Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
hauptbahnhof
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
stustanet
hauptbahnhof
Commits
77bae388
Commit
77bae388
authored
4 years ago
by
Michael Loipführer
Browse files
Options
Downloads
Patches
Plain Diff
fix privileged api
parent
8957328a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
clicki_bunti/src/App.js
+2
-2
2 additions, 2 deletions
clicki_bunti/src/App.js
hauptbahnhof/core/ws.py
+2
-2
2 additions, 2 deletions
hauptbahnhof/core/ws.py
with
4 additions
and
4 deletions
clicki_bunti/src/App.js
+
2
−
2
View file @
77bae388
...
...
@@ -5,7 +5,7 @@ import Login from "./components/Login";
import
Haspa
from
"
./components/Haspa
"
;
import
Loading
from
"
./components/Loading
"
;
const
privilegedIP
=
"
::1
"
;
const
privilegedIP
s
=
[
"
localhost
"
,
"
10.150.9.13
"
,
"
::1
"
]
;
class
App
extends
React
.
Component
{
state
=
{
...
...
@@ -58,7 +58,7 @@ class App extends React.Component {
setTimeout
(
this
.
refreshToken
,
message
[
"
expires_at
"
]
*
1000
-
new
Date
().
getTime
()
-
10000
);
}
else
if
(
message
[
"
type
"
]
===
"
client_info
"
)
{
const
clientIP
=
message
[
"
client_ip
"
];
if
(
clientIP
===
privilegedIP
&&
!
this
.
state
.
isPrivileged
)
{
if
(
privilegedIPs
.
includes
(
clientIP
)
&&
!
this
.
state
.
isPrivileged
)
{
this
.
setState
({
isPrivileged
:
true
,
wsURL
:
message
[
"
privileged_address
"
]});
this
.
ws
=
new
WebSocket
(
message
[
"
privileged_address
"
]);
this
.
initWS
();
...
...
This diff is collapsed.
Click to expand it.
hauptbahnhof/core/ws.py
+
2
−
2
View file @
77bae388
...
...
@@ -72,8 +72,8 @@ class WebSocket:
client_info
=
{
"
type
"
:
"
client_info
"
,
"
client_ip
"
:
client_ip
,
"
privileged_address
"
:
f
'
ws
s
://
{
self
.
config
.
get
(
"
internal_host
"
)
}
:
{
self
.
config
.
get
(
"
internal_port
"
)
}
'
,
"
unprivileged_address
"
:
f
'
ws://
{
self
.
config
.
get
(
"
external_host
"
)
}
:
{
self
.
config
.
get
(
"
external_port
"
)
}
'
"
privileged_address
"
:
f
'
ws://
{
self
.
config
.
get
(
"
internal_host
"
)
}
:
{
self
.
config
.
get
(
"
internal_port
"
)
}
'
,
"
unprivileged_address
"
:
f
'
ws
s
://
{
self
.
config
.
get
(
"
external_host
"
)
}
:
{
self
.
config
.
get
(
"
external_port
"
)
}
'
}
await
websocket
.
send
(
json
.
dumps
(
client_info
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment