diff options
author | 2025-01-23 14:48:09 +0000 | |
---|---|---|
committer | 2025-01-23 15:48:09 +0100 | |
commit | b42cb7a802096762cbffb0fa1177c8355898cc1c (patch) | |
tree | bdd88b6fe32ce32a8fe3b0773209dfb1d5a2df39 /web | |
parent | [feature] Add `published` property to outgoing AP Actor representations (#3671) (diff) | |
download | gotosocial-b42cb7a802096762cbffb0fa1177c8355898cc1c.tar.xz |
[feature] Add warning about `trusted-proxies` to make config easier (#3675)
* [feature] Add warning about `trusted-proxies` to make config easier
* thank you linter, hugs and kisses to you
Diffstat (limited to 'web')
-rw-r--r-- | web/source/css/page.css | 21 | ||||
-rw-r--r-- | web/template/page_header.tmpl | 26 |
2 files changed, 46 insertions, 1 deletions
diff --git a/web/source/css/page.css b/web/source/css/page.css index 642586048..752b264ee 100644 --- a/web/source/css/page.css +++ b/web/source/css/page.css @@ -42,7 +42,26 @@ padding: 1.5rem; gap: 1rem; - a { + .trusted-proxies-rec { + color: $info-fg; + background: $info-bg; + max-width: fit-content; + padding-left: 1rem; + padding-right: 1rem; + border-radius: $br; + text-align: center; + align-self: center; + + code { + background: $info-bg; + } + + a { + color: $info-fg; + } + } + + & > a { display: flex; flex-wrap: wrap; gap: 1rem; diff --git a/web/template/page_header.tmpl b/web/template/page_header.tmpl index 388587aaf..f2349581e 100644 --- a/web/template/page_header.tmpl +++ b/web/template/page_header.tmpl @@ -17,6 +17,29 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. */ -}} +{{- define "trustedProxiesRec" -}} +{{- .with }} +<div class="trusted-proxies-rec"> + <p> + <strong>Warning!</strong> It looks like <code>trusted-proxies</code> is not set correctly in this instance's configuration. + This may cause rate-limiting issues and, by extension, federation issues. + </p> + <p> + If you are the instance admin, you should fix this by adding <code>{{- .trustedProxiesRec -}}</code> to your <code>trusted-proxies</code>. + </p> + <p> + For more information, see + <a + href="https://docs.gotosocial.org/en/latest/configuration/trusted_proxies/" + rel="nofollow noreferrer noopener" + target="_blank" + > + the documentation + </a>. + </p> +</div> +{{- end -}} + {{- define "thumbnailDescription" -}} {{- if .instance.ThumbnailDescription -}} {{- .instance.ThumbnailDescription -}} @@ -56,6 +79,9 @@ Instance Logo {{- end -}} {{- with . }} +{{- if .trustedProxiesRec }} +{{- template "trustedProxiesRec" . }} +{{- end }} <a aria-label="{{- .instance.Title -}}. Go to instance homepage" href="/" class="nounderline"> <picture> {{- if .instance.ThumbnailStatic }} |