Giter VIP home page Giter VIP logo

multistreamer-installer's Introduction

Archived

Hi all. I don't enjoy working on this anymore. I'm archiving this repo, you're free to fork it.

Stop emailing me directly.

multistreamer-installer

An install script for installing Multistreamer onto a server.

So far, this is only tested with Ubuntu 16.04.

This will:

  1. Download ffmpeg, and dependencies for compiling OpenResty
  2. Download/Compile/Install OpenResty + the nginx RTMP module and Stream-Lua modules
  3. Install a precompiled version of sockexec
  4. Download postgres-auth-server
  5. Download Multistreamer
  6. Install needed lua modules for postgres-auth-server/multistreamer
  7. Create scripts under /usr/local/bin for launching postgres-auth-server, multistreamer, and sockexec
  8. Create a multistreamer user
  9. Create systemd service units for postgres-auth-server, multistreamer, and sockexec

Optionally, it can:

  1. Install Postgresql and redis and configure them
  2. Install nginx + haproxy as reverse proxies
  3. Setup dehydrated for automatic renewel of Let's Encrypt certificates
  4. Create a basic configuration for multistreamer
  5. Add your first user to postgres-auth-server or import users from an older htpasswd-auth-server installation

Usage

Clone this repo somewhere, and either run install as root, or setup as root.

git clone https://github.com/jprjr/multistreamer-installer
cd multistreamer
sudo ./install # or sudo ./setup <domain>

install just downloads + compiles openresty, multistreamer, sockexec, etc. It doesn't do any setup steps, doesn't automatically enable any services, no configuration of multistreamer, and so on. You can keep the repo around to act as an updater for Multistreamer - anytime you run install, it will checkout the latest tag from Multistreamer.

setup runs install, then does additional steps assuming this box is brand-new, dedicated to multistreamer, and has a DNS hostname. It can be somewhat destructive - if your box is currently running Apache, it disables Apache, for example. So setup should only be run on something 100% dedicated to running Multistreamer.

Steps to take if you only run ./install

When done, you'll have everything installed under /opt:

  • /opt/sockexec
  • /opt/postgres-auth-server
  • /opt/multistreamer

Additionally, convenience scripts are placed in /usr/local/bin, so instead of typing long commands like:

  • ./bin/postgres-auth-server -l /opt/openresty-rtmp/luajit/bin/luajit add
  • ./bin/postgres-auth-server -l /opt/openresty-rtmp/luajit/bin/luajit run

you can simply call

  • postgres-auth-server add
  • postgres-auth-server run

Similarly for multistreamer, instead of typing:

  • ./bin/multistreamer -l /opt/openresty-rtmp/luajit/bin/luajit -e prod initdb
  • ./bin/multistreamer -l /opt/openresty-rtmp/luajit/bin/luajit -e prod run

you can just type

  • multistreamer -e prod initdb
  • multistreamer -e prod run

Basically, the -l /opt/openresty-rtmp/luajit/bin/luajit part of the command isn't needed if you just type multistreamer instead of ./bin/multistreamer, postgres-auth-server instead of ./bin/postgres-auth-server

Once you've finished setting up postgres-auth, multistreamer, etc manually and you're sure everything is to your liking, enable and start the services:

systemctl enable sockexec.service postgres-auth-server.service multistreamer.service
systemctl start sockexec.service postgres-auth-server.service multistreamer.service

Stesp to take if you run ./setup <domain>

Nothing, you'll have Let's Encrypt certificates installed, your first user created, etc.

Your multistreamer installation will be available at https://, and you'll be able to add/remove users, change passwords, etc at https:///users

Be sure to check out the above notes about where Multistreamer, sockexec, and postgres-auth-server are installed.

Dehydrated is installed at /opt/dehydrated, and its config, certs, keys etc are at /etc/dehydrated.

A script is installed to /etc/cron.daily/ to auto-renew Let's Encrypt certificates and reload nginx + haproxy.

nginx is configured as a reverse proxy in front of Multistreamer's web interface. Be sure to look at /etc/nginx/sites-available/(your domain), that's where the reverse proxy configuration is at.

haproxy is configured to provide SSL for the IRC port, look at /etc/haproxy/haproxy.cfg for its configuration.

To create more users, just run postgres-auth-server add, you'll be prompted for a username and password, or visit https:///users

License

Released under an MIT license, see LICENSE

multistreamer-installer's People

Contributors

jprjr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

multistreamer-installer's Issues

Adding Users.

When I go to add users. It add's them but then won't let me log in.

