-
Notifications
You must be signed in to change notification settings - Fork 140
Description
hi i'm having issues configuring mod_s3_upload
I was able to get it to install ok (i think? it didn't error when I installed it) but when I try to configure it and restart ejabberd, it crashes. The error log says:
2023-07-12 15:25:10.283073-04:00 [critical] <0.174.0>@ejabberd_app:start/2:72 Failed to start ejabberd application: Failed to read YAML file '/opt/ejabberd/conf/ejabberd.yml': Syntax error on line 199 at position 3: did not find expected key
here is an excerpt from my yaml
mod_s3_upload:
access_key_id: censored
access_key_secret: censored
region: us-east-1
bucket_url: todiy-files.us-east-1.linodeobjects.com
max_size: 25000000
put_ttl: 600
set_public: true
service_name: 'Linode'
access: local
hosts:
- files.torontodiy.xyz #this is line 199
I haven't really done anything else to configure file uploads, this is a relatively fresh install. Currently on the same box I'm running a mastodon server, which is using an S3 bucket, the same one i'm trying to get ejabberd to use. It is using the same subdomain of files.
here is the nginx config
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name files.torontodiy.xyz;
root /var/www/html;
keepalive_timeout 30;
ssl_certificate /etc/letsencrypt/live/torontodiy.xyz/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/torontodiy.xyz/privkey.pem; # managed by Certbot
location = / {
index index.html;
}
location / {
try_files $uri @s3;
}
set $s3_backend 'https://todiy-files.us-east-1.linodeobjects.com/todiy-files';
location @s3 {
limit_except GET {
deny all;
}
resolver 8.8.8.8;
proxy_set_header Host todiy-files.us-east-1.linodeobjects.com;
proxy_set_header Connection '';
proxy_set_header Authorization '';
proxy_hide_header Set-Cookie;
proxy_hide_header 'Access-Control-Allow-Origin';
proxy_hide_header 'Access-Control-Allow-Methods';
proxy_hide_header 'Access-Control-Allow-Headers';
proxy_hide_header x-amz-id-2;
proxy_hide_header x-amz-request-id;
proxy_hide_header x-amz-meta-server-side-encryption;
proxy_hide_header x-amz-server-side-encryption;
proxy_hide_header x-amz-bucket-region;
proxy_hide_header x-amzn-requestid;
proxy_ignore_headers Set-Cookie;
proxy_pass $s3_backend$uri;
proxy_intercept_errors off;
proxy_cache CACHE;
proxy_cache_valid 200 48h;
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
proxy_cache_lock on;
expires 1y;
add_header Cache-Control public;
add_header 'Access-Control-Allow-Origin' '*';
add_header X-Cache-Status $upstream_cache_status;
}
}
if you need anything else from me please let me know. I'm new to Ejabberd, XMPP, Nginx, and being a sysadmin in general. I assume my issue is probably pretty small, yet still catastrophic. Appreciate the help : )