fix next.js env vars

This commit is contained in:
Matthias Kretschmann 2021-10-27 18:07:11 +01:00
parent 4f4f5d30d4
commit 1cf69c2423
Signed by: m
GPG Key ID: 606EEEF3C479A91F
6 changed files with 27 additions and 25 deletions

View File

@ -1,7 +1,7 @@
#NEXT_INFURA_PROJECT_ID="xxx"
#NEXT_MARKET_FEE_ADDRESS="0xxx"
#NEXT_PORTIS_ID="xxx"
#NEXT_PUBLIC_INFURA_PROJECT_ID="xxx"
#NEXT_PUBLIC_MARKET_FEE_ADDRESS="0xxx"
#NEXT_PUBLIC_PORTIS_ID="xxx"
#
@ -9,9 +9,9 @@
#
# Toggle pricing options presented during price creation
#NEXT_ALLOW_FIXED_PRICING="true"
#NEXT_ALLOW_DYNAMIC_PRICING="true"
#NEXT_ALLOW_FREE_PRICING="true"
#NEXT_PUBLIC_ALLOW_FIXED_PRICING="true"
#NEXT_PUBLIC_ALLOW_DYNAMIC_PRICING="true"
#NEXT_PUBLIC_ALLOW_FREE_PRICING="true"
# Privacy Preference Center
#NEXT_PRIVACY_PREFERENCE_CENTER="true"
#NEXT_PUBLIC_PRIVACY_PREFERENCE_CENTER="true"

View File

@ -16,8 +16,8 @@ jobs:
- run: npm run build
env:
NEXT_INFURA_PROJECT_ID: ${{ secrets.NEXT_INFURA_PROJECT_ID }}
NEXT_PORTIS_ID: ${{ secrets.NEXT_PORTIS_ID }}
NEXT_PUBLIC_INFURA_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_INFURA_PROJECT_ID }}
NEXT_PUBLIC_PORTIS_ID: ${{ secrets.NEXT_PUBLIC_PORTIS_ID }}
- run: npm run deploy:s3
env:

View File

@ -340,15 +340,15 @@ Everything else is made open according to the apache2 license. We look forward t
### Dynamic Pricing
To allow publishers to set pricing as "Dynamic" you need to add the following environmental variable to your .env file: `NEXT_ALLOW_DYNAMIC_PRICING="true"` (default).
To allow publishers to set pricing as "Dynamic" you need to add the following environmental variable to your .env file: `NEXT_PUBLIC_ALLOW_DYNAMIC_PRICING="true"` (default).
### Fixed Pricing
To allow publishers to set pricing as "Fixed" you need to add the following environmental variable to your .env file: `NEXT_ALLOW_FIXED_PRICING="true"` (default).
To allow publishers to set pricing as "Fixed" you need to add the following environmental variable to your .env file: `NEXT_PUBLIC_ALLOW_FIXED_PRICING="true"` (default).
### Free Pricing
To allow publishers to set pricing as "Free" you need to add the following environmental variable to your .env file: `NEXT_ALLOW_FREE_PRICING="true"` (default).
To allow publishers to set pricing as "Free" you need to add the following environmental variable to your .env file: `NEXT_PUBLIC_ALLOW_FREE_PRICING="true"` (default).
This allocates the datatokens to the [dispenser contract](https://github.com/oceanprotocol/contracts/blob/main/contracts/dispenser/Dispenser.sol) which dispenses data tokens to users for free. Publishers in your market will now be able to offer their datasets to users for free (excluding gas costs).
@ -362,7 +362,7 @@ Feel free to adopt our provided privacy policies to your needs. Per default we c
### Privacy Preference Center
Additionally, Ocean Market provides a privacy preference center for you to use. This feature is disabled per default since we do not use cookies requiring consent on our deployment of the market. However, if you need to add some functionality depending on cookies, you can simply enable this feature by changing the value of the `NEXT_PRIVACY_PREFERENCE_CENTER` environmental variable to `"true"` in your `.env` file. This will enable a customizable cookie banner stating the use of your individual cookies. The content of this banner can be adjusted within the `content/gdpr.json` file. If no `optionalCookies` are provided, the privacy preference center will be set to a simpler version displaying only the `title`, `text` and `close`-button. This can be used to inform the user about the use of essential cookies, where no consent is needed. The privacy preference center supports two different styling options: `'small'` and `'default'`. Setting the style propertie to `'small'` will display a smaller cookie banner to the user at first, only showing the default styled privacy preference center upon the user's customization request.
Additionally, Ocean Market provides a privacy preference center for you to use. This feature is disabled per default since we do not use cookies requiring consent on our deployment of the market. However, if you need to add some functionality depending on cookies, you can simply enable this feature by changing the value of the `NEXT_PUBLIC_PRIVACY_PREFERENCE_CENTER` environmental variable to `"true"` in your `.env` file. This will enable a customizable cookie banner stating the use of your individual cookies. The content of this banner can be adjusted within the `content/gdpr.json` file. If no `optionalCookies` are provided, the privacy preference center will be set to a simpler version displaying only the `title`, `text` and `close`-button. This can be used to inform the user about the use of essential cookies, where no consent is needed. The privacy preference center supports two different styling options: `'small'` and `'default'`. Setting the style propertie to `'small'` will display a smaller cookie banner to the user at first, only showing the default styled privacy preference center upon the user's customization request.
Now your market users will be provided with additional options to toggle the use of your configured cookie consent categories. You can always retrieve the current consent status per category with the provided `useConsent()` hook. See below, how you can set your own custom cookies depending on the market user's consent. Feel free to adjust the provided utility functions for cookie usage provided in the `src/utils/cookies.ts` file to your needs.

View File

@ -1,4 +1,4 @@
module.exports = {
export default {
// URI of single metadata cache instance for all networks.
// While ocean.js includes this value for each network as part of its ConfigHelper,
// it is assumed to be the same for all networks.
@ -6,7 +6,8 @@ module.exports = {
// const { appConfig } = useSiteMetadata()
// return appConfig.metadataCacheUri
metadataCacheUri:
process.env.METADATACACHE_URI || 'https://aquarius.oceanprotocol.com',
process.env.NEXT_PUBLIC_METADATACACHE_URI ||
'https://aquarius.oceanprotocol.com',
// List of chainIds which metadata cache queries will return by default.
// This preselects the Chains user preferences.
@ -15,11 +16,11 @@ module.exports = {
// List of all supported chainIds. Used to populate the Chains user preferences list.
chainIdsSupported: [1, 3, 4, 137, 80001, 1287, 56, 2021000, 1285, 246],
infuraProjectId: process.env.NEXT_INFURA_PROJECT_ID || 'xxx',
infuraProjectId: process.env.NEXT_PUBLIC_INFURA_PROJECT_ID || 'xxx',
// The ETH address the marketplace fee will be sent to.
marketFeeAddress:
process.env.NEXT_MARKET_FEE_ADDRESS ||
process.env.NEXT_PUBLIC_MARKET_FEE_ADDRESS ||
'0x9984b2453eC7D99a73A5B3a46Da81f197B753C8d',
// Used for conversion display, can be whatever coingecko API supports
@ -48,13 +49,13 @@ module.exports = {
},
// Wallets
portisId: process.env.NEXT_PORTIS_ID || 'xxx',
portisId: process.env.NEXT_PUBLIC_PORTIS_ID || 'xxx',
// Used to show or hide the fixed, dynamic or free price options
// tab to publishers during the price creation.
allowFixedPricing: process.env.NEXT_ALLOW_FIXED_PRICING || 'true',
allowDynamicPricing: process.env.NEXT_ALLOW_DYNAMIC_PRICING || 'true',
allowFreePricing: process.env.NEXT_ALLOW_FREE_PRICING || 'true',
allowFixedPricing: process.env.NEXT_PUBLIC_ALLOW_FIXED_PRICING || 'true',
allowDynamicPricing: process.env.NEXT_PUBLIC_ALLOW_DYNAMIC_PRICING || 'true',
allowFreePricing: process.env.NEXT_PUBLIC_ALLOW_FREE_PRICING || 'true',
// Set the default privacy policy to initially display
// this should be the slug of your default policy markdown file
@ -65,5 +66,6 @@ module.exports = {
// If set to true a gdpr.json file inside the content directory
// is used to create and show a privacy preference center / cookie banner
// To learn more about how to configure and use this, please refer to the readme
privacyPreferenceCenter: process.env.NEXT_PRIVACY_PREFERENCE_CENTER || 'false'
privacyPreferenceCenter:
process.env.NEXT_PUBLIC_PRIVACY_PREFERENCE_CENTER || 'false'
}

View File

@ -14,7 +14,7 @@ export function getOceanConfig(network: string | number): ConfigHelperConfig {
network === 'gaiaxtestnet' ||
network === 2021000
? undefined
: process.env.NEXT_INFURA_PROJECT_ID
: process.env.NEXT_PUBLIC_INFURA_PROJECT_ID
) as ConfigHelperConfig
return config as ConfigHelperConfig
}

View File

@ -32,8 +32,8 @@
"include": [
"./src/**/*",
"./tests/**/*",
"./app.config.js",
"./next-env.d.ts",
"./content/**/*"
"./content/**/*",
"app.config.ts"
]
}