mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-03-30 23:03:03 -07:00
timestamp cleanup
This commit is contained in:
11
.github/skills/code-standards/SKILL.md
vendored
11
.github/skills/code-standards/SKILL.md
vendored
@@ -42,11 +42,18 @@ Nested subprocess calls need their own timeout—outer timeout won't save you.
|
||||
## Time Utilities
|
||||
|
||||
```python
|
||||
from utils.datetime_utils import timeNowDB
|
||||
from utils.datetime_utils import timeNowUTC
|
||||
|
||||
timestamp = timeNowDB()
|
||||
timestamp = timeNowUTC()
|
||||
```
|
||||
|
||||
This is the ONLY function that calls datetime.datetime.now() in the entire codebase.
|
||||
|
||||
⚠️ CRITICAL: ALL database timestamps MUST be stored in UTC
|
||||
# This is the SINGLE SOURCE OF TRUTH for current time in NetAlertX
|
||||
# Use timeNowUTC() for DB writes (returns UTC string by default)
|
||||
# Use timeNowUTC(as_string=False) for datetime operations (scheduling, comparisons, logging)
|
||||
|
||||
## String Sanitization
|
||||
|
||||
Use sanitizers from `server/helper.py` before storing user input.
|
||||
|
||||
6
.github/workflows/run-all-tests.yml
vendored
6
.github/workflows/run-all-tests.yml
vendored
@@ -12,7 +12,7 @@ on:
|
||||
type: boolean
|
||||
default: false
|
||||
run_backend:
|
||||
description: '📂 backend/ (SQL Builder & Security)'
|
||||
description: '📂 backend/ & db/ (SQL Builder, Security & Migration)'
|
||||
type: boolean
|
||||
default: false
|
||||
run_docker_env:
|
||||
@@ -43,9 +43,9 @@ jobs:
|
||||
run: |
|
||||
PATHS=""
|
||||
# Folder Mapping with 'test/' prefix
|
||||
if [ "${{ github.event.inputs.scan }}" == "true" ]; then PATHS="$PATHS test/scan/"; fi
|
||||
if [ "${{ github.event.inputs.run_scan }}" == "true" ]; then PATHS="$PATHS test/scan/"; fi
|
||||
if [ "${{ github.event.inputs.run_api }}" == "true" ]; then PATHS="$PATHS test/api_endpoints/ test/server/"; fi
|
||||
if [ "${{ github.event.inputs.run_backend }}" == "true" ]; then PATHS="$PATHS test/backend/"; fi
|
||||
if [ "${{ github.event.inputs.run_backend }}" == "true" ]; then PATHS="$PATHS test/backend/ test/db/"; fi
|
||||
if [ "${{ github.event.inputs.run_docker_env }}" == "true" ]; then PATHS="$PATHS test/docker_tests/"; fi
|
||||
if [ "${{ github.event.inputs.run_ui }}" == "true" ]; then PATHS="$PATHS test/ui/"; fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user