restreamer
restreamer copied to clipboard
docker-compose.yml location
I'm trying to find the docker-compose.yml file but can't. Where is it normally located?? I'm using docker on a pi4
You have to copy/download it from the repository: https://github.com/datarhei/restreamer/blob/master/docker-compose.yml
Oh ok i see. I'm new to Docker so just trying to get used to where everthing goes.
After i download the yml what folder do i put it in on my Pi??? There is a var/lib/docker directory. Would it be placed in that?? Cheers
I have spent a few days on this trying to get it https in order to embed on my website but seriously its such a difficult process to get your head around. It would be great if we had a list of Exact steps in order to get this to work. It seems in theory the docker-compose method may be the most straight forward but still by no means easy. Any help would be greatly appreciated
You put the docker-compose.yml wherever you want to (e.g. ~/restreamer/docker-compose.yml) then you edit it and start the container with: docker-compose up -d
If you need https then you should have a look at caddy. It is a middleware that will handle the https certificates for you and the config file is very simple
You put the docker-compose.yml wherever you want to (e.g. ~/restreamer/docker-compose.yml) then you edit it and start the container with: docker-compose up -d
If you need https then you should have a look at caddy. It is a middleware that will handle the https certificates for you and the config file is very simple
Thanks so much. I will have a look at Caddy. Seems like a good option
I'm trying to use the BYOC method as i have a free domain with a cert.
Im running this command docker run ... -p 443:8181 -e RS_HTTPS=true -v /mnt/restreamer/db:/restreamer/db ...
But gettings this error docker run ... -p 443:8181 -e RS_HTTPS=true -v /mnt/restreamer/db:/restreamer/db ... docker: invalid reference format. See 'docker run --help'.
I have tried to do this when restreamer is stopped and running.
If i just get a ssl cert for my no-ip ddns.net address will https work? It would be worth the 20 dollars or so just to not to have to change so many settings for it then to not work.
Cheers
Please don't buy a certificate. They can be obtained for free.
The docker command you were trying to run was meant as an example for you to modify your existing command. There are dots (...) in the command that should be replaced with other docker options that you already use. Instead of
docker run ... -p 443:8181 -e RS_HTTPS=true -v /mnt/restreamer/db:/restreamer/db ...
the command should look like, e.g.
docker run -it --rm --name restreamer -e "RS_USERNAME=admin" -e "RS_PASSWORD=datarhei" -p 8080:8080 -p 443:8181 -e RS_HTTPS=true -v /mnt/restreamer/db:/restreamer/db datarhei/restreamer:latest
As @MrCoala wrote, the easiest option to setup HTTPS is with docker compose. Get the docker-compose.yml and store it somewhere (e.g. ~/restreamer/docker-compose.yml) and open it in a text editor. You see that the services is divided in 3 sections: restreamer, fblive, and https-portal.
In the restreamer: section you configure the restreamer itself. There you should at least change the value of RS_PASSWORD to something only you know.
The fblive: section can be removed completely.
In the https-portal: section, you don't need to change anything for the start. It will route all requests to http://localhost and https://localhost to the restreamer.
Run docker-compose up and you will see some logging messages on the screen, e.g.
docker-compose up cmd:0
WARNING: The following deploy sub-keys are not supported and have been ignored: restart_policy.delay, restart_policy.window
Creating network "work_frontend" with the default driver
Pulling restreamer (datarhei/restreamer:)...
latest: Pulling from datarhei/restreamer
afb6ec6fdc1c: Pull complete
27905740eef7: Pull complete
06277d0d5dfa: Pull complete
dd45fadfa16f: Pull complete
6df1f6137338: Pull complete
2bb81e031a29: Pull complete
8750b7787677: Pull complete
Digest: sha256:d29b5e131e390df04d87b4b8e416364d0cad5d6ab0378b1a4d01e9921fd72aba
Status: Downloaded newer image for datarhei/restreamer:latest
Pulling https-portal (steveltn/https-portal:1)...
1: Pulling from steveltn/https-portal
45b42c59be33: Pull complete
d0d9e9ea897e: Pull complete
66e650438339: Pull complete
76a3dfe4406b: Pull complete
410ff9d97480: Pull complete
2af6f6a39946: Pull complete
b3e5c73b61e1: Pull complete
79456c2a2dcd: Pull complete
734a34766f1d: Pull complete
58c10e4b2a7a: Pull complete
ba45a1bf6836: Pull complete
a6e3d6a21fa6: Pull complete
c1db08eb8dfd: Pull complete
4253af2c8ad9: Pull complete
Digest: sha256:102bf41b771756d591d0615ad47828c94e131d53eeea0a85c072db86498b6faf
Status: Downloaded newer image for steveltn/https-portal:1
Creating restreamer ... done
Creating https-portal ... done
Attaching to https-portal, restreamer
https-portal | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
https-portal | [s6-init] ensuring user provided files have correct perms...exited 0.
https-portal | [fix-attrs.d] applying ownership & permissions fixes...
https-portal | [fix-attrs.d] done.
https-portal | [cont-init.d] executing container initialization scripts...
https-portal | [cont-init.d] 00-welcome: executing...
https-portal |
https-portal | ========================================
https-portal | HTTPS-PORTAL v1.19.0
https-portal | ========================================
https-portal |
https-portal | [cont-init.d] 00-welcome: exited 0.
https-portal | [cont-init.d] 20-setup: executing...
https-portal | Generating dummy certificate for default fallback server
https-portal | Generating a RSA private key
https-portal | ..........................................+++++
https-portal | ..................................+++++
https-portal | writing new private key to '/var/lib/https-portal/default_server/default_server.key'
https-portal | -----
https-portal | Generating DH parameters, 2048 bit long safe prime, generator 2
https-portal | This is going to take a long time
restreamer |
restreamer | > [email protected] start /restreamer
restreamer | > node ./src/start
restreamer |
restreamer | [16-08-2021 13:09:16.124] [DEBUG] [ Webserver] Init webserver with PROD environment
restreamer | [16-08-2021 13:09:16.188] [INFO ] _ _ _ _
restreamer | [16-08-2021 13:09:16.188] [INFO ] __| | __ _| |_ __ _ _ __| |___ ___(_)
restreamer | [16-08-2021 13:09:16.189] [INFO ] / _ |/ _ | __/ _ | __| _ |/ _ | |
restreamer | [16-08-2021 13:09:16.189] [INFO ] | (_| | (_| | || (_| | | | | | | __/| |
restreamer | [16-08-2021 13:09:16.190] [INFO ] |_____|_____|_||_____|_| |_| |_|____||_|
restreamer | [16-08-2021 13:09:16.190] [INFO ]
restreamer | [16-08-2021 13:09:16.191] [INFO ] Restreamer v0.6.8
restreamer | [16-08-2021 13:09:16.192] [INFO ]
restreamer | [16-08-2021 13:09:16.192] [INFO ] ENVIRONMENTS
restreamer | [16-08-2021 13:09:16.193] [INFO ] More information in our Docs
restreamer | [16-08-2021 13:09:16.193] [INFO ]
restreamer | [16-08-2021 13:09:16.194] [INFO ] [ ENV] RS_NODEJS_PORT = 3000 (using default) - Webserver port of application.
restreamer | [16-08-2021 13:09:16.194] [INFO ] [ ENV] RS_NODEJS_ENV = prod (using default) - Node.js Environment ('dev' or 'prod').
restreamer | [16-08-2021 13:09:16.195] [INFO ] [ ENV] RS_LOGLEVEL = 4 - Logging level (0=no logging, 1=ERROR, 2=WARN, 3=INFO, 4=DEBUG).
restreamer | [16-08-2021 13:09:16.196] [INFO ] [ ENV] RS_TIMEZONE = Europe/Berlin - Set the timezone. Accepts Olson timezone IDs.
restreamer | [16-08-2021 13:09:16.197] [INFO ] [ ENV] RS_SNAPSHOT_INTERVAL = 1m - Interval for new snapshots (in milliseconds, use suffix 's' for seconds, 'm' for minutes). Use a value of 0 to disable snapshots.
restreamer | [16-08-2021 13:09:16.197] [INFO ] [ ENV] RS_USERNAME = admin - Username for the backend.
restreamer | [16-08-2021 13:09:16.198] [INFO ] [ ENV] RS_PASSWORD = ****** - Password for the backend.
restreamer | [16-08-2021 13:09:16.198] [INFO ] [ ENV] RS_TOKEN = (using default) - Token for pushing an RTMP stream.
restreamer | [16-08-2021 13:09:16.199] [INFO ] [ ENV] RS_DEBUG_HEAPDUMPS = false (using default) - Create heapdumps of application.
restreamer | [16-08-2021 13:09:16.199] [INFO ] [ ENV] RS_DEBUG = false (using default) - Enables debug reporting.
restreamer | [16-08-2021 13:09:16.200] [INFO ] [ ENV] RS_AUDIO = auto (using default) - Audio track handling: auto, none (remove audio), silence (force silence), aac (force AAC), mp3 (force MP3).
restreamer | [16-08-2021 13:09:16.200] [INFO ] [ ENV] RS_HTTPS = false (using default) - Enables HTTPS support for admin interface and embeddable player.
restreamer | [16-08-2021 13:09:16.201] [INFO ] [ ENV] RS_INPUTSTREAM = (using default) - Automatically start pulling from this stream on a fresh Restreamer installation.
restreamer | [16-08-2021 13:09:16.201] [INFO ] [ ENV] RS_OUTPUTSTREAM = (using default) - Automatically start pushing to this stream on a fresh Restreamer installation.
restreamer | [16-08-2021 13:09:16.202] [INFO ] [ NGINX] Starting ...
restreamer | [16-08-2021 13:09:16.486] [INFO ] [ NGINX] Successfully started
restreamer | [16-08-2021 13:09:16.488] [INFO ] [ RestreamerData] Checking jsondb file...
restreamer | [16-08-2021 13:09:16.507] [DEBUG] [ RestreamerData] "v1.db" is valid
restreamer | [16-08-2021 13:09:16.515] [DEBUG] [ checkForUpdates] Checking for updates...
restreamer | [16-08-2021 13:09:16.527] [INFO ] [ publicIP] Retrieving public IP ...
restreamer | [16-08-2021 13:09:16.534] [INFO ] [ Webserver] Starting ...
restreamer | [16-08-2021 13:09:16.591] [INFO ] [ Webserver] Running on port 3000
restreamer | [16-08-2021 13:09:16.634] [INFO ] [ publicIP] Found public IP: 0.0.0.0
restreamer | [16-08-2021 13:09:16.748] [INFO ] [ checkForUpdates] Update checking succeeded. No updates available
restreamer | [16-08-2021 13:09:16.749] [DEBUG] [ checkForUpdates] local: 0.6.8; remote: 0.6.8
restreamer | [16-08-2021 13:09:16.755] [DEBUG] [ WSController] Emitting update
https-portal | ............................................................................+...........................+............................................................................................................................................+.................................................................................................................................................................................................................................................................................................................................+...........................+..............................................+...................................................+.............................................................+...............................+............................................+.....................................................................................................................................................................+........................................................................................+.................................................................+....................................................................................................................................................................................................................................................................+...........................+.......+............................................................+...........................................................................................................................................................................................+..+.+...........................+..............................................................................................................................................................+.....................................+.....................+.........................................................................................................+...........................................................................................................................................................................+..+.+...............................................................+..........................................+.......................................................................................................................+.......................+.+..................+..............................................+..+.......+....................+.............................................................................................................................+................................+.............................+.................................+...................................................................................................................................+..............+.......................................................+........+..............................................................................+.......................++*++*++*++*
https-portal | Generating RSA private key, 4096 bit long modulus (2 primes)
https-portal | .........++++
https-portal | ..........................................................++++
https-portal | e is 65537 (0x010001)
https-portal | Signing skipped for localhost, it expires at 36500 days from now.
https-portal | [cont-init.d] 20-setup: exited 0.
https-portal | [cont-init.d] 30-set-docker-gen-status: executing...
https-portal | [cont-init.d] 30-set-docker-gen-status: exited 0.
https-portal | [cont-init.d] done.
https-portal | [services.d] starting services
https-portal | [services.d] done.
Then you can navigate your browser to https://localhost. You might see some warnings about an invalid or self-signed certificate, but that's OK and can be ignored. Afterwards you should see the Restreamer login screen, where you enter the username and password you set with RS_USERNAME and RS_PASSWORD.
Press Ctrl-C or abort the docker-compose command.
Now that it generally works with localhost, you can configure it such that it uses your no-ip ddns.net address.
Open your docker-compose.yml in an editor and go to the bottom of the document. For the value of DOMAINS write yourdomain.com -> http://restreamer:8080 instead of localhost -> http://restreamer:8080 and you have to replace yourdomain.com with your own no-ip ddns.net address. Then also change the value of STAGE to production.
Before you run docker-compose up again, you have to make sure that your router forwards the ports 80 and 443 to the machine where you are running the docker-compose command. Please check the manual of your router to find out how to setup port forwarding.
After you set up the port forwarding, you can run docker-compose up again. In the logs on the screen you should see messages about obtaining certificates for your no-ip ddns.net address. Then you can access the Restreamer login screen with https:// and your no-ip ddns.net address.
If this also works properly, you can abort the docker-compose command again and restrart it with the -d option, i.e. docker-compose up -d. This will start the containers in the background.
Thanks so much for the detailed guide on what i need to do. I will now go step by step and hopefully it will work. I will update accordingly
I was getting a Command not found error but then found out you actually have to install docker-compose to the system before you can run a docker-compose up command. Anyway this is a small sample of the output and https in not available on localhost. Any ideas?
Some services (restreamer) use the 'deploy' key, which will be ignored. Compose does not support 'deploy' configuration - use docker stack deploy to deploy to a swarm.
Starting https-portal ... done
Creating restreamer ... done
Attaching to https-portal, restreamer
https-portal | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
https-portal | [s6-init] ensuring user provided files have correct perms...exited 0.
https-portal | [fix-attrs.d] applying ownership & permissions fixes...
https-portal | [fix-attrs.d] done.
https-portal | [cont-init.d] executing container initialization scripts...
https-portal | [cont-init.d] 00-welcome: executing...
https-portal |
https-portal | ========================================
https-portal | HTTPS-PORTAL v1.19.0
https-portal | ========================================
https-portal |
https-portal | [cont-init.d] 00-welcome: exited 0.
https-portal | [cont-init.d] 20-setup: executing...
restreamer | standard_init_linux.go:228: exec user process caused: exec format error
restreamer exited with code 1
You're running this on a Pi4. I forgot this detail. In the docker-compose.yml you have to change the image for the restreamer from datarhei/restreamer to datarhei/restreamer-armv7l. It should look like this now:
version: "3"
services:
restreamer:
image: datarhei/restreamer-armv7l
container_name: restreamer
ports:
- 1935:1935
- 8080:8080
networks:
- frontend
volumes:
- "~/db:/restreamer/db"
environment:
- RS_USERNAME=admin
- RS_PASSWORD=datarhei
- RS_LOGLEVEL=4
- RS_TIMEZONE=Europe/Berlin
- RS_SNAPSHOT_INTERVAL=1m
deploy:
replicas: 1
restart_policy:
condition: any
delay: 5s
window: 10s
https-portal:
image: steveltn/https-portal:1
container_name: https-portal
ports:
- 80:80
- 443:443
restart: always
networks:
- frontend
environment:
DOMAINS: localhost -> http://restreamer:8080
STAGE: local
# DOMAINS: yourdomain.com -> http://restreamer:8080
# STAGE: production
networks:
frontend:
I have got to the stage below but https://localhost loads nothing saying the site can't be reached. When i enter 192.168.0.245:8080 the normal log in page loads but not https "Then you can navigate your browser to https://localhost. You might see some warnings about an invalid or self-signed certificate, but that's OK and can be ignored. Afterwards you should see the Restreamer login screen, where you enter the username and password you set with RS_USERNAME and RS_PASSWORD"
Edit: Ignore what i said above as silly me wasn't using localhost on the Pi. I'm at the stage where Emitting Update is on screen. Does this take long as its been over 10 mins now without any new update?
restreamer | [16-08-2021 13:09:16.755] [DEBUG] [ WSController] Emitting update
Edit:2 Script seems to be looping with this error showing each time
nginx: [emerg] could not build server_names_hash, you should increase server_names_hash_bucket_size: 32
https-portal | /opt/certs_manager/lib/nginx.rb:39:in start': undefined method fail_and_shutdown' for Commands:Module (NoM
The "Emitting Update" is usually the last message of the start-up process of Restreamer. After this it should be ready.
Regarding "Edit 2". There you might have configured the "https-portal" service wrongly. What did you use as value for DOMAINS?
The "Emitting Update" is usually the last message of the start-up process of Restreamer. After this it should be ready.
Regarding "Edit 2". There you might have configured the "https-portal" service wrongly. What did you use as value for
DOMAINS?
This is what i have for the https-portal section https-portal: image: steveltn/https-portal:1 container_name: https-portal ports: - 80:80 - 443:443 restart: always networks: - frontend environment: DOMAINS: waterfordweather.ddns.net -> http://restreamer:8080 STAGE: production # DOMAINS: yourdomain.com -> http://restreamer:8080 # STAGE: production
Working on this the last few days but still can't find a fix to the nginx server_names_hash_bucket_size: 32 error.
Seems in normal nginx you can edit the nginx.conf file but how would that transfer to Restreamer??
Others must have come across this issue at some stage. I've spent so much time trying to get https to work i can't give up now.
Got it working finally but i'm not sure if its the https portal or Caddy is providing the cert. I have both running with a reverse proxy set up in the Caddyfile. Anyway i will leave it run and do more investigation to the source of the https in the coming days. Just glad to finally have it running and now embedded with https on my website
Hi @mickopla We are closing your issue https://github.com/datarhei/restreamer/issues/283.
This may be due to the following reasons:
- Problem/inquiry has been solved
- The ticket remained unanswered by you for a more extended time
- The problem was explained and handled in another ticket
You can reopen this ticket at any time!
Please do not open related tickets twice. Always answer/ask in the original issue with the same problem.
Your datarhei team //Sven