Compare commits

...

15 commits

Author SHA1 Message Date
dcd2ebc49c
dist-upgrade -> full-upgrade 2025-01-16 10:20:34 +01:00
555350eab7
debian update 2025-01-16 10:20:18 +01:00
e117acac04
backup all doesnt stop on first error 2025-01-09 23:41:21 +01:00
16313b9e40
disable tasnomta charge 2025-01-09 22:45:27 +01:00
033a1cf6e5
macbook gnu grep 2025-01-01 13:04:42 +01:00
8befec9769
readme git sign 2024-12-09 09:07:19 +01:00
d22add5bfd
shortcut 2024-12-09 09:03:14 +01:00
69fb93a664
macbook compat 2024-12-09 08:58:14 +01:00
f4b59dc702
stuff 2024-11-23 15:58:10 +01:00
17aa3d7e48
no wg while at home 2024-11-23 14:50:49 +01:00
8bb9dae45c
all via usb interface, internal is broken 2024-11-23 14:50:40 +01:00
c244645020
kea deps 2024-11-23 14:50:22 +01:00
64029d2147
freescout readme 2024-11-23 11:51:31 +01:00
8081f12315
freescout comment 2024-11-23 11:18:11 +01:00
4ec2d5192a
freescout repair? 2024-11-23 11:02:28 +01:00
13 changed files with 95 additions and 50 deletions

View file

@ -37,3 +37,12 @@ fi
telegraf: execd for daemons telegraf: execd for daemons
TEST TEST
# git signing
git config --global gpg.format ssh
git config --global commit.gpgsign true
git config user.name CroneKorkN
git config user.email i@ckn.li
git config user.signingkey "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILMVroYmswD4tLk6iH+2tvQiyaMe42yfONDsPDIdFv6I"

View file

@ -23,7 +23,7 @@ for node in nodes:
print(node.run('DEBIAN_FRONTEND=noninteractive apt update').stdout.decode()) print(node.run('DEBIAN_FRONTEND=noninteractive apt update').stdout.decode())
print(node.run('DEBIAN_FRONTEND=noninteractive apt list --upgradable').stdout.decode()) print(node.run('DEBIAN_FRONTEND=noninteractive apt list --upgradable').stdout.decode())
if int(node.run('DEBIAN_FRONTEND=noninteractive apt list --upgradable 2> /dev/null | grep upgradable | wc -l').stdout.decode()): if int(node.run('DEBIAN_FRONTEND=noninteractive apt list --upgradable 2> /dev/null | grep upgradable | wc -l').stdout.decode()):
print(node.run('DEBIAN_FRONTEND=noninteractive apt -y dist-upgrade').stdout.decode()) print(node.run('DEBIAN_FRONTEND=noninteractive apt -qy full-upgrade').stdout.decode())
# REBOOT IN ORDER # REBOOT IN ORDER

View file

@ -1,13 +1,31 @@
#!/bin/bash #!/bin/bash
set -exu set -u
# FIXME: inelegant # FIXME: inelegant
% if wol_command: % if wol_command:
${wol_command} ${wol_command}
% endif % endif
exit=0
failed_paths=""
for path in $(jq -r '.paths | .[]' < /etc/backup/config.json) for path in $(jq -r '.paths | .[]' < /etc/backup/config.json)
do do
echo backing up $path
/opt/backup/backup_path "$path" /opt/backup/backup_path "$path"
# set exit to 1 if any backup fails
if [ $? -ne 0 ]
then
echo ERROR: backing up $path failed >&2
exit=5
failed_paths="$failed_paths $path"
fi
done done
if [ $exit -ne 0 ]
then
echo "ERROR: failed to backup paths: $failed_paths" >&2
fi
exit $exit

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
set -exu set -eu
path=$1 path=$1
uuid=$(jq -r .client_uuid < /etc/backup/config.json) uuid=$(jq -r .client_uuid < /etc/backup/config.json)

View file

