filesite
3 years ago
7 changed files with 198 additions and 14 deletions
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
#user nobody; |
||||
worker_processes 1; |
||||
|
||||
#error_log logs/error.log; |
||||
#error_log logs/error.log notice; |
||||
#error_log logs/error.log info; |
||||
|
||||
#pid logs/nginx.pid; |
||||
|
||||
|
||||
events { |
||||
worker_connections 1024; |
||||
} |
||||
|
||||
|
||||
http { |
||||
include mime.types; |
||||
default_type application/octet-stream; |
||||
|
||||
#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 logs/access.log main; |
||||
|
||||
sendfile on; |
||||
#tcp_nopush on; |
||||
|
||||
#keepalive_timeout 0; |
||||
keepalive_timeout 65; |
||||
|
||||
#gzip on; |
||||
|
||||
include /usr/local/nginx/conf/conf.d/*.conf; |
||||
} |
@ -0,0 +1,48 @@
@@ -0,0 +1,48 @@
|
||||
# machete |
||||
server { |
||||
listen 80; |
||||
server_name _; |
||||
|
||||
#charset UTF-8; |
||||
#access_log logs/machete.access.log main; |
||||
|
||||
root /var/www/machete/www; |
||||
index index.php index.html; |
||||
|
||||
location / { |
||||
try_files $uri $uri/ /index.php?$args; |
||||
} |
||||
|
||||
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 |
||||
location ~ ^/index\.php$ { |
||||
fastcgi_pass 127.0.0.1:9000; |
||||
fastcgi_index index.php; |
||||
fastcgi_param SCRIPT_FILENAME /var/www/machete/www$fastcgi_script_name; |
||||
include fastcgi_params; |
||||
} |
||||
|
||||
# deny all other php |
||||
location ~ \.php { |
||||
deny all; |
||||
} |
||||
|
||||
# deny all md |
||||
location ~ \.md { |
||||
deny all; |
||||
} |
||||
|
||||
# deny all txt |
||||
location ~ \.txt { |
||||
deny all; |
||||
} |
||||
|
||||
# deny all url |
||||
location ~ \.url { |
||||
deny all; |
||||
} |
||||
|
||||
# deny all hidden files |
||||
location ~ /\. { |
||||
deny all; |
||||
} |
||||
} |
@ -0,0 +1,32 @@
@@ -0,0 +1,32 @@
|
||||
<?php |
||||
/** |
||||
* Config of 图片站googleimage |
||||
*/ |
||||
return array( |
||||
'default_timezone' => 'Asia/Shanghai', //timezone |
||||
|
||||
//文档站皮肤 |
||||
//'content_directory' => 'content/', //directory of contents in /www/ |
||||
//when it's empty, use layout and views in directory views/ |
||||
//'theme' => 'manual', //name of theme which is enabled |
||||
|
||||
//导航站皮肤 |
||||
//'content_directory' => 'navs/', //directory of contents in /www/ |
||||
//'theme' => 'webdirectory', |
||||
|
||||
//图片站皮肤 |
||||
'content_directory' => 'dogs/', //directory of contents in /www/ |
||||
'theme' => 'googleimage', //name of theme which is enabled |
||||
|
||||
'default_layout' => 'main', //default layout |
||||
'error_layout' => 'error', //exception layout, show error title and content |
||||
|
||||
//for debug, log directory: ../runtime/logs/ |
||||
'debug' => false, |
||||
|
||||
//for themes |
||||
'googleimage' => [ |
||||
'imageHeight' => 180, //图片高度,单位:px |
||||
'contact' => 'FileSite图片网站订制联系:<a href="https://filesite.io" target="_blank">FileSite.io</a>', |
||||
], |
||||
); |
@ -0,0 +1,32 @@
@@ -0,0 +1,32 @@
|
||||
<?php |
||||
/** |
||||
* Config of 文档站manual |
||||
*/ |
||||
return array( |
||||
'default_timezone' => 'Asia/Shanghai', //timezone |
||||
|
||||
//文档站皮肤 |
||||
'content_directory' => 'content/', //directory of contents in /www/ |
||||
//when it's empty, use layout and views in directory views/ |
||||
'theme' => 'manual', //name of theme which is enabled |
||||
|
||||
//导航站皮肤 |
||||
//'content_directory' => 'navs/', //directory of contents in /www/ |
||||
//'theme' => 'webdirectory', |
||||
|
||||
//图片站皮肤 |
||||
//'content_directory' => 'dogs/', //directory of contents in /www/ |
||||
//'theme' => 'googleimage', //name of theme which is enabled |
||||
|
||||
'default_layout' => 'main', //default layout |
||||
'error_layout' => 'error', //exception layout, show error title and content |
||||
|
||||
//for debug, log directory: ../runtime/logs/ |
||||
'debug' => false, |
||||
|
||||
//for themes |
||||
//'googleimage' => [ |
||||
// 'imageHeight' => 180, //图片高度,单位:px |
||||
// 'contact' => 'FileSite图片网站订制联系:<a href="https://filesite.io" target="_blank">FileSite.io</a>', |
||||
//], |
||||
); |
@ -0,0 +1,32 @@
@@ -0,0 +1,32 @@
|
||||
<?php |
||||
/** |
||||
* Config of 导航站webdirectory |
||||
*/ |
||||
return array( |
||||
'default_timezone' => 'Asia/Shanghai', //timezone |
||||
|
||||
//文档站皮肤 |
||||
//'content_directory' => 'content/', //directory of contents in /www/ |
||||
//when it's empty, use layout and views in directory views/ |
||||
//'theme' => 'manual', //name of theme which is enabled |
||||
|
||||
//导航站皮肤 |
||||
'content_directory' => 'navs/', //directory of contents in /www/ |
||||
'theme' => 'webdirectory', |
||||
|
||||
//图片站皮肤 |
||||
//'content_directory' => 'dogs/', //directory of contents in /www/ |
||||
//'theme' => 'googleimage', //name of theme which is enabled |
||||
|
||||
'default_layout' => 'main', //default layout |
||||
'error_layout' => 'error', //exception layout, show error title and content |
||||
|
||||
//for debug, log directory: ../runtime/logs/ |
||||
'debug' => false, |
||||
|
||||
//for themes |
||||
//'googleimage' => [ |
||||
// 'imageHeight' => 180, //图片高度,单位:px |
||||
// 'contact' => 'FileSite图片网站订制联系:<a href="https://filesite.io" target="_blank">FileSite.io</a>', |
||||
//], |
||||
); |
@ -1,20 +1,16 @@
@@ -1,20 +1,16 @@
|
||||
#!/bin/sh |
||||
themes=( |
||||
manual |
||||
googleimage |
||||
webdirectory |
||||
) |
||||
|
||||
theme=$1 |
||||
if [ ! -z "${theme}" ]; then |
||||
if [[ ! "${themes[@]}" =~ "${theme}" ]]; then |
||||
theme=webdirectory |
||||
fi |
||||
else |
||||
if [ ! -d "/var/www/machete/themes/${theme}/" ]; then |
||||
theme=webdirectory |
||||
fi |
||||
|
||||
echo "Theme chosed [${theme}]." |
||||
|
||||
##TODO: 复制对应皮肤的配置文件到docker容器指定目录 |
||||
## 复制对应皮肤的配置文件 |
||||
cd /var/www/machete/conf/ |
||||
rm -f app.php |
||||
cp "template_${theme}.php" app.php |
||||
|
||||
|
||||
## 启动nginx和php-fpm |
||||
/usr/local/nginx/sbin/nginx |
||||
|
Loading…
Reference in new issue