pull/628/head
Mr Chen 7 months ago
parent 649ea30cb4
commit 7937747a05
  1. 7
      plugins/fail2ban/index.py
  2. 2
      plugins/fail2ban/info.json
  3. 5
      plugins/fail2ban/js/fail2ban.js
  4. 4
      plugins/gitea/index.py
  5. 6
      web/admin/config/__init__.py
  6. 6
      web/admin/plugins/__init__.py

@ -282,13 +282,14 @@ def _read_conf(path, l=None):
return json.loads(conf)
def getBlackList():
_black_list = getServerDir + "/black_list.json"
_black_list = getServerDir() + "/black_list.json"
conf = _read_conf(_black_list, l=1)
if not conf:
return ''
if not conf:
return []
return "\n".join(conf)
content = "\n".join(conf)
return mw.returnJson(True, 'ok', content)
if __name__ == "__main__":
func = sys.argv[1]
@ -318,5 +319,7 @@ if __name__ == "__main__":
print(configTpl())
elif func == 'read_config_tpl':
print(readConfigTpl())
elif func == 'get_black_list':
print(getBlackList())
else:
print('error')

@ -11,7 +11,7 @@
"path": "server/fail2ban",
"display": 1,
"author": "fail2ban",
"date": "2025-07-28",
"date": "2024-07-28",
"home": "https://www.fail2ban.org",
"type": 0,
"pid": "4"

@ -81,4 +81,9 @@ function f2bBanIp(){
matchBrackets:true,
});
editor.focus();
f2bPost('get_black_list', '', {}, function(data){
console.log(data);
})
}

@ -418,7 +418,7 @@ def getGogsConf():
result = []
for g in gets:
rep = g['name'] + '\s*=\s*(.*)'
rep = g['name'] + '\\s*=\\s*(.*)'
tmp = re.search(rep, conf)
if not tmp:
continue
@ -447,7 +447,7 @@ def submitGogsConf():
conf = mw.readFile(filename)
for g in gets:
if g in args:
rep = g + '\s*=\s*(.*)'
rep = g + '\\s*=\\s*(.*)'
val = g + ' = ' + args[g]
conf = re.sub(rep, val, conf)
mw.writeFile(filename, conf)

@ -15,3 +15,9 @@ blueprint = Blueprint('config', __name__, url_prefix='/config', template_folder=
@blueprint.route('/index', endpoint='index')
def index():
return render_template('config.html', data={})
@blueprint.route('/get_panel_list', endpoint='get_panel_list', methods=['POST'])
def get_panel_list():
return []

@ -15,3 +15,9 @@ blueprint = Blueprint('plugins', __name__, url_prefix='/plugins', template_folde
@blueprint.route('/index', endpoint='index')
def index():
return render_template('plugins.html', data={})
# 插件列表
@blueprint.route('/list', endpoint='list', methods=['GET'])
def list():
return []
Loading…
Cancel
Save