From 585136beadf24e5949bb89c0a8f5540af1826063 Mon Sep 17 00:00:00 2001 From: Kio <kio.thedev@gmail.com> Date: Wed, 4 Dec 2024 15:34:43 -0500 Subject: [PATCH 1/4] Add more configurations for reverse proxies --- content/en/docs/install/fresh.md | 70 ++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/content/en/docs/install/fresh.md b/content/en/docs/install/fresh.md index 89ed076..cea4957 100644 --- a/content/en/docs/install/fresh.md +++ b/content/en/docs/install/fresh.md @@ -263,6 +263,76 @@ running. See [Misskey's instructions](https://misskey-hub.net/en/docs/admin/nginx.html) +### HAProxy +> Heads up - Sharkey doesn't officially support HAProxy, but you can still find community support for it within the discord. + +Add these lines to your frontend: + +```haproxy + acl sharkey hdr(Host) -i myshark.ey + use_backend sharkey-be if sharkey +``` + +And these to your backend: +```haproxy + backend sharkey-be + http-reuse aggressive + option forwarded + option forwardfor + mode http + option redispatch + timeout queue 15s + http-request set-header X-Real-IP %[src] + http-request set-header X-Forwarded-Proto https + server sharkey-server <ip>:3000 check observe layer7 error-limit 10 on-error mark-down inter 2s rise 10 slowstart 10s +``` +Check out Latte Macchiato's [guide](https://blog.lattemacchiato.dev/how-to-make-your-fedi-instance-performance-not-suck/) to making your fedi instance suck for more optimization tricks with HAProxy. + +### Traefik +> Heads up - Sharkey doesn't officially support Traefik, but you can still find community support for it within the discord. + + +Our configs will make the assumptions that sharkey is listening to port `3000`, your https(443) entrypoint is called ``webSecure`` and that you have a certificate resolver ready called ``myResolver``. Change these as necessary. Remember to change ``myshark.ey`` to your instances domain name. + +#### Docker Labels +Append these labels to your sharkey service in docker-compose.yml: +```yml + ...[your docker config]... + labels: + - "traefik.http.routers.sharkey.rule=Host(`myShark.ey`)" + - "traefik.http.services.sharkey.loadbalancer.server.port=3000" + - "traefik.http.routers.sharkey.tls=true" + - "traefik.http.routers.sharkey.tls.certresolver=myResolver" + ...[your docker config]... +``` +#### Dynamic Config +insert this into your dynamic config: +```yml +http: + routers: + sharkey: + entryPoints: ["web", "webSecure"] + rule: "Host(`myshark.ey`)" + service: "sharkey-be" + tls: + certresolver: myResolver + + services: + sharkey-be: + loadBalancer: + servers: + - url: "http://<ip>:3000" +``` + +### Caddy +> Heads up - Sharkey doesn't officially support Caddy, but you can still find community support for it within the discord. + +In your Caddyfile, inset the following instructions. Note that ``<>`` denotes a required option, and ``[]`` is optional to have in your config. +```Caddyfile +<myshark.ey> +reverse_proxy [ip]:3000 +``` + ## Update Sharkey ### With Docker -- GitLab From 7040fb64fc9fd3c599cfaff49fd171c43a2af32b Mon Sep 17 00:00:00 2001 From: Kio <kio.thedev@gmail.com> Date: Wed, 4 Dec 2024 15:37:12 -0500 Subject: [PATCH 2/4] Fix linting issues --- content/en/docs/install/fresh.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/content/en/docs/install/fresh.md b/content/en/docs/install/fresh.md index cea4957..a0faa20 100644 --- a/content/en/docs/install/fresh.md +++ b/content/en/docs/install/fresh.md @@ -274,6 +274,7 @@ Add these lines to your frontend: ``` And these to your backend: + ```haproxy backend sharkey-be http-reuse aggressive @@ -286,16 +287,17 @@ And these to your backend: http-request set-header X-Forwarded-Proto https server sharkey-server <ip>:3000 check observe layer7 error-limit 10 on-error mark-down inter 2s rise 10 slowstart 10s ``` + Check out Latte Macchiato's [guide](https://blog.lattemacchiato.dev/how-to-make-your-fedi-instance-performance-not-suck/) to making your fedi instance suck for more optimization tricks with HAProxy. ### Traefik > Heads up - Sharkey doesn't officially support Traefik, but you can still find community support for it within the discord. - Our configs will make the assumptions that sharkey is listening to port `3000`, your https(443) entrypoint is called ``webSecure`` and that you have a certificate resolver ready called ``myResolver``. Change these as necessary. Remember to change ``myshark.ey`` to your instances domain name. #### Docker Labels Append these labels to your sharkey service in docker-compose.yml: + ```yml ...[your docker config]... labels: @@ -305,8 +307,10 @@ Append these labels to your sharkey service in docker-compose.yml: - "traefik.http.routers.sharkey.tls.certresolver=myResolver" ...[your docker config]... ``` + #### Dynamic Config insert this into your dynamic config: + ```yml http: routers: -- GitLab From b94ad704f2954a95ee27c7338ed736ac02c46b75 Mon Sep 17 00:00:00 2001 From: Kio <kio.thedev@gmail.com> Date: Wed, 4 Dec 2024 15:37:12 -0500 Subject: [PATCH 3/4] fix missed lint --- content/en/docs/install/fresh.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/content/en/docs/install/fresh.md b/content/en/docs/install/fresh.md index cea4957..e95948a 100644 --- a/content/en/docs/install/fresh.md +++ b/content/en/docs/install/fresh.md @@ -274,6 +274,7 @@ Add these lines to your frontend: ``` And these to your backend: + ```haproxy backend sharkey-be http-reuse aggressive @@ -286,16 +287,17 @@ And these to your backend: http-request set-header X-Forwarded-Proto https server sharkey-server <ip>:3000 check observe layer7 error-limit 10 on-error mark-down inter 2s rise 10 slowstart 10s ``` + Check out Latte Macchiato's [guide](https://blog.lattemacchiato.dev/how-to-make-your-fedi-instance-performance-not-suck/) to making your fedi instance suck for more optimization tricks with HAProxy. ### Traefik > Heads up - Sharkey doesn't officially support Traefik, but you can still find community support for it within the discord. - Our configs will make the assumptions that sharkey is listening to port `3000`, your https(443) entrypoint is called ``webSecure`` and that you have a certificate resolver ready called ``myResolver``. Change these as necessary. Remember to change ``myshark.ey`` to your instances domain name. #### Docker Labels Append these labels to your sharkey service in docker-compose.yml: + ```yml ...[your docker config]... labels: @@ -305,8 +307,10 @@ Append these labels to your sharkey service in docker-compose.yml: - "traefik.http.routers.sharkey.tls.certresolver=myResolver" ...[your docker config]... ``` + #### Dynamic Config insert this into your dynamic config: + ```yml http: routers: @@ -328,6 +332,7 @@ http: > Heads up - Sharkey doesn't officially support Caddy, but you can still find community support for it within the discord. In your Caddyfile, inset the following instructions. Note that ``<>`` denotes a required option, and ``[]`` is optional to have in your config. + ```Caddyfile <myshark.ey> reverse_proxy [ip]:3000 -- GitLab From e4e62e7fa87044379fc5198ff28bd05ef6eb2982 Mon Sep 17 00:00:00 2001 From: Kio! <im@kio.moe> Date: Sun, 15 Dec 2024 16:17:52 +0000 Subject: [PATCH 4/4] Fix Typo --- content/en/docs/install/fresh.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/install/fresh.md b/content/en/docs/install/fresh.md index e95948a..57f000f 100644 --- a/content/en/docs/install/fresh.md +++ b/content/en/docs/install/fresh.md @@ -331,7 +331,7 @@ http: ### Caddy > Heads up - Sharkey doesn't officially support Caddy, but you can still find community support for it within the discord. -In your Caddyfile, inset the following instructions. Note that ``<>`` denotes a required option, and ``[]`` is optional to have in your config. +In your Caddyfile, insert the following instructions. Note that ``<>`` denotes a required option, and ``[]`` is optional to have in your config. ```Caddyfile <myshark.ey> -- GitLab