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

Add a setting to allow anonymous access to individual gists while still RequireLogin everywhere else #229

Merged
merged 7 commits into from
May 12, 2024

Conversation

lf-
Copy link
Contributor

@lf- lf- commented Feb 29, 2024

This is a middle ground between the existing setting "Require Login",
which requires login to do anything at all, and having it off, which
shows a public list of gists and more generally allows discovering info
about the users/gists of the instance without login.

The idea of this setting is that it is "require login" for everything
except individual gists.

Fixes #228.

lf- and others added 4 commits February 29, 2024 00:16
This is a middle ground between the existing setting "Require Login",
which requires login to do anything at all, and having it off, which
shows a public list of gists and more generally allows discovering info
about the users/gists of the instance without login.

The idea of this setting is that it is "require login" for everything
except individual gists.

Fixes thomiceli#228.
@@ -37,7 +39,9 @@ func runGitCommand(ch ssh.Channel, gitCmd string, key string, ip string) error {
return errors.New("gist not found")
}

requireLogin, err := db.GetSetting(db.SettingRequireLogin)
// FIXME: this seems to not actually work for clones, the auth process
Copy link
Owner

@thomiceli thomiceli May 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @lf- , sorry for the long delay

About this FIXME, does the bug occur when you enable RequireLogin and try to git clone another user gist ? Otherwise i'm not sure to encounter the bug or if it's something else

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this PR, but maybe related to the bug you're encountering, there is a wrong interaction with RequireLogin, when it's true, you can only pull/clone your own gists... which needs to be fixed ofc

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #280 if this is the bug you're encountering

Copy link
Owner

@thomiceli thomiceli May 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe if you encountered this (i try to understand the fixme)

5:03AM ERR SSH: Failed to handshake error="[ssh: no auth passed yet, unknown public key]"

That means the ssh key git uses has not been added for your user into your opengist instance. If that's the case try to add the key and try again

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC it doesn't even reach this code at all. I kind of forget the reproducer as well.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would assume it was the second bug i described..

@thomiceli
Copy link
Owner

Thanks for the PR

@thomiceli thomiceli merged commit 22052bd into thomiceli:master May 12, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to disable the discovery page without login while still making unlisted gists visible
2 participants