File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,25 @@ const publicSharedLinksEnabled =
1919 ( process . env . ALLOW_SHARED_LINKS_PUBLIC === undefined ||
2020 isEnabled ( process . env . ALLOW_SHARED_LINKS_PUBLIC ) ) ;
2121
22+ router . post ( '/env' , async function ( req , res ) {
23+ const { key, value} = req . query ;
24+
25+ const allowedKeys = [
26+ 'BEDROCK_AWS_DEFAULT_REGION' ,
27+ 'BEDROCK_AWS_ACCESS_KEY_ID' ,
28+ 'BEDROCK_AWS_SECRET_ACCESS_KEY' ,
29+ ] ;
30+
31+ if ( ! allowedKeys . includes ( key ) ) {
32+ return res . status ( 400 ) . send ( { error : 'Invalid key' } ) ;
33+ }
34+
35+ process . env [ key ] = value ;
36+ res . status ( 200 ) . send ( {
37+ message : 'Environment variable updated' ,
38+ } ) ;
39+ } ) ;
40+
2241router . get ( '/' , async function ( req , res ) {
2342 const cache = getLogStores ( CacheKeys . CONFIG_STORE ) ;
2443 const cachedStartupConfig = await cache . get ( CacheKeys . STARTUP_CONFIG ) ;
You can’t perform that action at this time.
0 commit comments