Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Freifunk Saar
Salt-States
Commits
f0a1fdb9
Commit
f0a1fdb9
authored
Dec 02, 2020
by
Ralf
Browse files
add a whitelist for nodes to switch (for experimentation)
parent
1780043a
Changes
1
Hide whitespace changes
Inline
Side-by-side
freifunk-mgmt/files/director/main.js
View file @
f0a1fdb9
...
...
@@ -28,6 +28,9 @@ const regions = {
switch_time
:
-
1
,
},
}
const
switch_nodes
=
[
// only these node IDs will be switched
"
525400280bbb
"
,
]
const
http
=
require
(
"
http
"
)
const
fs
=
require
(
"
fs
"
)
...
...
@@ -69,7 +72,7 @@ const server = http.createServer(async (req, res) => {
result
.
node_information
.
region
=
nodeinfo
[
result
.
node_information
.
id
].
meta
.
region
}
}
if
(
result
.
node_information
.
region
)
{
if
(
switch_nodes
.
indexOf
(
result
.
node_information
.
id
)
>=
0
&&
result
.
node_information
.
region
)
{
const
region_info
=
regions
[
result
.
node_information
.
region
]
if
(
region_info
)
{
result
.
node_information
.
domain
.
name
=
region_info
.
domain
...
...
Write
Preview
Supports
Markdown
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