diff --git a/Dockerfile b/Dockerfile index e671d50..4f42f7f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,6 +24,9 @@ ENV DAILYMOTION_STREAMKEY NULL ENV LIVECODING_URL rtmp://eumedia1.livecoding.tv:1935/livecodingtv ENV LIVECODING_STREAMKEY NULL +ENV FACEBOOK_URL rtmp://127.0.0.1:19350/rtmp +ENV FACEBOOK_STREAMKEY NULL + ENV YOUR_IP YOUR_IP ENV PRIVATE_KEY anthonykgross ENV STREAM_SPECIFIER hd720 @@ -31,6 +34,11 @@ ENV URL_TRANSCODE transcode ENV URL_LIVE live ENV EXPIRATION_TOKEN 3600 +RUN apt-get update && \ + apt-get install -y ca-certificates openssl libssl-dev stunnel vim&& \ + rm -rf /var/lib/apt/lists/* &&\ + mkdir -p /etc/stunnel/conf.d/ + RUN mkdir -p /conf && \ mkdir -p /log && \ chmod 777 /log -Rf && \ @@ -50,6 +58,9 @@ ADD entrypoint.sh /entrypoint.sh RUN cp /conf/nginx/nginx.conf /usr/local/nginx-streaming/conf/nginx.conf -f && \ cp /conf/supervisor/conf.d/supervisor.conf /etc/supervisor/conf.d/supervisor.conf -f && \ + cp /conf/stunnel/fb.conf /etc/stunnel/conf.d/fb.conf -f && \ + cp /conf/stunnel/stunnel4 /etc/default/stunnel4 -f && \ + cp /conf/stunnel/stunnel.conf /etc/stunnel/stunnel.conf -f && \ chmod +x /entrypoint.sh EXPOSE 80 diff --git a/README.md b/README.md index f0e7134..fade660 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,8 @@ $ docker-compose up -d * Set your Stream RTMP from Dailymotion. - **DAILYMOTION_STREAMKEY** (default :"NULL") * Set your Stream RTMP from Dailymotion. +- **FACEBOOK_STREAMKEY** (default :"NULL") + * Set your Stream RTMP from Facebook. - **YOUR_IP** (default : "YOUR_IP") * Set your server's IP : Only useful in docker's logs. - **PRIVATE_KEY** (default : "anthonykgross") @@ -74,6 +76,7 @@ broadcaster_1 | = TWITCH_STREAMKEY : live_101724967_qLZMlwnxxpKqsqsfJ5lNcBc broadcaster_1 | = HITBOX_STREAMKEY : qsfqf?key=Jn6Dsqdqsd8cpx broadcaster_1 | = YOUTUBE_STREAMKEY : poopaplla-7537.ea0k-ef3-czsz broadcaster_1 | = DAILYMOTION_STREAMKEY : 24646?auth=qeGP_9fb42e109944fa5b504e191 +broadcaster_1 | = FACEBOOK_STREAMKEY : 12312385213123?s_bl=1&s_ps=1&s_sw=0&s_vt=api-s&a=AbyDXs7sMdsygq50 broadcaster_1 | = broadcaster_1 | = URL live = rtmp://xxx.xxx.xxx.xxx:1935/live/ broadcaster_1 | = URL transcode = rtmp://xxx.xxx.xxx.xxx:1935/transcode/ diff --git a/conf/nginx/nginx.conf b/conf/nginx/nginx.conf index d3bfbdf..cf6a9c2 100644 --- a/conf/nginx/nginx.conf +++ b/conf/nginx/nginx.conf @@ -83,9 +83,12 @@ rtmp { # STREAM TO DAILYMOTION.COM push playpath=; + # STREAM TO FACEBOOK.COM + push playpath=; + # STREAM TO LiveCoding push playpath=; - + push rtmp://localhost/mobile/live; } diff --git a/conf/stunnel/fb.conf b/conf/stunnel/fb.conf new file mode 100644 index 0000000..035287f --- /dev/null +++ b/conf/stunnel/fb.conf @@ -0,0 +1,5 @@ +[fb-live] +client = yes +accept = 127.0.0.1:19350 +connect = live-api-s.facebook.com:443 +verifyChain = no diff --git a/conf/stunnel/stunnel.conf b/conf/stunnel/stunnel.conf new file mode 100644 index 0000000..f8d6a00 --- /dev/null +++ b/conf/stunnel/stunnel.conf @@ -0,0 +1,5 @@ +setuid = stunnel4 +setgid = stunnel4 +pid=/tmp/stunnel.pid +output = /var/log/stunnel4/stunnel.log +include = /etc/stunnel/conf.d diff --git a/conf/stunnel/stunnel4 b/conf/stunnel/stunnel4 new file mode 100644 index 0000000..3c2b1b7 --- /dev/null +++ b/conf/stunnel/stunnel4 @@ -0,0 +1,18 @@ +# /etc/default/stunnel +# Julien LEMOINE +# September 2003 + +# Change to one to enable stunnel automatic startup +ENABLED=1 +FILES="/etc/stunnel/*.conf" +OPTIONS="" + +# Change to one to enable ppp restart scripts +PPP_RESTART=0 + +# Change to enable the setting of limits on the stunnel instances +# For example, to set a large limit on file descriptors (to enable +# more simultaneous client connections), set RLIMITS="-n 4096" +# More than one resource limit may be modified at the same time, +# e.g. RLIMITS="-n 4096 -d unlimited" +RLIMITS="" diff --git a/docker-compose.yml b/docker-compose.yml index f7cbd4f..c7aa7c8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,6 +9,8 @@ broadcaster: # HITBOX_STREAMKEY: "NULL" # DAILYMOTION_URL: rtmp://publish.dailymotion.com/publish-dm # DAILYMOTION_STREAMKEY: "NULL" +# FACEBOOK_URL: rtmp://127.0.0.1:19350/rtmp +# FACEBOOK_STREAMKEY: "NULL" # LIVECODING_URL: rtmp://eumedia1.livecoding.tv:1935/livecodingtv # LIVECODING_STREAMKEY: "NULL" # YOUR_IP: YOUR_IP diff --git a/entrypoint.sh b/entrypoint.sh index e874f1e..c6057ec 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -13,6 +13,7 @@ run() { sed -i -e "s,,$HITBOX_URL,g" /usr/local/nginx-streaming/conf/nginx.conf sed -i -e "s,,$YOUTUBE_URL,g" /usr/local/nginx-streaming/conf/nginx.conf sed -i -e "s,,$DAILYMOTION_URL,g" /usr/local/nginx-streaming/conf/nginx.conf + sed -i -e "s,,$FACEBOOK_URL,g" /usr/local/nginx-streaming/conf/nginx.conf sed -i -e "s,,$LIVECODING_URL,g" /usr/local/nginx-streaming/conf/nginx.conf echo "===============================================================================================" @@ -61,6 +62,17 @@ run() { sed -i -e "s,,#,g" /usr/local/nginx-streaming/conf/nginx.conf fi + if [[ $FACEBOOK_STREAMKEY != "NULL" ]] + then + echo "= FACEBOOK_STREAMKEY : $FACEBOOK_STREAMKEY" + sed -i -e "s,, ,g" /usr/local/nginx-streaming/conf/nginx.conf + sed -i -e "s,,$FACEBOOK_STREAMKEY,g" /usr/local/nginx-streaming/conf/nginx.conf + + else + echo "= FACEBOOK_STREAMKEY : NOT FOUND!" + sed -i -e "s,,#,g" /usr/local/nginx-streaming/conf/nginx.conf + fi + if [[ $LIVECODING_STREAMKEY != "NULL" ]] then echo "= LIVECODING_STREAMKEY : $LIVECODING_STREAMKEY"