{"id":27120661,"url":"https://github.com/potlock/rss-service-template","last_synced_at":"2025-04-07T10:07:13.957Z","repository":{"id":280777841,"uuid":"943097246","full_name":"PotLock/rss-service-template","owner":"PotLock","description":"Lightweight, scalable, easy-to-deploy RSS feed service","archived":false,"fork":false,"pushed_at":"2025-03-14T20:10:07.000Z","size":68,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-14T21:26:56.352Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/PotLock.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":"2025-03-05T06:54:32.000Z","updated_at":"2025-03-14T20:10:10.000Z","dependencies_parsed_at":"2025-03-05T09:28:23.300Z","dependency_job_id":"05049b25-6325-4fbc-afe2-d55ad2402e48","html_url":"https://github.com/PotLock/rss-service-template","commit_stats":null,"previous_names":["potlock/rss-service-template"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotLock%2Frss-service-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotLock%2Frss-service-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotLock%2Frss-service-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotLock%2Frss-service-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PotLock","download_url":"https://codeload.github.com/PotLock/rss-service-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247631815,"owners_count":20970065,"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-04-07T10:07:13.385Z","updated_at":"2025-04-07T10:07:13.940Z","avatar_url":"https://github.com/PotLock.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RSS Service\n\nA lightweight, scalable RSS feed service built with Hono.js and Upstash Redis. This service allows you to create and manage RSS feeds programmatically through a simple REST API. It's designed to work seamlessly with the `@curatedotfun/rss` plugin in the curate.fun ecosystem.\n\n## Quick Deploy\n\nDeploy your own RSS service with one click:\n\n[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/template/pfvWZK?referralCode=3O4l1-)\n\n[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/potlock/rss-service-template)\n\n## Features\n\n- **Multiple Feed Formats**: Generate RSS 2.0, Atom, and JSON Feed formats\n- **Standard-Compliant URLs**: Access feeds via standard paths (`/rss.xml`, `/atom.xml`, `/feed.json`)\n- **Raw Data Option**: Get content without HTML via `/raw.json` for frontend customization\n- **HTML Sanitization**: Secure content handling with sanitize-html\n- **Simple Authentication**: API secret-based authentication for feed management\n- **Configurable CORS**: Cross-origin request support\n- **Redis Storage**: Efficient storage with Upstash Redis (production) or Redis mock (development)\n- **Docker Support**: Easy local development with Docker and Docker Compose\n\n## API Endpoints\n\n| Endpoint | Method | Description | Authentication | Response Format |\n|----------|--------|-------------|----------------|-----------------|\n| `/` | GET | Health check and redirect to preferred format | No | Redirect |\n| `/rss.xml` | GET | Get feed as RSS 2.0 XML | No | `application/rss+xml` |\n| `/atom.xml` | GET | Get feed as Atom XML | No | `application/atom+xml` |\n| `/feed.json` | GET | Get feed as JSON Feed (with HTML content) | No | `application/json` |\n| `/raw.json` | GET | Get feed as JSON Feed (without HTML content) | No | `application/json` |\n| `/api/items` | GET | Get all items as JSON | No | `application/json` |\n| `/api/items?format=html` | GET | Get all items with HTML preserved | No | `application/json` |\n| `/api/items` | POST | Add an item to the feed | Yes | `application/json` |\n\n## Authentication\n\nThe RSS service uses a simple API secret for authentication. Protected endpoints (like POST operations) require the API secret in the Authorization header:\n\n```txt\nAuthorization: Bearer \u003cyour-api-secret\u003e\n```\n\nPublic endpoints (health check and feed retrieval) do not require authentication, making it easy for RSS readers to access your feed.\n\nThe API secret is configured through the `API_SECRET` environment variable and should be kept secure. This should match the secret used by services posting to the feed.\n\n## Environment Variables\n\n| Variable | Description | Required | Default |\n|----------|-------------|----------|---------|\n| `API_SECRET` | Secret key for API authentication | Yes | - |\n| `UPSTASH_REDIS_REST_URL` | Upstash Redis REST URL | Yes (for production, serverless) | - |\n| `UPSTASH_REDIS_REST_TOKEN` | Upstash Redis REST token | Yes (for production, serverless) | - |\n| `ALLOWED_ORIGINS` | Comma-separated list of allowed origins for CORS | No | `*` |\n| `PORT` | Port to run the server on | No | `4001` |\n| `USE_REDIS_MOCK` | Set to 'true' to use Redis mock for local development | No | `false` |\n| `NODE_ENV` | Environment mode (development/production) | No | `development` |\n\n## Feed Configuration\n\nThe RSS service can be configured through the `/api/config` API endpoint:\n\n| Endpoint | Method | Description | Authentication | Response Format |\n|----------|--------|-------------|----------------|-----------------|\n| `/api/config` | GET | Get current feed configuration | No | `application/json` |\n| `/api/config` | PUT | Update feed configuration | Yes | `application/json` |\n\nExample configuration request:\n\n```bash\ncurl -X PUT https://your-service.com/api/config \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer your-api-secret\" \\\n  -d '{\n    \"title\": \"My RSS Feed\",\n    \"description\": \"A feed of curated content\",\n    \"siteUrl\": \"https://example.com\",\n    \"language\": \"en\",\n    \"copyright\": \"© 2025\",\n    \"author\": {\n      \"name\": \"Feed Author\",\n      \"email\": \"author@example.com\"\n    },\n    \"maxItems\": 100,\n    \"image\": \"https://example.com/logo.png\"\n  }'\n```\n\n## Development\n\n### Local Development\n\nFor local development, you can use Docker or run directly:\n\n#### Using Docker\n\n```bash\ndocker compose up\n```\n\nThe service will be available at \u003chttp://localhost:4001\u003e\n\n#### Without Docker\n\n1. Create a `.env` file (`cp .env.example .env`):\n\n```txt\nAPI_SECRET=your-secure-random-string\nUSE_REDIS_MOCK=true\nPORT=4001\n```\n\n2. Start the development server:\n\n```bash\nnpm install\nnpm run dev\n```\n\n## Deployment\n\n### Railway (Recommended)\n\nClick the \"Deploy on Railway\" button at the top of this README to:\n\n1. Create a new project from our template\n2. Set up all necessary infrastructure\n3. Configure the deployment settings\n\nAfter deployment, you only need to:\n\n1. Set the `API_SECRET` environment variable in your Railway dashboard\n\n### Netlify\n\n1. Click the \"Deploy to Netlify\" button above\n2. Add required environment variables:\n   - `UPSTASH_REDIS_REST_URL`\n   - `UPSTASH_REDIS_REST_TOKEN`\n   - `API_SECRET`\n\n### Cloudflare Workers\n\nFor deployment to Cloudflare Workers:\n\n1. Install Wrangler: `npm install -g wrangler`\n\n2. Add secrets:\n\n```bash\nwrangler secret put UPSTASH_REDIS_REST_URL\nwrangler secret put UPSTASH_REDIS_REST_TOKEN\nwrangler secret put API_SECRET\n```\n\n3. Deploy: `wrangler publish`\n\n## Testing Your Feed\n\nAccess your feed at:\n\n- `/rss.xml` (RSS 2.0)\n- `/atom.xml` (Atom)\n- `/feed.json` (JSON Feed)\n- `/raw.json` (Raw JSON)\n\nAdd items using the API:\n\n```bash\ncurl -X POST http://localhost:4001/api/items \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer your-api-secret\" \\\n  -d '{\"title\":\"Test Item\",\"content\":\"\u003cp\u003eTest content\u003c/p\u003e\",\"link\":\"https://example.com/test\"}'\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotlock%2Frss-service-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpotlock%2Frss-service-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotlock%2Frss-service-template/lists"}