mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2025-07-02 04:28:30 +02:00
Compare commits
6 Commits
ovenmediae
...
8d2adad509
Author | SHA1 | Date | |
---|---|---|---|
8d2adad509 | |||
0035c63c22 | |||
849196b4cb | |||
205c4b526c | |||
1d117ea480 | |||
45cb61e436 |
@ -3,12 +3,14 @@ package ldap
|
||||
|
||||
import (
|
||||
"github.com/go-ldap/ldap/v3"
|
||||
"log"
|
||||
)
|
||||
|
||||
// Options holds package configuration
|
||||
type Options struct {
|
||||
URI string
|
||||
UserDn string
|
||||
Aliases map[string]string
|
||||
URI string
|
||||
UserDn string
|
||||
}
|
||||
|
||||
// LDAP authentification backend
|
||||
@ -20,6 +22,12 @@ type LDAP struct {
|
||||
// Login tries to bind to LDAP
|
||||
// Returns (true, nil) if success
|
||||
func (a LDAP) Login(username string, password string) (bool, error) {
|
||||
// Resolve stream alias if necessary
|
||||
for aliasFor, ok := a.Cfg.Aliases[username]; ok; aliasFor, ok = a.Cfg.Aliases[username] {
|
||||
log.Printf("[LDAP] Use stream alias %s for username %s", username, aliasFor)
|
||||
username = aliasFor
|
||||
}
|
||||
|
||||
// Try to bind as user
|
||||
bindDn := "cn=" + username + "," + a.Cfg.UserDn
|
||||
err := a.Conn.Bind(bindDn, password)
|
||||
|
@ -21,8 +21,11 @@
|
||||
</IceCandidates>
|
||||
</WebRTC>
|
||||
<HLS>
|
||||
<Port>80</Port>
|
||||
<Port>80</Port>
|
||||
</HLS>
|
||||
<DASH>
|
||||
<Port>80</Port>
|
||||
</DASH>
|
||||
</Publishers>
|
||||
</Bind>
|
||||
|
||||
@ -52,14 +55,15 @@
|
||||
</Video>
|
||||
</Encode>
|
||||
<Encode>
|
||||
<Name>BYPASS</Name>
|
||||
<Video>
|
||||
<Bypass>true</Bypass>
|
||||
</Video>
|
||||
<Name>bypass</Name>
|
||||
<Audio>
|
||||
<Bypass>true</Bypass>
|
||||
</Audio>
|
||||
<Video>
|
||||
<Bypass>true</Bypass>
|
||||
</Video>
|
||||
</Encode>
|
||||
|
||||
</Encodes>
|
||||
<Streams>
|
||||
<Stream>
|
||||
@ -71,9 +75,10 @@
|
||||
<Stream>
|
||||
<Name>${OriginStreamName}_bypass</Name>
|
||||
<Profiles>
|
||||
<Profile>BYPASS</Profile>
|
||||
<Profile>bypass</Profile>
|
||||
</Profiles>
|
||||
</Stream>
|
||||
|
||||
</Streams>
|
||||
<Providers>
|
||||
<RTMP>
|
||||
@ -86,15 +91,28 @@
|
||||
<Timeout>30000</Timeout>
|
||||
</WebRTC>
|
||||
<HLS>
|
||||
<SegmentDuration>5</SegmentDuration>
|
||||
<SegmentDuration>2</SegmentDuration>
|
||||
<SegmentCount>2</SegmentCount>
|
||||
<CrossDomain>
|
||||
<Url>*</Url>
|
||||
</CrossDomain>
|
||||
</HLS>
|
||||
<DASH>
|
||||
<SegmentDuration>2</SegmentDuration>
|
||||
<SegmentCount>2</SegmentCount>
|
||||
<CrossDomain>
|
||||
<Url>*</Url>
|
||||
</CrossDomain>
|
||||
</DASH>
|
||||
<LLDASH>
|
||||
<SegmentDuration>2</SegmentDuration>
|
||||
<CrossDomain>
|
||||
<Url>*</Url>
|
||||
</CrossDomain>
|
||||
</LLDASH>
|
||||
</Publishers>
|
||||
</Application>
|
||||
</Applications>
|
||||
</VirtualHost>
|
||||
</VirtualHosts>
|
||||
</Server>
|
||||
</Server>
|
||||
|
@ -34,6 +34,11 @@ auth:
|
||||
#ldap:
|
||||
# uri: ldap://127.0.0.1:389
|
||||
# userdn: cn=users,dc=example,dc=com
|
||||
#
|
||||
# # You can define aliases, to stream on stream.example.com/example with the credentials of the demo account.
|
||||
# aliases:
|
||||
# example: demo
|
||||
#
|
||||
|
||||
## Stream forwarding ##
|
||||
# Forward an incoming stream to other servers
|
||||
@ -173,6 +178,18 @@ web:
|
||||
#
|
||||
#widgetURL: ""
|
||||
|
||||
# IMPORTANT, CHANGE THIS
|
||||
# You need to declare which entity you are and to specify an address to claim some content.
|
||||
legalMentionsEntity: "l'association Crans"
|
||||
legalMentionsAddress: "61 Avenue du Président Wilson, 94235 Cachan Cedex, France"
|
||||
legalMentionsFullAddress:
|
||||
- Association Cr@ns - ENS Paris-Saclay
|
||||
- Notification de Contenus Illicites
|
||||
- 4, avenue des Sciences
|
||||
- 91190 Gif-sur-Yvette
|
||||
- France
|
||||
legalMentionsEmail: "bureau[at]crans.org"
|
||||
|
||||
## WebRTC server ##
|
||||
webrtc:
|
||||
# If you disable webrtc module, the web client won't be able to play streams.
|
||||
|
@ -42,8 +42,9 @@ func New() *Config {
|
||||
Credentials: make(map[string]string),
|
||||
},
|
||||
LDAP: ldap.Options{
|
||||
URI: "ldap://127.0.0.1:389",
|
||||
UserDn: "cn=users,dc=example,dc=com",
|
||||
Aliases: make(map[string]string),
|
||||
URI: "ldap://127.0.0.1:389",
|
||||
UserDn: "cn=users,dc=example,dc=com",
|
||||
},
|
||||
},
|
||||
Forwarding: make(map[string][]string),
|
||||
@ -82,6 +83,11 @@ func New() *Config {
|
||||
MapDomainToStream: make(map[string]string),
|
||||
PlayerPoster: "/static/img/no_stream.svg",
|
||||
ViewersCounterRefreshPeriod: 20000,
|
||||
LegalMentionsEntity: "l'association Crans",
|
||||
LegalMentionsAddress: "61 Avenue du Président Wilson, 94235 Cachan Cedex, France",
|
||||
LegalMentionsFullAddress: []string{"Association Cr@ns - ENS Paris-Saclay",
|
||||
"Notification de Contenus Illicites", "4, avenue des Sciences", "91190 Gif-sur-Yvette", "France"},
|
||||
LegalMentionsEmail: "bureau[at]crans.org",
|
||||
},
|
||||
WebRTC: webrtc.Options{
|
||||
Enabled: false,
|
||||
|
@ -47,10 +47,20 @@ export function initViewerPage(stream, omeApp, viewersCounterRefreshPeriod, post
|
||||
"label": " WebRTC - Source"
|
||||
},
|
||||
{
|
||||
"type": "hls",
|
||||
"file": "https://" + window.location.host + "/" + omeApp + "/" + stream + "_bypass/playlist.m3u8",
|
||||
"type": "hls",
|
||||
"label": " HLS"
|
||||
}
|
||||
},
|
||||
{
|
||||
"file": "https://" + window.location.host + "/" + omeApp + "/" + stream + "_bypass/manifest.mpd",
|
||||
"type": "dash",
|
||||
"label": "DASH"
|
||||
},
|
||||
{
|
||||
"file": "https://" + window.location.host + "/" + omeApp + "/" + stream + "_bypass/manifest_ll.mpd",
|
||||
"type": "dash",
|
||||
"label": "LL-DASH"
|
||||
},
|
||||
]
|
||||
});
|
||||
player.on("stateChanged", function (data) {
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
web/static/ovenplayer/ovenplayer.provider.Html5-0.9.0.js
Normal file
2
web/static/ovenplayer/ovenplayer.provider.Html5-0.9.0.js
Normal file
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
/*! OvenPlayerv0.9.0 | (c)2020 AirenSoft Co., Ltd. | MIT license (https://github.com/AirenSoft/OvenPlayerPrivate/blob/master/LICENSE) | Github : https://github.com/AirenSoft/OvenPlayer */
|
File diff suppressed because one or more lines are too long
2
web/static/ovenplayer/ovenplayer.sdk.js
Normal file
2
web/static/ovenplayer/ovenplayer.sdk.js
Normal file
File diff suppressed because one or more lines are too long
1
web/static/ovenplayer/ovenplayer.sdk.js.LICENSE
Normal file
1
web/static/ovenplayer/ovenplayer.sdk.js.LICENSE
Normal file
@ -0,0 +1 @@
|
||||
/*! OvenPlayerv0.9.0 | (c)2020 AirenSoft Co., Ltd. | MIT license (https://github.com/AirenSoft/OvenPlayerPrivate/blob/master/LICENSE) | Github : https://github.com/AirenSoft/OvenPlayer */
|
@ -9,7 +9,11 @@
|
||||
</p>
|
||||
|
||||
<h2>Comment je diffuse ?</h2>
|
||||
<p>Pour diffuser un contenu vous devez être adhérent Crans.</p>
|
||||
<p>
|
||||
Pour diffuser un contenu vous devez avoir des identifiants valides.
|
||||
Si le service est hébergé par une association, il est probable que
|
||||
vous deviez être membre de cette association.
|
||||
</p>
|
||||
|
||||
<h3>Avec Open Broadcaster Software</h3>
|
||||
<p>
|
||||
@ -21,7 +25,7 @@
|
||||
<ul>
|
||||
<li>
|
||||
<b>Serveur :</b>
|
||||
<code>srt://{{.Cfg.Hostname}}:{{.Cfg.SRTServerPort}}?IDENTIFIANT:MOT_DE_PASS</code>,
|
||||
<code>srt://{{.Cfg.Hostname}}:{{.Cfg.SRTServerPort}}?IDENTIFIANT:MOT_DE_PASSE</code>,
|
||||
avec <code>IDENTIFIANT</code> et <code>MOT_DE_PASSE</code>
|
||||
vos identifiants.
|
||||
</li>
|
||||
@ -42,7 +46,8 @@
|
||||
<p>
|
||||
<code>
|
||||
{{/* FIXME replace with good SRT params */}}
|
||||
ffmpeg -re -i mavideo.webm -vcodec libx264 -vprofile baseline
|
||||
ffmpeg -re -i mavideo.webm -vcodec libx264
|
||||
-preset:v veryfast -vprofile baseline -tune zerolatency
|
||||
-acodec aac -strict -2 -f flv
|
||||
srt://{{.Cfg.Hostname}}:{{.Cfg.SRTServerPort}}?streamid=IDENTIFIANT:MOT_DE_PASSE
|
||||
</code>
|
||||
@ -95,10 +100,9 @@
|
||||
Bien que VLC supporte officiellement le protocole SRT,
|
||||
toutes les options ne sont pas encore implémentées,
|
||||
notamment l'option pour choisir son stream.
|
||||
<a href="https://patches.videolan.org/patch/30299/">Un patch</a>
|
||||
a été soumis et est en attente d'acceptation.
|
||||
Une fois le patch accepté, il sera appliqué dans les versions
|
||||
de développement de VLC. Sous Arch Linux, il suffit de récupérer
|
||||
Cette option n'est supportée que dans la version de développement
|
||||
depuis très récemment, grâce à un patch de l'un des développeurs
|
||||
de Ghostream. Sous Arch Linux, il suffit de récupérer
|
||||
le paquet <code>vlc-git</code> de l'AUR. Avec un VLC à jour,
|
||||
il suffit d'exécuter :
|
||||
</p>
|
||||
@ -128,18 +132,18 @@
|
||||
Le service de diffusion vidéo du Crans est un service d'hébergement
|
||||
au sens de l'article 6, I, 2e de la loi 2004-575 du 21 juin 2004.
|
||||
Conformément aux dispositions de l'article 6, II du même,
|
||||
l'association Crans conserve les données de nature à permettre
|
||||
conserve les données de nature à permettre
|
||||
l'identification des auteurs du contenu diffusé.
|
||||
Ce service est hébergé par l'association Crans, au
|
||||
61 Avenue du Président Wilson, 94235 Cachan Cedex, France.
|
||||
Ce service est hébergé par {{.Cfg.LegalMentionsEntity}}, au
|
||||
{{.Cfg.LegalMentionsAddress}}.
|
||||
</p>
|
||||
<p>
|
||||
<b>En cas de réclamation sur le contenu diffusé</b>,
|
||||
la loi vous autorise à contacter directement l'hébergeur à
|
||||
l'adresse suivante :
|
||||
<pre>Association Cr@ns - ENS Paris-Saclay<br/>Notification de Contenus Illicites<br/>4, avenue des Sciences<br/>91190 Gif-sur-Yvette<br/>France</pre>
|
||||
<pre>{{range $i, $element := .Cfg.LegalMentionsFullAddress}}{{$element}}<br/>{{end}}</pre>
|
||||
Vous pouvez également envoyer directement vos réclamations par
|
||||
courrier électronique à l'adresse <code>bureau[at]crans.org</code>.
|
||||
courrier électronique à l'adresse <code>{{.Cfg.LegalMentionsEmail}}</code>.
|
||||
</p>
|
||||
</div>
|
||||
{{end}}
|
||||
|
@ -36,6 +36,7 @@
|
||||
|
||||
{{if .OMECfg.Enabled}}
|
||||
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/dashjs/2.9.3/dash.all.min.js"></script>
|
||||
<script src="/static/ovenplayer/ovenplayer.js"></script>
|
||||
<script src="/static/js/ovenplayer.js"></script>
|
||||
{{end}}
|
||||
|
@ -28,6 +28,10 @@ type Options struct {
|
||||
STUNServers []string
|
||||
ViewersCounterRefreshPeriod int
|
||||
WidgetURL string
|
||||
LegalMentionsEntity string
|
||||
LegalMentionsAddress string
|
||||
LegalMentionsFullAddress []string
|
||||
LegalMentionsEmail string
|
||||
}
|
||||
|
||||
var (
|
||||
|
Reference in New Issue
Block a user