You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+56-96Lines changed: 56 additions & 96 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,107 +4,92 @@ A simple, self-hosted RSS/Atom feed aggregator inspired by Netvibes & iGoogle, d
4
4
5
5
## Features
6
6
7
-
* Organize grids of feeds into customizable tabs, like Netvibes / iGoogle
8
-
* Import/Export tabs and feeds as OPML files (tested with exports from Netvibes).
9
-
* Add feeds via URL.
10
-
* Delete feeds.
11
-
* Create, rename, and delete tabs.
12
-
* Automatic background fetching of feed updates.
13
-
* Real-time UI updates when feeds are refreshed in the background, powered by Server-Sent Events (SSE).
14
-
* Mark items as read.
15
-
* Displays unread counts per feed and per tab.
16
-
* Basic persistence using a database.
7
+
***Feed Management**: Add, delete, and edit RSS/Atom feeds.
8
+
***Tabbed Organization**: Organize feeds into customizable tabs, similar to Netvibes and iGoogle.
9
+
***OPML Support**: Import and export your feeds and tabs as OPML files.
10
+
***Background Updates**: Automatically fetches feed updates in the background.
11
+
***Real-Time UI**: The user interface updates in real-time when feeds are refreshed, thanks to Server-Sent Events (SSE).
12
+
***Unread Tracking**: Mark items as read and see unread counts for each feed and tab.
13
+
***Persistence**: Your data is saved in a persistent database.
14
+
15
+
## Project Structure
16
+
17
+
*`.github/workflows/`: Contains GitHub Actions workflows for automated testing.
18
+
*`backend/`: The Python Flask backend.
19
+
*`app.py`: The main Flask application file, containing API endpoints and application logic.
20
+
*`feed_service.py`: Handles fetching, parsing, and processing of RSS/Atom feeds.
21
+
*`models.py`: Defines the database schema using SQLAlchemy.
22
+
*`test_app.py`, `test_feed.py`: Pytest tests for the backend.
23
+
*`frontend/`: The vanilla JavaScript frontend.
24
+
*`index.html`: The main HTML file.
25
+
*`script.js`: The main JavaScript file, containing all frontend logic.
26
+
*`style.css`: The stylesheet for the application.
27
+
*`pod/`: Contains files for deploying the application with Podman.
28
+
*`quadlet/`: Contains Quadlet files for managing the application with systemd.
29
+
*`scripts/`: Contains helper scripts for deployment and development.
17
30
18
31
## Production Deployment (Podman Pod with systemd using Quadlet)
19
32
20
33
This section describes how to deploy SheepVibes using a Podman Pod managed by systemd user services, leveraging Quadlet for easier unit file management.
21
34
22
35
### Prerequisites
23
36
24
-
-`podman` and `curl` installed (the deployment script will check for these).
25
-
- Git (optional, if you prefer to clone the repository).
26
-
- A modern version of Podman that includes Quadlet support.
37
+
*`podman` and `curl` installed.
38
+
* A modern version of Podman that includes Quadlet support.
39
+
* Git (optional, if you prefer to clone the repository).
27
40
28
41
### Setup Instructions
29
42
30
43
1.**Obtain the Deployment Script**:
31
-
32
-
For the stable version, always refer to the `main` branch:
Navigate to where you downloaded the script (or the repository root if cloned).
40
-
The script will fetch the necessary Quadlet unit files (e.g., `sheepvibespod.pod`, `sheepvibes-app.container`, `sheepvibes-db.volume`, etc.) from the `pod/quadlet/` directory in the GitHub repository (from the `main` branch, unless modified) and copy them to `~/.config/containers/systemd/`. Volume management is defined within these Quadlet files.
41
-
49
+
The script will download the necessary Quadlet files to `~/.config/containers/systemd/`.
42
50
```bash
43
-
chmod +x deploy_pod.sh# Or scripts/deploy_pod.sh if cloned
44
-
./deploy_pod.sh # Or scripts/deploy_pod.sh if cloned
51
+
chmod +x deploy_pod.sh
52
+
./deploy_pod.sh
45
53
```
46
-
The script will check for dependencies, guide you through the process, and inform you of the next steps.
47
54
48
55
3. **Manage the Service**:
49
56
After running the deployment script, you will be instructed to:
50
-
- Reload systemd to recognize the new Quadlet files and generate systemd services:
57
+
- Reload systemd to recognize the new Quadlet files:
51
58
```bash
52
59
systemctl --user daemon-reload
53
60
```
54
-
- Start the main pod service (which in turn starts all containers and creates volumes):
61
+
- Start the main pod service:
55
62
```bash
56
63
systemctl --user start sheepvibespod-pod.service
57
64
```
58
-
- Check the status of the pod and its components:
65
+
- Check the status of the pod:
59
66
```bash
60
67
systemctl --user status sheepvibespod-pod.service
61
-
systemctl --user status sheepvibes-app.service
62
-
systemctl --user status sheepvibes-redis.service
63
-
# You can also check the status of volume services (they are Type=oneshot)
64
-
systemctl --user status sheepvibes-db-volume.service
65
-
systemctl --user status sheepvibes-redis-data-volume.service
66
68
```
67
-
- View logs for the entire pod (follow):
69
+
- View logs for the entire pod:
68
70
```bash
69
71
journalctl --user -u sheepvibespod-pod.service -f
70
72
```
71
-
- View logs for a specific container (e.g., `sheepvibes-app`):
# Or for more detailed logs of just the app container's service:
75
-
journalctl --user -u sheepvibes-app.service -f
76
-
```
77
-
The `sheepvibes-redis` container runs within the same pod and is managed as part of `sheepvibespod-pod.service`. Network communication between the app and Redis occurs over `localhost` within the pod. Application data and Redis data are stored in Podman-managed volumes (e.g., `systemd-sheepvibes-db` and `systemd-sheepvibes-redis-data` by default), defined via `.volume` Quadlet files.
78
73
79
74
4. **Enable Auto-start (Optional)**:
80
-
The `pod/quadlet/sheepvibespod.pod` file includes an `[Install]` section with `WantedBy=default.target`. This means that after you run `systemctl --user daemon-reload` (as instructed by the `deploy_pod.sh` script), the main pod service (`sheepvibespod-pod.service`) is automatically configured to start when your user session begins.
81
-
82
-
No separate `systemctl --user enable sheepvibespod-pod.service`command is needed, and attempting to run it on the generated service will result in an error.
83
-
84
-
To verify auto-start, you can log out and log back in. The service should start automatically.
85
-
86
-
*Note on system boot*: For user services to start automatically when the system boots (i.e., without requiring an interactive login for that user), you may need to enable lingering for your user. This typically requires root privileges:
75
+
The `pod/quadlet/sheepvibespod.pod` file includes an `[Install]` section that enables the service to start automatically with your user session. For the service to start at boot (without requiring a login), you may need to enable lingering for your user:
87
76
```bash
88
77
sudo loginctl enable-linger $(whoami)
89
78
```
90
79
91
80
### Accessing the Application
92
81
93
-
Once started, the application will be accessible at `http://127.0.0.1:5000` by default. This is configured by the `PublishPort` setting in the `[Pod]` section of the `pod/quadlet/sheepvibespod.pod` file. If you need to access it from other machines, you might need to:
94
-
1. Adjust firewall settings on your server.
95
-
2. Modify the `PublishPort` setting in the `pod/quadlet/sheepvibespod.pod` file (e.g., change to `0.0.0.0:5000:5000`).
96
-
- If you modify it *before* running `deploy_pod.sh` (e.g., in a cloned repository), the script will use your modified version if it's fetching from your local clone or a specific branch.
97
-
- If you modify it *after* deployment by editing `~/.config/containers/systemd/sheepvibespod.pod`, you'll need to run `systemctl --user daemon-reload && systemctl --user restart sheepvibespod-pod.service`.
82
+
Once started, the application will be accessible at `http://127.0.0.1:5000` by default. To access the application from other machines, you may need to modify the `PublishPort` setting in`~/.config/containers/systemd/sheepvibespod.pod` (e.g., to `0.0.0.0:5000:5000`) and then run `systemctl --user daemon-reload && systemctl --user restart sheepvibespod-pod.service`.
98
83
99
84
## Local Development
100
85
101
-
This section describes how to set up SheepVibes forlocal development and testing. This typically involves cloning the repository to get all source files and the `Containerfile`.
86
+
This section describes how to set up SheepVibes forlocal development.
102
87
103
88
### Prerequisites
104
89
105
-
- Podman installed.
106
-
- Git.
107
-
- Python environment (optional, for direct backend/frontend work without containers).
90
+
* Podman
91
+
*Git
92
+
* Python 3 and `pip`
108
93
109
94
### Building the Container
110
95
@@ -115,16 +100,14 @@ This section describes how to set up SheepVibes for local development and testin
115
100
```
116
101
117
102
2. **Build the Image**:
118
-
Build the application image using the `Containerfile`:
# Make sure it's executable first: chmod +x scripts/rebuild_container.sh
125
108
./scripts/rebuild_container.sh
126
109
```
127
-
After rebuilding the image, if you are using systemd forproduction, you must restart the service to use the new image: `systemctl --user restart sheepvibespod-pod.service` (this will recreate containers with the updated image if their `Pull` policy allows or if the image tag changed and Quadlet detects it). Podman typically restarts containers with the newest image version if the image name/tagin the `.container` file is `:latest` and the image is updated locally.
110
+
After rebuilding the image, if you are using systemd for production, you must restart the service to use the new image: `systemctl --user restart sheepvibespod-pod.service`.
128
111
129
112
### Running Locally with Podman
130
113
@@ -139,12 +122,8 @@ This section describes how to set up SheepVibes for local development and testin
139
122
```
140
123
141
124
3. **Run the Application Container**:
142
-
Create a local directory for the database:
143
125
```bash
144
126
mkdir -p ./dev_data
145
-
```
146
-
Run the application container, linking it to Redis and mounting the local data directory:
147
-
```bash
148
127
podman run -d --name sheepvibes-app-dev \
149
128
--network sheepvibes-dev-network \
150
129
-p 127.0.0.1:5001:5000 \
@@ -157,55 +136,36 @@ This section describes how to set up SheepVibes for local development and testin
157
136
-e FLASK_RUN_HOST=0.0.0.0 \
158
137
localhost/sheepvibes-app
159
138
```
160
-
You can then access the app at `http://127.0.0.1:5001`. Logs can be viewed with `podman logs sheepvibes-app-dev`.
161
-
162
-
4. **Using `run_dev.sh` (Alternative)**:
163
-
The `scripts/run_dev.sh` script provides a way to manage the local development containers. Review and modify it as needed for your local setup.
164
-
*(Note: You might need to update `scripts/run_dev.sh`if it's outdated or doesn't match the above setup. The script primarily focuses on running the backend directly without containers for faster iteration).*
139
+
The app will be accessible at `http://127.0.0.1:5001`.
165
140
166
141
### Direct Backend/Frontend Development
167
142
168
-
This section is fordevelopers who want to work on the Python backend or JavaScript frontend directly, without running the full applicationin Podman.
169
-
170
-
1. **Prerequisites:**
171
-
* Ensure you have Python 3, `pip`, and a running Redis server (e.g., `podman run -d --name sheepvibes-redis-direct -p 127.0.0.1:6379:6379 redis:alpine`).
143
+
1. **Prerequisites**:
144
+
* A running Redis server.
172
145
173
-
2. **Set up Backend Virtual Environment (requires cloning the repo):**
146
+
2. **Set up Backend Virtual Environment**:
174
147
* Navigate to the `backend` directory: `cd sheepvibes/backend`
175
148
* Create a virtual environment: `python -m venv venv`
176
-
* Activate it: `source venv/bin/activate` (or `venv\Scripts\activate` on Windows)
3. **Run the Development Server (Flask Backend - requires cloning the repo):**
180
-
The `scripts/run_dev.sh` script can start the Flask backend server directly.
181
-
Ensure `CACHE_REDIS_URL` is set, e.g. `export CACHE_REDIS_URL=redis://localhost:6379/0`
152
+
3. **Run the Development Server**:
153
+
The `scripts/run_dev.sh` script can start the Flask backend server.
182
154
```bash
183
-
# from the repository root (e.g., cd sheepvibes)
184
155
./scripts/run_dev.sh
185
156
```
186
-
This will typically start the backend on `http://127.0.0.1:5000` (or as configured). The frontend is served statically by Flask in this mode.
187
157
188
158
## Configuration (Environment Variables)
189
159
190
-
You can configure the application by passing environment variables.
191
-
- When deploying with systemd using Quadlet (via `deploy_pod.sh`), the script downloads a set of default Quadlet files (e.g., `sheepvibes-app.container`, `sheepvibespod.pod`) from `pod/quadlet/`. To customize environment variables for the application:
192
-
1. Modify the `Environment=` lines within the `pod/quadlet/sheepvibes-app.container` file (or your local copy at `~/.config/containers/systemd/sheepvibes-app.container` after deployment).
193
-
2. After modification, run `systemctl --user daemon-reload && systemctl --user restart sheepvibespod-pod.service`.
194
-
- When using `podman run` directly, use the `-e` flag.
195
-
- When running the backend directly, set them in your shell environment.
196
-
197
-
*`DATABASE_PATH`: The full path *inside the container* (or on the host if running directly) where the SQLite database file should be stored. Defaults to `/app/data/sheepvibes.db` (container) or `backend/sheepvibes.db` (direct script). This path is relative to the volume mount specified in`sheepvibes-app.container`.
198
-
*`UPDATE_INTERVAL_MINUTES`: The interval (in minutes) at which the application checks feeds for updates. Defaults to `15`.
199
-
*`CACHE_REDIS_URL`: The connection URL for the Redis server.
200
-
* Pod default (from `sheepvibes-app.container`): `redis://localhost:6379/0` (since Redis is in the same pod).
201
-
*`podman run` dev example: `redis://sheepvibes-redis-dev:6379/0`
202
-
* Direct script: `redis://localhost:6379/0` (if Redis is on host)
203
-
*`FLASK_APP`: Path to the Flask application. Defaults to `backend.app`.
204
-
*`PYTHONPATH`: Python module search path. Defaults to `/app`in container.
205
-
*`FLASK_RUN_HOST`: Host for Flask development server. Defaults to `0.0.0.0` to be accessible.
160
+
*`DATABASE_PATH`: The path to the SQLite database file.
161
+
*`UPDATE_INTERVAL_MINUTES`: The interval in minutes for checking for feed updates.
162
+
*`CACHE_REDIS_URL`: The URL for the Redis server.
163
+
*`FLASK_APP`: The path to the Flask application.
164
+
*`PYTHONPATH`: The Python module search path.
165
+
*`FLASK_RUN_HOST`: The host for the Flask development server.
206
166
207
167
## Contributing
208
-
(Contributions are welcome. Please open an issue or PR.)
168
+
Contributions are welcome. Please open an issue or pull request.
209
169
210
170
## License
211
-
(This project is under a GNU General Public License v3.0 License)
171
+
This project is licensed under the GNU General Public License v3.0.
0 commit comments