diff --git a/.gitignore b/.gitignore index 6026d1d63..f9cbd72b5 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,5 @@ dist/ example/ldap/private.ldif package-lock.json + +Configuration.schema.json diff --git a/scripts/travis.sh b/scripts/travis.sh index 97e2c5454..332b24501 100755 --- a/scripts/travis.sh +++ b/scripts/travis.sh @@ -5,6 +5,8 @@ set -e docker --version docker-compose --version +grunt run:generate-config-schema + # Run unit tests grunt test-unit diff --git a/server/src/lib/configuration/Configuration.schema.json b/server/src/lib/configuration/Configuration.schema.json deleted file mode 100644 index 9fd4e9238..000000000 --- a/server/src/lib/configuration/Configuration.schema.json +++ /dev/null @@ -1,368 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "definitions": { - "ACLConfiguration": { - "properties": { - "any": { - "items": { - "properties": { - "domain": { - "type": "string" - }, - "policy": { - "$ref": "#/definitions/ACLPolicy" - }, - "resources": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "domain", - "policy" - ], - "type": "object" - }, - "type": "array" - }, - "default_policy": { - "$ref": "#/definitions/ACLPolicy" - }, - "groups": { - "additionalProperties": { - "items": { - "properties": { - "domain": { - "type": "string" - }, - "policy": { - "$ref": "#/definitions/ACLPolicy" - }, - "resources": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "domain", - "policy" - ], - "type": "object" - }, - "type": "array" - }, - "type": "object" - }, - "users": { - "additionalProperties": { - "items": { - "properties": { - "domain": { - "type": "string" - }, - "policy": { - "$ref": "#/definitions/ACLPolicy" - }, - "resources": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "domain", - "policy" - ], - "type": "object" - }, - "type": "array" - }, - "type": "object" - } - }, - "type": "object" - }, - "ACLPolicy": { - "enum": [ - "allow", - "deny" - ], - "type": "string" - }, - "AuthenticationMethod": { - "enum": [ - "basic_auth", - "two_factor" - ], - "type": "string" - }, - "AuthenticationMethodsConfiguration": { - "properties": { - "default_method": { - "$ref": "#/definitions/AuthenticationMethod" - }, - "per_subdomain_methods": { - "additionalProperties": { - "enum": [ - "basic_auth", - "two_factor" - ], - "type": "string" - }, - "type": "object" - } - }, - "required": [ - "default_method", - "per_subdomain_methods" - ], - "type": "object" - }, - "FileSystemNotifierConfiguration": { - "properties": { - "filename": { - "type": "string" - } - }, - "required": [ - "filename" - ], - "type": "object" - }, - "GmailNotifierConfiguration": { - "properties": { - "password": { - "type": "string" - }, - "sender": { - "type": "string" - }, - "username": { - "type": "string" - } - }, - "required": [ - "password", - "sender", - "username" - ], - "type": "object" - }, - "LocalStorageConfiguration": { - "properties": { - "in_memory": { - "type": "boolean" - }, - "path": { - "type": "string" - } - }, - "type": "object" - }, - "MongoStorageConfiguration": { - "properties": { - "url": { - "type": "string" - } - }, - "required": [ - "url" - ], - "type": "object" - }, - "NotifierConfiguration": { - "properties": { - "filesystem": { - "$ref": "#/definitions/FileSystemNotifierConfiguration" - }, - "gmail": { - "$ref": "#/definitions/GmailNotifierConfiguration" - }, - "smtp": { - "$ref": "#/definitions/SmtpNotifierConfiguration" - } - }, - "type": "object" - }, - "RegulationConfiguration": { - "properties": { - "ban_time": { - "type": "number" - }, - "find_time": { - "type": "number" - }, - "max_retries": { - "type": "number" - } - }, - "required": [ - "ban_time", - "find_time", - "max_retries" - ], - "type": "object" - }, - "SessionCookieConfiguration": { - "properties": { - "domain": { - "type": "string" - }, - "expiration": { - "type": "number" - }, - "redis": { - "$ref": "#/definitions/SessionRedisOptions" - }, - "secret": { - "type": "string" - } - }, - "required": [ - "secret" - ], - "type": "object" - }, - "SessionRedisOptions": { - "properties": { - "host": { - "type": "string" - }, - "port": { - "type": "number" - } - }, - "required": [ - "host", - "port" - ], - "type": "object" - }, - "SmtpNotifierConfiguration": { - "properties": { - "host": { - "type": "string" - }, - "password": { - "type": "string" - }, - "port": { - "type": "number" - }, - "secure": { - "type": "boolean" - }, - "sender": { - "type": "string" - }, - "username": { - "type": "string" - } - }, - "required": [ - "host", - "password", - "port", - "secure", - "sender", - "username" - ], - "type": "object" - }, - "StorageConfiguration": { - "properties": { - "local": { - "$ref": "#/definitions/LocalStorageConfiguration" - }, - "mongo": { - "$ref": "#/definitions/MongoStorageConfiguration" - } - }, - "type": "object" - }, - "UserLdapConfiguration": { - "properties": { - "additional_groups_dn": { - "type": "string" - }, - "additional_users_dn": { - "type": "string" - }, - "base_dn": { - "type": "string" - }, - "group_name_attribute": { - "type": "string" - }, - "groups_filter": { - "type": "string" - }, - "mail_attribute": { - "type": "string" - }, - "password": { - "type": "string" - }, - "url": { - "type": "string" - }, - "user": { - "type": "string" - }, - "users_filter": { - "type": "string" - } - }, - "required": [ - "base_dn", - "password", - "url", - "user" - ], - "type": "object" - } - }, - "properties": { - "access_control": { - "$ref": "#/definitions/ACLConfiguration" - }, - "authentication_methods": { - "$ref": "#/definitions/AuthenticationMethodsConfiguration" - }, - "ldap": { - "$ref": "#/definitions/UserLdapConfiguration" - }, - "logs_level": { - "type": "string" - }, - "notifier": { - "$ref": "#/definitions/NotifierConfiguration" - }, - "port": { - "type": "number" - }, - "regulation": { - "$ref": "#/definitions/RegulationConfiguration" - }, - "session": { - "$ref": "#/definitions/SessionCookieConfiguration" - }, - "storage": { - "$ref": "#/definitions/StorageConfiguration" - } - }, - "required": [ - "ldap", - "notifier", - "regulation", - "session", - "storage" - ], - "type": "object" -} -