Skip to content

Commit

Permalink
Merge upstream main
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevithakannan2 committed Oct 31, 2024
1 parent be2bfc4 commit 5c822d5
Show file tree
Hide file tree
Showing 45 changed files with 715 additions and 387 deletions.
2 changes: 2 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ cd linutil
```

## 3. Make your changes

- **Edit the files you want to change**: Make your changes to the relevant files.
- **Test your changes**: Run `cargo run` to test your modifications in a local environment and ensure everything works as expected.

Expand Down Expand Up @@ -60,6 +61,7 @@ cd linutil
## 11. Documentation

- **Update the documentation**: If your change affects the functionality, please update the relevant documentation files to reflect this.
- **Automatic generation**: If you decide to add functionality through a new shell script, make sure to fill out all fields in `tab_data.toml` and run `cargo xtask docgen`.

## 12. License

Expand Down
19 changes: 13 additions & 6 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@

## Supported Versions

It is recommended that you run the stable version as this is more tested and used by most. The dev branch is bleed-edge commits that are not well tested and aren't meant to be used in production environments
It is recommended that you use the stable branch as it's tested and used by most. The dev branch may contain bleeding-edge commits that are not well tested and are not meant to be used in production environments.<br>
Version tags lower than the [latest stable release](https://github.com/ChrisTitusTech/linutil/releases/latest) are **not** supported.

| Version | Supported |
| ------- | ------------------ |
| latest | :white_check_mark: |
| dev | :x: |
| Branch | Supported |
| ------- | ---------------------- |
| Stable | :white_check_mark: YES |
| Dev | :x: NO |

| Version | Supported |
| -------------------------------------------------- | ---------------------- |
| [![LATEST](https://img.shields.io/github/v/release/ChrisTitusTech/linutil?color=%230567ff&label=Latest&style=for-the-badge)](https://github.com/ChrisTitusTech/linutil/releases/latest) | :white_check_mark: YES |
| Below LATEST | :x: NO |
| Above LATEST | :x: NO |

## Reporting a Vulnerability

I'd recommend making an Issue for reporting a bug. If you would like privately submit the bug you can email me at [email protected]
If you have any reason to believe there are security vulnerabilities in Linutil, fill out the [report form](https://github.com/christitustech/linutil/security/advisories/new) or e-mail [[email protected]](mailto:[email protected]).
29 changes: 22 additions & 7 deletions .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,34 @@ changelog:
categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '⚙️ Refactoring'
labels:
- 'refactor'
- title: '🧩 UI/UX'
labels:
- 'UI/UX'
- title: '📚 Documentation'
label: 'documentation'
labels:
- 'documentation'
- title: '🔒 Security'
label: 'security'
labels:
- 'security'
- title: '🧰 GitHub Actions'
label: 'github actions'
labels:
- 'github_actions'
- title: '🦀 Rust'
labels:
- 'rust'
- title: '📃 Scripting'
labels:
- 'script'
- title: 'Other Changes'
labels:
- "*"
exclude:
labels:
- 'skip-changelog'
- 'skip-changelog'
2 changes: 1 addition & 1 deletion .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- name: Copy Contributing Guidelines
run: |
echo "<!-- THIS FILE IS GENERATED AUTOMATICALLY. EDIT .github/CONTRIBUTING.md -->\n\n$(cat .github/CONTRIBUTING.md)" > 'docs/contributing.md'
echo -e "<!-- THIS FILE IS GENERATED AUTOMATICALLY. EDIT .github/CONTRIBUTING.md -->\n\n$(cat .github/CONTRIBUTING.md)" > 'docs/contributing.md'
- uses: stefanzweifel/git-auto-commit-action@v5
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: ["main"]
paths:
- '**/*.rs'
- 'Cargo.toml'
- '**/Cargo.toml'
- 'Cargo.lock'

env:
Expand Down
63 changes: 21 additions & 42 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,34 @@
name: ShellCheck
name: Script Checks

on:
pull_request:
paths:
- 'core/tabs/**/*.sh'
- '**/*.sh'
workflow_dispatch:

jobs:
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: git fetch origin ${{ github.base_ref }}
- name: Checkout sources
uses: actions/checkout@v4

- name: Download, setup, and run ShellCheck
shell: bash {0}
run : |
SC_URL="https://github.com/koalaman/shellcheck/releases/download/v0.10.0/shellcheck-v0.10.0.linux.x86_64.tar.xz"
curl -fsSL "$SC_URL" | tar -Jx
chmod +x "./shellcheck-v0.10.0/shellcheck"
- name: Run ShellCheck
uses: reviewdog/action-shellcheck@v1
with:
reviewdog_flags: '-fail-level=any'

error=0
files_to_check=$(git diff --name-only origin/${{ github.base_ref }} HEAD core/tabs)
for file in $files_to_check; do
if [[ "$file" == *.sh ]] && [[ -f "$file" ]]; then
sc_output=$(./shellcheck-v0.10.0/shellcheck -fgcc -Serror "$file")
iter_safe_parsed_errors=$(echo -e "$sc_output" | sed -n 's/\(.\+\)\:\([0-9]\+\)\:\([0-9]\+\)\: \(.*\)/::error file=\1,line=\2,col=\3::\4/p' | sed 's/ /:space:/g')
for error in $iter_safe_parsed_errors; do
echo "$error" | sed 's/:space:/ /g'
error=1
done
tabs_detected=$(grep -nP '^\t+\S+' "$file")
# fast fail on the action runner would fail immediately if there weren't any tabs found
# this check makes sure that we don't continue if there's something really weird going on
if [ "$?" = "2" ]; then
echo "::error file=$file::There was a critical error while grepping $file, aborting"
exit 1
fi
iter_safe_parsed_tabs_detected=$(echo "$tabs_detected" | sed -n 's,\([0-9]\+\).*,::error file='"$file"'\,line=\1::Found tab indentations,p' | sed 's/ /:space:/g')
for error in $iter_safe_parsed_tabs_detected; do
echo "$error" | sed 's/:space:/ /g'
error=1
done
fi
done
exit $error
shfmt:
name: Shell Fomatting
runs-on: ubuntu-latest
needs: shellcheck
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Run shfmt
uses: reviewdog/action-shfmt@v1
with:
shfmt_flags: '-i 4 -ci'
reviewdog_flags: '-fail-level=any'
25 changes: 25 additions & 0 deletions core/tabs/applications-setup/browsers/waterfox.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh -e

. ../../common-script.sh

installWaterfox() {
if ! command_exists waterfox; then
printf "%b\n" "${YELLOW}Installing waterfox...${RC}"
case "$PACKAGER" in
pacman)
"$AUR_HELPER" -S --needed --noconfirm waterfox-bin
;;
*)
. ../setup-flatpak.sh
flatpak install -y flathub net.waterfox.waterfox
;;
esac
else
printf "%b\n" "${GREEN}Waterfox is already installed.${RC}"
fi
}

checkEnv
checkEscalationTool
checkAURHelper
installWaterfox
11 changes: 11 additions & 0 deletions core/tabs/applications-setup/docker-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ install_docker() {
apt-get|nala)
curl -fsSL https://get.docker.com | sh
;;
dnf)
"$ESCALATION_TOOL" "$PACKAGER" -y install dnf-plugins-core
"$ESCALATION_TOOL" "$PACKAGER" config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
"$ESCALATION_TOOL" "$PACKAGER" -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin
"$ESCALATION_TOOL" systemctl enable --now docker
;;
zypper)
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install docker
"$ESCALATION_TOOL" systemctl enable docker
Expand All @@ -49,6 +55,11 @@ install_docker_compose() {
apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" install -y docker-compose-plugin
;;
dnf)
"$ESCALATION_TOOL" "$PACKAGER" -y install dnf-plugins-core
"$ESCALATION_TOOL" "$PACKAGER" config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
"$ESCALATION_TOOL" "$PACKAGER" install -y docker-compose-plugin
;;
zypper)
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install docker-compose
;;
Expand Down
15 changes: 13 additions & 2 deletions core/tabs/applications-setup/linutil-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ installLinutil() {
printf "%b\n" "${YELLOW}Installing rustup...${RC}"
case "$PACKAGER" in
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm rustup
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm curl rustup man-db
;;
dnf)
"$ESCALATION_TOOL" "$PACKAGER" install -y rustup
"$ESCALATION_TOOL" "$PACKAGER" install -y curl rustup man-pages man-db man
;;
zypper)
"$ESCALATION_TOOL" "$PACKAGER" install -n curl gcc make
Expand All @@ -54,12 +54,23 @@ installLinutil() {
rustup default stable
cargo install --force linutil_tui
printf "%b\n" "${GREEN}Installed successfully.${RC}"
installExtra
;;
*) printf "%b\n" "${RED}Linutil not installed.${RC}" ;;
esac
esac
}

installExtra() {
printf "%b\n" "${YELLOW}Installing the manpage...${RC}"
"$ESCALATION_TOOL" mkdir -p /usr/share/man/man1
curl 'https://raw.githubusercontent.com/ChrisTitusTech/linutil/refs/heads/main/man/linutil.1' | "$ESCALATION_TOOL" tee '/usr/share/man/man1/linutil.1' > /dev/null
printf "%b\n" "${YELLOW}Creating a Desktop Entry...${RC}"
"$ESCALATION_TOOL" mkdir -p /usr/share/applications
curl 'https://raw.githubusercontent.com/ChrisTitusTech/linutil/refs/heads/main/linutil.desktop' | "$ESCALATION_TOOL" tee /usr/share/applications/linutil.desktop > /dev/null
printf "%b\n" "${GREEN}Done.${RC}"
}

checkEnv
checkEscalationTool
checkAURHelper
Expand Down
20 changes: 10 additions & 10 deletions core/tabs/applications-setup/mybash-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
gitpath="$HOME/.local/share/mybash"

installDepend() {
if ! command_exists bash bash-completion tar bat tree unzip fontconfig git; then
printf "%b\n" "${YELLOW}Installing Bash...${RC}"
case "$PACKAGER" in
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm bash bash-completion tar bat tree unzip fontconfig git
;;
*)
"$ESCALATION_TOOL" "$PACKAGER" install -y bash bash-completion tar bat tree unzip fontconfig git
;;
esac
if [ ! -f "/usr/share/bash-completion/bash_completion" ] || ! command_exists bash tar bat tree unzip fc-list git; then
printf "%b\n" "${YELLOW}Installing Bash...${RC}"
case "$PACKAGER" in
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm bash bash-completion tar bat tree unzip fontconfig git
;;
*)
"$ESCALATION_TOOL" "$PACKAGER" install -y bash bash-completion tar bat tree unzip fontconfig git
;;
esac
fi
}

Expand Down
2 changes: 1 addition & 1 deletion core/tabs/applications-setup/office-suites/freeoffice.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh -e

. ../common-script.sh
. ../../common-script.sh

installFreeOffice() {
if ! command_exists softmaker-freeoffice-2024 freeoffice softmaker; then
Expand Down
2 changes: 1 addition & 1 deletion core/tabs/applications-setup/office-suites/libreoffice.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh -e

. ../common-script.sh
. ../../common-script.sh

installLibreOffice() {
if ! command_exists libreoffice; then
Expand Down
2 changes: 1 addition & 1 deletion core/tabs/applications-setup/office-suites/onlyoffice.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh -e

. ../common-script.sh
. ../../common-script.sh

installOnlyOffice() {
if ! command_exists onlyoffice-desktopeditors; then
Expand Down
2 changes: 1 addition & 1 deletion core/tabs/applications-setup/office-suites/wpsoffice.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh -e

. ../common-script.sh
. ../../common-script.sh

installWpsOffice() {
if ! command_exists com.wps.Office; then
Expand Down
2 changes: 1 addition & 1 deletion core/tabs/applications-setup/pdf-suites/evince.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh -e

. ../common-script.sh
. ../../common-script.sh

installEvince() {
if ! command_exists evince; then
Expand Down
2 changes: 1 addition & 1 deletion core/tabs/applications-setup/pdf-suites/okular.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh -e

. ../common-script.sh
. ../../common-script.sh

installOkular() {
if ! command_exists okular; then
Expand Down
2 changes: 1 addition & 1 deletion core/tabs/applications-setup/pdf-suites/pdfstudio.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh -e

. ../common-script.sh
. ../../common-script.sh

installPdfstudio() {
if ! command_exists pdfstudio2024; then
Expand Down
2 changes: 1 addition & 1 deletion core/tabs/applications-setup/pdf-suites/pdfstudioviewer.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh -e

. ../common-script.sh
. ../../common-script.sh

installPdfstudioviewer() {
if ! command_exists pdfstudioviewer2024; then
Expand Down
Loading

0 comments on commit 5c822d5

Please sign in to comment.