Skip to content

Commit d076757

Browse files
author
Hyper Lambda
authored
Merge pull request #5 from hlambda/release/0.0.8
Release/0.0.8
2 parents 5b5ac2f + be6d73f commit d076757

29 files changed

+206
-84
lines changed

.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ PRIVATE_KEY_CONFIGURATION="__INSERT_YOUR_PRIVATE_KEY_CONFIGURATION__"
3030
# Server max allowed body size from client that express app will support. (Main usecase is Apple Subscription Notifications)
3131
SERVER_BODY_SIZE="2mb"
3232

33+
# Constant reference in code: ENV_HLAMBDA_CORS_DOMAIN | Default value: *
34+
# By default, all CORS requests to the Hlambda server are allowed. To run with more restrictive CORS settings, use this env variable. Example: `https://*.foo.bar.com:8080, http://*.localhost, http://localhost:3000, http://example.com`
35+
HLAMBDA_CORS_DOMAIN="*"
36+
3337
# Constant reference in code: ENV_SERVER_HEALTH | Default value: Healthy
3438
# Server health that can change based on different events "Healthy", "Degraded", "Unhealthy", "Advisory"
3539
SERVER_HEALTH="Healthy"

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# (Future) Release 0.0.9
2+
3+
- undefined :)
4+
5+
# Release 0.0.8
6+
7+
- Added CHANGELOG.md
8+
- Fix issue with serving static content. (Now you can serve static content on root by disabling root redirect to console via HLAMBDA_DISABLE_INITIAL_ROUTE_REDIRECT="true" )
9+
- Add example for the static serving of the content because `__dirname` is not available, `fileURLToPath(import.meta.url);` should be used.
10+
- Add version build number route. (GET /build-number)
11+
- Add timestamp to docker image on build `./image-build-timestamp.txt`
12+
- Add GET /healthz route
13+
- Add CORS env variable `HLAMBDA_CORS_DOMAIN`, by default Hlambda server continues to allow '\*'

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ WORKDIR /usr/src/app
1515
# where available (npm@5+)
1616
COPY package*.json ./
1717

18-
RUN echo "Date: `date`" > ./version.txt
18+
# RUN echo "`date`" > ./image-build-time.txt
19+
RUN echo "`date +%s`" > ./image-build-timestamp.txt
1920

2021
RUN ["npm", "install"]
2122
# If you are building your code for production

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

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

