diff --git a/README.md b/README.md index b489aa7..143c1b9 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,12 @@ A shell script with the goal to make the UDM-Pro silenced while still having goo A split tunnel VPN script for the UDM with policy based routing. This helper script can be used on your UDM to route select VLANs, clients, or even domains through a VPN connection. It supports OpenVPN, WireGuard, and OpenConnect (Cisco AnyConnect) clients running directly on your UDM, and external VPN clients running on other servers on your network. +### rclone + + + +Run rclone container with Web GUI for offsite backups. + ## Unsupported / No longer maintained ### nextdns Run NextDNS on your UDM with podman. diff --git a/homebridge/README.md b/homebridge/README.md index d8b8ed8..c7062fc 100644 --- a/homebridge/README.md +++ b/homebridge/README.md @@ -1,26 +1,20 @@ # Run Homebridge on your UDM ### Features -1. Run [Homebridge](https://homebridge.io/) on your UDM. +1. Run [Homebridge](https://homebridge.io/) on your UDM(P). 2. Integrate Unifi Protect cameras in HomeKit via `homebridge-unifi-protect`. 3. Persists through reboots and firmware updates. ### Requirements 1. You have successfully setup the on boot script described [here](https://github.com/boostchicken/udm-utilities/tree/master/on-boot-script). 2. You have applied [container-common](https://github.com/boostchicken/udm-utilities/tree/master/container-common) change to prevent UDM storage to fill up with Homebridge logs and addon error messages that can move fast. - -### Customization - -- Update [90-homebridge.conflist](cni/90-homebridge.conflist) to match your network: - - Change `"bridge": "br0"` to the appropriate VLAN for your network. - - Update `"subnet"` and `"gateway"` to match that VLAN. - - If you want a specific IP assigned, update `"rangeStart"` and `"rangeEnd"`. Otherwise those properties can be deleted. +3. You have applied [cni-plugins](https://github.com/boostchicken/udm-utilities/tree/master/cni-plugins "cni-plugins") to setup for cni configeration. (You dont need the configeration files, just place the script in the on boot folder.) ### Steps -1. `mkdir -p /mnt/data/homebridge/run` -2. Copy [25-homebridge.sh](on_boot.d/25-homebridge.sh) to `/mnt/data/on_boot.d`. -3. Copy [90-homebridge.conflist](cni/90-homebridge.conflist) to `/mnt/data/podman/cni`. This will create the podman network that bridges the container to your VLAN. +1. Type this command: `mkdir -p /mnt/data/homebridge/run` +2. Copy [25-homebridge.sh](on_boot.d/25-homebridge.sh) to `/mnt/data/on_boot.d`. To do this, cd into `/mnt/data/on_boot.d`, then type `vim 25-homebridge.sh` then go to [this page](https://raw.githubusercontent.com/boostchicken/udm-utilities/master/homebridge/on_boot.d/25-homebridge.sh "this page") and copy everything using CTRL + A and then CTRL + C and then paste it into vim then click ESC and then type `:x` then click the enter key. +3. Copy [90-homebridge.conflist](cni/90-homebridge.conflist) to `/mnt/data/podman/cni`. This will create the podman network that bridges the container to your VLAN. To do this, cd into `/mnt/data/podman/cni` and type `vim 90-homebridge.conflist` then go to [this page](https://raw.githubusercontent.com/boostchicken/udm-utilities/master/homebridge/cni/90-homebridge.conflist "this page") and the press CTRL + A and then CTRL + C and then paste it into vim and click ESC and then type `:x` then click the enter key. 4. Run the Homebridge docker container. Change the timezone (`-e TZ`) to match your timezone, and DNS (`--dns`) to match your VLAN gateway. ```shell script @@ -41,3 +35,10 @@ 5. Access the Homebridge UI based on the IP you assigned, like [http://192.168.1.20/](http://192.168.1.20/). 6. If using the UDM Pro, the `homebridge-unifi-protect` plugin can be installed via the Homebridge UI to integrate Unifi Protect cameras. + +### Customization + +- Update [90-homebridge.conflist](cni/90-homebridge.conflist) to match your network: + - Change `"bridge": "br0"` to the appropriate VLAN for your network. + - Update `"subnet"` and `"gateway"` to match that VLAN. + - If you want a specific IP assigned, update `"rangeStart"` and `"rangeEnd"`. Otherwise those properties can be deleted. \ No newline at end of file diff --git a/rclone/10-rclone.sh b/rclone/10-rclone.sh new file mode 100644 index 0000000..a14029f --- /dev/null +++ b/rclone/10-rclone.sh @@ -0,0 +1,21 @@ +#!/bin/sh +CONTAINER=rclone + +if podman container exists "$CONTAINER"; then + podman start "$CONTAINER" +else + podman run -i -d --rm \ + --net=host \ + -v /mnt/data/rclone:/data/backups/rclone \ + -v /mnt/data/pihole:/data/backups/pihole \ + -v /mnt/data/on_boot.d:/data/backups/on_boot.d \ + -v /data/unifi/data/backup/autobackup:/data/backups//data/unifi/data/backup/autobackup \ + -v /mnt/data/podman/cni:/data/backups/podman/cni \ + -v /mnt/data/rclone:/config/rclone \ + -v /mnt/data/rclone/sync.sh:/data/sync.sh \ + --name "$CONTAINER" \ + --security-opt=no-new-privileges \ + rclone/rclone:latest \ + rcd --rc-web-gui --rc-addr :5572 \ + --rc-user rclone --rc-pass randompassword12345 +fi \ No newline at end of file diff --git a/rclone/README.md b/rclone/README.md new file mode 100644 index 0000000..9e6c4b7 --- /dev/null +++ b/rclone/README.md @@ -0,0 +1,33 @@ +# Rclone + +## Features + +- Rclone w/ WebGUI + +## Requirements + +1. You have successfully setup the on boot script described [here](https://github.com/boostchicken/udm-utilities/tree/master/on-boot-script) + +## Steps + +1. Make a directory for your configuration + + ```sh + mkdir -p /mnt/data/rclone + ``` + +2. Create [rclone.conf](https://rclone.org/commands/rclone_config/) in `/mnt/data/rclone` and update it to meet yours needs. +3. Copy [sync.sh](sync.sh) in `/mnt/data/rclone` and update it to meet your needs. +4. Copy [10-rclone.sh](10-rclone.sh) to `/mnt/data/on_boot.d` and update it to meet your needs. +5. Execute `/mnt/data/on_boot.d/10-rclone.sh` +6. Execute `podman logs rclone`, this will provide a link to the Web GUI. +7. Copy [rclone](rclone) in `/etc/cron.hourly/`. +8. Set permissions to executable `chmod +x /etc/cron.hourly/rclone`. + +## Customization + +1. Login to run rclone commands locally to create and test configs + + ```sh + podman exec -ti rclone /bin/sh + ``` diff --git a/rclone/rclone b/rclone/rclone new file mode 100644 index 0000000..1764bca --- /dev/null +++ b/rclone/rclone @@ -0,0 +1,3 @@ +#!/bin/sh + +podman exec -ti rclone sh -x /data/sync.sh \ No newline at end of file diff --git a/rclone/sync.sh b/rclone/sync.sh new file mode 100644 index 0000000..47316b6 --- /dev/null +++ b/rclone/sync.sh @@ -0,0 +1,2 @@ +# sync job for cron +rclone sync Unifi:/data/backups google:backups \ No newline at end of file diff --git a/zerotier-one/20-zerotier.sh b/zerotier-one/20-zerotier.sh index d917ac7..cda56b0 100755 --- a/zerotier-one/20-zerotier.sh +++ b/zerotier-one/20-zerotier.sh @@ -1,7 +1,7 @@ #!/bin/sh CONTAINER=zerotier-one -# Starts a wireguard container that is deleted after it is stopped. -# All configs stored in /mnt/data/wireguard +# Starts a ZeroTier container that is deleted after it is stopped. +# All configs stored in /mnt/data/zerotier-one if podman container exists ${CONTAINER}; then podman start ${CONTAINER} else