Compare commits
46
Commits
v2-1
...
e38493230a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 }}
|
||||||
@@ -4,12 +4,16 @@
|
|||||||
|
|
||||||
- [x] Support Ubuntu 22.04
|
- [x] Support Ubuntu 22.04
|
||||||
- [x] Latest Nginx 1.26.0
|
- [x] Latest Nginx 1.26.0
|
||||||
|
- [x] HTTP/3
|
||||||
- [x] ModSecurity Support.
|
- [x] ModSecurity Support.
|
||||||
- [x] Naxsi Support.
|
- [x] Naxsi Support.
|
||||||
- [x] Lua Support.
|
- [x] Lua Support.
|
||||||
- [x] Cookie Based Challenge.
|
- [x] Cookie Based Challenge.
|
||||||
- [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)
|
||||||
|
|
||||||
|
## Easy install
|
||||||
|
(This is beta please create an issue if any errors) Download .deb from https://github.com/theraw/The-World-Is-Yours/releases
|
||||||
|
|
||||||
## Compile from source
|
## Compile from source
|
||||||
```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/
|
||||||
@@ -24,7 +28,7 @@ If you want to try with a custom nginx version then, open `version` file and cha
|
|||||||
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 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)
|
||||||
@@ -32,7 +36,7 @@ bash build/run.sh postfix => This will redownload /nginx/nginx.conf everytime yo
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Basic info.
|
## Nginx info.
|
||||||
|
|
||||||
```
|
```
|
||||||
=> Nginx Folder = /nginx/
|
=> Nginx Folder = /nginx/
|
||||||
|
|||||||
+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