Guardsman Web is a web-based administration panel designed for managing and automating tasks such as auto-punishment expiry, data backups, and statistics. This project is no longer actively maintained, so use it at your own risk.
Last edited by Jaiden 10 months ago.
Special thanks to the Pterodactyl Project for their in-depth installation instructions, which were utilized in this guide.
Warning
The release of Guardsman V2 has made this Guardsman Project deprecated, and updates have ceased.
This is just a "fork" of the repo, as the "normal" one has been privatised.
Thank you for your support to Guardsman
THIS REPO AND ALL THE CONTENTS INSIDE OF IT ARE OWNED BY BUNKER BRAVO LLC.
This repo is not a replacment until V2 is going open-source as most of it is deprecated and/or not maintained.
ERRATUM: Apparently, V2's Back AND front end are not going open-source, sooo yeah.
Guardsman Web requires several system dependencies and programs to function properly. Follow the steps below to install them:
-
Install the
software-properties-commonpackage to add theadd-apt-repositorycommand:sudo apt -y install software-properties-common curl apt-transport-https ca-certificates gnupg
-
Add additional repositories for PHP, Redis, and MariaDB:
sudo LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php
-
Update the repositories list:
sudo apt update && sudo apt upgrade -y -
Install the required dependencies:
sudo apt -y install php8.3 php8.3-{common,cli,gd,mysql,mbstring,bcmath,xml,fpm,curl,zip} mariadb-server nginx tar unzip git -
Install Composer, a PHP package/dependency manager:
sudo curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
To install Guardsman Web on your system, follow these steps:
- Clone the Guardsman Web repository:
git clone https://github.com/Sintaxytb/Guardsman-Web-Origin-Repo
1.2 Go in the cloned repo.
cd guardsman-web- Install Composer dependencies:
sudo composer install-
Install NPM dependencies using your preferred package manager:
sudo npm install --legacy-peer-deps #For npm install to not have conflict dependecies, due to an update -
Generate an application key:
sudo php artisan key:generate
To enable automated tasks such as auto-punishment expiry, data backups, and statistics, you need to set up a crontab entry that runs the scheduled tasks every minute.
-
Open the crontab editor:
sudo crontab -e
If prompted, select an editor (e.g., GNU nano).
-
Add the following entry to the bottom of the file:
* * * * * php /opt/guardsman-web/artisan schedule:run >> /dev/null 2>&1
Note: To customize the interval, use Crontab Guru.
-
Copy the
.env.examplefile to.env:cp .env.example .env
-
Edit the
.envfile to configure your environment variables. Guardsman Web requires a working MySQL or MariaDB installation. -
After configuring the
DB_*values, run the database migrations:sudo php artisan migrate
Without SSL:
server {
# Replace the example <domain> with your domain name or IP address
listen 80;
server_name <domain>;
root /opt/guardsman-web/public;
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
expires 1y;
add_header Cache-Control "public, no-transform";
add_header Accept-Encoding "gzip, compress, br";
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log off;
error_log /var/log/nginx/guardsman.log error;
location /api/* {
expires -1;
add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
}
location /openapi.json {
expires -1;
add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
}
location /statistics.json {
expires -1;
add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
}
#GZIP
# Enable gzip compression.
gzip on;
# Compression level (1-9).
# 5 is a perfect compromise between size and CPU usage, offering about
# 75% reduction for most ASCII files (almost identical to level 9).
gzip_comp_level 5;
# Don't compress anything that's already small and unlikely to shrink much
# if at all (the default is 20 bytes, which is bad as that usually leads to
# larger files after gzipping).
gzip_min_length 256;
# Compress data even for clients that are connecting to us via proxies,
# identified by the "Via" header (required for CloudFront).
gzip_proxied any;
# Tell proxies to cache both the gzipped and regular version of a resource
# whenever the client's Accept-Encoding capabilities header varies;
# Avoids the issue where a non-gzip capable client (which is extremely rare
# today) would display gibberish if their proxy gave them the gzipped version.
gzip_vary on;
# Compress all output labeled with one of the following MIME-types.
gzip_types
application/atom+xml
application/javascript
application/json
application/ld+json
application/manifest+json
application/rss+xml
application/vnd.geo+json
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/bmp
image/svg+xml
image/x-icon
text/cache-manifest
text/css
text/plain
text/vcard
text/vnd.rim.location.xloc
text/vtt
text/x-component
text/x-cross-domain-policy;
# text/html is always compressed by gzip module
# allow larger file uploads and longer script runtimes
client_max_body_size 100m;
client_body_timeout 120s;
sendfile off;
location /api/docs {
proxy_pass http://127.0.0.1:9001;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTP_PROXY "";
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
}
location ~ /\.ht {
deny all;
}
}After completing the installation, you need to create a user with super admin privileges:
-
Run the following command:
sudo php artisan g:role:make
-
Run the following command:
sudo php artisan g:user:make
-
Follow the prompts to enter the user's information.
- No Maintenance: This project is no longer actively maintained. Bugs and security issues will not be addressed. (Dependecies will NOT be updated)
- Database Backups: Regularly back up your database to prevent data loss.
- Security: Ensure your server is properly secured, especially if exposed to the internet.
This project is provided as-is without any warranty. Use it at your own risk.