Skip to content

Please revert gidelines to create repo to use ssh origin link instead of http #19205

Closed
@chmike

Description

@chmike

Description

I have just installed the latest version of gitea

Version: 1.16.5 built with GNU Make 4.1, go1.18 : bindata, sqlite, sqlite_unlock_notify

The guide lines to create the repository shown just after the repository has been created in gitea show now the HTTPS remote url. It was previously showing the SSH url.

This is inconvenient when we use SSH as the default access. Is it possible to revert or display the alternative with SSH ?
It is convenient to copy past in the git command. Otherwise I need construct the command by getting the SSH path.

With SSH I can use public key authentication and don't need to give my password. This is also needed when using a smart shell prompt that shows git status relative to origin.

Screenshots

touch README.md
git init

git add README.md
git commit -m "first commit"
git remote add origin https://gitea.xxx.xxx/xxx/demo.git
git push -u origin master

Gitea Version

1.16.5

Can you reproduce the bug on the Gitea demo site?

No

Operating System

Debian buster (release 10)

Browser Version

Not relevant

Activity

zeripath

zeripath commented on Mar 24, 2022

@zeripath
Contributor

Honestly I give up.

There seems to be no possible way of solving this page to everyone's satisfaction.

gitea embedded extract repo/empty.tmpl and change the template.

However if you click the ssh button once then:

const isSSH = tmplData.httpsDisabled || localStorage.getItem('repo-clone-protocol') === 'ssh';

localStorage.setItem('repo-clone-protocol', 'ssh');

localStorage.setItem('repo-clone-protocol', 'https');

Should mean it becomes the default for you all the time.

wxiaoguang

wxiaoguang commented on Mar 25, 2022

@wxiaoguang
Contributor

And I found a bug in the empty page, caused by last PR.

I will propose a refactoring about clone buttons to make them clear.

wxiaoguang

wxiaoguang commented on Mar 25, 2022

@wxiaoguang
Contributor

There is a JS error when visiting an empty repo page, which causes the clone-urls can not be updated by local storage.

Fix PR:

wxiaoguang

wxiaoguang commented on Mar 25, 2022

@wxiaoguang
Contributor

And the fix for 1.16

Without the fix, even if user have chosen ssh, on the new empty repo page, the URL is still https, because the JS can not run correctly.

added this to the 1.16.6 milestone on Mar 25, 2022
wxiaoguang

wxiaoguang commented on Mar 29, 2022

@wxiaoguang
Contributor

@zeripath we can use this PR to find JS errors as early as possible.

locked and limited conversation to collaborators on Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic/uiChange the appearance of the Gitea UItype/bug

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      Participants

      @chmike@zeripath@wxiaoguang@6543

      Issue actions

        Please revert gidelines to create repo to use ssh origin link instead of http · Issue #19205 · go-gitea/gitea