Skip to content
Python

1.34.0: New version notice, fix untranslated German texts

DerMilderJoghurt4b39ab7ac576
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9c4617b..d80da35 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,18 @@
Version numbers follow [SemVer](https://semver.org/): MAJOR.MINOR.PATCH
(MAJOR = incompatible change, MINOR = new feature, PATCH = bug fix).
+## 1.34.0 – 2026-11-23
+- **New version notice:** every 6 hours MirrorSync asks GitHub whether a newer version exists. If so, the bottom left
+ shows "⬆ vX.Y.Z available" below the version number, linking to the release. Can be turned off under
+ Settings → General → Updates, which also offers "Save and check now" and shows the last check. Only the installed
+ version number is sent. Changing the setting is recorded in the audit log. API/MCP: `GET /update` (`get_update`),
+ `POST /update/check` (`check_update`, permission "general settings"), `PATCH /settings/update` with `update_check`
+ (`update_update_settings`), plus `update` in `/status` and `get_settings`. Use another repository via the
+ environment variable `UPDATE_REPO`. All texts in 5 languages.
+- Fixed: some texts still appeared in German in other languages: "aktiv", "immer", "aus" and "manuell" on the
+ Schedules page, "sonst"/"immer" in the bandwidth preview, and the storage type names "S3 and S3-compatible" and
+ "Encryption (crypt)" in the type selection when creating a storage location.
+
## 1.33.2 – 2026-11-23
- **GitHub repository in English:** README, CHANGELOG, compose file and workflow comments are now in English.
The German README is still available as [README.de.md](README.de.md).
diff --git a/Dockerfile b/Dockerfile
index 80a0cd6..b8eb9a5 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -18,7 +18,7 @@ RUN for i in 1 2 3; do \
exit 1
COPY app/ .
-ARG VERSION=1.33.2
+ARG VERSION=1.34.0
LABEL org.opencontainers.image.title="MirrorSync" org.opencontainers.image.version=$VERSION
ENV TZ=Europe/Berlin CONFIG_DIR=/config LOG_DIR=/logs PORT=8080 PYTHONUNBUFFERED=1
VOLUME ["/config", "/logs"]
diff --git a/README.de.md b/README.de.md
index b891537..2f69e9a 100644
--- a/README.de.md
+++ b/README.de.md
@@ -1,6 +1,6 @@
# MirrorSync – 1:1-Spiegelung mit Web-GUI und Zeitplänen
-Version **1.33.2** · Änderungen siehe [CHANGELOG.md](CHANGELOG.md) (englisch) · [English version](README.md)
+Version **1.34.0** · Änderungen siehe [CHANGELOG.md](CHANGELOG.md) (englisch) · [English version](README.md)
Ein Docker-Container, der Ordner **einweg 1:1 spiegelt** (wie FreeFileSync „Spiegeln"):
Das Ziel wird exakt wie die Quelle, inklusive Löschungen. Als Sync-Motor dient
@@ -64,8 +64,8 @@ Geänderte Dateien werden komplett neu übertragen (kein Delta wie bei rsync).
## Installation
Das fertige Image liegt in der GitHub Container Registry: `ghcr.io/dermilderjoghurt/mirrorsync`
-(für amd64 und arm64, z. B. Raspberry Pi). Tags: `latest` (neueste Version), `1.33.2` (feste Version),
-`1.33` (neuester Patch dieser Version).
+(für amd64 und arm64, z. B. Raspberry Pi). Tags: `latest` (neueste Version), `1.34.0` (feste Version),
+`1.34` (neuester Patch dieser Version).
### Mit Docker Compose (empfohlen)
1. Ordner anlegen und die [`docker-compose.yml`](docker-compose.yml) hineinlegen, z. B. nach `/opt/mirrorsync/`.
@@ -703,6 +703,17 @@ erhalten bleiben. Fehlt ein Eintrag, erscheint Englisch. Danach Image neu bauen,
automatisch in allen Auswahllisten.
- Zurück auf eine Version vor 1.18.0: die Dateien aus `config/json-backup/` zurück nach `config/` legen.
+## Hinweis auf neue Versionen (seit 1.34.0)
+MirrorSync fragt alle 6 Stunden bei GitHub (`api.github.com`, Repo `DerMilderJoghurt/mirrorsync`) nach, ob es eine
+neuere Version gibt. Wenn ja, steht unten links unter der Versionsnummer „⬆ vX.Y.Z verfügbar“, ein Klick öffnet das
+Release mit allen Änderungen. Übertragen wird dabei nur die eigene Versionsnummer.
+
+- Ein- und ausschalten unter **Einstellungen → Allgemein → Updates**, dort auch „Speichern und jetzt prüfen“ und
+ wann zuletzt geprüft wurde. Aktualisiert wird nicht automatisch, das bleibt bei dir (siehe unten).
+- API/MCP: `GET /api/v1/update` (`get_update`), `POST /api/v1/update/check` (`check_update`),
+ `PATCH /api/v1/settings/update` mit `{"update_check": false}` (`update_update_settings`); `/status` enthält `update`.
+- Ein anderes Repo (z. B. ein eigener Fork) lässt sich per `UPDATE_REPO=besitzer/repo` einstellen.
+
## Update auf eine neue Version
```bash
docker compose pull && docker compose up -d
diff --git a/README.md b/README.md
index ef96913..14799c0 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# MirrorSync – 1:1 mirroring with a web GUI and schedules
-Version **1.33.2** · Changes: [CHANGELOG.md](CHANGELOG.md) · [Deutsche Version](README.de.md)
+Version **1.34.0** · Changes: [CHANGELOG.md](CHANGELOG.md) · [Deutsche Version](README.de.md)
A Docker container that **mirrors folders one-way, 1:1** (like FreeFileSync "Mirror"):
the destination becomes an exact copy of the source, including deletions. The sync engine is
@@ -63,8 +63,8 @@ Changed files are transferred completely (no delta transfer like rsync).
## Installation
The ready-made image is in the GitHub Container Registry: `ghcr.io/dermilderjoghurt/mirrorsync`
-(for amd64 and arm64, e.g. Raspberry Pi). Tags: `latest` (newest version), `1.33.2` (fixed version),
-`1.33` (newest patch of this version).
+(for amd64 and arm64, e.g. Raspberry Pi). Tags: `latest` (newest version), `1.34.0` (fixed version),
+`1.34` (newest patch of this version).
### With Docker Compose (recommended)
1. Create a folder and put the [`docker-compose.yml`](docker-compose.yml) into it, e.g. `/opt/mirrorsync/`.
@@ -682,6 +682,17 @@ the original German text and stay unchanged). Placeholders like `{0}`, `{job}`,
kept. Missing entries fall back to English. Then rebuild the image, the language appears automatically in all
selection lists. Pull requests with new languages are welcome.
+## New version notice (since 1.34.0)
+Every 6 hours MirrorSync asks GitHub (`api.github.com`, repository `DerMilderJoghurt/mirrorsync`) whether a newer
+version exists. If so, the bottom left shows "⬆ vX.Y.Z available" below the version number; clicking it opens the
+release with all changes. Only the installed version number is sent.
+
+- Turn it on or off under **Settings → General → Updates**, which also has "Save and check now" and shows when the
+ last check happened. Nothing is updated automatically, that stays up to you (see below).
+- API/MCP: `GET /api/v1/update` (`get_update`), `POST /api/v1/update/check` (`check_update`),
+ `PATCH /api/v1/settings/update` with `{"update_check": false}` (`update_update_settings`); `/status` contains `update`.
+- Another repository (e.g. your own fork) can be set with `UPDATE_REPO=owner/repo`.
+
## Updating to a new version
```bash
docker compose pull && docker compose up -d
diff --git a/app/VERSION b/app/VERSION
index 80c8c0b..2b17ffd 100644
--- a/app/VERSION
+++ b/app/VERSION
@@ -1 +1 @@
-1.33.2
+1.34.0
diff --git a/app/api.py b/app/api.py
index 407e7d5..72fe164 100644
--- a/app/api.py
+++ b/app/api.py
@@ -367,7 +367,7 @@ def op_status():
"failed": [{"id": jid, "name": j["name"], "last_run": j.get("last_run")} for jid, j in jobs.items()
if j.get("last_status") == "fehler"],
"paused": [{"id": jid, "name": j["name"]} for jid, j in jobs.items() if core.is_paused(j)],
- "key": g.user, "permissions": sorted(g.access.perms)}
+ "key": g.user, "permissions": sorted(g.access.perms), "update": core.update_status()}
def op_jobs():
diff --git a/app/apigui.py b/app/apigui.py
index 550089a..f8b0be6 100644
--- a/app/apigui.py
+++ b/app/apigui.py
@@ -432,7 +432,33 @@ def a_get_general(a):
return {"logs": {k: s.get(k) for k in LOG_KEYS}, "security": {k: s.get(k) for k in SEC_KEYS},
"language": s.get("language") or core.i18n.default_lang,
"languages": [{"code": c, "name": n} for c, n in core.i18n.languages()],
- "geoip": core.geoip.status()}
+ "geoip": core.geoip.status(), "update": core.update_status()}
+
+
+@action("get_update", "GET", "/update", None, "System",
+ "Prüfung auf eine neuere MirrorSync-Version: installierte (current) und neueste Version (latest), "
+ "update_available, Link zum Release (url), Zeitpunkt der letzten Prüfung, enabled.", ro=True)
+def a_get_update(a):
+ return core.update_status()
+
+
+@action("check_update", "POST", "/update/check", "system.settings", "System",
+ "Jetzt bei GitHub nach einer neueren Version fragen und das Ergebnis zurückgeben.")
+def a_check_update(a):
+ core.update.check()
+ return core.update_status()
+
+
+@action("update_update_settings", "PATCH", "/settings/update", "system.settings", "Einstellungen",
+ "Automatische Prüfung auf neue Versionen ein- oder ausschalten (update_check).",
+ {"update_check": S(BOOL)}, ["update_check"])
+def a_update_update_settings(a):
+ _check_keys(a, ("update_check",))
+ form = {"section": "update"}
+ if _bool(a["update_check"]):
+ form["update_check"] = "on"
+ msg = done(gui("POST", "/settings/general", form=form))
+ return {"ok": True, "message": msg, "update": core.update_status()}
@action("update_log_settings", "PATCH", "/settings/logs", "system.settings", "Einstellungen",
diff --git a/app/app.py b/app/app.py
index 40f4664..e3dbfee 100644
--- a/app/app.py
+++ b/app/app.py
@@ -34,6 +34,7 @@ import db as dbmod
import files as filemgr
import geoip
import i18n
+import update
import ipguard
import msgtpl
import notify
@@ -118,6 +119,7 @@ app.jinja_env.globals.update(_=i18n.t, lang_code=i18n.current, LANGS=i18n.langua
bw_unit=lambda: load_settings().get("bw_unit") or "MB/s")
app.jinja_env.filters["regex_cmd"] = lambda h: (re.search(r'rclone authorize "[^\n]*', h or "") or [None])[0]
app.jinja_env.globals["VERSION"] = VERSION
+app.jinja_env.globals["UPDATE"] = lambda: update_status() if g.get("user") else None
notify.VERSION = VERSION
app.jinja_env.globals["ICON"] = {k: Markup(v) for k, v in ICONS.items()}
app.jinja_env.globals["STATUS"] = {"ok": "OK", "fehler": "Fehler", "laeuft": "läuft",
@@ -131,6 +133,7 @@ scheduler = BackgroundScheduler(timezone=TZ)
# ---------------------------------------------------------------- Speicher
DB = dbmod.DB(os.path.join(CONFIG_DIR, dbmod.DB_NAME))
+update.init(DB, VERSION)
try:
dbmod.migrate(DB, CONFIG_DIR, log=lambda m: print(m, flush=True))
except Exception as _e: # nichts uebernommen, JSON-Dateien unveraendert -> lieber nicht starten als leer starten
@@ -366,7 +369,7 @@ SETTINGS_FILE = os.path.join(CONFIG_DIR, "settings.json")
LOG_DEFAULTS = {"log_keep_runs": "50", "log_keep_days": "30", "trust_proxy": False, "geoip_auto": True, "geoip_days": "30",
"geoip_mode": "interval", "geoip_time": "03:00", "geoip_dow": "mon",
"lock_attempts": "5", "lock_minutes": "15", "lock_notify": True,
- "fail_notify": "", "fail_notify_minutes": "15", "audit_keep_days": "365"}
+ "fail_notify": "", "fail_notify_minutes": "15", "audit_keep_days": "365", "update_check": True}
RUN_ID_RE = re.compile(r"^[A-Za-z0-9_.-]{1,64}$")
@@ -381,6 +384,27 @@ def save_settings(data):
DB.put_map("settings", data)
+def update_status():
+ """Ergebnis der Pruefung auf eine neuere Version (siehe update.py)."""
+ return update.status(load_settings().get("update_check", True))
+
+
+def _update_loop():
+ """Beim Start (nach kurzer Pause) und danach regelmaessig bei GitHub nach einer neueren Version fragen."""
+ time.sleep(30)
+ while True:
+ try:
+ if load_settings().get("update_check", True) and update.due():
+ st = update.check()
+ if st.get("error"):
+ print(f"Update-Prüfung: {st['error']}", flush=True)
+ elif update.newer(st.get("latest"), VERSION):
+ print(f"Neue MirrorSync-Version {st['latest']} verfügbar: {st.get('url')}", flush=True)
+ except Exception as e: # noqa: BLE001
+ print(f"Update-Prüfung: {e}", flush=True)
+ time.sleep(600)
+
+
def keep_limits():
st = load_settings()
try:
@@ -2428,6 +2452,11 @@ def providers():
return _providers
+def providers_tr():
+ """providers() mit Bezeichnungen in der Sprache der Anfrage (fuer die GUI)."""
+ return [dict(p, label=i18n.t(p["label"])) for p in providers()]
+
+
def list_remotes():
rc, out = rclone("listremotes", "--long", timeout=15)
if rc != 0:
@@ -2538,7 +2567,7 @@ def edit_remote(name=None):
err = "Mit dieser Auswahl unter „Sichtbar für“ würdest du den Speicherort selbst nicht mehr sehen."
if err:
return render_template("remote_edit.html", name=name, existing=_safe(existing), err=err,
- providers=providers(), form=f, vis=vis, vis_opts=vis_options())
+ providers=providers_tr(), form=f, vis=vis, vis_opts=vis_options())
meta = DB.get_map("remote_meta")
if vis == "all":
meta.pop(new_name, None)
@@ -2555,7 +2584,7 @@ def edit_remote(name=None):
q, err = _config_step(["config", "create", new_name, typ, *params, "--obscure"])
return _after_step(new_name, q, err, f"Speicherort '{new_name}' gespeichert. Jetzt mit „Testen“ prüfen.")
return render_template("remote_edit.html", name=name, existing=_safe(existing), err=None,
- providers=providers(), form={}, vis=remote_vis_map().get(name, "all") if name else "all",
+ providers=providers_tr(), form={}, vis=remote_vis_map().get(name, "all") if name else "all",
vis_opts=vis_options())
@@ -2682,6 +2711,15 @@ def general_settings():
save_settings(s)
i18n.default_lang = lang
msg = "Standardsprache gespeichert."
+ elif request.method == "POST" and request.form.get("section") == "update":
+ s["update_check"] = "update_check" in request.form
+ save_settings(s)
+ msg = "Gespeichert."
+ if request.form.get("check_now"):
+ st = update.check()
+ msg = (i18n.t("Prüfung fehlgeschlagen: {0}", st["error"]) if st.get("error") else
+ i18n.t("Neue Version {0} verfügbar.", st["latest"]) if update.newer(st.get("latest"), VERSION) else
+ i18n.t("MirrorSync ist aktuell ({0}).", VERSION))
elif request.method == "POST" and request.form.get("section") == "bw":
cfg, err = bwlimit.clean(parse_bw(request.form.get("bw_json")))
if not err:
@@ -2714,7 +2752,7 @@ def general_settings():
pk_rp_id, _, _pk_prob = _pk_rp()
return render_template("general.html", s=s, msg=msg, err=err, usage=usage, bw_cfg=bw, geo=geoip.status(), pk_now=pk_rp_id,
attribution=Markup(geoip.ATTRIBUTION), my_ip=_client_ip(), my_loc=geoip.locate(_client_ip()),
- next_geoip=next_run("_geoip"), tz=TZ,
+ next_geoip=next_run("_geoip"), tz=TZ, upd=update_status(),
fwd=request.headers.get("X-Forwarded-For", ""),
bw_desc=bwlimit.describe(bw, s.get("bw_unit") or "MB/s"), bw_tt=bwlimit.timetable(bw))
@@ -3943,6 +3981,7 @@ def main():
print(f"Hinweis: Benutzer {', '.join(grp)} unterscheiden sich nur in Groß-/Kleinschreibung. "
"Anmeldung klappt nur mit exakter Schreibweise, bitte einen umbenennen oder löschen.", flush=True)
threading.Thread(target=_geoip_loop, daemon=True).start()
+ threading.Thread(target=_update_loop, daemon=True).start()
scheduler.start()
schedule_all()
from waitress import serve
diff --git a/app/audit.py b/app/audit.py
index e6fdb23..7d70ccf 100644
--- a/app/audit.py
+++ b/app/audit.py
@@ -41,7 +41,7 @@ LABELS = {
"auto_minutes": "Auto-Sperre Minuten", "auto_window": "Zeitfenster Fehlversuche", "auto_exempt_lan": "LAN ausnehmen",
"notify": "Benachrichtigen", "trust_proxy": "Reverse-Proxy vertrauen", "public_url": "Öffentliche Adresse", "log_keep_runs": "Logs behalten (Läufe)",
"log_keep_days": "Logs behalten (Tage)", "audit_keep_days": "Audit-Log behalten (Tage)", "lock_attempts": "Sperre nach Fehlversuchen",
- "lock_minutes": "Sperrdauer", "fail_notify": "Fehlversuche melden", "geoip_auto": "Länder-Datenbank automatisch", "geoip_days": "Länder-Datenbank erneuern alle (Tage)", "geoip_mode": "Länder-Datenbank erneuern", "geoip_time": "Länder-Datenbank: Uhrzeit", "geoip_dow": "Länder-Datenbank: Wochentage", "visible_to": "Sichtbar für", "windows": "aktiv nur zu Zeiten", "versions_keep": "Versionen behalten", "versions_days": "Versionen höchstens Tage", "expires": "gültig bis", "ips": "erlaubte IPs", "members": "Mitglieder", "keys": "API-Keys", "bw_unit": "Einheit der Bandbreite",
+ "lock_minutes": "Sperrdauer", "fail_notify": "Fehlversuche melden", "geoip_auto": "Länder-Datenbank automatisch", "update_check": "Nach neuen Versionen suchen", "geoip_days": "Länder-Datenbank erneuern alle (Tage)", "geoip_mode": "Länder-Datenbank erneuern", "geoip_time": "Länder-Datenbank: Uhrzeit", "geoip_dow": "Länder-Datenbank: Wochentage", "visible_to": "Sichtbar für", "windows": "aktiv nur zu Zeiten", "versions_keep": "Versionen behalten", "versions_days": "Versionen höchstens Tage", "expires": "gültig bis", "ips": "erlaubte IPs", "members": "Mitglieder", "keys": "API-Keys", "bw_unit": "Einheit der Bandbreite",
"hash": "Passwort", "pass": "Passwort", "token": "Token", "smtp_pass": "SMTP-Passwort", "telegram_token": "Telegram-Token",
"notify_telegram_token": "Telegram-Token", "smtp_user": "SMTP-Benutzer", "host": "Server", "user": "Benutzer", "totp_secret": "2FA-Schlüssel", "backup_codes": "Backup-Codes",
"paused": "pausiert", "paused_until": "pausiert bis", "paused_by": "pausiert von", "pause_chain": "pausiert in Kette",
diff --git a/app/i18n/en.json b/app/i18n/en.json
index 3cb09b1..21488ac 100644
--- a/app/i18n/en.json
+++ b/app/i18n/en.json
@@ -2006,5 +2006,23 @@
"🚫 MirrorSync: IP gesperrt": "🚫 MirrorSync: IP blocked",
"🚫 MirrorSync: IP {ip} {flagge} {land} wurde nach zu vielen Fehlversuchen {wie_lange} gesperrt (zuletzt Benutzer „{benutzer}“).": "🚫 MirrorSync: IP {ip} {flagge} {land} was blocked {wie_lange} after too many failed attempts (last user “{benutzer}”).",
"🪞 Wie Spiegeln (inkl. Löschen)": "🪞 Like mirroring (incl. deleting)",
- "🪞 Wie Spiegeln: neue, geänderte und gelöschte Dateien übernehmen (empfohlen)": "🪞 Like mirroring: apply new, changed and deleted files (recommended)"
+ "🪞 Wie Spiegeln: neue, geänderte und gelöschte Dateien übernehmen (empfohlen)": "🪞 Like mirroring: apply new, changed and deleted files (recommended)",
+ "sonst": "otherwise",
+ "Updates": "Updates",
+ "Nach neuen Versionen suchen": "Check for new versions",
+ "Fragt alle 6 Stunden bei GitHub nach, ob es eine neuere Version gibt, und zeigt sie unten links neben der Versionsnummer an. Übertragen wird dabei nur die eigene Versionsnummer.": "Asks GitHub every 6 hours whether a newer version exists and shows it at the bottom left next to the version number. Only the installed version number is sent.",
+ "Installiert:": "Installed:",
+ "Neueste Version:": "Latest version:",
+ "Neue Version verfügbar": "New version available",
+ "aktuell": "up to date",
+ "Zuletzt geprüft: {{ upd.checked }}": "Last checked: {{ upd.checked }}",
+ "Fehler bei der letzten Prüfung: {{ upd.error }}": "Error during the last check: {{ upd.error }}",
+ "Speichern und jetzt prüfen": "Save and check now",
+ "⬆ v{{ upd_s.latest }} verfügbar": "⬆ v{{ upd_s.latest }} available",
+ "Prüfung fehlgeschlagen: {0}": "Check failed: {0}",
+ "Neue Version {0} verfügbar.": "New version {0} available.",
+ "MirrorSync ist aktuell ({0}).": "MirrorSync is up to date ({0}).",
+ "Prüfung auf eine neuere MirrorSync-Version: installierte (current) und neueste Version (latest), update_available, Link zum Release (url), Zeitpunkt der letzten Prüfung, enabled.": "Check for a newer MirrorSync version: installed (current) and latest version (latest), update_available, link to the release (url), time of the last check, enabled.",
+ "Jetzt bei GitHub nach einer neueren Version fragen und das Ergebnis zurückgeben.": "Ask GitHub for a newer version now and return the result.",
+ "Automatische Prüfung auf neue Versionen ein- oder ausschalten (update_check).": "Turn the automatic check for new versions on or off (update_check)."
}
\ No newline at end of file
diff --git a/app/i18n/es.json b/app/i18n/es.json
index 6fa622e..57ec8ea 100644
--- a/app/i18n/es.json
+++ b/app/i18n/es.json
@@ -2006,5 +2006,23 @@
"🚫 MirrorSync: IP gesperrt": "🚫 MirrorSync: IP bloqueada",
"🚫 MirrorSync: IP {ip} {flagge} {land} wurde nach zu vielen Fehlversuchen {wie_lange} gesperrt (zuletzt Benutzer „{benutzer}“).": "🚫 MirrorSync: la IP {ip} {flagge} {land} se ha bloqueado {wie_lange} tras demasiados intentos fallidos (último usuario “{benutzer}”).",
"🪞 Wie Spiegeln (inkl. Löschen)": "🪞 Como espejo (incl. eliminar)",
- "🪞 Wie Spiegeln: neue, geänderte und gelöschte Dateien übernehmen (empfohlen)": "🪞 Como espejo: aplicar archivos nuevos, modificados y eliminados (recomendado)"
+ "🪞 Wie Spiegeln: neue, geänderte und gelöschte Dateien übernehmen (empfohlen)": "🪞 Como espejo: aplicar archivos nuevos, modificados y eliminados (recomendado)",
+ "sonst": "si no",
+ "Updates": "Actualizaciones",
+ "Nach neuen Versionen suchen": "Buscar nuevas versiones",
+ "Fragt alle 6 Stunden bei GitHub nach, ob es eine neuere Version gibt, und zeigt sie unten links neben der Versionsnummer an. Übertragen wird dabei nur die eigene Versionsnummer.": "Consulta GitHub cada 6 horas si hay una versión más reciente y la muestra abajo a la izquierda junto al número de versión. Solo se envía el número de versión instalado.",
+ "Installiert:": "Instalada:",
+ "Neueste Version:": "Última versión:",
+ "Neue Version verfügbar": "Nueva versión disponible",
+ "aktuell": "actualizado",
+ "Zuletzt geprüft: {{ upd.checked }}": "Última comprobación: {{ upd.checked }}",
+ "Fehler bei der letzten Prüfung: {{ upd.error }}": "Error en la última comprobación: {{ upd.error }}",
+ "Speichern und jetzt prüfen": "Guardar y comprobar ahora",
+ "⬆ v{{ upd_s.latest }} verfügbar": "⬆ v{{ upd_s.latest }} disponible",
+ "Prüfung fehlgeschlagen: {0}": "Comprobación fallida: {0}",
+ "Neue Version {0} verfügbar.": "Nueva versión {0} disponible.",
+ "MirrorSync ist aktuell ({0}).": "MirrorSync está actualizado ({0}).",
+ "Prüfung auf eine neuere MirrorSync-Version: installierte (current) und neueste Version (latest), update_available, Link zum Release (url), Zeitpunkt der letzten Prüfung, enabled.": "Comprobación de una versión más reciente de MirrorSync: versión instalada (current) y más reciente (latest), update_available, enlace a la versión (url), hora de la última comprobación, enabled.",
+ "Jetzt bei GitHub nach einer neueren Version fragen und das Ergebnis zurückgeben.": "Consultar ahora a GitHub si hay una versión más reciente y devolver el resultado.",
+ "Automatische Prüfung auf neue Versionen ein- oder ausschalten (update_check).": "Activar o desactivar la comprobación automática de nuevas versiones (update_check)."
}
\ No newline at end of file
diff --git a/app/i18n/fr.json b/app/i18n/fr.json
index 3512ef3..5b124ce 100644
--- a/app/i18n/fr.json
+++ b/app/i18n/fr.json
@@ -2006,5 +2006,23 @@
"🚫 MirrorSync: IP gesperrt": "🚫 MirrorSync : IP bloquée",
"🚫 MirrorSync: IP {ip} {flagge} {land} wurde nach zu vielen Fehlversuchen {wie_lange} gesperrt (zuletzt Benutzer „{benutzer}“).": "🚫 MirrorSync : l’IP {ip} {flagge} {land} a été bloquée {wie_lange} après trop d’échecs (dernier utilisateur « {benutzer} »).",
"🪞 Wie Spiegeln (inkl. Löschen)": "🪞 Comme le miroir (suppression incluse)",
- "🪞 Wie Spiegeln: neue, geänderte und gelöschte Dateien übernehmen (empfohlen)": "🪞 Comme le miroir : appliquer les fichiers nouveaux, modifiés et supprimés (recommandé)"
+ "🪞 Wie Spiegeln: neue, geänderte und gelöschte Dateien übernehmen (empfohlen)": "🪞 Comme le miroir : appliquer les fichiers nouveaux, modifiés et supprimés (recommandé)",
+ "sonst": "sinon",
+ "Updates": "Mises à jour",
+ "Nach neuen Versionen suchen": "Rechercher de nouvelles versions",
+ "Fragt alle 6 Stunden bei GitHub nach, ob es eine neuere Version gibt, und zeigt sie unten links neben der Versionsnummer an. Übertragen wird dabei nur die eigene Versionsnummer.": "Interroge GitHub toutes les 6 heures pour savoir s'il existe une version plus récente et l'affiche en bas à gauche à côté du numéro de version. Seul le numéro de version installé est transmis.",
+ "Installiert:": "Installée :",
+ "Neueste Version:": "Dernière version :",
+ "Neue Version verfügbar": "Nouvelle version disponible",
+ "aktuell": "à jour",
+ "Zuletzt geprüft: {{ upd.checked }}": "Dernière vérification : {{ upd.checked }}",
+ "Fehler bei der letzten Prüfung: {{ upd.error }}": "Erreur lors de la dernière vérification : {{ upd.error }}",
+ "Speichern und jetzt prüfen": "Enregistrer et vérifier maintenant",
+ "⬆ v{{ upd_s.latest }} verfügbar": "⬆ v{{ upd_s.latest }} disponible",
+ "Prüfung fehlgeschlagen: {0}": "Échec de la vérification : {0}",
+ "Neue Version {0} verfügbar.": "Nouvelle version {0} disponible.",
+ "MirrorSync ist aktuell ({0}).": "MirrorSync est à jour ({0}).",
+ "Prüfung auf eine neuere MirrorSync-Version: installierte (current) und neueste Version (latest), update_available, Link zum Release (url), Zeitpunkt der letzten Prüfung, enabled.": "Vérification d'une version plus récente de MirrorSync : version installée (current) et la plus récente (latest), update_available, lien vers la version (url), heure de la dernière vérification, enabled.",
+ "Jetzt bei GitHub nach einer neueren Version fragen und das Ergebnis zurückgeben.": "Demander maintenant à GitHub s'il existe une version plus récente et renvoyer le résultat.",
+ "Automatische Prüfung auf neue Versionen ein- oder ausschalten (update_check).": "Activer ou désactiver la vérification automatique des nouvelles versions (update_check)."
}
\ No newline at end of file
diff --git a/app/i18n/it.json b/app/i18n/it.json
index a045f6e..2698b0a 100644
--- a/app/i18n/it.json
+++ b/app/i18n/it.json
@@ -2006,5 +2006,23 @@
"🚫 MirrorSync: IP gesperrt": "🚫 MirrorSync: IP bloccato",
"🚫 MirrorSync: IP {ip} {flagge} {land} wurde nach zu vielen Fehlversuchen {wie_lange} gesperrt (zuletzt Benutzer „{benutzer}“).": "🚫 MirrorSync: l’IP {ip} {flagge} {land} è stato bloccato {wie_lange} dopo troppi tentativi falliti (ultimo utente “{benutzer}”).",
"🪞 Wie Spiegeln (inkl. Löschen)": "🪞 Come mirror (incl. eliminazione)",
- "🪞 Wie Spiegeln: neue, geänderte und gelöschte Dateien übernehmen (empfohlen)": "🪞 Come mirror: applica file nuovi, modificati ed eliminati (consigliato)"
+ "🪞 Wie Spiegeln: neue, geänderte und gelöschte Dateien übernehmen (empfohlen)": "🪞 Come mirror: applica file nuovi, modificati ed eliminati (consigliato)",
+ "sonst": "altrimenti",
+ "Updates": "Aggiornamenti",
+ "Nach neuen Versionen suchen": "Cerca nuove versioni",
+ "Fragt alle 6 Stunden bei GitHub nach, ob es eine neuere Version gibt, und zeigt sie unten links neben der Versionsnummer an. Übertragen wird dabei nur die eigene Versionsnummer.": "Chiede a GitHub ogni 6 ore se esiste una versione più recente e la mostra in basso a sinistra accanto al numero di versione. Viene inviato solo il numero di versione installato.",
+ "Installiert:": "Installata:",
+ "Neueste Version:": "Ultima versione:",
+ "Neue Version verfügbar": "Nuova versione disponibile",
+ "aktuell": "aggiornato",
+ "Zuletzt geprüft: {{ upd.checked }}": "Ultimo controllo: {{ upd.checked }}",
+ "Fehler bei der letzten Prüfung: {{ upd.error }}": "Errore durante l'ultimo controllo: {{ upd.error }}",
+ "Speichern und jetzt prüfen": "Salva e controlla ora",
+ "⬆ v{{ upd_s.latest }} verfügbar": "⬆ v{{ upd_s.latest }} disponibile",
+ "Prüfung fehlgeschlagen: {0}": "Controllo non riuscito: {0}",
+ "Neue Version {0} verfügbar.": "Nuova versione {0} disponibile.",
+ "MirrorSync ist aktuell ({0}).": "MirrorSync è aggiornato ({0}).",
+ "Prüfung auf eine neuere MirrorSync-Version: installierte (current) und neueste Version (latest), update_available, Link zum Release (url), Zeitpunkt der letzten Prüfung, enabled.": "Controllo di una versione più recente di MirrorSync: versione installata (current) e più recente (latest), update_available, link alla release (url), ora dell'ultimo controllo, enabled.",
+ "Jetzt bei GitHub nach einer neueren Version fragen und das Ergebnis zurückgeben.": "Chiedere ora a GitHub se esiste una versione più recente e restituire il risultato.",
+ "Automatische Prüfung auf neue Versionen ein- oder ausschalten (update_check).": "Attivare o disattivare il controllo automatico delle nuove versioni (update_check)."
}
\ No newline at end of file
diff --git a/app/templates.py b/app/templates.py
index ced8311..0ac8a88 100644
--- a/app/templates.py
+++ b/app/templates.py
@@ -27,7 +27,7 @@ nav a{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:8p
nav a:hover{background:var(--card2);color:var(--fg)}nav a.active{background:var(--acc-soft);color:var(--acc)}
nav svg,.btn svg{width:16px;height:16px;flex:0 0 16px}
.side-foot{margin-top:auto;padding:12px 10px;border-top:1px solid var(--bd);display:flex;flex-direction:column;gap:2px}
-.side-foot .ver{color:var(--mut);font-size:12px;padding:6px 10px}
+.side-foot .ver{color:var(--mut);font-size:12px;padding:6px 10px}.side-foot .ver .upd{color:var(--acc);font-weight:600;text-decoration:none}.side-foot .ver .upd:hover{text-decoration:underline}
.side-foot button,.side-foot a{all:unset;display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:8px;color:var(--mut);cursor:pointer;font-weight:500}
.side-foot button:hover,.side-foot a:hover{background:var(--card2);color:var(--fg)}.side-foot svg{width:16px;height:16px}
.content{flex:1;min-width:0}
@@ -169,7 +169,7 @@ table,tbody,tr,td{display:block;width:100%}tr:first-child:has(th){display:none}t
<button type="button" onclick="toggleTheme()" title="Design wechseln">{{ ICON.theme }}<span id="themeLabel" class="lbl">Design wechseln</span></button>
{% if g.user %}<a href="/account" class="userchip" title="{{ g.user }}"><span class="avatar">{{ g.user[:1]|upper }}</span><span class="lbl"><b>{{ g.user }}</b><br><small>{{ role_name(g.role) }}</small></span></a>
<a href="/logout" title="Abmelden">{{ ICON.logout }}<span class="lbl">Abmelden</span></a>{% endif %}
-<div class="ver">MirrorSync v{{ VERSION }}</div>
+<div class="ver">MirrorSync v{{ VERSION }}{% set upd_s = UPDATE() %}{% if upd_s and upd_s.update_available %}<br><a class="upd" href="{{ upd_s.url }}" target="_blank" rel="noopener" title="Neue Version verfügbar">⬆ v{{ upd_s.latest }} verfügbar</a>{% endif %}</div>
</div>
</aside>
<div class="content">
@@ -1786,6 +1786,13 @@ scope();
<div class="row"><div><label>Standardsprache</label><select name="language">{% for c, n in LANGS() %}<option value="{{ c }}" {{ "selected" if c == s.language }}>{{ n }}</option>{% endfor %}</select></div>
<div style="align-self:end"><button class="btn pri">Speichern</button></div></div>
<div class="hint">Gilt für die Anmeldeseite, Benachrichtigungen, API-Meldungen und alle Benutzer ohne eigene Auswahl. Jeder Benutzer stellt seine Sprache unter <a href="/account">Mein Konto</a> ein.</div></form>
+<form method="post" class="card"><input type="hidden" name="section" value="update"><h2>Updates</h2>
+<label class="check"><input type="checkbox" name="update_check" {{ "checked" if upd.enabled }}> Nach neuen Versionen suchen</label>
+<div class="hint">Fragt alle 6 Stunden bei GitHub nach, ob es eine neuere Version gibt, und zeigt sie unten links neben der Versionsnummer an. Übertragen wird dabei nur die eigene Versionsnummer.</div>
+<p style="margin:10px 0 0"><span class="mut">Installiert:</span> <b>v{{ upd.current }}</b>{% if upd.latest %} &nbsp;·&nbsp; <span class="mut">Neueste Version:</span> <a href="{{ upd.url }}" target="_blank" rel="noopener">v{{ upd.latest }}</a>{% if upd.update_available %} <span class="tag ok">Neue Version verfügbar</span>{% elif upd.enabled %} <span class="tag">aktuell</span>{% endif %}{% endif %}</p>
+{% if upd.checked %}<p class="mut" style="margin:4px 0 0"><small>Zuletzt geprüft: {{ upd.checked }}</small></p>{% endif %}
+{% if upd.error %}<p style="margin:4px 0 0;color:var(--err)"><small>Fehler bei der letzten Prüfung: {{ upd.error }}</small></p>{% endif %}
+<p style="margin-top:12px"><button class="btn pri">Speichern</button> <button class="btn" name="check_now" value="1">Speichern und jetzt prüfen</button></p></form>
<form method="post"><div class="card"><h2>Logs aufbewahren</h2>
<p class="mut" style="margin-top:-4px">Jeder Lauf bekommt ein eigenes Log. Ältere Läufe werden nach jedem Lauf automatisch gelöscht.</p>
<div class="row"><div><label>Läufe pro Aufgabe behalten</label><input type="text" inputmode="numeric" name="log_keep_runs" value="{{ s.log_keep_runs }}"><div class="hint">1 bis 1000</div></div>
@@ -1869,7 +1876,7 @@ function collect(){return {up:store(document.getElementById('bw_up').value),down
function rate(u,d){u=u?show(u)+' '+U:'unbegrenzt';d=d?show(d)+' '+U:'unbegrenzt';return u===d?u:'↑ '+u+' / ↓ '+d}
function days(a){const s=a.join();return s==='0,1,2,3,4,5,6'?'täglich':s==='0,1,2,3,4'?'Mo–Fr':s==='5,6'?'Sa–So':a.map(i=>DD[i]).join(', ')}
window.bwPrev=function(){const c=collect();const p=c.rules.map(r=>days(r.days)+' '+r.start+'–'+r.end+': '+rate(r.up,r.down));
- p.push((c.rules.length?'sonst: ':'immer: ')+rate(c.up,c.down));document.getElementById('bw_prev').textContent='Ergebnis: '+p.join(' · ')};
+ p.push((c.rules.length?'sonst':'immer')+': '+rate(c.up,c.down));document.getElementById('bw_prev').textContent='Ergebnis: '+p.join(' · ')};
['bw_up','bw_down'].forEach(i=>document.getElementById(i).addEventListener('input',bwPrev));
(C.rules||[]).forEach(r=>bwAdd(r));units();bwPrev();
const us=document.getElementById('bw_unit');
@@ -2016,7 +2023,7 @@ function timeRow(j){const el=document.createElement('div');el.className='sch';co
'<div class="ctl">'+trigSelect(j)+
(pc?'<input type="time" class="tm" value="'+pc.t+'"><span class="days">'+[1,2,3,4,5,6,0].map(d=>'<label><input type="checkbox" value="'+d+'"'+(days.includes(d)?' checked':'')+'><span>'+DD[(d+6)%7]+'</span></label>').join('')+'</span>'
:'<input type="text" class="cr" value="'+esc(j.schedule)+'" style="width:150px" title="Cron-Ausdruck">')+
- '<label class="check" style="margin:0"><input type="checkbox" class="en"'+(j.enabled?' checked':'')+'> aktiv</label>'+
+ '<label class="check" style="margin:0"><input type="checkbox" class="en"'+(j.enabled?' checked':'')+'> '+'aktiv'+'</label>'+
(E?'<button type="button" class="btn sm pri sv">Speichern</button>':'')+'</div>';
if(!E)el.querySelectorAll('input').forEach(i=>i.disabled=true);
bindTrig(el,j);const sv=el.querySelector('.sv');
@@ -2035,7 +2042,7 @@ function liveRow(j){const el=document.createElement('div');el.className='sch';co
'<span class="fk-time" style="display:contents"><input type="time" class="tm" value="'+(pc?pc.t:'03:00')+'"><span class="days">'+[1,2,3,4,5,6,0].map(d=>'<label><input type="checkbox" value="'+d+'"'+(days.includes(d)?' checked':'')+'><span>'+DD[(d+6)%7]+'</span></label>').join('')+'</span></span>'+
'<span class="fk-every" style="display:contents"><input type="number" class="fn" min="1" max="720" value="'+(ev?ev[1]:6)+'" style="width:70px"><select class="fu"><option value="h"'+(ev&&ev[2]==='m'?'':' selected')+'>'+'Std.'+'</option><option value="m"'+(ev&&ev[2]==='m'?' selected':'')+'>'+'Min.'+'</option></select></span>'+
'<span class="fk-cron" style="display:contents"><input type="text" class="cr" value="'+esc(kind==='cron'?j.full:'0 3 * * *')+'" style="width:150px" title="'+'Cron-Ausdruck für den vollen Abgleich'+'"></span></span>'+
- '<label class="check" style="margin:0"><input type="checkbox" class="en"'+(j.enabled?' checked':'')+'> aktiv</label>'+
+ '<label class="check" style="margin:0"><input type="checkbox" class="en"'+(j.enabled?' checked':'')+'> '+'aktiv'+'</label>'+
(E?'<button type="button" class="btn sm pri sv">Speichern</button>':'')+'</div>';
const q=s=>el.querySelector(s);
const vis=()=>{const f=!tw&&q('.lm').value==='fast',k=q('.fk').value;q('.fullc').style.display=f?'contents':'none';
@@ -2052,10 +2059,10 @@ function manualRow(j){const el=document.createElement('div');el.className='sch';
bindTrig(el,j);if(E)drag(el);return el}
function chainRow(j){const el=document.createElement('div');el.className='sch';el.dataset.id=j.id;
el.innerHTML=(E?'<span class="handle" title="ziehen">⠿</span>':'')+nameCell(j)+'<div class="ctl">'+
- (E?'<select class="wh"><option value="ok"'+(j.when!=='always'?' selected':'')+'>nur bei Erfolg</option><option value="always"'+(j.when==='always'?' selected':'')+'>immer</option></select>'
- +'<label class="check" style="margin:0"><input type="checkbox" class="en"'+(j.enabled?' checked':'')+'> aktiv</label>'
+ (E?'<select class="wh"><option value="ok"'+(j.when!=='always'?' selected':'')+'>nur bei Erfolg</option><option value="always"'+(j.when==='always'?' selected':'')+'>'+'immer'+'</option></select>'
+ +'<label class="check" style="margin:0"><input type="checkbox" class="en"'+(j.enabled?' checked':'')+'> '+'aktiv'+'</label>'
+'<button type="button" class="btn sm up" title="nach oben">↑</button><button type="button" class="btn sm dn" title="nach unten">↓</button>'+trigSelect(j)
- :'<small>'+(j.when==='always'?'immer':'nur bei Erfolg')+(j.enabled?'':' · aus')+'</small>')+'</div>';
+ :'<small>'+(j.when==='always'?'immer':'nur bei Erfolg')+(j.enabled?'':' · '+'aus')+'</small>')+'</div>';
if(E){bindTrig(el,j);drag(el);el.querySelector('.wh').onchange=saveChains;el.querySelector('.en').onchange=saveChains;
el.querySelector('.up').onclick=()=>{const p=el.previousElementSibling;if(p&&p.classList.contains('sch')){el.parentNode.insertBefore(el,p);saveChains()}};
el.querySelector('.dn').onclick=()=>{const n=el.nextElementSibling;if(n&&n.classList.contains('sch')){el.parentNode.insertBefore(n,el);saveChains()}}}
@@ -2093,7 +2100,7 @@ function render(){
}
function chainBox(root,items){const r=D.jobs[root];const b=document.createElement('div');b.className='chainbox';b.dataset.root=root;
const how=r.trigger==='time'?('🕒 '+esc(r.text||r.schedule)+(r.enabled&&r.next_run?' · nächster Lauf '+esc(r.next_run):' · Zeitplan aus'))
- :r.trigger==='live'?('⚡ '+esc(r.live_text)+' · Folgeaufgaben nach dem vollen Abgleich'+(r.next_run?' ('+esc(r.next_run)+')':'')):'✋ manuell';
+ :r.trigger==='live'?('⚡ '+esc(r.live_text)+' · Folgeaufgaben nach dem vollen Abgleich'+(r.next_run?' ('+esc(r.next_run)+')':'')):'✋ '+'manuell';
b.innerHTML='<div class="chainhead"><div class="nm"><b>'+esc(r.name)+'</b><small class="mut">'+how+'</small></div><small class="mut">Start der Kette</small></div><div class="drop"></div>';
const z=b.querySelector('.drop');items.forEach(id=>z.append(chainRow(D.jobs[id])));
if(!items.length)z.innerHTML='<div class="empty-drop">Aufgabe hierher ziehen</div>';
diff --git a/app/update.py b/app/update.py
new file mode 100644
index 0000000..04c2fcc
--- /dev/null
+++ b/app/update.py
@@ -0,0 +1,79 @@
+"""Pruefung auf eine neuere MirrorSync-Version ueber die GitHub-Releases-API.
+
+Abgefragt wird nur https://api.github.com/repos/<UPDATE_REPO>/releases/latest (ohne Daten ueber diese
+Installation, ausser der Version im User-Agent). Das Ergebnis liegt in der Datenbank (meta "update"), damit es
+einen Neustart uebersteht. Geprueft wird hoechstens alle INTERVAL Sekunden, abschaltbar in den Einstellungen.
+"""
+import json
+import os
+import re
+import time
+import urllib.request
+
+REPO = os.environ.get("UPDATE_REPO", "DerMilderJoghurt/mirrorsync")
+INTERVAL = 6 * 3600
+TIMEOUT = 10
+_db = None
+_version = "0"
+
+
+def init(db, version):
+ global _db, _version
+ _db, _version = db, version
+
+
+def parse(v):
+ """'v1.33.2' -> (1, 33, 2); unbrauchbar -> None."""
+ m = re.match(r"^v?(\d+)\.(\d+)\.(\d+)", (v or "").strip())
+ return tuple(int(x) for x in m.groups()) if m else None
+
+
+def newer(latest, current):
+ a, b = parse(latest), parse(current)
+ return bool(a and b and a > b)
+
+
+def _state():
+ st = (_db.meta("update") if _db else None) or {}
+ if isinstance(st, str):
+ try:
+ st = json.loads(st)
+ except ValueError:
+ st = {}
+ return st if isinstance(st, dict) else {}
+
+
+def check():
+ """Jetzt bei GitHub nachfragen. Gibt den neuen Zustand zurueck, Fehler stehen in 'error'."""
+ st = _state()
+ st["checked"] = time.strftime("%Y-%m-%d %H:%M:%S")
+ st["checked_ts"] = int(time.time())
+ try:
+ req = urllib.request.Request(f"https://api.github.com/repos/{REPO}/releases/latest",
+ headers={"Accept": "application/vnd.github+json",
+ "User-Agent": f"MirrorSync/{_version}"})
+ with urllib.request.urlopen(req, timeout=TIMEOUT) as r:
+ data = json.loads(r.read().decode("utf-8"))
+ tag = str(data.get("tag_name") or "")
+ if not parse(tag):
+ raise ValueError(f"unbekannte Versionsangabe {tag!r}")
+ st.update(latest=tag.lstrip("v"), url=str(data.get("html_url") or f"https://github.com/{REPO}/releases"),
+ published=str(data.get("published_at") or "")[:10], error="")
+ except Exception as e: # noqa: BLE001 - Netzwerk, JSON, HTTP: alles nur melden
+ st["error"] = str(e)[:300]
+ if _db:
+ _db.set_meta("update", json.dumps(st))
+ return st
+
+
+def due():
+ return int(time.time()) - int(_state().get("checked_ts") or 0) >= INTERVAL
+
+
+def status(enabled=True):
+ st = _state()
+ latest = st.get("latest") or ""
+ return {"enabled": bool(enabled), "current": _version, "latest": latest,
+ "update_available": bool(enabled) and newer(latest, _version),
+ "url": st.get("url") or f"https://github.com/{REPO}/releases", "published": st.get("published") or "",
+ "checked": st.get("checked") or "", "error": st.get("error") or "", "repo": REPO}
diff --git a/docker-compose.yml b/docker-compose.yml
index 1b81bd0..098b8a2 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -8,7 +8,7 @@
services:
mirrorsync:
- image: ghcr.io/dermilderjoghurt/mirrorsync:latest # or a fixed version, e.g. :1.33.2
+ image: ghcr.io/dermilderjoghurt/mirrorsync:latest # or a fixed version, e.g. :1.34.0
# Build it yourself instead of pulling (Dockerfile and app/ in the same folder):
# build: .
container_name: mirrorsync