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

Create configs in a folder #407

Merged
merged 2 commits into from
Dec 24, 2024
Merged

Create configs in a folder #407

merged 2 commits into from
Dec 24, 2024

Conversation

Snowiiii
Copy link
Member

@Snowiiii Snowiiii commented Dec 24, 2024

Description

Creates configuration files in a separate folder which then can be in a read-only mode.
Addresses #377

Testing

  • Linux: Changed config values and saw that the server detected the new values

  • Docker

Checklist

Things need to be done before this Pull Request can be merged.

  • Code is well-formatted and adheres to project style guidelines: cargo fmt
  • Code does not produce any clippy warnings: cargo clippy
  • All unit tests pass: cargo test
  • I added new unit tests, so other people don't accidentally break my code by changing other parts of the codebase. How?

@@ -126,26 +128,33 @@ trait LoadConfiguration {
where
Self: Sized + Default + Serialize + DeserializeOwned,
{
let path = Self::get_path();
let exe_path = env::current_exe().unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

In docker, the config folder is created in /bin, something is wrong!
It should not use current_exe as base path, instead use CWD see env::current_dir()

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense, did not saw that. Can you may test it again with the latest change

@Commandcracker
Copy link
Contributor

Commandcracker commented Dec 24, 2024

Maybe we should make it possible to change the path via CLI args or/and env vars.
see java -jar .\paper.jar --help (--plugins --config etc.)

@Commandcracker
Copy link
Contributor

Now it works how it should be, config folder inside data volume

@Snowiiii Snowiiii merged commit f5c20fb into master Dec 24, 2024
18 checks passed
@Snowiiii Snowiiii deleted the config-folder branch December 25, 2024 14:12
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.

2 participants