{"id":21477541,"url":"https://github.com/5ht2/srp-go","last_synced_at":"2025-04-23T00:44:57.509Z","repository":{"id":43044829,"uuid":"383847464","full_name":"5HT2/srp-go","owner":"5HT2","description":"Serve random pictures on a domain, with upload and browse support","archived":false,"fork":false,"pushed_at":"2024-03-20T07:08:58.000Z","size":3313,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-23T00:44:51.432Z","etag":null,"topics":["docker","fasthttp","filesystem","go","http","http-server"],"latest_commit_sha":null,"homepage":"https://frog.pics","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/5HT2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"custom":["https://payy.lv"]}},"created_at":"2021-07-07T15:38:22.000Z","updated_at":"2024-10-12T13:26:58.000Z","dependencies_parsed_at":"2023-12-28T09:28:14.104Z","dependency_job_id":"f68db570-ab91-4165-bd26-ead374c7e172","html_url":"https://github.com/5HT2/srp-go","commit_stats":null,"previous_names":["l1ving/srp-go"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5HT2%2Fsrp-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5HT2%2Fsrp-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5HT2%2Fsrp-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5HT2%2Fsrp-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/5HT2","download_url":"https://codeload.github.com/5HT2/srp-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250348874,"owners_count":21415907,"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":["docker","fasthttp","filesystem","go","http","http-server"],"created_at":"2024-11-23T11:14:12.845Z","updated_at":"2025-04-23T00:44:57.484Z","avatar_url":"https://github.com/5HT2.png","language":"Go","funding_links":["https://payy.lv"],"categories":[],"sub_categories":[],"readme":"# [srp-go](https://frog.pics)\n\n[![time tracker](https://wakatime.com/badge/github/5HT2/srp-go.svg)](https://wakatime.com/badge/github/5HT2/srp-go)\n[![Docker Pulls](https://img.shields.io/docker/pulls/l1ving/srp-go?logo=docker\u0026logoColor=white)](https://hub.docker.com/r/l1ving/srp-go)\n[![Docker Build](https://img.shields.io/github/actions/workflow/status/5HT2/srp-go/docker-build.yml?logo=docker\u0026logoColor=white\u0026branch=master)](https://github.com/5HT2/srp-go/actions/workflows/docker-build.yml)\n[![CodeFactor](https://img.shields.io/codefactor/grade/github/5HT2/srp-go?logo=codefactor\u0026logoColor=white)](https://www.codefactor.io/repository/github/5HT2/srp-go)\n\nServe a random image on [\\\u003cmain page\\\u003e](https://frog.pics) with a dynamic background color, let users upload\non [/upload](https://frog.pics/upload) and browse a gallery on [/browse](https://frog.pics/browse). Has (optional) image\nresizing and compression.\n\nContributions are welcome and appreciated.\n\n## Contributing\n\nTo build:\n\n```bash\ngit clone git@github.com:5HT2/srp-go.git\ncd srp-go\nmake\n```\n\nTo run:\n\n```bash\n./srp-go -h # for a full list of parameters (none required)\n./srp-go -addr=localhost:6060 -debug=true\n```\n\nI recommend deleting [`sample.jpg`](https://github.com/5HT2/srp-go/blob/master/config/images/sample.jpg)\nafter you have uploaded a few pictures. The sample file is there to prevent issues when first testing\n(needing an image to serve on `/`, to generate a sample color for, etc).\n\nYou can also add your own `favicon.ico` inside the `config/` directory, and it will overwrite the default icon.\n\n## OAuth\n\nIn order to set up OAuth, follow [these](https://docs.github.com/en/developers/apps/building-oauth-apps/creating-an-oauth-app)\ninstructions to create a GitHub OAuth app.\n\nYou will want to \n- Set `LIVE_URL` to the accessible url of your site in (`.env`)\n  - Eg: `https://frog.pics`\n  - Or: `http://localhost:6060` for a testing environment\n- Set the Callback URL to your `LIVE_URL` + `/api/auth/callback`\n- Enable \"Request user authorization (OAuth)\"\n- You do not need to enable permissions for anything\n\nCreate a `.env` file inside your config folder, with the following format:\n```bash\nOAUTH_CLIENT_ID=Iv1.some_client_id\nOAUTH_CLIENT_SECRET=your_client_secret\nLIVE_URL=http://localhost:6060\nBROWSE_PAGE_COLOR= # optional color code to use for the /browse page\nWEBHOOK_URL= # optional discord webhook url for posting specific events\n```\n\n## API\n\nThe full list of accessible API endpoints can be found inside [`api.go`](https://github.com/5HT2/srp-go/blob/master/api.go).\n\nThe `/api/all` endpoint will give you a list of all available images, in the below json format.\n\nThe `/api/random` endpoint will return the properties of a randomly-selected image in json (by default), like so:\n```json\n{\n    \"image_name\": \"sample.jpg\",\n    \"image_url\": \"http://localhost:6060/images/sample.jpg\",\n    \"median_color\": \"868232\"\n}\n```\n\nYou can also add `?format=css` to get the css version if you really want:\n```css\nbody {\n    background-color: #868232;\n}\n\ndiv.img {\n    content: url('/images/sample.jpg');\n}\n```\n\n## TODO:\n\n- [x] Add authentication for uploading\n- [ ] Add Discord embeds\n- [ ] Switch to a different prominent color library, because the current one doesn't support webp\n  - [ ] Switch to webp for saving images\n- [ ] Finalize webhook support\n- [ ] Image attribution support\n- [x] Sign In button broke\n\n## License\n\nThis project is licensed under [ISC](https://github.com/5HT2/srp-go/blob/master/LICENSE.md).\n\nThe [`sample.jpg`](https://github.com/5HT2/srp-go/blob/master/config/images/sample.jpg) file is licensed under\nCreative Commons Attribution-Share Alike, you can find the original file\n[here](https://commons.wikimedia.org/wiki/File:Bufo_americanus_PJC1.jpg).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5ht2%2Fsrp-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F5ht2%2Fsrp-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5ht2%2Fsrp-go/lists"}