diff --git a/config/custom-environment-variables.json b/config/custom-environment-variables.json new file mode 100644 index 00000000..c3ac0d80 --- /dev/null +++ b/config/custom-environment-variables.json @@ -0,0 +1,8 @@ +{ + "WalletConfig": { + "lbryAddress": "LBRY_WALLET_ADDRESS" + }, + "AnalyticsConfig":{ + "googleId": "GOOGLE_ANALYTICS_ID" + } +} \ No newline at end of file diff --git a/config/default.json b/config/default.json new file mode 100644 index 00000000..17c51244 --- /dev/null +++ b/config/default.json @@ -0,0 +1,8 @@ +{ + "WalletConfig": { + "lbryAddress": "none" + }, + "AnalyticsConfig":{ + "googleId": "none" + } +} \ No newline at end of file diff --git a/helpers/socketHelpers.js b/helpers/socketHelpers.js index 6a3a7638..45c67e39 100644 --- a/helpers/socketHelpers.js +++ b/helpers/socketHelpers.js @@ -1,5 +1,7 @@ var fs = require('fs'); var lbryApi = require('../helpers/lbryApi.js'); +var config = require('config'); +var walledAddress = config.get('WalletConfig.lbryAddress'); function handlePublishError(error) { if (error.code === "ECONNREFUSED"){ @@ -24,8 +26,8 @@ function createPublishParams(name, filepath, license, nsfw) { "license": license, "nsfw": (nsfw.toLowerCase() === "true") }, - "claim_address": "", // fill in wallet address - "change_address": "" // fill in wallet address; requires daemon 0.12.2rc1 or above + "claim_address": walledAddress, + "change_address": walledAddress //requires daemon 0.12.2rc1 or above }; return publishParams; } diff --git a/package.json b/package.json index 799ceade..fe250769 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "dependencies": { "axios": "^0.16.1", "body-parser": "^1.17.1", + "config": "^1.26.1", "express": "^4.15.2", "express-handlebars": "^3.0.0", "nodemon": "^1.11.0",