infra:workadventure:start

Dies ist eine alte Version des Dokuments!


Workadventure

Unsere aktuell laufende Version mit allen möglichen Patches ist hier zu finden: https://git.binary-kitchen.de/noby/workadventure Der Source liegt unter /opt/workadventure/source Es gibt einen User „workadventure“ dessen Home-Directory /opt/workadventure ist.

Außerdem läuft ein Nginx Webserver. Die Config workadventure Datei ist hier zu sehen:

server {
        listen 80;
        listen [::]:80;
 
        server_name wa.binary-kitchen.de play.wa.binary-kitchen.de pusher.wa.binary-kitchen.de uploader.wa.binary-kitchen.de;
 
        location /.well-known/acme-challenge {
                default_type "text/plain";
                alias /var/www/acme-challenge;
        }
 
        location / {
                return 301 https://$host$request_uri;
        }
}
 
server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
 
        server_name wa.binary-kitchen.de;
 
        ssl_certificate_key /etc/nginx/ssl/wa.binary-kitchen.de.key;
        ssl_certificate /etc/nginx/ssl/wa.binary-kitchen.de.crt;
 
        location / {
                #return 302 https://play.wa.binary-kitchen.de/_/global/raw.githubusercontent.com/Binary-Kitchen/rc3.world/master/main.json;
                root /opt/workadventure/source/landing/dist;
        }
}
 
server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
 
        server_name play.wa.binary-kitchen.de;
 
        ssl_certificate_key /etc/nginx/ssl/wa.binary-kitchen.de.key;
        ssl_certificate /etc/nginx/ssl/wa.binary-kitchen.de.crt;
 
        location / {
                root /opt/workadventure/source/front/dist;
                try_files $uri uri/ /index.html?$args;
        }
}
 
server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
 
        server_name pusher.wa.binary-kitchen.de;
 
        ssl_certificate_key /etc/nginx/ssl/wa.binary-kitchen.de.key;
        ssl_certificate /etc/nginx/ssl/wa.binary-kitchen.de.crt;
 
        location / {
                proxy_pass http://localhost:8002;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "Upgrade";
                proxy_set_header Host $host;
        }
}
 
server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
 
        server_name uploader.wa.binary-kitchen.de;
 
        ssl_certificate_key /etc/nginx/ssl/wa.binary-kitchen.de.key;
        ssl_certificate /etc/nginx/ssl/wa.binary-kitchen.de.crt;
 
        location / {
                proxy_pass http://localhost:8005;
        }
}

Hier kann entweder direkt ein Zertifikat angegeben werden oder einfach eines via Letsencrypt bezogen werden.

Die Datei docker-compose.mm.yml (folgend) befindet sich im source Verzeichnis.

version: "3"
services:
  # the frontend is only built here - it is served directly via nginx
  front:
    image: thecodingmachine/nodejs:14
    environment:
      DEBUG_MODE: "$DEBUG_MODE"
      JITSI_URL: "$JITSI_URL"
      JITSI_PRIVATE_MODE: "$JITSI_PRIVATE_MODE"
      NODE_ENV: development
      API_URL: "pusher.$DOMAIN"
      UPLOADER_URL: "uploader.$DOMAIN"
      STARTUP_COMMAND_1: ./templater.sh
      STARTUP_COMMAND_2: yarn install
      STUN_SERVER: "stun:stun.l.google.com:19302"
      TURN_SERVER: "turn:coturn.workadventu.re:443,turns:coturn.workadventu.re:443"
      # Use TURN_USER/TURN_PASSWORD if your Coturn server is secured via hard coded credentials.
      # Advice: you should instead use Coturn REST API along the TURN_STATIC_AUTH_SECRET in the Back container
      TURN_USER: workadventure
      TURN_PASSWORD: WorkAdventure123
      START_ROOM_URL: "$START_ROOM_URL"
    command: yarn run build
    volumes:
      - ./front:/usr/src/app
  pusher:
    image: thecodingmachine/nodejs:12
    environment:
      DEBUG: "*"
      STARTUP_COMMAND_1: yarn install
      SECRET_JITSI_KEY: "$SECRET_JITSI_KEY"
      SECRET_KEY: yourSecretKey
      ADMIN_API_TOKEN: "$ADMIN_API_TOKEN"
      API_URL: back:50051
      JITSI_URL: "$JITSI_URL"
      JITSI_ISS: "$JITSI_ISS"
    command: yarn run prod
    ports:
      - "127.0.0.1:8002:8080"
    volumes:
      - ./pusher:/usr/src/app
  back:
    image: thecodingmachine/nodejs:12
    environment:
      DEBUG: "*"
      STARTUP_COMMAND_1: yarn install
      SECRET_KEY: yourSecretKey
      SECRET_JITSI_KEY: "$SECRET_JITSI_KEY"
      ALLOW_ARTILLERY: "true"
      ADMIN_API_TOKEN: "$ADMIN_API_TOKEN"
      JITSI_URL: "$JITSI_URL"
      JITSI_ISS: "$JITSI_ISS"
    command: yarn run prod
    volumes:
      - ./back:/usr/src/app
  uploader:
    image: thecodingmachine/nodejs:12
    environment:
      DEBUG: "*"
      STARTUP_COMMAND_1: yarn install
    command: yarn run prod
    ports:
      - "127.0.0.1:8005:8080"
    volumes:
      - ./uploader:/usr/src/app
  messages:
    #image: thecodingmachine/nodejs:14
    image: thecodingmachine/workadventure-back-base:latest
    environment:
      #STARTUP_COMMAND_0: sudo apt-get install -y inotify-tools
      STARTUP_COMMAND_1: yarn install
      STARTUP_COMMAND_2: yarn run proto:watch
    volumes:
      - ./messages:/usr/src/app
      - ./back:/usr/src/back
      - ./front:/usr/src/front
      - ./pusher:/usr/src/pusher

Die .env Datei (muss angepasst werden) liegt dann ebenfalls im source Verzeichnis:

DEBUG_MODE=false
DOMAIN=wa.binary-kitchen.de
JITSI_URL=<<<<insert jitsi server here>>>>
# If your Jitsi environment has authentication set up, you MUST set JITSI_PRIVATE_MODE to "true" and you MUST pass a SECRET_JITSI_KEY to generate the JWT secret
JITSI_PRIVATE_MODE=false
JITSI_ISS=
SECRET_JITSI_KEY=
ADMIN_API_TOKEN=123
START_ROOM_URL=/_/global/raw.githubusercontent.com/Binary-Kitchen/rc3.world/master/main.json
# If your Turn server is configured to use the Turn REST API, you should put the shared auth secret here.
# If you are using Coturn, this is the value of the "static-auth-secret" parameter in your coturn config file.
# Keep empty if you are sharing hard coded / clear text credentials.
TURN_STATIC_AUTH_SECRET=
 
# The email address used by Let's encrypt to send renewal warnings (compulsory)
ACME_EMAIL=

Gestartet wird den Server aktuell von Hand ohne Systemd Script (nicht schön aber tut)

$ su – workadventure
$ docker-compose -f docker-compose.mm.yml up –d

Zusätzlich zu dem workadventure Server benötigt man aber ggf. auch noch eine Jitsi Instanz wenn man mit mehr als 4 Personen gleichzeitig sprechen will (Diese wird bei uns z.B. bei den Tischen geöffnet)

  • infra/workadventure/start.1622193749.txt.gz
  • Zuletzt geändert: 2021/05/28 09:22
  • von noby