mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-06-10 08:37:02 +00:00
only check for exit code 81
Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
@@ -19,14 +19,14 @@ get_expiration_time() {
|
|||||||
DURATION_READABLE=$(printf "%02d hours %02d minutes %02d seconds" $DURATION_HOUR $DURATION_MIN $DURATION_SEC)
|
DURATION_READABLE=$(printf "%02d hours %02d minutes %02d seconds" $DURATION_HOUR $DURATION_MIN $DURATION_SEC)
|
||||||
}
|
}
|
||||||
# Run "borg info" and handle the exit code.
|
# Run "borg info" and handle the exit code.
|
||||||
# If the exit code indicates a connection failure (80 = ConnectionClosed,
|
# If the exit code indicates a connection failure
|
||||||
# 81 = ConnectionClosedWithHint) and a remote repo is configured, the SSH
|
# (81 = ConnectionClosedWithHint) and a remote repo is configured, the SSH
|
||||||
# auth error signal file is created so the mastercontainer can show a
|
# auth error signal file is created so the mastercontainer can show a
|
||||||
# targeted error message. Returns the original borg exit code.
|
# targeted error message. Returns the original borg exit code.
|
||||||
borg_info() {
|
borg_info() {
|
||||||
borg "$BORG_LOG_LEVEL_FLAG" info > /dev/null
|
borg "$BORG_LOG_LEVEL_FLAG" info > /dev/null
|
||||||
local _exit=$?
|
local _exit=$?
|
||||||
if [ -n "$BORG_REMOTE_REPO" ] && { [ "$_exit" -eq 80 ] || [ "$_exit" -eq 81 ]; }; then
|
if [ -n "$BORG_REMOTE_REPO" ] && [ "$_exit" -eq 81 ]; then
|
||||||
touch "$SSH_AUTH_ERROR_FILE"
|
touch "$SSH_AUTH_ERROR_FILE"
|
||||||
fi
|
fi
|
||||||
return $_exit
|
return $_exit
|
||||||
@@ -34,7 +34,7 @@ borg_info() {
|
|||||||
|
|
||||||
# Signal file written when an SSH authentication failure is detected so the
|
# Signal file written when an SSH authentication failure is detected so the
|
||||||
# mastercontainer can show a targeted error without needing to scan container logs.
|
# mastercontainer can show a targeted error without needing to scan container logs.
|
||||||
# Borg exit codes 80 (ConnectionClosed) and 81 (ConnectionClosedWithHint) indicate
|
# Borg exit code 81 (ConnectionClosedWithHint) indicate
|
||||||
# connection failures that occur before the Borg protocol is established, which covers
|
# connection failures that occur before the Borg protocol is established, which covers
|
||||||
# SSH authentication errors and host-key verification failures.
|
# SSH authentication errors and host-key verification failures.
|
||||||
# These codes are available because BORG_EXIT_CODES=modern is set in start.sh.
|
# These codes are available because BORG_EXIT_CODES=modern is set in start.sh.
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ else
|
|||||||
fi
|
fi
|
||||||
export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes
|
export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes
|
||||||
export BORG_RELOCATED_REPO_ACCESS_IS_OK=yes
|
export BORG_RELOCATED_REPO_ACCESS_IS_OK=yes
|
||||||
# Use specific exit codes (80/81 for connection failures) instead of the legacy generic exit code 2
|
# Use specific exit codes (81 for ssh connection failures) instead of the legacy generic exit code 2
|
||||||
export BORG_EXIT_CODES=modern
|
export BORG_EXIT_CODES=modern
|
||||||
if [ -n "$BORG_REMOTE_REPO" ]; then
|
if [ -n "$BORG_REMOTE_REPO" ]; then
|
||||||
export BORG_REPO="$BORG_REMOTE_REPO"
|
export BORG_REPO="$BORG_REMOTE_REPO"
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
- [ ] The page should now reload
|
- [ ] The page should now reload
|
||||||
- [ ] Now click on `Create backup`
|
- [ ] Now click on `Create backup`
|
||||||
- [ ] After the first failed backup attempt with a remote repo, the page should show **"The initial backup was not successful."** and one of two things depending on why it failed:
|
- [ ] After the first failed backup attempt with a remote repo, the page should show **"The initial backup was not successful."** and one of two things depending on why it failed:
|
||||||
- [ ] **SSH auth error** (exit codes 80/81 – connection closed before Borg protocol established): a prominent ⚠️ **"SSH key not authorized on the remote server."** warning should appear with the public key displayed. After adding the key to `~/.ssh/authorized_keys` on the remote server, click **Create backup** again to retry.
|
- [ ] **SSH auth error** (exit code 81 – connection closed before Borg protocol established): a prominent ⚠️ **"SSH key not authorized on the remote server."** warning should appear with the public key displayed. After adding the key to `~/.ssh/authorized_keys` on the remote server, click **Create backup** again to retry.
|
||||||
- [ ] **Other error** (wrong path, unreachable host, etc.): instead of the ⚠️ warning, a **"Reset backup location"** button should appear (with a confirmation prompt) that allows resetting the configured location so a new one can be entered. Note: there are no longer inline text inputs to re-enter the location at this point.
|
- [ ] **Other error** (wrong path, unreachable host, etc.): instead of the ⚠️ warning, a **"Reset backup location"** button should appear (with a confirmation prompt) that allows resetting the configured location so a new one can be entered. Note: there are no longer inline text inputs to re-enter the location at this point.
|
||||||
- [ ] After authorizing the SSH key on the remote, scroll down and click on `Create backup` again to create another backup. This time it should succeed.
|
- [ ] After authorizing the SSH key on the remote, scroll down and click on `Create backup` again to create another backup. This time it should succeed.
|
||||||
- [ ] The initial Nextcloud credentials on top of the page that are visible when the containers are running should now be hidden in a details tag
|
- [ ] The initial Nextcloud credentials on top of the page that are visible when the containers are running should now be hidden in a details tag
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ For the below to work, you need a backup archive of an AIO instance and the loca
|
|||||||
- [ ] Enter a valid remote borg repo URL and the correct backup password:
|
- [ ] Enter a valid remote borg repo URL and the correct backup password:
|
||||||
- [ ] Should reload and should hide all options except the option to test the path and password
|
- [ ] Should reload and should hide all options except the option to test the path and password
|
||||||
- [ ] After the first failed connection attempt, the behavior depends on the failure reason:
|
- [ ] After the first failed connection attempt, the behavior depends on the failure reason:
|
||||||
- [ ] **SSH auth error** (exit codes 80/81 – connection closed before Borg protocol established): a prominent ⚠️ **"SSH key not authorized on the remote server."** warning should appear with the SSH public key displayed and instructions to add it to `~/.ssh/authorized_keys` on the remote server. After adding the key, scroll down and click on the test button again.
|
- [ ] **SSH auth error** (exit code 81 – connection closed before Borg protocol established): a prominent ⚠️ **"SSH key not authorized on the remote server."** warning should appear with the SSH public key displayed and instructions to add it to `~/.ssh/authorized_keys` on the remote server. After adding the key, scroll down and click on the test button again.
|
||||||
- [ ] **Other error** (wrong path, unreachable host, etc.): a generic message should appear noting the public key that may still need to be authorized on the remote.
|
- [ ] **Other error** (wrong path, unreachable host, etc.): a generic message should appear noting the public key that may still need to be authorized on the remote.
|
||||||
- [ ] After authorizing the key on the remote server, scroll down and click on the test button again. This time it should succeed and show the options to check the integrity and list backup archives
|
- [ ] After authorizing the key on the remote server, scroll down and click on the test button again. This time it should succeed and show the options to check the integrity and list backup archives
|
||||||
- [ ] After the test you should see the options to check the integrity of the backup and a list of backup archives that you can choose from to restore your instance
|
- [ ] After the test you should see the options to check the integrity of the backup and a list of backup archives that you can choose from to restore your instance
|
||||||
|
|||||||
Reference in New Issue
Block a user