Skip to content

Commit 7e67584

Browse files
Update env.example with better defauls, consolidate access to environment through the config package
1 parent 835fc24 commit 7e67584

File tree

10 files changed

+278
-196
lines changed

10 files changed

+278
-196
lines changed

.env.example

+129-129
Original file line numberDiff line numberDiff line change
@@ -7,115 +7,162 @@
77

88
# REQUIRED VARIABLES
99

10-
# The node environment to run the server in. Should be "production" or "development"
10+
# The node environment to run the server in. Should be "production" or "development"
1111
NODE_ENV
1212

13-
# Standalone mode is the ide running locally.
13+
# Standalone mode is the IDE running locally
1414
STANDALONE
15+
VITE_APP_STANDALONE
16+
17+
# Production mode flag
18+
PRODUCTION
1519

16-
## Main database URL
20+
# Main database URL
1721
DATABASE_URL
1822

1923
# The shadow database URL used for prisma migrations
2024
SHADOW_DATABASE_URL
2125

22-
# API key for pinecone used by the memory service
23-
PINECONE_API_KEY
26+
# Keywords API configuration
27+
KEYWORDS_API_KEY
28+
KEYWORDS_API_URL
29+
30+
# The main JWT secret used by the server to authenticate requests. Shared with the portal API.
31+
JWT_SECRET=magick_nextauth_secret_key_123
32+
33+
# Generic hard coded API access key for server to server communication
34+
API_ACCESS_KEY
2435

25-
# telemetry key for the platform
26-
HYPERDX_API_KEY
36+
# Used to encrypt the credentials in the database
37+
CREDENTIALS_ENCRYPTION_KEY
2738

2839
# URL of the portal
2940
PORTAL_URL
3041

31-
# Url of the IDE server itself
42+
# URL of the IDE server itself
43+
API_URL
3244
API_ROOT_URL
3345

34-
# The main JWT secret used by the server to authenticate requests. Shared with the portal API.
35-
JWT_SECRET
46+
# Trusted parent URL
47+
TRUSTED_PARENT_URL
3648

37-
# Generic hard coded API access key for server to server communication
38-
API_ACCESS_KEY
49+
# The URL for the main redis server
50+
REDIS_URL
51+
REDIS_PRIVATE_URL
3952

40-
# Used to encrypt the credentials in the database.
41-
CREDENTIALS_ENCRYPTION_KEY
53+
# Used by the cloud to validate any API requests coming from the agent server
54+
PORTAL_AGENT_KEY
4255

43-
# Posthos API key for doing posthog stuff in the app
44-
POSTHOG_API_KEY
56+
# Portal bot URL for notifications
57+
PORTAL_BOT_URL
4558

46-
# The URL for teh main redis server. Often set as an environment by hosting services.
47-
REDIS_URL
59+
# User service configuration
60+
ENABLE_USER_SERVICE
4861

49-
# Used by the cloud to validate any API requests coming from the agent server. Needs to be the same in the portal
50-
PORTAL_AGENT_KEY
62+
# Seraph configuration
63+
ENABLE_SERAPH
64+
NITRO_JWT_SECRET
5165

52-
# AWS CONFIGURATION KEYS
53-
AWS_ACCESS_KEY
54-
AWS_SECRET_KEY
55-
AWS_REGION
56-
AWS_BUCKET_NAME
57-
AWS_BUCKET_ENDPOINT
66+
# ML SERVICE API KEYS
67+
OPENAI_API_KEY
68+
DEFAULT_OPENAI_KEY
69+
ANTHROPIC_API_KEY
70+
GROQ_API_KEY
71+
TOGETHERAI_API_KEY
72+
GEMINI_API_KEY
73+
DEFAULT_GOOGLEAI_API_KEY
74+
UNSTRUCTURED_KEY
75+
76+
# MEMORY/VECTOR DATABASES
77+
PINECONE_API_KEY
78+
PINECONE_INDEX_NAME
79+
80+
# VOICE SERVICES
81+
AAI_KEY
82+
ELEVENLABS_API_KEY
83+
84+
# TELEMETRY CONFIGURATION
85+
POSTHOG_API_KEY
86+
POSTHOG_ENABLED
87+
VITE_APP_POSTHOG_ENABLED
88+
VITE_APP_POSTHOG_API_KEY
89+
PINO_LOG_LEVEL
90+
BUDGET_LOGGING
91+
LITELLM_LOCAL_MODEL_COST_MAP
5892

59-
# Open meter configuration
93+
# OPENMETER CONFIGURATION
6094
OPENMETER_ENABLED
6195
OPENMETER_ENDPOINT
6296
OPENMETER_TOKEN
6397
OPENMETER_SOURCE
6498

65-
# EXTERNAL ML SERVICES
66-
MAGICK_OPENAI_API_KEY
67-
MAGICK_GEMINI_API_KEY
68-
MAGICK_PALM_API_KEY
69-
MAGICK_TOGETHERAI_API_KEY
70-
VERTEXAI_PROJECT
71-
VERTEXAI_LOCATION
99+
# FEATURE FLAGS
100+
VITE_APP_COMPOSER_V2
101+
COMPOSER_V2
102+
NEXT_PUBLIC_BETA_FEATURES_FUNCTIONS
72103

