mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2024-12-22 20:52:20 +00:00
Fix hostname
This commit is contained in:
parent
73bf43afc5
commit
4b5c5d282e
@ -79,10 +79,10 @@ sudo apt install python3-ldap python3-flask uwsgi-plugin-python3
|
|||||||
git clone https://gitlab.crans.org/nounous/ghostream && cd ghostream
|
git clone https://gitlab.crans.org/nounous/ghostream && cd ghostream
|
||||||
```
|
```
|
||||||
|
|
||||||
Copy [ghostreamer.service](doc/ghostreamer.service) to `/etc/systemd/system/ghostreamer.service`
|
Copy [ghostreamer.service](doc/ghostream.service) to `/etc/systemd/system/ghostream.service`
|
||||||
and customize.
|
and customize.
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
sudo systemctl enable --now ghostreamer
|
sudo systemctl enable --now ghostream
|
||||||
```
|
```
|
||||||
|
@ -9,6 +9,7 @@ Environment=FLASK_CONFIG=production
|
|||||||
Environment=LDAP_URI=ldap://127.0.0.1:389
|
Environment=LDAP_URI=ldap://127.0.0.1:389
|
||||||
Environment=LDAP_USER_DN=cn=Utilisateurs,dc=crans,dc=org
|
Environment=LDAP_USER_DN=cn=Utilisateurs,dc=crans,dc=org
|
||||||
Environment=SITE_NAME=Crans Stream
|
Environment=SITE_NAME=Crans Stream
|
||||||
|
Environment=SITE_HOSTNAME=stream.crans.org
|
||||||
Environment=FAVICON=https://www.crans.org/images/favicon.ico
|
Environment=FAVICON=https://www.crans.org/images/favicon.ico
|
||||||
ExecStart=uwsgi --http-socket 127.0.0.1:8080 --master --plugin python3 --module ghostream:app --static-map /static=/var/local/ghostream/ghostream/static
|
ExecStart=uwsgi --http-socket 127.0.0.1:8080 --master --plugin python3 --module ghostream:app --static-map /static=/var/local/ghostream/ghostream/static
|
||||||
Restart=always
|
Restart=always
|
@ -30,7 +30,7 @@ rtmp {
|
|||||||
live on;
|
live on;
|
||||||
record off;
|
record off;
|
||||||
push rtmp://127.0.0.1:1915;
|
push rtmp://127.0.0.1:1915;
|
||||||
on_publish http://127.0.0.1:5000/;
|
on_publish http://127.0.0.1:8080/app/auth;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,9 +49,11 @@ server {
|
|||||||
access_log /var/log/nginx/ghostream.log;
|
access_log /var/log/nginx/ghostream.log;
|
||||||
error_log /var/log/nginx/ghostream_error.log;
|
error_log /var/log/nginx/ghostream_error.log;
|
||||||
|
|
||||||
# Serve static HTML page with URL rewriting
|
# Pass HTTP to Flask web server
|
||||||
root /var/www/stream;
|
location / {
|
||||||
try_files $uri $uri/ /index.html;
|
proxy_pass http://127.0.0.1:8080;
|
||||||
|
proxy_redirect off;
|
||||||
|
}
|
||||||
|
|
||||||
# Pass WebSocket to OvenMediaEngine for WebRTC signalling
|
# Pass WebSocket to OvenMediaEngine for WebRTC signalling
|
||||||
location /app/ {
|
location /app/ {
|
||||||
|
@ -15,13 +15,9 @@ def viewer(path):
|
|||||||
"""Show stream that match this path"""
|
"""Show stream that match this path"""
|
||||||
return render_template('viewer.html', path=path)
|
return render_template('viewer.html', path=path)
|
||||||
|
|
||||||
@app.route('/auth', methods=['POST'])
|
@app.route('/app/auth', methods=['POST'])
|
||||||
def auth():
|
def auth():
|
||||||
"""Authentication on stream start"""
|
"""Authentication on stream start"""
|
||||||
# Limit to NGINX auth
|
|
||||||
if request.remote_addr != '127.0.0.1':
|
|
||||||
return "Permission denied", 403
|
|
||||||
|
|
||||||
name = request.form.get('name')
|
name = request.form.get('name')
|
||||||
password = request.form.get('pass')
|
password = request.form.get('pass')
|
||||||
|
|
||||||
|
@ -8,4 +8,5 @@ LDAP_USER_DN = os.environ.get('LDAP_USER_DN') or "cn=users,dc=example,dc=com"
|
|||||||
|
|
||||||
# Web page
|
# Web page
|
||||||
SITE_NAME = os.environ.get('SITE_NAME') or "Ghostream"
|
SITE_NAME = os.environ.get('SITE_NAME') or "Ghostream"
|
||||||
|
SITE_HOSTNAME = os.environ.get('SITE_HOSTNAME') or "localhost"
|
||||||
FAVICON = os.environ.get('FAVICON') or "/favicon.ico"
|
FAVICON = os.environ.get('FAVICON') or "/favicon.ico"
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<b>Serveur :</b>
|
<b>Serveur :</b>
|
||||||
<code>rtmps://{{ request.remote_addr }}:1935/app</code>,
|
<code>rtmps://{{ config.SITE_HOSTNAME }}:1935/app</code>,
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b>Clé de stream :</b>
|
<b>Clé de stream :</b>
|
||||||
@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
Votre stream sera alors disponible sur
|
Votre stream sera alors disponible sur
|
||||||
<code>https://{{ request.remote_addr }}/IDENTIFIANT</code>.
|
<code>https://{{ config.SITE_HOSTNAME }}/IDENTIFIANT</code>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h3>Avec FFmpeg</h3>
|
<h3>Avec FFmpeg</h3>
|
||||||
@ -51,7 +51,7 @@
|
|||||||
<code>
|
<code>
|
||||||
ffmpeg -re -i mavideo.webm -vcodec libx264 -vprofile baseline
|
ffmpeg -re -i mavideo.webm -vcodec libx264 -vprofile baseline
|
||||||
-acodec aac -strict -2 -f flv
|
-acodec aac -strict -2 -f flv
|
||||||
rtmps://{{ request.remote_addr }}:1935/app/IDENTIFIANT?pass=MOT_DE_PASSE
|
rtmps://{{ config.SITE_HOSTNAME }}:1935/app/IDENTIFIANT?pass=MOT_DE_PASSE
|
||||||
</code>
|
</code>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
<path fill-rule="evenodd" d="M1.5 13A1.5 1.5 0 0 0 3 14.5h8a1.5 1.5 0 0 0 1.5-1.5V9a.5.5 0 0 0-1 0v4a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 0 0-1H3A1.5 1.5 0 0 0 1.5 5v8zm7-11a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v5a.5.5 0 0 1-1 0V2.5H9a.5.5 0 0 1-.5-.5z"/>
|
<path fill-rule="evenodd" d="M1.5 13A1.5 1.5 0 0 0 3 14.5h8a1.5 1.5 0 0 0 1.5-1.5V9a.5.5 0 0 0-1 0v4a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 0 0-1H3A1.5 1.5 0 0 0 1.5 5v8zm7-11a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v5a.5.5 0 0 1-1 0V2.5H9a.5.5 0 0 1-.5-.5z"/>
|
||||||
<path fill-rule="evenodd" d="M14.354 1.646a.5.5 0 0 1 0 .708l-8 8a.5.5 0 0 1-.708-.708l8-8a.5.5 0 0 1 .708 0z"/>
|
<path fill-rule="evenodd" d="M14.354 1.646a.5.5 0 0 1 0 .708l-8 8a.5.5 0 0 1-.708-.708l8-8a.5.5 0 0 1 .708 0z"/>
|
||||||
</svg>
|
</svg>
|
||||||
<code>rtmps://{{ request.remote_addr }}:1935/app/{{ path }}</code>
|
<code>rtmps://{{ config.SITE_HOSTNAME }}:1935/app/{{ path }}</code>
|
||||||
<a href="#" id="chatToggle" title="Cacher/Afficher le chat">»</a>
|
<a href="#" id="chatToggle" title="Cacher/Afficher le chat">»</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@ -47,7 +47,7 @@ player = OvenPlayer.create("player", {
|
|||||||
expandFullScreenUI: true,
|
expandFullScreenUI: true,
|
||||||
sources: [
|
sources: [
|
||||||
{
|
{
|
||||||
"file": "wss://{{ request.remote_addr }}/app/{{ path }}",
|
"file": "wss://{{ config.SITE_HOSTNAME }}/app/{{ path }}",
|
||||||
"type": "webrtc",
|
"type": "webrtc",
|
||||||
"label": "WebRTC Source"
|
"label": "WebRTC Source"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user