-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some documentation about the proxy setup
Thanks to https://docs.photoprism.app/getting-started/proxies/traefik/. Most of the content come from here.
- Loading branch information
Showing
9 changed files
with
234 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# How to install duckcloud | ||
|
||
The installation process require several steps: | ||
|
||
- Install the binary | ||
- [Setup a reverse proxy](./proxies/why-use-a-proxy.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Using Apache 2.4 as Reverse Proxy | ||
|
||
!!! tldr "" | ||
Should you experience problems with Apache, we recommend that you ask the Apache community for advice, as we cannot provide support for third-party software and services. | ||
|
||
!!! example | ||
``` | ||
ProxyPass /api/v1/ws ws://duckcloud.fr:2342/api/v1/ws | ||
ProxyPassReverse /api/v1/ws ws://duckcloud.fr:2342/api/v1/ws | ||
ProxyPass / http://duckcloud:2342/ | ||
ProxyPassReverse / http://duckcloud:2342/ | ||
ProxyRequests off | ||
``` | ||
|
||
The [official documentation](https://httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.html) explains in detail, how to configure Apache Web Server 2.4 to reverse proxy WebSockets. | ||
|
||
!!! example "" | ||
**Help improve these docs!** You can contribute by clicking :material-file-edit-outline: to send a pull request with your changes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Using Caddy 1 as Reverse Proxy | ||
|
||
!!! tldr "" | ||
Should you experience problems with Caddy, we recommend that you ask the Caddy community for advice, as we cannot provide support for third-party software and services. | ||
|
||
For Duckcloud to work properly, you need to enable websockets and transparent proxying: | ||
|
||
!!! example | ||
``` | ||
example.com { | ||
proxy / duckcloud:2342 { | ||
websocket | ||
transparent | ||
} | ||
} | ||
``` | ||
|
||
Please refer to the [official documentation](https://caddyserver.com/v1/docs/websocket) | ||
for further details. | ||
|
||
!!! example "" | ||
**Help improve these docs!** You can contribute by clicking :material-file-edit-outline: to send a pull request with your changes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Using Caddy 2 as Reverse Proxy | ||
|
||
!!! tldr "" | ||
Should you experience problems with Caddy, we recommend that you ask the Caddy community for advice, as we cannot provide support for third-party software and services. | ||
|
||
WebSocket proxying automatically works in Caddy 2. There is no need to enable this as necessary for Caddy 1, Apache | ||
and NGINX. In addition, Caddy 2 may [automatically create](https://caddyserver.com/docs/caddyfile/directives/tls) | ||
and update [Let's Encrypt](https://letsencrypt.org/) HTTPS certificates. | ||
|
||
!!! example | ||
``` | ||
example.com { | ||
reverse_proxy duckcloud:2342 | ||
} | ||
``` | ||
|
||
Please refer to the [official documentation](https://caddyserver.com/docs/v2-upgrade#proxy) | ||
for further details. | ||
|
||
!!! example "" | ||
**Help improve these docs!** You can contribute by clicking :material-file-edit-outline: to send a pull request with your changes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Using HAPROXY as Reverse Proxy | ||
|
||
!!! tldr "" | ||
Should you experience problems with Haproxy, we recommend that you ask the Haproxy community for advice, as we cannot provide support for third-party software and services. | ||
|
||
```bigquery | ||
defaults | ||
#Defaults used in frontend and backends | ||
#Defined here to avoid repitition | ||
#Can be overwritten in frontends and/or backends | ||
log global | ||
option logasap | ||
mode http | ||
timeout connect 30000ms | ||
timeout client 30000ms | ||
timeout server 30000ms | ||
timeout tunnel 120000ms | ||
timeout queue 5000ms | ||
########################################################## | ||
#Frontend config | ||
frontend fe-duckcloud | ||
#'photo' is the name of the subdomain | ||
#TLS certs should be referenced here, maybe created by dehydrated, certbot, ... | ||
bind *:443 ssl crt /etc/ssl/localcerts/wildcard.example.com.pem | ||
#SNI-Detection | ||
#Can be removed, if not needed | ||
acl sni_photo hdr(host) -i photo.example.com | ||
#Use Backend if domain (acl is set) detected | ||
use_backend be-duckcloud if sni_photo | ||
#Every unflagged request goes here, may target to another backend as well | ||
default_backend be-duckcloud | ||
########################################################## | ||
#Backend config | ||
#be-duckcloud is the name of the backend referenced in frontend | ||
backend be-duckcloud | ||
retries 3 | ||
option forwardfor | ||
no option httpclose | ||
#Local Duckcloud-Instance | ||
server photo 127.0.0.1:2342 | ||
``` | ||
|
||
!!! example "" | ||
**Help improve these docs!** You can contribute by clicking :material-file-edit-outline: to send a pull request with your changes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Using NGINX as Reverse Proxy | ||
|
||
!!! danger "Getting Support" | ||
Since [NGINX](https://www.nginx.com/) is notoriously difficult to configure, we unfortunately can't offer you support in case something isn't working. If you have NGINX related issues such as failed uploads or connection errors, we recommend that you [ask the NGINX community for advice](https://www.nginx.com/support/) or try to [use Caddy 2 as a reverse proxy](caddy-2.md), as it is easier to configure and much more convenient to work with overall. | ||
|
||
This [tutorial](https://www.serverlab.ca/tutorials/linux/web-servers-linux/how-to-configure-nginx-for-websockets/) explains, how to configure NGINX WebSocket connections between your client and backend services. | ||
|
||
!!! example | ||
``` | ||
http { | ||
server { | ||
listen 80 ssl; | ||
listen [::]:80 ssl; | ||
server_name example.com; | ||
client_max_body_size 500M; | ||
|
||
# With SSL via Let's Encrypt | ||
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot | ||
ssl_certificate_key /etc/letsencrypt/live/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 | ||
|
||
location / { | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header Host $host; | ||
|
||
proxy_pass http://duckcloud:2342; | ||
|
||
proxy_buffering off; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "upgrade"; | ||
client_max_body_size 500M; | ||
} | ||
} | ||
} | ||
``` | ||
|
||
At the very least you will need to adapt `server_name` and the `ssl_certificate`/`ssl_certificate_key` paths to match your setup. Please refer to their [official documentation](https://nginx.org/en/docs/) for further details. | ||
|
||
[View "Pitfalls and Common Mistakes" ›](https://www.nginx.com/nginx-wiki/build/dirhtml/start/topics/tutorials/config_pitfalls/) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Why use a Proxy? # | ||
|
||
If you install Duckcloud on a public server outside your home network, **always run it behind a secure | ||
HTTPS reverse proxy**. Your files and passwords will otherwise be transmitted in clear text and can be intercepted | ||
by anyone, including your provider, hackers, and governments. Backup tools and file sync apps may refuse to | ||
connect as well. | ||
|
||
If you don't already have a one setup we advice you to try [Caddy 2](./caddy-2.md). This proxy is the easiest to setup and | ||
handle [automatically create](https://caddyserver.com/docs/caddyfile/directives/tls) | ||
and update [Let's Encrypt](https://letsencrypt.org/) HTTPS certificates. | ||
|
||
!!! example "" | ||
**Help improve these docs!** You can contribute by clicking :material-file-edit-outline: to send a pull request with your changes. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters