{"id":29656659,"url":"https://github.com/anxdpanic/image-short-codes","last_synced_at":"2026-04-16T18:32:23.142Z","repository":{"id":234974400,"uuid":"789840060","full_name":"anxdpanic/image-short-codes","owner":"anxdpanic","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-01T16:44:09.000Z","size":101,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-02T11:34:13.943Z","etag":null,"topics":["cloudflare-workers","docker","nginx-docker","python","python3","sftp-server"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anxdpanic.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":"2024-04-21T17:38:16.000Z","updated_at":"2024-05-01T16:44:13.000Z","dependencies_parsed_at":"2024-05-01T18:09:15.369Z","dependency_job_id":null,"html_url":"https://github.com/anxdpanic/image-short-codes","commit_stats":null,"previous_names":["anxdpanic/image-short-codes"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anxdpanic/image-short-codes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anxdpanic%2Fimage-short-codes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anxdpanic%2Fimage-short-codes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anxdpanic%2Fimage-short-codes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anxdpanic%2Fimage-short-codes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anxdpanic","download_url":"https://codeload.github.com/anxdpanic/image-short-codes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anxdpanic%2Fimage-short-codes/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266456453,"owners_count":23931416,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["cloudflare-workers","docker","nginx-docker","python","python3","sftp-server"],"created_at":"2025-07-22T08:36:15.361Z","updated_at":"2026-04-16T18:32:23.133Z","avatar_url":"https://github.com/anxdpanic.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Image Shortcode Url Generation and Hosting\n\n## Docker (nginx and sftpd)\n\n#### Job \n- Host images with nginx from a single directory `./data`\n- SFTPd with access to `./data` for managing image files\n\n---\n\n```shell\ngit clone https://github.com/anxdpanic/image-short-codes\ncd docker\n\n# generate encrypted sftp password, and ssh keys\n# configure SFTP_USERNAME, USER_UID, and USER_GID in .env\n./run-first.sh\n\ndocker-compose up --build -d\n```\n\n---\n\n## Cloudflare Worker (Python)\n\nRequires [NodeJS](https://nodejs.org/en/download)\n\n#### Job \n- Handle incoming http requests for shortcodes\n- Manage Cloudflare D1 database with shortcode \u003c-\u003e url references based on the http request (authentication header required)\n- Resolve shortcode to it's url (hosted by the nginx docker) and display the image\n\n---\n\n```shell\ngit clone https://github.com/anxdpanic/image-short-codes\ncd cloudflare_worker/image-short\n\n# configure settings in .toml\n# [vars]\n# CF_WORKER_BASE_URL = \"https://img.example.com\"\n# RAW_IMG_BASE_URL = \"https://images.example.com\"\n\n# [[d1_databases]]\n# database_id = \"\"\n\ncp wrangler.toml.template wrangler.toml\nnano wrangler.toml\n\n# install wrangler\nnpm install wrangler@latest\n# or\nyarn add wrangler@latest\n\n# add authentication token as a secret on cloudflare\nnpx wrangler@latest add secret AUTHENTICATION_TOKEN\n\n# deploy worker\nnpx wrangler@latest deploy\n```\n\n---\n\n## Image Watchdog\n\n#### Job \n- Monitor a single folder for changes to image files\n- Mirror those changes to the sftp server to be hosted by nginx\n- Manage shortcodes through the cloudflare worker via http requests\n- Send Discord notification with new shortcodes\n\n---\n\n```shell\ngit clone https://github.com/anxdpanic/image-short-codes\ncd watchdog\n\n# configure settings for watchdog, discord webhook settings are optional\ncp config.json.template config.json\nnano config.json\n\n# install\npip install .\n# confirm working\nwatchdog-imgshort -f config.json\n# run in the background\nscreen -dmS ImageWatchdog watchdog-imgshort -f config.json\n```\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanxdpanic%2Fimage-short-codes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanxdpanic%2Fimage-short-codes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanxdpanic%2Fimage-short-codes/lists"}