Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sfu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alain Takoudjou
sfu
Commits
4bdd7c76
Commit
4bdd7c76
authored
Sep 10, 2020
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement group redirection.
parent
c2b1723b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
2 deletions
+18
-2
README
README
+3
-1
group.go
group.go
+1
-0
webclient.go
webclient.go
+6
-0
webserver.go
webserver.go
+8
-1
No files found.
README
View file @
4bdd7c76
...
...
@@ -75,7 +75,9 @@ fields, all of which are optional.
- `allow-recording`: if true, then recording is allowed in this group;
- `allow-anonymous`: if true, then users may connect with an empty
username; this is not recommended, since anonymous users are not
allowed to participate in the chat.
allowed to participate in the chat;
- `redirect`: if set, then attempts to join the group will be redirected
to the given URL; most other fields are ignored in this case.
A user definition is a dictionary with the following fields:
...
...
group.go
View file @
4bdd7c76
...
...
@@ -334,6 +334,7 @@ type groupDescription struct {
loadTime
time
.
Time
`json:"-"`
modTime
time
.
Time
`json:"-"`
fileSize
int64
`json:"-"`
Redirect
string
`json:"redirect,omitempty"`
Public
bool
`json:"public,omitempty"`
MaxClients
int
`json:"max-clients,omitempty"`
AllowAnonymous
bool
`json:"allow-anonymous,omitempty"`
...
...
webclient.go
View file @
4bdd7c76
...
...
@@ -709,6 +709,12 @@ func startClient(conn *websocket.Conn) (err error) {
}
return
}
if
g
.
description
.
Redirect
!=
""
{
// We normally redirect at the HTTP level, but the group
// description could have been edited in the meantime.
err
=
userError
(
"group is now at "
+
g
.
description
.
Redirect
)
return
}
c
.
group
=
g
defer
delClient
(
c
)
...
...
webserver.go
View file @
4bdd7c76
...
...
@@ -93,7 +93,7 @@ func groupHandler(w http.ResponseWriter, r *http.Request) {
return
}
_
,
err
:=
addGroup
(
name
,
nil
)
g
,
err
:=
addGroup
(
name
,
nil
)
if
err
!=
nil
{
if
os
.
IsNotExist
(
err
)
{
http
.
NotFound
(
w
,
r
)
...
...
@@ -104,6 +104,13 @@ func groupHandler(w http.ResponseWriter, r *http.Request) {
}
return
}
if
g
.
description
.
Redirect
!=
""
{
http
.
Redirect
(
w
,
r
,
g
.
description
.
Redirect
,
http
.
StatusPermanentRedirect
)
return
}
http
.
ServeFile
(
w
,
r
,
filepath
.
Join
(
staticRoot
,
"sfu.html"
))
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment