Skip to content

Commit 9f0a9a7

Browse files
committed
docs: update readme with self-hosting instructions and deployment details
1 parent 51ba605 commit 9f0a9a7

File tree

1 file changed

+42
-8
lines changed

1 file changed

+42
-8
lines changed

README.md

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,54 @@ A clean Next.js frontend for interacting with a CopyParty file server. Log in us
1010
- Session restore via cookie and local storage of the `serverUrl`
1111

1212
## Requirements
13-
- Node.js 18+ and npm
13+
- Node.js 18+ and npm (or pnpm)
1414
- A running CopyParty server (for example `http://127.0.0.1:3923`)
15-
- Set a cookie encryption secret: add `COOKIE_SECRET=your-long-random-secret` to `.env`
15+
- Set a cookie encryption secret: add `COOKIE_SECRET=your-long-random-secret` to your environment
1616

17-
18-
## Quick Start
17+
## Quick Start (dev)
1918
- Install dependencies: `npm install`
2019
- Start dev server: `npm run dev`
21-
- Open the URL shown in the terminal (commonly `http://localhost:3000`)
20+
- Open the URL shown in the terminal (default `http://localhost:3925`)
2221

2322
## Configuration
2423
- `COOKIE_SECRET` (recommended) or `NEXT_PUBLIC_COOKIE_SECRET` encrypts the auth cookie using AES‑256‑GCM.
2524
- No username is required; CopyParty APIs authenticate with the password only.
2625
- The app persists only `serverUrl` in `localStorage`. The password is never stored in web storage.
2726

27+
## Self-Hosting
28+
You can self-host in two ways: using a prebuilt ZIP from Releases (standalone build), or building locally.
29+
30+
### Option A: Download ZIP from GitHub Releases (standalone)
31+
1. Download the latest `build-front.zip` from the project’s Releases page.
32+
- `wget https://github.com/andrecrjr/copyparty-front/releases/0.0.1/download/build-front.zip` or latest one check the Releases page.
33+
- Alternatively, build it yourself using the instructions below.
34+
2. Unzip it: `unzip build-front.zip` (this creates `build-front/`).
35+
3. Change into the standalone bundle: `cd build-front/.next/standalone`.
36+
4. Set environment variables (at minimum a strong cookie secret, and your desired port):
37+
- macOS/Linux: `COOKIE_SECRET=your-long-random-secret PORT=3925 NODE_ENV=production node server.js`
38+
- Windows (PowerShell): `$env:COOKIE_SECRET="your-long-random-secret"; $env:PORT="3925"; $env:NODE_ENV="production"; node server.js`
39+
5. Open `http://localhost:3925` and log in with your CopyParty server URL and password.
40+
41+
Notes:
42+
- The ZIP includes `.next/standalone` with `server.js` and minimal node_modules, plus static assets under `.next/standalone/.next/static` and `public` so it runs without the full dev environment.
43+
- Behind a reverse proxy, ensure `x-forwarded-proto` is set to `https` to enable secure cookies.
44+
45+
### Option B: Build it yourself
46+
1. Clone the repo and install deps:
47+
- `git clone <your-repo-url>`
48+
- `cd copyparty-front && npm install`
49+
2. Build production: `npm run build` (Next is configured with `output: 'standalone'`).
50+
3. Prepare the standalone bundle (assets copied into the standalone directory):
51+
- `cp -r public .next/standalone/ && cp -r .next/static .next/standalone/.next/`
52+
- Or simply run: `make zip-deploy` (creates `build-front/` and `build-front.zip`).
53+
Note: the `zip-deploy` Makefile target currently uses `pnpm`. If you use `npm`, either replace that line with `npm run build` or run the copy commands above manually.
54+
4. Start the standalone server:
55+
- `cd .next/standalone`
56+
- `COOKIE_SECRET=your-long-random-secret PORT=3925 NODE_ENV=production node server.js`
57+
5. Visit `http://localhost:3925`.
58+
59+
Alternative start (non-standalone): `npm run serve` (uses `next start --port 3925`). Use this when running on a machine with the full Node environment available.
60+
2861
## Usage
2962
- On the login screen, enter your CopyParty server URL and password, then Connect.
3063
- Browse folders, switch between grid/list, and use breadcrumbs to navigate.
@@ -41,13 +74,14 @@ A clean Next.js frontend for interacting with a CopyParty file server. Log in us
4174

4275
## Security Notes
4376
- Always set `COOKIE_SECRET` in production; the default dev fallback is insecure.
44-
- In production, cookies are `httpOnly`, `sameSite=lax`, and `secure` when served over HTTPS.
77+
- In production, cookies are `httpOnly`, `sameSite=lax`, and `secure` when served over HTTPS (or when `x-forwarded-proto=https`).
4578
- The browser never stores the password; it is encrypted server‑side and only forwarded to CopyParty during API requests.
4679

4780
## Build and Deploy
4881
- Production build: `npm run build`
49-
- Start: `npm start`
50-
- Deploy to your platform of choice (e.g., Vercel). Ensure `COOKIE_SECRET` is configured and your app is served over HTTPS.
82+
- Start (standalone): `COOKIE_SECRET=your-long-random-secret PORT=3925 node .next/standalone/server.js`
83+
- Start (Next server): `npm run serve`
84+
- Deploy to your platform of choice (e.g., a VM or container). Ensure `COOKIE_SECRET` is configured and your app is served over HTTPS.
5185

5286
## Acknowledgements
5387
- Powered by [CopyParty](https://github.com/9001/copyparty) and Next.js and me.

0 commit comments

Comments
 (0)