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

fix(server/(config): add config validation for session_secret #1820

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions server/ott-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,14 @@
return err(new Error("Invalid configuration."));
}

if (conf.get("session_secret").length < 80) {
log.error(
"session_secret must be at least 80 characters long. Use a password generator to generate a secure alphanumeric secret."
);
log.error("This can also be set with the SESSION_SECRET environment variable.");
return err(new Error("Invalid configuration."));
}

Check warning on line 530 in server/ott-config.ts

View check run for this annotation

Codecov / codecov/patch

server/ott-config.ts#L523-L530

Added lines #L523 - L530 were not covered by tests
return ok(undefined);
}

Expand Down
Loading