mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-05 09:54:11 +08:00
update 2026-10-27 07:31:06
This commit is contained in:
1 parent
197c60d843
commit
a4d6470641
4213 files changed
-1575003
No files matched your search
@@ -1,11 +0,0 @@
|
||||
|
||||
config global
|
||||
option port '8081'
|
||||
option upload_max_filesize '64M'
|
||||
list open_basedir '/'
|
||||
option https '0'
|
||||
option project_directory '/tmp/kodexplorer'
|
||||
option ipv6 '0'
|
||||
option memory_limit '64M'
|
||||
option enable '0'
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2018-2022 Lienol <lawlienol@gmail.com>
|
||||
|
||||
START=99
|
||||
|
||||
CONFIG="kodexplorer"
|
||||
|
||||
TEMP_PATH="/var/etc/$CONFIG"
|
||||
NGINX_CONFIG="$TEMP_PATH/nginx.conf"
|
||||
PHP_CONFIG="$TEMP_PATH/php.ini"
|
||||
PHP_FPM_CONFIG="$TEMP_PATH/php-fpm.conf"
|
||||
PHP_FPM_SOCK="$TEMP_PATH/php-fpm.sock"
|
||||
|
||||
config_t_get() {
|
||||
local index=0
|
||||
[ -n "$4" ] && index=$4
|
||||
local ret=$(uci get $CONFIG.@$1[$index].$2 2>/dev/null)
|
||||
echo ${ret:=$3}
|
||||
}
|
||||
|
||||
gen_nginx_config() {
|
||||
ipv6=$(config_t_get global ipv6 0)
|
||||
port=$(config_t_get global port)
|
||||
[ "$(config_t_get global https 0)" == "1" ] && {
|
||||
port="$port ssl"
|
||||
ssl_certificate="ssl_certificate $(config_t_get global certificate);"
|
||||
ssl_certificate_key="ssl_certificate_key $(config_t_get global key);"
|
||||
}
|
||||
sed -e "s#|PID|#$TEMP_PATH/nginx.pid#g" \
|
||||
-e "s#|PORT|#$port#g" \
|
||||
-e "s#|ssl_certificate|#$ssl_certificate#g" \
|
||||
-e "s#|ssl_certificate_key|#$ssl_certificate_key#g" \
|
||||
-e "s#|project_directory|#$project_directory#g" \
|
||||
-e "s#|SOCK|#$PHP_FPM_SOCK#g" \
|
||||
-e "s#|upload_max_filesize|#$upload_max_filesize#g" \
|
||||
-e "s#|temp_path|#$TEMP_PATH/temp#g" \
|
||||
/etc/$CONFIG/nginx.conf.template > $1
|
||||
|
||||
[ "$ipv6" = "0" ] && sed -i '/listen \[::\]:/d' $1
|
||||
}
|
||||
|
||||
gen_php_config() {
|
||||
sed -e "s#|project_directory|#$project_directory#g" \
|
||||
-e "s#|open_basedir|#$open_basedir#g" \
|
||||
-e "s#|memory_limit|#$memory_limit#g" \
|
||||
-e "s#|upload_max_filesize|#$upload_max_filesize#g" \
|
||||
/etc/$CONFIG/php.ini.template > $PHP_CONFIG
|
||||
|
||||
sed -e "s#|PID|#$TEMP_PATH/php-fpm.pid#g" \
|
||||
-e "s#|ERROR_LOG|#$TEMP_PATH/php-fpm.log#g" \
|
||||
-e "s#|SOCK|#$PHP_FPM_SOCK#g" \
|
||||
/etc/$CONFIG/php-fpm.conf.template > $PHP_FPM_CONFIG
|
||||
}
|
||||
|
||||
start() {
|
||||
ENABLED=$(config_t_get global enable 0)
|
||||
[ "$ENABLED" = "0" ] && return 0
|
||||
mkdir -p $TEMP_PATH $TEMP_PATH/temp /var/log/nginx /var/lib/nginx
|
||||
memory_limit=$(config_t_get global memory_limit 64M)
|
||||
upload_max_filesize=$(config_t_get global upload_max_filesize 64M)
|
||||
project_directory=$(config_t_get global project_directory)
|
||||
open_basedir=$(config_t_get global open_basedir "/")
|
||||
open_basedir=$(echo $open_basedir | sed "s/ /:/g")
|
||||
gen_php_config
|
||||
/usr/bin/php8-fpm -c $PHP_CONFIG -R -y $PHP_FPM_CONFIG
|
||||
gen_nginx_config $NGINX_CONFIG
|
||||
/usr/sbin/nginx -c $NGINX_CONFIG >/dev/null 2>&1 &
|
||||
}
|
||||
|
||||
stop() {
|
||||
/usr/sbin/nginx -c $NGINX_CONFIG -s stop >/dev/null 2>&1
|
||||
[ -f "$TEMP_PATH/php-fpm.pid" ] && kill -2 $(cat $TEMP_PATH/php-fpm.pid) >/dev/null 2>&1
|
||||
rm -rf $TEMP_PATH
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
user root root;
|
||||
worker_processes auto;
|
||||
pid |PID|;
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
server {
|
||||
listen |PORT|;
|
||||
listen [::]:|PORT|;
|
||||
|ssl_certificate|
|
||||
|ssl_certificate_key|
|
||||
ssl_session_cache shared:SSL:1m;
|
||||
ssl_session_timeout 5m;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
ssl_prefer_server_ciphers on;
|
||||
server_name localhost;
|
||||
root |project_directory|;
|
||||
index index.html index.htm index.php;
|
||||
location ~ \.php(.*)$ {
|
||||
fastcgi_pass unix:|SOCK|; # 通过 Unix 套接字执行 PHP
|
||||
fastcgi_index index.php;
|
||||
fastcgi_split_path_info ^(.+\.php)(.*)$;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # 修复 Nginx fastcgi 漏洞
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
include /etc/nginx/fastcgi_params;
|
||||
client_max_body_size |upload_max_filesize|;
|
||||
client_body_temp_path |temp_path|;
|
||||
client_body_timeout 3600s;
|
||||
fastcgi_connect_timeout 3600s;
|
||||
fastcgi_send_timeout 3600s;
|
||||
fastcgi_read_timeout 3600s;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
[global]
|
||||
pid = |PID|
|
||||
error_log = |ERROR_LOG|
|
||||
[www]
|
||||
user = root
|
||||
listen = |SOCK|
|
||||
listen.mode = 0666
|
||||
listen.allowed_clients = 127.0.0.1
|
||||
pm = dynamic
|
||||
pm.max_children = 5
|
||||
pm.start_servers = 2
|
||||
pm.min_spare_servers = 1
|
||||
pm.max_spare_servers = 3
|
||||
chdir = /
|
||||
@@ -1,55 +0,0 @@
|
||||
[PHP]
|
||||
zend.ze1_compatibility_mode = Off
|
||||
engine = On
|
||||
precision = 12
|
||||
y2k_compliance = On
|
||||
output_buffering = Off
|
||||
zlib.output_compression = Off
|
||||
implicit_flush = Off
|
||||
unserialize_callback_func =
|
||||
serialize_precision = 100
|
||||
|
||||
open_basedir = /tmp:|project_directory|:|open_basedir|:/usr/bin/
|
||||
disable_functions =
|
||||
disable_classes =
|
||||
expose_php = On
|
||||
max_execution_time = 3600
|
||||
max_input_time = 3600
|
||||
memory_limit = |memory_limit|
|
||||
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
|
||||
|
||||
display_errors = On
|
||||
display_startup_errors = Off
|
||||
log_errors = Off
|
||||
ignore_repeated_errors = Off
|
||||
ignore_repeated_source = Off
|
||||
report_memleaks = On
|
||||
track_errors = Off
|
||||
|
||||
variables_order = "EGPCS"
|
||||
request_order = "GP"
|
||||
register_globals = Off
|
||||
register_long_arrays = Off
|
||||
register_argc_argv = On
|
||||
auto_globals_jit = On
|
||||
post_max_size = |upload_max_filesize|
|
||||
magic_quotes_runtime = Off
|
||||
magic_quotes_sybase = Off
|
||||
auto_prepend_file =
|
||||
auto_append_file =
|
||||
default_mimetype = "text/html"
|
||||
|
||||
;doc_root = "/www"
|
||||
user_dir =
|
||||
extension_dir = "/usr/lib/php8"
|
||||
enable_dl = On
|
||||
cgi.fix_pathinfo=1
|
||||
|
||||
file_uploads = On
|
||||
upload_tmp_dir = "/tmp"
|
||||
upload_max_filesize = |upload_max_filesize|
|
||||
max_file_uploads = 1000
|
||||
|
||||
allow_url_fopen = On
|
||||
allow_url_include = Off
|
||||
default_socket_timeout = 60
|
||||
@@ -1,6 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
/etc/init.d/php8-fpm stop
|
||||
/etc/init.d/php8-fpm disable
|
||||
rm -rf /tmp/luci-*cache
|
||||
exit 0
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"luci-app-kodexplorer": {
|
||||
"description": "Grant UCI access for luci-app-kodexplorer",
|
||||
"read": {
|
||||
"uci": [ "kodexplorer" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "kodexplorer" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"config": "kodexplorer",
|
||||
"init": "kodexplorer"
|
||||
}
|
||||
Reference in new issue
Block a user