MCPcopy Index your code
hub / github.com/scality/cloudserver / constructor

Method constructor

lib/Config.js:624–660  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

622 */
623class Config extends EventEmitter {
624 constructor() {
625 super();
626 /*
627 * Config files will be looked up under the directories:
628 * <project-root>/conf
629 * <project-root>
630 *
631 * An error will be thrown if the config files cannot be found
632 *
633 * The path to the "config.json" config can be overridden using the
634 * S3_CONFIG_FILE environment var
635 *
636 * The path to the "locationConfig.json" config can be overridden using
637 * the S3_LOCATION_FILE environment var.
638 */
639 this._basePath = path.join(__dirname, '..');
640 this.configPath = findConfigFile(process.env.S3_CONFIG_FILE ||
641 'config.json');
642
643 let locationConfigFileName = 'locationConfig.json';
644 if (process.env.CI === 'true' && !process.env.S3_END_TO_END) {
645 locationConfigFileName =
646 'tests/locationConfig/locationConfigTests.json';
647 }
648 this.locationConfigPath = findConfigFile(process.env.S3_LOCATION_FILE ||
649 locationConfigFileName);
650
651 if (process.env.S3_REPLICATION_FILE !== undefined) {
652 this.replicationConfigPath = process.env.S3_REPLICATION_FILE;
653 }
654
655 // Read config automatically
656 this._getLocationConfig();
657 const config = this._getConfig();
658 this._configureBackends();
659 this._sseMigration(config);
660 }
661
662 _parseKmsAWS(config) {
663 if (!config.kmsAWS) {

Callers

nothing calls this directly

Calls 5

_getLocationConfigMethod · 0.95
_getConfigMethod · 0.95
_configureBackendsMethod · 0.95
_sseMigrationMethod · 0.95
findConfigFileFunction · 0.85

Tested by

no test coverage detected