diff --git a/.env.sample b/.env.sample new file mode 100644 index 0000000..4f36271 --- /dev/null +++ b/.env.sample @@ -0,0 +1,26 @@ +# The location of your hosted daemon, sans protocol (so, daemon.your.site instead of https://daemon.your.site) +# HTTPS is assumed for security reasons +DAEMON_URL= + +# https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app +# We use this to show the GitHub feed on the homepage +GITHUB_OAUTH_TOKEN= + +# You can use openssl to generate impossible to guess tokens +# Ideally you would have a reference to this on your daemon so make sure that server is secure! +# openssl rand -hex 32 || openssl rand -base64 32 +LBRY_DAEMON_ACCESS_TOKEN= + +# Absolute path to the images folder you want the daemon to use on its server +LBRY_DAEMON_IMAGES_PATH= + +# Usually 443 +# This is commented-out for local development +PORT= + +# https://devcenter.heroku.com/articles/rediscloud +REDISCLOUD_URL= + +# https://api.slack.com/incoming-webhooks +# We get notified when issues with this app happens, directly in Slack +SLACK_WEBHOOK_URL= diff --git a/app/helpers/fetch-metadata.js b/app/helpers/fetch-metadata.js index 773c585..13c714b 100644 --- a/app/helpers/fetch-metadata.js +++ b/app/helpers/fetch-metadata.js @@ -154,7 +154,7 @@ module.exports = exports = (data, socket) => { body: body, json: true, method: apiRequestMethod, - url: `${process.env.NODE_ENV === "development" ? `http://localhost:5200/${resolveMethod}` : `https://daemon.lbry.tech/${resolveMethod}`}` + url: `${process.env.NODE_ENV === "development" ? `http://localhost:5200/${resolveMethod}` : `https://${process.env.DAEMON_URL}/${resolveMethod}`}` }, (error, response, body) => { if (error) { if (process.env.NODE_ENV !== "development") { diff --git a/app/helpers/publish-meme.js b/app/helpers/publish-meme.js index cf81538..33f419e 100644 --- a/app/helpers/publish-meme.js +++ b/app/helpers/publish-meme.js @@ -17,7 +17,7 @@ module.exports = exports = publishMetadata => new Promise((resolve, reject) => r }, json: true, method: "PUT", - url: `${process.env.NODE_ENV === "development" ? "http://localhost:5200/publish" : "https://daemon.lbry.tech/publish" }` + url: `${process.env.NODE_ENV === "development" ? "http://localhost:5200/publish" : `https://${process.env.DAEMON_URL}/publish` }` }, (error, response, body) => { if (error) resolve(error); resolve(body); diff --git a/app/helpers/upload-image.js b/app/helpers/upload-image.js index b47a231..0e1d6ad 100644 --- a/app/helpers/upload-image.js +++ b/app/helpers/upload-image.js @@ -18,7 +18,7 @@ module.exports = exports = imageSource => new Promise((resolve, reject) => { // }, json: true, method: "POST", - url: `${process.env.NODE_ENV === "development" ? "http://localhost:5200/image" : "https://daemon.lbry.tech/image" }` + url: `${process.env.NODE_ENV === "development" ? "http://localhost:5200/image" : `https://${process.env.DAEMON_URL}/image` }` }, (error, response, body) => { if (error) resolve(error); resolve(body);