1
0
Fork 0
This commit is contained in:
Frank Celler 2016-04-14 14:02:07 -07:00
parent 0fa6435731
commit b2b5fbb62d
15 changed files with 56 additions and 46 deletions

View File

@ -73,6 +73,7 @@ RestServerFeature::RestServerFeature(
_authenticationRealm(authenticationRealm),
_defaultApiCompatibility(Version::getNumericServerVersion()),
_allowMethodOverride(false),
_authentication(true),
_handlerFactory(nullptr),
_jobManager(nullptr) {
setOptional(true);
@ -93,7 +94,9 @@ void RestServerFeature::collectOptions(
"default API compatibility version",
new Int32Parameter(&_defaultApiCompatibility));
options->addSection("http", "HttpServer features");
options->addOption("--server.authentication",
"enable or disable authentication for ALL client requests",
new BooleanParameter(&_authentication));
options->addSection("http", "HttpServer features");

View File

@ -54,10 +54,11 @@ class RestServerFeature final
std::string const _authenticationRealm;
int32_t _defaultApiCompatibility;
bool _allowMethodOverride;
bool _authentication;
public:
#warning TODO
bool authentication() const { return false; }
bool authentication() const { return _authentication; }
bool authenticationUnixSockets() const { return false; }
bool authenticationSystemOnly() const { return false; }

View File

@ -95,9 +95,6 @@ void ServerFeature::collectOptions(std::shared_ptr<ProgramOptions> options) {
"server.authenticate-system-only", &_authenticateSystemOnly,
"use HTTP authentication only for requests to /_api and /_admin")
(
"server.disable-authentication", &_disableAuthentication,
"disable authentication for ALL client requests")
#ifdef ARANGODB_HAVE_DOMAIN_SOCKETS
("server.disable-authentication-unix-sockets",

View File

@ -5,4 +5,4 @@ progress = true
[server]
endpoint = tcp://127.0.0.1:8529
disable-authentication = true
authentication = false

View File

@ -33,16 +33,15 @@ directory = /data
#
# bind everything for docker, since we expect to have our own IP:
endpoint = tcp://0.0.0.0:8529
# endpoint = tcp://127.0.0.1:8529
# resuse a port on restart or wait until it is freed by the operating system
# reuse-address = false
# disable authentication for the admin frontend
disable-authentication = yes
authentication = false
# number of server threads
threads = 4
# number of server threads, 0 to use them all
# threads = 4
# the user and group are normally set in the start script
uid = arangodb
@ -50,8 +49,8 @@ gid = arangodb
[scheduler]
# number of threads used for I/O
threads = 2
# number of threads used for I/O, 0 will select a sensible number
# threads = 2
[javascript]
startup-directory = @PKGDATADIR@/js

View File

@ -32,10 +32,10 @@ endpoint = tcp://127.0.0.1:8529
# reuse-address = false
# disable authentication for the admin frontend
disable-authentication = yes
authentication = false
# number of server threads
threads = 4
# number of server threads, 0 to use them all
# threads = 4
# the user and group are normally set in the start script
# uid = arangodb
@ -43,8 +43,8 @@ threads = 4
[scheduler]
# number of threads used for I/O
threads = 2
# number of threads used for I/O, 0 will select a sensible number
# threads = 2
[javascript]
startup-directory = @PKGDATADIR@/js
@ -59,8 +59,6 @@ level = info
file = @LOCALSTATEDIR@/log/arangodb/arangod.log
[cluster]
disable-dispatcher-kickstarter = yes
disable-dispatcher-frontend = yes
data-path = @LOCALSTATEDIR@/lib/arangodb/cluster
log-path = @LOCALSTATEDIR@/log/arangodb/cluster
agent-path = @LIBEXECDIR@/arangodb/etcd-arango@PROGRAM_SUFFIX@

View File

@ -4,4 +4,4 @@ progress = true
[server]
endpoint = tcp://127.0.0.1:8529
disable-authentication = true
authentication = false

View File

@ -2,4 +2,4 @@
[server]
endpoint = tcp://127.0.0.1:8529
disable-authentication = true
authentication = false

View File

@ -4,4 +4,4 @@ progress = true
[server]
endpoint = tcp://127.0.0.1:8529
disable-authentication = true
authentication = false

View File

@ -1,10 +1,9 @@
# config file for arangosh
[console]
pretty-print = true
[server]
endpoint = tcp://127.0.0.1:8529
disable-authentication = true
authentication = false
[javascript]
startup-directory = @PKGDATADIR@/js

View File

@ -1,10 +1,9 @@
# config file for foxx-manager
[console]
pretty-print = true
[server]
endpoint = tcp://127.0.0.1:8529
disable-authentication = true
authentication = false
[javascript]
startup-directory = @PKGDATADIR@/js

View File

@ -23,8 +23,6 @@ level = info
username = root
password =
disable-dispatcher-kickstarter = true
disable-dispatcher-frontend = true
data-path = ./cluster/data
log-path = ./cluster/log
agent-path = ./bin/etcd-arango

View File

@ -274,15 +274,15 @@ function makeArgsArangod(options, appDir) {
return {
"configuration": "none",
"server.keyfile": PEM_FILE,
"database.maximal-journal-size": "1048576",
"database.force-sync-properties": "false",
"database.maximal-journal-size": "1048576",
"javascript.app-path": appDir,
"javascript.startup-directory": JS_DIR,
"server.threads": "20",
"javascript.v8-contexts": "5",
"server.disable-authentication": "true",
"server.allow-use-database": "true"
"server.allow-use-database": "true",
"server.authentication": "false",
"server.threads": "20",
"ssl.keyfile": PEM_FILE
};
}
@ -2731,7 +2731,7 @@ testFuncs.config = function(options) {
const args = {
"configuration": fs.join(CONFIG_DIR, test + ".conf"),
"flatCommands": ["--help"]
"flatCommands": ["--check-configuration"]
};
const run = fs.join(BIN_DIR, test);
@ -2758,7 +2758,7 @@ testFuncs.config = function(options) {
const args = {
"configuration": fs.join(CONFIG_RELATIVE_DIR, test + ".conf"),
"flatCommands": ["--help"]
"flatCommands": ["--check-configuration"]
};
const run = fs.join(BIN_DIR, test);

View File

@ -42,6 +42,7 @@ ConfigFeature::ConfigFeature(application_features::ApplicationServer* server,
: ApplicationFeature(server, "Config"),
_file(""),
_version(false),
_checkConfiguration(false),
_progname(progname) {
setOptional(false);
requiresElevatedPrivileges(false);
@ -56,11 +57,30 @@ void ConfigFeature::collectOptions(std::shared_ptr<ProgramOptions> options) {
options->addOption("--version", "reports the version and exists",
new BooleanParameter(&_version, false));
options->addOption("--check-configuration", "check the configuration and exists",
new BooleanParameter(&_checkConfiguration, false));
}
void ConfigFeature::loadOptions(std::shared_ptr<ProgramOptions> options) {
LOG_TOPIC(TRACE, Logger::STARTUP) << name() << "::loadOptions";
loadConfigFile(options);
if (_checkConfiguration) {
exit(EXIT_SUCCESS);
}
}
void ConfigFeature::validateOptions(std::shared_ptr<ProgramOptions>) {
if (_version) {
std::cout << Version::getServerVersion() << "\n\n"
<< Version::getDetailed() << std::endl;
exit(EXIT_SUCCESS);
}
}
void ConfigFeature::loadConfigFile(std::shared_ptr<ProgramOptions> options) {
if (StringUtils::tolower(_file) == "none") {
LOG_TOPIC(DEBUG, Logger::CONFIG) << "use 'none' config file at all";
return;
@ -140,11 +160,3 @@ void ConfigFeature::loadOptions(std::shared_ptr<ProgramOptions> options) {
exit(EXIT_FAILURE);
}
}
void ConfigFeature::validateOptions(std::shared_ptr<ProgramOptions>) {
if (_version) {
std::cout << Version::getServerVersion() << "\n\n"
<< Version::getDetailed() << std::endl;
exit(EXIT_SUCCESS);
}
}

View File

@ -36,10 +36,14 @@ class ConfigFeature final : public application_features::ApplicationFeature {
void loadOptions(std::shared_ptr<options::ProgramOptions>) override final;
void validateOptions(std::shared_ptr<options::ProgramOptions>) override final;
public:
private:
std::string _file;
bool _version;
bool _checkConfiguration;
private:
void loadConfigFile(std::shared_ptr<options::ProgramOptions>);
private:
std::string _progname;
};