mirror of
https://github.com/pacnpal/simpleguardhome.git
synced 2025-12-20 04:21:13 -05:00
feat(docker): update Docker build workflow and enhance README with installation instructions and static file support
This commit is contained in:
2
.github/workflows/docker-build.yml
vendored
2
.github/workflows/docker-build.yml
vendored
@@ -51,12 +51,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
images: ${{ secrets.DOCKERHUB_USERNAME }}/simpleguardhome
|
images: ${{ secrets.DOCKERHUB_USERNAME }}/simpleguardhome
|
||||||
tags: |
|
tags: |
|
||||||
|
type=raw,value=latest,enable={{is_default_branch}}
|
||||||
type=sha,format=long
|
type=sha,format=long
|
||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
type=ref,event=pr
|
type=ref,event=pr
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
type=ref,event=latest
|
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
|
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
|
||||||
|
|||||||
97
README.md
97
README.md
@@ -1,7 +1,30 @@
|
|||||||
# SimpleGuardHome
|
<p align="center">
|
||||||
|
<img src="static/simpleguardhome.png" alt="SimpleGuardHome Logo" width="200">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h1 align="center">SimpleGuardHome</h1>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://github.com/pacnpal/simpleguardhome/releases"><img src="https://img.shields.io/badge/version-0.1.0-blue.svg" alt="Version 0.1.0"></a>
|
||||||
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="MIT License"></a>
|
||||||
|
<a href="#requirements"><img src="https://img.shields.io/badge/python-3.9+-blue.svg" alt="Python 3.9+"></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
A modern web application for checking and managing domain filtering in AdGuard Home. Built with FastAPI and modern JavaScript, following the official AdGuard Home OpenAPI specification.
|
A modern web application for checking and managing domain filtering in AdGuard Home. Built with FastAPI and modern JavaScript, following the official AdGuard Home OpenAPI specification.
|
||||||
|
|
||||||
|
## Quick Start
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Using Docker
|
||||||
|
docker run -d -p 8000:8000 -e ADGUARD_HOST=http://localhost -e ADGUARD_PORT=3000 pacnpal/simpleguardhome:latest
|
||||||
|
|
||||||
|
# Or using Python
|
||||||
|
pip install simpleguardhome
|
||||||
|
python -m uvicorn simpleguardhome.main:app --port 8000
|
||||||
|
```
|
||||||
|
|
||||||
|
Then visit `http://localhost:8000` to start managing your AdGuard Home filtering.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- 🔍 Real-time domain filtering status checks
|
- 🔍 Real-time domain filtering status checks
|
||||||
@@ -13,18 +36,79 @@ A modern web application for checking and managing domain filtering in AdGuard H
|
|||||||
- ⚙️ Environment-based configuration
|
- ⚙️ Environment-based configuration
|
||||||
- 📚 Full OpenAPI/Swagger documentation
|
- 📚 Full OpenAPI/Swagger documentation
|
||||||
- ✅ Implements official AdGuard Home API spec
|
- ✅ Implements official AdGuard Home API spec
|
||||||
|
- 🐳 Docker support
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- Python 3.9 or higher
|
### System Requirements
|
||||||
|
- Python 3.9 or higher (for local installation)
|
||||||
- Running AdGuard Home instance
|
- Running AdGuard Home instance
|
||||||
- AdGuard Home API credentials (if authentication is enabled)
|
- AdGuard Home API credentials (if authentication is enabled)
|
||||||
|
- Docker (optional, for containerized deployment)
|
||||||
|
|
||||||
## Installation
|
### Python Dependencies
|
||||||
|
- FastAPI - Web framework for building APIs
|
||||||
|
- Uvicorn - ASGI server implementation
|
||||||
|
- Python-dotenv - Environment variable management
|
||||||
|
- HTTPX - Modern HTTP client
|
||||||
|
- Pydantic - Data validation using Python type annotations
|
||||||
|
- Jinja2 - Template engine for the web interface
|
||||||
|
|
||||||
|
## Docker Installation
|
||||||
|
|
||||||
|
The easiest way to get started is using Docker:
|
||||||
|
|
||||||
|
1. Pull the Docker image:
|
||||||
|
```bash
|
||||||
|
docker pull pacnpal/simpleguardhome:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Create a `.env` file with your AdGuard Home settings:
|
||||||
|
```env
|
||||||
|
ADGUARD_HOST=http://localhost # AdGuard Home host URL
|
||||||
|
ADGUARD_PORT=3000 # AdGuard Home API port
|
||||||
|
ADGUARD_USERNAME=admin # Optional: AdGuard Home username
|
||||||
|
ADGUARD_PASSWORD=password # Optional: AdGuard Home password
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Run the container:
|
||||||
|
```bash
|
||||||
|
docker run -d \
|
||||||
|
--name simpleguardhome \
|
||||||
|
-p 8000:8000 \
|
||||||
|
--env-file .env \
|
||||||
|
pacnpal/simpleguardhome:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
The application will be available at `http://localhost:8000`
|
||||||
|
|
||||||
|
### Docker Compose
|
||||||
|
|
||||||
|
Alternatively, you can use Docker Compose. Create a `docker-compose.yml` file:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
simpleguardhome:
|
||||||
|
image: pacnpal/simpleguardhome:latest
|
||||||
|
container_name: simpleguardhome
|
||||||
|
ports:
|
||||||
|
- "8000:8000"
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
restart: unless-stopped
|
||||||
|
```
|
||||||
|
|
||||||
|
Then run:
|
||||||
|
```bash
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
## Local Installation
|
||||||
|
|
||||||
1. Clone this repository:
|
1. Clone this repository:
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/yourusername/simpleguardhome.git
|
git clone https://github.com/pacnpal/simpleguardhome.git
|
||||||
cd simpleguardhome
|
cd simpleguardhome
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -56,6 +140,7 @@ ADGUARD_PASSWORD=password # Optional: AdGuard Home password
|
|||||||
|
|
||||||
## Running the Application
|
## Running the Application
|
||||||
|
|
||||||
|
### Local Development
|
||||||
Start the application:
|
Start the application:
|
||||||
```bash
|
```bash
|
||||||
python -m uvicorn src.simpleguardhome.main:app --reload
|
python -m uvicorn src.simpleguardhome.main:app --reload
|
||||||
@@ -151,9 +236,13 @@ simpleguardhome/
|
|||||||
│ ├── adguard.py # AdGuard Home API client
|
│ ├── adguard.py # AdGuard Home API client
|
||||||
│ └── templates/
|
│ └── templates/
|
||||||
│ └── index.html # Web interface
|
│ └── index.html # Web interface
|
||||||
|
├── static/
|
||||||
|
│ └── simpleguardhome.png # Project logo
|
||||||
├── requirements.txt
|
├── requirements.txt
|
||||||
├── setup.py
|
├── setup.py
|
||||||
├── .env.example
|
├── .env.example
|
||||||
|
├── Dockerfile
|
||||||
|
├── docker-compose.yml
|
||||||
└── README.md
|
└── README.md
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
BIN
src/simpleguardhome/favicon.ico
Normal file
BIN
src/simpleguardhome/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
@@ -44,10 +44,16 @@ app.add_middleware(
|
|||||||
expose_headers=["X-Request-ID"]
|
expose_headers=["X-Request-ID"]
|
||||||
)
|
)
|
||||||
|
|
||||||
# Setup templates directory
|
# Setup templates and static directories
|
||||||
templates_path = Path(__file__).parent / "templates"
|
templates_path = Path(__file__).parent / "templates"
|
||||||
templates = Jinja2Templates(directory=str(templates_path))
|
templates = Jinja2Templates(directory=str(templates_path))
|
||||||
|
|
||||||
|
# Mount static files from package directory
|
||||||
|
app.mount("/static", StaticFiles(directory=str(Path(__file__).parent)), name="static")
|
||||||
|
|
||||||
|
# Mount favicon.ico at root
|
||||||
|
app.mount("/favicon.ico", StaticFiles(directory=str(Path(__file__).parent), files={"favicon.ico": "favicon.ico"}), name="favicon")
|
||||||
|
|
||||||
# Response models matching AdGuard spec
|
# Response models matching AdGuard spec
|
||||||
class ErrorResponse(BaseModel):
|
class ErrorResponse(BaseModel):
|
||||||
"""Error response model according to AdGuard spec."""
|
"""Error response model according to AdGuard spec."""
|
||||||
|
|||||||
BIN
static/simpleguardhome.png
Normal file
BIN
static/simpleguardhome.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
Reference in New Issue
Block a user