104+
# GOOGLE CLOUD CONFIGURATION
105+
GOOGLE_CLOUD_PROJECT_ID
106+
GOOGLE_CLOUD_CLIENT_EMAIL
107+
GOOGLE_CLOUD_PRIVATE_KEY
108+
GOOGLE_PRIVATE_BUCKET_NAME
109+
GOOGLE_PUBLIC_BUCKET_NAME
110+
PROJECT_BUCKET_PREFIX
111+
112+
# AWS CONFIGURATION KEYS
113+
AWS_ACCESS_KEY
114+
AWS_SECRET_KEY
115+
AWS_REGION
116+
AWS_BUCKET_NAME
117+
AWS_BUCKET_ENDPOINT
118+
NEXT_PUBLIC_BUCKET_PREFIX
73119

74120
# OPTIONAL VARIABLES
75121

76-
# Prevents the server form crashing on unhandled exceptions.
77-
# Defaults to true
122+
# Prevents the server from crashing on unhandled exceptions
78123
DONT_CRASH_ON_ERROR
79124

80-
# The port the server should listen on.
81-
# Default: 3030
125+
# The port the server should listen on
126+
PORT
82127
SERVER_PORT
83128

84129
# The host of the server
85-
# Default: localhost
130+
HOST
86131
SERVER_HOST
87132

88-
# Algorithm used for credential encryptian
133+
# Algorithm used for credential encryption
89134
CREDENTIALS_ALGORITHM
90135

91-
# How many items are returned from a paginated endpoint
92-
# default: 10
136+
# Pagination configuration
93137
PAGINATE_DEFAULT
94-
95-
# The maximum number of items that can be returned from a paginated endpoint
96-
# default: 100
97138
PAGINATE_MAX
98139

99-
# The log level for pino. Can be "trace", "debug", "info"
100-
# Defaults to "info"
101-
PINO_LOG_LEVEL
102-
103-
# The interval in milliseconds that the agent manager should send a heartbeat to check for agents
104-
# default: 3000
140+
# Agent configuration
105141
HEARTBEAT_MSEC
106-
107-
# How long the agent manager should wait before checking for agents after starting
108-
# default: 5000
109142
MANAGER_WARM_UP_MSEC
143+
AGENT_HEARTBEAT_INTERVAL_MSEC
144+
AGENT_RESPONSE_TIMEOUT_MSEC
110145

111-
# Slack developer mode is used to developer slack apps locally
112-
# Defaults to false
146+
# Plugin configuration
113147
SLACK_DEVELOPER_MODE
114-
115-
# The directory plugins live in.
116-
# Defaults to ./plugins
117-
PLUGINS_DIRECTORY
118-
148+
DISCORD_DEVELOPER_MODE
149+
PLUGIN_DIRECTORY
150+
151+
# Embedder configuration
152+
EMBEDDER_DB_URL
153+
EMBEDDER_REDIS_URL
154+
EMBEDDER_REDIS_HOST
155+
EMBEDDER_REDIS_PORT
156+
EMBEDDER_PINECONE_PROJECT
157+
EMBEDDER_PINECONE_CLOUD
158+
EMBEDDER_PINECONE_REGION
159+
EMBEDDER_JWT_SECRET
160+
EMBEDDER_JWT_EXPIRES_IN
161+
EMBEDDER_AUTH_ROUTE_MATCHER
162+
AGENT_EMBEDDER_API_KEY
163+
164+
# Frigade configuration
165+
FRIGADE_PRIVATE_KEY
119166

120167
# ██╗██████╗ ███████╗ ██████╗██╗ ██╗███████╗███╗ ██╗████████╗
121168
# ██║██╔══██╗██╔════╝ ██╔════╝██║ ██║██╔════╝████╗ ██║╚══██╔══╝
@@ -127,44 +174,14 @@ PLUGINS_DIRECTORY
127174
# The URL of the app portal
128175
NEXT_PUBLIC_APP_URL=http://localhost:3000
129176

130-
# The root url of the IDE server
131-
SERVER_ROOT_URL
132-
133177
# The root url of the API server
134-
# defaults to localhost:SERVER_PORT (3030)
135178
VITE_APP_API_ROOT_URL
136179

137-
# Enabled posthog. Defaults to false.
138-
VITE_APP_POSTHOG_ENABLED
139-
140-
# The posthog API key for the app
141-
VITE_APP_POSTHOG_API_KEY
142-
143-
# The frigade API key
144-
VITE_APP_FRIGADE_KEY
145-
146-
147-
# IDE CLIENT VARIABLES - optional
148-
149-
# The port the server is running on
150-
# Default: 3030
180+
# IDE CLIENT VARIABLES
151181
VITE_APP_SERVER_PORT
152-
153-
# The node environment to run the server in. Should be "production" or "development".
154-
# Defaults to development
155182
VITE_APP_NODE_ENV
156-
157-
# used for running the IDE locally
158-
VITE_APP_STANDALONE
159-
160-
# Used by the client to set up a single project space.
161-
# Needs to also be on the server, and have a JWT key encoded with it.
162183
VITE_APP_DEFAULT_PROJECT_ID
163-
164-
# Used by the client to set up a single user space.
165184
VITE_APP_DEFAULT_USER_ID
166-
167-
# A default jwt token used to authenticate the default user with the default project id.
168185
VITE_APP_DEFAULT_USER_TOKEN
169186

