Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 40 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,23 @@ SERVER_HEALTH="Healthy"
HLAMBDA_ADMIN_SECRET=""

# Constant reference in code: ENV_HLAMBDA_DISABLE_ADMIN_SECRET | Default value: false
# Is master password for API management enabled or disabled.
# Disables or enables master password for API management.
HLAMBDA_DISABLE_ADMIN_SECRET="false"

# Constant reference in code: ENV_HLAMBDA_DISABLE_CONSOLE | Default value: false
# Is master password for API management enabled or disabled.
# Completely disables Console and Console API thus any metadata update.
HLAMBDA_DISABLE_CONSOLE="false"

# Constant reference in code: ENV_HLAMBDA_DISABLE_INITIAL_ROUTE_REDIRECT | Default value: false
# Disable 301 redirect from the root path to the `/console`.
HLAMBDA_DISABLE_INITIAL_ROUTE_REDIRECT="false"

# Constant reference in code: ENV_HLAMBDA_METADATA_RELOAD_DEBOUNCE_MS | Default value: 1331
# Debounce ms time to wait before closing the server and reloading metadata.
HLAMBDA_METADATA_RELOAD_DEBOUNCE_MS="1331"

# Constant reference in code: ENV_HLAMBDA_LOADED_APPS_PREFIX | Default value: /api/v1/
# Debounce ms time to wait before closing the server and reloading metadata.
# Prefix used for all the loaded router apps.
HLAMBDA_LOADED_APPS_PREFIX="/api/v1/"

# Constant reference in code: ENV_HLAMBDA_ENABLE_PUBLIC_SWAGGER | Default value: false
Expand All @@ -60,5 +64,37 @@ HLAMBDA_ENABLE_PUBLIC_SWAGGER="false"

# Constant reference in code: ENV_HLAMBDA_PUBLIC_SWAGGER_ROUTE | Default value: /docs
# Flag to map swagger route, default `/docs`.
HLAMBDA_ENABLE_PUBLIC_SWAGGER="/docs"
HLAMBDA_PUBLIC_SWAGGER_ROUTE="/docs"

# Constant reference in code: ENV_HLAMBDA_CONFIGURATION_LOADER_PREFIX | Default value: hlambda-config.yaml
# Sets the value for the name of the configuration file that will be loaded.
HLAMBDA_CONFIGURATION_LOADER_PREFIX="hlambda-config.yaml"

# Constant reference in code: ENV_HLAMBDA_EXPRESS_LOADER_PREFIX | Default value: router.
# Sets the value for the prefix of the router files that will be loaded.
HLAMBDA_EXPRESS_LOADER_PREFIX="router."

# Constant reference in code: ENV_HLAMBDA_ENTRYPOINT_LOADER_PREFIX | Default value: entrypoint.
# Sets the value for the prefix of the entrypoint files that will be loaded.
HLAMBDA_ENTRYPOINT_LOADER_PREFIX="entrypoint."

# Constant reference in code: ENV_HLAMBDA_ENABLE_ENVIRONMENT_BANNER | Default value: false
# Enables environment banner.
HLAMBDA_ENABLE_ENVIRONMENT_BANNER="false"

# Constant reference in code: ENV_HLAMBDA_ENVIRONMENT_BANNER_NAME | Default value:
# Sets name to the environment banner.
HLAMBDA_ENVIRONMENT_BANNER_NAME=""

# Constant reference in code: ENV_HLAMBDA_ENVIRONMENT_BANNER_MESSAGE | Default value:
# Sets message to the environment banner.
HLAMBDA_ENVIRONMENT_BANNER_MESSAGE=""

# Constant reference in code: ENV_HLAMBDA_ENABLE_ENVIRONMENT_BANNER_COLOR | Default value: #FF0000
# Selects color of the environment banner.
HLAMBDA_ENABLE_ENVIRONMENT_BANNER_COLOR="#FF0000"

# Constant reference in code: ENV_HLAMBDA_LIST_OF_PROTECTED_ENV_VARIABLES | Default value: ENV_HLAMBDA_LIST_OF_PROTECTED_ENV_VARIABLES,HLAMBDA_DISABLE_CONSOLE,HLAMBDA_ADMIN_SECRET
# List of the env variable names that are protected from hlambda config override.
HLAMBDA_LIST_OF_PROTECTED_ENV_VARIABLES="ENV_HLAMBDA_LIST_OF_PROTECTED_ENV_VARIABLES,HLAMBDA_DISABLE_CONSOLE,HLAMBDA_ADMIN_SECRET"

2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
]
},
"parserOptions": {
"ecmaVersion": 2020,
"ecmaVersion": 2022,
"sourceType": "module",
"ecmaFeatures": {}
},
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ watcher_trigger/

# development
metadata_tmp/

.DS_Store
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM node:16.13.1-alpine3.14
FROM node:lts-alpine3.15

RUN apk -U upgrade \
&& apk add --no-cache \
git \
openssh
git \
openssh

RUN mkdir -p /usr/src/app

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Hlambda (/hlæmdə/; hλ;)
# Hlambda (/hlæmdə/; hλ;) [Hyper Lambda]

## What is Hlambda (/hlæmdə/)
## What is Hlambda (/hlæmdə/) [Hyper Lambda]

Hlambda is ECMAScript meta API service. That means that it offers simple ways to deploy ECMAScript code to local or remote servers.

Expand Down Expand Up @@ -52,7 +52,7 @@ Exporting errors in hlambda if imported can also cause it to not be visible in t

Until addressed this has a simple hotfix to just remove that package from the list of dependencies in your hlambda app, before applying metadata.

## NOTICE
## Notice

```
Any contributions are greatly appreciated.
Expand Down
5 changes: 5 additions & 0 deletions metadata/apps/bad-app/router.auth.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/*
// Uncomment this file to test how Hlambda handles bad code with errors.

import express from 'express';
import asyncHandler from 'express-async-handler';

Expand All @@ -22,3 +25,5 @@ router.get(
aaa;

export default router;

*/
2 changes: 2 additions & 0 deletions metadata/apps/example_demo_app/hlambda-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ env:
HASURA_GRAPHQL_ADMIN_SECRET: "hlambda-test"
YES: "yes"
HAHAH: "YooY"
HLAMBDA_DISABLE_CONSOLE: "false"
envForce:
HASURA_GRAPHQL_API_ENDPOINT: "http://graphql-engine:8099/v1/graphql"
HASURA_GRAPHQL_ADMIN_SECRET: "realpassword"
SPECIAL_PASSWORD: "realpz"
HLAMBDA_DISABLE_CONSOLE: "false"
28 changes: 21 additions & 7 deletions metadata/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion metadata/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"type": "module",
"dependencies": {
"lodash": "^4.17.21",
"luxon": "^2.2.0",
"luxon": "^2.4.0",
"node-forge": "^1.3.1",
"uuid": "^8.3.2"
}
}
Loading