Skip to content

Commit

Permalink
Merge pull request #10 from mashiahd/develop
Browse files Browse the repository at this point in the history
Few Fixes
  • Loading branch information
mashiahd authored Jun 24, 2024
2 parents 70f49a5 + 442b6fc commit 0ff082f
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 9 deletions.
45 changes: 41 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This repository contains a bash script for installing Nginx with ModSecurity 3 s
- [Installation](#installation)
- [Host/VM](#hostvm)
- [Proxmox VE (lxc)](#proxmox-ve-lxc)
- [DEV Enviroment](#dev-enviroment)
- [Usage](#usage)
- [Command Line Arguments](#command-line-arguments)
- [Default Values](#default-values)
Expand Down Expand Up @@ -46,15 +47,15 @@ This repository contains a bash script for installing Nginx with ModSecurity 3 s
Download and install via bash on you local machine:

```bash
sudo bash -c "$(wget -qLO - https://raw.githubusercontent.com/mashiahd/1minute_waf/develop/platform/proxmox_ct/modsec-nginx.sh)"
sudo bash -c "$(wget -qLO - https://raw.githubusercontent.com/mashiahd/1minute_waf/main/platform/vm/modsec_nginx.sh)"
```

#### Option 2:
```bash
git clone https://github.com/mashiahd/1minute_waf.git
cd ./1minute_waf/platform/vm
chmod +x modsec-nginx.sh
sudo ./modsec-nginx.sh [options]
chmod +x modsec_nginx.sh
sudo ./modsec_nginx.sh [options]
```

### Proxmox VE (lxc)
Expand All @@ -63,7 +64,7 @@ sudo ./modsec-nginx.sh [options]
Download and install via bash on lxc conatiner (Linux Container):

```bash
sudo bash -c "$(wget -qLO - https://raw.githubusercontent.com/mashiahd/1minute_waf/develop/platform/proxmox_ct/modsec_nginx_proxmox.sh)"
sudo bash -c "$(wget -qLO - https://raw.githubusercontent.com/mashiahd/1minute_waf/main/platform/proxmox_ct/modsec_nginx_proxmox.sh)"
```

#### Option 2:
Expand All @@ -74,6 +75,42 @@ chmod +x modsec_nginx_proxmox.sh
sudo ./modsec_nginx_proxmox.sh [options]
```

### DEV Enviroment

#### Option 1:

##### Host/VM

Download and install via bash on lxc conatiner (Linux Container):

```bash
sudo bash -c "$(wget -qLO - https://raw.githubusercontent.com/mashiahd/1minute_waf/develop/platform/vm/modsec_nginx.sh)"
```

#### Option 2:
```bash
git clone --single-branch --branch develop https://github.com/mashiahd/1minute_waf.git
cd ./1minute_waf/platform/vm
chmod +x modsec_nginx.sh
sudo ./modsec_nginx.sh [options]
```

##### Proxmox VE (lxc)

Download and install via bash on lxc conatiner (Linux Container):

```bash
sudo bash -c "$(wget -qLO - https://raw.githubusercontent.com/mashiahd/1minute_waf/develop/platform/proxmox_ct/modsec_nginx_proxmox.sh)"
```

#### Option 2:
```bash
git clone --single-branch --branch develop https://github.com/mashiahd/1minute_waf.git
cd ./1minute_waf/platform/proxmox_ct
chmod +x modsec_nginx_proxmox.sh
sudo ./modsec_nginx_proxmox.sh [options]
```

## Usage
If repository cloned run the script with or without command-line arguments:

Expand Down
3 changes: 2 additions & 1 deletion misc/utils.func
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,5 @@ description() {
</div>"
if [[ -f /etc/systemd/system/ping-instances.service ]]; then
systemctl start ping-instances.service
fi
fi
}
4 changes: 2 additions & 2 deletions platform/proxmox_ct/modsec_nginx_proxmox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Author: David Netanel Mashiah (mashiahd)
# License: GNU General Public License v3.0
# https://github.com/mashiahd/1minute_waf/LICENSE
source <(curl -s https://raw.githubusercontent.com/mashiahd/1minute_waf/main/misc/utils.func)
source <(curl -s https://raw.githubusercontent.com/mashiahd/1minute_waf/develop/misc/utils.func)

current_dir=$(pwd)
log_file="$current_dir/1minwaf_install.log"
Expand All @@ -22,7 +22,7 @@ HOSTNAME="modsec-nginx"
STORAGE="local-lvm"
TEMPLATE_FILENAME="ubuntu-22.04-standard_22.04-1_amd64.tar.zst"
FULL_TEMPLATE="local:vztmpl/$TEMPLATE_FILENAME"
SCRIPT_URL="https://raw.githubusercontent.com/mashiahd/1minute_waf/main/platform/vm/modsec_nginx.sh"
SCRIPT_URL="https://raw.githubusercontent.com/mashiahd/1minute_waf/develop/platform/vm/modsec_nginx.sh"
SCRIPT_NAME="modsec_nginx.sh"

log_info "Preparing Environment..."
Expand Down
4 changes: 2 additions & 2 deletions platform/vm/modsec_nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ echo -e "\033[1;34m[i] Downloading utils file\033[0m"

# Try to source the script using curl if available
if command -v curl &> /dev/null; then
if ! source <(curl -s https://raw.githubusercontent.com/mashiahd/1minute_waf/main/misc/utils.func); then
if ! source <(curl -s https://raw.githubusercontent.com/mashiahd/1minute_waf/develop/misc/utils.func); then
echo -e "\033[0;33m[!] Failed to download utils.func using curl\033[0m"
curl_successful=false
else
Expand All @@ -27,7 +27,7 @@ fi
# If curl attempt failed or curl is not available, try using wget
if [ "$curl_successful" != true ]; then
echo -e "\033[1;34m[i] Downloading utils.func file using wget\033[0m"
wget -q -O utils.func https://raw.githubusercontent.com/mashiahd/1minute_waf/main/misc/utils.func
wget -q -O utils.func https://raw.githubusercontent.com/mashiahd/1minute_waf/develop/misc/utils.func

# Source the downloaded script
if [ -f utils.func ]; then
Expand Down

0 comments on commit 0ff082f

Please sign in to comment.