170187
# ██████╗ ██████╗ ██████╗ ████████╗ █████╗ ██╗
@@ -174,66 +191,49 @@ VITE_APP_DEFAULT_USER_TOKEN
174191
# ██║ ╚██████╔╝██║ ██║ ██║ ██║ ██║███████╗
175192
# ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚══════╝
176193

177-
# Database stuff
178-
PORTAL_DATABASE_URL
179-
PORTAL_SHADOW_DATABASE_URL
194+
# Note: The following are client/portal specific variables and may not
195+
# be directly used in the server config.ts, but are kept for reference.
180196

181-
# The URL of the app portal
182-
NEXT_PUBLIC_APP_URL
197+
# Database configuration
198+
PORTAL_DATABASE_URL
183199

184-
# URL of the IDE API
200+
# URLs for portal
185201
NEXT_PUBLIC_API_URL=http://localhost:3030
186-
187-
# The root url of the IDE server
188202
IDE_SERVER_URL=http://localhost:3030
189-
190203
APP_URL=http://localhost:3000
191-
192-
# URL for the API server
193204
API_URL=http://localhost:3030
205+
SERVER_ROOT_URL
194206

195-
# Stripe stuff
207+
# Stripe configuration
196208
NEXT_PUBLIC_STRIPE_PUB_KEY
197209
STRIPE_SIGNING_SECRET
198210
STRIPE_WEBHOOK_SECRET
199211
STRIPE_DATABASE_URL
200212

201-
# POSTHOG
202-
NEXT_PUBLIC_POSTHOG_KEY
203-
NEXT_PUBLIC_POSTHOG_HOST
204-
205-
# AWS CONFIGURATION KEYS
206-
NEXT_AWS_ACCESS_KEY
207-
NEXT_AWS_SECRET_KEY
208-
NEXT_AWS_REGION
209-
NEXT_AWS_BUCKET_NAME
210-
NEXT_AWS_BUCKET_ENDPOINT
211-
NEXT_PUBLIC_BUCKET_PREFIX
212-
213213
# Next auth secret (shared with IDE)
214-
NEXTAUTH_SECRET
214+
NEXTAUTH_SECRET=magick_nextauth_secret_key_123
215215

216-
# Needed to talk directly to the IDE server
216+
# API key for the agent
217217
AGENT_API_KEY
218218

219219
# Clerk configuration
220220
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
221-
# The clerk secret key.
222221
CLERK_SECRET_KEY
222+
CLERK_WEBHOOK_SECRET
223223
CLERK_WEBHOOK_LOGGING
224224
CLERK_MIDDLEWARE_LOGGING
225-
226-
# The URL for sign in
227225
NEXT_PUBLIC_CLERK_SIGN_IN_URL
228-
229-
# The URL for sign up
230226
NEXT_PUBLIC_CLERK_SIGN_UP_URL
231-
232-
# The URL to redirect to after sign up
233227
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL
228+
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL
234229

235-
# The URL to redirect to after sign in
236-
NEXT_PUBLIC_CLERK_SIGN_IN_URL
230+
# Posthog configuration - portal specific
231+
NEXT_PUBLIC_POSTHOG_ENABLED=false
232+
NEXT_PUBLIC_POSTHOG_KEY=dummy_key
233+
NEXT_PUBLIC_POSTHOG_HOST=https://app.posthog.com
234+
235+
# Embedder client URL - portal specific
236+
NEXT_PUBLIC_EMBEDDER_SERVER_URL
237237

238-
#Webhook secret for clerk
239-
CLERK_WEBHOOK_SECRET
238+
# Frigade key - portal specific
239+
VITE_APP_FRIGADE_KEY

packages/plugins/core/src/lib/corePlugin.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { CoreEventsPlugin } from '@magickml/agent-plugin'
22
import { RedisPubSub } from '@magickml/redis-pubsub'
33
import { SpellCaster } from '@magickml/agent-service'
4-
import { DATABASE_URL } from '@magickml/server-config'
4+
import { DATABASE_URL, ENABLE_USER_SERVICE } from '@magickml/server-config'
55

66
import { CoreLLMService } from './services/coreLLMService/coreLLMService'
77
import { messageEvent } from './nodes/events/messageEvent'
@@ -189,7 +189,7 @@ export class CorePlugin extends CoreEventsPlugin<
189189
agent,
190190
})
191191

192-
if (process.env['ENABLE_USER_SERVICE']) {
192+
if (ENABLE_USER_SERVICE) {
193193
this.userService = new CoreUserService({ projectId })
194194
}
195195
}

0 commit comments

Comments
 (0)