mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2024-12-22 15:02:19 +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
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
```
|
||||
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_USER_DN=cn=Utilisateurs,dc=crans,dc=org
|
||||
Environment=SITE_NAME=Crans Stream
|
||||
Environment=SITE_HOSTNAME=stream.crans.org
|
||||
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
|
||||
Restart=always
|
@ -30,7 +30,7 @@ rtmp {
|
||||
live on;
|
||||
record off;
|
||||
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;
|
||||
error_log /var/log/nginx/ghostream_error.log;
|
||||
|
||||
# Serve static HTML page with URL rewriting
|
||||
root /var/www/stream;
|
||||
try_files $uri $uri/ /index.html;
|
||||
# Pass HTTP to Flask web server
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8080;
|
||||
proxy_redirect off;
|
||||
}
|
||||
|
||||
# Pass WebSocket to OvenMediaEngine for WebRTC signalling
|
||||
location /app/ {
|
||||
|
@ -15,13 +15,9 @@ def viewer(path):
|
||||
"""Show stream that match this path"""
|
||||
return render_template('viewer.html', path=path)
|
||||
|
||||
@app.route('/auth', methods=['POST'])
|
||||
@app.route('/app/auth', methods=['POST'])
|
||||
def auth():
|
||||
"""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')
|
||||
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
|
||||
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"
|
||||
|
@ -23,7 +23,7 @@
|
||||
<ul>
|
||||
<li>
|
||||
<b>Serveur :</b>
|
||||
<code>rtmps://{{ request.remote_addr }}:1935/app</code>,
|
||||
<code>rtmps://{{ config.SITE_HOSTNAME }}:1935/app</code>,
|
||||
</li>
|
||||
<li>
|
||||
<b>Clé de stream :</b>
|
||||
@ -43,7 +43,7 @@
|
||||
|
||||
<p>
|
||||
Votre stream sera alors disponible sur
|
||||
<code>https://{{ request.remote_addr }}/IDENTIFIANT</code>.
|
||||
<code>https://{{ config.SITE_HOSTNAME }}/IDENTIFIANT</code>.
|
||||
</p>
|
||||
|
||||
<h3>Avec FFmpeg</h3>
|
||||
@ -51,7 +51,7 @@
|
||||
<code>
|
||||
ffmpeg -re -i mavideo.webm -vcodec libx264 -vprofile baseline
|
||||
-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>
|
||||
</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="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>
|
||||
<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>
|
||||
</p>
|
||||
</div>
|
||||
@ -47,7 +47,7 @@ player = OvenPlayer.create("player", {
|
||||
expandFullScreenUI: true,
|
||||
sources: [
|
||||
{
|
||||
"file": "wss://{{ request.remote_addr }}/app/{{ path }}",
|
||||
"file": "wss://{{ config.SITE_HOSTNAME }}/app/{{ path }}",
|
||||
"type": "webrtc",
|
||||
"label": "WebRTC Source"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user