From aa9880e99924c3924c3431aa1f4e4bc3898e6405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Sun, 31 Jul 2022 21:14:57 +0200 Subject: [PATCH] cleanup traefik readme. --- README.md | 56 ++---------------- docker-compose.yml | 24 ++++++++ traefik/README.md | 67 ++++++++++++++++++++++ install => traefik/install | 0 {docs => traefik}/nginx/docker-compose.yml | 0 {docs => traefik}/nginx/nginx.conf | 0 6 files changed, 97 insertions(+), 50 deletions(-) create mode 100644 docker-compose.yml create mode 100644 traefik/README.md rename install => traefik/install (100%) rename {docs => traefik}/nginx/docker-compose.yml (100%) rename {docs => traefik}/nginx/nginx.conf (100%) diff --git a/README.md b/README.md index 4e9240a..bdf1277 100644 --- a/README.md +++ b/README.md @@ -16,70 +16,25 @@ Simple room management system for [n.eko](https://github.com/m1k1o/neko). Self h n.eko -## Zero-knowledge installation +## Zero-knowledge installation (with HTTPS and Traefik) If you don't have any clue about docker and stuff but only want to have fun with friends in a shared browser, we got you covered! - Rent a VPS with public IP and OS Ubuntu. - Get a domain name pointing to your IP (you can even get some for free). - Run install script and follow instructions. +- Secure using HTTPs thanks to Let's Encrypt and Traefik. ```bash -wget -O neko-rooms.sh https://raw.githubusercontent.com/m1k1o/neko-rooms/master/install +wget -O neko-rooms.sh https://raw.githubusercontent.com/m1k1o/neko-rooms/master/traefik/install sudo bash neko-rooms.sh ``` ## How to start -You need to have installed `Docker` and `docker-compose`. You need to have a custom domain pointing to your server's IP. +If you want to use Traefik as reverse proxy, visit [installation guide for traefik as reverse proxy](./traefik/). -You can watch installation video provided by *Dr R1ck*: - -https://www.youtube.com/watch?v=cCmnw-pq0gA - -### Installation guide - -You only need `.env.example`, `docker-compose.yml` and `traefik/`. - -#### Do I need to use traefik? - -- Traefik needs to be used to forward traffic to the rooms. You can put nginx in front of it, but not replace it. -- See example configuration for [nginx](docs/nginx). - -You can use `docker-compose.http.yml` that will expose this service to `8080` or any port. Authentication is optional. Start it quickly with `docker-compose -f docker-compose.http.yml up -d`. - -### Step 1 - -Copy `.env.example` to `.env` and customize. - -```bash -cp .env.example .env -``` - -### Step 2 - -Create `usersfile` with your users: - -```bash -touch traefik/usersfile -``` - -And add as many users as you like: - -```bash -echo $(htpasswd -nb user password) >> traefik/usersfile -``` - -### Step 3 (HTTPS only) - -Create `acme.json` - -```bash -touch traefik/acme.json -chmod 600 traefik/acme.json -``` - -Update your email in `traefik/traefik.yml`. +Otherwise modify variables in `docker-compose.yml` and just run `docker-compose up -d`. ### Download images / update @@ -116,6 +71,7 @@ For more information visit [docs](./docs). - [x] add authentication provider for traefik - [x] allow specifying custom ENV variables - [x] allow mounting directories for persistent data + - [x] optionally remove Traefik as dependency - [ ] add upgrade button - [ ] auto pull images, that do not exist - [ ] add bearer token to for API diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..cee1537 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,24 @@ +version: "3.5" + +networks: + default: + attachable: true + name: "neko-rooms-net" + +services: + neko-rooms: + image: "m1k1o/neko-rooms:latest" + restart: "unless-stopped" + environment: + - "TZ=Europe/Vienna" + - "NEKO_ROOMS_MUX=true" + - "NEKO_ROOMS_EPR=59000-59049" + - "NEKO_ROOMS_NAT1TO1=127.0.0.1" # IP address of your server that is reachable from client + - "NEKO_ROOMS_INSTANCE_URL=http://127.0.0.1:8080/" # external URL + - "NEKO_ROOMS_INSTANCE_NETWORK=neko-rooms-net" + - "NEKO_ROOMS_TRAEFIK_ENABLED=false" + - "NEKO_ROOMS_PATH_PREFIX=/room/" + ports: + - "8080:8080" + volumes: + - "/var/run/docker.sock:/var/run/docker.sock" diff --git a/traefik/README.md b/traefik/README.md new file mode 100644 index 0000000..a4a6f45 --- /dev/null +++ b/traefik/README.md @@ -0,0 +1,67 @@ +# Installation guide for traefik as reverse proxy + +## Zero-knowledge installation + +If you don't have any clue about docker and stuff but only want to have fun with friends in a shared browser, we got you covered! + +- Rent a VPS with public IP and OS Ubuntu. +- Get a domain name pointing to your IP (you can even get some for free). +- Run install script and follow instructions. + +```bash +wget -O neko-rooms.sh https://raw.githubusercontent.com/m1k1o/neko-rooms/master/traefik/install +sudo bash neko-rooms.sh +``` + +## How to start + +You need to have installed `Docker` and `docker-compose`. You need to have a custom domain pointing to your server's IP. + +You can watch installation video provided by *Dr R1ck*: + +https://www.youtube.com/watch?v=cCmnw-pq0gA + +### Installation guide + +You only need `.env.example`, `docker-compose.yml` and `traefik/`. + +#### Do I need to use traefik? + +- This project started with Traefik as a needed dependency. That, however, changed. Traefik must not be used but the original setup can still be used. +- Traefik is used to forward traffic to the rooms. You can put nginx in front of it. +- See example configuration for [nginx](./nginx). + +You can use `docker-compose.http.yml` that will expose this service to `8080` or any port. Authentication is optional. Start it quickly with `docker-compose -f docker-compose.http.yml up -d`. + +### Step 1 + +Copy `.env.example` to `.env` and customize. + +```bash +cp .env.example .env +``` + +### Step 2 + +Create `usersfile` with your users: + +```bash +touch usersfile +``` + +And add as many users as you like: + +```bash +echo $(htpasswd -nb user password) >> usersfile +``` + +### Step 3 (HTTPS only) + +Create `acme.json` + +```bash +touch acme.json +chmod 600 acme.json +``` + +Update your email in `traefik.yml`. diff --git a/install b/traefik/install similarity index 100% rename from install rename to traefik/install diff --git a/docs/nginx/docker-compose.yml b/traefik/nginx/docker-compose.yml similarity index 100% rename from docs/nginx/docker-compose.yml rename to traefik/nginx/docker-compose.yml diff --git a/docs/nginx/nginx.conf b/traefik/nginx/nginx.conf similarity index 100% rename from docs/nginx/nginx.conf rename to traefik/nginx/nginx.conf