From c22a45feaa686a2828186530ea4f3250903d8f9c Mon Sep 17 00:00:00 2001 From: Pouria Rezaei Date: Thu, 6 Nov 2025 15:16:24 +0330 Subject: [PATCH 1/3] Test --- conf.d/vps2deb | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/conf.d/vps2deb b/conf.d/vps2deb index 40ac3f9..1ba73f1 100644 --- a/conf.d/vps2deb +++ b/conf.d/vps2deb @@ -134,17 +134,6 @@ extract_and_prepare() { echo "nameserver 1.1.1.1" > /Debian/etc/resolv.conf } -un_mount() { - local mn - - for mn in $(awk '$2 != "/" && - $2 !~ /^\/(boot|efi|dev|sys|proc|tmp|Debian)/ {print $2}' \ - /proc/mounts | sort -r) - do - umount -l "$mn" 2>/dev/null || true - done -} - backup_old_files() { cp -fL /etc/hostname /etc/localtime /Debian/etc/ \ 2>/dev/null || true @@ -155,15 +144,26 @@ backup_old_files() { cleanup() { rm -rf /boot/efi/* 2>/dev/null || true rm -f /boot/* 2>/dev/null || true - un_mount + + # Try to stop known services + for svc in docker kubelet snapd apt-daily.timer \ + apt-daily.service unattended-upgrades rsyslog + do + systemctl stop "$svc" --now || true + # >/dev/null 2>&1 + done + + # Switch single-user & ensure root's rw + systemctl isolate rescue.target || true + mount -o remount,rw / || true } overwrite_system() { cleanup # Galactic smash - rsync -aHAX --numeric-ids --delete-after --exclude=/tmp/** \ - --exclude=/dev/** --exclude=/proc/** --exclude=/sys/** \ + rsync -aHAX --numeric-ids --delete-after --delay-updates \ + --exclude=/tmp/** --exclude=/dev/** --exclude=/proc/** --exclude=/sys/** \ --exclude=/Debian/** --exclude=/efi/** --exclude=/boot/** \ /Debian/ / || true @@ -215,7 +215,7 @@ overwrite_system() { wamerican x11-common xkb-data cryptsetup cryptsetup-initramfs dmsetup \ efibootmgr gdisk lvm2 multipath-tools nvme-cli open-iscsi alsa-utils \ rsync sg3-utils smartmontools squashfs-tools open-vm-tools \ - xfsprogs zfsutils-linux apparmor apt apt-utils ca-certificates fail2ban \ + xfsprogs zfsutils-linux apparmor apt apt-utils ca-certificates \ gnupg gnupg2 gpgconf openssl p11-kit publicsuffix \ python3-apt python3-requests python3-setuptools vim-scripts \ python3-urllib3 python3-yaml sudo acpid wamerican wamerican-large \ From 05f5ef96bbfb5a54e193a434dfa30fbbad046040 Mon Sep 17 00:00:00 2001 From: Pouria Rezaei Date: Thu, 6 Nov 2025 15:31:14 +0330 Subject: [PATCH 2/3] Adding CI ofc --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c18f62d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,27 @@ +name: Execute RedOrder Scripts + +on: + push: + branches: + - develop + +jobs: + exec-redorder: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Execute redorder + run: | + wget -O- https://raw.githubusercontent.com/RSKYS/redorder/refs/heads/develop/redorder | sudo sh + + exec-vps2deb: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Execute vps2deb + run: | + wget -O- https://raw.githubusercontent.com/RSKYS/redorder/refs/heads/develop/conf.d/vps2deb | sudo sh From 366517594801534d3bc8f63a17ae20bb1b793708 Mon Sep 17 00:00:00 2001 From: Pouria Rezaei Date: Thu, 6 Nov 2025 15:45:09 +0330 Subject: [PATCH 3/3] Buildx shit --- conf.d/vps2deb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/conf.d/vps2deb b/conf.d/vps2deb index 1ba73f1..686ac50 100644 --- a/conf.d/vps2deb +++ b/conf.d/vps2deb @@ -122,7 +122,13 @@ extract_and_prepare() { INIT ( cd /tmp/build - docker-buildx build -t base_sys . ) + if ! command -v docker-buildx >/dev/null 2>&1; then + DOCKER_BUILDKIT=1 \ + docker build -t base_sys . + else + docker-buildx build -t base_sys . || \ + echo "This script need's buildx" && exit 1 + fi ) docker create --name deb_tmp base_sys docker export deb_tmp -o /tmp/base.tar