Configure/deploy HTTP upload service for Kosmos Chat/XMPP #245
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "feature/http_upload_service"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.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
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.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
LGTM!