Skip to content

Commit

Permalink
Merge pull request #65 from ikifar2012/dev
Browse files Browse the repository at this point in the history
2022.9.0
  • Loading branch information
ikifar2012 authored Sep 3, 2022
2 parents b2085b9 + 9a0432e commit bae7265
Show file tree
Hide file tree
Showing 8 changed files with 393 additions and 242 deletions.
28 changes: 28 additions & 0 deletions remote-backup/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
# 2022.9.0

## Please read before upgrading

**This release includes a ton of breaking changes**
**Please read the documentation carefully before upgrading**
**Be aware that some of the configuration options have been renamed and may overwrite your current settings**

Please backup your configuration before upgrading by clicking the vertical dots in the top right corner of the add-on configuration page
and click "Edit in YAML", you can then copy that to a text file and map those settings to their new config options as per the
[documentation](https://addons.mathesonsteplock.ca/docs/addons/remote-backup/basic-config).

- enable rsync key-based authentication #51
- changed logging to bashio logger #52
- Rsync cleanup #54
- Configuration documentation #56
- Replace zip password with built in backup password #57
- renamed and resorted configuration #58
- Improve error handling #59
- Security enhancements #60
- Bump base image to 12.2.3
- added SFTP/SCP fallback and password auth #64
- Restore rclone config option #66

Huge thanks to [@patman15](https://github.com/patman15) for all of his work this release!

**Full Changelog**: https://github.com/ikifar2012/remote-backup-addon/compare/2022.7.2...2022.9.0

# 2022.7.2

- Add init to config.yml to solve `s6-overlay-suexec: fatal: can only run as pid 1`
Expand Down
4 changes: 4 additions & 0 deletions remote-backup/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Please visit the documentation at [addons.mathesonsteplock.ca](https://addons.mathesonsteplock.ca/docs/addons/remote-backup/basic-config)

## Security
For SSH and rsync operation it is recommend to add the public key of the remote host to the file `/ssl/known_hosts`. If you see a warning `Missing known_hosts file!` then you have not done so and the add-on automatically does it for you each time it is called.
**Note that this is a security risk** which can be fixed by executing `ssh-keyscan -t rsa <remote host> >> /ssl/known_hosts` from a terminal, e.g. [SSH & Web Terminal](https://github.com/hassio-addons/addon-ssh).

# Support Me

[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/mathesonsteplock)
13 changes: 3 additions & 10 deletions remote-backup/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,12 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV LANG C.UTF-8

# Setup base
RUN apk add --no-cache jq openssh-client zip sshpass rsync wget curl unzip
RUN apk add --no-cache jq openssh-client sshpass rsync curl unzip

# Rclone CLI
ARG BUILD_ARCH
RUN curl https://rclone.org/install.sh | bash


# Hass.io CLI
ARG BUILD_ARCH
ARG CLI_VERSION
RUN wget -O /usr/bin/ha "https://github.com/home-assistant/cli/releases/download/4.18.0/ha_${BUILD_ARCH}" \
&& chmod a+x /usr/bin/ha

# Copy data
COPY run.sh /
RUN chmod a+x run.sh
Expand All @@ -33,12 +26,12 @@ ARG BUILD_VERSION
# Labels
LABEL \
io.hass.name="Remote Backup" \
io.hass.description="Automatically create and backup HA snapshots using SCP" \
io.hass.description="Automatically create and transfer HA backups using SFTP (SCP), rsync." \
io.hass.arch="${BUILD_ARCH}" \
io.hass.type="addon" \
io.hass.version=${BUILD_VERSION} \
maintainer="Matheson Steplock <mathesonsteplock.ca>" \
org.label-schema.description="Automatically create and backup HA snapshots using SCP" \
org.label-schema.description="Automatically create and transfer HA backups using SFTP (SCP), rsync." \
org.label-schema.build-date=${BUILD_DATE} \
org.label-schema.name="Remote Backup" \
org.label-schema.schema-version="1.0" \
Expand Down
31 changes: 31 additions & 0 deletions remote-backup/apparmor.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include <tunables/global>

profile ADDON_SLUG flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/base>

# Capabilities
file,
signal (send) set=(kill,term,int,hup,cont),

# S6-Overlay
/init ix,
/bin/** ix,
/usr/bin/rsync ix,
/usr/bin/scp ix,
/usr/bin/rclone ix,
/run/{s6,s6-rc*,service}/** ix,
/package/** ix,
/command/** ix,
/etc/services.d/** rwix,
/etc/cont-init.d/** rwix,
/etc/cont-finish.d/** rwix,
/run/{,**} rwk,
/dev/tty rw,

# Bashio
/usr/lib/bashio/** ix,
/tmp/** rwk,

# Access to options.json and other files within your addon
/data/** rw,
}
10 changes: 5 additions & 5 deletions remote-backup/build.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
squash: false
build_from:
aarch64: ghcr.io/hassio-addons/base/aarch64:12.2.1
amd64: ghcr.io/hassio-addons/base/amd64:12.2.1
armhf: ghcr.io/hassio-addons/base/armhf:12.2.1
armv7: ghcr.io/hassio-addons/base/armv7:12.2.1
i386: ghcr.io/hassio-addons/base/i386:12.2.1
aarch64: ghcr.io/hassio-addons/base/aarch64:12.2.3
amd64: ghcr.io/hassio-addons/base/amd64:12.2.3
armhf: ghcr.io/hassio-addons/base/armhf:12.2.3
armv7: ghcr.io/hassio-addons/base/armv7:12.2.3
i386: ghcr.io/hassio-addons/base/i386:12.2.3
codenotary:
signer: [email protected]
base_image: [email protected]
77 changes: 32 additions & 45 deletions remote-backup/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Remote Backup
version: "2022.7.2"
version: "2022.9.0"
slug: remote_backup
description: Automatically create and backup HA backups using SCP
description: Automatically create and transfer HA backups using SFTP (SCP), rsync, or rclone (experimental)
image: ikifar/remote-backup-{arch}
url: https://addons.mathesonsteplock.ca/docs/addons/remote-backup/basic-config
codenotary: [email protected]
Expand All @@ -17,69 +17,56 @@ arch:
homeassistant: "2021.9.0"
hassio_api: true
hassio_role: manager
homeassistant_api: true
map:
- config
- addons
- share
- ssl
- backup:rw
- backup

options:
debug: false
remote_host: null
remote_port: 22
remote_user: null
remote_key: ""
backup_friendly_name: true
backup_custom_prefix: Automated backup
backup_keep_local: "all"
ssh_enabled: true
friendly_name: true
custom_prefix: Automated backup
ssh_host: ""
ssh_port: 22
ssh_user: ""
ssh_key: ""
ssh_host_key_algorithms: ""
exclude_folders: []
exclude_addons: []
remote_directory: ""
backup_password: ""
keep_local_backup: "all"
ssh_remote_directory: "hassio-backup"
rsync_enabled: false
rsync_host: ""
rsync_rootfolder: hassio-sync
rsync_exclude:
- "/config/*.db-shm"
- "/config/*.db-wal"
- "/config/*.db"
rsync_user: ""
rsync_password: ""
rclone_enabled: false
rclone_copy: false
rclone_sync: false
rclone_restore: false
rclone_remote: ""
rclone_remote_directory: ""

schema:
debug: bool?
ssh_enabled: bool?
friendly_name: bool?
custom_prefix: str?
ssh_host: str?
ssh_port: port?
ssh_user: str?
ssh_key: str?
ssh_host_key_algorithms: str?
exclude_folders:
- match(^[A-Za-z0-9_\-\.\*\/\?\+\\]*$)?
exclude_addons:
remote_host: str
remote_port: port
remote_user: str
remote_password: str?
remote_key: str?
remote_host_key_algorithms: str?
backup_friendly_name: bool?
backup_custom_prefix: str?
backup_exclude_folders:
- match(^[A-Za-z0-9_\-\.\*\/\?\+\\ ]*$)?
backup_exclude_addons:
- str?
remote_directory: str?
backup_keep_local: match(^(all|[+]?\d*)$)?
backup_password: str?
keep_local_backup: match(^(all|[+]?\d*)$)
rsync_enabled: bool?
rsync_host: str?
ssh_enabled: bool
ssh_remote_directory: str?
rsync_enabled: bool
rsync_rootfolder: str?
rsync_exclude:
- match(^[A-Za-z0-9_\-\.\*\/\?\+\\]+$)
rsync_user: str?
rsync_password: str?
- match(^[A-Za-z0-9_\-\.\*\/\?\+\\ ]+$)?
rclone_enabled: bool?
rclone_remote_directory: str?
rclone_remote_host: str?
rclone_copy: bool?
rclone_sync: bool?
rclone_restore: bool?
rclone_remote: str?
rclone_remote_directory: str?
Loading

0 comments on commit bae7265

Please sign in to comment.