Compare commits
53 Commits
v2-1
..
94b9f0e5cb
| Author | SHA1 | Date | |
|---|---|---|---|
| 94b9f0e5cb | |||
| 6d38221fa3 | |||
| 713cb9160e | |||
| 035d396c4f | |||
| e9a1efbf89 | |||
| 1d905742bc | |||
| 956543cfc3 | |||
| e38493230a | |||
| cfb2467782 | |||
| e6f35b2a1f | |||
| 1f8f1149cb | |||
| a92ad6e145 | |||
| 467546961f | |||
| b3ae758a82 | |||
| 400d814e20 | |||
| 79442acea9 | |||
| b84df55970 | |||
| cb5ae02ea2 | |||
| 7b91c32759 | |||
| 599fa32c67 | |||
| 32edbddf07 | |||
| 57f25ecac9 | |||
| 0c5f4b47b4 | |||
| 710daf1475 | |||
| de647fc401 | |||
| f1d0957af9 | |||
| e15b9d88f1 | |||
| 06624021d4 | |||
| 7069b0e0d6 | |||
| 201e399361 | |||
| 4f745516cd | |||
| b6c8c9ce96 | |||
| ebcd3a4d8c | |||
| cd68adb0cd | |||
| c8c4db0388 | |||
| 14bc66eac3 | |||
| 2a57da27dd | |||
| 14a7a13738 | |||
| 9e70a9eab5 | |||
| 92e1440c03 | |||
| caf9b67fcf | |||
| ed3bc18f9a | |||
| ceb2f81038 | |||
| 0016be8b72 | |||
| 648b594996 | |||
| 32185fd641 | |||
| 4cab377b5b | |||
| 6cf028078e | |||
| 3ee649efd1 | |||
| 41a757b5b7 | |||
| 8737f183d1 | |||
| 6f09ea58df | |||
| 529020368a |
@@ -0,0 +1,106 @@
|
|||||||
|
name: Build and Publish NGINX
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get -y install git dpkg-dev
|
||||||
|
|
||||||
|
- name: Clone the repository
|
||||||
|
run: |
|
||||||
|
cd $HOME
|
||||||
|
git clone https://github.com/theraw/The-World-Is-Yours.git
|
||||||
|
cd The-World-Is-Yours/
|
||||||
|
|
||||||
|
- name: Build NGINX
|
||||||
|
run: |
|
||||||
|
touch $HOME/.dockerenv
|
||||||
|
cd $HOME/The-World-Is-Yours/
|
||||||
|
sudo bash build/run.sh new
|
||||||
|
sudo bash build/run.sh build
|
||||||
|
sudo bash build/run.sh postfix
|
||||||
|
|
||||||
|
- name: Build .deb Package
|
||||||
|
id: build_deb
|
||||||
|
run: |
|
||||||
|
cd $HOME/The-World-Is-Yours/
|
||||||
|
sudo bash -c 'function create_deb() {
|
||||||
|
PKG_NAME="twiy"
|
||||||
|
VERSION=$(nginx -v 2>&1 | awk -F"/" "{print \$2}")
|
||||||
|
ARCH="amd64"
|
||||||
|
PKG_DIR="/opt/${PKG_NAME}_${VERSION}_${ARCH}"
|
||||||
|
DEB_DIR="${PKG_DIR}/DEBIAN"
|
||||||
|
mkdir -p ${PKG_DIR}/usr/sbin
|
||||||
|
mkdir -p ${PKG_DIR}/usr/local/nginx
|
||||||
|
mkdir -p ${PKG_DIR}/nginx
|
||||||
|
mkdir -p ${PKG_DIR}/etc/systemd/system
|
||||||
|
mkdir -p ${PKG_DIR}/var/log/nginx
|
||||||
|
mkdir -p ${PKG_DIR}/nginx/conf.d
|
||||||
|
mkdir -p ${PKG_DIR}/nginx/live
|
||||||
|
mkdir -p ${PKG_DIR}/nginx/modsec
|
||||||
|
mkdir -p ${PKG_DIR}/usr/lib
|
||||||
|
mkdir -p ${PKG_DIR}/usr/local/lib
|
||||||
|
mkdir -p ${PKG_DIR}/hostdata/default/public_html
|
||||||
|
mkdir -p ${PKG_DIR}/usr/nginx_lua
|
||||||
|
cp /usr/sbin/nginx ${PKG_DIR}/usr/sbin/
|
||||||
|
cp -R /nginx/* ${PKG_DIR}/nginx/
|
||||||
|
cp /etc/systemd/system/nginx.service ${PKG_DIR}/etc/systemd/system/
|
||||||
|
cp -R /hostdata/default ${PKG_DIR}/hostdata/
|
||||||
|
cp -R /usr/nginx_lua ${PKG_DIR}/usr/
|
||||||
|
for lib in $(ldd /usr/sbin/nginx | grep "=> /" | awk "{print \$3}"); do
|
||||||
|
cp "$lib" "${PKG_DIR}/usr/lib/"
|
||||||
|
done
|
||||||
|
for module in /opt/mod/*; do
|
||||||
|
if [ -f "$module" ]; then
|
||||||
|
for lib in $(ldd "$module" | grep "=> /" | awk "{print \$3}"); do
|
||||||
|
cp "$lib" "${PKG_DIR}/usr/lib/"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
mkdir -p ${DEB_DIR}
|
||||||
|
echo "Package: ${PKG_NAME}" > ${DEB_DIR}/control
|
||||||
|
echo "Version: ${VERSION}" >> ${DEB_DIR}/control
|
||||||
|
echo "Section: base" >> ${DEB_DIR}/control
|
||||||
|
echo "Priority: optional" >> ${DEB_DIR}/control
|
||||||
|
echo "Architecture: ${ARCH}" >> ${DEB_DIR}/control
|
||||||
|
echo "Maintainer: Julio <me@julio.al>" >> ${DEB_DIR}/control
|
||||||
|
echo "Description: Nginx L7 DDoS Protection! And many more features github.com/theraw/The-World-Is-Yours" >> ${DEB_DIR}/control
|
||||||
|
echo "#!/bin/bash" > ${DEB_DIR}/postinst
|
||||||
|
echo "useradd -r -d /usr/local/nginx -s /bin/false nginx || true" >> ${DEB_DIR}/postinst
|
||||||
|
chmod 755 ${DEB_DIR}/postinst
|
||||||
|
chmod -R 0755 ${DEB_DIR}
|
||||||
|
dpkg-deb --build ${PKG_DIR}
|
||||||
|
mv ${PKG_DIR}.deb /opt/${PKG_NAME}_${VERSION}_${ARCH}.deb
|
||||||
|
echo "Debian package created at /opt/${PKG_NAME}_${VERSION}_${ARCH}.deb"
|
||||||
|
echo "::set-output name=VERSION::${VERSION}"
|
||||||
|
}; create_deb'
|
||||||
|
|
||||||
|
- name: Create Git Tag
|
||||||
|
run: |
|
||||||
|
VERSION=${{ steps.build_deb.outputs.VERSION }}
|
||||||
|
git config user.name "theraw"
|
||||||
|
git config user.email "me@julio.al"
|
||||||
|
git tag v$VERSION
|
||||||
|
git push origin v$VERSION
|
||||||
|
|
||||||
|
- name: Upload .deb Package as Release Asset
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
files: /opt/*.deb
|
||||||
|
tag_name: v${{ steps.build_deb.outputs.version }}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
|
||||||
+25
@@ -0,0 +1,25 @@
|
|||||||
|
/.phpunit.cache
|
||||||
|
/node_modules
|
||||||
|
/public/build
|
||||||
|
/public/hot
|
||||||
|
/public/storage
|
||||||
|
/storage/*.key
|
||||||
|
/storage/pail
|
||||||
|
/vendor
|
||||||
|
.env
|
||||||
|
.env.backup
|
||||||
|
.env.production
|
||||||
|
.phpactor.json
|
||||||
|
.phpunit.result.cache
|
||||||
|
Homestead.json
|
||||||
|
Homestead.yaml
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
/auth.json
|
||||||
|
/.fleet
|
||||||
|
/.idea
|
||||||
|
/.nova
|
||||||
|
/.vscode
|
||||||
|
/.zed
|
||||||
|
/.cache
|
||||||
|
.cache
|
||||||
@@ -2,15 +2,46 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
- [x] Support Ubuntu 22.04
|
- [x] **Support Ubuntu 22.04**
|
||||||
- [x] Latest Nginx 1.26.0
|
- [x] **Latest Nginx 1.26.0**
|
||||||
- [x] ModSecurity Support.
|
- [x] **HTTP/3**
|
||||||
- [x] Naxsi Support.
|
- [x] **Admin Panel** : Optional *(Not installed by default)*
|
||||||
|
- [X] **Home Page** *(Nginx stats/graph via nginx stub stats)*
|
||||||
|
- [X] **Vhosts Page** *(Create, Delete, Edit)*
|
||||||
|
- [X] **IP Management** *(add, edit, delete)* *selectable on vhost creation*
|
||||||
|
- [X] **Ports Management** *(add, edit, delete)* *selectable on vhost creation*
|
||||||
|
- [ ] **Nginx Settings Page** *(Only change existing nginx.conf values)*
|
||||||
|
- [ ] **Log Reporting Page** (Not set yet, might be all in one page or seperated pages for access logs, modsec logs)
|
||||||
|
- [x] **Php Selector** (a.k.a creation of dedicated fpm pool) *selectable on vhost creation*
|
||||||
|
- [ ] **One click App installer** *(WordPress)*
|
||||||
|
- [x] ModSecurity Support *(Ngx Mod)*
|
||||||
|
- [x] Naxsi Support *(Ngx Mod)*
|
||||||
- [x] Lua Support.
|
- [x] Lua Support.
|
||||||
- [x] Cookie Based Challenge.
|
- [X] **AutoSSL** *(Lua Mod)*
|
||||||
|
- [ ] **Rate Limit** *(Lua Mod)*
|
||||||
|
- [ ] **Captcha** *(Lua Mod)*
|
||||||
|
- [x] Cookie Based Challenge *(Ngx Mod)*
|
||||||
- [x] [Versions List](https://github.com/theraw/The-World-Is-Yours/blob/master/version)
|
- [x] [Versions List](https://github.com/theraw/The-World-Is-Yours/blob/master/version)
|
||||||
|
|
||||||
## Compile from source
|
# Installation methods.
|
||||||
|
|
||||||
|
- 1 : **Repository (Easy)**
|
||||||
|
```bash
|
||||||
|
# Add repository and update system.
|
||||||
|
echo '' > /etc/apt/sources.list.d/the-world-is-yours.list
|
||||||
|
apt-get update; apt-get upgrade -y
|
||||||
|
|
||||||
|
# Install nginx.
|
||||||
|
apt-get install raweb -y
|
||||||
|
|
||||||
|
# Install admin panel.
|
||||||
|
apt-get install raweb-admin -y
|
||||||
|
```
|
||||||
|
- 2 : **Manual .deb (Med)**
|
||||||
|
```bash
|
||||||
|
Download them from : https://github.com/theraw/The-World-Is-Yours/releases
|
||||||
|
```
|
||||||
|
- 3 : **Compile from source (Hard)**
|
||||||
```bash
|
```bash
|
||||||
apt-get -y install git && cd /root/ && git clone https://github.com/theraw/The-World-Is-Yours.git && cd The-World-Is-Yours/
|
apt-get -y install git && cd /root/ && git clone https://github.com/theraw/The-World-Is-Yours.git && cd The-World-Is-Yours/
|
||||||
|
|
||||||
@@ -18,23 +49,27 @@ bash build/run.sh new
|
|||||||
bash build/run.sh build
|
bash build/run.sh build
|
||||||
bash build/run.sh postfix
|
bash build/run.sh postfix
|
||||||
```
|
```
|
||||||
|
- 3.1 : **Compiling from source with changed versions**
|
||||||
If you want to try with a custom nginx version then, open `version` file and change versions then run
|
|
||||||
```bash
|
```bash
|
||||||
|
# assuming you completed step 3.
|
||||||
|
# update "version" file then run again
|
||||||
bash build/run.sh new
|
bash build/run.sh new
|
||||||
bash build/run.sh build
|
bash build/run.sh build
|
||||||
```
|
```
|
||||||
## Basic cli info
|
|
||||||
```
|
|
||||||
|
|
||||||
|
## CLI Info
|
||||||
|
```bash
|
||||||
bash build/run.sh new => Download all modules + nginx that are missing from /opt/. (If you make version changes to 'version' file then simply rerun this to download again)
|
bash build/run.sh new => Download all modules + nginx that are missing from /opt/. (If you make version changes to 'version' file then simply rerun this to download again)
|
||||||
bash build/run.sh build => This is going to simply compile nginx nothing else. (You can run this as many times as you need, its not going to replace configs)
|
bash build/run.sh build => This is going to simply compile nginx nothing else. (You can run this as many times as you need, its not going to replace configs)
|
||||||
bash build/run.sh postfix => This will redownload /nginx/nginx.conf everytime you run it. (Suggested to run only once when you install nginx via my repo for first time)
|
bash build/run.sh postfix => This will redownload /nginx/nginx.conf everytime you run it. (Suggested to run only once when you install nginx via my repo for first time)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Basic info.
|
## Nginx Structure.
|
||||||
|
|
||||||
```
|
```bash
|
||||||
=> Nginx Folder = /nginx/
|
=> Nginx Folder = /nginx/
|
||||||
=> --conf-path = /nginx/nginx.conf
|
=> --conf-path = /nginx/nginx.conf
|
||||||
=> --pid-path = /var/run/nginx.pid
|
=> --pid-path = /var/run/nginx.pid
|
||||||
@@ -44,15 +79,26 @@ bash build/run.sh postfix => This will redownload /nginx/nginx.conf everytime yo
|
|||||||
=> --error-log-path = /var/log/nginx/error.log
|
=> --error-log-path = /var/log/nginx/error.log
|
||||||
|
|
||||||
LUA RESTY CORE SCRIPTS = /usr/nginx_lua
|
LUA RESTY CORE SCRIPTS = /usr/nginx_lua
|
||||||
|
|
||||||
|
# Admin Panel Info
|
||||||
|
=> Folder = /nginx/admin/public_html
|
||||||
```
|
```
|
||||||
|
|
||||||
## How to install lua scripts
|
## How to install lua scripts
|
||||||
```
|
|
||||||
|
- Method 1
|
||||||
|
```bash
|
||||||
. /root/The-World-Is-Yours/version
|
. /root/The-World-Is-Yours/version
|
||||||
cd /opt/mod/; git clone https://github.com/openresty/lua-resty-lrucache.git
|
cd /opt/mod/; git clone https://github.com/openresty/lua-resty-lrucache.git
|
||||||
cd /opt/mod/lua-resty-lrucache; make install PREFIX=${LUA_SCRIPTS}
|
cd /opt/mod/lua-resty-lrucache; make install PREFIX=${LUA_SCRIPTS}
|
||||||
nginx -s reload
|
nginx -s reload
|
||||||
```
|
```
|
||||||
|
- Method 2
|
||||||
|
```bash
|
||||||
|
# At first when you use this method you may get errors for missing lua scripts, you can install them with "luarocks".
|
||||||
|
apt-get install luarocks
|
||||||
|
luarocks install lua-resty-lrucache
|
||||||
|
```
|
||||||
|
|
||||||
# Support options.
|
# Support options.
|
||||||
|
|
||||||
|
|||||||
+11
-1
@@ -7,7 +7,7 @@ function reqs() {
|
|||||||
apt-get -y install wget zip unzip build-essential libssl-dev curl nano git
|
apt-get -y install wget zip unzip build-essential libssl-dev curl nano git
|
||||||
# apt-get -y install iptables ipset
|
# apt-get -y install iptables ipset
|
||||||
apt-get install libtool pkg-config make cmake automake autoconf -y
|
apt-get install libtool pkg-config make cmake automake autoconf -y
|
||||||
apt-get install libyajl-dev ssdeep zlib1g-dev libxslt1-dev libgd-dev libgeoip-dev liblmdb-dev libfuzzy-dev libmaxminddb-dev liblua5.2-dev libcurl4-openssl-dev libxml2 libxml2-dev libpcre3-dev mercurial libpcre2-dev libc-ares-dev libre2-dev -y
|
apt-get install libyajl-dev ssdeep zlib1g-dev libxslt1-dev libgd-dev libgeoip-dev liblmdb-dev libfuzzy-dev libmaxminddb-dev liblua5.1-dev libcurl4-openssl-dev libxml2 libxml2-dev libpcre3-dev mercurial libpcre2-dev libc-ares-dev libre2-dev -y
|
||||||
mkdir -p $LUA_SCRIPTS
|
mkdir -p $LUA_SCRIPTS
|
||||||
}
|
}
|
||||||
function clean_install() {
|
function clean_install() {
|
||||||
@@ -311,6 +311,16 @@ function post_build() {
|
|||||||
curl -s https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/nginx/live/default > /nginx/live/default
|
curl -s https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/nginx/live/default > /nginx/live/default
|
||||||
mkdir -p /hostdata/default/public_html/ && curl -s https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/index.html > /hostdata/default/public_html/index.html
|
mkdir -p /hostdata/default/public_html/ && curl -s https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/index.html > /hostdata/default/public_html/index.html
|
||||||
mkdir -p /hostdata/default/public_html/cdn/modsec && curl -s https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/modsec/aes.min.js > /hostdata/default/public_html/cdn/modsec/aes.min.js
|
mkdir -p /hostdata/default/public_html/cdn/modsec && curl -s https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/modsec/aes.min.js > /hostdata/default/public_html/cdn/modsec/aes.min.js
|
||||||
|
if [ -f "/run/.containerenv" ] || [ -f "/.dockerenv" ] || [ -f "/home/runner/.dockerenv" ]; then
|
||||||
|
echo "Skipping systemctl commands on GitHub runner"
|
||||||
|
mkdir -p /etc/systemd/system/
|
||||||
|
curl -s https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/Jammy/nginx.service > /etc/systemd/system/nginx.service
|
||||||
|
else
|
||||||
|
curl -s https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/Jammy/nginx.service > /etc/systemd/system/nginx.service
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl start nginx.service
|
||||||
|
systemctl enable nginx.service
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Handling command-line arguments
|
# Handling command-line arguments
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[Nginx]
|
[Unit]
|
||||||
Description=A high performance web server and a reverse proxy server
|
Description=A high performance web server and a reverse proxy server
|
||||||
After=syslog.target network-online.target remote-fs.target nss-lookup.target
|
After=syslog.target network-online.target remote-fs.target nss-lookup.target
|
||||||
Wants=network-online.target
|
Wants=network-online.target
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ events {
|
|||||||
|
|
||||||
http {
|
http {
|
||||||
# =================== LOAD LUA ========================= #
|
# =================== LOAD LUA ========================= #
|
||||||
lua_package_path "/usr/nginx_lua/lib/lua/?.lua";
|
lua_package_path "/usr/nginx_lua/lib/lua/?.lua;;";
|
||||||
|
lua_package_cpath "/usr/nginx_lua/lib/lua/5.1/?.so;;";
|
||||||
# =================== END LUA ========================== #
|
# =================== END LUA ========================== #
|
||||||
|
|
||||||
# =================== LOAD L7 ========================== #
|
# =================== LOAD L7 ========================== #
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
export NGINX="1.26.0"
|
export NGINX="1.26.0"
|
||||||
|
|
||||||
export LUA_SCRIPTS="/usr/nginx_lua/"
|
export LUA_SCRIPTS="/usr/nginx_lua"
|
||||||
|
|
||||||
# https://github.com/openresty/lua-nginx-module/tags
|
# https://github.com/openresty/lua-nginx-module/tags
|
||||||
export NGX_MOD_LUA="0.10.26"
|
export NGX_MOD_LUA="0.10.27"
|
||||||
|
|
||||||
# https://github.com/vision5/ngx_devel_kit/tags
|
# https://github.com/vision5/ngx_devel_kit/tags
|
||||||
export NGX_MOD_DEVELKIT="0.3.3"
|
export NGX_MOD_DEVELKIT="0.3.3"
|
||||||
|
|||||||
Reference in New Issue
Block a user