--- /dev/null
+.envrc
\ No newline at end of file
"net/http"
"os"
"os/signal"
+ "strings"
"syscall"
"time"
"github.com/phitux/dailytxt/backend/utils"
)
-// Application version - UPDATE THIS FOR NEW RELEASES
-const AppVersion = "2.0.0-testing.1"
+// Application version - loaded from local 'version' file at startup
+var AppVersion string
// longTimeoutEndpoints defines endpoints that need extended/none timeouts
// Paths are checked against the request URL path as seen by the top-level handler.
logger := log.New(os.Stdout, "dailytxt: ", log.LstdFlags|log.Lmicroseconds|log.Lshortfile)
logger.Println("Server starting...")
+ // Read application version as the very first step
+ data, err := os.ReadFile("version")
+ if err != nil {
+ log.Fatalf("Failed to read 'version' file: %v", err)
+ }
+ AppVersion = strings.TrimSpace(string(data))
+ if AppVersion == "" {
+ log.Fatalf("'version' file is empty")
+ }
+
// Set application version
utils.SetVersion(AppVersion)
logger.Printf("DailyTxT version: %s", AppVersion)
--- /dev/null
+2.0.0-testing.1
--- /dev/null
+#!/usr/bin/env bash
+set -euo pipefail
+
+# Build script: pulls translations from Tolgee, then builds the Docker image.
+# Requirements:
+# - Environment variable TOLGEE_API_KEY must be set
+# - tolgee CLI available
+# - Docker installed
+#
+# Usage:
+# TOLGEE_API_KEY=... ./build.sh [IMAGE_TAG]
+#
+# Example:
+# export TOLGEE_API_KEY=xxxxx
+# ./build.sh phitux/dailytxt:2.x.x-testing.1
+
+if [[ $# -lt 1 ]]; then
+ echo "Usage: ./build.sh <IMAGE_TAG>"
+ exit 1
+fi
+IMAGE_TAG="$1"
+
+if [[ -z "${TOLGEE_API_KEY:-}" ]]; then
+ echo "Error: TOLGEE_API_KEY is not set."
+ echo "Please export your Tolgee API key, e.g.:"
+ echo " export TOLGEE_API_KEY=xxxxxxxxxxxxxxxx"
+ exit 1
+fi
+
+echo "[1/3] Writing IMAGE_TAG (=version) into backend/version ..."
+echo "$IMAGE_TAG" > ./backend/version
+
+echo "[2/3] Pulling translations from Tolgee into frontend/src/i18n ..."
+tolgee pull --path ./frontend/src/i18n --api-key $TOLGEE_API_KEY
+
+echo "[3/3] Building Docker image: $IMAGE_TAG"
+docker build -t phitux/dailytxt:$IMAGE_TAG .
+
+echo "Done. Image built: $IMAGE_TAG"
"images_loading_per_device": "Für jedes Gerät einzeln festlegen, ob die Bilder automatisch geladen werden sollen",
"images_loading_this_device": "Bilder auf <b>diesem Gerät</b> automatisch laden",
"images_title": "Bilder automatisch laden",
+ "installation_help": "Du kannst DailyTxT auch wie eine App installieren. Das geht über die Einstellungen des Browsers, wird aber nicht von jedem Browser unterstützt. Aktuell wurde keine Installation erkannt.<br/> \n<ul>\n<li>Android: \"Zum Startbildschirm hinzufügen\"</li>\n<li>Apple: \"Teilen\" -> \"Zum Home-Bildschirm\"</li>\n</ul>",
"language": "Sprache",
"language_auto_detect": "Sprache anhand des Browsers ermitteln. Aktuell:",
"language_not_available": "Die Sprache <code>{browserLanguage}</code> ist nicht verfügbar. Es wird die Standardsprache <code>{defaultLanguage}</code> verwendet.",
"toast": {
"password": {
"available_backup_codes": "{count, plural, one {Noch {count} Backup-Code verfügbar!} other {Noch {count} Backup-Codes verfügbar!}}"
+ },
+ "pwa": {
+ "install_button": "Installieren",
+ "install_description": "Installiere DailyTxT, damit es sich verhält wie eine normale App.",
+ "reload_button": "Neu laden",
+ "update_available": "Eine neue Version ist verfügbar."
}
},
"weekdays": {
"images_loading_per_device": "Decide for each device whether images should be loaded automatically",
"images_loading_this_device": "Automatically load images on <b>this device</b>",
"images_title": "Automatically load images",
+ "installation_help": "You can also install DailyTxT like an app. This is done through the browser settings, but it is not supported by every browser. Currently, no installation has been detected.<br/>\n<ul>\n<li>Android: \"Add to Home screen\"</li>\n<li>Apple: \"Share\" -> \"Add to Home Screen\"</li>\n</ul>",
"language": "Language",
"language_auto_detect": "Determine language based on the browser. Currently:",
"language_not_available": "The language <code>{browserLanguage}</code> is not available. The default language <code>{defaultLanguage}</code> is used.",
"toast": {
"password": {
"available_backup_codes": "{count, plural, one {Still {count} backup code available!} other {Still {count} backup codes available!}}"
+ },
+ "pwa": {
+ "install_button": "Install",
+ "install_description": "Install DailyTxT for a better app-like experience.",
+ "reload_button": "Reload",
+ "update_available": "A new version is available."
}
},
"weekdays": {
"delete": "Supprimer",
"delete_account": "Supprimer le compte utilisateur",
"delete_account.delete_button": "Supprimer le compte utilisateur",
+ "installation_help": "Tu peux aussi installer DailyTxT comme une application. Cela se fait via les paramètres du navigateur, mais tous les navigateurs ne le prennent pas en charge. Aucune installation n'a été détectée actuellement.<br/> \n<ul>\n<li>Android : \"Ajouter à l'écran d'accueil\"</li>\n<li>Apple : \"Partager\" -> \"Sur l'écran d'accueil\"</li>\n</ul>",
"language": {
"reload_info": "Certaines modifications ne seront visibles qu'après rechargement de la page."
},
"error_saving": "Erreur lors de la création du tag!",
"error_saving_exists": "\"Le nom du tag existe déjà\""
}
+ },
+ "toast": {
+ "pwa": {
+ "install_button": "Installer",
+ "install_description": "Installe DailyTxT pour qu'il se comporte comme une application normale.",
+ "reload_button": "Recharger",
+ "update_available": "Une nouvelle version est disponible."
+ }
}
}
\ No newline at end of file
console.error('Error fetching version info:', error);
});
}
+
+ let showInstallationHelp = $state(false);
+ $effect(() => {
+ if (window.matchMedia('(display-mode: standalone)').matches) {
+ showInstallationHelp = false;
+ console.log("We're installed");
+ } else {
+ showInstallationHelp = true;
+ console.log("We're not installed");
+ }
+ });
</script>
<div class="d-flex flex-column h-100">
<img src={dailytxt} alt="" height="38px" />
<span class="dailytxt ms-2 user-select-none">DailyTxT</span>
</div>
- 1
+ 2
</div>
<div class="col-lg-4 col-sm-5 col pe-0 d-flex flex-row justify-content-end">
{/each}
</select>
</div>
+ {#if showInstallationHelp}
+ <div class="alert alert-info">{@html $t('settings.installation_help')}</div>
+ {/if}
<div id="appearance">
<h3 class="text-primary">🎨 {$t('settings.appearance')}</h3>
<div id="lightdark">