From: xf0r3m Date: Mon, 12 Jun 2023 10:36:57 +0000 (+0200) Subject: Utworzenie bazowych plików wersji nowej wersji immudex-testing X-Git-Url: https://gitweb.morketsmerke.org/?a=commitdiff_plain;h=6c0e5996160a9132e76ea127274f532848bfb9e8;p=immudex-testing.git Utworzenie bazowych plików wersji nowej wersji immudex-testing --- diff --git a/versions/100.sh b/versions/100.sh index eb31de6..dca2d5f 100644 --- a/versions/100.sh +++ b/versions/100.sh @@ -12,8 +12,8 @@ if [ ! /sbin/debootstrap ]; then exit 1; fi if [ "$1" = "--amd64" ] || [ "$1" = "--i386" ]; then if [ "$1" = "--amd64" ]; then arch="64"; else arch="32"; fi sudo rm -rf ~/immudex-testing/${arch}/chroot; - sudo /sbin/debootstrap --arch=$(echo $1 | sed 's/-//g') bookworm ~/immudex-testing/${arch}/chroot http://deb.debian.org/debian - sudo cat > 100_chroot.sh < base_chroot.sh < /etc/apt/sources.list; -echo "deb-src http://deb.debian.org/debian/ bookworm main" >> /etc/apt/sources.list; -echo "deb http://security.debian.org/debian-security bookworm-security main" >> /etc/apt/sources.list; -echo "deb-src http://security.debian.org/debian-security bookworm-security main" >> /etc/apt/sources.list; -echo "deb http://deb.debian.org/debian/ bookworm-updates main" >> /etc/apt/sources.list; -echo "deb-src http://deb.debian.org/debian/ bookworm-updates main" >> /etc/apt/sources.list; +echo "deb http://deb.debian.org/debian/ testing main" > /etc/apt/sources.list; +echo "deb-src http://deb.debian.org/debian/ testing main" >> /etc/apt/sources.list; +echo "deb http://security.debian.org/debian-security testing-security main" >> /etc/apt/sources.list; +echo "deb-src http://security.debian.org/debian-security testing-security main" >> /etc/apt/sources.list; +echo "deb http://deb.debian.org/debian/ testing-updates main" >> /etc/apt/sources.list; +echo "deb-src http://deb.debian.org/debian/ testing-updates main" >> /etc/apt/sources.list; update_packages; @@ -50,7 +50,7 @@ install_packages task-desktop task-xfce-desktop; install_packages firejail ufw cryptsetup lsof extlinux grub-efi-amd64 efibootmgr bash-completion etherwake wakeonlan cifs-utils wget figlet mpv youtube-dl vim-gtk3 redshift irssi nmap nfs-common remmina python3-pip ffmpeg debootstrap squashfs-tools xorriso syslinux-efi grub-pc-bin grub-efi-amd64-bin mtools dosfstools chrony python3-venv isolinux rsync thunderbird gimp openvpn netselect-apt gvfs-backends; head -1 /etc/apt/sources.list | tee /etc/apt/sources.list.d/xfce4-notes-plugin.list; -sed -i 's/bookworm/experimental/' /etc/apt/sources.list.d/xfce4-notes-plugin.list; +sed -i 's/testing/experimental/' /etc/apt/sources.list.d/xfce4-notes-plugin.list; apt update; apt install xfce4-notes-plugin -y; rm /etc/apt/sources.list.d/xfce4-notes-plugin.list; @@ -58,7 +58,7 @@ apt update; cd; -git clone https://github.com/xf0r3m/xfcedebian -b testing; +git clone https://github.com/xf0r3m/xfcedebian -b d13; cd xfcedebian; bash install.sh; @@ -119,9 +119,9 @@ set_xfce4_notes_autostart; tidy; EOF - sudo cp 100_chroot.sh ~/immudex-testing/${arch}/chroot; - sudo chroot ~/immudex-testing/${arch}/chroot bash 100_chroot.sh; - sudo rm ~/immudex-testing/${arch}/chroot/100_chroot.sh; + sudo cp base_chroot.sh ~/immudex-testing/${arch}/chroot; + sudo chroot ~/immudex-testing/${arch}/chroot bash base_chroot.sh; + sudo rm ~/immudex-testing/${arch}/chroot/base_chroot.sh; else exit 1; fi diff --git a/versions/base.sh b/versions/base.sh new file mode 100644 index 0000000..7f83ab7 --- /dev/null +++ b/versions/base.sh @@ -0,0 +1,106 @@ +#!/bin/bash + +dhclient; +cd; +if [ -x /usr/bin/git ]; then GIT_SSH_COMMAND="ssh -p 2022" git clone ssh://git@searx.morketsmerke.org/~/immudex-testing.git +else apt install git -y && GIT_SSH_COMMAND="ssh -p 2022" git clone ssh://git@searx.morketsmerke.org/~/immudex-testing.git; + +fi +export VERSION=100; +source ~/immudex-testing/versions/template.sh; + +echo "deb http://deb.debian.org/debian/ testing main" > /etc/apt/sources.list; +echo "deb-src http://deb.debian.org/debian/ testing main" >> /etc/apt/sources.list; +echo "deb http://security.debian.org/debian-security testing-security main" >> /etc/apt/sources.list; +echo "deb-src http://security.debian.org/debian-security testing-security main" >> /etc/apt/sources.list; +echo "deb http://deb.debian.org/debian/ testing-updates main" >> /etc/apt/sources.list; +echo "deb-src http://deb.debian.org/debian/ testing-updates main" >> /etc/apt/sources.list; +update_packages; + + +if [ $(uname -m) = "x86_64" ]; then +install_packages --no-install-recommends linux-image-amd64 live-boot systemd-sysv -y; +else +install_packages --no-install-recommends linux-image-686-pae live-boot systemd-sysv -y; +fi + +install_packages tzdata locales keyboard-configuration console-setup; + +dpkg-reconfigure tzdata; +dpkg-reconfigure locales; +dpkg-reconfigure keyboard-configuration; +dpkg-reconfigure console-setup; + +install_packages task-desktop task-xfce-desktop; + +install_packages firejail ufw cryptsetup lsof extlinux grub-efi-amd64 efibootmgr bash-completion etherwake wakeonlan cifs-utils wget figlet mpv youtube-dl vim-gtk3 redshift irssi nmap nfs-common remmina python3-pip ffmpeg debootstrap squashfs-tools xorriso syslinux-efi grub-pc-bin grub-efi-amd64-bin mtools dosfstools chrony python3-venv isolinux rsync thunderbird gimp openvpn netselect-apt gvfs-backends; + +head -1 /etc/apt/sources.list | tee /etc/apt/sources.list.d/xfce4-notes-plugin.list; +sed -i 's/testing/experimental/' /etc/apt/sources.list.d/xfce4-notes-plugin.list; +apt update; +apt install xfce4-notes-plugin -y; +rm /etc/apt/sources.list.d/xfce4-notes-plugin.list; +apt update; + +cd; + +git clone https://github.com/xf0r3m/xfcedebian -b d13; +cd xfcedebian; +bash install.sh; + +cd; + +cp -vv ~/immudex-testing/tools/${VERSION}/* /usr/local/bin; +chmod +x /usr/local/bin/*; + +mkdir /etc/skel/.irssi + +cp -vv ~/immudex-testing/files/${VERSION}/config /etc/skel/.irssi; +cp -vv ~/immudex-testing/files/${VERSION}/default.theme /etc/skel/.irssi; +cp -rvv ~/immudex-testing/files/${VERSION}/libreoffice /etc/skel/.config; +cp -vv ~/immudex-testing/files/${VERSION}/firejail.config /etc/firejail; +cp -vv ~/immudex-testing/files/${VERSION}/Notifier\ -\ distro.desktop /etc/skel/.config/autostart; +cp -vv ~/immudex-testing/files/${VERSION}/redshift.conf /etc/skel/.config; +cp -vv ~/immudex-testing/files/${VERSION}/redshift.desktop /etc/skel/.config/autostart; +cp -vv ~/immudex-testing/files/${VERSION}/Klient\ poczty\ Thunderbird.desktop /etc/skel/Pulpit; +cp -vv ~/immudex-testing/files/${VERSION}/terminalrc /etc/skel/.config/xfce4/terminal; +cp -vv ~/immudex-testing/files/${VERSION}/mimeapps.list /etc/skel/.config; +cp -rvv ~/immudex-testing/files/${VERSION}/sync.sh /usr/share; +cp -vv ~/immudex-testing/files/${VERSION}/conkyrc /etc/skel/.conkyrc; +cp -vv ~/immudex-testing/files/${VERSION}/gtk-main.css /usr/share/xfce4-notes-plugin/gtk-3.0/; +cp -vv ~/immudex-testing/files/${VERSION}/immudex_hostname.service /etc/systemd/system; + +tar -xzvf ~/immudex-testing/files/${VERSION}/mozilla.tgz -C /etc/skel; +cp -vv ~/immudex-testing/images/${VERSION}/apply.png /usr/share/icons; +cp -vv ~/immudex-testing/images/${VERSION}/rss.png /usr/share/icons; +cp -vv ~/immudex-testing/images/${VERSION}/notes-background.jpg /usr/share/images/desktop-base; + +rm /usr/share/images/desktop-base/no_trespass_abandon.jpeg; +systemctl enable immudex_hostname.service; + +cat >> /etc/bash.bashrc << EOL +if [ ! -f /tmp/.motd ]; then +/usr/local/bin/motd2 +touch /tmp/.motd; +fi +EOL + +echo "alias chhome='export HOME=\\\$(pwd)'" >> /etc/bash.bashrc; +echo "alias ytstream='mpv --ytdl-format=best[heigth=480]'" >> /etc/bash.bashrc; + +chmod u+s /usr/bin/ping; + +/usr/sbin/ufw default deny incoming; +/usr/sbin/ufw default allow outgoing; +/usr/sbin/ufw enable; + +echo "immudex" > /etc/hostname; +echo "127.0.1.1 immudex" >> /etc/hosts; + +recreate_users; +echo "user ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers; +echo "xf0r3m ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers; +set_notifier_packages; +set_xfce4_notes_autostart; + +tidy; diff --git a/versions/template.sh b/versions/template.sh index 79def86..82d66f7 100644 --- a/versions/template.sh +++ b/versions/template.sh @@ -10,39 +10,28 @@ function install_packages() { apt install $@ -y; } -function get_immudex_testing_project() { - if [ ! -d ~/immudex-testing ]; then - cd; - git clone https://github.com/xf0r3m/immudex-testing.git; - fi -} - function recreate_users() { userdel -r user; userdel -r xf0r3m; useradd -m -s /bin/bash user; - if [ ! -f /home/user/.vimrc ]; then - cp -rvv /etc/skel/.??* /home/user; - cp -rvv /etc/skel/?* /home/user; - mkdir /home/user/.local; - tar -xvf ~/immudex-testing/files/${VERSION}/local_user.tar -C /home/user/.local; - rm /home/user/.face; - cp /usr/share/images/desktop-base/immudex_xfce_greeter_logo.png /home/user/.face; - chown -R user:user /home/user; - fi + cp -rvv /etc/skel/.??* /home/user; + cp -rvv /etc/skel/?* /home/user; + mkdir /home/user/.local; + tar -xvf ~/immudex-testing/files/${VERSION}/local_user.tar -C /home/user/.local; + rm /home/user/.face; + cp /usr/share/images/desktop-base/immudex_xfce_greeter_logo.png /home/user/.face; + chown -R user:user /home/user; echo "user:user1" | chpasswd; useradd -m -s /bin/bash xf0r3m; - if [ ! -f /home/xf0r3m/.vimrc ]; then - cp -rvv /etc/skel/.??* /home/xf0r3m; - cp -rvv /etc/skel/?* /home/xf0r3m; - mkdir /home/xf0r3m/.local; - tar -xvf ~/immudex-testing/files/${VERSION}/local_xf0r3m.tar -C /home/xf0r3m/.local; - rm /home/xf0r3m/.face; - cp /usr/share/images/desktop-base/immudex_xfce_greeter_logo.png /home/xf0r3m/.face; - chown -R xf0r3m:xf0r3m /home/xf0r3m; - fi + cp -rvv /etc/skel/.??* /home/xf0r3m; + cp -rvv /etc/skel/?* /home/xf0r3m; + mkdir /home/xf0r3m/.local; + tar -xvf ~/immudex-testing/files/${VERSION}/local_xf0r3m.tar -C /home/xf0r3m/.local; + rm /home/xf0r3m/.face; + cp /usr/share/images/desktop-base/immudex_xfce_greeter_logo.png /home/xf0r3m/.face; + chown -R xf0r3m:xf0r3m /home/xf0r3m; echo "xf0r3m:xf0r3m1" | chpasswd; usermod -aG libvirt,libvirt-qemu xf0r3m;