{"id":25692558,"url":"https://github.com/pyvec/naucse-hooks","last_synced_at":"2025-04-24T05:15:40.169Z","repository":{"id":44910198,"uuid":"121976338","full_name":"pyvec/naucse-hooks","owner":"pyvec","description":"Hooks for naucse.python.cz","archived":false,"fork":false,"pushed_at":"2023-02-16T04:55:59.000Z","size":95,"stargazers_count":3,"open_issues_count":6,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-24T05:15:19.427Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyvec.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}},"created_at":"2018-02-18T18:04:34.000Z","updated_at":"2022-01-11T19:00:48.000Z","dependencies_parsed_at":"2022-09-05T12:01:27.046Z","dependency_job_id":null,"html_url":"https://github.com/pyvec/naucse-hooks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyvec%2Fnaucse-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyvec%2Fnaucse-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyvec%2Fnaucse-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyvec%2Fnaucse-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyvec","download_url":"https://codeload.github.com/pyvec/naucse-hooks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250566512,"owners_count":21451234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2025-02-24T23:09:26.814Z","updated_at":"2025-04-24T05:15:40.151Z","avatar_url":"https://github.com/pyvec.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deployment trigger for naucse.python.cz\n\nYou can send a POST request to ``/trigger``, which will trigger a rebuild of naucse. The request\nhas to contain keys `repository` and `branch`. This repository and branch has to be used somewhere\nin naucse, otherwise no deployment will be triggered.\n\n## How to install:\n\n    pip install -r requirements.txt\n\n## How to run:\n\n    export FLASK_APP=naucse_hooks.py\n    flask run\n\n## How to run in debug:\n\n    export FLASK_DEBUG=1\n    export FLASK_APP=naucse_hooks.py\n    flask run\n\n## How to configure:\n  \n  + Create a file `local_settings.cfg`. It uses Pythonic syntax, see `settings.cfg` for reference.\n  + List of available settings for hooks:\n    - **NAUCSE_GIT_URL** - http(s) link to base naucse git\n    - **NAUCSE_BRANCH** - branch used to render naucse\n    - **GITHUB_TOKEN** - token used to trigger CI workflows in naucse repository\n    - **SENTRY_DSN** - a DSN for Sentry, to use Raven to catch errors (optional)\n\n## How to deploy using mod_wsgi:\n\nThe app has to be able to write to file ``naucse_hooks.log`` and to the folder ``.sessions``.\n\n(\u003c\u003e means something you have to replace with your value) \n\n  + Create a file called `wsgi.py` in the root folder:\n    \n        import sys\n        sys.path.insert(0, '\u003cpath to root folder\u003e')\n        from naucse_hooks import app as application\n\n  * Add this to Apache config\n\n        \u003cVirtualHost *:80\u003e\n            ServerName \u003cdomain\u003e\n            RewriteEngine On\n            RewriteCond %{HTTPS} off\n            RewriteRule (.*) https://\u003cdomain\u003e%{REQUEST_URI}\n        \u003c/VirtualHost\u003e\n\n        \u003cVirtualHost *:443\u003e\n            ServerName      \u003cdomain\u003e\n    \n            ErrorLog \u003cpath to folder containg logs\u003e/logs/error.log\n            CustomLog \u003cpath to folder containg logs\u003e/logs/access.log combined\n    \n            Options -Indexes\n    \n            \u003cDirectory \u003cpath to root folder\u003e\u003e\n                    \u003cFiles wsgi.py\u003e\n                            Order allow,deny\n                            Allow from all\n                    \u003c/Files\u003e\n            \u003c/Directory\u003e\n    \n            DocumentRoot \u003cpath to root folder\u003e\n            LoadModule wsgi_module /usr/local/lib/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so\n            WSGIDaemonProcess naucse_hooks processes=1 threads=2 display-name=%{GROUP} python-home=\u003cpath to venv\u003e home=\u003cpath to root folder\u003e\n            WSGIProcessGroup naucse_hooks\n            WSGIApplicationGroup %{GROUP}\n            WSGIScriptAlias / \u003cpath to root folder\u003e/wsgi.py\n            WSGIScriptReloading On\n\n            SSLCertificateFile /etc/letsencrypt/live/\u003cdomain\u003e/fullchain.pem\n            SSLCertificateKeyFile /etc/letsencrypt/live/\u003cdomain\u003e/privkey.pem\n            Include /etc/letsencrypt/options-ssl-apache.conf\n\n        \u003c/VirtualHost\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyvec%2Fnaucse-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyvec%2Fnaucse-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyvec%2Fnaucse-hooks/lists"}