Skip to content

Commit

Permalink
Merge pull request #403 from midoks/dev
Browse files Browse the repository at this point in the history
0.14.1
  • Loading branch information
midoks authored Apr 16, 2023
2 parents a75a49c + bf5274c commit cff1d5e
Show file tree
Hide file tree
Showing 26 changed files with 3,788 additions and 31 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,7 @@ plugins/my_*
plugins/l2tp
plugins/openlitespeed
plugins/tamper_proof
plugins/tamper_proof_*
plugins/cryptocurrency_trade
plugins/op_load_balance
plugins/gdrive
plugins/mtproxy
plugins/zimg
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,11 @@ docker run -itd --name mw-server --privileged=true -p 7200:7200 -p 80:80 -p 443:
```


### 版本更新 0.14.0
### 版本更新 0.14.1

* 加入系统加固插件。
* 安装优化。
* 加入OP负载均衡插件。
* 网站防篡改程序(测试中)。

### JSDelivr安装地址

Expand Down
2 changes: 1 addition & 1 deletion class/core/config_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

class config_api:

__version = '0.14.0'
__version = '0.14.1'
__api_addr = 'data/api.json'

def __init__(self):
Expand Down
2 changes: 2 additions & 0 deletions plugins/op_load_balance/conf/load_balance.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## 指定共享内存
lua_shared_dict healthcheck 10m;
64 changes: 64 additions & 0 deletions plugins/op_load_balance/conf/rewrite.tpl.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
location / {
proxy_pass http://{$UPSTREAM_NAME};

client_max_body_size 10m;
client_body_buffer_size 128k;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $proxy_host;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}


#location /upstream_status {
# allow 127.0.0.1;
# deny all;
# access_log off;
# default_type text/plain;
# content_by_lua_block {
# local hc = require "resty.upstream.healthcheck"
# ngx.say("OpenResty Worker PID: ", ngx.worker.pid())
# ngx.print(hc.status_page())
# }
#}

location /upstream_status_{$UPSTREAM_NAME} {
allow 127.0.0.1;
deny all;
access_log off;
default_type text/plain;
content_by_lua_block {
local json = require "cjson"
local ok, upstream = pcall(require, "ngx.upstream")
if not ok then
ngx.print("[]")
return
end

local get_primary_peers = upstream.get_primary_peers
local get_backup_peers = upstream.get_backup_peers
local upstream_name = "{$UPSTREAM_NAME}"

peers, err = get_primary_peers(upstream_name)
if not peers then
ngx.print("[]")
return
end

peers_backup, err = get_backup_peers(upstream_name)
if peers_backup then
for k, v in pairs(peers_backup) do
table.insert(peers,v)
end
end

ngx.print(json.encode(peers))
}
}
5 changes: 5 additions & 0 deletions plugins/op_load_balance/conf/upstream.tpl.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
upstream {$UPSTREAM_NAME}
{
{$NODE_ALGO}
{$NODE_SERVER_LIST}
}
Binary file added plugins/op_load_balance/ico.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions plugins/op_load_balance/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<div class="bt-form">
<div class="bt-w-main">
<div class="bt-w-menu">
<p class="bgw" onclick="pluginService('op_load_balance');">服务</p>
<p onclick="loadBalanceList();">负载均衡</p>
</div>
<div class="bt-w-con pd15">
<div class="soft-man-con"></div>
</div>
</div>

</div>

<script type="text/javascript" src="/plugins/file?name=op_load_balance&f=js/app.js"></script>
<script type="text/javascript">
resetPluginWinWidth(800);
resetPluginWinHeight(300);
$.getScript( "/plugins/file?name=op_load_balance&f=js/app.js", function(){
pluginService('op_load_balance');
});
</script>
Loading

0 comments on commit cff1d5e

Please sign in to comment.