domainmod funneee

This commit is contained in:
Roxy 2023-06-09 10:30:58 +02:00
parent ef64b903f3
commit 881e5e3108
2 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,63 @@
#!/bin/bash
#Installing da dependencies
sudo apt update
sudo apt install -y nginx php-fpm php-mysql
sudo systemctl start php7.4-fpm
sudo systemctl enable php7.4-fpm
#Population da Nginx configs, replace dom.adastra7.net with your domain obv
sudo tee /etc/nginx/sites-available/domainmod <<EOF
server {
listen 80;
listen [::]:80;
dom.adastra7.net; # Replace with your actual domain name
root /var/www/domainmod;
index index.php;
location / {
try_files \$uri \$uri/ /index.php?\$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
EOF
# enable the funny new config
sudo ln -s /etc/nginx/sites-available/domainmod /etc/nginx/sites-enabled/
# Yeet nginx defaul config because we don need it anymore
sudo rm /etc/nginx/sites-enabled/default
#If this throws error we fucked up
sudo nginx -t
sudo nginx -S reload
#restart nginx for good measure
sudo systemctl restart nginx
# download domain mod and extract it
cd /var/www/
sudo wget -O domainmod.zip https://github.com/domainmod/domainmod/archive/master.zip
sudo unzip domainmod.zip
sudo mv domainmod-master domainmod
sudo chown -R www-data:www-data /var/www/domainmod
# change em logins to what you want them to be here plz
mysql -u root -p <<MYSQL_SCRIPT
CREATE DATABASE domainmod;
GRANT ALL PRIVILEGES ON domainmod.* TO 'domainmod'@'localhost' IDENTIFIED BY 'legit-password.exe';
FLUSH PRIVILEGES;
EXIT
MYSQL_SCRIPT
#make prem prem initial database
mysql -u domainmod -p domainmod < /var/www/domainmod/install/database/database.sql
#set file perms
sudo chmod -R 755 /var/www/domainmod
echo "Congrats my script didnt crash wohoo stuff should technically work"

View File

@ -31,3 +31,6 @@ Do not use the Appimage provided on the rockbox website, this will fail as apps
## Automating the installation of mediamtx
Whenever I require to install mediamtx to run USB Webcams over RTSP I am required to install mediamtx this is something that can clearly be automated using bash hence why you will find a basic bash script in the mediamtx folder that automates this process for me.
## Automating the installation of domainMOD because I can
TODO