settings: cloudronId is only ever set

we use subscription API to get the cloudronId, never from database
This commit is contained in:
Girish Ramakrishnan
2023-08-02 21:49:29 +05:30
parent e0d07c3c19
commit eb4213d61d
2 changed files with 2 additions and 19 deletions
-17
View File
@@ -34,9 +34,6 @@ exports = module.exports = {
getLanguage,
setLanguage,
getCloudronId,
setCloudronId,
getSysinfoConfig,
setSysinfoConfig,
@@ -157,7 +154,6 @@ const gDefaults = (function () {
provider: 'noop'
};
result[exports.LANGUAGE_KEY] = 'en';
result[exports.CLOUDRON_ID_KEY] = '';
result[exports.BACKUP_CONFIG_KEY] = {
provider: 'filesystem',
backupFolder: paths.DEFAULT_BACKUP_DIR,
@@ -563,19 +559,6 @@ async function setLanguage(language) {
notifyChange(exports.LANGUAGE_KEY, language);
}
async function getCloudronId() {
const value = await get(exports.CLOUDRON_ID_KEY);
if (value === null) return gDefaults[exports.CLOUDRON_ID_KEY];
return value;
}
async function setCloudronId(cid) {
assert.strictEqual(typeof cid, 'string');
await set(exports.CLOUDRON_ID_KEY, cid);
notifyChange(exports.CLOUDRON_ID_KEY, cid);
}
async function list() {
const settings = await database.query(`SELECT ${SETTINGS_FIELDS} FROM settings WHERE value IS NOT NULL ORDER BY name`);