Bozhidar Slaveykov 1 year ago
parent
commit
d97ebff273

BIN
.DS_Store


+ 23 - 0
.github/workflows/compile-ngix-package.yml

@@ -0,0 +1,23 @@
+name: Compile AlphaXPanel Packages
+
+on:
+  push:
+    branches: [ "main" ]
+  pull_request:
+    branches: [ "main" ]
+
+permissions:
+  contents: read
+
+jobs:
+  build:
+
+    runs-on: ubuntu-latest
+
+    steps:
+    - uses: actions/checkout@v3
+
+    - name: Compile NGINX
+      run: |
+        ls
+

+ 10 - 0
compilators/debian/control

@@ -0,0 +1,10 @@
+Source: alphax-nginx
+Package: alphax-nginx
+Priority: optional
+Version: 1.22.0
+Section: web
+Maintainer: Cloud Vision Ltd.
+Homepage: https://www.cloudvision.bg
+Architecture: amd64
+Depends: nginx
+Description: Nginx web server

+ 34 - 0
compilators/debian/custom-ngix.txt

@@ -0,0 +1,34 @@
+apt install build-essential dpkg-dev debhelper autotools-dev libgeoip-dev libssl-dev libpcre3-dev zlib1g-dev
+
+wget  http://nginx.org/download/nginx-1.20.0.tar.gz
+tar -zxvf nginx-1.20.0.tar.gz
+cd nginx-1.20.0
+
+./configure --prefix=/usr/local/alphax/nginx
+./configure
+        --prefix=/var/www/html
+        --sbin-path=/usr/sbin/nginx
+        --conf-path=/etc/nginx/nginx.conf
+        --http-log-path=/var/log/nginx/access.log
+        --error-log-path=/var/log/nginx/error.log
+        --with-pcre
+        --lock-path=/var/lock/nginx.lock
+        --pid-path=/var/run/nginx.pid
+        --with-http_ssl_module
+        --with-http_image_filter_module=dynamic
+        --modules-path=/etc/nginx/modules
+        --with-http_v2_module
+        --with-stream=dynamic
+        --with-http_addition_module
+        --with-http_mp4_module
+
+
+
+dpkg-deb -Zxz --build
+dpkg-deb --build mynginx
+
+for install
+sudo dpkg -i package-name.deb
+
+for remove
+sudo dpkg -r package-name

+ 32 - 0
compilators/debian/nginx-compile.sh

@@ -0,0 +1,32 @@
+#!/bin/bash
+
+# Install dependencies
+#apt install build-essential dpkg-dev debhelper autotools-dev libgeoip-dev libssl-dev libpcre3-dev zlib1g-dev
+
+rm -rf "alphaXpanel-compilators"
+
+mkdir "alphaXpanel-compilators"
+mkdir "alphaXpanel-compilators/nginx"
+cd "alphaXpanel-compilators/nginx"
+
+#Download nginx source
+wget http://nginx.org/download/nginx-1.20.0.tar.gz
+tar -zxvf nginx-1.20.0.tar.gz
+cd nginx-1.20.0
+
+# Configure nginx
+./configure --prefix=/usr/local/alphax/nginx
+make
+make install
+
+mkdir alphax-nginx-1.20.0
+cd alphax-nginx-1.20.0
+mkdir DEBIAN
+mkdir usr
+mkdir usr/local
+mkdir usr/local/alphax
+
+mv /usr/local/alphax/nginx usr/local/alphax
+cp control DEBIAN
+
+

+ 22 - 0
compilators/debian/nginx.service.txt

@@ -0,0 +1,22 @@
+
+# Create nginx service
+cat > /etc/systemd/system/alphax-nginx.service << EOF
+[Unit]
+Description=alphax-nginx
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/local/alphax/nginx/sbin/nginx
+ExecReload=/usr/local/alphax/nginx/sbin/nginx -s reload
+ExecStop=/usr/local/alphax/nginx/sbin/nginx -s quit
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target
+EOF
+
+# Start nginx service
+systemctl daemon-reload
+systemctl enable alphax-nginx.service
+systemctl start alphax-nginx.service

+ 2 - 0
configurations/ubuntu/nginx/panel.conf

@@ -1,3 +1,5 @@
+user alphaxweb;
+
 server {
 server {
     listen 3036;
     listen 3036;
     listen [::]:3036;
     listen [::]:3036;

BIN
web/.DS_Store


+ 12 - 0
web/public/index.php

@@ -1,4 +1,16 @@
 <?php
 <?php
+
+
+
+var_dump(exec('ls -la'));
+
+//var_dump(file_put_contents('/etc/nginx/sites-available/test-site.conf', 1));
+
+
+die();
+
+
+
 use Illuminate\Contracts\Http\Kernel;
 use Illuminate\Contracts\Http\Kernel;
 use Illuminate\Http\Request;
 use Illuminate\Http\Request;
 
 

+ 4 - 0
web/sudo/alphaxweb

@@ -0,0 +1,4 @@
+Defaults:root !requiretty
+
+# sudo is limited to alphaxpanel scripts
+alphaxweb   ALL=NOPASSWD:/usr/local/alphaxpanel/bin/*

+ 12 - 0
web/user.sh

@@ -0,0 +1,12 @@
+# Generate a random password
+random_password="wfawfafwafwafaw"
+email="wfafwafwa@abv.bg"
+
+# Create the new alphaxweb user
+#/usr/sbin/useradd "alphaxweb" -c "$email" --no-create-home
+# do not allow login into alphaxweb user
+echo alphaxweb:$random_password | sudo chpasswd -e
+
+mkdir -p /etc/sudoers.d
+cp -f /usr/local/alpha-x-panel/web/sudo/alphaxweb /etc/sudoers.d/
+chmod 440 /etc/sudoers.d/alphaxweb