mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-07-27 00:05:44 +02:00
Update to 2021-12-01 19:13
This commit is contained in:
23
roles/wapt_server/templates/nginx.conf.j2
Normal file
23
roles/wapt_server/templates/nginx.conf.j2
Normal file
@@ -0,0 +1,23 @@
|
||||
user nginx;
|
||||
worker_processes auto;
|
||||
error_log /var/log/nginx/error.log;
|
||||
worker_rlimit_nofile 32768;
|
||||
pid /run/nginx.pid;
|
||||
include /usr/share/nginx/modules/*.conf;
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
http {
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
access_log /var/log/nginx/access.log main;
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 65;
|
||||
types_hash_max_size 2048;
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
}
|
3
roles/wapt_server/templates/post-backup.sh.j2
Normal file
3
roles/wapt_server/templates/post-backup.sh.j2
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
rm -f /opt/wapt/backup/*
|
10
roles/wapt_server/templates/pre-backup.sh.j2
Normal file
10
roles/wapt_server/templates/pre-backup.sh.j2
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
PGPASSWORD={{ wapt_db_pass | quote }} /usr/pgsql-14/bin/pg_dump \
|
||||
--clean \
|
||||
--create \
|
||||
--username={{ wapt_db_user | quote }} \
|
||||
--host={{ wapt_db_server | quote }} \
|
||||
{{ wapt_db_name | quote }} | zstd -c > /opt/wapt/backup/{{ wapt_db_name }}.sql.zst
|
56
roles/wapt_server/templates/wapt.conf.j2
Normal file
56
roles/wapt_server/templates/wapt.conf.j2
Normal file
@@ -0,0 +1,56 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
gzip_min_length 1000;
|
||||
gzip_buffers 4 8k;
|
||||
gzip_http_version 1.0;
|
||||
gzip_disable "msie6";
|
||||
gzip_types text/plain text/css application/json;
|
||||
gzip_vary on;
|
||||
|
||||
index index.html;
|
||||
|
||||
location ~ ^/wapt.* {
|
||||
proxy_set_header Cache-Control "store, no-cache, must-revalidate, post-check=0, pre-check=0";
|
||||
proxy_set_header Pragma "no-cache";
|
||||
proxy_set_header Expires "Sun, 19 Nov 1978 05:00:00 GMT";
|
||||
root "/var/www/html";
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
client_max_body_size 4096m;
|
||||
client_body_timeout 1800;
|
||||
|
||||
location /add_host_kerberos {
|
||||
return 403;
|
||||
}
|
||||
|
||||
location ~ ^/(api/v3/upload_packages|api/v3/upload_hosts/|upload_waptsetup) {
|
||||
proxy_pass http://127.0.0.1:8080;
|
||||
client_max_body_size 4096m;
|
||||
client_body_timeout 1800;
|
||||
}
|
||||
|
||||
location /wapt-host/Packages {
|
||||
return 403;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8080;
|
||||
}
|
||||
|
||||
location /socket.io {
|
||||
proxy_http_version 1.1;
|
||||
proxy_buffering off;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
proxy_pass http://127.0.0.1:8080/socket.io;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user