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

bug: pushd error: VAPID_PRIVATE_KEY: InvalidPadding #122

Closed
VladlenAfonin opened this issue Jan 6, 2025 · 7 comments
Closed

bug: pushd error: VAPID_PRIVATE_KEY: InvalidPadding #122

VladlenAfonin opened this issue Jan 6, 2025 · 7 comments
Labels
bug Something isn't working

Comments

@VladlenAfonin
Copy link

VladlenAfonin commented Jan 6, 2025

What happened?

Error description

When I run docker compose up -d I get the following in the pushd logs:

pushd-1          | thread 'main' panicked at crates/daemons/pushd/src/consumers/outbound/vapid.rs:33:14:
pushd-1          | valid `VAPID_PRIVATE_KEY`: InvalidPadding
pushd-1          | note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

As far as I understand, the issue is related to vapid private key: when I change it in the Revolt.toml, the error message also changes. The keys are generated using the ./generate_config.sh script.

Environment

OS: Debian 12
Docker version 27.4.1, build b9d17ea
Docker Compose version v2.32.1
Arch: amd64 (x86_64)

Maybe important: I don't use domain names. I only use IP address.

Steps to reproduce

Following README.md:

  1. Clone the repository.
  2. Generate keys using ./generate_config.sh 123.123.123.123 (my IP address is different).
  3. Run docker compose up -d.

Expected

All the services start and the pages https://123.123.123.123/* are accessible.

Actual behavior

pushd service does not load and keeps restarting with the error message presented above.

UPD 2025-01-08

I have also tried with domain name and using Ubuntu 24.04 as in the instructions. The error is the same,

@VladlenAfonin VladlenAfonin added the bug Something isn't working label Jan 6, 2025
@github-project-automation github-project-automation bot moved this to 🆕 Untriaged in Revolt Project Jan 6, 2025
@Rexogamer
Copy link
Contributor

Rexogamer commented Jan 8, 2025

the decoder requires that the generated key has no padding. I suspect that the generated keys have padding - we've seen this issue on our end at Upryzing and, taking a look, our key (which was generated with the script) does have padding. I'll test removing it in a bit and see if that fixes the issue

@Rexogamer
Copy link
Contributor

Rexogamer commented Jan 8, 2025

yup. removing the padding fixes this issue. now getting a different error which is with our configuration, but the original issue has gone

@Rexogamer
Copy link
Contributor

I'm assuming the fix is to remove the padding when generating the keys so cc @insertish

@Akurosia
Copy link

Akurosia commented Jan 9, 2025

Can you give an example how you fixed it in the script?
i am currently running into the same issue.

@Rexogamer
Copy link
Contributor

I didn't tweak the script, but in our Revolt.toml I tweaked the private key to remove the equals signs (=) at the end. equals signs at the end of base64 strings are padding, which the code requires to be absent.

hakt0r added a commit to hakt0r/self-hosted that referenced this issue Jan 28, 2025
generate_config.sh would generate keys with base64 = padding which would crash pushd
hakt0r added a commit to hakt0r/self-hosted that referenced this issue Jan 28, 2025
./generate_config.sh was not stripping base64 padding (=) which would lead to pushd crashing
@hakt0r
Copy link
Contributor

hakt0r commented Jan 28, 2025

my pr should automate this, sorry for the brevity, i still encounter other issues

@DeclanChidlow
Copy link
Member

Closing as should be resolved by #126 which is now merged.

@github-project-automation github-project-automation bot moved this from 🆕 Untriaged to ✅ Done in Revolt Project Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

5 participants