mastodon / chart

Helm chart for Mastodon deployment in Kubernetes
GNU Affero General Public License v3.0
154 stars 89 forks source link

How to generate vapid keys for this Chart? #29

Closed itz-Jana closed 1 year ago

itz-Jana commented 1 year ago

Hi all, I tried installing Mastodon using this chart and it requires me to set the vapid private_key and public_key. Now according to the normal installation instructions on the mastodon website one can do this using the "mastodon:webpush:generate_vapid_key" command, after installing the packages, which doesn't really work when deploying to Kubernetes with Helm. I would assume that it is possible to run the generate command inside one of the containers, but as I don't yet have a deep understanding of Mastodon I don't know which one. I think it would be great if on the README you could provide a one-shot "kubectl run ..." command that uses the correct container image and generates these keys, such that newcomers like me know how to generate them in the Helm setup :)

mschneider82 commented 1 year ago

i have the same issue

mschneider82 commented 1 year ago

To generate keys for VAPID_PRIVATE_KEY & VAPID_PUBLIC_KEY run:

docker run --rm -it -w /app/www --entrypoint rake lscr.io/linuxserver/mastodon mastodon:webpush:generate_vapid_key
deepy commented 1 year ago

Why not use the official docker image from tootsuite/mastodon?

mschneider82 commented 1 year ago

because i found this in an documentation, it worked well for me = problem solved. just wanted to share the solution. Feel free to modify it with the official image und add it to readme.

itz-Jana commented 1 year ago

Thanks a lot, that was enough information to get me onto the right path.

Here are the kubectl run commands to generate the secret and keys using the official image:

kubectl run -i --rm --attach mastodonkeys --image=tootsuite/mastodon --command -- bundle exec rake secret
kubectl run -i --rm --attach mastodonkeys --image=tootsuite/mastodon --command -- bundle exec rake mastodon:webpush:generate_vapid_key

Had to add "bundle exec", as otherwise I received this error:

Gem::LoadError: You have already activated rake 13.0.3, but your Gemfile requires rake 13.0.6. Prepending `bundle exec` to your command may solve this.

I think it would be great to add them to the README, such that people know how to generate them.