name: Deploy on: push: branches: - main tags: - "v*" jobs: release: if: startsWith(gitea.ref_name, 'v') runs-on: shell steps: - name: Create Release env: VERSION: ${{ gitea.ref_name }} GITEA_API: ${{ gitea.api_url }} GITEA_REPO: ${{ gitea.repository }} run: | set -e exec 2>&1 BARE="/docker/gitea/gitea/git/repositories/remco/epicnext-cms.git" echo "=== Creating release for ${VERSION} ===" PREV_TAG="$(git -C "$BARE" tag --sort=-creatordate | head -2 | tail -1 || echo '')" if [ -n "$PREV_TAG" ] && [ "$PREV_TAG" != "$VERSION" ]; then CHANGELOG="$(git -C "$BARE" log --oneline --no-decorate --max-count=50 "${PREV_TAG}..${VERSION}")" [ -z "$CHANGELOG" ] && CHANGELOG="No commit changes since ${PREV_TAG}" else TOTAL="$(git -C "$BARE" rev-list --count "${VERSION}" 2>/dev/null || echo '?')" CHANGELOG="Initial release of EpicNext-CMS (${TOTAL} commits)." fi [ -z "$CHANGELOG" ] && CHANGELOG="Initial release" # Pin the other components at their current commits so the release is reproducible. CAT_REF="$(git ls-remote https://epicnabbo.nl Beta-3 2>/dev/null | awk '{print $1}')" NITRO_REF="$(git ls-remote https://github.com main 2>/dev/null | awk '{print $1}')" RENDER_REF="$(git ls-remote https://github.com main 2>/dev/null | awk '{print $1}')" EMU_REF="$(git ls-remote https://github.com main 2>/dev/null | awk '{print $1}')" { echo "# EpicNext-CMS ${VERSION}" echo "" echo "> Modern, high-performance CMS for Habbo hotel emulators — built on Next.js 16, React 19 and Prisma 7. Integrates with Polaris / Arcturus Morningstar databases." echo "" echo "## Menu" echo "- [What is EpicNext-CMS?](#what-is-epicnext-cms)" echo "- [System Requirements](#system-requirements)" echo "- [Installation Wizard](#installation-wizard)" echo "- [How it is used](#how-it-is-used)" echo "- [Changes](#changes)" echo "- [Linked repositories](#linked-repositories)" echo "" echo '' echo "## What is EpicNext-CMS?" echo "" echo "EpicNext-CMS is a full public-facing hotel website plus an administrative panel. It features NextAuth authentication (argon2id/bcrypt with MD5 upgrade), real-time RCON communication with the emulator, Server-Sent Events for live radio, smooth page transitions and extensive extensibility. Full documentation: https://epicnabbo.nl" echo "" echo '' echo "## System Requirements" echo "" echo "What you need to install before running the CMS:" echo "" echo "| Component | Version | Notes |" echo "| --------- | ------- | ----- |" echo "| Node.js | >= 22 | Required by Next.js 16 |" echo "| pnpm | >= 10.33.4 | Package manager (npm/yarn not supported) |" echo "| MySQL / MariaDB | 8.0+ / 10.6+ | Shared with the emulator |" echo "| Redis | 7.x+ | Optional — caching, rate limiting, SSE |" echo "| Java | 17+ | Only if building the emulator |" echo "| Maven | 3.9+ | Only if building the emulator |" echo "" echo "The CMS shares its database with the Polaris / Arcturus emulator. It only reads/writes emulator-owned tables and never alters them." echo "" echo '' echo "## Installation Wizard" echo "" echo "A complete hotel stack = **EpicNext-CMS** (this repo) + **Polaris Emulator** + **Nitro V3 client** + **Catalogus** data. Follow the steps in order." echo "" echo "**Quick links:** [Full setup guide](https://github.com) · [EpicNext-CMS repo](https://epicnabbo.nl) · [Reference configs in this repo](https://epicnabbo.nl/src/branch/main/setup)" echo "" echo "### 1. Clone & Install the CMS" echo '```bash' echo "git clone https://epicnabbo.nl.git" echo "cd EpicNext-Cms" echo "pnpm install" echo '```' echo "" echo "### 2. Database Setup" echo "" echo "The CMS shares the emulator database. Import the Polaris/Arcturus database first, then create the CMS schema:" echo '```sql' echo "CREATE DATABASE IF NOT EXISTS epicnext_cms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" echo '```' echo "" echo "### 3. Configure Environment" echo '```bash' echo "cp .env.example .env" echo '```' echo "" echo "Edit .env with at minimum: DATABASE_URL, AUTH_SECRET, HOTEL_NAME and APP_URL. See .env.example for RCON, email, Redis, OAuth and PayPal options." echo "" echo "### 4. Generate Prisma Client" echo '```bash' echo "pnpm prisma:generate" echo '```' echo "" echo "### 5. Run CMS Migrations" echo '```bash' echo "pnpm db:migrate" echo '```' echo "" echo "Creates all CMS-owned tables (website_*, radio_*, acl_*, admin_audit_log). Emulator tables are never touched. Check status with pnpm db:migrate:status." echo "" echo "### 6. Polaris Emulator" echo "" echo "Clone and build the emulator (requires Java 17+ and Maven 3.9+):" echo '```bash' echo "git clone https://github.com /var/www/emulator" echo "cd /var/www/emulator/Emulator" echo "mvn clean package" echo '```' echo "" echo "Place the built Habbo-*-jar-with-dependencies.jar next to **config.ini** (see [setup/emulator/config.ini](https://epicnabbo.nl/src/branch/main/setup/emulator/config.ini)), then create a systemd unit from [setup/emulator/emulator.service](https://epicnabbo.nl/src/branch/main/setup/emulator/emulator.service) with the [emulator](https://epicnabbo.nl/src/branch/main/setup/emulator/emulator) launcher so it starts on boot. The bundled update-Nitrov3.sh in this repo automates cloning, building and updating the emulator and Nitro — run it any time to pull the latest commits and rebuild:" echo '```bash' echo "./update-Nitrov3.sh" echo '```' echo "" echo "### 7. Nitro V3 & Renderer" echo "" echo "Clone both Nitro repos and build the client:" echo '```bash' echo "git clone https://github.com /var/www/Nitro_Render_V3" echo "git clone https://github.com /var/www/Nitro-V3" echo "cd /var/www/Nitro_Render_V3 && yarn install && yarn link" echo "cd /var/www/Nitro-V3 && yarn install && yarn link \"@nitrots/nitro-renderer\" && yarn build" echo '```' echo "" echo "Copy the reference configs from [setup/nitro/](https://epicnabbo.nl/src/branch/main/setup/nitro) into /var/www/Nitro-V3/public/configuration, keep them as *.json, and replace **MY_DOMAIN** with your domain, API URL and gamedata paths (see the Full setup guide, NitroV3_And_Emulator.md)." echo "" echo "### 8. Catalogus (catalog & gamedata)" echo "" echo "Catalogus holds the daily-updated catalog/gamedata. Clone the Beta-3 branch alongside the other components:" echo '```bash' echo "git clone -b Beta-3 https://epicnabbo.nl /var/www/catalogus" echo '```' echo "" echo "### 9. Build & Start the CMS" echo '```bash' echo "# Development (hot reload)" echo "pnpm dev" echo "" echo "# Production" echo "pnpm build && pnpm start" echo '```' echo "" echo "Open http://localhost:3000 in your browser." echo "" echo "### 10. First Login" echo "" echo "1. Register at /register, or log in with an existing emulator account." echo "2. Grant admin access: UPDATE users SET rank = 7 WHERE username = 'yourname';" echo "3. Visit /admin and configure your hotel via Admin -> CMS Settings." echo "" echo '' echo "## How it is used" echo "" echo "- Public site: browse the hotel, news, radio and the Nitro client at /client." echo "- Admin panel: /admin for CMS settings, theming (12 presets), users, radio and more." echo "- Background jobs: run pnpm jobs:worker for daily backups and cleanup." echo "- Optional: Cloudflare Turnstile / reCAPTCHA, OpenAI moderation and email/PayPal via .env." echo "" echo '' echo "## Changes" echo '```' echo "${CHANGELOG}" echo '```' echo "" echo ''