mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-05 13:15:21 +00:00
Merge branch 'main' of ssh://github.com/christitustech/linutil into cleanup
This commit is contained in:
commit
ccf22dec89
82
.github/workflows/linutil.yml
vendored
82
.github/workflows/linutil.yml
vendored
|
@ -1,40 +1,42 @@
|
|||
name: LinUtil Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
linutil_build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Cache Cargo registry
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cargo/registry
|
||||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: ${{ runner.os }}-cargo-registry-
|
||||
- name: Cache Cargo index
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cargo/git
|
||||
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: ${{ runner.os }}-cargo-index-
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
- name: Build
|
||||
run: cargo build --target-dir=build --release --verbose
|
||||
- uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: Commit Linutil
|
||||
file_pattern: 'build/release/linutil'
|
||||
if: success()
|
||||
name: LinUtil Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
linutil_build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Cache Cargo registry
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cargo/registry
|
||||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: ${{ runner.os }}-cargo-registry-
|
||||
- name: Cache Cargo index
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cargo/git
|
||||
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: ${{ runner.os }}-cargo-index-
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: x86_64-unknown-linux-musl
|
||||
- name: Build
|
||||
run: cargo build --target-dir=build --release --verbose --target=x86_64-unknown-linux-musl
|
||||
- uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: Commit Linutil
|
||||
file_pattern: "build/x86_64-unknown-linux-musl/release/linutil"
|
||||
if: success()
|
||||
|
|
8
.github/workflows/pre-release.yaml
vendored
8
.github/workflows/pre-release.yaml
vendored
|
@ -1,8 +1,8 @@
|
|||
name: Pre-Release LinUtil
|
||||
|
||||
permissions:
|
||||
contents: write # Grant write permissions to contents
|
||||
packages: write # Grant write permissions to packages
|
||||
contents: write # Grant write permissions to contents
|
||||
packages: write # Grant write permissions to packages
|
||||
|
||||
on:
|
||||
workflow_dispatch: # Manual trigger added
|
||||
|
@ -30,9 +30,9 @@ jobs:
|
|||
body: "![GitHub Downloads (specific asset, specific tag)](https://img.shields.io/github/downloads/ChrisTitusTech/linutil/${{ env.version }}/linutil)"
|
||||
append_body: false
|
||||
files: |
|
||||
./build/release/linutil
|
||||
./build/x86_64-unknown-linux-musl/release/linutil
|
||||
prerelease: true
|
||||
generate_release_notes: true
|
||||
env:
|
||||
version: ${{ env.version }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
12
Cargo.lock
generated
12
Cargo.lock
generated
|
@ -163,9 +163,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "clap"
|
||||
version = "4.5.9"
|
||||
version = "4.5.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "64acc1846d54c1fe936a78dc189c34e28d3f5afc348403f28ecf53660b9b8462"
|
||||
checksum = "35723e6a11662c2afb578bcf0b88bf6ea8e21282a953428f240574fcc3a2b5b3"
|
||||
dependencies = [
|
||||
"clap_builder",
|
||||
"clap_derive",
|
||||
|
@ -173,9 +173,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "clap_builder"
|
||||
version = "4.5.9"
|
||||
version = "4.5.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6fb8393d67ba2e7bfaf28a23458e4e2b543cc73a99595511eb207fdb8aede942"
|
||||
checksum = "49eb96cbfa7cfa35017b7cd548c75b14c3118c98b423041d70562665e07fb0fa"
|
||||
dependencies = [
|
||||
"anstream",
|
||||
"anstyle",
|
||||
|
@ -185,9 +185,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "clap_derive"
|
||||
version = "4.5.8"
|
||||
version = "4.5.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085"
|
||||
checksum = "5d029b67f89d30bbb547c89fd5161293c0aec155fc691d7924b64550662db93e"
|
||||
dependencies = [
|
||||
"heck",
|
||||
"proc-macro2",
|
||||
|
|
|
@ -5,7 +5,7 @@ edition = "2021"
|
|||
|
||||
[dependencies]
|
||||
chrono = "0.4.33"
|
||||
clap = { version = "4.5.9", features = ["derive"] }
|
||||
clap = { version = "4.5.11", features = ["derive"] }
|
||||
crossterm = "0.27.0"
|
||||
ego-tree = "0.6.2"
|
||||
oneshot = "0.1.8"
|
||||
|
|
|
@ -11,7 +11,7 @@ A distro-agnostic* toolbox which helps with everyday Linux tasks. It can help yo
|
|||
|
||||
## 💡 Usage
|
||||
|
||||
Open your terminal and paste this command
|
||||
Open your terminal and paste this command:
|
||||
```bash
|
||||
curl -fsSL https://christitus.com/linux | sh
|
||||
```
|
||||
|
|
Binary file not shown.
BIN
build/x86_64-unknown-linux-musl/release/linutil
Executable file
BIN
build/x86_64-unknown-linux-musl/release/linutil
Executable file
Binary file not shown.
39
src/commands/security/firewall-baselines.sh
Normal file
39
src/commands/security/firewall-baselines.sh
Normal file
|
@ -0,0 +1,39 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
installPkg() {
|
||||
echo "Install UFW if not already installed..."
|
||||
if ! command_exists ufw; then
|
||||
case ${PACKAGER} in
|
||||
pacman)
|
||||
sudo "${PACKAGER}" -S --noconfirm ufw
|
||||
;;
|
||||
*)
|
||||
sudo "${PACKAGER}" install -y ufw
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo "UFW is already installed."
|
||||
fi
|
||||
echo -e "${GREEN}Using Chris Titus Recommended Firewall Rules${RC}"
|
||||
sudo ufw limit 22/tcp
|
||||
echo "Limiting port 22/tcp (UFW)"
|
||||
|
||||
sudo ufw allow 80/tcp
|
||||
echo "Allowing port 80/tcp (UFW)"
|
||||
|
||||
sudo ufw allow 443/tcp
|
||||
echo "Allowing port 443/tcp (UFW)"
|
||||
|
||||
sudo ufw default deny incoming
|
||||
echo "Denying Incoming Packets by Default(UFW)"
|
||||
|
||||
sudo ufw default allow outgoing
|
||||
echo "Allowing Outcoming Packets by Default(UFW)"
|
||||
|
||||
sudo ufw enable
|
||||
echo -e "${GREEN}Enabled Firewall with Baselines!${RC}"
|
||||
|
||||
}
|
||||
|
||||
checkEnv
|
||||
installPkg
|
|
@ -55,12 +55,12 @@ installDepend() {
|
|||
fi
|
||||
"$AUR_HELPER" --noconfirm -S "$DEPENDENCIES"
|
||||
;;
|
||||
apt)
|
||||
apt-get|nala)
|
||||
COMPILEDEPS='build-essential'
|
||||
sudo "$PACKAGER" update
|
||||
sudo dpkg --add-architecture i386
|
||||
sudo "$PACKAGER" update
|
||||
sudo "$PACKAGER" install -y "$DEPENDENCIES" $COMPILEDEPS
|
||||
sudo "$PACKAGER" install -y $DEPENDENCIES $COMPILEDEPS
|
||||
;;
|
||||
dnf)
|
||||
COMPILEDEPS='@development-tools'
|
||||
|
@ -76,7 +76,7 @@ installDepend() {
|
|||
sudo "$PACKAGER" --non-interactive install libgcc_s1-gcc7-32bit glibc-devel-32bit
|
||||
;;
|
||||
*)
|
||||
sudo "$PACKAGER" install -y "$DEPENDENCIES"
|
||||
sudo "$PACKAGER" install -y $DEPENDENCIES # Fixed bug where no packages found on debian-based
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
|
|
@ -78,7 +78,8 @@ updateSystem() {
|
|||
sudo "${PACKAGER}" upgrade -y
|
||||
;;
|
||||
pacman)
|
||||
sudo "${PACKAGER}" -Syu --noconfirm
|
||||
sudo "${PACKAGER}" -Sy --noconfirm --needed archlinux-keyring
|
||||
sudo "${PACKAGER}" -Su --noconfirm
|
||||
;;
|
||||
zypper)
|
||||
sudo ${PACKAGER} ref
|
||||
|
|
11
src/list.rs
11
src/list.rs
|
@ -76,7 +76,16 @@ impl CustomList {
|
|||
},
|
||||
},
|
||||
ListNode {
|
||||
name: "Applications Setup",
|
||||
name: "Security",
|
||||
command: ""
|
||||
} => {
|
||||
ListNode {
|
||||
name: "Firewall Baselines (CTT)",
|
||||
command: with_common_script!("commands/security/firewall-baselines.sh"),
|
||||
}
|
||||
},
|
||||
ListNode {
|
||||
name: "Titus Dotfiles",
|
||||
command: Command::None
|
||||
} => {
|
||||
ListNode {
|
||||
|
|
Loading…
Reference in New Issue
Block a user