Configure/deploy HTTP upload service for Kosmos Chat/XMPP #245

Merged
greg merged 7 commits from feature/http_upload_service into master 2020-11-25 09:46:48 +00:00
Owner

In order to be able to run multiple ejabberd nodes, we need to have user uploads go to a central external service, instead of each node directly. This configures/deploys a compatible upload service on https://uploads.kosmos.chat.

It is based on a Perl module for Nginx, which implements XEP 0363.

It contains an additional nginx install recipe for a setup with the HTTP Perl Module, and removes the dependency on the default recipe from the certbot recipe. This may break certbot resource usage in one or more unrelated cookbooks, in which case you can just include kosmos-nginx right before the certbot resource is used.

In order to be able to run multiple ejabberd nodes, we need to have user uploads go to a central external service, instead of each node directly. This configures/deploys a compatible upload service on https://uploads.kosmos.chat. It is based on a [Perl module for Nginx](https://github.com/weiss/ngx_http_upload), which implements [XEP 0363](https://xmpp.org/extensions/xep-0363.html). It contains an additional nginx install recipe for a setup with the HTTP Perl Module, and removes the dependency on the default recipe from the certbot recipe. This may break certbot resource usage in one or more unrelated cookbooks, in which case you can just include `kosmos-nginx` right before the certbot resource is used.
raucao added the
kredits-2
label 2020-11-23 16:44:57 +00:00
Author
Owner

I tried it with the new cluster node (after fixing iptables being weird on draco after the recent reboot), and when I got it working I manually added the config on andromeda, which we cannot provision with chef anymore.

All uploads now go to uploads-1 on draco! Here's my first production test:

https://uploads.kosmos.chat/791c7ed148e453f934ef56e1a4acb79a30845f0f/8SBtwY2eToAhPIaAy0IKaWUTNVH0oBwNh38k8crs/chilis.jpeg

I tried it with the new cluster node (after fixing iptables being weird on draco after the recent reboot), and when I got it working I manually added the config on andromeda, which we cannot provision with chef anymore. All uploads now go to `uploads-1` on draco! Here's my first production test: https://uploads.kosmos.chat/791c7ed148e453f934ef56e1a4acb79a30845f0f/8SBtwY2eToAhPIaAy0IKaWUTNVH0oBwNh38k8crs/chilis.jpeg
Author
Owner

Ugh, that's dumb: ejabberd accepted my config with reload_config and then just failed when I removed the second cluster node, as well as when actually restarting it. Saying it cannot configure http uploads without @host variable when using multiple vhosts. :/

There's an option to configure subdirectory levels in upload.pm, but that'll have to wait until tomorrow.

Ugh, that's dumb: ejabberd accepted my config with `reload_config` and then just failed when I removed the second cluster node, as well as when actually restarting it. Saying it cannot configure http uploads without `@host` variable when using multiple vhosts. :/ There's an option to configure subdirectory levels in `upload.pm`, but that'll have to wait until tomorrow.
Author
Owner

I have solved the last remaining issue, by moving the upload config to the respective vhosts config files and configuring a subdirectory (just hash of respective user address domain).

Here's my successful production test: https://uploads.kosmos.chat/8af2c77/791c7ed148e453f934ef56e1a4acb79a30845f0f/iMNpkgBBCLOpmQoHX5TqhQKUbZG4gHHDlPm0cva2/japan-map-in-english.jpeg

I have solved the last remaining issue, by moving the upload config to the respective vhosts config files and configuring a subdirectory (just hash of respective user address domain). Here's my successful production test: https://uploads.kosmos.chat/8af2c77/791c7ed148e453f934ef56e1a4acb79a30845f0f/iMNpkgBBCLOpmQoHX5TqhQKUbZG4gHHDlPm0cva2/japan-map-in-english.jpeg
raucao requested review from greg 2020-11-24 14:34:24 +00:00
greg approved these changes 2020-11-25 09:46:23 +00:00
greg left a comment
Owner

LGTM!

LGTM!
greg merged commit 3da883864b into master 2020-11-25 09:46:47 +00:00
raucao deleted branch feature/http_upload_service 2020-11-25 11:43:44 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kosmos/chef#245
No description provided.