Added PostgreSQL RDS database. Added channels protected endpoints. Added scripts and docker config to run application locally in dev mode.
Some checks failed
AWS Deploy on Push / build (push) Failing after 41s
Some checks failed
AWS Deploy on Push / build (push) Failing after 41s
This commit is contained in:
151
README.md
151
README.md
@@ -1,133 +1,44 @@
|
||||
# IPTV Management System
|
||||
# Roo Commander Build - v{BUILD_VERSION} ({BUILD_CODENAME})
|
||||
|
||||
**Status**: Actively in development ⚠️
|
||||
**Build Date:** {BUILD_DATE}
|
||||
|
||||
A modern IPTV management system that leverages AWS Cognito for secure user authentication and provides tools for EPG generation, stream validation, and cloud deployment via AWS CDK. It automatically provisions infrastructure, including an EC2 instance running the application behind Nginx, and uses `acme.sh` with FreeDNS for automated SSL certificate management.
|
||||
## Overview
|
||||
|
||||
## Key Features
|
||||
This archive contains the configuration files for Roo Commander, a system designed to enhance AI-assisted software development within VS Code.
|
||||
|
||||
✅ **Implemented**
|
||||
## Installation
|
||||
|
||||
- **User Authentication**:
|
||||
- AWS Cognito integration for secure user sign-in
|
||||
- JWT token generation & validation
|
||||
- Role-based access control (RBAC) with the [`require_roles`](app/auth/dependencies.py) decorator
|
||||
(_Endpoints include both general and admin-protected routes_)
|
||||
1. **Ensure you are in your desired VS Code workspace root directory.** This is the top-level folder of the project you want Roo Commander to assist with.
|
||||
2. **Extract the contents of this zip archive directly into your workspace root.**
|
||||
|
||||
- **Stream & EPG Management**:
|
||||
- EPG generation from M3U8 playlists ([`app/iptv/createEpg.py`](app/iptv/createEpg.py))
|
||||
- Playlist creation utility ([`app/iptv/createPlaylist.py`](app/iptv/createPlaylist.py))
|
||||
- Stream validation tooling ([`app/utils/check_streams.py`](app/utils/check_streams.py))
|
||||
This will create/overwrite the following hidden directories and files:
|
||||
|
||||
- **Deployment & Infrastructure**:
|
||||
- Infrastructure provisioning using AWS CDK ([`app.py`](app.py), [`infrastructure/stack.py`](infrastructure/stack.py))
|
||||
- Automated SSL certificate provisioning using `acme.sh` and FreeDNS DNS API.
|
||||
- Nginx configured as a reverse proxy with SSL termination.
|
||||
- Deployment scripts to deploy/destroy the stack and update running instances ([`scripts/deploy.sh`](scripts/deploy.sh), [`scripts/destroy.sh`](scripts/destroy.sh))
|
||||
- Environment configuration driven by a `.env` file ([`.env`](.env), [.env.example](.env.example))
|
||||
- Gitea Actions workflow for automated deployment on push ([`.gitea/workflows/aws_deploy_on_push.yml`](.gitea/workflows/aws_deploy_on_push.yml)), compatible with minor changes for GitHub Actions.
|
||||
* `.ruru/modes/` (Contains all mode definitions)
|
||||
* `.ruru/processes/` (Contains standard process definitions)
|
||||
* `.roo/` (Contains Roo Commander specific rules and configurations)
|
||||
* `.ruru/templates/` (Contains templates for various artifacts)
|
||||
* `.ruru/workflows/` (Contains workflow definitions)
|
||||
* `.ruru/archive/` (Empty placeholder)
|
||||
* `.ruru/context/` (Empty placeholder)
|
||||
* `.ruru/decisions/` (Empty placeholder)
|
||||
* `.ruru/docs/` (Empty placeholder)
|
||||
* `.ruru/ideas/` (Empty placeholder)
|
||||
* `.ruru/logs/` (Empty placeholder)
|
||||
* `.ruru/planning/` (Empty placeholder)
|
||||
* `.ruru/reports/` (Empty placeholder)
|
||||
* `.ruru/snippets/` (Empty placeholder)
|
||||
* `.ruru/tasks/` (Empty placeholder)
|
||||
* `build_mode_summary.js`
|
||||
* `build_roomodes.js`
|
||||
* `LICENSE`
|
||||
* `.roomodes`
|
||||
|
||||
🛠️ **In Progress**
|
||||
|
||||
- User management interface and additional API endpoints
|
||||
- Automated EPG updates and playlist management endpoints
|
||||
- Refresh token implementation and enhanced security features
|
||||
- Comprehensive API documentation
|
||||
|
||||
## Installation & Deployment
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- AWS Account and configured AWS CLI credentials.
|
||||
- Node.js and npm installed (for AWS CDK).
|
||||
- Python 3.8+ and pip installed.
|
||||
- `uv` installed (`pip install uv`).
|
||||
- A domain name hosted on FreeDNS.
|
||||
- FreeDNS API credentials (username and password).
|
||||
- An email address for Let's Encrypt registration.
|
||||
- An SSH public key to access the EC2 instance.
|
||||
|
||||
### Local Setup
|
||||
|
||||
1. **Clone the repository:**
|
||||
|
||||
```bash
|
||||
git clone [repository-url]
|
||||
cd iptv-updater-aws
|
||||
```
|
||||
|
||||
2. **Set up the virtual environment:**
|
||||
|
||||
```bash
|
||||
uv venv .venv
|
||||
source .venv/bin/activate
|
||||
uv pip install -r requirements.txt
|
||||
```
|
||||
|
||||
3. **Configure environment variables:**
|
||||
|
||||
Copy [.env.example](.env.example) to `.env` and update the credentials and domain information. You will need to provide:
|
||||
- `FREEDNS_User`: Your FreeDNS username.
|
||||
- `FREEDNS_Password`: Your FreeDNS password.
|
||||
- `DOMAIN_NAME`: Your domain name registered with FreeDNS.
|
||||
- `SSH_PUBLIC_KEY`: Your SSH public key string.
|
||||
- `REPO_URL`: The URL of this git repository.
|
||||
- `LETSENCRYPT_EMAIL`: The email address for Let's Encrypt notifications.
|
||||
|
||||
### Deploying Infrastructure
|
||||
|
||||
The project uses AWS CDK to provision the required AWS resources.
|
||||
|
||||
1. **Install dependencies and CDK globally:**
|
||||
|
||||
```bash
|
||||
./install.sh
|
||||
```
|
||||
|
||||
2. **Deploy the stack:**
|
||||
|
||||
```bash
|
||||
./scripts/deploy.sh
|
||||
```
|
||||
|
||||
This script will read variables from your `.env` file, synthesize the CDK stack, deploy it to AWS, and then use AWS SSM to update the application code on the newly created EC2 instance. The EC2 instance's userdata script will handle the installation of dependencies, Nginx, `acme.sh`, and the initial certificate provisioning using the FreeDNS API credentials passed via environment variables.
|
||||
|
||||
3. **Update application on running instances:**
|
||||
|
||||
The deployment script ([`scripts/deploy.sh`](scripts/deploy.sh)) automatically updates the application code on running instances after the initial deployment. You can re-run this script to pull the latest code and restart the service without destroying and recreating the infrastructure.
|
||||
|
||||
4. **Destroy the stack:**
|
||||
|
||||
```bash
|
||||
./scripts/destroy.sh
|
||||
```
|
||||
|
||||
This script will read variables from your `.env` file and destroy all resources created by the CDK stack.
|
||||
|
||||
### Automated Deployment (Gitea Actions)
|
||||
|
||||
The repository includes a Gitea Actions workflow definition at [`.gitea/workflows/aws_deploy_on_push.yml`](.gitea/workflows/aws_deploy_on_push.yml). This workflow is triggered on pushes to the `main` branch and automates the deployment process using AWS CDK and SSM. This workflow is largely compatible with GitHub Actions with minimal modifications.
|
||||
|
||||
To use the automated deployment:
|
||||
|
||||
1. Configure the required secrets (`AWS_ACCESS_KEY`, `AWS_SECRET_KEY`, `FREEDNS_USER`, `FREEDNS_PASSWORD`, `DOMAIN_NAME`, `SSH_PUBLIC_KEY`, `REPO_URL`, `LETSENCRYPT_EMAIL`) in your Gitea repository settings.
|
||||
2. Push changes to the `main` branch.
|
||||
**Important:** Extracting these files may overwrite existing configurations if you have previously set up Roo Commander.
|
||||
|
||||
## Usage
|
||||
|
||||
- **API Endpoints**: The application will be accessible via HTTPS on your configured domain name.
|
||||
- Sign-in: `/signin`
|
||||
- Protected endpoints: `/protected` and `/protected_admin`
|
||||
Once extracted, Roo Commander should be active within your VS Code workspace (you might need to reload the window). You can interact with it via the chat interface.
|
||||
|
||||
- **EPG & Playlist Generation**:
|
||||
- Create playlists using [`app/iptv/createPlaylist.py`](app/iptv/createPlaylist.py)
|
||||
- Generate EPG data using [`app/iptv/createEpg.py`](app/iptv/createEpg.py)
|
||||
## Changelog
|
||||
|
||||
- **Stream Validation**:
|
||||
- Validate stream URLs using the utility ([`app/utils/check_streams.py`](app/utils/check_streams.py))
|
||||
|
||||
## Notes
|
||||
|
||||
- This project is under active development. Expect additional functionality and improvements in upcoming releases.
|
||||
- For deployment details and troubleshooting, refer to the deployment scripts and AWS CDK documentation.
|
||||
- Ensure your FreeDNS API credentials and domain name are correctly configured in the `.env` file for `acme.sh` to function correctly.
|
||||
Please refer to `CHANGELOG.md` (included in this archive) for details on what's new in this version.
|
||||
Reference in New Issue
Block a user