Added heimdal CT

This commit is contained in:
2021-12-02 03:55:50 +00:00
parent 5ceb12deea
commit c2c5d1337d
6 changed files with 136 additions and 1 deletions

View File

@@ -0,0 +1,50 @@
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;
client_body_buffer_size 10K;
client_header_buffer_size 1k;
client_max_body_size 64m;
large_client_header_buffers 4 4k;
server_names_hash_bucket_size 64;
root /usr/share/nginx/html;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log off;
error_log /var/log/nginx/error.log;
#Server config for Heimdall
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /opt/heimdall/public/;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/run/php-fpm7/php-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
}

View File

@@ -0,0 +1,39 @@
[heimdall]
user = nginx
group = nginx
listen = /run/php-fpm7/php-fpm.sock
listen.owner = nginx
listen.group = nginx
php_admin_value[disable_functions] = exec,passthru,system
php_admin_value[error_log] = /var/log/php-fpm.error.log
php_admin_value [date.timezone] = Europe/Amsterdam
; OPCACHE SETTINGS
php_admin_value[opcache.memory_consumption] = 256
php_admin_value[opcache.enable] = 0
php_admin_value[opcache.interned_strings_buffer] = 32
php_admin_value[opcache.max_accelerated_files] = 50000
php_admin_value[opcache.max_wasted_percentage] = 5
php_admin_value[opcache.revalidate_freq] = 0
php_admin_value[opcache.validate_timestamps] = 1
; PERFORMANCE LIMITS
php_admin_value[max_input_vars] = 5000
php_admin_value[upload_max_filesize] = 64M
php_admin_value[post_max_size] = 64M
php_admin_value[max_input_time] = 15
; SECURITY
php_admin_value[cgi.fix_pathinfo] = 0
php_admin_value[allow_url_fopen] = Off
php_admin_value[file_uploads] = On
php_admin_value[open_basedir] = /opt/heimdall:/run/php-fpm7/php-fpm.sock:/tmp
php_admin_value[session.use_strict_mode] = 1
php_admin_value[session.cookie_httponly] = 1
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chdir = /

View File

@@ -0,0 +1,2 @@
[Date]
date.timezone = Europe/Amsterdam

View File

@@ -0,0 +1,22 @@
#!/bin/ash
#Install php 7.3
echo "@phphernandev https://php.hernandev.com/v3.11/php-7.3" >> /etc/apk/repositories
curl -L https://php.hernandev.com/key/php-alpine.rsa.pub -o /etc/apk/keys/php-alpine.rsa.pub
apk add php7@phphernandev php7-ctype@phphernandev php7-curl@phphernandev php7-pdo_sqlite@phphernandev php7-mbstring@phphernandev php7-json@phphernandev php7-zip@phphernandev php7-xml@phphernandev php7-fpm@phphernandev php7-session@phphernandev php7-openssl@phphernandev
#Configure Nginx
rm -rf /etc/nginx/conf.d
mv /opt/Setup/Configs/nginx.conf /etc/nginx/nginx.conf
#Configure Php-Fpm
rm -rf /etc/php7/php-fpm.d/*
mv /opt/Setup/Configs/php.conf /etc/php7/php-fpm.d/heimdall.conf
mv /opt/Setup/Configs/phpTimezone.ini /etc/php8/conf.d/04_date_timezone.ini
#Install Heimdall
git clone https://github.com/linuxserver/Heimdall.git /opt/heimdall
chown -R nginx:nginx /opt/heimdall
#Enable services on boot
rc-update add nginx
rc-update add php-fpm7