mirror of
				https://github.com/bashclub/zamba-lxc-toolbox.git
				synced 2025-11-04 08:02:28 +01:00 
			
		
		
		
	Update functions.sh
Added some functions for installations
This commit is contained in:
		@@ -9,7 +9,7 @@ random_password() {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
generate_dhparam() {
 | 
			
		||||
    openssl dhparam -out /etc/nginx/dhparam.pem 2048
 | 
			
		||||
    openssl dhparam -dsaparam -out /etc/nginx/dhparam.pem 2048
 | 
			
		||||
    cat << EOF > /etc/cron.monthly/generate-dhparams
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
openssl dhparam -out /etc/nginx/dhparam.gen 4096 > /dev/null 2>&1
 | 
			
		||||
@@ -27,5 +27,26 @@ apt_repo() {
 | 
			
		||||
 | 
			
		||||
    wget -q -O - ${apt_key_url} | gpg --dearmor -o ${apt_key_path}
 | 
			
		||||
    echo "deb [signed-by=${apt_key_path}] ${apt_repo_url}" > /etc/apt/sources.list.d/${apt_name}.list
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
#### Set repo and install Nginx ####
 | 
			
		||||
inst_nginx() {
 | 
			
		||||
    apt_repo "nginx" "https://nginx.org/keys/nginx_signing.key" "http://nginx.org/packages/mainline/debian $(lsb_release -cs) nginx"
 | 
			
		||||
    apt update && DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt install -y -qq --no-install-recommends nginx
 | 
			
		||||
}
 | 
			
		||||
#### Set repo and install PHP ####
 | 
			
		||||
inst_php() {
 | 
			
		||||
    curl -sSLo /usr/share/keyrings/sury_php.gpg https://packages.sury.org/php/apt.gpg
 | 
			
		||||
    echo "deb [signed-by=/usr/share/keyrings/sury_php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/sury_php.list
 | 
			
		||||
    apt update && DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt install -y -qq --no-install-recommends php-common php$NEXTCLOUD_PHP_VERSION-{fpm,gd,curl,pgsql,xml,zip,intl,mbstring,bz2,ldap,apcu,bcmath,gmp,imagick,igbinary,mysql,redis,smbclient,sqlite3,cli,common,opcache,readline}
 | 
			
		||||
}
 | 
			
		||||
#### Set repo and install Postgresql ####
 | 
			
		||||
inst_postgresql() {
 | 
			
		||||
    apt_repo "postgresql" "https://www.postgresql.org/media/keys/ACCC4CF8.asc" "http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main"
 | 
			
		||||
    apt update && DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt install -y -qq --no-install-recommends postgresql-$POSTGRES_VERSION
 | 
			
		||||
}
 | 
			
		||||
#### Set repo and install Crowdsec ####
 | 
			
		||||
inst_crowdsec() {
 | 
			
		||||
    apt_repo "crowdsec" "https://packagecloud.io/crowdsec/crowdsec/gpgkey" " https://packagecloud.io/crowdsec/crowdsec/any any main"
 | 
			
		||||
    apt update && DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt install -y -qq --no-install-recommends crowdsec
 | 
			
		||||
    DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt install -y -qq --no-install-recommends crowdsec-firewall-bouncer-nftables
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user