Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Shell scripts must keep LF endings or bash breaks on Linux/Mac
setup.sh text eol=lf
*.sh text eol=lf

# Windows batch files need CRLF
setup.bat text eol=crlf
*.bat text eol=crlf
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,19 @@ docs/
# Local launcher scripts (machine-specific, not needed in repo)
*.bat
*.ps1
# ...but the guided setup scripts ship with the project
!setup.ps1
!setup.sh
!setup.bat
!start.sh
!start.bat

# Frontend dev scripts and build artifacts
frontend/*.cjs
frontend/test.js
frontend/test_output.txt
frontend/src/*.bak

# Local .env backups (created when testing setup scripts)
*.env.bak
*.env.backup
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,32 @@ cd CITY_NET

---

## Quick Setup (Guided Script)

> ## ⚠️ NEVER RUN SCRIPTS FROM AN UNTRUSTED SOURCE
>
> Only use `setup.ps1` / `setup.sh` if you downloaded them **directly from this repository** ([github.com/over2take/CITY_NET](https://github.com/over2take/CITY_NET)). Scripts can do anything your user account can do — if someone sends you a "setup script" for CITY_NET from anywhere else (Discord, forums, a re-upload, a YouTube description), **do not run it.** When in doubt, open the script in a text editor and read it first, or use the manual setup below instead — it's only a few copy-paste steps.

If you'd rather not edit config files by hand, run the guided setup script. It supports both install methods — Docker (recommended) or manual with Node.js — generates a secure `JWT_SECRET` for you, asks for your admin login and port, optionally sets up DuckDNS (Docker only), writes the `.env` files, and can build and launch the app — all from a few prompts.

**Windows:** double-click `setup.bat`, or from PowerShell:
```powershell
powershell -ExecutionPolicy Bypass -File setup.ps1
```

**Linux/Mac:**
```bash
bash setup.sh
```

Requires Docker (recommended) or Node.js v18+ to be installed. For manual configuration instead, follow the options below.

**Starting the app later:**
- **Docker install:** containers auto-restart; or run `docker compose up -d`
- **Node.js install:** double-click `start.bat` (Windows) or run `bash start.sh` (Linux/Mac). The server runs in that terminal — closing it stops the app.

---

## Option A: Docker (Recommended)

### 2. Configure environment
Expand Down
4 changes: 4 additions & 0 deletions setup.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@echo off
REM City_Net guided setup - double-click launcher for setup.ps1
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0setup.ps1"
pause
Loading
Loading