{"id":17928481,"url":"https://github.com/alifeee/github-webhook-printing","last_synced_at":"2025-07-07T14:33:02.212Z","repository":{"id":247999541,"uuid":"827468108","full_name":"alifeee/github-webhook-printing","owner":"alifeee","description":"Printing GitHub webhook events with a ZJ-58 receipt printer","archived":false,"fork":false,"pushed_at":"2024-07-23T13:30:14.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-04T15:22:53.475Z","etag":null,"topics":["cgi","escpos","thermal-printer","webhooks","zj-58"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/alifeee.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":"2024-07-11T17:47:54.000Z","updated_at":"2024-07-23T13:30:18.000Z","dependencies_parsed_at":"2025-02-09T00:31:32.709Z","dependency_job_id":"238c6faf-53d5-446a-9153-b0ad7a34d681","html_url":"https://github.com/alifeee/github-webhook-printing","commit_stats":null,"previous_names":["alifeee/github-webhook-printing"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alifeee/github-webhook-printing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifeee%2Fgithub-webhook-printing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifeee%2Fgithub-webhook-printing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifeee%2Fgithub-webhook-printing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifeee%2Fgithub-webhook-printing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alifeee","download_url":"https://codeload.github.com/alifeee/github-webhook-printing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifeee%2Fgithub-webhook-printing/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264092040,"owners_count":23556223,"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":["cgi","escpos","thermal-printer","webhooks","zj-58"],"created_at":"2024-10-28T21:03:22.781Z","updated_at":"2025-07-07T14:33:02.196Z","avatar_url":"https://github.com/alifeee.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub webhook printing\n\nPrint (certain) GitHub webhook events with a thermal printer.\n\n## Install\n\n```bash\nmkdir -p /var/www/cgi/\ngit clone git@github.com:alifeee/github-webhook-printing.git\nmv github-webhook-printing githubwebhooks\ncd githubwebhooks\nchown -R alifeee:www-data .\n```\n\n## Use Nginx to turn on CGI scripts\n\n```bash\napt install nginx fcgiwrap\nservice nginx start\necho 'server {\n        listen 80;\n        listen [::]:80;\n\n\tserver_name \u003cserver-address\u003e;\n\n\tlocation /githubwebhooks {\n\t\tfastcgi_intercept_errors on;\n\t\tinclude fastcgi_params;\n\t\tfastcgi_param SCRIPT_FILENAME /var/www/cgi/$fastcgi_script_name;\n\t\tfastcgi_pass unix:/var/run/fcgiwrap.socket;\n\t}\n}' \u003e /etc/nginx/sites-available/githubwebhook\nln -s /etc/nginx/sites-available/githubwebhook /etc/nginx/sites-enabled/githubwebhook\nnginx -t\nufw allow 80\nservice nginx restart\n```\n\n## Test ping CGI script\n\n```bash\ncurl \"http://\u003cserver-address\u003e/githubwebhooks/ping.cgi\"\n```\n\n## Collect example webhook payloads\n\nGo to a GitHub user, repository, or organisation settings page \u003e webhooks. Add a webhook that points to `http://\u003cserver-address\u003e/githubwebhooks/hook.cgi`.\n\nSend some webhook requests (by activating GitHub events).\n\nCopy and paste the `env` output and data from the `log` file to files like `webhook-examples/push.env` and `webhook-examples/push.json`.\n\n## Test webhook\n\nSet the webhook to point to `http://\u003cserver-address\u003e/githubwebhooks/hook.cgi`\n\n```bash\n# push\ncurl -s --request POST -i -H \"X-GITHUB-EVENT: push\" \"http://\u003cserver-address\u003e/githubwebhooks/hook.cgi\" -d \"@webhook-examples/push.json\"\n# issue_comment\ncurl -s --request POST -i -H \"X-GITHUB-EVENT: issue_comment\" \"http://\u003cserver-address\u003e/githubwebhooks/hook.cgi\" -d \"@webhook-examples/issue_comment.json\"\n# create\ncurl -s --request POST -i -H \"X-GITHUB-EVENT: create\" \"http://\u003cserver-address\u003e/githubwebhooks/hook.cgi\" -d \"@webhook-examples/create.json\"\n# pull_request\ncurl -s --request POST -i -H \"X-GITHUB-EVENT: pull_request\" \"http://\u003cserver-address\u003e/githubwebhooks/hook.cgi\" -d \"@webhook-examples/pull_request.json\"\n```\n\n## To-do\n\n- print a QR code that links to the event (QR code printing with ESCPOS *without* using a library like [python-escpos] or [node-escpos] is difficult)\n- add more events!\n\n[python-escpos]: https://github.com/python-escpos/python-escpos/\n[node-escpos]: https://github.com/node-escpos/driver\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falifeee%2Fgithub-webhook-printing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falifeee%2Fgithub-webhook-printing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falifeee%2Fgithub-webhook-printing/lists"}