Initial commit
This commit is contained in:
commit
bc8b826e7c
10 changed files with 154 additions and 0 deletions
3
rootfs/etc/confd/conf.d/config.local.php.toml
Normal file
3
rootfs/etc/confd/conf.d/config.local.php.toml
Normal file
|
@ -0,0 +1,3 @@
|
|||
[template]
|
||||
src = "config_local.php.tmpl"
|
||||
dest = "/usr/share/webapps/cops/config_local.php"
|
3
rootfs/etc/confd/conf.d/cops.conf.toml
Normal file
3
rootfs/etc/confd/conf.d/cops.conf.toml
Normal file
|
@ -0,0 +1,3 @@
|
|||
[template]
|
||||
src = "cops.conf.tmpl"
|
||||
dest = "/etc/nginx/conf.d/cops.conf"
|
13
rootfs/etc/confd/templates/config_local.php.tmpl
Normal file
13
rootfs/etc/confd/templates/config_local.php.tmpl
Normal 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";
|
50
rootfs/etc/confd/templates/cops.conf.tmpl
Normal file
50
rootfs/etc/confd/templates/cops.conf.tmpl
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue