Fixed DISABLE_PATREON not working, it's now a Meteor setting instead of an ENV variable

This commit is contained in:
Stefan Zermatten
2021-07-27 14:31:54 +02:00
parent 9a9e6491b9
commit 421ff2aa7d
3 changed files with 12 additions and 2 deletions

View File

@@ -78,8 +78,12 @@ NPM_CONFIG_PRODUCTION=true
PROJECT_DIR=app
ROOT_URL=https://<url of your DiceCloud instance>
DEFAULT_LIBRARIES=<comma separated list of library ids that will be subscribed by default: "abc123,def456">
DISABLE_PATREON=<"true" if you want to prevent features being locked behind Patreon tiers>
```
To disable Patreon features and unlock all paid restrictions for all users of your deployment, replace
`"patreon": { "clientId": ... }"` with `"disablePatreon": true` in the public key of the METEOR_SETTINGS environment variable.
Alternatively run `meteor run --settings exampleMeteorSettings.json` to start the app with the example settings that disable Patreon by default.
Now, visiting [](http://localhost:3000/) should show you an empty instance of
DiceCloud running.

View File

@@ -0,0 +1,6 @@
{
"public": {
"environment": "production",
"disablePatreon": true
}
}

View File

@@ -1,7 +1,7 @@
import { findLast } from 'lodash';
import getEntitledCents from '/imports/api/users/patreon/getEntitledCents.js';
import Invites from '/imports/api/users/Invites.js';
const patreonDisabled = !!process.env.DISABLE_PATREON;
const patreonDisabled = !!Meteor.settings?.public?.disablePatreon;
const TIERS = Object.freeze([
{