diff --git a/Dockerfile b/Dockerfile index f6ba64d..20c8517 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ RUN npm run build # # STAGE 2: build executable binary # -FROM golang:1.17-buster as builder +FROM golang:1.18-buster as builder WORKDIR /app COPY . . @@ -33,7 +33,7 @@ COPY --from=frontend /src/dist/ /var/www ENV DOCKER_API_VERSION=1.39 ENV NEKO_ROOMS_BIND=:8080 -ENV NEKO_ROOMS_STATIC=/var/www +ENV NEKO_ROOMS_ADMIN_STATIC=/var/www EXPOSE 8080 diff --git a/OpenApi.yml b/OpenApi.yml index 330e120..42f3ea4 100644 --- a/OpenApi.yml +++ b/OpenApi.yml @@ -307,6 +307,7 @@ components: max_connections: type: number example: 10 + description: 0 when using mux running: type: boolean example: true @@ -361,6 +362,7 @@ components: max_connections: type: number default: 10 + description: 0 when using mux user_pass: type: string example: neko 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/client/src/components/RoomInfo.vue b/client/src/components/RoomInfo.vue index d9c07cf..ee9109e 100644 --- a/client/src/components/RoomInfo.vue +++ b/client/src/components/RoomInfo.vue @@ -25,10 +25,10 @@ :rotate="270" :size="100" :width="15" - :value="usesMux ? 100 : ((stats.connections / settings.max_connections) * 100)" + :value="settings.max_connections == 0 ? 100 : ((stats.connections / settings.max_connections) * 100)" color="blue" > - {{ stats.connections }} + {{ stats.connections }} @@ -99,7 +99,10 @@ Invite link for admins - Max connections {{ settings.max_connections }} + Max connections + + not limited because uses mux + Control protection {{ settings.control_protection }} Implicit Control {{ settings.implicit_control }} @@ -275,8 +278,7 @@ export default class RoomInfo extends Vue { } get usesMux() { - // old rooms might not use mux despite enabled server wide, simple check for that - return this.$store.state.roomsConfig.uses_mux && this.settings?.max_connections == 1 + return this.$store.state.roomsConfig.uses_mux } get allBrowserExtensions() { diff --git a/client/src/components/RoomsCreate.vue b/client/src/components/RoomsCreate.vue index 8546f3f..b78bd29 100644 --- a/client/src/components/RoomsCreate.vue +++ b/client/src/components/RoomsCreate.vue @@ -604,7 +604,7 @@ export default class RoomsCreate extends Vue { // eslint-disable-next-line admin_pass: this.data.admin_pass || randomPassword(), // eslint-disable-next-line - max_connections: Number(this.data.max_connections), // not needed when uses mux + max_connections: Number(this.data.max_connections), // ignored when uses mux // eslint-disable-next-line control_protection: Boolean(this.data.control_protection), // eslint-disable-next-line diff --git a/client/src/components/RoomsList.vue b/client/src/components/RoomsList.vue index 6f92daa..95afd82 100644 --- a/client/src/components/RoomsList.vue +++ b/client/src/components/RoomsList.vue @@ -33,8 +33,8 @@