fix: remove trailing whitespace from secrets read from secrets file #1209

Merged
nex merged 1 commit from charludo/continuwuity:ch/fix/newline-secrets into main 2025-12-13 16:08:32 +00:00
Contributor

After trying to debug my coturn setup for more hours than I care to admit yesterday evening, it turns out that the issue is that continuwuity reads the turn_secret from turn_secret_file, and then uses the file's entire contents as the secret.
Even using the exact same secrets file in coturn (through agenix, in my case) this leads to problems because both continuwuity and coturn happily start and use the key, but coturn strips the newline, and then the key supposedly shared between the two does not match.

While I could see the argument that this is user error, I don't agree with it; it's unexpected behavior to have to explicitly remove newlines from the secret.

This PR adds that trimming.

After trying to debug my coturn setup for more hours than I care to admit yesterday evening, it turns out that the issue is that continuwuity reads the `turn_secret` from `turn_secret_file`, and then uses the file's entire contents as the secret. Even using the exact same secrets file in coturn (through `agenix`, in my case) this leads to problems because both continuwuity and coturn happily start and use the key, but coturn strips the newline, and then the key supposedly shared between the two does not match. While I could see the argument that this is user error, I don't agree with it; it's unexpected behavior to have to explicitly remove newlines from the secret. This PR adds that trimming.
nex approved these changes 2025-12-02 11:29:01 +00:00
nex left a comment
Owner

LGTM, stripping trailing whitespace is usually an expected behaviour anyway

LGTM, stripping trailing whitespace is usually an expected behaviour anyway
Jade approved these changes 2025-12-03 01:44:17 +00:00
Jade left a comment
Owner

LGTM, probably something to note in the changelog as it's technically breaking.

LGTM, probably something to note in the changelog as it's technically breaking.
Author
Contributor

@Jade wrote in #1209 (comment):

LGTM, probably something to note in the changelog as it's technically breaking.

Sorry, I'm new here - do I need to do anything to make that happen, or is it just a label on the PR or something?

@Jade wrote in https://forgejo.ellis.link/continuwuation/continuwuity/pulls/1209#issuecomment-21988: > LGTM, probably something to note in the changelog as it's technically breaking. Sorry, I'm new here - do I need to do anything to make that happen, or is it just a label on the PR or something?
Owner

Nope, we just have to come back to this when we're writing stuff up

Nope, we just have to come back to this when we're writing stuff up
ginger added this to the 0.5.0 milestone 2025-12-08 18:26:56 +00:00
Owner

This good to merge? @Jade

This good to merge? @Jade
Owner

I'll take that as a yes

I'll take that as a yes
nex force-pushed ch/fix/newline-secrets from 05bfa1a7c2
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m49s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 12m24s
to 862684af28
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Documentation / Build and Deploy Documentation (push) Successful in 1m15s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m15s
Checks / Prek / Pre-commit & Formatting (push) Successful in 1m56s
Release Docker Image / Build linux-arm64 (release) (push) Successful in 7m28s
Release Docker Image / Build linux-amd64 (release) (push) Successful in 7m40s
Release Docker Image / Create Multi-arch Release Manifest (push) Failing after 17s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 18m55s
Checks / Prek / Clippy and Cargo Tests (push) Successful in 18m0s
Release Docker Image / Build linux-amd64 (max-perf) (push) Successful in 13m37s
Release Docker Image / Build linux-arm64 (max-perf) (push) Successful in 13m37s
Release Docker Image / Create Max-Perf Manifest (push) Failing after 11s
2025-12-13 16:07:54 +00:00
Compare
nex merged commit 862684af28 into main 2025-12-13 16:08:32 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
continuwuation/continuwuity!1209
No description provided.