{"id":20171737,"url":"https://github.com/sir-ragna/notifier","last_synced_at":"2026-05-10T18:50:39.716Z","repository":{"id":150497958,"uuid":"431984236","full_name":"sir-ragna/notifier","owner":"sir-ragna","description":"Collect notifications through HTTP requests and filter through them. Created in Django.","archived":false,"fork":false,"pushed_at":"2024-04-17T01:16:44.000Z","size":158,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T04:27:51.062Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sir-ragna.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-25T21:45:22.000Z","updated_at":"2023-03-08T00:52:44.000Z","dependencies_parsed_at":"2024-04-17T02:38:10.695Z","dependency_job_id":"7e9c0aac-d089-4f2e-b891-9fee08d24100","html_url":"https://github.com/sir-ragna/notifier","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sir-ragna/notifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sir-ragna%2Fnotifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sir-ragna%2Fnotifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sir-ragna%2Fnotifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sir-ragna%2Fnotifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sir-ragna","download_url":"https://codeload.github.com/sir-ragna/notifier/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sir-ragna%2Fnotifier/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32867988,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"ssl_error","status_checked_at":"2026-05-10T13:40:02.145Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-14T01:27:37.170Z","updated_at":"2026-05-10T18:50:39.681Z","avatar_url":"https://github.com/sir-ragna.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Notifier\n\nNotifier is a very simple website that catches alert notifications.\n\nThe notifications are created by performing a post request.\nThis can be done with one line of Powershell, so it is easy and fast to \ninclude in scripts.\n\nThe idea is not to use this as a monitoring tool for a large number of machines, \nbut rather, to quickly write one-off scripts to monitor a specific event at on a \nspecific system.\n\nMaybe a certain error only rarely occurs, and you want to get \nnotified when it happens. Instead of checking the log file on a daily basis,\n_notifier_ was created, so you can quickly whip up a monitoring script to do \nthe checking for you.\n\n## Filters\n\nThe system has pagination and bookmarkable filters.\n\nThe URL http://0.0.0.0:8000/?description=100\u0026customer=Contoso\u0026system=System \nwill only show events that contain **100** in their description, **Contoso**  \nin their customer field and **System** in their system field.\n\n# Installing Notifier\n\nThis is an explanation for Linux.\nBoth development and deployment could be done on Windows in theory, I haven't\ntested this.\n\n## Retrieve the source code\n\nDownload the source code. Either clone the git respository or download\nthe zip file.\n\n```sh\ncurl https://codeload.github.com/sir-ragna/notifier/zip/refs/heads/main -o notifier-main.zip   \nunzip notifier-main.zip\ncd notifier-main\n```\n\n## Install the Python dependencies\n\nSet up a Python virtual environment. This will prevent issues between Python \nsystem modules and the versions used by this program. This allows us to run \nold and outdated programs.\n\n```sh\npython -m venv venv\n```\n\nThe above command creates a virtual in the directory `venv`.\nActivate the environment and install the dependencies from the _requirements.txt_ file.\n\n```sh\nsource venv/bin/activate\npip install -r requirements.txt\n```\n\n### Set up Django for use\n\nWe need to initiate the database. You also need to do this when upgrading.\n\n    python manage.py migrate\n\nIn order to sign in in the web interface. We need to create an initial user.\n\n    python manage.py createsuperuser --username admin\n\n## Setting up the service\n\nIt is best practice to create a separate user for this service.\n\n```\nuseradd -c \"notifier service user\" -r -d /opt/notifier/ -s \"/sbin/nologin\" notifier\n```\n\nFix the permissions on the working directory.\n\n```\nchown notifier:notifier -R /opt/notifier\n```\n\nSet up a systemd service file.\nThe systemd service file should include\n- the required environment variables. TIME_ZONE and SECRET_KEY are required.\n- the gunicorn command to run the WSGI service\n- the user and group you want to use to run the service under\n\nHere is an example of a systemd service file.\n\n```\n[Unit]\nDescription=notifier daemon\n#Requires=\nAfter=network.target\n\n[Service]\nType=notify\n# the specific user that our service will run as\nUser=notifier\nGroup=notifier\n# another option for an even more restricted service is\n# DynamicUser=yes\n# see http://0pointer.net/blog/dynamic-users-with-systemd.html\n#RuntimeDirectory=/opt/notifier\nWorkingDirectory=/opt/notifier\nEnvironment=TIME_ZONE=CET\nEnvironment=SECRET_KEY=generate-a-random-secret-key\nExecStart=/opt/notifier/venv/bin/gunicorn notifier.wsgi --bind 0.0.0.0:8000 --log-file -\nExecReload=/bin/kill -s HUP $MAINPID\nKillMode=mixed\nTimeoutStopSec=5\nPrivateTmp=true\n\n[Install]\nWantedBy=multi-user.target\n```\n\n## Serving static files\n\nGunicorn isn't made to serve static files.\nFor this reason it is best to run an Nginx in front of the app to serve the \nstatic files. We need Nginx to redirect the non-static requests to the app but\nall the static files, such as images, javascript and css files should be served\nby Nginx.\n\nAt a basic Nginx configuration level you will split up the static and dynamic part.\n\n```\n    location / {\n        proxy_pass http://10.0.0.1:8000/;\n    }\n    location /static/ {\n        root   /usr/share/nginx/notifier;\n    }\n```\n\n### static files\n\nFirst we need to collect the static files.\n\n```\nsource venv/bin/activate       # don't forget this before you try to run anything\npython manage.py collectstatic # writes static files to ./nginx/static\n```\n\nPut these files on your Nginx server in `/usr/share/nginx/notifier`.\n\n\n# User Management\n\nIt is possible to create users from the cmdline. This is required to \nat least create one initial user.\n\n    python manage.py createsuperuser --username admin\n\nMore users can be created from the `/admin/` page that is built-into Django.\n\n![screenshot of the add user screen](screenshots/add-user.png)\n\n## Keeping up-to-date\n\nBecause of the simplicity of the current set-up. \nThe following script can be used to install updates.\n\n```sh\n#!/bin/bash\n\n## Update the notifier app to the latest git commit\npushd notifier # enter notifier dir\ngit pull       # pull in the latest changes\nsource venv/bin/activate        # activate virtual environment\npip install -r requirements.txt # install the requirements\npython manage.py migrate        # perform database updates\npopd                            # return to previous dir\nchown -R notifier:notifier notifier # set the permissions right\nsystemctl restart notifier          # restart the service\n```\n\n## Containers\n\nOptionally, Notifier can be run inside an OCI container with either docker or podman.\n\nBuild the container using buildah.\n\n    buildah build --layers --tag=\"notifier:v0.6\" .  \n\nRun the container using podman.\n\n    podman run --rm -it -p 8000:8000 -v $(pwd)/database:/app/database notifier:v0.6\n\n    podman run --rm -it -p 8000:8000 -v $(pwd)/database:/app/database -v $(pwd)/attachments:/app/attachments -e SECRET_KEY='django-insecure-a62c754d-d754-4c40-a81a-73e6bff62ac6' localhost/notifier:v0.6\n\nThe container is using [gunicorn](https://gunicorn.org/) \nto run Django. As such it will not serve any\nstatic files. To serve static files you are supposed to run an nginx server in \nfront. To test this I have a Dockerfile and nginx configuration file in \nthe nginx directory.\n\n# Development setup\n\nRequires python 3. Instantiate the virtual environment, activate it and install\nthe dependencies.\n\n```sh\npython -m venv venv\nsource venv/bin/activate\npip install -r requirements\n```\n\nInitiate the database and create a new superuser.\n\n```sh\npython manage.py migrate\npython manage.py createsuperuser\n```\n\nThe **run.sh** script will apply migrations and start the site in debug mode.\nDjango will restart itself when you save changes.\n\n```sh\n./run.sh\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsir-ragna%2Fnotifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsir-ragna%2Fnotifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsir-ragna%2Fnotifier/lists"}