From 6a7c97538fb2ef9e8e0bd21c7c8f957ccdce433c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=CC=81scar=20M=2E=20Lage?= Date: Thu, 5 Dec 2024 14:13:54 +0100 Subject: [PATCH] Add: mastodon instance env var --- env-sample | 1 + internal/web/controller.go | 3 +++ internal/web/templates/result.html | 6 +++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/env-sample b/env-sample index 9f69854..f12a847 100644 --- a/env-sample +++ b/env-sample @@ -3,3 +3,4 @@ BASE_URL=https://wrap.sh SERVER_PORT=8080 UPLOAD_DIR=uploads TOP_N_COMMANDS=10 +MASTODON_INSTANCE_FOR_SHARING=mastodon.social diff --git a/internal/web/controller.go b/internal/web/controller.go index db11a12..0145096 100644 --- a/internal/web/controller.go +++ b/internal/web/controller.go @@ -121,6 +121,9 @@ func handleResults(w http.ResponseWriter, r *http.Request) { } stats["baseURL"] = baseURL + mastodon := os.Getenv("MASTODON_INSTANCE_FOR_SHARING") + stats["mastodon"] = mastodon + tmpl, err := loadTemplates("result.html") if err != nil { http.Error(w, "Error loading template", http.StatusInternalServerError) diff --git a/internal/web/templates/result.html b/internal/web/templates/result.html index 221201f..e0505d5 100644 --- a/internal/web/templates/result.html +++ b/internal/web/templates/result.html @@ -54,17 +54,17 @@
Share on Twitter Share on Mastodon Share on Bluesky