Update #1: I can login via the main account that was created via the ./setup process.
Update #2: If i use the command "postgres-auth-server add (username)" it adds the user

Installation on an already running nginx vps ?

Hi @jprjr and thank you for the great work ! I have some issues managing to run the docker image on my vps as I followed you great video here : https://youtu.be/HdDDtBOLme4?t=1228

On my vps/host, an nginx instance is already running and manage all of our websites, so I decided to move the 8081 port to 8085. Same for rmtp, there is already one running for our live streams so I moved the port 1935 to 1937. I have opened the following ports on my firewall (dunno if I have too by the way) : 8085,6667,1937
VPS : Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-45-generic x86_64)

So basically I can't access to the website (error 500) as I believe everything is well configured. Here is my configuration :

docker-compose.override.yml

redisio:
  volumes:
   - /home/admin/conf/web:/etc/ssl
   - /srv/docker/multistreamer/redis:/var/lib/redis:Z
postgresql:
  volumes:
   - /home/admin/conf/web:/etc/ssl
   - /srv/docker/multistreamer/postgresql:/var/lib/postgresql:Z
  environment:
   - POSTGRES_USER=multistreamer
   - POSTGRES_PASS=password
multistreamer:
  ports:
   - "185.19.29.84:8085:8081"
   - "6667:6667"
   - "1937:1935"
  volumes:
   - /home/admin/conf/web:/etc/ssl
   - /srv/docker/multistreamer/multistreamer:/etc/multistreamer:Z
   - ./htpasswd:/etc/htpasswd-auth-server:Z
  environment:
   MULTISTREAMER_APP_NAME: multistreamer
   MULTISTREAMER_LANG_ID: en_us
   MULTISTREAMER_AUTH_ENDPOINT: 
   MULTISTREAMER_SESSION_SECRET: 123456
   MULTISTREAMER_PUBLIC_HTTP_URL: https://onair.solarsoundsystem.org
   MULTISTREAMER_PUBLIC_RTMP_URL: rtmp://onair.solarsoundsystem.org:1937
   MULTISTREAMER_RTMP_PREFIX: multistreamer
   MULTISTREAMER_HTTP_PREFIX: 
   MULTISTREAMER_PUBLIC_IRC_HOSTNAME: onair.solarsoundsystem.org
   MULTISTREAMER_PUBLIC_IRC_PORT: 6667
   MULTISTREAMER_TWITCH_CLIENT_ID: 
   MULTISTREAMER_TWITCH_CLIENT_SECRET: 
   MULTISTREAMER_TWITCH_INGEST_SERVER: 
   MULTISTREAMER_YOUTUBE_CLIENT_ID: 
   MULTISTREAMER_YOUTUBE_CLIENT_SECRET: 
   MULTISTREAMER_YOUTUBE_COUNTRY_CODE: 
   MULTISTREAMER_FACEBOOK_APP_ID: 
   MULTISTREAMER_FACEBOOK_APP_SECRET: 
   MULTISTREAMER_MIXER_CLIENT_ID: 
   MULTISTREAMER_MIXER_CLIENT_SECRET: 
   MULTISTREAMER_MIXER_INGEST_SERVER: 
   MULTISTREAMER_LOG_LEVEL: error
   MULTISTREAMER_PUBLIC_IRC_SSL: 'false'
   MULTISTREAMER_SESSION_NAME: multistreamer
   MULTISTREAMER_LOQ_QUERIES: 'false'
   MULTISTREAMER_LOQ_REQUESTS: 'false'
   MULTISTREAMER_IRC_FORCE_JOIN: 'false'
   MULTISTREAMER_WORKER_PROCESSES: 1
   MULTISTREAMER_DNS_RESOLVER: 127.0.0.1:5353 ipv6=off
   MULTISTREAMER_DICT_STREAMS_SIZE: 10m
   MULTISTREAMER_DICT_WRITERS_SIZE: 10m
   MULTISTREAMER_FFMPEG_MAX_ATTEMPTS: 3
   MULTISTREAMER_PING: 1m
   MULTISTREAMER_PING_TIMEOUT: 30s
   MULTISTREAMER_SHOW_VERSION: 'true'
   MULTISTREAMER_IRC_MOTD: |-
     Welcome to the SolarSoundSystem IRC server!
     Shine On.

On the host, here is my nginx configuration :