@ -11,3 +11,13 @@ Enter it again:
freescout=# freescout=#
\q \q
``` ```
# problems
# check if /opt/freescout/.env is resettet
# ckeck `psql -h localhost -d freescout -U freescout -W`with pw from .env
# chown -R www-data:www-data /opt/freescout
# sudo su - www-data -c 'php /opt/freescout/artisan freescout:clear-cache' -s /bin/bash
# javascript funny? `sudo su - www-data -c 'php /opt/freescout/artisan storage:link' -s /bin/bash`
# benutzer bilder weg? aus dem backup holen: `/opt/freescout/.zfs/snapshot/zfs-auto-snap_hourly-2024-11-22-1700/storage/app/public/users` `./customers`

View file

@ -12,33 +12,33 @@ directories = {
} }
actions = { actions = {
'clone_freescout': { # 'clone_freescout': {
'command': run_as('www-data', 'git clone https://github.com/freescout-helpdesk/freescout.git /opt/freescout'), # 'command': run_as('www-data', 'git clone https://github.com/freescout-helpdesk/freescout.git /opt/freescout'),
'unless': 'test -e /opt/freescout/.git', # 'unless': 'test -e /opt/freescout/.git',
'needs': [ # 'needs': [
'pkg_apt:git', # 'pkg_apt:git',
'directory:/opt/freescout', # 'directory:/opt/freescout',
], # ],
}, # },
'pull_freescout': { # 'pull_freescout': {
'command': run_as('www-data', 'git -C /opt/freescout fetch origin dist && git -C /opt/freescout reset --hard origin/dist && git -C /opt/freescout clean -f'), # 'command': run_as('www-data', 'git -C /opt/freescout fetch origin dist && git -C /opt/freescout reset --hard origin/dist && git -C /opt/freescout clean -f'),
'unless': run_as('www-data', 'git -C /opt/freescout fetch origin && git -C /opt/freescout status -uno | grep -q "Your branch is up to date"'), # 'unless': run_as('www-data', 'git -C /opt/freescout fetch origin && git -C /opt/freescout status -uno | grep -q "Your branch is up to date"'),
'needs': [ # 'needs': [
'action:clone_freescout', # 'action:clone_freescout',
], # ],
'triggers': [ # 'triggers': [
'action:freescout_artisan_update', # 'action:freescout_artisan_update',
f'svc_systemd:php{php_version}-fpm.service:restart', # f'svc_systemd:php{php_version}-fpm.service:restart',
], # ],
}, # },
'freescout_artisan_update': { # 'freescout_artisan_update': {
'command': run_as('www-data', 'php /opt/freescout/artisan freescout:after-app-update'), # 'command': run_as('www-data', 'php /opt/freescout/artisan freescout:after-app-update'),
'triggered': True, # 'triggered': True,
'needs': [ # 'needs': [
f'svc_systemd:php{php_version}-fpm.service:restart', # f'svc_systemd:php{php_version}-fpm.service:restart',
'action:pull_freescout', # 'action:pull_freescout',
], # ],
}, # },
} }
# svc_systemd = { # svc_systemd = {

View file

@ -15,6 +15,7 @@ svc_systemd = {
'needs': [ 'needs': [
'pkg_apt:kea-dhcp4-server', 'pkg_apt:kea-dhcp4-server',
'file:/etc/kea/kea-dhcp4.conf', 'file:/etc/kea/kea-dhcp4.conf',
'svc_systemd:systemd-networkd:restart',
], ],
}, },
} }

View file

@ -2,5 +2,5 @@
cd "$OLDPWD" cd "$OLDPWD"
export BW_ITEM_WORKERS=$(expr "$(nproc)" '*' 12 '/' 10) export BW_ITEM_WORKERS=$(expr "$(sysctl -n hw.logicalcpu)" '*' 12 '/' 10)
export BW_NODE_WORKERS=$(expr 320 '/' "$BW_ITEM_WORKERS") export BW_NODE_WORKERS=$(expr 320 '/' "$BW_ITEM_WORKERS")

View file

