{"id":24876300,"url":"https://github.com/deeper-x/web_log","last_synced_at":"2026-05-09T17:37:10.232Z","repository":{"id":65193730,"uuid":"427771654","full_name":"deeper-x/web_log","owner":"deeper-x","description":"Web service - Registered sources save log messages to mongodb","archived":false,"fork":false,"pushed_at":"2025-01-09T11:31:21.000Z","size":6855,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-14T23:11:03.004Z","etag":null,"topics":["database","golang","logger","mongodb"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deeper-x.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-13T21:01:32.000Z","updated_at":"2025-01-09T11:32:16.000Z","dependencies_parsed_at":"2025-02-01T08:47:35.229Z","dependency_job_id":"5b5b414d-a775-415b-a92d-0ffefd896d20","html_url":"https://github.com/deeper-x/web_log","commit_stats":null,"previous_names":["deeper-x/web_log","deeper-x/weblog"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/deeper-x/web_log","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deeper-x%2Fweb_log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deeper-x%2Fweb_log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deeper-x%2Fweb_log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deeper-x%2Fweb_log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deeper-x","download_url":"https://codeload.github.com/deeper-x/web_log/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deeper-x%2Fweb_log/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32828877,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","golang","logger","mongodb"],"created_at":"2025-02-01T08:47:32.337Z","updated_at":"2026-05-09T17:37:10.203Z","avatar_url":"https://github.com/deeper-x.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mongodb web app - web interface for logging events\n\nIn order to allow system with signature ID ```SYSTEMXYZ``` to log message ```System failure detected```\n\n### Configure signature ID in whitelist.json like that:\n\n```json\n{\n    \"systems\": [{\n            \"ID\": \"SYSTEMXYZ\",\n            \"Description\": \"Mail server 1\"\n        },\n        {\n            \"ID\": \"SYSTEMABC\",\n            \"Description\": \"File server 1\"\n        },\n        {\n            \"ID\": \"SYSTEMWZT\",\n            \"Description\": \"File server 2\"\n        }\n    ]\n}\n```\n\n\nRun:\n```go\ngo run main.go\n```\n\nCall /save with parameter ```signature``` \"SYSTEMXYZ\" and ```message``` \"System failure detected\":\n\n```bash\nhttps://127.0.0.1/save?signature=SYSTEMXYZ\u0026message=System failure detected\n```\n\nResult:\n```mongo\n{ \"_id\" : ObjectId(\"6193e1520dcdee3f35f5faff\"), \"signature\" : \"SYSTEMXYZ\", \"ts\" : ISODate(\"2021-11-16T16:50:26.014Z\"), \"message\" : \"system failure detected on XYZ\" }\n\n```\n\nIf host is not allowed (e.g: ```SYSTEMFOO```, its signature ID is not in whitelist), then result is:\n\n```bash\nhttps://127.0.0.1/save?signature=SYSTEMXYZ\u0026message=system failure on XYZ\n```\nResult:\n```bash\nError: authentication denied\n```\n\nIn order to retrieve objects for registered systems, you have to call ```/load```  with parameter ```signature```:\n```bash\nhttps://127.0.0.1/save?signature=SYSTEMXYZ\n```\n\nResult:\n```bash\n[\n    {\n        \"Signature\": \"SYSTEMXYZ\",\n        \"TS\": \"2021-11-16T16:50:26.014Z\",\n        \"Message\": \"system failure detected on XYZ\"\n    },\n    {\n        \"Signature\": \"SYSTEMXYZ\",\n        \"TS\": \"2021-11-16T17:37:06.46Z\",\n        \"Message\": \"system failure detected on XYZ\"\n    },\n    {\n        \"Signature\": \"SYSTEMXYZ\",\n        \"TS\": \"2021-11-16T17:59:31.746Z\",\n        \"Message\": \"system failure detected on XYZ\"\n    }\n]\n```\n\n### Environment setup:\n```bash\nexport GOPATH=${HOME}/go\nexport GOBIN=${GOPATH}/bin\nexport PATH=${PATH}:${GOBIN}\nexport PATH=${PATH}:$( dirname $( which go ) )\n```\n\n### Run:\n```\nsudo --preserve-env=GOPATH,GOBIN,PATH make run\n```\n\n### Build:\n```\nsudo --preserve-env=GOPATH,GOBIN,PATH make build\n```\n\n### Test:\n```\nsudo --preserve-env=GOPATH,GOBIN,PATH make test\n```\n\n\n### Test coverage details:\n```golang\n(main)$ go test -v -cover ./...\n?   \tgithub.com/deeper-x/weblog\t[no test files]\n=== RUN   TestNewInstance\n--- PASS: TestNewInstance (0.00s)\n=== RUN   TestCreateCtx\n--- PASS: TestCreateCtx (0.00s)\n=== RUN   TestCreateClient\n--- PASS: TestCreateClient (0.00s)\n=== RUN   TestCreateCollection\n--- PASS: TestCreateCollection (0.00s)\n=== RUN   TestConnect\n--- PASS: TestConnect (0.00s)\n=== RUN   TestClose\n--- PASS: TestClose (0.00s)\n=== RUN   TestAddEntry\n--- PASS: TestAddEntry (0.01s)\n=== RUN   TestSaveEntry\n--- PASS: TestSaveEntry (0.00s)\n=== RUN   TestGetEntries\n--- PASS: TestGetEntries (0.00s)\nPASS\ncoverage: 59.4% of statements\nok  \tgithub.com/deeper-x/weblog/db\t0.038s\tcoverage: 59.4% of statements\n?   \tgithub.com/deeper-x/weblog/messages\t[no test files]\n?   \tgithub.com/deeper-x/weblog/settings\t[no test files]\n=== RUN   TestReadJSONFile\n--- PASS: TestReadJSONFile (0.00s)\nPASS\ncoverage: 46.2% of statements\nok  \tgithub.com/deeper-x/weblog/wauth\t0.004s\tcoverage: 46.2% of statements\n=== RUN   TestSave\n2021/11/17 12:30:56 Saving entry - Signature: [SYSTEMXYZ]\n2021/11/17 12:30:56 Entry saved succesfully ✔\n--- PASS: TestSave (0.01s)\n=== RUN   TestLoad\n--- PASS: TestLoad (0.01s)\nPASS\ncoverage: 40.8% of statements\nok  \tgithub.com/deeper-x/weblog/web\t0.029s\tcoverage: 40.8% of statements\n```\n\n***\n\n## Additionale notes:\n\nTLS deploy:\n```bash\n# key 2048 bit - RSA\nopenssl genrsa -out tls/server.key 2048\n# self-signed cert (x509) pem encoded, no password\nopenssl req -new -x509 -sha256 -key tls/server.key -out tls/server.crt -days 365\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeeper-x%2Fweb_log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeeper-x%2Fweb_log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeeper-x%2Fweb_log/lists"}