server {
    listen      185.19.29.84:443 http2;
    server_name onair.solarsoundsystem.org ;
    ssl         on;
    ssl_certificate      /home/admin/conf/web/ssl.onair.solarsoundsystem.org.pem;
    ssl_certificate_key  /home/admin/conf/web/ssl.onair.solarsoundsystem.org.key;
    error_log  /var/log/httpd/domains/onair.solarsoundsystem.org.error.log error;
 
      location / {
	proxy_pass https://185.19.29.84:8085;
	proxy_request_buffering off;
	proxy_http_version 1.1;
	#proxy_redirect http:// https://;
}

      location /ws {
	proxy_pass https://185.19.29.84:8085;
	proxy_request_buffering off;
	proxy_http_version 1.1;
	#proxy_redirect http:// https://;
	proxy_set_header Upgrade $http_upgrade;
	proxy_set_header Connection "upgrade";

    }

    location /error/ {
        alias   /home/admin/web/onair.solarsoundsystem.org/document_errors/;
    }

    location @fallback {
        proxy_pass      https://185.19.29.84:8443;
    }

    include /home/admin/conf/web/snginx.onair.solarsoundsystem.org.conf*;
}

docker-compose up

Starting docker-multistreamer_postgresql_1 ... done
Starting docker-multistreamer_redisio_1    ... done
Recreating docker-multistreamer_multistreamer_1 ... done
Attaching to docker-multistreamer_postgresql_1, docker-multistreamer_redisio_1, docker-multistreamer_multistreamer_1
postgresql_1     | 2019-03-05 13:49:56.221 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
postgresql_1     | 2019-03-05 13:49:56.221 UTC [1] LOG:  listening on IPv6 address "::", port 5432
postgresql_1     | 2019-03-05 13:49:56.226 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgresql_1     | 2019-03-05 13:49:56.249 UTC [23] LOG:  database system was shut down at 2019-03-05 13:49:39 UTC
postgresql_1     | 2019-03-05 13:49:56.261 UTC [1] LOG:  database system is ready to accept connections
redisio_1        | 1:C 05 Mar 2019 13:49:56.265 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redisio_1        | 1:C 05 Mar 2019 13:49:56.265 # Redis version=5.0.3, bits=64, commit=00000000, modified=0, pid=1, just started
redisio_1        | 1:C 05 Mar 2019 13:49:56.265 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
redisio_1        | 1:M 05 Mar 2019 13:49:56.267 * Running mode=standalone, port=6379.
redisio_1        | 1:M 05 Mar 2019 13:49:56.267 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
redisio_1        | 1:M 05 Mar 2019 13:49:56.267 # Server initialized
redisio_1        | 1:M 05 Mar 2019 13:49:56.267 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
redisio_1        | 1:M 05 Mar 2019 13:49:56.267 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
redisio_1        | 1:M 05 Mar 2019 13:49:56.267 * DB loaded from disk: 0.000 seconds
redisio_1        | 1:M 05 Mar 2019 13:49:56.268 * Ready to accept connections
multistreamer_1  | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
multistreamer_1  | [s6-init] ensuring user provided files have correct perms...exited 0.
multistreamer_1  | [fix-attrs.d] applying ownership & permissions fixes...
multistreamer_1  | [fix-attrs.d] done.
multistreamer_1  | [cont-init.d] executing container initialization scripts...
multistreamer_1  | [cont-init.d] 01-setup: executing...
multistreamer_1  | [cont-init.d] 01-setup: exited 0.
multistreamer_1  | [cont-init.d] done.
multistreamer_1  | [services.d] starting services
multistreamer_1  | [services.d] done.

And what I have when accessing to https://onair.solarsoundsystem.org/ is only a 500 error message, without any error logs in nginx or apache

Any idea ? Thanks in advance for your help ! Really looking forward making it work

Install script not run

Hi,
I´m trying to install with script on ubuntu 16.04 on VPS but not run..
image
this is multistreamer status
Could you help me...
thank you

Stream Preview not working

Stream preview not working.,, It detect signal because go button "Go Live!" is actived but dont preview image
thank you!

Install Error

I'm having trouble while installing. It keeps erroring out at this point.

Generating multistreamer config file (/etc/multistreamer/config.yaml) ...
./setup: 512: ./setup: /opt/openresty-rtmp/bin/lua: not found

install_error

Install so not FFMPEG

Hi,
I install with script and its all ok, but, in app dont appear option to ffmpeg arguments for custom RTMP
Could you help me?
thank you

Shouldn't L197 be changed?

$LUAROCKS --tree=lua_modules install --only-deps /opt/multistreamer/rockspecs/multistreamer-dev-1.rockspec >> $MISC_LOGFILE 2>&1

