diff --git a/.github/ISSUE_TEMPLATE/i-have-an-issue.yml b/.github/ISSUE_TEMPLATE/i-have-an-issue.yml index 068c170a..49c21793 100755 --- a/.github/ISSUE_TEMPLATE/i-have-an-issue.yml +++ b/.github/ISSUE_TEMPLATE/i-have-an-issue.yml @@ -46,7 +46,7 @@ body: attributes: label: app.conf description: | - Paste your `app.conf` (remove personal info) + Paste relevant `app.conf`settings (remove sensitive info) render: python validations: required: false @@ -70,6 +70,13 @@ body: - Bare-metal (community only support - Check Discord) validations: required: true +- type: checkboxes + attributes: + label: Debug or Trace enabled + description: I confirm I set `LOG_LEVEL` to `debug` or `trace` + options: + - label: I have read and followed the steps in the wiki link above and provided the required debug logs and the log section covers the time when the issue occurs. + required: true - type: textarea attributes: label: app.log @@ -78,13 +85,14 @@ body: ***Generally speaking, all bug reports should have logs provided.*** Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. Additionally, any additional info? Screenshots? References? Anything that will give us more context about the issue you are encountering! - You can use `tail -100 /app/log/app.log` in the container if you have trouble getting to the log files. + You can use `tail -100 /app/log/app.log` in the container if you have trouble getting to the log files or send them to netalertx@gmail.com with the issue number. validations: required: false -- type: checkboxes +- type: textarea attributes: - label: Debug enabled - description: I confirm I enabled `debug` - options: - - label: I have read and followed the steps in the wiki link above and provided the required debug logs and the log section covers the time when the issue occurs. - required: true + label: Docker Logs + description: | + You can retrieve the logs from Portainer -> Containers -> your NetAlertX container -> Logs or by running `sudo docker logs netalertx`. + validations: + required: true + diff --git a/front/plugins/sync/sync.py b/front/plugins/sync/sync.py index 2e804b0d..e47a4682 100755 --- a/front/plugins/sync/sync.py +++ b/front/plugins/sync/sync.py @@ -181,8 +181,10 @@ def main(): # make sure the file has the correct name (e.g last_result.encoded.Node_1.1.log) to skip any otehr plugin files if len(file_name.split('.')) > 2: - # Store e.g. Node_1 from last_result.encoded.Node_1.1.log - syncHubNodeName = file_name.split('.')[1] + # Extract node name from either last_result.decoded.Node_1.1.log or last_result.Node_1.log + parts = file_name.split('.') + # If decoded/encoded file, node name is at index 2; otherwise at index 1 + syncHubNodeName = parts[2] if 'decoded' in file_name or 'encoded' in file_name else parts[1] file_path = f"{LOG_PATH}/{file_name}" diff --git a/server/api_server/api_server_start.py b/server/api_server/api_server_start.py index fbf944f5..9b516f13 100755 --- a/server/api_server/api_server_start.py +++ b/server/api_server/api_server_start.py @@ -390,6 +390,10 @@ def api_clean_log(): @app.route("/logs/add-to-execution-queue", methods=["POST"]) def api_add_to_execution_queue(): + + if not is_authorized(): + return jsonify({"success": False, "message": "ERROR: Not authorized", "error": "Forbidden"}), 403 + queue = UserEventsQueueInstance() # Get JSON payload safely diff --git a/server/api_server/logs_endpoint.py b/server/api_server/logs_endpoint.py index 4d76cefa..120644b7 100644 --- a/server/api_server/logs_endpoint.py +++ b/server/api_server/logs_endpoint.py @@ -52,7 +52,7 @@ def clean_log(log_file): except Exception as e: msg = f"[clean_log] ERROR Failed to purge {log_file}: {e}" - mylog('none', []) - write_notification(msg) - return jsonify({"success": False, "message": msg}), 200 + mylog('none', [msg]) + write_notification(msg, 'interrupt') + return jsonify({"success": False, "message": msg}), 500