{"id":16894078,"url":"https://github.com/firefart/gochro","last_synced_at":"2025-07-09T04:06:20.663Z","repository":{"id":34469236,"uuid":"179148995","full_name":"firefart/gochro","owner":"firefart","description":"Take screenshots of websites and create PDF from HTML pages using chromium and docker","archived":false,"fork":false,"pushed_at":"2025-05-12T05:23:50.000Z","size":218,"stargazers_count":65,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-20T11:06:44.316Z","etag":null,"topics":["chromium","docker","golang","pdf-generation","screenshot","screenshot-utility"],"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/firefart.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,"zenodo":null},"funding":{"github":"firefart","patreon":"firefart"}},"created_at":"2019-04-02T19:56:24.000Z","updated_at":"2025-05-12T05:23:48.000Z","dependencies_parsed_at":"2023-01-15T07:16:17.843Z","dependency_job_id":"eadba420-4e6a-4088-92ee-3f48e8e3ea6e","html_url":"https://github.com/firefart/gochro","commit_stats":{"total_commits":247,"total_committers":4,"mean_commits":61.75,"dds":0.4493927125506073,"last_synced_commit":"91360d7ae6f93ad8c029f6c8b9e771c6976077d9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/firefart/gochro","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firefart%2Fgochro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firefart%2Fgochro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firefart%2Fgochro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firefart%2Fgochro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firefart","download_url":"https://codeload.github.com/firefart/gochro/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firefart%2Fgochro/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264390709,"owners_count":23600563,"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":["chromium","docker","golang","pdf-generation","screenshot","screenshot-utility"],"created_at":"2024-10-13T17:17:36.558Z","updated_at":"2025-07-09T04:06:20.642Z","avatar_url":"https://github.com/firefart.png","language":"Go","funding_links":["https://github.com/sponsors/firefart","https://patreon.com/firefart"],"categories":[],"sub_categories":[],"readme":"# gochro\n\ngochro is a small docker image with chromium installed and a golang based webserver to interact with it. It can be used to take screenshots of websites using chromium-headless and convert HTML pages to PDF.\n\nIf errors occur the error will be logged to stdout and a non information leaking error message is presented to the user.\n\nThis project was used on [https://wpscan.io](https://wpscan.io) for taking website screenshots and to generate PDF reports.\n\n## Screenshot\n\nThis URL takes a Screenshot of [https://firefart.at](https://firefart.at) with a resolution of 1024x768 and returns an image.\n\n[http://localhost:8080/screenshot?url=https://firefart.at\u0026w=1024\u0026h=768](http://localhost:8080/screenshot?url=https://firefart.at\u0026w=1024\u0026h=768)\n\n## HTML 2 PDF\n\nSend a POST request with the HTML you want to convert in the Post body to the following url.\n\n[http://localhost:8080/html2pdf?w=1024\u0026h=768](http://localhost:8080/html2pdf?w=1024\u0026h=768)\n\nThis will return a PDF of the HTML input.\n\nExample:\n\n```text\nPOST /html2pdf?w=1024\u0026h=768 HTTP/1.1\nHost: localhost:8000\nContent-Type: application/x-www-form-urlencoded\nContent-Length: 119\n\n\u003chtml\u003e\n\u003chead\u003e\u003ctitle\u003eTest Page\u003c/title\u003e\u003c/head\u003e\n\u003cbody\u003e\n\u003ch1\u003eThis is a test\u003c/h1\u003e\n\u003cp\u003eThis is a test\u003c/p\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\nExample as curl:\n\n```text\ncurl -s -k -X 'POST' -o test.pdf --data-binary '\u003chtml\u003e\u003cbody\u003e\u003ch1\u003etest\u003c/h1\u003e\u003c/body\u003e\u003c/html\u003e' 'http://127.0.0.1:8000/html2pdf'\n```\n\n## URL 2 PDF\n\nSend a GET request to the following url to get the response as PDF.\n\n[http://localhost:8080/url2pdf?url=https://firefart.at\u0026w=1024\u0026h=768](http://localhost:8080/url2pdf?url=https://firefart.at\u0026w=1024\u0026h=768)\n\n## Run server\n\nTo run this image you should use the [seccomp profile](https://github.com/jessfraz/dotfiles/blob/master/etc/docker/seccomp/chrome.json) provided by [Jess Frazelle](https://github.com/jessfraz). The privileges on the host are needed for chromiums internal security sandbox. You can also deactivate the sandbox on chromium (would require changes in `main.go`) but that's a bad idea and puts your server at risk, so please use the seccomp profile instead.\n\nBe sure to use the --init switch to get rid of zombie processes of chromium.\n\n### Command Line Options\n```text\n-host                  The host and port to listen of (refers to inside the container). Defaults to 0.0.0.0:8000\n-debug                 Enables debug output. Default: false\n-ignore-cert-errors    Also fetch ressources from origins with untrusted certificates or cert errors.\n-proxy                 Use a proxy server to connect to the internet. Please use format IP:PORT without a protocol. Example: 1.2.3.4:3128\n```\n\n### Use the docker hub image\n\nYou can also use the [prebuit image](https://hub.docker.com/r/firefart/gochro) from dockerhub.\n\nTo pull the image run\n\n```bash\ndocker pull firefart/gochro\n```\n\n### Include in docker-compose\n\nIf you want to include this image in a docker-compose file you can use the following example. Just connect the `gochronet` to the other service so the containers can communicate with each other.\n\nPlease note that the `0.0.0.0` in the command only applies to the network inside the docker container itself. If you want to access it from your local machine you need to add a port mapping.\n\n```yml\nversion: '3.7'\n\nservices:\n  gochro:\n    image: firefart/gochro\n    init: true\n    container_name: gochro\n    security_opt:\n      - seccomp=\"chrome.json\"\n    command: -host 0.0.0.0:8000\n    networks:\n      - gochronet\n\nnetworks:\n  gochronet:\n    driver: bridge\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirefart%2Fgochro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirefart%2Fgochro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirefart%2Fgochro/lists"}