From 9dc30e4f0c99cade5019bbe6dcf0959340ae7feb Mon Sep 17 00:00:00 2001 From: shylinux Date: Fri, 17 Feb 2023 22:14:41 +0800 Subject: [PATCH] opt some --- etc/conf/location.conf | 16 +++------------- etc/conf/locations.conf | 30 +++++++++++++++++++++++++----- etc/conf/nginx.conf | 8 ++++---- go.mod | 16 +--------------- go.sum | 18 ++++++++++++++++-- src/main.sh | 21 +++++++++++++++++++-- src/main.svg | 1 - 7 files changed, 68 insertions(+), 42 deletions(-) delete mode 100644 src/main.svg diff --git a/etc/conf/location.conf b/etc/conf/location.conf index b7917c33..2f9eb589 100644 --- a/etc/conf/location.conf +++ b/etc/conf/location.conf @@ -1,18 +1,8 @@ -ssl_session_timeout 30m; -ssl_session_cache shared:SSL:1m; - -ssl_ciphers HIGH:!aNULL:!MD5; -ssl_prefer_server_ciphers on; - -client_max_body_size 100m; -client_body_timeout 300s; - -client_body_in_file_only clean; -client_body_buffer_size 16K; -client_body_temp_path /tmp/nginx/client_body_temp; - location / { include header.conf; + if ($http_user_agent ~* "^Mozilla") { + return 302 https://$server_name/$request_uri; + } proxy_pass http://contexts; } diff --git a/etc/conf/locations.conf b/etc/conf/locations.conf index b679849f..b7917c33 100644 --- a/etc/conf/locations.conf +++ b/etc/conf/locations.conf @@ -1,9 +1,29 @@ +ssl_session_timeout 30m; +ssl_session_cache shared:SSL:1m; + +ssl_ciphers HIGH:!aNULL:!MD5; +ssl_prefer_server_ciphers on; + +client_max_body_size 100m; +client_body_timeout 300s; + +client_body_in_file_only clean; +client_body_buffer_size 16K; +client_body_temp_path /tmp/nginx/client_body_temp; + location / { include header.conf; - if ($http_user_agent ~* "^Wget") { - proxy_pass http://contexts; - break; - } - return 302 https://$server_name/; + proxy_pass http://contexts; } +location /space/ { + include header.conf; + proxy_pass http://contexts; + proxy_set_header Connection "upgrade"; + proxy_set_header Upgrade $http_upgrade; +} + +location /x/ { + include header.conf; + proxy_pass http://contexts_repos; +} diff --git a/etc/conf/nginx.conf b/etc/conf/nginx.conf index bc5cd6ce..3b058635 100644 --- a/etc/conf/nginx.conf +++ b/etc/conf/nginx.conf @@ -24,12 +24,12 @@ http { server { listen 80; server_name shylinux.com; - include locations.conf; + include location.conf; } server { listen 443 ssl; server_name shylinux.com; - include location.conf; + include locations.conf; ssl_certificate_key 8293704_shylinux.com.key; ssl_certificate 8293704_shylinux.com.pem; @@ -38,12 +38,12 @@ http { server { listen 80; server_name contexts.com.cn; - include locations.conf; + include location.conf; } server { listen 443 ssl; server_name contexts.com.cn; - include location.conf; + include locations.conf; ssl_certificate_key 7424713_contexts.com.cn.key; ssl_certificate 7424713_contexts.com.cn.pem; diff --git a/go.mod b/go.mod index eec5df9a..3abf0f37 100644 --- a/go.mod +++ b/go.mod @@ -13,21 +13,7 @@ require ( require ( shylinux.com/x/gogit v0.0.7 shylinux.com/x/ice v1.2.7 - shylinux.com/x/icebergs v1.5.2 + shylinux.com/x/icebergs v1.5.1 shylinux.com/x/toolkits v0.7.3 shylinux.com/x/webview v0.0.2 ) - -replace ( - shylinux.com/x/ice => ./usr/release - shylinux.com/x/icebergs => ./usr/icebergs - shylinux.com/x/toolkits => ./usr/toolkits -) - -replace ( - shylinux.com/x/golang-story => ./usr/golang-story - shylinux.com/x/linux-story => ./usr/linux-story - shylinux.com/x/mysql-story => ./usr/mysql-story - shylinux.com/x/nginx-story => ./usr/nginx-story - shylinux.com/x/redis-story => ./usr/redis-story -) diff --git a/go.sum b/go.sum index 9fcae0f2..cbbc6e55 100644 --- a/go.sum +++ b/go.sum @@ -2,12 +2,26 @@ shylinux.com/x/creackpty v0.0.2 h1:1ekWD5zeKZiQZCYvKSkHnm819wryZxzoq3kmvheC7bA= shylinux.com/x/creackpty v0.0.2/go.mod h1:SOsAaW5FdicXUprrxgENk2JP1f8LdHBXZjqOFot488o= shylinux.com/x/go-qrcode v0.0.2 h1:/c0PLj+1RT+kUPfnZVXwgbgH5m1SxBUjM2MIKXbDk+E= shylinux.com/x/go-qrcode v0.0.2/go.mod h1:TlzGBENHXy19xC3AsC6h4Vs5fx2ZuDA4TZ0U3C2OeK4= -shylinux.com/x/go-sql-mysql v0.0.1 h1:VX5SrwLBKzfkRouj39LgJ9reIXOWmMsScRpr+e0qdp0= -shylinux.com/x/go-sql-mysql v0.0.1/go.mod h1:47OfAZK24HRJMy7dAu/jrksGCf9yzJaAUFwWYjhDFDA= shylinux.com/x/go-sql-mysql v0.0.2 h1:XcsMEF3KnFmRu6EmxIwIF6M1o2tD1NQvel3U9m+1Ap4= shylinux.com/x/go-sql-mysql v0.0.2/go.mod h1:lHjRMZz5Lii6U+49fhkbCWgsnL+yux54SYJYWqASN8Y= shylinux.com/x/gogit v0.0.7 h1:2ep5QpXWLs0UBCywJuUHda/aagskYvFmn0nj3vpEdY4= shylinux.com/x/gogit v0.0.7/go.mod h1:wYfHxpQT1C8yNV+yC1jStIy0I12bfUCyJARhn0sNn1M= +shylinux.com/x/golang-story v0.5.7 h1:Vzfa4EWy3I4CFXICUHQLnxmmDdv9Sye1AdyT6P1eBCg= +shylinux.com/x/golang-story v0.5.7/go.mod h1:2FV/6fLo5/M6byd1eETrG0de9gfA5DvLCYXP0nT+DQM= +shylinux.com/x/ice v1.2.7 h1:os/TJjKx5YXucQRQD9/HchNSHi+oyheaq5q5gB6g+Xg= +shylinux.com/x/ice v1.2.7/go.mod h1:vTALHrKmHOvxDajsbmNsXh9ogIq1RIvBKJM4wDyyhe4= +shylinux.com/x/icebergs v1.5.1 h1:kWBIKbkV9FDg81dY5xl8PcqA9UX3V0zpyDklMw68WZQ= +shylinux.com/x/icebergs v1.5.1/go.mod h1:tyatkO1j/uIN/CO6E6SweEoDv3mTRTwugAFyJju1Kws= +shylinux.com/x/linux-story v0.5.4 h1:L2+qbUT6DGkg1wwY5yPyxy0MikVzbjlowlA369YxDWw= +shylinux.com/x/linux-story v0.5.4/go.mod h1:nm+nXsgvGKXCpNT5K31GtRFVTinevtuUu+1nFtJbZ20= +shylinux.com/x/mysql-story v0.5.7 h1:62BGm7s6qvad7SI+6L08uF44+l0YV6mG+QtFlb7OhiE= +shylinux.com/x/mysql-story v0.5.7/go.mod h1:is88aTgLsGGUSLGT4PQorwIcvwvb2fTgDLvFRlc6Uds= +shylinux.com/x/nginx-story v0.5.7 h1:QLh9HslOzlpi/2BdWFX2QZCyz4Z2hRV/bD4xaeEbbeA= +shylinux.com/x/nginx-story v0.5.7/go.mod h1:OKgJu5Y8mgQCIw9TtR7ijp2grTkq1LBU+4gWWJg47aM= +shylinux.com/x/redis-story v0.5.8 h1:1MGebd/6YMFGULvPgcroEr2kLcSuLy1YHjisR8TpuDg= +shylinux.com/x/redis-story v0.5.8/go.mod h1:5PAglQTnrWoCzog5RrQTtmQTH4feKEJIYon6t0tfr2g= +shylinux.com/x/toolkits v0.7.3 h1:yeiYnUTpF3CUDTSlqiy56LWfd+CkdrLQvD2fe0kAHzQ= +shylinux.com/x/toolkits v0.7.3/go.mod h1:8LbYHe7oxBIqb6s4MSOD+4d28QvPdvkyCVtwB/JW7AA= shylinux.com/x/websocket v0.0.2 h1:aeeZyAsh6QN7+l5oMXlO9/rlQgx6CHvDtpZyAqMCSlU= shylinux.com/x/websocket v0.0.2/go.mod h1:yMcu4XS6JB11YRISXwvubh7dPM6rWPdzIRv0CrshQBY= shylinux.com/x/webview v0.0.2 h1:T0f2sDdiMCdDPjYwD1WS64ASBGwvZKPZkxDQ84d+ZQs= diff --git a/src/main.sh b/src/main.sh index 5c6999d8..92a1f151 100644 --- a/src/main.sh +++ b/src/main.sh @@ -1,2 +1,19 @@ -echo "hello world" -echo "$@" \ No newline at end of file +main() { + case "$1" in + app) # 生产环境 + export ctx_log=${ctx_log:=/dev/stdout} + shift && prepare_ice && bin/ice.bin forever start dev dev "$@" + ;; + dev) # 开发环境 + shift && prepare_package && source etc/miss.sh "$@" + ;; + cmd) # 命令环境 + ish_sys_dev_init >/dev/null + shift; [ -n "$*" ] && ish_sys_dev_run "$@" + ;; + *) + ;; + esac +} +main "$@" + diff --git a/src/main.svg b/src/main.svg deleted file mode 100644 index 1ad6fd7d..00000000 --- a/src/main.svg +++ /dev/null @@ -1 +0,0 @@ -shyolddevcomMB2MB1MB0 \ No newline at end of file