Skip to content

Commit c6385f1

Browse files
authored
Merge pull request #65 from HarperFast/chore/harperdb-is-dead-long-live-harper
HarperDB is dead. Long live Harper!
2 parents ca5579b + c62f31a commit c6385f1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+173
-174
lines changed

bin/cliOperations.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ async function cliOperations(req) {
142142
// is running and that we can communicate with it.
143143
initConfig();
144144
if (!getHdbPid()) {
145-
console.error('HarperDB must be running to perform this operation');
145+
console.error('Harper must be running to perform this operation');
146146
process.exit();
147147
}
148148

bin/harper.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ process.setSourceMapsEnabled(true); // this is necessary for source maps to work
1414
const HELP = `
1515
Usage: harperdb [command]
1616
17-
With no command, harperdb will simply run HarperDB (in the foreground)
17+
With no command, harper will simply run Harper (in the foreground)
1818
1919
By default, the CLI also supports certain Operation APIs. Specify the operation name and any required parameters, and omit the 'operation' command.
2020
@@ -28,7 +28,7 @@ renew-certs - Generate a new set of self-signed certificates
2828
restart - Restart the harperdb background process
2929
run <path> - Run the application in the specified path
3030
start - Starts a separate background process for harperdb and CLI will exit
31-
status - Print the status of HarperDB
31+
status - Print the status of Harper
3232
stop - Stop the harperdb background process
3333
help - Display this output
3434
upgrade - Upgrade harperdb
@@ -80,7 +80,7 @@ async function harper() {
8080
// The require is here to better control the flow of imports when this module is called.
8181
return require('./upgrade.js')
8282
.upgrade(null)
83-
.then(() => 'Your instance of HarperDB is up to date!');
83+
.then(() => 'Your instance of Harper is up to date!');
8484
case SERVICE_ACTIONS_ENUM.STATUS:
8585
return require('./status.js')();
8686
case SERVICE_ACTIONS_ENUM.RENEWCERTS:

bin/restart.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const path = require('node:path');
1515
const { unlinkSync } = require('node:fs');
1616
envMgr.initSync();
1717

18-
const RESTART_RESPONSE = `Restarting HarperDB. This may take up to ${hdbTerms.RESTART_TIMEOUT_MS / 1000} seconds.`;
18+
const RESTART_RESPONSE = `Restarting Harper. This may take up to ${hdbTerms.RESTART_TIMEOUT_MS / 1000} seconds.`;
1919
const INVALID_SERVICE_ERR = 'Invalid service';
2020

2121
let calledFromCli;
@@ -35,9 +35,8 @@ if (isMainThread) {
3535
}
3636

3737
/**
38-
* Restart HarperDB.
39-
* In PM2 mode HarperDB, Leaf and Hub servers are managed by PM2. Function will use PM2 to restart these three processes.
40-
* In good old regular mode (PM2 is nowhere to be seen) it will restart all the child threads and the hub and leaf server processes.
38+
* Restart Harper.
39+
* It will restart all the child threads and the hub and leaf server processes.
4140
* @param req
4241
* @returns {Promise<string>}
4342
*/

bin/run.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ let pmUtils;
3232
let cmdArgs;
3333
let skipExitListeners = false;
3434

35-
const UPGRADE_COMPLETE_MSG = 'Upgrade complete. Starting HarperDB.';
36-
const UPGRADE_ERR = 'Got an error while trying to upgrade your HarperDB instance. Exiting HarperDB.';
37-
const HDB_NOT_FOUND_MSG = 'HarperDB not found, starting install process.';
38-
const INSTALL_ERR = 'There was an error during install, check install_log.log for more details. Exiting.';
39-
const HDB_STARTED = 'HarperDB successfully started.';
35+
const UPGRADE_COMPLETE_MSG = 'Upgrade complete. Starting Harper.';
36+
const UPGRADE_ERR = 'Got an error while trying to upgrade your Harper instance. Exiting Harper.';
37+
const HDB_NOT_FOUND_MSG = 'Harper not found, starting install process.';
38+
const INSTALL_ERR = 'There was an error during install, check install_log.log for more details. Exiting.';
39+
const HDB_STARTED = 'Harper successfully started.';
4040

4141
function addUnhandleRejectionListener() {
4242
process.on('unhandledRejection', (reason, promise) => {
@@ -73,7 +73,7 @@ function addExitListeners() {
7373
*/
7474
async function initialize(calledByInstall = false, calledByMain = false) {
7575
// Check to see if HDB is installed, if it isn't we call install.
76-
console.log(chalk.magenta('Starting HarperDB...'));
76+
console.log(chalk.magenta('Starting Harper...'));
7777

7878
addUnhandleRejectionListener();
7979

@@ -108,24 +108,24 @@ async function initialize(calledByInstall = false, calledByMain = false) {
108108
}
109109
}
110110

111-
// Check to see if HarperDB is already running by checking for a pid file
111+
// Check to see if Harper is already running by checking for a pid file
112112
// If found confirm it matches a currently running processes
113113
let hdbPid = getHdbPid();
114114
if (hdbPid) {
115-
hdbLogger.debug('Error: HarperDB is already running');
116-
console.error(`Error: HarperDB is already running (pid: ${hdbPid})`);
115+
hdbLogger.debug('Error: Harper is already running');
116+
console.error(`Error: Harper is already running (pid: ${hdbPid})`);
117117
process.exit(4);
118118
}
119119

120120
addExitListeners();
121121

122122
if (calledByMain) {
123-
// Write HarperDB PID to file for tracking purposes
123+
// Write Harper PID to file for tracking purposes
124124
await fs.writeFile(path.join(env.get(hdbTerms.CONFIG_PARAMS.ROOTPATH), hdbTerms.HDB_PID_FILE), `${process.pid}`);
125125
}
126-
hdbLogger.info('HarperDB PID', process.pid);
126+
hdbLogger.info('Harper PID', process.pid);
127127

128-
// Check to see if an upgrade is needed based on existing hdbInfo data. If so, we need to force the user to upgrade
128+
// Check to see if an upgrade is needed based on existing hdbInfo data. If so, we need to force the user to upgrade
129129
// before the server can be started.
130130
let upgradeVers;
131131
try {
@@ -138,7 +138,7 @@ async function initialize(calledByInstall = false, calledByMain = false) {
138138
} catch (err) {
139139
if (upgradeVers) {
140140
console.error(
141-
`Got an error while trying to upgrade your HarperDB instance to version ${upgradeVers}. Exiting HarperDB.`,
141+
`Got an error while trying to upgrade your Harper instance to version ${upgradeVers}. Exiting Harper.`,
142142
err
143143
);
144144
hdbLogger.error(err);
@@ -188,12 +188,12 @@ async function main(calledByInstall = false) {
188188
function started() {
189189
// Console log Harper dog logo
190190
hdbLogger.suppressLogging(() => {
191-
console.log(chalk.magenta(`HarperDB ${packageJson.version} successfully started`));
191+
console.log(chalk.magenta(`Harper ${packageJson.version} successfully started`));
192192
});
193193
hdbLogger.notify(HDB_STARTED);
194194
}
195195
/**
196-
* Launches a separate process for HarperDB and then exits. This is an unusual practice and is anathema
196+
* Launches a separate process for Harper and then exits. This is an unusual practice and is anathema
197197
* to the way processes are typically handled, both in terminal and for services (systemd), but this functionality
198198
* is retained for legacy purposes.
199199
* @returns {Promise<void>} // ha ha, it doesn't!
@@ -297,7 +297,7 @@ function startupLog(portResolutions) {
297297
env.get(CONFIG_PARAMS.REPLICATION_SECUREPORT) ?? env.get(CONFIG_PARAMS.OPERATIONSAPI_NETWORK_SECUREPORT);
298298

299299
repLog += replicationPort ? `WS: ${replicationPort}, ` : '';
300-
repLog += replicationSecurePort ? `WSS: ${replicationSecurePort} ` : '';
300+
repLog += replicationSecurePort ? `WSS: ${replicationSecurePort} ` : '';
301301
logMsg += `${repLog.slice(0, -2)}\n`;
302302
}
303303

bin/stop.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const childProcess = require('child_process');
66
const exec = util.promisify(childProcess.exec);
77
const sysInfo = require('../utility/environment/systemInformation.js');
88

9-
const STOP_MSG = 'Stopping HarperDB.';
9+
const STOP_MSG = 'Stopping Harper.';
1010

1111
module.exports = stop;
1212

bin/upgrade.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = {
2929
};
3030

3131
/**
32-
* Runs the upgrade directives, if needed, for an updated version of HarperDB.
32+
* Runs the upgrade directives, if needed, for an updated version of Harper.
3333
*
3434
* @param upgradeObj - optional
3535
* @returns {Promise<void>}
@@ -53,12 +53,12 @@ async function upgrade(upgradeObj) {
5353
if (!hdbUpgradeInfo) {
5454
hdbUpgradeInfo = await hdbInfoController.getVersionUpdateInfo();
5555
if (!hdbUpgradeInfo) {
56-
console.log('HarperDB version is current');
56+
console.log('Harper version is current');
5757
process.exit(0);
5858
}
5959
}
6060

61-
printToLogAndConsole(`This version of HarperDB is ${packageJson.version}`, hdbTerms.LOG_LEVELS.INFO);
61+
printToLogAndConsole(`This version of Harper is ${packageJson.version}`, hdbTerms.LOG_LEVELS.INFO);
6262

6363
//The upgrade version should always be included in the hdbUpgradeInfo object returned from the getVersion function
6464
// above but testing for it and using the version from package.json just in case it is not
@@ -84,7 +84,7 @@ async function upgrade(upgradeObj) {
8484
}
8585

8686
if (!startUpgrade) {
87-
console.log('Cancelled upgrade, closing HarperDB');
87+
console.log('Cancelled upgrade, closing Harper');
8888
process.exit(exitCode);
8989
}
9090

@@ -93,7 +93,7 @@ async function upgrade(upgradeObj) {
9393
await runUpgrade(hdbUpgradeInfo);
9494

9595
printToLogAndConsole(
96-
`HarperDB was successfully upgraded to version ${hdbUpgradeInfo[UPGRADE_VERSION]}`,
96+
`Harper was successfully upgraded to version ${hdbUpgradeInfo[UPGRADE_VERSION]}`,
9797
hdbTerms.LOG_LEVELS.INFO
9898
);
9999
}

components/componentLoader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ let watchesSetup;
4545
let resources;
4646

4747
/**
48-
* Load all the applications registered in HarperDB, those in the components directory as well as any directly
48+
* Load all the applications registered in Harper, those in the components directory as well as any directly
4949
* specified to run
5050
* @param loadedPluginModules
5151
* @param loadedResources

components/operations.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ async function deployComponent(req) {
419419
let response = await server.replication.replicateOperation(req);
420420
if (req.restart === true) {
421421
manageThreads.restartWorkers('http');
422-
response.message = `Successfully deployed: ${application.name}, restarting HarperDB`;
422+
response.message = `Successfully deployed: ${application.name}, restarting Harper`;
423423
} else if (rollingRestart) {
424424
const serverUtilities = require('../server/serverHelpers/serverUtilities.ts');
425425
const jobResponse = await serverUtilities.executeJob({
@@ -429,7 +429,7 @@ async function deployComponent(req) {
429429
});
430430

431431
response.restartJobId = jobResponse.job_id;
432-
response.message = `Successfully deployed: ${application.name}, restarting HarperDB`;
432+
response.message = `Successfully deployed: ${application.name}, restarting Harper`;
433433
} else response.message = `Successfully deployed: ${application.name}`;
434434

435435
return response;
@@ -631,7 +631,7 @@ async function dropComponent(req) {
631631
let response = await server.replication.replicateOperation(req);
632632
if (req.restart === true) {
633633
manageThreads.restartWorkers('http');
634-
response.message = `Successfully dropped: ${projectPath}, restarting HarperDB`;
634+
response.message = `Successfully dropped: ${projectPath}, restarting Harper`;
635635
} else response.message = `Successfully dropped: ${projectPath}`;
636636
return response;
637637
}

config/configUtils.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const EMPTY_GET_VALUE = 'Empty parameter sent to getConfigValue';
2323
const DEFAULT_CONFIG_FILE_PATH = path.join(__dirname, '../../static', hdbTerms.HDB_DEFAULT_CONFIG_FILE);
2424

2525
const CONFIGURE_SUCCESS_RESPONSE =
26-
'Configuration successfully set. You must restart HarperDB for new config settings to take effect.';
26+
'Configuration successfully set. You must restart Harper for new config settings to take effect.';
2727

2828
const DEPRECATED_CONFIG = {
2929
logging_rotation_retain: 'logging.rotation.retain',
@@ -71,7 +71,7 @@ function resolvePath(relativePath) {
7171
}
7272

7373
/**
74-
* Builds the HarperDB config file using user inputs and default values from defaultConfig.yaml
74+
* Builds the Harper config file using user inputs and default values from defaultConfig.yaml
7575
* @param args - any args that the user provided.
7676
*/
7777
function createConfigFile(args, skipFsValidation = false) {
@@ -232,7 +232,7 @@ function getConfigFilePath(bootPropsFilePath = hdbUtils.getPropsFilePath()) {
232232

233233
/**
234234
* If in memory config obj is undefined or init is being forced,
235-
* read and parses the HarperDB config file and add to config object.
235+
* read and parses the Harper config file and add to config object.
236236
* @param force
237237
*/
238238
function initConfig(force = false) {
@@ -244,7 +244,7 @@ function initConfig(force = false) {
244244
fs.accessSync(bootPropsFilePath, fs.constants.F_OK | fs.constants.R_OK);
245245
} catch (err) {
246246
logger.error(err);
247-
throw new Error(`HarperDB properties file at path ${bootPropsFilePath} does not exist`);
247+
throw new Error(`Harper properties file at path ${bootPropsFilePath} does not exist`);
248248
}
249249
}
250250

@@ -267,12 +267,12 @@ function initConfig(force = false) {
267267
configDoc = parseYamlDoc(configFilePath);
268268
} catch (err) {
269269
if (err.code === hdbTerms.NODE_ERROR_CODES.ENOENT) {
270-
logger.trace(`HarperDB config file not found at ${configFilePath}.
270+
logger.trace(`Harper config file not found at ${configFilePath}.
271271
This can occur during early stages of install where the config file has not yet been created`);
272272
return;
273273
} else {
274274
logger.error(err);
275-
throw new Error(`Error reading HarperDB config file at ${configFilePath}`);
275+
throw new Error(`Error reading Harper config file at ${configFilePath}`);
276276
}
277277
}
278278

@@ -569,7 +569,7 @@ function backupConfigFile(configPath, hdbRoot) {
569569

570570
const PRESERVED_PROPERTIES = ['databases'];
571571
/**
572-
* Flattens the JSON version of HarperDB config with underscores separating each parent/child key.
572+
* Flattens the JSON version of Harper config with underscores separating each parent/child key.
573573
* @param obj
574574
* @returns {null}
575575
*/
@@ -702,7 +702,7 @@ function readConfigFile() {
702702
} catch (err) {
703703
if (!hdbUtils.noBootFile()) {
704704
logger.error(err);
705-
throw new Error(`HarperDB properties file at path ${bootPropsFilePath} does not exist`);
705+
throw new Error(`Harper properties file at path ${bootPropsFilePath} does not exist`);
706706
}
707707
}
708708

config/harperConfigEnvVars.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* HARPER_DEFAULT_CONFIG and HARPER_SET_CONFIG environment variable support
33
*
44
* This module provides utilities for applying configuration from environment variables
5-
* to HarperDB's configuration system with source tracking and drift detection.
5+
* to Harper's configuration system with source tracking and drift detection.
66
*
77
* Features:
88
* - Install-time and runtime configuration from env vars

0 commit comments

Comments
 (0)