OSPL20 will be replaced with MPL2.0 after 1st February 2021! Read more here
OSPL18 and OSPL19 will be replaced with MIT after 1st February2021! Read more here

Verified Commit 9802c33f authored by AtjonTV's avatar AtjonTV

Beta 1 (AAAB 3.18.3)

parents
# AAAB Setup
This is a setup script for Caddy and AAAB Master/Proxy.
## How to setup Master
```bash
$ bash setup.sh
```
## How to setup Proxy
```bash
$ bash setup.sh --proxy
```
\ No newline at end of file
http://aaab-online.xyz {
redir https://aaab-online.xyz
}
https://aaab-online.xyz {
proxy / http://127.0.0.1:8080 {
transparent
}
log / /var/log/caddy/access.log
}
\ No newline at end of file
[Unit]
Description=Caddy HTTP/2 web server
Documentation=https://caddyserver.com/docs
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service
[Service]
Restart=on-abnormal
; User and group the process will run as.
User=caddy
Group=caddy
; Letsencrypt-issued certificates will be written to this directory.
Environment=CADDYPATH=/etc/caddy/ssl
; Always set "-root" to something safe in case it gets forgotten in the Caddyfile.
ExecStart=/usr/local/bin/caddy -log stdout -agree=true -conf=/etc/caddy/conf/Caddyfile -root=/var/tmp
ExecReload=/bin/kill -USR1 $MAINPID
; Use graceful shutdown with a reasonable timeout
KillMode=mixed
KillSignal=SIGQUIT
TimeoutStopSec=5s
; Limit the number of file descriptors; see `man systemd.exec` for more limit settings.
LimitNOFILE=1048576
; Unmodified caddy is not expected to use more than that.
LimitNPROC=512
; Use private /tmp and /var/tmp, which are discarded after caddy stops.
PrivateTmp=false
; Use a minimal /dev (May bring additional security if switched to 'true', but it may not work on Raspberry Pi's or other devices, so it has been disabled in this dist.)
PrivateDevices=true
; Hide /home, /root, and /run/user. Nobody will steal your SSH-keys.
ProtectHome=true
; Make /usr, /boot, /etc and possibly some more folders read-only.
ProtectSystem=full
; … except /etc/caddy/ssl, because we want Letsencrypt-certificates there.
; This merely retains r/w access rights, it does not add any new. Must still be writable on the host!
ReadWriteDirectories=/etc/caddy/ssl
; The following additional security directives only work with systemd v229 or later.
; They further restrict privileges that can be gained by caddy. Uncomment if you like.
; Note that you may have to add capabilities required by any plugins in use.
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_BIND_SERVICE
;NoNewPrivileges=true
[Install]
WantedBy=multi-user.target
\ No newline at end of file
#!/bin/bash
# Caddy Install
curl https://getcaddy.com | bash -s personal http.nobots,http.ratelimit,http.realip
# Caddy Setup
mkdir /etc/caddy
mkdir /etc/caddy/{ssl,conf}
mkdir /var/log/caddy
adduser --system --disabled-password --shell /bin/bash --group caddy
chown -R caddy:caddy /etc/caddy
chown -R caddy:caddy /var/log/caddy
setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/caddy
# Caddy Service
cp caddy/caddy.service /etc/caddy
ln -s /etc/caddy/caddy.service /etc/systemd/system/caddy.service
# Caddy Config
cp caddy/Caddyfile /etc/caddy/conf/Caddyfile
# Service
service caddy start
\ No newline at end of file
[Unit]
Description=AltAccountAutoBan v3
[Service]
ExecStart=/opt/aaab-master/service start
#ExecStop=/opt/aaab-master/service stop
Type=simple
User=root
[Install]
WantedBy=multi-user.target
\ No newline at end of file
host=127.0.0.1
port=8080
db.host=localhost
db.name=aaab
db.user=aaab
db.pass=<pwd>
updates.enable=true
updates.token=77150a90e970417c6b1d7a8134cb01199762c5ea
updates.location=/opt/aaab-master/bin
tracking.token=77150a90e970417c6b1d7a8134cb01199762c5ea
tracking.file=/opt/aaab-master/tracking.json
client.min_plugin=3.5.0
client.min_proxy=3.18.0
\ No newline at end of file
#!/bin/bash
cd /opt/aaab-master
rm aaab.jar
ln -s /opt/aaab-master/bin/aaab-$1.jar aaab.jar
systemctl daemon-reload
service aaab-master restart
\ No newline at end of file
#!/bin/bash
if [ "$1" == "start" ]; then
/usr/bin/java -jar /opt/aaab-master/aaab-master.jar --config=/opt/aaab-master/config.konf &>> "/opt/aaab-master/logs/$(date '+%Y-%m-%d').log"
elif [ "$1" == "startx" ]; then
screen -S aaab-master ./service start
elif [ "$1" == "stop" ]; then
kill `ps -ef | grep -v awk | awk -e '/java.*aaab-master/ { print $2 }'`
elif [ "$1" == "update" ]; then
if [ -e "/tmp/___465acac8-forceRestart" ]; then
/opt/aaab-master/deploy $(cat /tmp/___465acac8-forceRestart)
rm /tmp/___465acac8-forceRestart
fi
fi
#!/bin/bash
# Software Setup
apt install mariadb-server mariadb-client -y
# Service
service mariadb start
# Database Setup
DATABASE=$(date +%s | sha256sum | base64 | head -c 32 ; echo)
mysql <<< "CREATE DATABASE aaab;"
mysql <<< "GRANT ALL PRIVELEGES ON aaab.* TO aaab@'localhost' IDENTIFIED BY '$DATABASE';"
sed -i "s/<pwd>/$DATABASE/g" master/config.konf
# Config Setup
mkdir /opt/aaab-master
mkdir /opt/aaab-master/{bin,logs}
cp master/config.konf /opt/aaab-master/config.konf
# AAAB-Master Setup (3.18.3)
VERSION=3.18.3
JOBID=5597
curl https://gitlab.atvg-studios.at/atvg-studios/aaab-project/aaab-center/-/jobs/$JOBID/artifacts/raw/build/libs/aaab-center-$VERSION-all.jar?inline=false -O aaab-$VERSION.jar
mv aaab-$VERSION.jar /opt/aaab-master/bin
ln -s /opt/aaab-master/bin/aaab-$VERSION.jar /opt/aaab-master/aaab.jar
# Service Setup
cp master/aaab.service /opt/aaab-master
ln -s /opt/aaab-master/aaab.service /etc/systemd/system/aaab-master.service
# Service
service aaab-master start
\ No newline at end of file
[Unit]
Description=AltAccountAutoBan v3 Proxy
[Service]
ExecStart=/opt/aaab-proxy/service start
#ExecStop=/opt/aaab-proxy/service stop
Type=simple
User=root
[Install]
WantedBy=multi-user.target
\ No newline at end of file
host=127.0.0.1
port=8080
updates.enable=true
updates.token=77150a90e970417c6b1d7a8134cb01199762c5ea
updates.location=/opt/aaab-proxy/bin
tracking.token=77150a90e970417c6b1d7a8134cb01199762c5ea
tracking.file=/opt/aaab-proxy/tracking.json
client.min_plugin=3.5.0
client.min_proxy=3.18.0
\ No newline at end of file
#!/bin/bash
cd /opt/aaab-proxy
rm aaab.jar
ln -s /opt/aaab-proxy/bin/aaab-$1.jar aaab.jar
systemctl daemon-reload
service aaab-proxy restart
\ No newline at end of file
#!/bin/bash
if [ "$1" == "start" ]; then
/usr/bin/java -jar /opt/aaab-proxy/aaab-proxy.jar --config=/opt/aaab-proxy/config.konf &>> "/opt/aaab-proxy/logs/$(date '+%Y-%m-%d').log"
elif [ "$1" == "startx" ]; then
screen -S aaab-proxy ./service start
elif [ "$1" == "stop" ]; then
kill `ps -ef | grep -v awk | awk -e '/java.*aaab-proxy/ { print $2 }'`
elif [ "$1" == "update" ]; then
if [ -e "/tmp/___465acac8-forceRestart" ]; then
/opt/aaab-proxy/deploy $(cat /tmp/___465acac8-forceRestart)
rm /tmp/___465acac8-forceRestart
fi
fi
#!/bin/bash
# Config Setup
mkdir /opt/aaab-proxy
mkdir /opt/aaab-proxy/{bin,logs}
cp proxy/config.konf /opt/aaab-proxy/config.konf
# AAAB-Proxy Setup (3.18.3)
VERSION=3.18.3
JOBID=5597
curl https://gitlab.atvg-studios.at/atvg-studios/aaab-project/aaab-center/-/jobs/$JOBID/artifacts/raw/build/libs/aaab-center-$VERSION-all.jar?inline=false -O aaab-$VERSION.jar
mv aaab-$VERSION.jar /opt/aaab-proxy/bin
ln -s /opt/aaab-proxy/bin/aaab-$VERSION.jar /opt/aaab-proxy/aaab.jar
# Service Setup
cp proxy/aaab.service /opt/aaab-proxy
ln -s /opt/aaab-proxy/aaab.service /etc/systemd/system/aaab-proxy.service
# Service
service aaab-proxy start
\ No newline at end of file
#!/bin/bash
# Software Setup
apt update
apt upgrade -y
apt install openjdk-8-jre-headless nano git
# Caddy Setup
bash caddy/setup.sh
# AAAB Setup
if [ "$1" = "--proxy" ];
bash proxy/setup.sh
else
bash master/setup.sh
fi
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment