Compare commits
12 Commits
alpha-1.7
...
alpha-1.18
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
27428b69a0 | ||
|
|
582f92eec4 | ||
|
|
1d27226b6f | ||
|
|
c70dc33f67 | ||
|
|
fb264bf7c6 | ||
|
|
f3304b90c8 | ||
|
|
cda916f2af | ||
| c3ab7a5a67 | |||
| b955e4f464 | |||
| 831564762b | |||
| 3f177a6993 | |||
| ea4afbd6ca |
15
.gitignore
vendored
15
.gitignore
vendored
@@ -69,5 +69,20 @@ PROJECT_SUMMARY.md
|
|||||||
QUICKSTART.md
|
QUICKSTART.md
|
||||||
VS_CODE_SETUP.md
|
VS_CODE_SETUP.md
|
||||||
|
|
||||||
|
# Gemini / Antigravity
|
||||||
|
.gemini/
|
||||||
|
|
||||||
# Windows artifacts
|
# Windows artifacts
|
||||||
nul
|
nul
|
||||||
|
|
||||||
|
# Debug / temp files (generated during development & testing)
|
||||||
|
out.txt
|
||||||
|
containers.txt
|
||||||
|
helper.txt
|
||||||
|
logs.txt
|
||||||
|
port.txt
|
||||||
|
env.txt
|
||||||
|
network.txt
|
||||||
|
update_helper.txt
|
||||||
|
state.txt
|
||||||
|
hostpath.txt
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ netbird-msp-appliance/
|
|||||||
1. Validate inputs (subdomain unique, email valid)
|
1. Validate inputs (subdomain unique, email valid)
|
||||||
2. Allocate ports (Management internal, Relay UDP public)
|
2. Allocate ports (Management internal, Relay UDP public)
|
||||||
3. Generate configs from Jinja2 templates
|
3. Generate configs from Jinja2 templates
|
||||||
4. Create instance directory: `/opt/netbird-instances/kunde{id}/`
|
4. Create instance directory: `/opt/netbird-instances/{subdomain}/`
|
||||||
5. Write `docker-compose.yml`, `management.json`, `relay.env`
|
5. Write `docker-compose.yml`, `management.json`, `relay.env`
|
||||||
6. Start Docker containers via Docker SDK
|
6. Start Docker containers via Docker SDK
|
||||||
7. Wait for health checks (max 60s)
|
7. Wait for health checks (max 60s)
|
||||||
@@ -113,7 +113,7 @@ No manual config file editing required!
|
|||||||
### 4. Nginx Proxy Manager Integration
|
### 4. Nginx Proxy Manager Integration
|
||||||
**Per customer, create proxy host:**
|
**Per customer, create proxy host:**
|
||||||
- Domain: `{subdomain}.{base_domain}`
|
- Domain: `{subdomain}.{base_domain}`
|
||||||
- Forward to: `netbird-kunde{id}-dashboard:80`
|
- Forward to: `netbird-{subdomain}-dashboard:80`
|
||||||
- SSL: Automatic Let's Encrypt
|
- SSL: Automatic Let's Encrypt
|
||||||
- Advanced config: Route `/api/*` to management, `/signalexchange.*` to signal, `/relay` to relay
|
- Advanced config: Route `/api/*` to management, `/signalexchange.*` to signal, `/relay` to relay
|
||||||
|
|
||||||
@@ -272,7 +272,7 @@ networks:
|
|||||||
services:
|
services:
|
||||||
netbird-management:
|
netbird-management:
|
||||||
image: {{ netbird_management_image }}
|
image: {{ netbird_management_image }}
|
||||||
container_name: netbird-kunde{{ customer_id }}-management
|
container_name: netbird-{{ subdomain }}-management
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- npm-network
|
- npm-network
|
||||||
@@ -285,7 +285,7 @@ services:
|
|||||||
|
|
||||||
netbird-signal:
|
netbird-signal:
|
||||||
image: {{ netbird_signal_image }}
|
image: {{ netbird_signal_image }}
|
||||||
container_name: netbird-kunde{{ customer_id }}-signal
|
container_name: netbird-{{ subdomain }}-signal
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- npm-network
|
- npm-network
|
||||||
@@ -294,7 +294,7 @@ services:
|
|||||||
|
|
||||||
netbird-relay:
|
netbird-relay:
|
||||||
image: {{ netbird_relay_image }}
|
image: {{ netbird_relay_image }}
|
||||||
container_name: netbird-kunde{{ customer_id }}-relay
|
container_name: netbird-{{ subdomain }}-relay
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- npm-network
|
- npm-network
|
||||||
@@ -311,7 +311,7 @@ services:
|
|||||||
|
|
||||||
netbird-dashboard:
|
netbird-dashboard:
|
||||||
image: {{ netbird_dashboard_image }}
|
image: {{ netbird_dashboard_image }}
|
||||||
container_name: netbird-kunde{{ customer_id }}-dashboard
|
container_name: netbird-{{ subdomain }}-dashboard
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- npm-network
|
- npm-network
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -95,8 +95,8 @@ A management solution for running isolated NetBird instances for your MSP busine
|
|||||||
| | Caddy | | | | Caddy | |
|
| | Caddy | | | | Caddy | |
|
||||||
| +------------+ | | +------------+ |
|
| +------------+ | | +------------+ |
|
||||||
+------------------+ +------------------+
|
+------------------+ +------------------+
|
||||||
kunde1.domain.de kundeN.domain.de
|
customer-a.domain.de customer-x.domain.de
|
||||||
UDP 3478 UDP 3478+N-1
|
| |3478+N-1
|
||||||
```
|
```
|
||||||
|
|
||||||
### Components per Customer Instance (5 containers):
|
### Components per Customer Instance (5 containers):
|
||||||
@@ -140,9 +140,9 @@ Example for 3 customers:
|
|||||||
|
|
||||||
| Customer | Dashboard (TCP) | Relay (UDP) |
|
| Customer | Dashboard (TCP) | Relay (UDP) |
|
||||||
|----------|----------------|-------------|
|
|----------|----------------|-------------|
|
||||||
| Kunde 1 | 9001 | 3478 |
|
| Customer-A | 9001 | 3478 |
|
||||||
| Kunde 2 | 9002 | 3479 |
|
| Customer-C | 9002 | 3479 |
|
||||||
| Kunde 3 | 9003 | 3480 |
|
| Customer-X | 9003 | 3480 |
|
||||||
|
|
||||||
**Your firewall must allow both the TCP dashboard ports and the UDP relay ports!**
|
**Your firewall must allow both the TCP dashboard ports and the UDP relay ports!**
|
||||||
|
|
||||||
|
|||||||
@@ -237,6 +237,10 @@ async def test_ldap(
|
|||||||
@router.get("/branding")
|
@router.get("/branding")
|
||||||
async def get_branding(db: Session = Depends(get_db)):
|
async def get_branding(db: Session = Depends(get_db)):
|
||||||
"""Public endpoint — returns branding info for the login page (no auth required)."""
|
"""Public endpoint — returns branding info for the login page (no auth required)."""
|
||||||
|
current_version = update_service.get_current_version().get("tag", "alpha-1.1")
|
||||||
|
if current_version == "unknown":
|
||||||
|
current_version = "alpha-1.1"
|
||||||
|
|
||||||
row = db.query(SystemConfig).filter(SystemConfig.id == 1).first()
|
row = db.query(SystemConfig).filter(SystemConfig.id == 1).first()
|
||||||
if not row:
|
if not row:
|
||||||
return {
|
return {
|
||||||
@@ -244,12 +248,14 @@ async def get_branding(db: Session = Depends(get_db)):
|
|||||||
"branding_subtitle": "Multi-Tenant Management Platform",
|
"branding_subtitle": "Multi-Tenant Management Platform",
|
||||||
"branding_logo_path": None,
|
"branding_logo_path": None,
|
||||||
"default_language": "en",
|
"default_language": "en",
|
||||||
|
"version": current_version
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
"branding_name": row.branding_name or "NetBird MSP Appliance",
|
"branding_name": row.branding_name or "NetBird MSP Appliance",
|
||||||
"branding_subtitle": row.branding_subtitle or "Multi-Tenant Management Platform",
|
"branding_subtitle": row.branding_subtitle or "Multi-Tenant Management Platform",
|
||||||
"branding_logo_path": row.branding_logo_path,
|
"branding_logo_path": row.branding_logo_path,
|
||||||
"default_language": row.default_language or "en",
|
"default_language": row.default_language or "en",
|
||||||
|
"version": current_version
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -334,6 +340,19 @@ async def get_version(
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
@router.get("/branches")
|
||||||
|
async def get_branches(
|
||||||
|
current_user: User = Depends(get_current_user),
|
||||||
|
db: Session = Depends(get_db),
|
||||||
|
):
|
||||||
|
"""Return a list of available branches from the configured git remote."""
|
||||||
|
config = get_system_config(db)
|
||||||
|
if not config or not config.git_repo_url:
|
||||||
|
return []
|
||||||
|
branches = await update_service.get_remote_branches(config)
|
||||||
|
return branches
|
||||||
|
|
||||||
|
|
||||||
@router.post("/update")
|
@router.post("/update")
|
||||||
async def trigger_update(
|
async def trigger_update(
|
||||||
current_user: User = Depends(get_current_user),
|
current_user: User = Depends(get_current_user),
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ async def deploy_customer(db: Session, customer_id: int) -> dict[str, Any]:
|
|||||||
|
|
||||||
allocated_port = None
|
allocated_port = None
|
||||||
instance_dir = None
|
instance_dir = None
|
||||||
container_prefix = f"netbird-kunde{customer_id}"
|
container_prefix = f"netbird-{customer.subdomain}"
|
||||||
local_mode = _is_local_domain(config.base_domain)
|
local_mode = _is_local_domain(config.base_domain)
|
||||||
existing_deployment = db.query(Deployment).filter(Deployment.customer_id == customer_id).first()
|
existing_deployment = db.query(Deployment).filter(Deployment.customer_id == customer_id).first()
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ async def deploy_customer(db: Session, customer_id: int) -> dict[str, Any]:
|
|||||||
# Step 2: Generate secrets (reuse existing key if instance data exists)
|
# Step 2: Generate secrets (reuse existing key if instance data exists)
|
||||||
relay_secret = generate_relay_secret()
|
relay_secret = generate_relay_secret()
|
||||||
datastore_key = _get_existing_datastore_key(
|
datastore_key = _get_existing_datastore_key(
|
||||||
os.path.join(config.data_dir, f"kunde{customer_id}", "management.json")
|
os.path.join(config.data_dir, customer.subdomain, "management.json")
|
||||||
)
|
)
|
||||||
if datastore_key:
|
if datastore_key:
|
||||||
_log_action(db, customer_id, "deploy", "info",
|
_log_action(db, customer_id, "deploy", "info",
|
||||||
@@ -159,7 +159,7 @@ async def deploy_customer(db: Session, customer_id: int) -> dict[str, Any]:
|
|||||||
relay_ws_protocol = "rels"
|
relay_ws_protocol = "rels"
|
||||||
|
|
||||||
# Step 4: Create instance directory
|
# Step 4: Create instance directory
|
||||||
instance_dir = os.path.join(config.data_dir, f"kunde{customer_id}")
|
instance_dir = os.path.join(config.data_dir, customer.subdomain)
|
||||||
os.makedirs(instance_dir, exist_ok=True)
|
os.makedirs(instance_dir, exist_ok=True)
|
||||||
os.makedirs(os.path.join(instance_dir, "data", "management"), exist_ok=True)
|
os.makedirs(os.path.join(instance_dir, "data", "management"), exist_ok=True)
|
||||||
os.makedirs(os.path.join(instance_dir, "data", "signal"), exist_ok=True)
|
os.makedirs(os.path.join(instance_dir, "data", "signal"), exist_ok=True)
|
||||||
@@ -225,7 +225,7 @@ async def deploy_customer(db: Session, customer_id: int) -> dict[str, Any]:
|
|||||||
# Step 8: Auto-create admin user via NetBird setup API
|
# Step 8: Auto-create admin user via NetBird setup API
|
||||||
admin_email = customer.email
|
admin_email = customer.email
|
||||||
admin_password = secrets.token_urlsafe(16)
|
admin_password = secrets.token_urlsafe(16)
|
||||||
management_container = f"netbird-kunde{customer_id}-management"
|
management_container = f"netbird-{customer.subdomain}-management"
|
||||||
setup_api_url = f"http://{management_container}:80/api/setup"
|
setup_api_url = f"http://{management_container}:80/api/setup"
|
||||||
setup_payload = json.dumps({
|
setup_payload = json.dumps({
|
||||||
"name": customer.name,
|
"name": customer.name,
|
||||||
@@ -387,7 +387,7 @@ async def deploy_customer(db: Session, customer_id: int) -> dict[str, Any]:
|
|||||||
# Rollback: stop containers if they were started
|
# Rollback: stop containers if they were started
|
||||||
try:
|
try:
|
||||||
await docker_service.compose_down(
|
await docker_service.compose_down(
|
||||||
instance_dir or os.path.join(config.data_dir, f"kunde{customer_id}"),
|
instance_dir or os.path.join(config.data_dir, customer.subdomain),
|
||||||
container_prefix,
|
container_prefix,
|
||||||
remove_volumes=True,
|
remove_volumes=True,
|
||||||
)
|
)
|
||||||
@@ -423,7 +423,7 @@ async def undeploy_customer(db: Session, customer_id: int) -> dict[str, Any]:
|
|||||||
config = get_system_config(db)
|
config = get_system_config(db)
|
||||||
|
|
||||||
if deployment and config:
|
if deployment and config:
|
||||||
instance_dir = os.path.join(config.data_dir, f"kunde{customer_id}")
|
instance_dir = os.path.join(config.data_dir, customer.subdomain)
|
||||||
|
|
||||||
# Stop and remove containers
|
# Stop and remove containers
|
||||||
try:
|
try:
|
||||||
@@ -484,16 +484,15 @@ async def undeploy_customer(db: Session, customer_id: int) -> dict[str, Any]:
|
|||||||
async def stop_customer(db: Session, customer_id: int) -> dict[str, Any]:
|
async def stop_customer(db: Session, customer_id: int) -> dict[str, Any]:
|
||||||
"""Stop containers for a customer."""
|
"""Stop containers for a customer."""
|
||||||
deployment = db.query(Deployment).filter(Deployment.customer_id == customer_id).first()
|
deployment = db.query(Deployment).filter(Deployment.customer_id == customer_id).first()
|
||||||
|
customer = db.query(Customer).filter(Customer.id == customer_id).first()
|
||||||
config = get_system_config(db)
|
config = get_system_config(db)
|
||||||
if not deployment or not config:
|
if not deployment or not config or not customer:
|
||||||
return {"success": False, "error": "Deployment or config not found."}
|
return {"success": False, "error": "Deployment, customer or config not found."}
|
||||||
|
|
||||||
instance_dir = os.path.join(config.data_dir, f"kunde{customer_id}")
|
instance_dir = os.path.join(config.data_dir, customer.subdomain)
|
||||||
ok = await docker_service.compose_stop(instance_dir, deployment.container_prefix)
|
ok = await docker_service.compose_stop(instance_dir, deployment.container_prefix)
|
||||||
if ok:
|
if ok:
|
||||||
deployment.deployment_status = "stopped"
|
deployment.deployment_status = "stopped"
|
||||||
customer = db.query(Customer).filter(Customer.id == customer_id).first()
|
|
||||||
if customer:
|
|
||||||
customer.status = "inactive"
|
customer.status = "inactive"
|
||||||
db.commit()
|
db.commit()
|
||||||
_log_action(db, customer_id, "stop", "success", "Containers stopped.")
|
_log_action(db, customer_id, "stop", "success", "Containers stopped.")
|
||||||
@@ -505,16 +504,15 @@ async def stop_customer(db: Session, customer_id: int) -> dict[str, Any]:
|
|||||||
async def start_customer(db: Session, customer_id: int) -> dict[str, Any]:
|
async def start_customer(db: Session, customer_id: int) -> dict[str, Any]:
|
||||||
"""Start containers for a customer."""
|
"""Start containers for a customer."""
|
||||||
deployment = db.query(Deployment).filter(Deployment.customer_id == customer_id).first()
|
deployment = db.query(Deployment).filter(Deployment.customer_id == customer_id).first()
|
||||||
|
customer = db.query(Customer).filter(Customer.id == customer_id).first()
|
||||||
config = get_system_config(db)
|
config = get_system_config(db)
|
||||||
if not deployment or not config:
|
if not deployment or not config or not customer:
|
||||||
return {"success": False, "error": "Deployment or config not found."}
|
return {"success": False, "error": "Deployment, customer or config not found."}
|
||||||
|
|
||||||
instance_dir = os.path.join(config.data_dir, f"kunde{customer_id}")
|
instance_dir = os.path.join(config.data_dir, customer.subdomain)
|
||||||
ok = await docker_service.compose_start(instance_dir, deployment.container_prefix)
|
ok = await docker_service.compose_start(instance_dir, deployment.container_prefix)
|
||||||
if ok:
|
if ok:
|
||||||
deployment.deployment_status = "running"
|
deployment.deployment_status = "running"
|
||||||
customer = db.query(Customer).filter(Customer.id == customer_id).first()
|
|
||||||
if customer:
|
|
||||||
customer.status = "active"
|
customer.status = "active"
|
||||||
db.commit()
|
db.commit()
|
||||||
_log_action(db, customer_id, "start", "success", "Containers started.")
|
_log_action(db, customer_id, "start", "success", "Containers started.")
|
||||||
@@ -526,16 +524,15 @@ async def start_customer(db: Session, customer_id: int) -> dict[str, Any]:
|
|||||||
async def restart_customer(db: Session, customer_id: int) -> dict[str, Any]:
|
async def restart_customer(db: Session, customer_id: int) -> dict[str, Any]:
|
||||||
"""Restart containers for a customer."""
|
"""Restart containers for a customer."""
|
||||||
deployment = db.query(Deployment).filter(Deployment.customer_id == customer_id).first()
|
deployment = db.query(Deployment).filter(Deployment.customer_id == customer_id).first()
|
||||||
|
customer = db.query(Customer).filter(Customer.id == customer_id).first()
|
||||||
config = get_system_config(db)
|
config = get_system_config(db)
|
||||||
if not deployment or not config:
|
if not deployment or not config or not customer:
|
||||||
return {"success": False, "error": "Deployment or config not found."}
|
return {"success": False, "error": "Deployment, customer or config not found."}
|
||||||
|
|
||||||
instance_dir = os.path.join(config.data_dir, f"kunde{customer_id}")
|
instance_dir = os.path.join(config.data_dir, customer.subdomain)
|
||||||
ok = await docker_service.compose_restart(instance_dir, deployment.container_prefix)
|
ok = await docker_service.compose_restart(instance_dir, deployment.container_prefix)
|
||||||
if ok:
|
if ok:
|
||||||
deployment.deployment_status = "running"
|
deployment.deployment_status = "running"
|
||||||
customer = db.query(Customer).filter(Customer.id == customer_id).first()
|
|
||||||
if customer:
|
|
||||||
customer.status = "active"
|
customer.status = "active"
|
||||||
db.commit()
|
db.commit()
|
||||||
_log_action(db, customer_id, "restart", "success", "Containers restarted.")
|
_log_action(db, customer_id, "restart", "success", "Containers restarted.")
|
||||||
|
|||||||
@@ -259,7 +259,16 @@ async def create_proxy_host(
|
|||||||
"block_exploits": True,
|
"block_exploits": True,
|
||||||
"allow_websocket_upgrade": True,
|
"allow_websocket_upgrade": True,
|
||||||
"access_list_id": 0,
|
"access_list_id": 0,
|
||||||
"advanced_config": "",
|
"advanced_config": (
|
||||||
|
"location ^~ /management.ManagementService/ {\n"
|
||||||
|
f" grpc_pass grpc://{forward_host}:{forward_port};\n"
|
||||||
|
" grpc_set_header Host $host;\n"
|
||||||
|
"}\n"
|
||||||
|
"location ^~ /signalexchange.SignalExchange/ {\n"
|
||||||
|
f" grpc_pass grpc://{forward_host}:{forward_port};\n"
|
||||||
|
" grpc_set_header Host $host;\n"
|
||||||
|
"}\n"
|
||||||
|
),
|
||||||
"meta": {
|
"meta": {
|
||||||
"letsencrypt_agree": True,
|
"letsencrypt_agree": True,
|
||||||
"letsencrypt_email": admin_email,
|
"letsencrypt_email": admin_email,
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import logging
|
|||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import httpx
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any
|
from typing import Any
|
||||||
@@ -14,10 +15,45 @@ import httpx
|
|||||||
SOURCE_DIR = "/app-source"
|
SOURCE_DIR = "/app-source"
|
||||||
VERSION_FILE = "/app/version.json"
|
VERSION_FILE = "/app/version.json"
|
||||||
BACKUP_DIR = "/app/backups"
|
BACKUP_DIR = "/app/backups"
|
||||||
|
CONTAINER_NAME = "netbird-msp-appliance"
|
||||||
|
SERVICE_NAME = "netbird-msp-appliance"
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
def _get_compose_project_name() -> str:
|
||||||
|
"""Detect the compose project name from the running container's labels.
|
||||||
|
|
||||||
|
Docker Compose sets the label ``com.docker.compose.project`` on every
|
||||||
|
managed container. Reading it at runtime avoids hard-coding a project
|
||||||
|
name that may differ from the directory name used at deploy time.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The compose project name (e.g. ``netbird-msp``).
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
result = subprocess.run(
|
||||||
|
[
|
||||||
|
"docker", "inspect", CONTAINER_NAME,
|
||||||
|
"--format",
|
||||||
|
'{{index .Config.Labels "com.docker.compose.project"}}',
|
||||||
|
],
|
||||||
|
capture_output=True, text=True, timeout=10,
|
||||||
|
)
|
||||||
|
if result.returncode == 0:
|
||||||
|
project = result.stdout.strip()
|
||||||
|
if project:
|
||||||
|
logger.info("Detected compose project name: %s", project)
|
||||||
|
return project
|
||||||
|
except Exception as exc:
|
||||||
|
logger.warning("Could not detect compose project name: %s", exc)
|
||||||
|
|
||||||
|
# Fallback: derive from SOURCE_DIR basename (mirrors Compose default behaviour)
|
||||||
|
fallback = Path(SOURCE_DIR).name
|
||||||
|
logger.warning("Using fallback compose project name: %s", fallback)
|
||||||
|
return fallback
|
||||||
|
|
||||||
|
|
||||||
def get_current_version() -> dict:
|
def get_current_version() -> dict:
|
||||||
"""Read the version baked at build time from /app/version.json."""
|
"""Read the version baked at build time from /app/version.json."""
|
||||||
try:
|
try:
|
||||||
@@ -103,15 +139,19 @@ async def check_for_updates(config: Any) -> dict:
|
|||||||
"tag": latest_tag,
|
"tag": latest_tag,
|
||||||
"commit": short_sha,
|
"commit": short_sha,
|
||||||
"commit_full": full_sha,
|
"commit_full": full_sha,
|
||||||
"message": latest_commit.get("commit", {}).get("message", "").split("\n")[0],
|
"message": latest_commit.get("commit", {}).get("message", "").split("\n")[0] if latest_commit.get("commit") else "",
|
||||||
"date": latest_commit.get("commit", {}).get("committer", {}).get("date", ""),
|
"date": latest_commit.get("timestamp", ""),
|
||||||
"branch": branch,
|
"branch": branch,
|
||||||
}
|
}
|
||||||
|
|
||||||
# Determine if update is needed: prefer tag comparison, fallback to commit
|
# Determine if update is needed: prefer tag comparison, fallback to commit
|
||||||
current_tag = current.get("tag", "unknown")
|
current_tag = current.get("tag", "unknown")
|
||||||
current_sha = current.get("commit", "unknown")
|
current_sha = current.get("commit", "unknown")
|
||||||
if current_tag != "unknown" and latest_tag != "unknown":
|
|
||||||
|
# If we don't know our current version but the remote has one, we should update
|
||||||
|
if current_tag == "unknown" and current_sha == "unknown":
|
||||||
|
needs_update = latest_tag != "unknown" or short_sha != "unknown"
|
||||||
|
elif current_tag != "unknown" and latest_tag != "unknown":
|
||||||
needs_update = current_tag != latest_tag
|
needs_update = current_tag != latest_tag
|
||||||
else:
|
else:
|
||||||
needs_update = (
|
needs_update = (
|
||||||
@@ -130,6 +170,42 @@ async def check_for_updates(config: Any) -> dict:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async def get_remote_branches(config: Any) -> list[str]:
|
||||||
|
"""Query the Gitea API for available branches on the configured repository.
|
||||||
|
|
||||||
|
Returns a list of branch names (e.g., ['main', 'unstable', 'development']).
|
||||||
|
If the repository URL is not configured or an error occurs, returns an empty list.
|
||||||
|
"""
|
||||||
|
if not config.git_repo_url:
|
||||||
|
return []
|
||||||
|
|
||||||
|
repo_url = config.git_repo_url.rstrip("/")
|
||||||
|
parts = repo_url.split("/")
|
||||||
|
if len(parts) < 5:
|
||||||
|
return []
|
||||||
|
|
||||||
|
base_url = "/".join(parts[:-2])
|
||||||
|
owner = parts[-2]
|
||||||
|
repo = parts[-1]
|
||||||
|
branches_api = f"{base_url}/api/v1/repos/{owner}/{repo}/branches?limit=100"
|
||||||
|
|
||||||
|
headers = {}
|
||||||
|
if config.git_token:
|
||||||
|
headers["Authorization"] = f"token {config.git_token}"
|
||||||
|
|
||||||
|
try:
|
||||||
|
async with httpx.AsyncClient(timeout=10) as client:
|
||||||
|
resp = await client.get(branches_api, headers=headers)
|
||||||
|
if resp.status_code == 200:
|
||||||
|
data = resp.json()
|
||||||
|
if isinstance(data, list):
|
||||||
|
return [branch.get("name") for branch in data if "name" in branch]
|
||||||
|
except Exception as exc:
|
||||||
|
logger.error("Error fetching branches: %s", exc)
|
||||||
|
|
||||||
|
return []
|
||||||
|
|
||||||
|
|
||||||
def backup_database(db_path: str) -> str:
|
def backup_database(db_path: str) -> str:
|
||||||
"""Create a timestamped backup of the SQLite database.
|
"""Create a timestamped backup of the SQLite database.
|
||||||
|
|
||||||
@@ -176,6 +252,16 @@ def trigger_update(config: Any, db_path: str) -> dict:
|
|||||||
pull_cmd = ["git", "-C", SOURCE_DIR, "pull", "origin", branch]
|
pull_cmd = ["git", "-C", SOURCE_DIR, "pull", "origin", branch]
|
||||||
|
|
||||||
# 3. Git pull (synchronous — must complete before rebuild)
|
# 3. Git pull (synchronous — must complete before rebuild)
|
||||||
|
# Ensure .git directory is owned by the process user (root inside container).
|
||||||
|
# The .git dir may be owned by the host user after manual operations.
|
||||||
|
try:
|
||||||
|
subprocess.run(
|
||||||
|
["git", "config", "--global", "--add", "safe.directory", SOURCE_DIR],
|
||||||
|
capture_output=True, timeout=10,
|
||||||
|
)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
pull_cmd,
|
pull_cmd,
|
||||||
@@ -199,6 +285,15 @@ def trigger_update(config: Any, db_path: str) -> dict:
|
|||||||
|
|
||||||
logger.info("git pull succeeded: %s", result.stdout.strip()[:200])
|
logger.info("git pull succeeded: %s", result.stdout.strip()[:200])
|
||||||
|
|
||||||
|
# Fetch tags separately — git pull does not always pull all tags
|
||||||
|
try:
|
||||||
|
subprocess.run(
|
||||||
|
["git", "-C", SOURCE_DIR, "fetch", "--tags"],
|
||||||
|
capture_output=True, text=True, timeout=30,
|
||||||
|
)
|
||||||
|
except Exception as exc:
|
||||||
|
logger.warning("git fetch --tags failed (non-fatal): %s", exc)
|
||||||
|
|
||||||
# 4. Read version info from the freshly-pulled source
|
# 4. Read version info from the freshly-pulled source
|
||||||
build_env = os.environ.copy()
|
build_env = os.environ.copy()
|
||||||
try:
|
try:
|
||||||
@@ -237,13 +332,20 @@ def trigger_update(config: Any, db_path: str) -> dict:
|
|||||||
# ensure the compose-up runs detached on the Docker host via a wrapper.
|
# ensure the compose-up runs detached on the Docker host via a wrapper.
|
||||||
log_path = Path(BACKUP_DIR) / "update_rebuild.log"
|
log_path = Path(BACKUP_DIR) / "update_rebuild.log"
|
||||||
|
|
||||||
|
# Detect compose project name at runtime — avoids hard-coding a name that
|
||||||
|
# may differ from the directory used at deploy time.
|
||||||
|
project_name = _get_compose_project_name()
|
||||||
|
# Image name follows Docker Compose convention: {project}-{service}
|
||||||
|
service_image = f"{project_name}-{SERVICE_NAME}:latest"
|
||||||
|
logger.info("Using project=%s image=%s", project_name, service_image)
|
||||||
|
|
||||||
# Phase A — build the new image (does NOT stop anything)
|
# Phase A — build the new image (does NOT stop anything)
|
||||||
build_cmd = [
|
build_cmd = [
|
||||||
"docker", "compose",
|
"docker", "compose",
|
||||||
"-p", "netbirdmsp-appliance",
|
"-p", project_name,
|
||||||
"-f", f"{SOURCE_DIR}/docker-compose.yml",
|
"-f", f"{SOURCE_DIR}/docker-compose.yml",
|
||||||
"build", "--no-cache",
|
"build", "--no-cache",
|
||||||
"netbird-msp-appliance",
|
SERVICE_NAME,
|
||||||
]
|
]
|
||||||
logger.info("Phase A: building new image …")
|
logger.info("Phase A: building new image …")
|
||||||
try:
|
try:
|
||||||
@@ -295,22 +397,19 @@ def trigger_update(config: Any, db_path: str) -> dict:
|
|||||||
val = build_env.get(key, "unknown")
|
val = build_env.get(key, "unknown")
|
||||||
env_flags.extend(["-e", f"{key}={val}"])
|
env_flags.extend(["-e", f"{key}={val}"])
|
||||||
|
|
||||||
# Use the same image we're already running (it has docker CLI + compose plugin)
|
|
||||||
own_image = "netbirdmsp-appliance-netbird-msp-appliance:latest"
|
|
||||||
|
|
||||||
helper_cmd = [
|
helper_cmd = [
|
||||||
"docker", "run", "-d", "--privileged",
|
"docker", "run", "--rm", "-d", "--privileged",
|
||||||
"--name", "msp-updater",
|
"--name", "msp-updater",
|
||||||
"-v", "/var/run/docker.sock:/var/run/docker.sock:z",
|
"-v", "/var/run/docker.sock:/var/run/docker.sock:z",
|
||||||
"-v", f"{host_source_dir}:{host_source_dir}:ro,z",
|
"-v", f"{host_source_dir}:{host_source_dir}:ro,z",
|
||||||
*env_flags,
|
*env_flags,
|
||||||
own_image,
|
service_image, # freshly built image — has docker CLI + compose plugin
|
||||||
"sh", "-c",
|
"sh", "-c",
|
||||||
(
|
(
|
||||||
"sleep 3 && "
|
"sleep 3 && "
|
||||||
"docker compose -p netbirdmsp-appliance "
|
f"docker compose -p {project_name} "
|
||||||
f"-f {host_source_dir}/docker-compose.yml "
|
f"-f {host_source_dir}/docker-compose.yml "
|
||||||
"up --force-recreate --no-deps -d netbird-msp-appliance"
|
f"up --force-recreate --no-deps -d {SERVICE_NAME}"
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
|
||||||
b25f16030139 netbirdmsp-appliance-netbird-msp-appliance:latest "sh -c 'sleep 3 && d…" 2 minutes ago Exited (1) 2 minutes ago msp-updater
|
|
||||||
c7acab75017f f4446ac34896 "uvicorn app.main:ap…" 11 minutes ago Up 11 minutes (healthy) 0.0.0.0:8000->8000/tcp, [::]:8000->8000/tcp netbird-msp-appliance
|
|
||||||
878efa979680 caddy:2-alpine "caddy run --config …" 3 hours ago Up 2 hours 443/tcp, 2019/tcp, 443/udp, 0.0.0.0:9001->80/tcp, [::]:9001->80/tcp netbird-kunde1-caddy
|
|
||||||
564c613f112a netbirdio/signal:latest "/go/bin/netbird-sig…" 3 hours ago Up 2 hours netbird-kunde1-signal
|
|
||||||
a98852970815 netbirdio/dashboard:latest "/usr/bin/supervisor…" 3 hours ago Up 2 hours 80/tcp, 443/tcp netbird-kunde1-dashboard
|
|
||||||
11e100e21d81 netbirdio/relay:latest "/go/bin/netbird-rel…" 3 hours ago Up 2 hours 0.0.0.0:3478->3478/udp, [::]:3478->3478/udp netbird-kunde1-relay
|
|
||||||
aeae96bf691e netbirdio/management:latest "/go/bin/netbird-mgm…" 3 hours ago Up 2 hours netbird-kunde1-management
|
|
||||||
9cdda4d58e36 tecnativa/docker-socket-proxy:latest "docker-entrypoint.s…" 3 days ago Up 2 hours 2375/tcp docker-socket-proxy
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Error response from daemon: No such container: msp-updater
|
|
||||||
30
logs.txt
30
logs.txt
@@ -1,30 +0,0 @@
|
|||||||
INFO: 172.18.0.1:34414 - "GET /lang/de.json HTTP/1.1" 304 Not Modified
|
|
||||||
INFO: 172.18.0.1:34414 - "GET /favicon.ico HTTP/1.1" 404 Not Found
|
|
||||||
INFO: 172.18.0.1:34424 - "GET /api/settings/branding HTTP/1.1" 200 OK
|
|
||||||
INFO: 172.18.0.1:34424 - "GET /api/auth/azure/config HTTP/1.1" 200 OK
|
|
||||||
INFO: 172.18.0.1:34424 - "GET /api/auth/me HTTP/1.1" 200 OK
|
|
||||||
INFO: 172.18.0.1:34424 - "GET /api/monitoring/status HTTP/1.1" 200 OK
|
|
||||||
INFO: 172.18.0.1:34414 - "GET /api/customers?page=1&per_page=25 HTTP/1.1" 200 OK
|
|
||||||
INFO: 127.0.0.1:34422 - "GET /api/health HTTP/1.1" 200 OK
|
|
||||||
INFO: 172.18.0.1:34042 - "GET /api/settings/system HTTP/1.1" 200 OK
|
|
||||||
INFO: 172.18.0.1:34042 - "GET /api/auth/mfa/status HTTP/1.1" 200 OK
|
|
||||||
2026-02-22 14:40:01,292 [INFO] httpx: HTTP Request: GET https://git.0x26.ch/api/v1/repos/BurgerGames/NetBirdMSP-Appliance/branches/unstable "HTTP/1.1 200 OK"
|
|
||||||
2026-02-22 14:40:01,301 [INFO] httpx: HTTP Request: GET https://git.0x26.ch/api/v1/repos/BurgerGames/NetBirdMSP-Appliance/tags?limit=1 "HTTP/1.1 200 OK"
|
|
||||||
INFO: 172.18.0.1:49812 - "GET /api/settings/version HTTP/1.1" 200 OK
|
|
||||||
INFO: 127.0.0.1:54492 - "GET /api/health HTTP/1.1" 200 OK
|
|
||||||
INFO: 127.0.0.1:36052 - "GET /api/health HTTP/1.1" 200 OK
|
|
||||||
2026-02-22 14:40:57,656 [INFO] app.services.update_service: Database backed up to /app/backups/netbird_msp_20260222_144057.db
|
|
||||||
2026-02-22 14:40:57,971 [INFO] app.services.update_service: git pull succeeded: Already up to date.
|
|
||||||
2026-02-22 14:40:57,988 [INFO] app.services.update_service: Rebuilding with GIT_TAG=alpha-1.7 GIT_COMMIT=c40b7d3 GIT_BRANCH=unstable
|
|
||||||
2026-02-22 14:40:57,988 [INFO] app.services.update_service: Phase A: building new image …
|
|
||||||
2026-02-22 14:42:44,434 [INFO] app.services.update_service: Phase A complete — image built successfully.
|
|
||||||
2026-02-22 14:42:44,461 [INFO] app.services.update_service: Host source directory: /home/sascha/NetBirdMSP-Appliance
|
|
||||||
2026-02-22 14:42:44,973 [INFO] app.services.update_service: Phase B: updater container started — this container will restart in ~5s.
|
|
||||||
2026-02-22 14:42:44,973 [INFO] app.routers.settings: Update triggered by admin.
|
|
||||||
INFO: 172.18.0.1:46292 - "POST /api/settings/update HTTP/1.1" 200 OK
|
|
||||||
INFO: 127.0.0.1:54584 - "GET /api/health HTTP/1.1" 200 OK
|
|
||||||
INFO: 127.0.0.1:33600 - "GET /api/health HTTP/1.1" 200 OK
|
|
||||||
INFO: 127.0.0.1:35272 - "GET /api/health HTTP/1.1" 200 OK
|
|
||||||
INFO: 127.0.0.1:44226 - "GET /api/health HTTP/1.1" 200 OK
|
|
||||||
INFO: 127.0.0.1:48574 - "GET /api/health HTTP/1.1" 200 OK
|
|
||||||
INFO: 127.0.0.1:53686 - "GET /api/health HTTP/1.1" 200 OK
|
|
||||||
10
out.txt
10
out.txt
@@ -1,10 +0,0 @@
|
|||||||
[unstable c40b7d3] alpha-1.7: final test
|
|
||||||
remote:
|
|
||||||
remote: Create a new pull request for 'unstable':
|
|
||||||
remote: https://git.0x26.ch/BurgerGames/NetBirdMSP-Appliance/pulls/new/unstable
|
|
||||||
remote:
|
|
||||||
remote: .. Processing 2 references
|
|
||||||
remote: Processed 2 references in total
|
|
||||||
To https://git.0x26.ch/BurgerGames/NetBirdMSP-Appliance.git
|
|
||||||
525b056..c40b7d3 unstable -> unstable
|
|
||||||
* [new tag] alpha-1.7 -> alpha-1.7
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -12,7 +12,7 @@ let currentPage = 'dashboard';
|
|||||||
let currentCustomerId = null;
|
let currentCustomerId = null;
|
||||||
let currentCustomerData = null;
|
let currentCustomerData = null;
|
||||||
let customersPage = 1;
|
let customersPage = 1;
|
||||||
let brandingData = { branding_name: 'NetBird MSP Appliance', branding_logo_path: null };
|
let brandingData = { branding_name: 'NetBird MSP Appliance', branding_logo_path: null, version: 'alpha-1.1' };
|
||||||
let azureConfig = { azure_enabled: false };
|
let azureConfig = { azure_enabled: false };
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
@@ -127,12 +127,19 @@ function applyBranding() {
|
|||||||
const name = brandingData.branding_name || 'NetBird MSP Appliance';
|
const name = brandingData.branding_name || 'NetBird MSP Appliance';
|
||||||
const subtitle = brandingData.branding_subtitle || t('login.subtitle');
|
const subtitle = brandingData.branding_subtitle || t('login.subtitle');
|
||||||
const logoPath = brandingData.branding_logo_path;
|
const logoPath = brandingData.branding_logo_path;
|
||||||
|
const version = brandingData.version || 'alpha-1.1';
|
||||||
|
|
||||||
// Login page
|
// Login page
|
||||||
document.getElementById('login-title').textContent = name;
|
document.getElementById('login-title').textContent = name;
|
||||||
const subtitleEl = document.getElementById('login-subtitle');
|
const subtitleEl = document.getElementById('login-subtitle');
|
||||||
if (subtitleEl) subtitleEl.textContent = subtitle;
|
if (subtitleEl) subtitleEl.textContent = subtitle;
|
||||||
document.title = name;
|
document.title = name;
|
||||||
|
|
||||||
|
// Update version string in login page
|
||||||
|
const versionEl = document.querySelector('#login-page .text-muted.small.mb-0');
|
||||||
|
if (versionEl) {
|
||||||
|
versionEl.innerHTML = `<i class="bi bi-tag me-1"></i>${version}`;
|
||||||
|
}
|
||||||
if (logoPath) {
|
if (logoPath) {
|
||||||
document.getElementById('login-logo').innerHTML = `<img src="${logoPath}" alt="Logo" style="max-height:64px;max-width:200px;" class="mb-1">`;
|
document.getElementById('login-logo').innerHTML = `<img src="${logoPath}" alt="Logo" style="max-height:64px;max-width:200px;" class="mb-1">`;
|
||||||
} else {
|
} else {
|
||||||
@@ -366,7 +373,7 @@ function logout() {
|
|||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Authorization': `Bearer ${authToken}`,
|
'Authorization': `Bearer ${authToken}`,
|
||||||
},
|
},
|
||||||
}).catch(() => {});
|
}).catch(() => { });
|
||||||
}
|
}
|
||||||
authToken = null;
|
authToken = null;
|
||||||
currentUser = null;
|
currentUser = null;
|
||||||
@@ -511,7 +518,7 @@ function showNewCustomerModal() {
|
|||||||
// Update subdomain suffix
|
// Update subdomain suffix
|
||||||
api('GET', '/settings/system').then(cfg => {
|
api('GET', '/settings/system').then(cfg => {
|
||||||
document.getElementById('cust-subdomain-suffix').textContent = `.${cfg.base_domain || 'domain.com'}`;
|
document.getElementById('cust-subdomain-suffix').textContent = `.${cfg.base_domain || 'domain.com'}`;
|
||||||
}).catch(() => {});
|
}).catch(() => { });
|
||||||
|
|
||||||
const modalEl = document.getElementById('customer-modal');
|
const modalEl = document.getElementById('customer-modal');
|
||||||
const modal = bootstrap.Modal.getOrCreateInstance(modalEl);
|
const modal = bootstrap.Modal.getOrCreateInstance(modalEl);
|
||||||
@@ -872,6 +879,9 @@ async function loadSettings() {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
showSettingsAlert('danger', t('errors.failedToLoadSettings', { error: err.message }));
|
showSettingsAlert('danger', t('errors.failedToLoadSettings', { error: err.message }));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Automatically fetch branches once the base config is populated
|
||||||
|
await loadGitBranches();
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateLogoPreview(logoPath) {
|
function updateLogoPreview(logoPath) {
|
||||||
@@ -1183,6 +1193,42 @@ async function testLdapConnection() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function loadGitBranches() {
|
||||||
|
const branchSelect = document.getElementById('cfg-git-branch');
|
||||||
|
const currentVal = branchSelect.value;
|
||||||
|
|
||||||
|
// Disable mapping while loading
|
||||||
|
branchSelect.disabled = true;
|
||||||
|
branchSelect.innerHTML = `<option value="${currentVal}">${currentVal} (Loading...)</option>`;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const branches = await api('GET', '/settings/branches');
|
||||||
|
branchSelect.innerHTML = '';
|
||||||
|
|
||||||
|
// Always ensure the currently saved branch is an option
|
||||||
|
if (currentVal && !branches.includes(currentVal)) {
|
||||||
|
branches.unshift(currentVal);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (branches.length === 0) {
|
||||||
|
branchSelect.innerHTML = `<option value="main">main</option>`;
|
||||||
|
} else {
|
||||||
|
branches.forEach(b => {
|
||||||
|
const opt = document.createElement('option');
|
||||||
|
opt.value = b;
|
||||||
|
opt.textContent = b;
|
||||||
|
if (b === currentVal) opt.selected = true;
|
||||||
|
branchSelect.appendChild(opt);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
showSettingsAlert('warning', `Failed to load branches: ${err.message}`);
|
||||||
|
branchSelect.innerHTML = `<option value="${currentVal}">${currentVal}</option>`;
|
||||||
|
} finally {
|
||||||
|
branchSelect.disabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Update / Version Management
|
// Update / Version Management
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
@@ -1219,12 +1265,12 @@ async function loadVersionInfo() {
|
|||||||
|
|
||||||
let html = `<div class="row g-3">
|
let html = `<div class="row g-3">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="border rounded p-3">
|
<div class="border rounded p-3 h-100">
|
||||||
<div class="text-muted small mb-1">${t('settings.currentVersion')}</div>
|
<div class="text-muted small mb-1">${t('settings.currentVersion')}</div>
|
||||||
<div class="fw-bold fs-5">${esc(currentTag || currentCommit)}</div>
|
<div class="fw-bold fs-5">${esc(currentTag || currentCommit)}</div>
|
||||||
${currentTag ? `<div class="text-muted small font-monospace">${t('settings.commitHash')}: ${esc(currentCommit)}</div>` : ''}
|
${currentTag ? `<div class="text-muted small font-monospace">${t('settings.commitHash')}: ${esc(currentCommit)}</div>` : ''}
|
||||||
<div class="text-muted small">${t('settings.branch')}: <strong>${esc(current.branch || 'unknown')}</strong></div>
|
<div class="text-muted small">${t('settings.branch')}: <strong>${esc(current.branch || 'unknown')}</strong></div>
|
||||||
<div class="text-muted small">${esc(current.date || '')}</div>
|
<div class="text-muted small mt-2"><i class="bi bi-clock me-1"></i>${formatDate(current.date)}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
@@ -1235,17 +1281,17 @@ async function loadVersionInfo() {
|
|||||||
? `<span class="badge bg-warning text-dark ms-1">${t('settings.updateAvailable')}</span>`
|
? `<span class="badge bg-warning text-dark ms-1">${t('settings.updateAvailable')}</span>`
|
||||||
: `<span class="badge bg-success ms-1">${t('settings.upToDate')}</span>`;
|
: `<span class="badge bg-success ms-1">${t('settings.upToDate')}</span>`;
|
||||||
html += `<div class="col-md-6">
|
html += `<div class="col-md-6">
|
||||||
<div class="border rounded p-3 ${needsUpdate ? 'border-warning' : ''}">
|
<div class="border rounded p-3 h-100 ${needsUpdate ? 'border-warning' : ''}">
|
||||||
<div class="text-muted small mb-1">${t('settings.latestVersion')} ${badge}</div>
|
<div class="text-muted small mb-1">${t('settings.latestVersion')} ${badge}</div>
|
||||||
<div class="fw-bold fs-5">${esc(latestTag || latestCommit)}</div>
|
<div class="fw-bold fs-5">${esc(latestTag || latestCommit)}</div>
|
||||||
${latestTag ? `<div class="text-muted small font-monospace">${t('settings.commitHash')}: ${esc(latestCommit)}</div>` : ''}
|
${latestTag ? `<div class="text-muted small font-monospace">${t('settings.commitHash')}: ${esc(latestCommit)}</div>` : ''}
|
||||||
<div class="text-muted small">${t('settings.branch')}: <strong>${esc(latest.branch || 'unknown')}</strong></div>
|
<div class="text-muted small">${t('settings.branch')}: <strong>${esc(latest.branch || 'unknown')}</strong></div>
|
||||||
<div class="text-muted small">${esc(latest.message || '')}</div>
|
<div class="text-muted small mt-2"><i class="bi bi-clock me-1"></i>${formatDate(latest.date)}</div>
|
||||||
<div class="text-muted small">${esc(latest.date || '')}</div>
|
${latest.message ? `<div class="text-muted small mt-1 border-top pt-1 text-truncate" title="${esc(latest.message)}"><i class="bi bi-chat-text me-1"></i>${esc(latest.message)}</div>` : ''}
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
} else if (data.error) {
|
} else if (data.error) {
|
||||||
html += `<div class="col-md-6"><div class="alert alert-warning mb-0">${esc(data.error)}</div></div>`;
|
html += `<div class="col-md-6"><div class="alert alert-warning h-100 mb-0">${esc(data.error)}</div></div>`;
|
||||||
}
|
}
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
|
|||||||
@@ -93,19 +93,22 @@
|
|||||||
},
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
"title": "Systemeinstellungen",
|
"title": "Systemeinstellungen",
|
||||||
"tabSystem": "Systemkonfiguration",
|
"tabSystem": "NetBird MSP System",
|
||||||
"tabNpm": "NPM Integration",
|
"tabNpm": "NPM Proxy",
|
||||||
"tabImages": "Docker Images",
|
"tabImages": "NetBird Docker Images",
|
||||||
"tabBranding": "Branding",
|
"tabBranding": "Branding",
|
||||||
"tabUsers": "Benutzer",
|
"tabUsers": "Benutzer",
|
||||||
"tabAzure": "Azure AD",
|
"tabAzure": "Azure AD",
|
||||||
"tabDns": "Windows DNS",
|
"tabDns": "Windows DNS",
|
||||||
"tabLdap": "LDAP / AD",
|
"tabLdap": "LDAP / AD",
|
||||||
"tabUpdate": "Updates",
|
"tabUpdate": "NetBird MSP Updates",
|
||||||
"tabSecurity": "Sicherheit",
|
"tabSecurity": "Sicherheit",
|
||||||
|
"groupUsers": "Benutzerverwaltung",
|
||||||
|
"groupSystem": "Systemkonfiguration",
|
||||||
|
"groupExternal": "Umsysteme",
|
||||||
"baseDomain": "Basis-Domain",
|
"baseDomain": "Basis-Domain",
|
||||||
"baseDomainPlaceholder": "ihredomain.com",
|
"baseDomainPlaceholder": "ihredomain.com",
|
||||||
"baseDomainHint": "Kunden erhalten Subdomains: kunde.ihredomain.com",
|
"baseDomainHint": "Kunden erhalten Subdomains: kundenname.ihredomain.com",
|
||||||
"adminEmail": "Admin E-Mail",
|
"adminEmail": "Admin E-Mail",
|
||||||
"adminEmailPlaceholder": "admin@ihredomain.com",
|
"adminEmailPlaceholder": "admin@ihredomain.com",
|
||||||
"dataDir": "Datenverzeichnis",
|
"dataDir": "Datenverzeichnis",
|
||||||
@@ -115,7 +118,7 @@
|
|||||||
"relayBasePort": "Relay-Basisport",
|
"relayBasePort": "Relay-Basisport",
|
||||||
"relayBasePortHint": "Erster UDP-Port für Relay. Bereich: Basis bis Basis+99",
|
"relayBasePortHint": "Erster UDP-Port für Relay. Bereich: Basis bis Basis+99",
|
||||||
"dashboardBasePort": "Dashboard-Basisport",
|
"dashboardBasePort": "Dashboard-Basisport",
|
||||||
"dashboardBasePortHint": "Basisport für Kunden-Dashboards. Kunde N erhält Basis+N",
|
"dashboardBasePortHint": "Basisport für Kunden-Dashboards. Der erste Kunde erhält Basis+1",
|
||||||
"saveSystemSettings": "Systemeinstellungen speichern",
|
"saveSystemSettings": "Systemeinstellungen speichern",
|
||||||
"npmDescription": "NPM verwendet JWT-Authentifizierung. Geben Sie Ihre NPM-Zugangsdaten ein. Das System meldet sich automatisch an.",
|
"npmDescription": "NPM verwendet JWT-Authentifizierung. Geben Sie Ihre NPM-Zugangsdaten ein. Das System meldet sich automatisch an.",
|
||||||
"npmApiUrl": "NPM API URL",
|
"npmApiUrl": "NPM API URL",
|
||||||
|
|||||||
@@ -114,16 +114,19 @@
|
|||||||
},
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
"title": "System Settings",
|
"title": "System Settings",
|
||||||
"tabSystem": "System Configuration",
|
"tabSystem": "NetBird MSP System",
|
||||||
"tabNpm": "NPM Integration",
|
"tabNpm": "NPM Proxy",
|
||||||
"tabImages": "Docker Images",
|
"tabImages": "NetBird Docker Images",
|
||||||
"tabBranding": "Branding",
|
"tabBranding": "Branding",
|
||||||
"tabUsers": "Users",
|
"tabUsers": "Users",
|
||||||
"tabAzure": "Azure AD",
|
"tabAzure": "Azure AD",
|
||||||
"tabDns": "Windows DNS",
|
"tabDns": "Windows DNS",
|
||||||
"tabLdap": "LDAP / AD",
|
"tabLdap": "LDAP / AD",
|
||||||
"tabUpdate": "Updates",
|
"tabUpdate": "NetBird MSP Updates",
|
||||||
"tabSecurity": "Security",
|
"tabSecurity": "Security",
|
||||||
|
"groupUsers": "User Management",
|
||||||
|
"groupSystem": "System Configuration",
|
||||||
|
"groupExternal": "External Systems",
|
||||||
"baseDomain": "Base Domain",
|
"baseDomain": "Base Domain",
|
||||||
"baseDomainPlaceholder": "yourdomain.com",
|
"baseDomainPlaceholder": "yourdomain.com",
|
||||||
"baseDomainHint": "Customers get subdomains: customer.yourdomain.com",
|
"baseDomainHint": "Customers get subdomains: customer.yourdomain.com",
|
||||||
|
|||||||
@@ -5,15 +5,15 @@
|
|||||||
:80 {
|
:80 {
|
||||||
# Embedded IdP OAuth2/OIDC endpoints
|
# Embedded IdP OAuth2/OIDC endpoints
|
||||||
handle /oauth2/* {
|
handle /oauth2/* {
|
||||||
reverse_proxy netbird-kunde{{ customer_id }}-management:80
|
reverse_proxy netbird-{{ subdomain }}-management:80
|
||||||
}
|
}
|
||||||
|
|
||||||
# NetBird Management API + gRPC
|
# NetBird Management API + gRPC
|
||||||
handle /api/* {
|
handle /api/* {
|
||||||
reverse_proxy netbird-kunde{{ customer_id }}-management:80
|
reverse_proxy netbird-{{ subdomain }}-management:80
|
||||||
}
|
}
|
||||||
handle /management.ManagementService/* {
|
handle /management.ManagementService/* {
|
||||||
reverse_proxy netbird-kunde{{ customer_id }}-management:80 {
|
reverse_proxy netbird-{{ subdomain }}-management:80 {
|
||||||
transport http {
|
transport http {
|
||||||
versions h2c
|
versions h2c
|
||||||
}
|
}
|
||||||
@@ -22,15 +22,20 @@
|
|||||||
|
|
||||||
# NetBird Signal gRPC
|
# NetBird Signal gRPC
|
||||||
handle /signalexchange.SignalExchange/* {
|
handle /signalexchange.SignalExchange/* {
|
||||||
reverse_proxy netbird-kunde{{ customer_id }}-signal:80 {
|
reverse_proxy netbird-{{ subdomain }}-signal:80 {
|
||||||
transport http {
|
transport http {
|
||||||
versions h2c
|
versions h2c
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# NetBird Relay WebSocket (rels://)
|
||||||
|
handle /relay* {
|
||||||
|
reverse_proxy netbird-{{ subdomain }}-relay:80
|
||||||
|
}
|
||||||
|
|
||||||
# Default: NetBird Dashboard
|
# Default: NetBird Dashboard
|
||||||
handle {
|
handle {
|
||||||
reverse_proxy netbird-kunde{{ customer_id }}-dashboard:80
|
reverse_proxy netbird-{{ subdomain }}-dashboard:80
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ services:
|
|||||||
# --- Caddy Reverse Proxy (entry point) ---
|
# --- Caddy Reverse Proxy (entry point) ---
|
||||||
netbird-caddy:
|
netbird-caddy:
|
||||||
image: caddy:2-alpine
|
image: caddy:2-alpine
|
||||||
container_name: netbird-kunde{{ customer_id }}-caddy
|
container_name: netbird-{{ subdomain }}-caddy
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- {{ docker_network }}
|
- {{ docker_network }}
|
||||||
@@ -18,7 +18,7 @@ services:
|
|||||||
# --- NetBird Management (with embedded IdP) ---
|
# --- NetBird Management (with embedded IdP) ---
|
||||||
netbird-management:
|
netbird-management:
|
||||||
image: {{ netbird_management_image }}
|
image: {{ netbird_management_image }}
|
||||||
container_name: netbird-kunde{{ customer_id }}-management
|
container_name: netbird-{{ subdomain }}-management
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- {{ docker_network }}
|
- {{ docker_network }}
|
||||||
@@ -39,7 +39,7 @@ services:
|
|||||||
# --- NetBird Signal ---
|
# --- NetBird Signal ---
|
||||||
netbird-signal:
|
netbird-signal:
|
||||||
image: {{ netbird_signal_image }}
|
image: {{ netbird_signal_image }}
|
||||||
container_name: netbird-kunde{{ customer_id }}-signal
|
container_name: netbird-{{ subdomain }}-signal
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- {{ docker_network }}
|
- {{ docker_network }}
|
||||||
@@ -49,7 +49,7 @@ services:
|
|||||||
# --- NetBird Relay ---
|
# --- NetBird Relay ---
|
||||||
netbird-relay:
|
netbird-relay:
|
||||||
image: {{ netbird_relay_image }}
|
image: {{ netbird_relay_image }}
|
||||||
container_name: netbird-kunde{{ customer_id }}-relay
|
container_name: netbird-{{ subdomain }}-relay
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- {{ docker_network }}
|
- {{ docker_network }}
|
||||||
@@ -61,7 +61,7 @@ services:
|
|||||||
# --- NetBird Dashboard ---
|
# --- NetBird Dashboard ---
|
||||||
netbird-dashboard:
|
netbird-dashboard:
|
||||||
image: {{ netbird_dashboard_image }}
|
image: {{ netbird_dashboard_image }}
|
||||||
container_name: netbird-kunde{{ customer_id }}-dashboard
|
container_name: netbird-{{ subdomain }}-dashboard
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- {{ docker_network }}
|
- {{ docker_network }}
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
unable to get image 'netbirdmsp-appliance-netbird-msp-appliance': permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.51/images/netbirdmsp-appliance-netbird-msp-appliance/json": dial unix /var/run/docker.sock: connect: permission denied
|
|
||||||
Reference in New Issue
Block a user