Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
chmike opened this issue Mar 24, 2022 · 5 comments · Fixed by #19209
Closed

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

chmike opened this issue Mar 24, 2022 · 5 comments · Fixed by #19209
Labels
topic/ui Change the appearance of the Gitea UI type/bug
Milestone

Comments

@chmike
Copy link

chmike commented Mar 24, 2022

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

@chmike chmike added type/bug topic/ui Change the appearance of the Gitea UI labels Mar 24, 2022
@zeripath
Copy link
Contributor

zeripath commented Mar 24, 2022

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.

@zeripath zeripath reopened this Mar 24, 2022
@wxiaoguang
Copy link
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
Copy link
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
Copy link
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.

@wxiaoguang
Copy link
Contributor

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

@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/ui Change the appearance of the Gitea UI type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants