diff --git a/.github/workflows/linutil.yml b/.github/workflows/linutil.yml index 53c43d02..1184549b 100644 --- a/.github/workflows/linutil.yml +++ b/.github/workflows/linutil.yml @@ -46,19 +46,9 @@ jobs: run: cargo build --target-dir=build --release --verbose --target=x86_64-unknown-linux-musl --all-features - name: Build aarch64 binary - run: cross build --target-dir=build --release --verbose --target=aarch64-unknown-linux-musl --all-features - - - name: Move binaries to build directory run: | - mv build/x86_64-unknown-linux-musl/release/linutil build/linutil - mv build/aarch64-unknown-linux-musl/release/linutil build/linutil-aarch64 - - - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_message: Commit Linutil - file_pattern: "build/linutil build/linutil-aarch64" - add_options: '--force' - if: success() + cross build --target-dir=build --release --verbose --target=aarch64-unknown-linux-musl --all-features + mv ./build/aarch64-unknown-linux-musl/release/linutil ./build/aarch64-unknown-linux-musl/release/linutil-aarch64 - name: Extract Version id: extract_version @@ -80,8 +70,8 @@ jobs: append_body: true generate_release_notes: true files: | - ./build/linutil - ./build/linutil-aarch64 + ./build/x86_64-unknown-linux-musl/release/linutil + ./build/aarch64-unknown-linux-musl/release/linutil-aarch64 ./start.sh ./startdev.sh prerelease: true @@ -89,23 +79,10 @@ jobs: version: ${{ env.version }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Setup Preview - run: | - echo "$(pwd)/build" >> $GITHUB_PATH - - - name: Generate preview - uses: charmbracelet/vhs-action@v2.1.0 + - name: Upload build artifacts + uses: actions/upload-artifact@v4 with: - path: "docs/assets/preview.tape" - - - name: Move preview - run: | - mv preview.gif docs/assets/preview.gif - - - name: Upload preview - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_message: Preview for ${{ env.version }} - file_pattern: "docs/assets/preview.gif" - add_options: "--force" - if: success() \ No newline at end of file + name: linutil-artifact + path: build/x86_64-unknown-linux-musl/release/linutil + compression-level: 0 + overwrite: true \ No newline at end of file diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 00000000..82bd17f1 --- /dev/null +++ b/.github/workflows/preview.yml @@ -0,0 +1,55 @@ +name: LinUtil Preview + +on: + workflow_dispatch: + inputs: + run_id: + description: 'Run ID of LinUtil Release' + required: true + workflow_run: + workflows: ["LinUtil Release"] + types: + - completed + +jobs: + generate_preview: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set Run ID + run: | + if [ "${{ github.event_name }}" == "workflow_run" ]; then + echo "run_id=${{ github.event.workflow_run.id }}" >> $GITHUB_ENV + else + echo "run_id=${{ github.event.inputs.run_id }}" >> $GITHUB_ENV + fi + + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: linutil-artifact + github-token: ${{ secrets.GITHUB_TOKEN }} + run-id: ${{ env.run_id }} + + - name: Set env + run: | + chmod +x linutil + echo "${{ github.workspace }}" >> $GITHUB_PATH + + - name: Generate preview + uses: charmbracelet/vhs-action@v2.1.0 + with: + path: "docs/assets/preview.tape" + + - name: Move preview + run: mv preview.gif docs/assets/preview.gif + + - name: Upload preview + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: Preview for ${{ env.run_id }} + file_pattern: "docs/assets/preview.gif" + add_options: "--force" + if: success() diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml index 901d5e71..864dfc3b 100644 --- a/.github/workflows/typos.yml +++ b/.github/workflows/typos.yml @@ -12,4 +12,4 @@ jobs: - run: git fetch origin ${{ github.base_ref }} - name: Run spellcheck - uses: crate-ci/typos@v1.25.0 + uses: crate-ci/typos@v1.26.0 diff --git a/Cargo.lock b/Cargo.lock index 320f081f..fc49af4c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -31,9 +31,9 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "ansi-to-tui" -version = "6.0.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00c4af0bef1b514c9b6a32a773caf604c1390fa7913f4eaa23bfe76f251d6a42" +checksum = "67555e1f1ece39d737e28c8a017721287753af3f93225e4a445b29ccb0f5912c" dependencies = [ "nom", "ratatui", @@ -159,9 +159,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.19" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7be5744db7978a28d9df86a214130d106a89ce49644cbc4e3f0c22c3fba30615" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" dependencies = [ "clap_builder", "clap_derive", @@ -169,9 +169,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.19" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" dependencies = [ "anstream", "anstyle", @@ -358,6 +358,12 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "indoc" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" + [[package]] name = "instability" version = "0.3.2" @@ -660,23 +666,23 @@ dependencies = [ [[package]] name = "ratatui" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdef7f9be5c0122f890d58bdf4d964349ba6a6161f705907526d891efabba57d" +checksum = "eabd94c2f37801c20583fc49dd5cd6b0ba68c716787c2dd6ed18571e1e63117b" dependencies = [ "bitflags 2.6.0", "cassowary", "compact_str", "crossterm", + "indoc", "instability", "itertools", "lru", "paste", "strum", - "strum_macros", "unicode-segmentation", "unicode-truncate", - "unicode-width 0.1.14", + "unicode-width 0.2.0", ] [[package]] @@ -1005,9 +1011,9 @@ dependencies = [ [[package]] name = "tree-sitter" -version = "0.24.2" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b84f60031bf8245b563a80c92c1034e557a914f7958f474bc0afa2eed78b98" +checksum = "f9871f16d6cf5c4757dcf30d5d2172a2df6987c510c017bbb7abfb7f9aa24d06" dependencies = [ "cc", "regex", @@ -1028,9 +1034,9 @@ dependencies = [ [[package]] name = "tree-sitter-highlight" -version = "0.24.2" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c727fb31f816c09fc54dc0e971d101318926866f7261b2acb820e84a61bf52d" +checksum = "48859aa39513716018d81904220960f415dbb72e071234a721304d20bf245e4c" dependencies = [ "lazy_static", "regex", @@ -1047,9 +1053,9 @@ checksum = "2545046bd1473dac6c626659cc2567c6c0ff302fc8b84a56c4243378276f7f57" [[package]] name = "tui-term" -version = "0.1.13" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07f0233f0d4795d2dc6663cfc3ce56b87bebcee66d6bcc088aa6aff5c072361" +checksum = "72af159125ce32b02ceaced6cffae6394b0e6b6dfd4dc164a6c59a2db9b3c0b0" dependencies = [ "ratatui", "vt100", diff --git a/core/tabs/applications-setup/browsers/vivaldi.sh b/core/tabs/applications-setup/browsers/vivaldi.sh index 002ff7e3..311816d0 100644 --- a/core/tabs/applications-setup/browsers/vivaldi.sh +++ b/core/tabs/applications-setup/browsers/vivaldi.sh @@ -2,22 +2,39 @@ . ../../common-script.sh -installLynx() { - if ! command_exists lynx; then - printf "%b\n" "${YELLOW}Installing Lynx...${RC}" +installVivaldi() { + if ! command_exists vivaldi; then + printf "%b\n" "${YELLOW}Installing Vivaldi...${RC}" case "$PACKAGER" in + apt-get|nala) + "$ESCALATION_TOOL" "$PACKAGER" install -y curl + "$ESCALATION_TOOL" curl -fsSL https://repo.vivaldi.com/archive/linux_signing_key.pub | gpg --dearmor | sudo dd of=/usr/share/keyrings/vivaldi-browser.gpg + "$ESCALATION_TOOL" echo "deb [signed-by=/usr/share/keyrings/vivaldi-browser.gpg arch=$(dpkg --print-architecture)] https://repo.vivaldi.com/archive/deb/ stable main" | sudo dd of=/etc/apt/sources.list.d/vivaldi-archive.list + "$ESCALATION_TOOL" "$PACKAGER" update + "$ESCALATION_TOOL" "$PACKAGER" install -y vivaldi-stable + ;; + dnf) + "$ESCALATION_TOOL" "$PACKAGER" install -y dnf-plugins-core + "$ESCALATION_TOOL" "$PACKAGER" config-manager --add-repo https://repo.vivaldi.com/stable/vivaldi-fedora.repo + "$ESCALATION_TOOL" "$PACKAGER" install -y vivaldi-stable + ;; + zypper) + "$ESCALATION_TOOL" zypper ar https://repo.vivaldi.com/archive/vivaldi-suse.repo + "$ESCALATION_TOOL" zypper --non-interactive --gpg-auto-import-keys in vivaldi-stable + ;; pacman) - "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm lynx + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm vivaldi ;; *) - "$ESCALATION_TOOL" "$PACKAGER" install -y lynx + printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" + exit 1 ;; esac else - printf "%b\n" "${GREEN}Lynx TUI Browser is already installed.${RC}" + printf "%b\n" "${GREEN}Vivaldi Browser is already installed.${RC}" fi } checkEnv checkEscalationTool -installLynx \ No newline at end of file +installVivaldi diff --git a/core/tabs/applications-setup/communication-apps/signal-setup.sh b/core/tabs/applications-setup/communication-apps/signal-setup.sh index 7f5d70fc..cdd71b55 100644 --- a/core/tabs/applications-setup/communication-apps/signal-setup.sh +++ b/core/tabs/applications-setup/communication-apps/signal-setup.sh @@ -3,7 +3,7 @@ . ../../common-script.sh installSignal() { - if ! command_exists signal; then + if ! command_exists org.signal.Signal && ! command_exists signal; then printf "%b\n" "${YELLOW}Installing Signal...${RC}" case "$PACKAGER" in apt-get|nala) @@ -20,8 +20,8 @@ installSignal() { "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm signal-desktop ;; dnf) - "$ESCALATION_TOOL" "$PACKAGER" copr enable luminoso/Signal-Desktop - "$ESCALATION_TOOL" "$PACKAGER" install -y signal-desktop + checkFlatpak + flatpak install -y flathub org.signal.Signal ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" diff --git a/core/tabs/system-setup/arch/server-setup.sh b/core/tabs/system-setup/arch/server-setup.sh index 3a385df5..913d5f61 100755 --- a/core/tabs/system-setup/arch/server-setup.sh +++ b/core/tabs/system-setup/arch/server-setup.sh @@ -130,7 +130,7 @@ echo -ne " ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝███████║ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ------------------------------------------------------------------------ - Please select presetup settings for your system + Please select presetup settings for your system ------------------------------------------------------------------------ " } @@ -146,7 +146,7 @@ filesystem () { case $? in 0) export FS=btrfs;; 1) export FS=ext4;; - 2) + 2) set_password "LUKS_PASSWORD" export FS=luks ;; @@ -155,14 +155,14 @@ filesystem () { esac } -# @description Detects and sets timezone. +# @description Detects and sets timezone. timezone () { # Added this from arch wiki https://wiki.archlinux.org/title/System_time time_zone="$(curl --fail https://ipapi.co/timezone)" echo -ne " System detected your timezone to be '$time_zone' \n" echo -ne "Is this correct? - " + " options=("Yes" "No") select_option "${options[@]}" @@ -171,14 +171,14 @@ timezone () { echo "${time_zone} set as timezone" export TIMEZONE=$time_zone;; n|N|no|NO|No) - echo "Please enter your desired timezone e.g. Europe/London :" + echo "Please enter your desired timezone e.g. Europe/London :" read -r new_timezone echo "${new_timezone} set as timezone" export TIMEZONE=$new_timezone;; *) echo "Wrong option. Try again";timezone;; esac } -# @description Set user's keyboard mapping. +# @description Set user's keyboard mapping. keymap () { echo -ne " Please select key board layout from this list" @@ -236,18 +236,18 @@ echo -ne " drivessd } -# @description Gather username and password to be used for installation. +# @description Gather username and password to be used for installation. userinfo () { # Loop through user input until the user gives a valid username while true - do + do read -r -p "Please enter username: " username if [[ "${username,,}" =~ ^[a-z_]([a-z0-9_-]{0,31}|[a-z0-9_-]{0,30}\$)$ ]] - then + then break - fi + fi echo "Incorrect username." - done + done export USERNAME=$username while true @@ -264,22 +264,22 @@ userinfo () { done export PASSWORD=$PASSWORD1 - # Loop through user input until the user gives a valid hostname, but allow the user to force save + # Loop through user input until the user gives a valid hostname, but allow the user to force save while true - do + do read -r -p "Please name your machine: " name_of_machine # hostname regex (!!couldn't find spec for computer name!!) if [[ "${name_of_machine,,}" =~ ^[a-z][a-z0-9_.-]{0,62}[a-z0-9]$ ]] - then - break - fi + then + break + fi # if validation fails allow the user to force saving of the hostname - read -r -p "Hostname doesn't seem correct. Do you still want to save it? (y/n)" force + read -r -p "Hostname doesn't seem correct. Do you still want to save it? (y/n)" force if [[ "${force,,}" = "y" ]] - then - break - fi - done + then + break + fi + done export NAME_OF_MACHINE=$name_of_machine } @@ -351,7 +351,7 @@ echo -ne " Creating Filesystems ------------------------------------------------------------------------- " -# @description Creates the btrfs subvolumes. +# @description Creates the btrfs subvolumes. createsubvolumes () { btrfs subvolume create /mnt/@ btrfs subvolume create /mnt/@home @@ -362,11 +362,11 @@ mountallsubvol () { mount -o "${MOUNT_OPTIONS}",subvol=@home "${partition3}" /mnt/home } -# @description BTRFS subvolulme creation and mounting. +# @description BTRFS subvolulme creation and mounting. subvolumesetup () { # create nonroot subvolumes - createsubvolumes -# unmount root to remount with subvolume + createsubvolumes +# unmount root to remount with subvolume umount /mnt # mount @ subvolume mount -o "${MOUNT_OPTIONS}",subvol=@ "${partition3}" /mnt @@ -386,33 +386,36 @@ fi if [[ "${FS}" == "btrfs" ]]; then mkfs.vfat -F32 -n "EFIBOOT" "${partition2}" - mkfs.btrfs -L ROOT "${partition3}" -f + mkfs.btrfs -f "${partition3}" mount -t btrfs "${partition3}" /mnt subvolumesetup elif [[ "${FS}" == "ext4" ]]; then mkfs.vfat -F32 -n "EFIBOOT" "${partition2}" - mkfs.ext4 -L ROOT "${partition3}" + mkfs.ext4 "${partition3}" mount -t ext4 "${partition3}" /mnt elif [[ "${FS}" == "luks" ]]; then - mkfs.vfat -F32 -n "EFIBOOT" "${partition2}" + mkfs.vfat -F32 "${partition2}" # enter luks password to cryptsetup and format root partition echo -n "${LUKS_PASSWORD}" | cryptsetup -y -v luksFormat "${partition3}" - -# open luks container and ROOT will be place holder +# open luks container and ROOT will be place holder echo -n "${LUKS_PASSWORD}" | cryptsetup open "${partition3}" ROOT - # now format that container - mkfs.btrfs -L ROOT "${partition3}" + mkfs.btrfs "${partition3}" # create subvolumes for btrfs mount -t btrfs "${partition3}" /mnt subvolumesetup + ENCRYPTED_PARTITION_UUID=$(blkid -s UUID -o value "${partition3}") fi +BOOT_UUID=$(blkid -s UUID -o value "${partition2}") + sync if ! mountpoint -q /mnt; then echo "ERROR! Failed to mount ${partition3} to /mnt after multiple attempts." exit 1 fi mkdir -p /mnt/boot/efi -mount -t vfat -L EFIBOOT /mnt/boot/ +mount -t vfat -U "${BOOT_UUID}" /mnt/boot/ if ! grep -qs '/mnt' /proc/mounts; then echo "Drive is not mounted can not continue" @@ -435,8 +438,8 @@ fi echo "keyserver hkp://keyserver.ubuntu.com" >> /mnt/etc/pacman.d/gnupg/gpg.conf cp /etc/pacman.d/mirrorlist /mnt/etc/pacman.d/mirrorlist -genfstab -L /mnt >> /mnt/etc/fstab -echo " +genfstab -U /mnt >> /mnt/etc/fstab +echo " Generated /etc/fstab: " cat /mnt/etc/fstab @@ -475,14 +478,14 @@ arch-chroot /mnt /bin/bash -c "KEYMAP='${KEYMAP}' /bin/bash" <