From ef8655b886fa6910b2cf59a5dc3f8f2bd9dbe5c3 Mon Sep 17 00:00:00 2001 From: lelo Date: Sun, 8 Jun 2025 23:05:46 +0200 Subject: [PATCH] add example configuration file --- example_config_files/.env | 2 + example_config_files/app_config.json | 12 ++ example_config_files/folder_mount_config.json | 37 +++++ .../folder_secret_config.json | 26 ++++ example_config_files/transcription_config.yml | 7 + readme.md | 145 ++++++++++++++++++ 6 files changed, 229 insertions(+) create mode 100644 example_config_files/.env create mode 100644 example_config_files/app_config.json create mode 100644 example_config_files/folder_mount_config.json create mode 100644 example_config_files/folder_secret_config.json create mode 100644 example_config_files/transcription_config.yml create mode 100644 readme.md diff --git a/example_config_files/.env b/example_config_files/.env new file mode 100644 index 0000000..0d510b7 --- /dev/null +++ b/example_config_files/.env @@ -0,0 +1,2 @@ +CONTAINER_NAME=bethaus-app +HOST_RULE=Host(`your-app-domain.de`) diff --git a/example_config_files/app_config.json b/example_config_files/app_config.json new file mode 100644 index 0000000..d2a6010 --- /dev/null +++ b/example_config_files/app_config.json @@ -0,0 +1,12 @@ +{ + "SECRET_KEY": "THIS_IS_USED_TO_CREATE_SESSIONS", + "SALT": "THIS_IS_USED_TO_CREATE_TOKENS", + "ADMIN_KEY": "THIS_IS_USED_TO_AUTHENTICATE_ADMIN", + "TITLE_SHORT": "Gottesdienste", + "TITLE_LONG": "Gottesdienste App", + "BASE_DIR": "/mnt", + "filecache_size_limit_audio": 16, + "filecache_size_limit_image": 16, + "filecache_size_limit_video": 16, + "filecache_size_limit_other": 16 +} \ No newline at end of file diff --git a/example_config_files/folder_mount_config.json b/example_config_files/folder_mount_config.json new file mode 100644 index 0000000..8ef977c --- /dev/null +++ b/example_config_files/folder_mount_config.json @@ -0,0 +1,37 @@ +{ + "SERVER1": { + "SSH_USER": "root", + "SSH_SERVER": "your-first-site.de", + "SSH_SERVER_PORT": 1122, + "REMOTE_NFS_PORT": 2049, + "LOCAL_PORT_BASE": 2022, + "MOUNT_POINTS": [ + "/mnt/Gottesdienste", + "/mnt/Jugendgottesdienste", + "/mnt/Liedersammlung", + "/mnt/Hochzeiten" + ], + "NFS_SHARES": [ + "/volume2/Aufnahme-stereo/010 Gottesdienste", + "/volume2/Jugend/Gottesdienste Archiv", + "/volume2/Aufnahme-stereo/014 Liedersammlung", + "/volume2/Aufnahme-stereo/021 Hochzeiten" + ] + }, + "SERVER2": { + "SSH_USER": "root", + "SSH_SERVER": "your-second-site.de", + "SSH_SERVER_PORT": 1122, + "REMOTE_NFS_PORT": 2049, + "LOCAL_PORT_BASE": 3022, + "MOUNT_POINTS": [ + "/mnt/Gottesdienste", + "/mnt/Hochzeiten" + ], + "NFS_SHARES": [ + "/volume1/Aufnahme/010 Gottesdienste", + "/volume1/Aufnahme/020 Hochzeiten" + ] + } + } + \ No newline at end of file diff --git a/example_config_files/folder_secret_config.json b/example_config_files/folder_secret_config.json new file mode 100644 index 0000000..8acf62e --- /dev/null +++ b/example_config_files/folder_secret_config.json @@ -0,0 +1,26 @@ +[ + { + "secret": "Up741PkSVTTbXsDjd0OVjfbBmM3ggcYV", + "validity": "31.07.2025", + "folders": [ + { + "foldername": "Gottesdienste", + "folderpath": "/mnt/Gottesdienste" + }, + { + "foldername": "Jugendgottesdienste", + "folderpath": "/mnt/Jugendgottesdienste" + } + ] + }, + { + "secret": "PstSQSkfVT6r2CScEWyupqVAfVCDR6aq", + "validity": "21.08.2025", + "folders": [ + { + "foldername": "Missionskonferenz", + "folderpath": "/mnt/Missionskonferenz" + } + ] + } +] \ No newline at end of file diff --git a/example_config_files/transcription_config.yml b/example_config_files/transcription_config.yml new file mode 100644 index 0000000..884e77d --- /dev/null +++ b/example_config_files/transcription_config.yml @@ -0,0 +1,7 @@ +model_name: "medium" +gpu_only: false + +folder_list: + # Windows path example + - "\\\\10.1.0.11\\Aufnahme-stereo\\010 Gottesdienste ARCHIV" + - "\\\\10.1.0.11\\Jugend\\Gottesdienste Archiv" diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..fb8a0bb --- /dev/null +++ b/readme.md @@ -0,0 +1,145 @@ +# Media Sharing App + +This is a self-hosted media sharing and indexing platform designed for secure and flexible file sharing. Originally created to serve specific community needs, it is now made available for general use under an open-source license. The application supports file access via time-limited secret links, metadata indexing, and transcription-based search. + +## Features + +- **Secret Link Sharing** + Share folders via unique URLs with expiration dates. Two levels of sharing: + - **Primary Folders (Secret Links):** Centralized configuration with full admin control. Suitable for public events. + - **Subfolders (Token Links):** Can be shared ad hoc, without central admin access. Ideal for limited-audience events. + +- **Transcription and Search** + - Local transcription of audio files + - Full-text search through transcripts + - Daily indexing for search via cron job required + +- **Caching and Performance** + - Data is fetched from a remote network storage via SSH + - Server side caching for fast repeat access + - Automatic cache invalidation for unused files + +- **Privacy-Aware Analytics** + - Anonymous access logging (no IP address storage) + +## Requirements + +- **Domain/Subdomain** for app access +- **Dynamic DNS** for local network tunnel access +- **Local Network Storage** (Linux server or NAS with SSH and NFS support) +- **Virtual Private Server (VPS)** with: + - Docker + - SSH + - NFS + - Cron + +## System Architecture + +```plaintext + ┌───────────────────────────┐ + │ Web Browser │ + │ (User / Admin Interface) │ + └────────────┬──────────────┘ + │ + ┌────────────▼──────────────┐ + │ HTTPS (Secret Link) │ + │ (Traefik) │ + └────────────┬──────────────┘ + │ + ┌────────────▼──────────────┐ + │ Flask App (VPS) │ + │ Routing Layer │ + └────────────┬──────────────┘ + │ + ┌────────────▼─────────────┐ + │ │ + ┌────────▼────────┐ ┌────────▼─────────┐ + │ User Views / │ │ Admin Interface │ + │ Token Logic │ │ (Protected Link)│ + └────────┬────────┘ └────────┬─────────┘ + │ │ + ┌───────▼──────────────────────────▼──────┐ + │ Link Validation & Expiry Logic │ + └───────────────────┬─────────────────────┘ + │ + ┌─────────────▼──────────────┐ + │ Caching Layer │ + │ (Local file cache) │ + └─────────────┬──────────────┘ + │ + ┌─────────────▼──────────────┐ + │ SSH Tunnel to Storage │ + │ (NAS or Linux Server) │ + └─────────────┬──────────────┘ + │ + ┌─────────────▼──────────────┐ ┌─────────────────────────────┐ + │ Local File System │◄─────┤ Media File Transcriber (PC) │ + └─────────────┬──────────────┘ └─────────────────────────────┘ + │ + ┌─────────────▼──────────────┐ + │ Daily Cron Service │ + │ - Index Filesystem │ + │ - Index Transcription │ + └─────────────┬──────────────┘ + │ + ┌─────────▼──────────┐ + │ Search Engine │ + └────────────────────┘ +``` + +- Files are served over an SSH tunnel from NAS to the VPS. +- Caching and indexing are performed on the VPS for performance. +- Admin and user features are activated via special access links. + +## Setup Instructions + +### 1. Clone the Repository to your VPS + +```bash +git clone https://gitea.centx.de/lelo/bethaus-app +cd your-app +``` + +### 2. Configure Your Environment + +Copy example config files and customize them for your setup: + +```bash +cd your-app +cd example_config_files +cp * ../ +``` + +### 3. Change Configurations + +- `.env` + Used by Docker Compose to manage environment variables. + +- `app_config.json` + General settings including search, link expiration, and admin key. + **Important:** Replace default keys with strong random strings and keep them secret. + +- `folder_mount_config.json` + Used if you set up `cron` to auto-mount folders. + +- `folder_secret_config.json` + Contains paths and secrets to the shared folders. + Add your first entry manually, then use the admin UI for further setup. + +- `transcription_config.yml` + Required for local transcription. Adjust based on your tools and resources. + +### 4. Launch the App + +```bash +docker compose up -d +``` + +### 5. Admin Access + +To unlock administrative controls on your device, use the dedicated admin access link. + +## Contribution + +This app is under active development and contributions are welcome. +If you'd like to adapt it for your own community or project, feel free to fork the repo and reach out for setup help.