diff --git a/.gitignore b/.gitignore index c2de7da..3ba80a1 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ __pycache__ *.pyc *.tar.xz *.tar.zst +wiki/** diff --git a/EtcFiles/shadowarch b/EtcFiles/shadowarch index bf25eeb..c71090f 100644 --- a/EtcFiles/shadowarch +++ b/EtcFiles/shadowarch @@ -2,156 +2,115 @@ function header () { tput setaf 1 - tput bold echo $@ + tput bold + echo $@ tput sgr0 return } function help() { - echo Usage: ${0} '[OPTIONS]' - echo '\-A -- Audio optimizations from the Arch Wiki' - echo '\-d DISK -- Use the disk.' - echo '\-e -- Encrypt the root partition' - echo '\-g -- GUI packages and setup' - echo '\-h -- This helptext' - echo '\-k -- Kali Linux-like package additions' - echo '\-l FILE -- Log to a file' - echo '\-p -- Productivity package additions' - echo '\-P -- Power saving for laptops' - echo '\-s -- Create a layout for an AniNIX/Spartacus' - echo '\-m -- Skip disk operations and assume storage is mounted on /mnt' - echo '\-v -- Verbose output.' - echo '\-z -- Try to add all the packages on AniNIX/Core' + cat < /etc/pacman.d/mirrorlist ;; + s) bootsize=10000 ;; v) set -x ;; - z) kitchensink=1 ;; *) help esac done header Confirm options: -echo Spartacus set to: $spartacus -echo Encryption set to: $encrypt -echo GUI: $gui -echo Productivity: $productivity -echo Kali tools: $kali -echo All Core packages: $kitchensink -echo Disk to use: $disk \(Skip disk building? $nodiskbuild \) -printf "Is this OK? Type YES to continue: " -read answer +cat <> /etc/pacman.conf > /mnt/etc/netctl/$interface arch-chroot /mnt systemctl enable netctl arch-chroot /mnt netctl enable $interface -ln -sf /etc/skel/.bashrc /mnt/root/.bashrc - -# Clone ConfigPackags from AniNIX::Foundation -arch-chroot /mnt git -C /usr/local/src/ clone https://aninix.net/foundation/ConfigPackages -arch-chroot /mnt git -C /usr/local/src/ clone https://aninix.net/foundation/MiscScripts - -arch-chroot /mnt make -C /usr/local/src/MiscScripts/Shared install -arch-chroot /mnt make -C /usr/local/src/MiscScripts/Admin install -arch-chroot /mnt make -C /usr/local/src/MiscScripts/ShadowArch install -arch-chroot /mnt git -C /usr/local/src/ clone https://aur.archlinux.org/cower.git -arch-chroot /mnt groupadd tty-allow -arch-chroot /mnt useradd -u 1001 -G tty-allow -m depriv -arch-chroot /mnt usermod -G "$(getent group | grep root | cut -f 1 -d ':' | tr '\n' ',')""tty-allow" root -arch-chroot /mnt /bin/bash -c 'line="$(grep -E root"[[:space:]]"ALL /etc/sudoers)"; sed -i "s/$line/$line\ndepriv ALL=(ALL) ALL/" /etc/sudoers' - -# Handle AUR Packages - -if [ ! -z "$kali" ]; then - arch-chroot /mnt git -C /usr/local/src/ clone https://aur.archlinux.org/autopsy.git -fi - # Optimizations from https://wiki.archlinux.org/index.php/Power_management if [ ! -z "$powersave" ]; then if [ `lspci | grep -i intel | grep -ic audio` -eq 1 ]; then echo 'options snd_hda_intel power_save=1' > /mnt/etc/modprobe.d/audio_powersave.conf - else + else echo 'options snd_ac97_codec power_save=1' > /mnt/etc/modprobe.d/audio_powersave.conf fi arch-chroot /mnt pacman -S rfkill cpupower --noconfirm @@ -278,36 +192,24 @@ fi # Set password header Set new root passphrase and depriviledged user '(depriv)' password. +arch-chroot /mnt useradd depriv arch-chroot /mnt passwd arch-chroot /mnt passwd depriv -arch-chroot /mnt chown -R depriv:depriv /usr/local/src/ # Set SSH host keys arch-chroot /mnt ssh-keygen -A -cp /root/shadowarch /mnt/root/shadowarch.installer."$(date +%F-%R)" - -if [ ! -z "$gui" ]; then - echo "Remember to install your graphics drivers! - For NVidia, look at xf86-video-nouveau - For AMD, look at xf86-video-amdgpu - For Hyper-V, look at xf86-video-fbdev - For Virtual Box, look at virtualbox-guest-utils - For VMware, look at open-vm-tools" -fi - # Set hostname header Set hostname printf "What is your fully-qualified hostname? (i.e. host.site.example.com) " read hostname echo "$hostname" > /mnt/etc/hostname -hostname "$hostname" -header "Installed ShadowArch on $HOSTNAME!" +header "Installed ShadowArch on $HOSTNAME!" if [ ! -z "$nodiskbuild" ]; then header Remember to run grub-install and set up your bootloader. echo 'https://wiki.archlinux.org/index.php/Installation_guide#Boot_loader' -else +else header Press enter to reboot. read diff --git a/Makefile b/Makefile index 6bb211b..4c0b30b 100644 --- a/Makefile +++ b/Makefile @@ -3,11 +3,14 @@ LIST=AdminScripts UserScripts EtcFiles compile: ${LIST} for i in ${LIST}; do make -C ./$$i; done -install: compile +install: compile for i in ${LIST}; do make -C ./$$i install; done -reverse: - @echo Please do this for each individual folder in ${LIST} +clean: + rm -Rf `cat .gitignore` + +uninstall: + @echo Please do this for each folder. test: ${LIST} @echo Please do this for each individual folder in ${LIST} @@ -15,13 +18,13 @@ test: ${LIST} checkperm: @echo Please do this for each individual folder in ${LIST} -clean: - rm -Rf `cat .gitignore` - diff: @echo Please do this for each individual folder in ${LIST} -localinstall: +reverse: + @echo Please do this for each individual folder in ${LIST} + +localinstall: mkdir -p ~/bin/ for i in AdminScripts UserScripts; do cd $$i; for j in `ls -1 | grep -v Makefile`; do install -o ${USER} -m 0755 "$$j" /home/${USER}/bin/; done; cd ..; done cd EtcFiles; for i in `ls -1 | grep -E -v '*.service|skel|Makefile'`; do cp "$$i" /home/${USER}/."$$i"; done diff --git a/README.md b/README.md index 4e33f83..f85f32d 100644 --- a/README.md +++ b/README.md @@ -7,17 +7,11 @@ This package holds core files for our environment. * AdminScripts: Scripts requiring root access for administration * UserScripts: Useful user-space deprivileged scripts -# How to Install ShadowArch -The AniNIX provides an installer to install ShadowArch and some basic clients for its services, similar to the [KickStart concept from RHEL/CentOS](https://serverfault.com/questions/517908/how-to-create-a-custom-iso-image-in-centos#521672). +# Etymology -1. Acquire a read-write storage device and some hardware with at least 256M of RAM and one core. -1. [https://archlinux.org/download Download the Arch ISO] and boot the VM or host from that. -1. Run the following to minimally install ShadowArch: - 1. `wget https://aninix.net/shadowarch; vi shadowarch; bash shadowarch` - 1. Some flags are listed below. -1. If you run across trouble, take a look at the Troubleshooting section at the bottom. +ShadowArch is a pun on Shadow IT, the concept of side projects developed outside the normal bounds, and ArchLinux, the system on which we work. -# Defaults +# Relevant Files and Software These are installed by default with the base package of ShadowArch, along with the ArchLinux base packages, grub, parted, os-prober, net-tools, bind-tools, and wget. * git for source-code access * elinks for browsing @@ -93,9 +87,19 @@ We include the following customizations: 1. [Chrome](https://www.google.com/chrome/) with [DuckDuckGo](https://duckduckgo.com/) as the default search engine is our browser recommendation. This can be bound to the ShadowArch-like keybind with Start > Chrome > Right-click > Open File Location > Right-click icon > Properties and set the shortcut key to B. We presently don't have a way to bind the Super key in the same way. 1. Terminal Emulator can be provided by either Powershell or [PuTTY](http://www.putty.org/), depending on where shell activity should live. Use the same steps as the browser above to set the keybind. 1. Default Windows Explorer and its keybinds equate to the XFCE4 thunar application used by ShadowArch. The Run and Explorer keybinds natively present in Windows will map. -1. Default Windows Aero window managment will map to the ShaodowArch keybinds. +1. Default Windows Aero window management will map to the ShadowArch keybinds. 1. Workspace management won't be quite the same, but this [CNET article](https://www.cnet.com/how-to/how-to-use-multiple-desktops-in-windows-10/) offers some help on understanding the difference. The Windows environment is a bit more dynamic so it requires more keybinds. +# Available Clients +The AniNIX provides an installer to install ShadowArch and some basic clients for its services, similar to the [KickStart concept from RHEL/CentOS](https://serverfault.com/questions/517908/how-to-create-a-custom-iso-image-in-centos#521672). + +1. Acquire a read-write storage device and some hardware with at least 256M of RAM and one core. +1. [https://archlinux.org/download Download the Arch ISO] and boot the VM or host from that. +1. Run the following to minimally install ShadowArch: + 1. `wget https://aninix.net/shadowarch; vi shadowarch; bash shadowarch` + 1. Some flags are listed below. +1. If you run across trouble, take a look at the Troubleshooting section at the bottom. + # References * [The ArchLinux Wiki](https://wiki.archlinux.org/) is an invaluable source of information, particularly around packages deployed by ShadowArch hosts. These are some known issues the users of ShadowArch have come across with weird reasons. @@ -107,3 +111,7 @@ Make sure the user is in the audio group on the system and alsamixer is not mute ## No Desktop Run xfdesktop -- sometimes xinit loses this execution and the desktop doesn't display. + +# Equivalents or Competition + +Raspberry Pi's Etcher, OVAs from other systems, etc. are all equivalent imaging projects.