You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

137 lines
3.5 KiB

#!/bin/bash
# Author: Tealk
# Repo: https://codeberg.org/Tealk/shell-administration-script
# shellcheck disable=SC2034
## General settings
WEBUSER="www-data"
WEBGROUP="www-data"
WEBPATH="/var/www"
PHP="/usr/bin/php7.3"
SELFUPDATE="stable" # stable, develop or false; updates are checked before execution of the script
## Backup settings
MOUNT="" # Leave blank to deactivate e.g. 192.168.1.1:/home/backup; otherwise the backup is made to the local directory
BACKPATH="/mnt/backup"
DBBACKUSER="backup" # need "SELECT, LOCK TABLES, SHOW VIEW" Permissions
DBBACKPASSWORD=""
NCBACKUP="true"
PMABACKUP="true"
MWBACKUP="true"
LOGCLEANUP="30" # Days, leave blank to deactivate
LDAPCLEANUP="180" # Days
BACKUPPATHS=" /etc \
/home"
EXCLUDEPATHS=" --exclude '/home/temp/*' \
--exclude '/home/*_bak/*'"
## Software settings
function NEXTCLOUD() {
WEBFOLDER="nextcloud"
LDAPPATH="/home/_ldap"
DATAPATH=""
DBHOST="localhost"
DBNAME="name"
DBUSER="user"
DBPASSWORD="pw"
INSTALLAPP="false"
APPINSTALL="accessibility activity admin_audit" # use blank's as separator
APPENABLE="accessibility activity admin_audit" # use blank's as separator
APPDISABLE="encryption files_external recommendations user_ldap" # use blank's as separator
# Required for installation
DATABASE="mysql"
DBPREFIX="nc_"
ADMINUSERNAME="xxx"
ADMINPASSWORD="xxx"
# Don't touch (if you don't know what you do)
PROGNAME="NextCloud"
FULLPATH="$WEBPATH/$WEBFOLDER"
}
function PHPMYADMIN() {
WEBFOLDER="phpmyadmin"
# Don't touch (if you don't know what you do)
PROGNAME="phpMyAdmin"
FULLPATH="$WEBPATH/$WEBFOLDER"
}
function MEDIAWIKI() {
WEBFOLDER="mediawiki"
DBHOST="localhost"
DBNAME="name"
DBUSER="user"
DBPASSWORD="pw"
EXTENSIONS="WikiEditor CodeEditor VisualEditor" # use blank's as separator
SKINS="Tweeki" # use blank's as separator
# Don't touch (if you don't know what you do)
PROGNAME="MediaWiki"
FULLPATH="$WEBPATH/$WEBFOLDER"
}
function COLLABORA() { # requires docker
IMAGE="collabora/code"
NAME="collabora" # use a unique phrase
DOMAIN="nextcloud.example.com" # since 6.4.3.1 no backslashes are required anymore
IPPORT="127.0.0.1:9980:9980"
}
function BOOKSTACK() { # requires git & composer
WEBFOLDER="bookstack"
DBHOST="localhost"
DBNAME="name"
DBUSER="user"
DBPASSWORD="pw"
# Don't touch (if you don't know what you do)
PROGNAME="BookStack"
FULLPATH="$WEBPATH/$WEBFOLDER"
}
function FRIENDICA() { # requires git & composer
WEBFOLDER="friendica"
DBHOST="localhost"
DBNAME="name"
DBUSER="user"
DBPASSWORD="pw"
# Don't touch (if you don't know what you do)
PROGNAME="Friendica"
FULLPATH="$WEBPATH/$WEBFOLDER"
}
function FRESHRSS() {
WEBFOLDER="FreshRSS"
VERSION="stable" # stable or edge; edge = rolling release
DBHOST="localhost"
DBNAME="name"
DBUSER="user"
DBPASSWORD="pw"
# Don't touch (if you don't know what you do)
PROGNAME="FreshRSS"
FULLPATH="$WEBPATH/$WEBFOLDER"
}
function WRITEFREELY() {
WEBFOLDER="writefreely"
DBHOST="localhost"
DBNAME="name"
DBUSER="user"
DBPASSWORD="pw"
# Don't touch (if you don't know what you do)
PROGNAME="writefreely"
FULLPATH="$WEBPATH/$WEBFOLDER"
}
## System settings
# Don't touch (if you don't know what you do)
DATE=$(date +%Y-%m-%d_%H-%M)
VERSION="11"
## Colores
COL_NC='\e[0m'
COL_LIGHT_GREEN='\e[1;32m'
COL_LIGHT_RED='\e[1;31m'
TICK="[${COL_LIGHT_GREEN}${COL_NC}]"
CROSS="[${COL_LIGHT_RED}${COL_NC}]"
INFO="[i]"
DONE="${COL_LIGHT_GREEN} done!${COL_NC}"
OVER="\\r\\033[K"