Skip to content

Add proper configuration#9

Merged
Bnyro merged 1 commit intolibre-tube:mainfrom
Jeidnx:configuration
Apr 29, 2026
Merged

Add proper configuration#9
Bnyro merged 1 commit intolibre-tube:mainfrom
Jeidnx:configuration

Conversation

@Jeidnx
Copy link
Copy Markdown

@Jeidnx Jeidnx commented Apr 27, 2026

Removed the dotenvor crate in favor of proper toml configuration, using the config crate. Existing behaviour is completely unchanged. I also updated the readme and compose examples.

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread src/config.rs
Comment thread src/config.rs Outdated
@Bnyro
Copy link
Copy Markdown
Member

Bnyro commented Apr 27, 2026

Great stuff, thanks 👍

@Jeidnx
Copy link
Copy Markdown
Author

Jeidnx commented Apr 29, 2026

Addressed all the comments. Thanks for the review!

Copy link
Copy Markdown
Member

@Bnyro Bnyro left a comment

Choose a reason for hiding this comment

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

Thanks!

Comment thread src/config.rs Outdated
Comment thread src/config.rs
#[derive(serde::Deserialize, Clone)]
pub struct Config {
#[serde(rename = "secret_key")]
pub secret: String,
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Is this even something that should be configuration? In my mind a secret key is more state than config. Also users can't really be trusted to put something with enough entropy here. Alternatively i would suggest generating a random key on first startup, and storing it in the database.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this even something that should be configuration? In my mind a secret key is more state than config.

I think it's possibly a security risk to store the security in the database, no?

If somebody gets read access to the database (somehow), they'd immediately also have access to the secret key, making it easier to compromise the app. Although one could argue that if an attacker gains unauthorized access to the database, it's over anyways.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Anyways, this is unrelated to this PR, so merging this anyways.

@Bnyro
Copy link
Copy Markdown
Member

Bnyro commented Apr 29, 2026

Fixed some oversights and renamed validate to validate_submitted_metadata diff.

Thanks again!

@Bnyro Bnyro merged commit 9abe56c into libre-tube:main Apr 29, 2026
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