In the /server/src
folder, rename myconfig.json
to config.json
and update with your config details.
http://localhost/api/auth/twitch/redirect
by default.oauth
enter an OAuth ID generated at https://twitchapps.com/tmi/broadcasterName
should be your Twitch user namehttp://localhost/api/auth/streamlabs/callback
by default.chewiebot.db
in the root directory./client/package.json
, ensure that proxy
is set to http://server:8080
. This is the default, so should only have been changed if you changed it for running with NodeJS.yarn --cwd server setup
. The setup
command will install node packages for both the server and client.docker-compose -f docker-compose.yml -f docker-compose.ng.yml up -d --build
. This will take some time the first time as it will build and start the containers using the dev docker config. The dev docker config will build images from local directories and map volumes to /server/
and /client/
. The docker-compose.prod.yml
config will take images from the DockerHub repository and only map a volume for the SQLite database.localhost
. This may give an error due to needing to wait for the client and server to start up. You can check if the client is running by docker-compose -f docker-compose.yml -f docker-compose.ng.yml logs ui
and checking to see if the Client Compiled
message is visible.--inspect
flag to node for node debugging the server when using docker-compose.ng.yml
. This will map localhost:9229 to the node inspector for the server./server/src
folder.react-scripts start
to watch the /client/
folder.sudo apt install redis-server
to install and sudo service redis-server restart
to ensure that it's running. Use sudo service redis-server stop
to stop the Redis server./server/
folder.yarn setup
to install dependencies. This will setup both the server and client./client/package.json
, you will need to change proxy
to http://localhost:8080
.yarn start-dev:build
--- This will build the client files before starting the node server. Use this if it's the first time starting the project, or changes have been made to the client folder.yarn start-dev
--- This will start the node server without building the client files. Use this if you've already used the build variant and there has been no changes made to the client folder.yarn start-debug:build
--- This will build the client files before starting the node server with the --inspect
flag. Use this if it's the first time starting the project, or changes have been made to the client folder. The --inspect
flag will allow you to attach a debugger to the process (for example, VSCodes debugger).yarn start-debug
--- This will start the node server with the --inspect
flag without building the client files. Use this if you've already used the build variant and there has been no changes made to the client folder.localhost:8080
.root@f6ef5d97cbf9:/# openssl genrsa -des3 -out server.key 2048
Generating RSA private key, 2048 bit long modulus
......+++++
..........+++++
e is 65537 (0x010001)
Enter pass phrase for server.key: # some cool password
Verifying - Enter pass phrase for server.key: # same as you typed
root@f6ef5d97cbf9:/# openssl req -new -key server.key -out server.csr
Enter pass phrase for server.key: # same password you typed
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:JP # type you like
State or Province Name (full name) [Some-State]:Tokyo # type you like
Locality Name (eg, city) []:Shibuya # type you like
Organization Name (eg, company) [Internet Widgits Pty Ltd]: # just push enter
Organizational Unit Name (eg, section) []: # just push enter
Common Name (e.g. server FQDN or YOUR name) []: # just push enter
Email Address []: # just push enter
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []: # just push enter
An optional company name []: # just push enter
root@f6ef5d97cbf9:/# cp server.key server.key.org
root@f6ef5d97cbf9:/# openssl rsa -in server.key.org -out server.key
Enter pass phrase for server.key.org: # same PW you typed
writing RSA key
root@f6ef5d97cbf9:/# openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
Signature ok
subject=C = JP, ST = Tokyo, L = Shibuya, O = Internet Widgits Pty Ltd
Getting Private key
docker cp <container-id>:server.crt ./path/to/server.crt
docker cp <container-id>:server.key ./path/to/server.key
/client/nginx/
folder. They will be copied from this folder during docker startup to enable https.default.conf
file to the following:# Close websocket connection when upgrade header set to ''
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
# map to websocket port
upstream websocket {
server backend:8001;
}
server {
listen 8020;
listen [::]:8020;
server_name _;
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header HOST $host;
proxy_pass http://websocket;
}
}
# If not using SSL and HTTPS, remove this server section.
server {
listen 80;
server_name _;
return 301 https://$host$request_uri;
}
server {
# If not using SSL and HTTPS, uncomment these:
# listen 80;
# listen [::]:80;
# If not using SSL and HTTPS, comment out the listen lines below.
listen 443 ssl;
listen [::]:443 ssl;
server_name _;
# If not using SSL and HTTPS, comment out the below ssl_certificate and ssl_certificate_key lines.
ssl_certificate /etc/nginx/server.crt;
ssl_certificate_key /etc/nginx/server.key;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location /api/ {
proxy_set_header HOST $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://backend:8080;
}
location /ws/ {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header HOST $host;
proxy_pass http://websocket;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}