-
Notifications
You must be signed in to change notification settings - Fork 7
Added possibilty to register publisher; Automatic creation of DNS-Server implemented; Domain-managemend partially implemented #144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 9 commits
ef18f74
2636aaa
9a3336b
61c7087
889a4bd
0554a28
a543ef6
d46738f
431e33a
8086316
258012a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,7 @@ c.fs.compendium = path.join(c.fs.base, 'compendium'); | |
c.fs.deleted = path.join(c.fs.base, 'deleted'); | ||
c.fs.job = path.join(c.fs.base, 'job'); | ||
c.fs.cache = path.join(c.fs.base, 'cache'); | ||
c.fs.dns = path.join(c.fs.base, 'dns'); | ||
c.fs.delete_inc = true; | ||
c.fs.fail_on_no_files = yn(env.MUNCHER_FAIL_ON_NO_FILES || 'false'); | ||
|
||
|
@@ -88,6 +89,9 @@ c.user.level.view_candidates = 500; | |
c.user.level.view_status = 1000; | ||
c.user.level.delete_compendium = 1000; | ||
c.user.level.manage_links = 500; | ||
c.user.level.manage_publisher = 1000; | ||
c.user.level.validate_journal = 1000; | ||
c.user.level.manage_journal = 500; | ||
|
||
// bagtainer configuration | ||
c.bagtainer = {}; | ||
|
@@ -148,7 +152,6 @@ c.bagtainer.docker.create_options = { | |
Env: ['O2R_MUNCHER=true'], | ||
Memory: 4294967296, // 4G | ||
MemorySwap: 8589934592, // double of 4G | ||
NetworkDisabled: true, | ||
User: env.MUNCHER_CONTAINER_USER || '1000' // user name depends on image, use id to be save | ||
}; | ||
c.bagtainer.rm = yn(env.EXECUTE_CONTAINER_RM || 'true'); | ||
|
@@ -167,7 +170,7 @@ c.email.sender = env.MUNCHER_EMAIL_SENDER; | |
// template for sending emails | ||
//if (emailTransporter) { | ||
// let mail = { | ||
// from: config.email.sender, // sender address | ||
// from: config.email.sender, // sender address | ||
// to: config.email.receivers, | ||
// subject: '[o2r platform] something happened', | ||
// text: '...' | ||
|
@@ -293,6 +296,24 @@ c.substitution.docker.volume.mode = ":ro"; | |
c.substitution.docker.cmd = 'docker run -it --rm'; | ||
c.substitution.docker.imageNamePrefix = 'erc:'; | ||
|
||
c.dns = {}; | ||
c.dns.dnsmasq = {}; | ||
c.dns.priority = {}; | ||
c.dns.dockerfile = "" + | ||
"FROM alpine:edge\n" + | ||
"RUN apk --no-cache add dnsmasq\n" + | ||
"EXPOSE 53/tcp 53/udp\n" + | ||
"COPY dnsmasq.conf /etc/dnsmasq.conf\n" + | ||
"CMD [\"dnsmasq\", \"--no-daemon\"]"; | ||
c.dns.dnsmasq.default = "" + | ||
"log-queries\n" + | ||
"no-hosts\n" + | ||
"no-resolv\n" + | ||
"cache-size=100000\n"; | ||
c.dns.dnsmasq.filterDummy = "server=/"; | ||
c.dns.priority.publisher = 100; | ||
c.dns.priority.journal = 50; | ||
Comment on lines
+311
to
+314
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gibt es hier irgendwas das ein Plattformbetreiber Konfigurieren wollen würde, oder ist das ziemlich stabil? Wenn Konfiguration, dann gerne das Muster mit den Umgebungsvariablen nutzen wie an anderen Stellen in dieser Datei. |
||
|
||
c.checker = {}; | ||
c.checker.diffFileName = 'check.html'; | ||
|
||
|
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* (C) Copyright 2017 o2r project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
let Dns = require('../lib/model/dns'); | ||
let dnsManager = require('../lib/dns-manager'); | ||
const debug = require('debug')('muncher:dns'); | ||
|
||
exports.startServersOnStartup = function () { | ||
return new Promise((fulfill, reject) => { | ||
debug("Starting DNS servers on startup"); | ||
let promiseArray = []; | ||
Dns.find((err, docs) => { | ||
if (err) { | ||
debug("Error searching for DNS Server configurations: %O", err); | ||
reject(err); | ||
} else if (docs.length < 1) { | ||
debug("No DNS Server configurations in database"); | ||
reject("No DNS configurations in database"); | ||
} else { | ||
for (let dns of docs) { | ||
promiseArray.push(new Promise((fulfill2, reject2) => { | ||
debug("Starting DNS Server: %s", dns.id); | ||
dnsManager | ||
.stopAndRemoveDnsServer(dns.id) | ||
.then(() => { | ||
buildNewDnsServer(dns.id) | ||
.then(dnsManager.startNewDnsServer) | ||
.then(() => { | ||
debug("Successfully started DNS Server: %s", dns.id); | ||
fulfill2(); | ||
}) | ||
.catch((err) => { | ||
debug("Error starting DNS Server: %O", err); | ||
reject2(err); | ||
}); | ||
}); | ||
})); | ||
} | ||
} | ||
Promise.all(promiseArray) | ||
.then(() => { | ||
debug("Successfully started all DNS Servers"); | ||
fulfill(); | ||
}) | ||
.catch((error) => { | ||
debug("Error starting DNS Servers: %O", error); | ||
reject(error); | ||
}); | ||
}); | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to admit this does make me a little bit nervous :-)