Skip to content

Commit 46a11c9

Browse files
committed
slim frontend, add ux-friendly autosource auth using hmac + docs
1 parent f23c8e8 commit 46a11c9

26 files changed

+2619
-289
lines changed

.github/copilot-instructions.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,31 @@
77
- **Principle:** _All features must work without JavaScript._ JS is only progressive enhancement.
88
- **Frontend:** Modern Astro-based UI with component architecture, served alongside Ruby backend.
99

10+
## Documentation website of core dependencies
11+
12+
Search these pages before using them. Find examples, plugins, UI components, and configuration options.
13+
14+
### Roda
15+
16+
1. https://roda.jeremyevans.net/documentation.html
17+
18+
### Astro & Starlight
19+
20+
1. https://docs.astro.build/en/getting-started/
21+
2. https://starlight.astro.build/getting-started/
22+
23+
### html2rss
24+
25+
1. If available, find source locally in: `../html2rss`.
26+
2. source code on github: https://github.com/html2rss/html2rss
27+
28+
### Test and Linters
29+
30+
1. https://docs.rubocop.org/rubocop/cops.html
31+
2. https://docs.rubocop.org/rubocop-rspec/cops_rspec.html
32+
3. https://rspec.info/features/3-13/rspec-expectations/built-in-matchers/
33+
4. https://www.betterspecs.org/
34+
1035
## Core Rules
1136

1237
- ✅ Use **Roda routing with `hash_branch`**. Keep routes small.
@@ -26,6 +51,7 @@
2651
- ❌ Don't leak stack traces or secrets in responses.
2752
- ❌ Don't add complex frontend frameworks (React, Vue, etc.). Keep Astro simple.
2853
- ❌ Don't modify `frontend/dist/` - it's generated by build process.
54+
- ❌ NEVER expose the auth token a user provides.
2955

3056
## Project Structure
3157

README.md

Lines changed: 71 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This web application scrapes websites to build and deliver RSS 2.0 feeds with a
1010
- **Feed Gallery**: Browse and discover popular RSS feeds
1111
- **Auto Source**: Generate feeds from any website automatically
1212
- **Stable URLs**: Provides stable URLs for feeds generated by automatic sourcing
13+
- **Public Feed Access**: Secure, token-based public access to RSS feeds without authentication headers
1314
- **Custom Feeds**: [Create your custom feeds](https://html2rss.github.io/web-application/tutorials/building-feeds)!
1415
- **Pre-built Configs**: Comes with plenty of [included configs](https://html2rss.github.io/web-application/how-to/use-included-configs)
1516
- **Performance**: Handles request caching and sets caching-related HTTP headers
@@ -29,42 +30,99 @@ The application can be configured using environment variables. See the [configur
2930
### Security Features
3031

3132
- **URL Restrictions**: Public instances can restrict auto source to specific URLs
32-
- **Authentication**: Basic auth for auto source and health check endpoints
33+
- **Authentication**: Token-based authentication for auto source and health check endpoints
34+
- **Public Feed Access**: Secure, stateless feed tokens for public RSS access
35+
- **HMAC-SHA256 Signing**: Cryptographically signed tokens prevent tampering
36+
- **URL Binding**: Feed tokens are bound to specific URLs for security
3337
- **SSRF Protection**: Built-in protection against Server-Side Request Forgery
3438
- **Input Validation**: Comprehensive validation of all inputs
39+
- **XML Sanitization**: Prevents XML injection attacks in RSS output
40+
- **CSP Headers**: Content Security Policy headers prevent XSS attacks
41+
42+
## Public Feed Access
43+
44+
The application now supports secure public access to RSS feeds without requiring authentication headers. This is perfect for sharing feeds with RSS readers and other applications.
45+
46+
### How It Works
47+
48+
1. **Create a Feed**: Use the auto source feature to generate a feed
49+
2. **Get Public URL**: The system returns a public URL with an embedded token
50+
3. **Share the URL**: Anyone can access the feed using this URL
51+
4. **Secure Access**: The token is cryptographically signed and URL-bound
52+
53+
### Example
54+
55+
```bash
56+
# Create a feed
57+
curl -X POST "https://your-domain.com/auto_source/create" \
58+
-H "Authorization: Bearer your-token" \
59+
-d "url=https://example.com&name=Example Feed"
60+
61+
# Response includes public_url
62+
{
63+
"id": "abc123",
64+
"name": "Example Feed",
65+
"url": "https://example.com",
66+
"public_url": "/feeds/abc123?token=...&url=https%3A%2F%2Fexample.com"
67+
}
68+
69+
# Access the feed publicly
70+
curl "https://your-domain.com/feeds/abc123?token=...&url=https%3A%2F%2Fexample.com"
71+
```
72+
73+
### Security Features
74+
75+
- **10-Year Expiry**: Tokens are valid for 10 years (perfect for RSS)
76+
- **URL Binding**: Tokens only work for their specific URL
77+
- **HMAC Signing**: Tokens cannot be tampered with
78+
- **No Server Storage**: Stateless validation, no database required
3579

3680
## Documentation
3781

3882
For full documentation, please see the [html2rss-web documentation](https://html2rss.github.io/web-application/).
3983

40-
## Development
84+
### Security and Deployment
85+
86+
- [Security Guide](SECURITY.md) - Comprehensive security documentation
87+
- [Project Website](https://html2rss.github.io/html2rss-web/) - Deployment and usage instructions
4188

42-
### Quick Start with GitHub Codespaces
89+
## Quick Start
4390

44-
The easiest way to get started is using GitHub Codespaces:
91+
This application is designed to be used via Docker Compose only.
4592

46-
1. Fork this repository
47-
2. Click "Code" → "Codespaces" → "Create codespace on [your-username]/html2rss-web"
48-
3. Wait for the codespace to build (it will automatically run `bundle install`)
49-
4. The development server will be available at the forwarded port (usually 3000)
93+
### Prerequisites
5094

51-
### Local Development
95+
- Docker and Docker Compose installed
96+
- Git (to clone the repository)
5297

53-
1. **Clone and setup:**
98+
### Setup and Run
5499

100+
1. **Clone the repository:**
55101
```bash
56102
git clone https://github.com/html2rss/html2rss-web.git
57103
cd html2rss-web
58-
make setup
59104
```
60105

61-
2. **Start development server:**
106+
2. **Generate a secret key:**
107+
```bash
108+
openssl rand -hex 32
109+
```
110+
111+
3. **Configure docker-compose.yml:**
62112
```bash
63-
make dev
113+
# Edit the file and replace 'your-generated-secret-key-here' with your actual secret key
114+
# The docker-compose.yml file is already included in the repository
115+
```
116+
117+
4. **Start the application:**
118+
```bash
119+
docker-compose up
64120
```
65121

66122
The application will be available at `http://localhost:3000`.
67123

124+
**⚠️ Important**: The `HTML2RSS_SECRET_KEY` environment variable is required. Without it, the application will not start and will display setup instructions.
125+
68126
### Frontend Development
69127

70128
The project includes a modern Astro frontend alongside the Ruby backend:

0 commit comments

Comments
 (0)