Initial commit

This commit is contained in:
Sebastian Hugentobler 2018-05-29 09:39:04 +02:00
commit bc8b826e7c
10 changed files with 154 additions and 0 deletions

View file

@ -0,0 +1,3 @@
[template]
src = "config_local.php.tmpl"
dest = "/usr/share/webapps/cops/config_local.php"

View file

@ -0,0 +1,3 @@
[template]
src = "cops.conf.tmpl"
dest = "/etc/nginx/conf.d/cops.conf"

View file

@ -0,0 +1,13 @@
<?php
if (!isset($config))
$config = array();
$config['calibre_directory'] = '/var/lib/cops/calibre/';
$config['calibre_internal_directory'] = '/calibre/';
$config['cops_full_url'] = '{{ getenv "DOMAIN" }}';
$config['cops_x_accel_redirect'] = "X-Accel-Redirect";
$config['cops_title_default'] = "{{ getenv "TITLE" "COPS" }}";
$config['cops_use_url_rewriting'] = "1";

View file

@ -0,0 +1,50 @@
error_log /dev/stdout info;
access_log /dev/stdout;
upstream php {
server 127.0.0.1:9000;
}
server {
listen 80;
server_name {{getenv "DOMAIN"}};
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
index index.php;
root /usr/share/webapps/cops/;
gzip on;
gzip_vary on;
gzip_comp_level 4;
gzip_min_length 256;
location /download/ {
rewrite ^/download/(\d+)/(\d+)/.*\.(.*)$ /fetch.php?data=$1&db=$2&type=$3 last;
rewrite ^/download/(\d+)/.*\.(.*)$ /fetch.php?data=$1&type=$2 last;
break;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param HTTPS on;
fastcgi_param modHeadersAvailable true;
fastcgi_param front_controller_active true;
fastcgi_pass php;
fastcgi_intercept_errors on;
}
location /calibre {
root /var/lib/cops;
internal;
}
}

View file

@ -0,0 +1,3 @@
#!/usr/bin/with-contenv sh
exec nginx -g "daemon off;"