diff --git a/arangod/RestServer/RestServerFeature.cpp b/arangod/RestServer/RestServerFeature.cpp index 8d9a456349..135fd2b8fc 100644 --- a/arangod/RestServer/RestServerFeature.cpp +++ b/arangod/RestServer/RestServerFeature.cpp @@ -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"); diff --git a/arangod/RestServer/RestServerFeature.h b/arangod/RestServer/RestServerFeature.h index 95d09593f0..6f6ed0ddfb 100644 --- a/arangod/RestServer/RestServerFeature.h +++ b/arangod/RestServer/RestServerFeature.h @@ -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; } diff --git a/arangod/RestServer/ServerFeature.cpp b/arangod/RestServer/ServerFeature.cpp index 17cb30e232..46ebd0d2ec 100644 --- a/arangod/RestServer/ServerFeature.cpp +++ b/arangod/RestServer/ServerFeature.cpp @@ -95,9 +95,6 @@ void ServerFeature::collectOptions(std::shared_ptr 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", diff --git a/etc/arangodb/arangob.conf.in b/etc/arangodb/arangob.conf.in index 96b8de2249..90fc51dbb3 100644 --- a/etc/arangodb/arangob.conf.in +++ b/etc/arangodb/arangob.conf.in @@ -5,4 +5,4 @@ progress = true [server] endpoint = tcp://127.0.0.1:8529 -disable-authentication = true +authentication = false diff --git a/etc/arangodb/arangod-docker.conf.in b/etc/arangodb/arangod-docker.conf.in index 03e1c6ec64..2a6fa2a32d 100644 --- a/etc/arangodb/arangod-docker.conf.in +++ b/etc/arangodb/arangod-docker.conf.in @@ -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 diff --git a/etc/arangodb/arangod.conf.in b/etc/arangodb/arangod.conf.in index 4df41a78aa..3b83a32dff 100644 --- a/etc/arangodb/arangod.conf.in +++ b/etc/arangodb/arangod.conf.in @@ -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@ diff --git a/etc/arangodb/arangodump.conf.in b/etc/arangodb/arangodump.conf.in index 7729627f5b..0161ce9801 100644 --- a/etc/arangodb/arangodump.conf.in +++ b/etc/arangodb/arangodump.conf.in @@ -4,4 +4,4 @@ progress = true [server] endpoint = tcp://127.0.0.1:8529 -disable-authentication = true +authentication = false diff --git a/etc/arangodb/arangoimp.conf.in b/etc/arangodb/arangoimp.conf.in index ad9d370b56..441cd4ceec 100644 --- a/etc/arangodb/arangoimp.conf.in +++ b/etc/arangodb/arangoimp.conf.in @@ -2,4 +2,4 @@ [server] endpoint = tcp://127.0.0.1:8529 -disable-authentication = true +authentication = false diff --git a/etc/arangodb/arangorestore.conf.in b/etc/arangodb/arangorestore.conf.in index 0578caae01..312b4abffa 100644 --- a/etc/arangodb/arangorestore.conf.in +++ b/etc/arangodb/arangorestore.conf.in @@ -4,4 +4,4 @@ progress = true [server] endpoint = tcp://127.0.0.1:8529 -disable-authentication = true +authentication = false diff --git a/etc/arangodb/arangosh.conf.in b/etc/arangodb/arangosh.conf.in index aeb1e8f4f5..1fea59e866 100644 --- a/etc/arangodb/arangosh.conf.in +++ b/etc/arangodb/arangosh.conf.in @@ -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 diff --git a/etc/arangodb/foxx-manager.conf.in b/etc/arangodb/foxx-manager.conf.in index 365b14c049..a6a7c31a49 100644 --- a/etc/arangodb/foxx-manager.conf.in +++ b/etc/arangodb/foxx-manager.conf.in @@ -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 diff --git a/etc/relative/arangod.conf b/etc/relative/arangod.conf index 0431596ac4..b31292c8a9 100644 --- a/etc/relative/arangod.conf +++ b/etc/relative/arangod.conf @@ -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 diff --git a/js/client/modules/@arangodb/testing.js b/js/client/modules/@arangodb/testing.js index 7d82bc4575..a906b0c695 100644 --- a/js/client/modules/@arangodb/testing.js +++ b/js/client/modules/@arangodb/testing.js @@ -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); diff --git a/lib/ApplicationFeatures/ConfigFeature.cpp b/lib/ApplicationFeatures/ConfigFeature.cpp index 9a6cf9ba2c..e8ab2ede77 100644 --- a/lib/ApplicationFeatures/ConfigFeature.cpp +++ b/lib/ApplicationFeatures/ConfigFeature.cpp @@ -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 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 options) { LOG_TOPIC(TRACE, Logger::STARTUP) << name() << "::loadOptions"; + loadConfigFile(options); + + if (_checkConfiguration) { + exit(EXIT_SUCCESS); + } +} + +void ConfigFeature::validateOptions(std::shared_ptr) { + if (_version) { + std::cout << Version::getServerVersion() << "\n\n" + << Version::getDetailed() << std::endl; + exit(EXIT_SUCCESS); + } +} + +void ConfigFeature::loadConfigFile(std::shared_ptr 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 options) { exit(EXIT_FAILURE); } } - -void ConfigFeature::validateOptions(std::shared_ptr) { - if (_version) { - std::cout << Version::getServerVersion() << "\n\n" - << Version::getDetailed() << std::endl; - exit(EXIT_SUCCESS); - } -} diff --git a/lib/ApplicationFeatures/ConfigFeature.h b/lib/ApplicationFeatures/ConfigFeature.h index 560ba93b39..e18806820d 100644 --- a/lib/ApplicationFeatures/ConfigFeature.h +++ b/lib/ApplicationFeatures/ConfigFeature.h @@ -36,10 +36,14 @@ class ConfigFeature final : public application_features::ApplicationFeature { void loadOptions(std::shared_ptr) override final; void validateOptions(std::shared_ptr) override final; - public: + private: std::string _file; bool _version; + bool _checkConfiguration; + private: + void loadConfigFile(std::shared_ptr); + private: std::string _progname; };