diff --git a/fleetledger/.env-example b/.env-example similarity index 100% rename from fleetledger/.env-example rename to .env-example diff --git a/.gitignore b/.gitignore index e4d7f54..4c49bd7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ .env -fleetledger/.env diff --git a/fleetledger/Dockerfile b/Dockerfile similarity index 100% rename from fleetledger/Dockerfile rename to Dockerfile diff --git a/README.md b/README.md index e69de29..bcf64fc 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,86 @@ +# FleetLedger + +FleetLedger is a small self-hosted web app to keep track of your rented servers: + +- VPS, dedicated servers, storage boxes, managed services +- Provider, location, IPs, hardware +- Monthly / yearly pricing and contract dates +- Simple access info (management URLs, SSH user + key hint) +- Multi-user support with per-user data separation +- Admin user management (activate / deactivate users) +- Dark-mode-first UI with PWA support (installable as an app) +- Per-user **map view** for server locations +- Admin **global dashboard** for fleet-wide stats + +> **Security note:** FleetLedger is *not* a full password manager. +> It is intentionally designed to store only **management password(s) optionally** and +> only **SSH key *names*** (no private keys). + +--- + +## Features + +- **Authentication & Users** + - User registration + login (session cookie based) + - First registered user becomes **admin** + - Admin can view all users and activate/deactivate them + - Deactivated users cannot log in and will be logged out automatically + +- **Server Management** + - Each user has their own list of servers (no cross-visibility) + - Create / edit / archive (soft-delete) servers + - Fields include: + - General: name, hostname, type (VPS, dedicated, storage, managed, other), provider, location, tags + - Network: IPv4, IPv6 + - Billing: price, currency, billing period (monthly/yearly/other), contract start/end + - Hardware: CPU model, core count, RAM, storage size & type + - Access: management URL, management user, management password (optional), SSH user, SSH key hint + - Free-form notes + - Contract badges: + - **"abgelaufen"** (expired): contract end in the past + - **"läuft bald aus"** (expiring soon): contract end within the next 30 days + - Detail view also shows how many days until / since contract end + +- **Per-user Dashboard & Map** + - On `/`: small dashboard row showing: + - number of active servers + - estimated total monthly cost + - how many contracts are expiring soon / already expired + - On `/map`: Leaflet-based map showing all non-archived servers of the logged-in user + - Marker position is derived from the `location` string (city/datacenter name) + - Multiple servers per city are slightly offset so all markers remain clickable + - Click on a marker → opens the server details page + +- **Admin Global Dashboard** + - On `/admin/dashboard` (admin only): + - Global counts: users, servers, monthly cost, expiring soon, expired + - Breakdown by provider (server count, monthly total, expiring soon, expired) + - List of contracts expiring soon and already expired + +- **Security** + - Passwords hashed with **bcrypt** (`passlib[bcrypt]`) + - Optional encryption for management passwords using **Fernet** (`cryptography`) + - No private SSH keys are stored, only name/hint strings + - Jinja2 auto-escaping enabled; no untrusted HTML is rendered with `|safe` + - Management URLs are restricted to `http://` or `https://` (no `javascript:` links, etc.) + +- **UI / UX** + - TailwindCSS via CDN for quick styling + - Dark mode is **enabled by default** + - Theme preference stored in `localStorage` and toggleable via a small button + - Responsive layout, works well on mobile + - PWA manifest and service worker for a simple offline-friendly experience + +--- + +## Quick Start (Docker) + +### 0. Environment + +Kopiere `.env-example` nach `.env` und setze mindestens ein starkes `SESSION_SECRET`. Für lokale HTTP-Tests kannst du `SESSION_COOKIE_SECURE=0` setzen, in Produktion sollte es `1` bleiben. Optional kannst du einen `ENCRYPTION_KEY` (Fernet) hinterlegen, um Management-Passwörter zu speichern. + +### 1. Clone / copy the repository + +```bash +git clone https://example.com/your/fleetledger.git +cd fleetledger diff --git a/fleetledger/app/__init__.py b/app/__init__.py similarity index 100% rename from fleetledger/app/__init__.py rename to app/__init__.py diff --git a/fleetledger/app/auth.py b/app/auth.py similarity index 100% rename from fleetledger/app/auth.py rename to app/auth.py diff --git a/fleetledger/app/db.py b/app/db.py similarity index 100% rename from fleetledger/app/db.py rename to app/db.py diff --git a/fleetledger/app/main.py b/app/main.py similarity index 100% rename from fleetledger/app/main.py rename to app/main.py diff --git a/fleetledger/app/models.py b/app/models.py similarity index 100% rename from fleetledger/app/models.py rename to app/models.py diff --git a/fleetledger/app/static/icon-192.png b/app/static/icon-192.png similarity index 100% rename from fleetledger/app/static/icon-192.png rename to app/static/icon-192.png diff --git a/fleetledger/app/static/icon-512.png b/app/static/icon-512.png similarity index 100% rename from fleetledger/app/static/icon-512.png rename to app/static/icon-512.png diff --git a/fleetledger/app/static/manifest.webmanifest b/app/static/manifest.webmanifest similarity index 100% rename from fleetledger/app/static/manifest.webmanifest rename to app/static/manifest.webmanifest diff --git a/fleetledger/app/static/service-worker.js b/app/static/service-worker.js similarity index 100% rename from fleetledger/app/static/service-worker.js rename to app/static/service-worker.js diff --git a/fleetledger/app/static/style.css b/app/static/style.css similarity index 100% rename from fleetledger/app/static/style.css rename to app/static/style.css diff --git a/fleetledger/app/templates/admin_dashboard.html b/app/templates/admin_dashboard.html similarity index 100% rename from fleetledger/app/templates/admin_dashboard.html rename to app/templates/admin_dashboard.html diff --git a/fleetledger/app/templates/base.html b/app/templates/base.html similarity index 100% rename from fleetledger/app/templates/base.html rename to app/templates/base.html diff --git a/fleetledger/app/templates/login.html b/app/templates/login.html similarity index 100% rename from fleetledger/app/templates/login.html rename to app/templates/login.html diff --git a/fleetledger/app/templates/register.html b/app/templates/register.html similarity index 100% rename from fleetledger/app/templates/register.html rename to app/templates/register.html diff --git a/fleetledger/app/templates/server_detail.html b/app/templates/server_detail.html similarity index 100% rename from fleetledger/app/templates/server_detail.html rename to app/templates/server_detail.html diff --git a/fleetledger/app/templates/server_form.html b/app/templates/server_form.html similarity index 100% rename from fleetledger/app/templates/server_form.html rename to app/templates/server_form.html diff --git a/fleetledger/app/templates/servers_list.html b/app/templates/servers_list.html similarity index 100% rename from fleetledger/app/templates/servers_list.html rename to app/templates/servers_list.html diff --git a/fleetledger/app/templates/servers_map.html b/app/templates/servers_map.html similarity index 100% rename from fleetledger/app/templates/servers_map.html rename to app/templates/servers_map.html diff --git a/fleetledger/app/templates/users_list.html b/app/templates/users_list.html similarity index 100% rename from fleetledger/app/templates/users_list.html rename to app/templates/users_list.html diff --git a/fleetledger/app/utils.py b/app/utils.py similarity index 100% rename from fleetledger/app/utils.py rename to app/utils.py diff --git a/fleetledger/docker-compose.yml b/docker-compose.yml similarity index 100% rename from fleetledger/docker-compose.yml rename to docker-compose.yml diff --git a/fleetledger/README.md b/fleetledger/README.md deleted file mode 100644 index bcf64fc..0000000 --- a/fleetledger/README.md +++ /dev/null @@ -1,86 +0,0 @@ -# FleetLedger - -FleetLedger is a small self-hosted web app to keep track of your rented servers: - -- VPS, dedicated servers, storage boxes, managed services -- Provider, location, IPs, hardware -- Monthly / yearly pricing and contract dates -- Simple access info (management URLs, SSH user + key hint) -- Multi-user support with per-user data separation -- Admin user management (activate / deactivate users) -- Dark-mode-first UI with PWA support (installable as an app) -- Per-user **map view** for server locations -- Admin **global dashboard** for fleet-wide stats - -> **Security note:** FleetLedger is *not* a full password manager. -> It is intentionally designed to store only **management password(s) optionally** and -> only **SSH key *names*** (no private keys). - ---- - -## Features - -- **Authentication & Users** - - User registration + login (session cookie based) - - First registered user becomes **admin** - - Admin can view all users and activate/deactivate them - - Deactivated users cannot log in and will be logged out automatically - -- **Server Management** - - Each user has their own list of servers (no cross-visibility) - - Create / edit / archive (soft-delete) servers - - Fields include: - - General: name, hostname, type (VPS, dedicated, storage, managed, other), provider, location, tags - - Network: IPv4, IPv6 - - Billing: price, currency, billing period (monthly/yearly/other), contract start/end - - Hardware: CPU model, core count, RAM, storage size & type - - Access: management URL, management user, management password (optional), SSH user, SSH key hint - - Free-form notes - - Contract badges: - - **"abgelaufen"** (expired): contract end in the past - - **"läuft bald aus"** (expiring soon): contract end within the next 30 days - - Detail view also shows how many days until / since contract end - -- **Per-user Dashboard & Map** - - On `/`: small dashboard row showing: - - number of active servers - - estimated total monthly cost - - how many contracts are expiring soon / already expired - - On `/map`: Leaflet-based map showing all non-archived servers of the logged-in user - - Marker position is derived from the `location` string (city/datacenter name) - - Multiple servers per city are slightly offset so all markers remain clickable - - Click on a marker → opens the server details page - -- **Admin Global Dashboard** - - On `/admin/dashboard` (admin only): - - Global counts: users, servers, monthly cost, expiring soon, expired - - Breakdown by provider (server count, monthly total, expiring soon, expired) - - List of contracts expiring soon and already expired - -- **Security** - - Passwords hashed with **bcrypt** (`passlib[bcrypt]`) - - Optional encryption for management passwords using **Fernet** (`cryptography`) - - No private SSH keys are stored, only name/hint strings - - Jinja2 auto-escaping enabled; no untrusted HTML is rendered with `|safe` - - Management URLs are restricted to `http://` or `https://` (no `javascript:` links, etc.) - -- **UI / UX** - - TailwindCSS via CDN for quick styling - - Dark mode is **enabled by default** - - Theme preference stored in `localStorage` and toggleable via a small button - - Responsive layout, works well on mobile - - PWA manifest and service worker for a simple offline-friendly experience - ---- - -## Quick Start (Docker) - -### 0. Environment - -Kopiere `.env-example` nach `.env` und setze mindestens ein starkes `SESSION_SECRET`. Für lokale HTTP-Tests kannst du `SESSION_COOKIE_SECURE=0` setzen, in Produktion sollte es `1` bleiben. Optional kannst du einen `ENCRYPTION_KEY` (Fernet) hinterlegen, um Management-Passwörter zu speichern. - -### 1. Clone / copy the repository - -```bash -git clone https://example.com/your/fleetledger.git -cd fleetledger diff --git a/fleetledger/requirements.txt b/requirements.txt similarity index 100% rename from fleetledger/requirements.txt rename to requirements.txt