Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33312418
D6113.1768814700.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D6113.1768814700.diff
View Options
diff --git a/keyserver/Dockerfile b/keyserver/Dockerfile
--- a/keyserver/Dockerfile
+++ b/keyserver/Dockerfile
@@ -20,6 +20,7 @@
ARG HOST_UID
ARG HOST_GID
+ARG COMM_ALCHEMY_KEY
USER root
RUN \
diff --git a/keyserver/docker-compose.yml b/keyserver/docker-compose.yml
--- a/keyserver/docker-compose.yml
+++ b/keyserver/docker-compose.yml
@@ -7,6 +7,7 @@
args:
- HOST_UID=${HOST_UID}
- HOST_GID=${HOST_GID}
+ - COMM_ALCHEMY_KEY=${COMM_ALCHEMY_KEY}
image: commapp/node-keyserver:1.0
restart: always
ports:
diff --git a/landing/.eslintrc.json b/landing/.eslintrc.json
--- a/landing/.eslintrc.json
+++ b/landing/.eslintrc.json
@@ -1,5 +1,8 @@
{
"env": {
"browser": true
+ },
+ "globals": {
+ "process": true
}
}
diff --git a/landing/siwe.react.js b/landing/siwe.react.js
--- a/landing/siwe.react.js
+++ b/landing/siwe.react.js
@@ -21,6 +21,7 @@
createClient,
WagmiConfig,
} from 'wagmi';
+import { alchemyProvider } from 'wagmi/providers/alchemy';
import { publicProvider } from 'wagmi/providers/public';
import type { SIWEWebViewMessage } from 'lib/types/siwe-types';
@@ -29,10 +30,13 @@
import { SIWENonceContext } from './siwe-nonce-context.js';
import css from './siwe.css';
-// details can be found https://wagmi.sh/docs/providers/configuring-chains
+// details can be found https://0.6.x.wagmi.sh/docs/providers/configuring-chains
+const availableProviders = process.env.COMM_ALCHEMY_KEY
+ ? [alchemyProvider({ apiKey: process.env.COMM_ALCHEMY_KEY })]
+ : [publicProvider()];
const { chains, provider } = configureChains(
[chain.mainnet],
- [publicProvider()],
+ availableProviders,
);
const { connectors } = getDefaultWallets({
diff --git a/landing/webpack.config.cjs b/landing/webpack.config.cjs
--- a/landing/webpack.config.cjs
+++ b/landing/webpack.config.cjs
@@ -1,5 +1,6 @@
const AssetsPlugin = require('assets-webpack-plugin');
const path = require('path');
+const webpack = require('webpack');
const {
createProdBrowserConfig,
@@ -65,18 +66,39 @@
},
};
+const alchemyKey = process.env.COMM_ALCHEMY_KEY;
+
module.exports = function (env) {
- const browserConfig =
+ const rawBrowserConfig =
env === 'prod'
? createProdBrowserConfig(baseProdBrowserConfig, babelConfig)
: createDevBrowserConfig(baseDevBrowserConfig, babelConfig);
- const nodeConfig = createNodeServerRenderingConfig(
+ const browserConfig = {
+ ...rawBrowserConfig,
+ plugins: [
+ ...rawBrowserConfig.plugins,
+ new webpack.DefinePlugin({
+ 'process.env': {
+ COMM_ALCHEMY_KEY: JSON.stringify(alchemyKey),
+ },
+ }),
+ ],
+ };
+ const baseNodeConfig = createNodeServerRenderingConfig(
baseNodeServerRenderingConfig,
babelConfig,
);
- const nodeServerRenderingConfig = {
- ...nodeConfig,
+ const nodeConfig = {
+ ...baseNodeConfig,
mode: env === 'prod' ? 'production' : 'development',
+ plugins: [
+ ...baseNodeConfig.plugins,
+ new webpack.DefinePlugin({
+ 'process.env': {
+ COMM_ALCHEMY_KEY: JSON.stringify(alchemyKey),
+ },
+ }),
+ ],
};
- return [browserConfig, nodeServerRenderingConfig];
+ return [browserConfig, nodeConfig];
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 19, 9:25 AM (19 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5955148
Default Alt Text
D6113.1768814700.diff (3 KB)
Attached To
Mode
D6113: [landing][keyserver] Allow setting Alchemy key in keyserver/.env
Attached
Detach File
Event Timeline
Log In to Comment