- Product name, app id, installer names, translations, titles -> Threshold - Desktop: look for threshold CLI first, then boundary; migrate legacy Boundary user-data dir; updater/release lookups disabled unless configured - Remove HashiCorp/IBM logos and art (plain placeholder mark), GitHub release workflows and HashiCorp release metadata - Add NOTICE and README 'About this fork' Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
64 lines
2.2 KiB
JavaScript
64 lines
2.2 KiB
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
const { isLinux } = require('../src/helpers/platform.js');
|
|
|
|
/** Always returns a valid semVer. Composed of Major.Minor.Path and all valid integers
|
|
* Otherwise we run into this issue: https://github.com/electron/packager/issues/1714#issuecomment-2091266284
|
|
*/
|
|
const returnSemVerFromReleaseVersion = (releaseVersion) => {
|
|
let [major, minor, patch] = releaseVersion.split('.').slice(0, 3);
|
|
|
|
// Delete, if present, v from Major
|
|
if (!parseInt(major)) {
|
|
major = major.replace('v', '');
|
|
}
|
|
// parseInt the patch to eliminate any text after the version integer.
|
|
return `${major}.${minor}.${parseInt(patch)}`;
|
|
};
|
|
|
|
// Create config
|
|
const createConfig = () => {
|
|
const config = {
|
|
name: 'threshold',
|
|
productName: 'Threshold',
|
|
// Upstream copyright is retained; see NOTICE and LICENSE in the repository root.
|
|
copyright: `Copyright © 2021-2026 HashiCorp, Inc. / IBM Corp. (upstream Boundary UI, BUSL-1.1). Threshold fork by CyberCove LLC.`,
|
|
releaseVersion: process.env.RELEASE_VERSION,
|
|
releaseCommit: process.env.RELEASE_COMMIT,
|
|
executableName: 'Threshold',
|
|
// Update feed (directory listing in the releases.hashicorp.com layout).
|
|
// Empty disables the in-app updater and the update-related network access.
|
|
updateFeedUrl: process.env.THRESHOLD_UPDATE_FEED_URL || '',
|
|
releaseVersionRaw: process.env.RELEASE_VERSION,
|
|
};
|
|
|
|
// Take a valid release version in semVer format.
|
|
if (!config.releaseVersion) {
|
|
config.releaseVersion = '0.0.0';
|
|
config.releaseVersionRaw = '0.0.0';
|
|
} else {
|
|
config.releaseVersion = returnSemVerFromReleaseVersion(
|
|
config.releaseVersion,
|
|
);
|
|
}
|
|
|
|
if (isLinux()) config.executableName = 'threshold-desktop';
|
|
return config;
|
|
};
|
|
|
|
// Save config to file
|
|
const saveConfig = (config, destination) => {
|
|
const configPath = path.join(destination, 'config.js');
|
|
const content = `module.exports = ${JSON.stringify(config, null, 2)}`;
|
|
fs.writeFileSync(configPath, content);
|
|
console.log(`Create: ${configPath}`);
|
|
};
|
|
|
|
module.exports = {
|
|
setup: () => {
|
|
const config = createConfig();
|
|
const destination = path.resolve(__dirname);
|
|
saveConfig(config, destination);
|
|
},
|
|
};
|