-
Notifications
You must be signed in to change notification settings - Fork 54
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
Running error!!![frontend] missing field origin
#152
Comments
Hi, [frontend.auth]
# You need to replace this by the origin of the endpoint with which users will access your Alexandrie instance.
# This is needed for creating the correct `redirect_uri` for OAuth 2 authentication flows (currently: GitHub/GitLab).
# If you are not using GitHub or GitLab to authenticate, then this value will never be used and can be set to anything.
origin = "http://localhost:3000" This should resolve your issue, feel free to comment here again if the error persists or if you encounter another configuration-related error. |
@Hirevo Hi,Please tell me, how to make it necessary to log in to see the content, otherwise there is only one login page? Thank you!😁 |
While what you're asking for is not possible as of today, this is a feature that would indeed be useful, and interest for exactly this has already been expressed in #93. I think I should definitely work on the ability to make the frontend inaccessible to logged-out users. But keep in mind that Cargo itself does not send authorization tokens for all API endpoints (like the crate download and search endpoints that cargo uses in This means that logged-out users, despite being unable to access the frontend, would still be able to download or search the crates, if they know which endpoints to hit. This was the reason why I haven't implemented it to be fully private in my initial iteration of Alexandrie. The Cargo team has accepted an RFC (rust-lang/rfcs#3139) proposing to add a new While the RFC has been accepted and the implementation work in Cargo has been done, the feature is still unstable (tracking issue: rust-lang/cargo#10474), and therefore only usable using Nightly Rust. Still, I think this should not block the work to make atleast the frontend private, and possibly start working on the foundations in preparation of the upcoming stabilization of that Cargo feature. I hope that, in the time being, the absence of this feature is not too much of an inconvenience. (Since the support of this feature is unrelated to this GitHub issue, I'll be closing it through the merge of PR #155) |
@Hirevo |
alexandrie.toml :
[general]
bind_address = "127.0.0.1:3000"
[frontend]
enabled = true
title = "Alexandrie"
description = "An alternative crate registry for Cargo, the Rust package manager."
links = [
{ name = "Github repository", href = "https://github.com/Hirevo/alexandrie" },
{ name = "User documentation", href = "https://hirevo.github.io/alexandrie" },
]
[frontend.sessions]
cookie_name = "alexandrie.sid"
secret = "YOU_REALLY_SHOULD_CHANGE_THIS_BEFORE_DEPLOYING"
[frontend.assets]
path = "assets"
[frontend.templates]
path = "templates"
[frontend.auth.local]
enabled = true
allow_registration = true
[frontend.auth.github]
enabled = false
client_id = "GITHUB_OAUTH_CLIENT_ID"
client_secret = "GITHUB_OAUTH_CLIENT_SECRET"
allowed_organizations = [
# Using this organization does not requires any specific team membership.
{ name = "ORG_NAME_1" },
# But using this one does requires membership in one of specified teams.
{ name = "ORG_NAME_2", allowed_teams = ["TEAM_NAME"] },
]
allow_registration = true
[frontend.auth.gitlab]
enabled = false
origin = "https://gitlab.com"
client_id = "GITLAB_OAUTH_CLIENT_ID"
client_secret = "GITLAB_OAUTH_CLIENT_SECRET"
allowed_groups = [
"GROUP_1",
"GROUP_2",
]
allow_registration = true
[database]
url = "alexandrie.db"
[index]
type = "command-line"
path = "crate-index"
[storage]
type = "disk"
path = "crate-storage"
[syntect.syntaxes]
type = "dump"
path = "syntect/dumps/syntaxes.dump"
[syntect.themes]
type = "dump"
path = "syntect/dumps/themes.dump"
theme_name = "frontier-contrast"
Execute a command:
./target/debug/alexandrie -c alexandrie.toml
Error occurs:
TOML error: TOML parse error at line 4, column 1
|
4 | [frontend]
| ^^^^^^^^^^
missing field
origin
How should I change it?
The text was updated successfully, but these errors were encountered: