From 4b541a0b350f1882d97349e529b75bdcf9d6ac36 Mon Sep 17 00:00:00 2001 From: Grena Date: Sat, 9 Nov 2024 17:36:35 +0100 Subject: [PATCH 1/5] Add name --- config_panel.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/config_panel.toml b/config_panel.toml index b7e2471..50b90e3 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -1,6 +1,7 @@ version = "1.0" [main] +name = "Borg configuration" services = [] [main.state] From 917955350f9335b0f05a59fd7ece759e238674c3 Mon Sep 17 00:00:00 2001 From: Grena Date: Sat, 9 Nov 2024 17:37:52 +0100 Subject: [PATCH 2/5] Fix typo --- config_panel.toml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 50b90e3..50ea01a 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -17,7 +17,7 @@ services = [] [main.general] [main.general.info] ask = """\ - Backup state : {{state}} + Backup state: {{state}} Last run: {{last_run}} """ type = "alert" @@ -26,7 +26,7 @@ services = [] [main.general.repository] ask.en = "Repository" type = "string" - help = "Specify a local repository (`/mount/my_external_harddrive/backups`) or a remote repository (`ssh://USER@DOMAIN.TLD:PORT/~/backup`). If you plan to use a remote borgserver_ynh app : `USER` is *not* meant to be an existing user on the guest server, instead, it will be created *on the host server* during the installation of the Borg Server App. With borgserver_ynh apps you can't specify another repo path than `~/backup`." + help = "Specify a local repository (`/mount/my_external_harddrive/backups`) or a remote repository (`ssh://USER@DOMAIN.TLD:PORT/~/backup`). If you plan to use a remote borgserver_ynh app : `USER` is *not* meant to be an existing user on the guest server, instead, it will be created *on the host server* during the installation of the Borg Server App. With the Borg Server App, you can't specify another repo path than `~/backup`." [main.general.ssh_public_key] ask.en = "Public key: {ssh_public_key}" @@ -67,13 +67,15 @@ services = [] [main.content.apps] ask.en = "Apps" type = "tags" - help = "App list separated by comma. You can write 'all' to select all apps, even those installed after this borg app. You can also select all apps but some apps by writing 'exclude:' following by an app list separated by comma." + help = "App list separated by comma. You can write 'all' to select all apps, even those installed after this Borg app. You can also select all apps but some apps by writing 'exclude:' following by an app list separated by comma." [list] name = "Last backups list" services = [] + [list.list] name = "" + [list.list.last_backups] ask.en = "" type = "markdown" From dc8a022c62e5e10862069cb0d93e74555c0a7d79 Mon Sep 17 00:00:00 2001 From: Grena Date: Sat, 9 Nov 2024 17:38:21 +0100 Subject: [PATCH 3/5] Remove services options --- config_panel.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 50ea01a..5a8ac15 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -2,7 +2,6 @@ version = "1.0" [main] name = "Borg configuration" -services = [] [main.state] name = "" @@ -71,7 +70,6 @@ services = [] [list] name = "Last backups list" -services = [] [list.list] name = "" From 6e0086188e4af546084e6070b1ce53513f24155e Mon Sep 17 00:00:00 2001 From: Grena Date: Sat, 9 Nov 2024 17:41:44 +0100 Subject: [PATCH 4/5] Add FR translation --- config_panel.toml | 31 ++++++++++++++++++++++--------- scripts/config | 8 ++++++-- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 5a8ac15..53e95c3 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -1,7 +1,8 @@ version = "1.0" [main] -name = "Borg configuration" +name.en = "Borg configuration" +name.fr = "Configuration de Borg" [main.state] name = "" @@ -24,11 +25,14 @@ name = "Borg configuration" [main.general.repository] ask.en = "Repository" + ask.fr = "Dépôt" type = "string" - help = "Specify a local repository (`/mount/my_external_harddrive/backups`) or a remote repository (`ssh://USER@DOMAIN.TLD:PORT/~/backup`). If you plan to use a remote borgserver_ynh app : `USER` is *not* meant to be an existing user on the guest server, instead, it will be created *on the host server* during the installation of the Borg Server App. With the Borg Server App, you can't specify another repo path than `~/backup`." - + help.en = "Specify a local repository (`/mount/my_external_harddrive/backups`) or a remote repository (`ssh://USER@DOMAIN.TLD:PORT/~/backup`). If you plan to use a remote borgserver_ynh app : `USER` is *not* meant to be an existing user on the guest server, instead, it will be created *on the host server* during the installation of the Borg Server App. With the Borg Server App, you can't specify another repo path than `~/backup`." + help.fr = "Spécifier un dépôt local (`/mount/my_external_harddrive/backups`) ou un dépôt distant (`ssh://USER@DOMAIN.TLD:PORT/~/backup`). Si vous prévoyez d’utiliser une application borgserver_ynh distante : `USER` n'est *pas* censé être un utilisateur existant sur le serveur invité, il sera créé *sur le serveur hôte* lors de l’installation de l'application Borg Server. Avec l'application Borg Server, vous ne pouvez pas spécifier un autre chemin de dépôt que `~/backup`." + [main.general.ssh_public_key] ask.en = "Public key: {ssh_public_key}" + ask.fr = "Clé publique : {ssh_public_key}" type = "markdown" bind = "/root/.ssh/id___APP___ed25519.pub" @@ -36,44 +40,53 @@ name = "Borg configuration" ask.en = "When at at which frequency should the backups be performed?" ask.fr = "Quand et à quelle fréquence les sauvegardes doivent-elles être effectuées ?" type = "string" - help = "For example: `Monthly`, `Weekly`, `Daily` (=every day at midnight), `Hourly`, `Sat *-*-1..7 18:00:00` (=the first saturday of every month at 18:00), `4:00` (=every day at 4 AM), `5,17:00` (=every day at 5 AM and 5 PM). See the [systemd OnCalendar format for full syntax doc](https://wiki.archlinux.org/index.php/Systemd/Timers#Realtime_timer)" + help.en = "For example: `Monthly`, `Weekly`, `Daily` (=every day at midnight), `Hourly`, `Sat *-*-1..7 18:00:00` (=the first saturday of every month at 18:00), `4:00` (=every day at 4 AM), `5,17:00` (=every day at 5 AM and 5 PM). See the [systemd OnCalendar format for full syntax doc](https://wiki.archlinux.org/index.php/Systemd/Timers#Realtime_timer)" bind = "OnCalendar:/etc/systemd/system/__APP__.timer" [main.general.mailalert] ask.en = "Mail alert" + ask.fr = "Alerte mail" type = "select" choices.always = "Always" choices.errors_only = "Only if an error occured" choices.never = "Never alert me" - help = "Alerts are sent to the first user of this server" + help.en = "Alerts are sent to the first user of this server" + help.fr = "Les alertes sont envoyées au premier utilisateur de ce serveur" [main.content] - name = "What should be backed up?" + name.en = "What should be backed up?" + name.fr = "Que devrait-on sauvegarder ?" optional = false [main.content.conf] ask.en = "Configuration" + ask.fr = "Configuration" type = "boolean" [main.content.data] ask.en = "Data" + ask.fr = "Données" type = "boolean" [main.content.data_multimedia] ask.en = "Data multimedia" + ask.fr = "Données multimedia" type = "boolean" [main.content.apps] ask.en = "Apps" + ask.fr = "Apps" type = "tags" - help = "App list separated by comma. You can write 'all' to select all apps, even those installed after this Borg app. You can also select all apps but some apps by writing 'exclude:' following by an app list separated by comma." + help.en = "App list separated by comma. You can write 'all' to select all apps, even those installed after this Borg app. You can also select all apps but some apps by writing 'exclude:' following by an app list separated by comma." + help.fr = "Liste d'applications séparées par des virgules. Vous pouvez écrire 'all' pour sélectionner toutes les applications, même celles installées après cette application Borg. Vous pouvez également sélectionner toutes les applications, mais certaines applications en écrivant 'exclure:' après une liste d’applications séparées par des virgules." [list] -name = "Last backups list" +name.en = "Last backups list" +name.fr = "Liste des dernières sauvegardes" [list.list] name = "" [list.list.last_backups] - ask.en = "" + ask = "" type = "markdown" diff --git a/scripts/config b/scripts/config index edb17a7..8b96e32 100644 --- a/scripts/config +++ b/scripts/config @@ -13,9 +13,12 @@ borg="$install_dir/venv/bin/borg" get__info() { cat << EOF ask: - en: "**Backup state**: ${old[state]} + en: "**Backup state:** ${old[state]} **Last run**: ${old[last_run]}" + fr: "**État de la sauvegarde :** ${old[state]} + + **Dernière exécution :** ${old[last_run]}" EOF if [ "${old[state]}" == "failed" ]; then cat << EOF @@ -35,7 +38,8 @@ EOF get__ssh_public_key() { cat << EOF ask: - en: "**Public key**: \`$(cat /root/.ssh/id_${app}_ed25519.pub || echo '')\`" + en: "**Public key:** \`$(cat /root/.ssh/id_${app}_ed25519.pub || echo '')\`" + fr: "**Clé publique :** \`$(cat /root/.ssh/id_${app}_ed25519.pub || echo '')\`" EOF } From 8d5ae6d8dcc52072213eea21a6c03c1455c49892 Mon Sep 17 00:00:00 2001 From: Grena Date: Sat, 9 Nov 2024 18:55:27 +0100 Subject: [PATCH 5/5] Update public key display --- config_panel.toml | 8 ++++---- scripts/config | 8 ++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 53e95c3..c680a8c 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -31,10 +31,10 @@ name.fr = "Configuration de Borg" help.fr = "Spécifier un dépôt local (`/mount/my_external_harddrive/backups`) ou un dépôt distant (`ssh://USER@DOMAIN.TLD:PORT/~/backup`). Si vous prévoyez d’utiliser une application borgserver_ynh distante : `USER` n'est *pas* censé être un utilisateur existant sur le serveur invité, il sera créé *sur le serveur hôte* lors de l’installation de l'application Borg Server. Avec l'application Borg Server, vous ne pouvez pas spécifier un autre chemin de dépôt que `~/backup`." [main.general.ssh_public_key] - ask.en = "Public key: {ssh_public_key}" - ask.fr = "Clé publique : {ssh_public_key}" - type = "markdown" - bind = "/root/.ssh/id___APP___ed25519.pub" + ask.en = "Public key" + ask.fr = "Clé publique" + type = "string" + readonly = true [main.general.on_calendar] ask.en = "When at at which frequency should the backups be performed?" diff --git a/scripts/config b/scripts/config index 8b96e32..9798839 100644 --- a/scripts/config +++ b/scripts/config @@ -18,7 +18,7 @@ ask: **Last run**: ${old[last_run]}" fr: "**État de la sauvegarde :** ${old[state]} - **Dernière exécution :** ${old[last_run]}" + **Dernière exécution :** ${old[last_run]}" EOF if [ "${old[state]}" == "failed" ]; then cat << EOF @@ -36,11 +36,7 @@ EOF } get__ssh_public_key() { - cat << EOF -ask: - en: "**Public key:** \`$(cat /root/.ssh/id_${app}_ed25519.pub || echo '')\`" - fr: "**Clé publique :** \`$(cat /root/.ssh/id_${app}_ed25519.pub || echo '')\`" -EOF + echo $(cat /root/.ssh/id_${app}_ed25519.pub || echo '') } get__data_multimedia() {