@ -2,7 +2,5 @@
cd "$OLDPWD" cd "$OLDPWD"
GNU_PATH="$HOME/.local/gnu_bin" PATH_add "/opt/homebrew/opt/gnu-sed/libexec/gnubin"
mkdir -p "$GNU_PATH" PATH_add "/opt/homebrew/opt/grep/libexec/gnubin"
test -f "$GNU_PATH/sed" || ln -s "$(which gsed)" "$GNU_PATH/sed"
PATH_add "$GNU_PATH"

View file

@ -14,16 +14,17 @@
'metadata': { 'metadata': {
'id': '1d6a43e5-858c-42f9-9c40-ab63d61c787c', 'id': '1d6a43e5-858c-42f9-9c40-ab63d61c787c',
'network': { 'network': {
'internal': { 'external': {
'interface': 'eno1',
'ipv4': '10.0.0.1/24',
'vlans': {'iot', 'internet', 'guest'},
'dhcp_server': True,
},
'temp': {
'interface': 'enx00e04c220682', 'interface': 'enx00e04c220682',
'ipv4': '10.0.99.126/24', 'ipv4': '10.0.99.126/24',
'gateway4': '10.0.99.1', 'gateway4': '10.0.99.1',
'vlans': {'iot', 'internet', 'guest', 'rolf', 'internal'},
},
'internal': {
'type': 'vlan',
'id': 1,
'ipv4': '10.0.0.1/24',
'dhcp_server': True,
}, },
'iot': { 'iot': {
'type': 'vlan', 'type': 'vlan',
@ -42,6 +43,12 @@
'ipv4': '10.0.9.1/24', 'ipv4': '10.0.9.1/24',
'dhcp_server': True, 'dhcp_server': True,
}, },
'rolf': { # rolf local test
'type': 'vlan',
'id': 51,
'ipv4': '192.168.179.1/24',
'dhcp_server': True,
},
}, },
# 'nftables': { # 'nftables': {
# 'forward': { # 'forward': {
@ -68,7 +75,7 @@
'allowed_ips': [ 'allowed_ips': [
'10.0.10.0/24', '10.0.10.0/24',
'10.0.10.0/24', '10.0.10.0/24',
'192.168.179.0/24', #'192.168.179.0/24', # while raspi at home
'10.0.227.0/24', # mseibert.freescout '10.0.227.0/24', # mseibert.freescout
], ],
}, },

View file

@ -32,7 +32,7 @@
'systemd-swap', 'systemd-swap',
'twitch-clip-download', 'twitch-clip-download',
'raspberrymatic-cert', 'raspberrymatic-cert',
'tasmota-charge', #'tasmota-charge',
'wol-waker', 'wol-waker',
'zfs', 'zfs',
], ],

View file

@ -1,5 +1,8 @@
# https://teamvault.apps.seibert-media.net/secrets/mkqMRv/
# https://console.hetzner.cloud/projects/889138/servers/46578341
{ {
'dummy': True, #'dummy': True,
'hostname': '159.69.117.89', 'hostname': '159.69.117.89',
'groups': [ 'groups': [
'backup', 'backup',
@ -31,8 +34,8 @@
'domain': 'foerderkreis.oranienschule-wiesbaden-wiki.de', 'domain': 'foerderkreis.oranienschule-wiesbaden-wiki.de',
}, },
'vm': { 'vm': {
'cores': 1, 'cores': 2,
'ram': 2048, 'ram': 4096,
}, },
'wireguard': { 'wireguard': {
'my_ip': '172.30.0.238/32', 'my_ip': '172.30.0.238/32',

View file

@ -1,8 +1,7 @@
{ {
'dummy': True,
'hostname': '192.168.179.20', 'hostname': '192.168.179.20',
'groups': [ 'groups': [
'debian-11', 'debian-12',
'monitored', 'monitored',
'raspberry-pi', 'raspberry-pi',
], ],
@ -10,7 +9,7 @@
'backup-freshness-check', 'backup-freshness-check',
'dm-crypt', 'dm-crypt',
'smartctl', 'smartctl',
'wireguard', #'wireguard',
'zfs', 'zfs',
], ],
'metadata': { 'metadata': {