-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #264 from dappnode/v0.2.10
v0.2.10 Release
- Loading branch information
Showing
350 changed files
with
20,275 additions
and
10,957 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/sh | ||
crond | ||
NODE_PATH=src node src/index.js | ||
node src/index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
typings/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,23 @@ | ||
{ | ||
"extends": ["plugin:prettier/recommended","eslint:recommended"], | ||
"parser": "@typescript-eslint/parser", | ||
"extends": [ | ||
"plugin:@typescript-eslint/recommended" // Uses the recommended rules from the @typescript-eslint/eslint-plugin | ||
], | ||
// "extends": ["plugin:prettier/recommended","eslint:recommended"], | ||
"parserOptions": { | ||
"ecmaVersion": 2018 | ||
"ecmaVersion": 2018, | ||
"sourceType": "module" // Allows for the use of imports | ||
}, | ||
"env": { | ||
"node": true, | ||
"mocha": true, | ||
"es6": true | ||
}, | ||
"rules": { | ||
"max-len": ["error", 1000] | ||
"max-len": ["error", 1000], | ||
// ##### Some libraries do not have typings and the compiler does not understand .d.ts files | ||
"@typescript-eslint/no-var-requires": "off", | ||
// ##### typescript does not understand hoisting | ||
"@typescript-eslint/no-use-before-define": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 14 additions & 9 deletions
23
...d/src/src/calls/autoUpdateSettingsEdit.js → ...d/src/src/calls/autoUpdateSettingsEdit.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,35 @@ | ||
const { | ||
import { | ||
MY_PACKAGES, // "my-packages" | ||
SYSTEM_PACKAGES, // "system-packages" | ||
editDnpSetting, | ||
editCoreSetting | ||
} = require("utils/autoUpdateHelper"); | ||
} from "../utils/autoUpdateHelper"; | ||
import { RpcHandlerReturn } from "../types"; | ||
|
||
/** | ||
* Edits the auto-update settings | ||
* | ||
* @param {string} id = "my-packages", "system-packages" or "bitcoin.dnp.dappnode.eth" | ||
* @param {bool} enabled Auto update is enabled for ID | ||
*/ | ||
const autoUpdateSettingsEdit = async ({ id, enabled }) => { | ||
export default async function autoUpdateSettingsEdit({ | ||
id, | ||
enabled | ||
}: { | ||
id: string; | ||
enabled: boolean; | ||
}): Promise<RpcHandlerReturn> { | ||
if (!id) | ||
throw Error(`Argument id is required or generalSettings must be true`); | ||
|
||
if (id === MY_PACKAGES) await editDnpSetting(enabled); | ||
else if (id === SYSTEM_PACKAGES) await editCoreSetting(enabled); | ||
else await editDnpSetting(enabled, id); | ||
if (id === MY_PACKAGES) editDnpSetting(enabled); | ||
else if (id === SYSTEM_PACKAGES) editCoreSetting(enabled); | ||
else editDnpSetting(enabled, id); | ||
|
||
const name = ((id || "").split(".")[0] || "").replace("-", " "); | ||
return { | ||
message: `${enabled ? "Enabled" : "Disabled"} auto updates for ${name}`, | ||
logMessage: true, | ||
userAction: true | ||
}; | ||
}; | ||
|
||
module.exports = autoUpdateSettingsEdit; | ||
} |
Oops, something went wrong.