secubox-openwrt/package/secubox/secubox-app-nextcloud
CyberMind-FR 2bb40d9419 fix(users,routing): Add gitea/jellyfin support and fix mitmproxy routes
secubox-users:
- Add gitea and jellyfin to supported services list
- Add create/update/delete handlers for gitea (via API) and jellyfin
- Update CLI help and status display to include new services

luci-app-secubox-users:
- Add jellyfin service checkbox and badge in frontend
- Update RPCD handler to check jellyfin service status

mitmproxy routing fix:
- nextcloudctl: Use host LAN IP instead of 127.0.0.1 for WAF routes
  (mitmproxy runs in container, can't reach host's localhost)
- metablogizerctl: Same fix for mitmproxy route registration
- mitmproxyctl: Fix sync_metablogizer_routes to use host IP

This fixes 502/403 errors when accessing services through HAProxy->mitmproxy
because the mitmproxy container couldn't route to 127.0.0.1 on the host.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-04 10:16:07 +01:00
..
files fix(users,routing): Add gitea/jellyfin support and fix mitmproxy routes 2026-03-04 10:16:07 +01:00
Makefile feat(nextcloud): Migrate to LXC with full-stack enhancement 2026-02-16 07:49:17 +01:00
README.md feat(nextcloud): Enhance LXC package with storage stats and backup management 2026-02-17 14:41:04 +01:00

SecuBox Nextcloud

Self-hosted file sync and collaboration platform running in a Debian LXC container on OpenWrt. Features MariaDB database, Redis caching, and Nginx web server.

Installation

opkg install secubox-app-nextcloud luci-app-nextcloud

Quick Start

# Install Nextcloud (creates LXC container)
nextcloudctl install

# Start service
/etc/init.d/nextcloud start

# Access web interface
# http://router-ip:8080

Configuration

UCI config file: /etc/config/nextcloud

uci set nextcloud.main.enabled='1'
uci set nextcloud.main.domain='cloud.example.com'
uci set nextcloud.main.http_port='8080'
uci set nextcloud.main.admin_user='admin'
uci set nextcloud.main.memory_limit='1G'
uci set nextcloud.main.upload_max='512M'
uci commit nextcloud

CLI Commands

nextcloudctl install          # Create Debian LXC, install Nextcloud stack
nextcloudctl uninstall        # Remove container (preserves data)
nextcloudctl update           # Update Nextcloud to latest version
nextcloudctl start            # Start Nextcloud service
nextcloudctl stop             # Stop Nextcloud service
nextcloudctl restart          # Restart Nextcloud service
nextcloudctl status           # Show service status (JSON)
nextcloudctl logs [-f]        # Show container logs
nextcloudctl shell            # Open shell in container

nextcloudctl occ <cmd>        # Run Nextcloud OCC command
nextcloudctl backup [name]    # Create backup of data and database
nextcloudctl restore <name>   # Restore from backup
nextcloudctl list-backups     # List available backups

nextcloudctl ssl-enable <domain>  # Register with HAProxy for SSL
nextcloudctl ssl-disable          # Remove HAProxy registration

Architecture

┌─────────────────────────────────────────────────────────────┐
│                     OpenWrt Host                            │
│  ┌───────────────────────────────────────────────────────┐  │
│  │              LXC: nextcloud (Debian 12)               │  │
│  │  ┌─────────┐  ┌─────────┐  ┌─────────┐  ┌─────────┐  │  │
│  │  │ Nginx   │  │Nextcloud│  │ MariaDB │  │  Redis  │  │  │
│  │  │ :8080   │→ │ PHP-FPM │→ │ :3306   │  │ :6379   │  │  │
│  │  └─────────┘  └─────────┘  └─────────┘  └─────────┘  │  │
│  │                    ↓                                  │  │
│  │         /srv/nextcloud (bind mount)                   │  │
│  └───────────────────────────────────────────────────────┘  │
│                          ↓                                   │
│  ┌───────────────────────────────────────────────────────┐  │
│  │           HAProxy (optional SSL termination)          │  │
│  │      cloud.example.com:443 → nextcloud:8080           │  │
│  └───────────────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────────┘

Features

  • File sync and share with web, desktop, and mobile clients
  • Calendar and contacts (CalDAV/CardDAV)
  • Collaborative document editing
  • End-to-end encryption support
  • Debian LXC container with PHP 8.2
  • MariaDB database with optimized settings
  • Redis caching for improved performance
  • Nginx with Nextcloud-optimized config
  • HAProxy integration for SSL/HTTPS
  • Automated backup and restore
  • Memory limit via cgroups
  • Auto-start on boot

Data Locations

/srv/nextcloud/
├── data/           # Nextcloud user data
├── config/         # Nextcloud config.php
└── backups/        # Automated backups

SSL with HAProxy

# Enable HTTPS via HAProxy with Let's Encrypt
nextcloudctl ssl-enable cloud.example.com

# Access via HTTPS
https://cloud.example.com

Dependencies

  • lxc - Container runtime
  • lxc-common - LXC utilities
  • tar, wget-ssl, unzip, xz - Archive tools
  • jsonfilter - JSON parsing
  • openssl-util - SSL utilities

License

Apache-2.0