Configuring S3 Manager with Garage

From Asgardius Wiki (English)
Revision as of 22:54, 18 October 2023 by Asgardius (talk | contribs) (First Revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

In case of using Garage it is necessary to set the region as us-east-1 inside the /etc/garage.toml configuration file as follows

[s3_api] s3_region = "us-east-1"

In order to use the PDF reader it will be necessary to establish a CORS policy that allows access to chosen pdf.js endpoint. This can be done adding required headers to web server used as reverse proxy. If you are using Caddy your caddyfile will look like the following

garage.example.com { reverse_proxy localhost:3900 @origin header Origin * header @origin Access-Control-Allow-Origin "*" header @origin Access-Control-Allow-Methods "GET" }

If you are using nginx your site config file will look like the following

server {

   server_name garage.example.com;
 location / {
   proxy_pass http://127.0.0.1:3900;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
   proxy_set_header Host $host;
   add_header 'Access-Control-Allow-Origin' '*';
   add_header 'Access-Control-Allow-Methods' 'GET';
   # Disable buffering to a temporary file.
   proxy_max_temp_file_size 0;
   client_max_body_size 0;
 }
   listen 443 ssl; # managed by Certbot
   ssl_certificate /etc/letsencrypt/live/garage.example.com/fullchain.pem; # managed by Certbot
   ssl_certificate_key /etc/letsencrypt/live/garage.example.com/privkey.pem; # managed by Certbot
   include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
   ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}