-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90210f9
commit ca4643f
Showing
36 changed files
with
175 additions
and
625 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,12 +7,6 @@ SSH_HOST := '[email protected]' | |
default $FZF_DEFAULT_OPTS='--preview-window hidden': | ||
@just --choose | ||
|
||
update: | ||
curl -L https://raw.githubusercontent.com/unifi-utilities/unifios-utilities/main/cni-plugins/05-install-cni-plugins.sh -o ./on_boot.d/05-install-cni-plugins.sh | ||
curl -L https://raw.githubusercontent.com/unifi-utilities/unifios-utilities/main/dns-common/on_boot.d/10-dns.sh -o ./on_boot.d/10-dns.sh | ||
curl -L https://raw.githubusercontent.com/pedropombeiro/udm-utilities/master/run-pihole/custom_pihole_dote.sh -o ./scripts/upd_pihole_dote.sh | ||
chmod +x ./on_boot.d/*.sh ./scripts/*.sh | ||
|
||
_ssh cmd: | ||
ssh {{ SSH_FLAGS }} {{ SSH_HOST }} '{{ cmd }}' | ||
|
||
|
@@ -35,10 +29,10 @@ dns_config_cmd := ''' | |
just _rsync --delete ./pihole/ {{ SSH_HOST }}:/data/ | ||
just _rsync ./etc-pihole/ {{ SSH_HOST }}:/data/ | ||
just _ssh '{{ dns_config_cmd }}' | ||
just unbound-reload | ||
# just unbound-reload | ||
|
||
prepare_data_dir_cmd := ''' | ||
mkdir -p {{ REMOTE_ON_BOOT_D }} /data/scripts /data/podman | ||
mkdir -p {{ REMOTE_ON_BOOT_D }} /data/scripts | ||
rm -rf {{ REMOTE_ON_BOOT_D }}/*.sh /data/scripts/*.sh | ||
''' | ||
|
||
|
@@ -56,11 +50,12 @@ push-config: | |
@just _ssh '{{ prepare_data_dir_cmd }}' | ||
chmod +x ./on_boot.d/*.sh | ||
@just _rsync --delete ./on_boot.d/ {{ SSH_HOST }}:/data/ | ||
@just _rsync ./cronjobs/ ./etc-ddns-updater/ ./podman/cni/ ./scripts/ ./settings/ ./system/ {{ SSH_HOST }}:/data/ | ||
@just _rsync ./cronjobs/ ./custom ./etc-ddns-updater/ ./opt/ ./scripts/ ./settings/ ./system/ {{ SSH_HOST }}:/data/ | ||
@just _rsync --no-relative ./etc-systemd/ {{ SSH_HOST }}:/etc/systemd/ | ||
just push-dns-config | ||
@just _ssh '{{ REMOTE_ON_BOOT_D }}/25-add-cron-jobs.sh' | ||
|
||
push: push-config (_ssh '/data/scripts/upd_pihole_unbound.sh') | ||
push: push-config | ||
|
||
install-tools: (_ssh '/data/scripts/download-tools.sh') | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
custom/machines/debian-dns/etc/systemd/network/mv-br6.network
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[Match] | ||
Name=mv-br6 | ||
|
||
[Network] | ||
IPForward=yes | ||
Address=192.168.6.254/24 | ||
Gateway=192.168.6.1 |
9 changes: 9 additions & 0 deletions
9
custom/machines/debian-dns/etc/systemd/system/unbound-exporter.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Unit] | ||
Description=Unbound Exporter | ||
After=network-online.target | ||
|
||
[Service] | ||
ExecStart=/opt/unbound/bin/unbound-exporter | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[Exec] | ||
Boot=on | ||
ResolvConf=off | ||
Capability=CAP_SYS_NICE | ||
|
||
[Network] | ||
MACVLAN=br6 | ||
|
||
[Files] | ||
Bind=/data/etc-pihole:/etc/pihole | ||
Bind=/data/pihole/etc-dnsmasq.d/03-user.conf:/etc/dnsmasq.d/03-user.conf | ||
BindReadOnly=/data/pihole/hosts:/etc/hosts | ||
|
||
Bind=/data/unbound/etc/:/etc/unbound/ | ||
Bind=/data/unbound/lib/:/var/lib/unbound/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[Unit] | ||
Description=DDNS Updater | ||
After=network-online.target | ||
|
||
[Service] | ||
ExecStart=/data/opt/ddns-updater | ||
Environment=LISTENING_PORT=8001 | ||
Environment=PUBLICIP_DNS_PROVIDERS=cloudflare | ||
Environment=LOG_LEVEL=info | ||
Environment=LOG_CALLER=short | ||
Environment=TZ=Europe/Zurich | ||
Environment=BACKUP_PERIOD=0 | ||
Environment=BACKUP_DIRECTORY=/data/etc-ddns-updater | ||
Environment=DATADIR=/data/etc-ddns-updater | ||
Environment=PERIOD=5m | ||
Environment=UPDATE_COOLDOWN_PERIOD=5m | ||
Environment=PUBLICIP_FETCHERS=all | ||
Environment=PUBLICIP_HTTP_PROVIDERS=all | ||
Environment=PUBLICIPV4_HTTP_PROVIDERS=all | ||
Environment=PUBLICIPV6_HTTP_PROVIDERS=all | ||
Environment=PUBLICIP_DNS_PROVIDERS=all | ||
Environment=PUBLICIP_DNS_TIMEOUT=3s | ||
Environment=HTTP_TIMEOUT=10s | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Unit] | ||
Description=Multicast Relay | ||
After=network-online.target | ||
|
||
[Service] | ||
ExecStart=/usr/bin/python3 /tmp/sonosnet.py --noSonosDiscovery --interfaces eth8 br46 br56 br76 br96 | ||
ExecStartPre=/usr/bin/curl -o /tmp/sonosnet.py \ | ||
https://raw.githubusercontent.com/alsmith/multicast-relay/master/multicast-relay.py | ||
ExecStop=/bin/kill $(/usr/bin/pgrep -d " " -f " /tmp/sonosnet\.py ") | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[Unit] | ||
Description=Run On Startup UDM 3.x | ||
Wants=network-online.target | ||
After=network-online.target | ||
StartLimitIntervalSec=500 | ||
StartLimitBurst=5 | ||
|
||
[Service] | ||
Restart=on-failure | ||
RestartSec=5s | ||
ExecStart=bash -c 'mkdir -p /data/on_boot.d && find -L /data/on_boot.d -mindepth 1 -maxdepth 1 -type f -print0 | sort -z | xargs -0 -r -n 1 -- bash -c \'if test -x "$0"; then echo "%n: running $0"; "$0"; else case "$0" in *.sh) echo "%n: sourcing $0"; . "$0";; *) echo "%n: ignoring $0";; esac; fi\'' | ||
RemainAfterExit=true | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
# This script installs systemd-container if it's not installed. | ||
# Also links any containers from /data/custom/machines to /var/lib/machines. | ||
|
||
if ! dpkg -l systemd-container | grep ii >/dev/null; then | ||
if ! apt -y install systemd-container debootstrap; then | ||
yes | dpkg -i /data/custom/dpkg/*.deb | ||
fi | ||
fi | ||
|
||
mkdir -p /var/lib/machines | ||
for machine in $(ls /data/custom/machines/); do | ||
if [ ! -e "/var/lib/machines/$machine" ]; then | ||
ln -s "/data/custom/machines/$machine" "/var/lib/machines/" | ||
machinectl enable "$machine" | ||
machinectl start "$machine" | ||
fi | ||
done |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.