diff --git a/.env.default b/.env.default index 7e7a6ccf7..7487743a2 100644 --- a/.env.default +++ b/.env.default @@ -8,7 +8,7 @@ SILEX_PORT=6805 # 6805 is the date of sexual revolution started in paris france SILEX_HOST=localhost SILEX_PROTOCOL=http SILEX_DEBUG=FALSE -SILEX_CONFIG= +SILEX_SERVER_CONFIG= SILEX_SSL_PORT= SILEX_FORCE_HTTPS= SILEX_SSL_PRIVATE_KEY= diff --git a/Dockerfile b/Dockerfile index 0047e0da2..320ff61cc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ ENV SILEX_PORT=6805 ENV SILEX_HOST=localhost ENV SILEX_PROTOCOL=http ENV SILEX_DEBUG=FALSE -ENV SILEX_CONFIG= +ENV SILEX_SERVER_CONFIG= ENV SILEX_SSL_PORT= ENV SILEX_FORCE_HTTPS= ENV SILEX_SSL_PRIVATE_KEY= diff --git a/README.md b/README.md index 7eb56144e..14fd20ec6 100755 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ You can configure Silex using environment variables and command-line options. Al There are config files (same as plugins) in the `examples/` folder. To start Silex locally with these config: ```sh -$ SILEX_CLIENT_CONFIG=./examples/client-config-transformers.js SILEX_CONFIG=`pwd`/examples/server-config-plugins.js npm run start:debug +$ SILEX_CLIENT_CONFIG=./examples/client-config-transformers.js SILEX_SERVER_CONFIG=`pwd`/examples/server-config-plugins.js npm run start:debug ``` ## Contributing diff --git a/src/ts/server/cli.ts b/src/ts/server/cli.ts index 5faabe767..7d68084f8 100644 --- a/src/ts/server/cli.ts +++ b/src/ts/server/cli.ts @@ -25,12 +25,12 @@ const options = parse({ 'host': ['', 'Sets the host param of the express module "cookie-session".', 'string'], 'port': [ 'p', 'Port to listen to', 'int'], 'protocol': ['', 'Sets the protocol param of the express module "cookie-session".', 'string'], - 'config': [ 'c', 'Path for the server side config file to load at startup', 'file'], - 'client-config': ['', 'Path to client config file to be served on .silex-client.js', 'string'], + 'server-config': [ 's', 'Path for the server side config file to load at startup', 'file'], + 'client-config': ['c', 'Path to client config file to be served on .silex-client.js', 'file'], 'fs-root': ['', 'Path to the root folder where to store websites. Used by the default storage connector (fs).', 'string'], 'fs-hosting-root': ['', 'Path to the root folder where to publish websites. Used by the default hosting connector (fs).', 'string'], 'session-name': ['', 'Sets the name param of the express module "cookie-session".', 'string'], - 'session-secret': ['s', 'Session secret', 'string'], + 'session-secret': ['', 'Session secret', 'string'], 'ssl-port': [ false, 'Port to listen to for SSL/HTTPS', 'int'], 'force-https': [ false, 'Force HTTPS', 'boolean'], 'ssl-private-key': [ false, 'Path to private key for SSL', 'file'], @@ -47,7 +47,7 @@ if(options['url']) process.env.SILEX_URL = options['url'] if(options['host']) process.env.SILEX_HOST = options['host'] if(options.port) process.env.SILEX_PORT = options.port if(options['protocol']) process.env.SILEX_PROTOCOL = options['protocol'] -if(options.config) process.env.SILEX_CONFIG = options.config +if(options['server-config']) process.env.SILEX_SERVER_CONFIG = options['server-config'] if(options['client-config']) process.env.SILEX_CLIENT_CONFIG = options['client-config'] if(options['fs-root']) process.env.SILEX_FS_ROOT = options['fs-root'] if(options['fs-hosting-root']) process.env.SILEX_FS_HOSTING_ROOT = options['fs-hosting-root'] diff --git a/src/ts/server/config.ts b/src/ts/server/config.ts index 7ef3a9d21..9bf5346c3 100644 --- a/src/ts/server/config.ts +++ b/src/ts/server/config.ts @@ -51,7 +51,7 @@ export class ServerConfig extends Config { public port = process.env.SILEX_PORT public debug = process.env.SILEX_DEBUG === 'true' public url = process.env.SILEX_URL?.replace(/\/$/, '') ?? `${process.env.SILEX_PROTOCOL}://${process.env.SILEX_HOST}:${process.env.SILEX_PORT}` - public userConfigPath: Plugin | undefined = process.env.SILEX_CONFIG + public userConfigPath: Plugin | undefined = process.env.SILEX_SERVER_CONFIG public configFilePath: Plugin = resolve(__dirname, '../../../.silex.js') // All connectors or just the storage or hosting connectors