Shouldn't this line be change, there seems to be differences in rockspecs?

 diff -u multistreamer-dev-1.rockspec multistreamer-12.2.2-0.rockspec
--- multistreamer-dev-1.rockspec	2019-01-06 08:35:44.941432367 -0500
+++ multistreamer-12.2.2-0.rockspec	2019-02-25 07:47:22.411487355 -0500
@@ -1,9 +1,9 @@
 package = "multistreamer"
-version = "dev-1"
+version = "12.2.2-0"
 
 source = {
-  url = "https://github.com/jprjr/multistreamer/archive/luarocks.tar.gz",
-  file = "multistreamer-luarocks.tar.gz",
+  url = "https://github.com/jprjr/multistreamer/archive/12.2.2.tar.gz",
+  file = "multistreamer-12.2.2.tar.gz",
 }
 
 dependencies = {
@@ -37,6 +37,7 @@
       ["multistreamer.config"] = "lib/multistreamer/config.lua",
       ["multistreamer.getopt"] = "lib/multistreamer/getopt.lua",
       ["multistreamer.http"] = "lib/multistreamer/http.lua",
+      ["multistreamer.importexport"] = "lib/multistreamer/importexport.lua",
       ["multistreamer.migrations"] = "lib/multistreamer/migrations.lua",
       ["multistreamer.nginx-conf"] = "lib/multistreamer/nginx-conf.lua",
       ["multistreamer.process_manager"] = "lib/multistreamer/process_manager.lua",

Script Installation Problems, not realy userfriendly

hi i have installed it with ./setup stream1......... instalation was sucesfully
if i go to my browser with stream1..... then i get 502 Bad gateway and in nginx config
conflicting server name "stream1..........." on [::]:443, ignored
So if i adjust the sites-available config to server1...... nginx is starting and in the browser i get "ERR_EMPTY_RESPONSE"

So i have no idea anymore, pls help me out.

How do I add Facebook APP, Youtube, etc using ./setup <domain>?

Hi jprjr...I found amazing your script, but I could not add YouTube and Facebook Accounts into the page. In fact, I made a fresh install and using your script Multistreamer-installer. How do I add these accounts with a command or where can I manually add these accounts?
I really hope to receive an answer.

Thanks
Screenshot 2019-07-17 at 2 27 10 AM

Succes but error..

I´m install on VPS ubuntu 16.04. It install fine, and say SUCESS but dont work.
say that:

Getting Let's Encrypt certificates...

/opt/openresty-rtmp/luajit/bin/luajit: /opt/multistreamer/lib/multistreamer/config.lua:2: module 'lyaml' not found:
no field package.preload['lyaml']
no file '/opt/multistreamer/lib/lyaml.lua'
no file '/opt/multistreamer/lib/lyaml/init.lua'
no file '/opt/multistreamer/lua_modules/share/lua/5.1/lyaml.lua'
no file '/opt/multistreamer/lua_modules/share/lua/5.1/lyaml/init.lua'
no file './lyaml.lua'
no file '/opt/multistreamer/lua_modules/lib/lua/5.1/lyaml.so'
stack traceback:
[C]: in function 'require'
/opt/multistreamer/lib/multistreamer/config.lua:2: in main chunk
[C]: in function 'require'
/opt/multistreamer/lib/multistreamer/cli.lua:4: in main chunk
[C]: in function 'require'
/opt/multistreamer/bin/multistreamer.lua:3: in main chunk
[C]: at 0x00404b60

Enabling and starting sockexec, postgres-auth-server, multistreamer...

Using the ./setup

Right so i was going to reply to you via eMail. But i thought that it would be more convient for me to post it all on this git since it's todo with this one. Also means if anyone else get's these problems you can send them to this issuie thread and they can have a good read. Hope that is all okay with you :)

Looked into the temp folder and this has happened.

make[1]: Leaving directory '/src/openresty-1.11.2.4/build/nginx-1.11.2'
mkdir -p /opt/openresty-1.11.2.4-rtmp/site/lualib /opt/openresty-1.11.2.4-rtmp/site/pod /opt/openresty-1.11.2.4-rtmp/site/manifest
ln -sf /opt/openresty-1.11.2.4-rtmp/nginx/sbin/nginx /opt/openresty-1.11.2.4-rtmp/bin/openresty
~/multistreamer-installer
./install: line 83: opt/openresty-1.11.2.4-rtmp: No such file or directory```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.