diff --git a/scripts/giteainstall.sh b/scripts/giteainstall.sh index 7aa8ea1..db5fe68 100644 --- a/scripts/giteainstall.sh +++ b/scripts/giteainstall.sh @@ -33,7 +33,26 @@ sudo chmod -R 750 /var/lib/gitea sudo mkdir -v /etc/gitea sudo chown -R root:git /etc/gitea sudo chmod -R 770 /etc/gitea -sudo wget -O /etc/systemd/system/gitea.service https://git.oldgate.org/Sophia/thelinuxlist/raw/branch/main/systemd/gitea.service +sudo echo " +[Unit] +Description=Gitea +After=syslog.target +After=network.target + +[Service] +RestartSec=3s +Type=simple +User=git +Group=git +WorkingDirectory=/var/lib/gitea/ + +ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini +Restart=always +Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea + +[Install] +WantedBy=multi-user.target +" >> /etc/systemd/system/gitea.service sudo systemctl daemon-reload sudo systemctl enable --now gitea sudo systemctl start gitea diff --git a/scripts/gogsinstall.sh b/scripts/gogsinstall.sh index 74f93e2..45f0239 100644 --- a/scripts/gogsinstall.sh +++ b/scripts/gogsinstall.sh @@ -23,7 +23,38 @@ sudo tar xvf linux_amd64.tar.gz sudo adduser --system --shell /bin/bash --gecos 'Git Version Control' --group --disabled-password --home /home/git git sudo mkdir /var/log/gogs sudo chown -R git:git /var/log/gogs/ -sudo wget -O /etc/systemd/system/gogs.service https://git.oldgate.org/Sophia/thelinuxlist/raw/branch/main/systemd/gogs.service +sudo echo " +[Unit] +Description=Gogs self-hosted Git service +After=syslog.target +After=network.target +After=mysql.service + +[Service] +# Modify these two values and uncomment them if you have +# repos with lots of files and get an HTTP error 500 because +# of that +### +#LimitMEMLOCK=infinity +#LimitNOFILE=65535 +Type=simple +User=git +Group=git +WorkingDirectory=/home/git +ExecStart=/home/git/gogs web +Restart=always +Environment=USER=git HOME=/home/git + +# Some distributions may not support these hardening directives. If you cannot start the service due +# to an unknown option, comment out the ones not supported by your version of systemd. +ProtectSystem=full +PrivateDevices=yes +PrivateTmp=yes +NoNewPrivileges=true + +[Install] +WantedBy=multi-user.target +" >> /etc/systemd/system/gogs.service sudo rsync -avz gogs/* /home/git/ sudo chown -R git:git /home/git/ sudo ufw allow 3000 diff --git a/scripts/pmainstall.sh b/scripts/pmainstall.sh index 76106fc..deb01fe 100644 --- a/scripts/pmainstall.sh +++ b/scripts/pmainstall.sh @@ -21,7 +21,26 @@ sudo apt update && apt upgrade -y sudo add-apt-repository --yes ppa:ondrej/php && apt install libapache2-mod-php$PHP_VER php$PHP_VER-fpm software-properties-common phpmyadmin php-mbstring php-zip php-gd php-json php-curl apache2 -y sudo systemctl stop apache2 sudo apt remove php8.1-fpm php8.1-* -y -sudo echo "Include /etc/phpmyadmin/apache.conf" >> /etc/apache2/apache2.conf +sudo echo " +Listen 8080 + + + + ServerName localhost + + + AllowOverride None + Require all granted + + + DocumentRoot /usr/share/phpmyadmin + + Include /etc/phpmyadmin/apache.conf + + ErrorLog ${APACHE_LOG_DIR}/phpmyadmin.error.log + CustomLog ${APACHE_LOG_DIR}/phpmyadmin.access.log combined + +" >> /etc/apache2/sites-enabled/phpmyadmin.conf sudo phpenmod mbstring sudo a2dismod php$PHP_VER sudo a2dismod mpm_prefork @@ -50,8 +69,8 @@ sudo systemctl restart apache2 echo -e "==================================================================" publicipaddress=$(curl -sS --connect-timeout 10 -m 60 https://ipv4.icanhazip.com/ || curl -sS --connect-timeout 10 -m 60 https://api.ipify.org ) intenalip=$(ip addr | grep -E -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -E -v "^127\.|^255\.|^0\." | head -n 1) - echo "phpMyAdmin Should be available at http://${intenalip}/phpmyadmin" - echo "Or If you are using a VPS at http://${publicipaddress}/phpmyadmin" + echo "phpMyAdmin Should be available at http://${intenalip}:8080" + echo "Or If you are using a VPS at http://${publicipaddress}:8080" echo -e "==================================================================" diff --git a/scripts/pmauninstall.sh b/scripts/pmauninstall.sh index e34722a..d35ca2e 100644 --- a/scripts/pmauninstall.sh +++ b/scripts/pmauninstall.sh @@ -18,7 +18,8 @@ do done sudo apt remove phpmyadmin -y sudo apt-get autoremove -y -rm -rf /usr/share/phpmyadmin/ +sudo rm -rf /usr/share/phpmyadmin/ +sudo rm -rf /etc/apache2/sites-enabled/phpmyadmin.conf sudo systemctl restart apache2 while true