7+
![Hlambda Banner](https://www.hlambda.io/assets/hlambda-logo-dark.png)
8+
79
It is the implementation of the idea to load your ECMAScript code as configuration (metadata). With Hlambda you can easily create a microservice that can load arbitrary code configuration.
810

911
The main use case was to implement a stateless REST microservice that will run Hasura custom actions in a separate container, containing any custom business logic.

docker/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Supported Tags
2+
3+
- `<version>`, `latest`
4+
5+
# Quick reference
6+
7+
- Where to get help: the [Hyper Lambda Discord Server](https://discord.gg/hlambda) or [Stack Overflow](https://stackoverflow.com/questions/tagged/hlambda)
8+
- Where to file issues: https://github.com/hlambda/hlambda-core
9+
- Supported architectures: amd64, arm64
10+
- Where are the docs: https://hlambda.io
11+
12+
# What is Hlambda [Hyper Lambda]
13+
14+
Hlambda is easy to manage, meta ECMAScript API server, with console UI and CLI tool.
15+
16+
Your ECMAScript metadata payload is the configuration of the (Hyper Lambda) Hlambda Server.
17+
18+
![Hlambda Banner](https://www.hlambda.io/assets/hlambda-logo-dark.png)
19+
20+
# How to use this image
21+
22+
### Stand-alone Server
23+
24+
To run Hlambda in docker as a stand-alone server instance you can run:
25+
26+
```
27+
docker run -d -p 8081:1331 --env HLAMBDA_ADMIN_SECRET=demo --name hlambda-server --restart=always -v hlambda_metadata:/usr/src/app/metadata hlambda/hlambda-core:latest
28+
```
29+
30+
This will:
31+
32+
- Run a new container named: hlambda-server
33+
- Run latest hlambda server on host port: 8081
34+
- Set hlambda server admin secret to: `demo`
35+
- Create volume for your metadata named: hlambda_metadata
36+
37+
Hlambda Console will be available at `http://localhost:8081`.
38+
39+
### Docker Compose Stack with [Hasura](https://hasura.io) <3 and Postgres <3
40+
41+
To run Hlambda in docker stack with Postgres and [Hasura](https://hasura.io) you can run:
42+
43+
```
44+
curl https://www.hlambda.io/raw/code/start/docker-compose.yaml -o docker-compose.yaml && docker compose up -d
45+
```
46+
47+
This will:
48+
49+
- Download the docker-compose.yaml file (Warning: please read the contents of the YAML file to understand what you are actually running)
50+
- Run new docker-compose stack
51+
52+
# License
53+
54+
View [license information](https://github.com/hlambda/hlambda-core/blob/master/LICENSE.md) for the software contained in this image.
55+
56+
As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

package-lock.json

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hlambda-core",
3-
"version": "0.0.7",
3+
"version": "0.0.8",
44
"description": "Hlambda core",
55
"type": "module",
66
"main": "src/index.js",
@@ -10,6 +10,9 @@
1010
"build-docker": "docker build -t hlambda-core:hotbuild .",
1111
"docker-build": "docker build -t hlambda-core:hotbuild .",
1212
"docker-build-all": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --push -t hlambda/hlambda-core:latest .",
13+
"run-docker": "docker run -d -p 8082:1331 --env HLAMBDA_ADMIN_SECRET=demo --name hlambda-server-dev --restart=always -v hlambda_metadata_dev:/usr/src/app/metadata hlambda-core:hotbuild",
14+
"docker-run": "npm run run-docker",
15+
"docker-clean": "docker container stop hlambda-server-dev && docker container rm hlambda-server-dev && docker volume rm hlambda_metadata_dev",
1316
"test": "echo \"Error: no test specified\" && exit 1",
1417
"cluster": "npx pm2 start ecosystem.config.js",
1518
"cluster-runtime": "npx pm2-runtime ecosystem.config.js",
@@ -33,7 +36,7 @@
3336
"express-list-endpoints": "^6.0.0",
3437
"figlet": "^1.5.2",
3538
"glob": "^7.2.0",
36-
"hlambda": "^0.0.3",
39+
"hlambda": "^0.0.5",
3740
"lodash": "^4.17.21",
3841
"multer": "^1.4.4",
3942
"output-text-formatter": "^0.0.2",
@@ -50,4 +53,4 @@
5053
"eslint-plugin-prettier": "^4.0.0",
5154
"nodemon": "^2.0.15"
5255
}
53-
}
56+
}

public/console/asset-manifest.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{
22
"files": {
33
"main.css": "/console/static/css/main.d83edd0b.chunk.css",
4-
"main.js": "/console/static/js/main.4216c957.chunk.js",
5-
"main.js.map": "/console/static/js/main.4216c957.chunk.js.map",
6-
"runtime-main.js": "/console/static/js/runtime-main.3af97199.js",
7-
"runtime-main.js.map": "/console/static/js/runtime-main.3af97199.js.map",
4+
"main.js": "/console/static/js/main.23700ad1.chunk.js",
5+
"main.js.map": "/console/static/js/main.23700ad1.chunk.js.map",
6+
"runtime-main.js": "/console/static/js/runtime-main.9674ee8e.js",
7+
"runtime-main.js.map": "/console/static/js/runtime-main.9674ee8e.js.map",
88
"static/css/2.f4c56af9.chunk.css": "/console/static/css/2.f4c56af9.chunk.css",
9-
"static/js/2.f5d9aaf8.chunk.js": "/console/static/js/2.f5d9aaf8.chunk.js",
10-
"static/js/2.f5d9aaf8.chunk.js.map": "/console/static/js/2.f5d9aaf8.chunk.js.map",
11-
"static/js/3.b29c6195.chunk.js": "/console/static/js/3.b29c6195.chunk.js",
12-
"static/js/3.b29c6195.chunk.js.map": "/console/static/js/3.b29c6195.chunk.js.map",
9+
"static/js/2.a9236953.chunk.js": "/console/static/js/2.a9236953.chunk.js",
10+
"static/js/2.a9236953.chunk.js.map": "/console/static/js/2.a9236953.chunk.js.map",
11+
"static/js/3.762d82cf.chunk.js": "/console/static/js/3.762d82cf.chunk.js",
12+
"static/js/3.762d82cf.chunk.js.map": "/console/static/js/3.762d82cf.chunk.js.map",
1313
"index.html": "/console/index.html",
1414
"static/css/2.f4c56af9.chunk.css.map": "/console/static/css/2.f4c56af9.chunk.css.map",
1515
"static/css/main.d83edd0b.chunk.css.map": "/console/static/css/main.d83edd0b.chunk.css.map",
16-
"static/js/2.f5d9aaf8.chunk.js.LICENSE.txt": "/console/static/js/2.f5d9aaf8.chunk.js.LICENSE.txt"
16+
"static/js/2.a9236953.chunk.js.LICENSE.txt": "/console/static/js/2.a9236953.chunk.js.LICENSE.txt"
1717
},
1818
"entrypoints": [
19-
"static/js/runtime-main.3af97199.js",
19+
"static/js/runtime-main.9674ee8e.js",
2020
"static/css/2.f4c56af9.chunk.css",
21-
"static/js/2.f5d9aaf8.chunk.js",
21+
"static/js/2.a9236953.chunk.js",
2222
"static/css/main.d83edd0b.chunk.css",
23-
"static/js/main.4216c957.chunk.js"
23+
"static/js/main.23700ad1.chunk.js"
2424
]
2525
}

public/console/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/console/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/console/logo192.png"/><link rel="manifest" href="/console/manifest.json"/><title>Console</title><link href="/console/static/css/2.f4c56af9.chunk.css" rel="stylesheet"><link href="/console/static/css/main.d83edd0b.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,i,a=r[0],c=r[1],l=r[2],s=0,p=[];s<a.length;s++)i=a[s],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&p.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(r);p.length;)p.shift()();return u.push.apply(u,l||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var c=t[a];0!==o[c]&&(n=!1)}n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={1:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+"static/js/"+({}[e]||e)+"."+{3:"b29c6195"}[e]+".chunk.js"}(e);var c=new Error;u=function(r){a.onerror=a.onload=null,clearTimeout(l);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var l=setTimeout((function(){u({type:"timeout",target:a})}),12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,function(r){return e[r]}.bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="/console/",i.oe=function(e){throw console.error(e),e};var a=this["webpackJsonpfrontend-console"]=this["webpackJsonpfrontend-console"]||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var l=0;l<a.length;l++)r(a[l]);var f=c;t()}([])</script><script src="/console/static/js/2.f5d9aaf8.chunk.js"></script><script src="/console/static/js/main.4216c957.chunk.js"></script></body></html>
1+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/console/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/console/logo192.png"/><link rel="manifest" href="/console/manifest.json"/><title>Console</title><link href="/console/static/css/2.f4c56af9.chunk.css" rel="stylesheet"><link href="/console/static/css/main.d83edd0b.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,i,a=r[0],c=r[1],l=r[2],s=0,p=[];s<a.length;s++)i=a[s],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&p.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(r);p.length;)p.shift()();return u.push.apply(u,l||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var c=t[a];0!==o[c]&&(n=!1)}n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={1:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+"static/js/"+({}[e]||e)+"."+{3:"762d82cf"}[e]+".chunk.js"}(e);var c=new Error;u=function(r){a.onerror=a.onload=null,clearTimeout(l);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var l=setTimeout((function(){u({type:"timeout",target:a})}),12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,function(r){return e[r]}.bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="/console/",i.oe=function(e){throw console.error(e),e};var a=this["webpackJsonpfrontend-console"]=this["webpackJsonpfrontend-console"]||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var l=0;l<a.length;l++)r(a[l]);var f=c;t()}([])</script><script src="/console/static/js/2.a9236953.chunk.js"></script><script src="/console/static/js/main.23700ad1.chunk.js"></script></body></html>

public/console/logo192.png

25.7 KB
Loading

0 commit comments

Comments
 (0)