From 6c3919d860dbe40628e520a12a0b0be1a1083ed5 Mon Sep 17 00:00:00 2001 From: Maurice Date: Wed, 1 Oct 2025 13:44:10 +0200 Subject: [PATCH] Update --- config/.profile | 84 +++++++++++++++++++++++++++++++++++++ install.sh | 2 + installation/basic.sh | 3 ++ installation/podman.sh | 2 +- services/adguard/update.sh | 4 +- services/caddy/update.sh | 2 + services/firewall/rules.nft | 2 +- update.sh | 2 +- 8 files changed, 97 insertions(+), 4 deletions(-) create mode 100644 config/.profile diff --git a/config/.profile b/config/.profile new file mode 100644 index 0000000..8a58786 --- /dev/null +++ b/config/.profile @@ -0,0 +1,84 @@ +alias vim="nvim" + +# Linux +alias ip="ip --color=auto" +alias la="ls -lah" + +# git helpers +alias gf="git fetch --prune" +alias gs="git status" +alias gsw="git switch" +alias ga="git add -A" +alias gb="git branch -v" +alias grh="git add -A; git reset --hard" +alias grr="git restore" +alias gp="git pull" +alias gpp="git push" +alias grsf="git reset --soft HEAD~1" +alias grhf="git reset --hard HEAD~1" +alias grhk="git reset HEAD^" # keep changes +alias gc="git commit -m" +alias grep="grep --color=auto" +alias gd="git diff" +alias gcl="git clean -dfx" + +gpu() { +current_branch="$(git rev-parse --abbrev-ref HEAD)" +echo "Pushing to origin $current_branch" +git push -u origin $current_branch +} + +gmm() { +current_branch="$(git rev-parse --abbrev-ref HEAD)" +echo "Merging master into $current_branch" +gpl +gsw master +gp +gsw $current_branch +git merge origin master +} + +# Other +alias dcl="dotnet clean && dotnet restore" +alias random="tr -dc A-Za-z0-9 /dev/null + fi +} + +add_to_path() { + if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then + PATH="${PATH:+"$PATH:"}$1" + fi +} + + +# PATH +add_to_path "$HOME/.cargo/bin" + +export EDITOR="nvim" \ No newline at end of file diff --git a/install.sh b/install.sh index 13d53e9..3af427b 100755 --- a/install.sh +++ b/install.sh @@ -2,6 +2,8 @@ clear echo "Starting installation..." +cp -f ./config/.profile /root/.profile + # Install podman-openrc tool apk add cargo cargo install podman-openrc diff --git a/installation/basic.sh b/installation/basic.sh index 49def1d..0c8faca 100644 --- a/installation/basic.sh +++ b/installation/basic.sh @@ -5,6 +5,9 @@ echo "Basic setup..." sed -i 's|^#\(http.*/community\)$|\1|' /etc/apk/repositories apk update +# Install basic packages +apk add neovim nnn kitty-terminfo curl + # Cron jobs rc-update add crond cat << EOF > /etc/periodic/daily/chrony diff --git a/installation/podman.sh b/installation/podman.sh index 688fb28..5445b4c 100644 --- a/installation/podman.sh +++ b/installation/podman.sh @@ -6,7 +6,7 @@ rc-update add cgroups rc-service cgroups start # Rootless mode -adduser -D podman +adduser -DH podman modprobe tun echo tun >> /etc/modules echo podman:100000:65536 > /etc/subuid diff --git a/services/adguard/update.sh b/services/adguard/update.sh index 81fe570..815bb7d 100644 --- a/services/adguard/update.sh +++ b/services/adguard/update.sh @@ -1,3 +1,5 @@ #!/bin/sh mkdir -p /var/containers/adguard -cp -f $(pwd)/AdGuardHome.yaml /var/containers/adguard/AdGuardHome.yaml \ No newline at end of file +cp -f $(pwd)/AdGuardHome.yaml /var/containers/adguard/AdGuardHome.yaml +chmod +x /etc/init.d/adguard.service +rc-update add adguard.service default \ No newline at end of file diff --git a/services/caddy/update.sh b/services/caddy/update.sh index a8a8726..84555d8 100644 --- a/services/caddy/update.sh +++ b/services/caddy/update.sh @@ -2,6 +2,8 @@ mkdir -p /var/containers/caddy cp -f $(pwd)/Caddyfile /var/containers/caddy/Caddyfile chown -R podman:podman /var/containers/caddy +chmod +x /etc/init.d/caddy.service +rc-update add caddy.service default if [ "$1" = "reload" ]; then podman exec caddy caddy reload -c /etc/caddy/Caddyfile diff --git a/services/firewall/rules.nft b/services/firewall/rules.nft index 15c498c..4df3f03 100644 --- a/services/firewall/rules.nft +++ b/services/firewall/rules.nft @@ -37,7 +37,7 @@ define icmpv6_slaac = { } # Clients that are allowed to access the LAN network -define lan_clients = { 10.0.0.3 } +define lan_clients = { 10.0.0.2 } table inet firewall { chain postrouting { diff --git a/update.sh b/update.sh index bc972bf..08df60e 100644 --- a/update.sh +++ b/update.sh @@ -2,7 +2,7 @@ base_dir=$(pwd) echo "Updating service scripts..." -podman-openrc ./services /etc/init.d/ +/root/.cargo/bin/podman-openrc ./services /etc/init.d/ # Update services (awall policies, scripts) for service in "./services"/*/; do