Add Dockerfile #4905

Closed
pea wants to merge 0 commits from gitlab-mr-iid-1523 into develop
Member

Not entirely sure about using the config/ directory to store docker.exs, so let me know if you have any better suggestions for that.

Running this live on https://ptest.pea.sh behind traefik (cherry-picked onto master to avoid some develop-only bugs futzing with things, but I've confirmed both to be working) and it seems to be working perfectly.

Would complete task 1 of #1147

Not entirely sure about using the config/ directory to store docker.exs, so let me know if you have any better suggestions for that. Running this live on https://ptest.pea.sh behind traefik (cherry-picked onto master to avoid some develop-only bugs futzing with things, but I've confirmed both to be working) and it seems to be working perfectly. Would complete task 1 of #1147
Member

How to overwrite/extend the default configuration?

Also, why generate vapid_details instead of using env vars?

How to overwrite/extend the default configuration? Also, why generate `vapid_details` instead of using env vars?
Author
Member

You can extend the default configuration by mounting a volume at /var/pleroma/ (which you should anyway for persistent secrets) and creating a config.exs, it's sourced after everything in docker.exs so it can overwrite any information.

As for the vapid bit, that's a keypair and normally generated in the config when creating an instance without user input anyway, while I could have it provided via environmental variables I couldn't think of a usecase where that would be a useful utility where it wouldn't make more sense to just modify secret.exs

You can extend the default configuration by mounting a volume at /var/pleroma/ (which you should anyway for persistent secrets) and creating a config.exs, it's sourced after everything in docker.exs so it can overwrite any information. As for the vapid bit, that's a keypair and normally generated in the config when creating an instance without user input anyway, while I could have it provided via environmental variables I couldn't think of a usecase where that would be a useful utility where it wouldn't make more sense to just modify secret.exs
Author
Member

it's worth noting there's one or two defaults I'm thinking of changing but haven't gotten to writing a MR for yet, this includes dynamic configuration and possible open registration, gonna make some time to talk to some folks in the irc channel about it though

it's worth noting there's one or two defaults I'm thinking of changing but haven't gotten to writing a MR for yet, this includes dynamic configuration and possible open registration, gonna make some time to talk to some folks in the irc channel about it though
Member

@pea, thanks for replying!

Sounds like unless there is a volume it would generate a new vapid config every time I run the image so a config volume is a requirement?

My current setup doesn't use volumes: secrets are stored in env vars and uploads in S3. I like this simplicity and would be happy to keep it so.

Some fairly complex apps like GitLab and Sentry are configurable via env vars. Would be great if it'd be possible to setup Pleroma with env vars only too.

Perhaps it worth to make the config volume optional for the cases where env vars are not enough (which I imagine would be rare since the defaults are reasonable and would probably suit the most instances)?

@pea, thanks for replying! Sounds like unless there is a volume it would generate a new vapid config every time I run the image so a config volume is a requirement? My current setup doesn't use volumes: secrets are stored in env vars and uploads in S3. I like this simplicity and would be happy to keep it so. Some fairly complex apps like GitLab and Sentry are configurable via env vars. Would be great if it'd be possible to setup Pleroma with env vars only too. Perhaps it worth to make the config volume optional for the cases where env vars are not enough (which I imagine would be rare since the defaults are reasonable and would probably suit the most instances)?
Author
Member

@egor I can look into this, but my main reason for not allowing it is that it would be significantly obtuse to generate vapid keys outside of the BEAM and convert them to a nice format to pass into the BEAM. Off the top of my head, it probably involves something like generating a keypair using openssl, removing the header and footer from the keypair, and joining the lines I suppose? Nothing too horribly difficult to put in a oneliner, but the reality is that there's not really much documentation on the mapping between the keys generated by erlang and pem files other than actual functions that do so, so I wouldn't be surprised if it's fairly roundabout.

Unless there's something I'm missing, I'm not going to make it a goal right this moment, though, sorry. If you can find an easier way to do it than what I'm envisioning then please get back to me with that and I'll do what I can to turn it into an MR for you, but it just seems quite difficult for minimal gain from what I'm seeing.

@egor I can look into this, but my main reason for not allowing it is that it would be significantly obtuse to generate vapid keys outside of the BEAM and convert them to a nice format to pass into the BEAM. Off the top of my head, it probably involves something like generating a keypair using openssl, removing the header and footer from the keypair, and joining the lines I suppose? Nothing too horribly difficult to put in a oneliner, but the reality is that there's not really much documentation on the mapping between the keys generated by erlang and pem files other than actual functions that do so, so I wouldn't be surprised if it's fairly roundabout. Unless there's something I'm missing, I'm not going to make it a goal right this moment, though, sorry. If you can find an easier way to do it than what I'm envisioning then please get back to me with that and I'll do what I can to turn it into an MR for you, but it just seems quite difficult for minimal gain from what I'm seeing.

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 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
pleroma/pleroma!4905
No description provided.