You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+75-6Lines changed: 75 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,6 +125,9 @@ When an event reaches its deadline, the share link stops working, all VM credent
125
125
126
126
```bash
127
127
bash setup.sh
128
+
129
+
cp .env.example .env
130
+
128
131
docker compose --profile master up -d --build
129
132
```
130
133
@@ -136,12 +139,7 @@ For development with hot-reloading:
136
139
docker compose --profile dev up --build
137
140
```
138
141
139
-
To run a slave node on another machine:
140
-
141
-
```bash
142
-
bash setup.sh
143
-
docker compose --profile slave up -d --build
144
-
```
142
+
To run a slave node on another machine, use the `slave` and follow the guide on the frontend:
145
143
146
144
## Configuration
147
145
@@ -158,6 +156,77 @@ Copy `.env.example` to `.env` and adjust as needed. Key variables:
158
156
|`BACKEND_PORT`|`8080`| Backend API port |
159
157
|`VITE_PORT`|`3000`| Frontend port |
160
158
159
+
## Deployment
160
+
161
+
### Reverse Proxy (nginx)
162
+
163
+
In production, you should place nginx in front of the application to serve both the frontend and backend on a single port. A ready-to-use configuration is provided in [`nginx.conf`](./nginx.conf).
- Listens on port **80** and routes traffic to the frontend (port 3000) and backend (port 8080)
175
+
- Proxies WebSocket connections for VM streaming (`/tunnel`)
176
+
- All other backend routes (`/auth`, `/vms`, `/images`, etc.) are forwarded to the API
177
+
178
+
> Note: If you change port configuration for the deployment, we trust you will update the reverse proxy configuration accordingly.
179
+
180
+
After enabling the reverse proxy, update your `.env` so the frontend calls the backend through nginx instead of directly:
181
+
182
+
```env
183
+
VITE_API_DOMAIN=http://your-domain.com
184
+
FRONTEND_URL=http://your-domain.com
185
+
```
186
+
187
+
### Firewall
188
+
189
+
VNC servers listen on ports 5900-5999 on the host. These must **not** be exposed to the network -- VM streaming is handled securely through the Guacamole WebSocket tunnel. Block external access with your firewall:
190
+
191
+
```bash
192
+
# ufw
193
+
sudo ufw deny 5900:5999/tcp
194
+
195
+
# or iptables
196
+
sudo iptables -A INPUT -p tcp --dport 5900:5999 -j DROP
197
+
```
198
+
199
+
### SSL is STRONGLY RECOMMENDED
200
+
201
+
Distribox should be served over HTTPS. Without SSL:
202
+
203
+
-**Clipboard will not work.** The browser Clipboard API (`navigator.clipboard`) is only available in [secure contexts](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API#security_considerations) (HTTPS). Copying VM credentials, event links, or any other data from the dashboard will silently fail on plain HTTP.
204
+
-**Pasting into VMs will not work.** The Guacamole client uses the Clipboard API to sync your clipboard with the remote VM. Without HTTPS, you will not be able to paste text into a VM session from your browser.
205
+
206
+
The easiest way to set up SSL is with [Certbot](https://certbot.eff.org/) (Let's Encrypt):
207
+
208
+
```bash
209
+
sudo apt install certbot python3-certbot-nginx
210
+
sudo certbot --nginx -d your-domain.com
211
+
```
212
+
213
+
Certbot will automatically modify your nginx configuration to:
214
+
- Redirect HTTP (port 80) to HTTPS (port 443)
215
+
- Install and renew your TLS certificate
216
+
217
+
After running Certbot, update your `.env`:
218
+
219
+
```env
220
+
VITE_API_DOMAIN=https://your-domain.com
221
+
FRONTEND_URL=https://your-domain.com
222
+
```
223
+
224
+
Certbot sets up automatic renewal via a systemd timer. You can verify it with:
0 commit comments