Commit Graph

7 Commits

Author SHA1 Message Date
db123-test
252c617769 fix: handle errors from audit log INSERT statements
Previously, errors from INSERT INTO audit_log were silently discarded using _, _, which
meant audit log failures could go unnoticed during add/delete/cleanup operations.

The changes now properly capture and return errors for permanent entry operations and
temporary entry operations, except for cleanupExpiredTemp which logs warnings instead
of failing the entire cleanup process when individual audit log entries fail.
2026-05-04 13:16:58 +03:30
db123-test
327827da69 refactor(db): remove unnecessary created_at column from perm whitelist query
The `created_at` field is no longer needed in the result set,
so it was removed from the SELECT query to reduce data transfer
and simplify the response.
2026-05-04 13:03:16 +03:30
db123-test
82f391f129 fix: initialize slices explicitly and improve uniqueness check robustness
- Initialize list slices with make() to avoid nil slices in ListTempEntries and ListPermEntries
- Use strings.Contains() for uniqueness constraint checking to handle variations in error messages
2026-05-04 12:10:41 +03:30
db123-test
39747cc151 fix: list permanent whitelist entries sorted by creation time
Update ListPermEntries to return entry field instead of ip and
sort results by created_at. Update the handler in auth.go to call
ListPermEntries instead of ListTempEntries for the whitelist endpoint.
2026-05-04 11:35:02 +03:30
db123-test
7221feb6d4 feat: add permanent whitelist list endpoint and rename DB table
- Add GET /api/whitelist/perm/list to list permanent whitelisted entries
- Implement permWhitelistListHandler with API key verification
- Rename permanent_whitelist table to perm_whitelist for consistency
- Update default DB path from ./data to /data
- Comment out build job in CI/CD workflow
2026-05-04 11:29:01 +03:30
db123-test
515de33837 feat: add SQLite persistence and REST API for temporary whitelisting
- Migrate IP-based temporary whitelisting from file to SQLite storage
- Add REST API endpoints for managing temporary and permanent whitelists
- Create `.env.example` with required environment variables
- Document API endpoints in README.md and docs/api.md
- Add new dependency `modernc.org/sqlite` for SQLite support
- Update deployment and security documentation
2026-05-04 09:08:11 +03:30
d82ab73336 refactor: added ton of sqlite helpers and used sqlite for all the whitelists 2026-05-04 08:29:36 +03:30