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

When env variable is set, any config file will be ignored and the default settings will be used #4594

Merged
merged 12 commits into from Apr 8, 2024

Conversation

jim-taylor-business
Copy link
Contributor

@jim-taylor-business jim-taylor-business commented Apr 4, 2024

When LEMMY_INITIALIZE_WITH_DEFAULT_SETTINGS env variable is set, any config file will be ignored and the default settings will be used.

This is for a special no federation standalone mode of operation for use in CI pipelines or other testing or restricted execution environments, e.g. automated end to end testing of the Leptos Lemmy UI.

@Nutomic
Copy link
Member

Nutomic commented Apr 4, 2024

This doesnt make sense because the only mandatory config field is the domain name. And if thats missing, the default would be an empty string which would break federation.

@jim-taylor-business
Copy link
Contributor Author

jim-taylor-business commented Apr 4, 2024

totally agree

this idea is for a special mode of operation for use in end 2 end testing of the leptos UI, so there will be no federation

there is probably a better way to trigger this standalone/testing mode rather than defaulting to it when no config file is found

this is very much a draft idea, i only made this PR to see if it would break any current tests

thanks for considering it seriously though @Nutomic 😄

@dullbananas
Copy link
Collaborator

The default config should be enabled using a new CLI option and require the domain name to be set in another CLI option.

@jim-taylor-business
Copy link
Contributor Author

i don't think a command line/entry-point can be specified in a woodpecker CI service but environment variables would work

@jim-taylor-business
Copy link
Contributor Author

for more context please see:

LemmyNet/lemmy-ui-leptos#54

@jim-taylor-business
Copy link
Contributor Author

jim-taylor-business commented Apr 5, 2024

i have implemented a potential solution using an environment variable, the build is breaking due to network errors at the moment

@jim-taylor-business jim-taylor-business changed the title do not panic when no config file found use defaults When env variable is set, any config file will be ignored and the default settings will be used Apr 5, 2024
crates/utils/src/settings/mod.rs Outdated Show resolved Hide resolved
crates/utils/src/settings/mod.rs Outdated Show resolved Hide resolved
@jim-taylor-business
Copy link
Contributor Author

do you think this could go into 0.19.4 @dessalines @Nutomic ? would be awesome, but i understand if there's a feature lock now

@Nutomic Nutomic merged commit a14ebef into LemmyNet:main Apr 8, 2024
1 check passed
@Nutomic
Copy link
Member

Nutomic commented Apr 8, 2024

Yes it will be in 0.19.4

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.

None yet

5 participants