Releases: labring/laf
v1.0.0-beta.14
Security Upgrades
CVE Fixed: https://nvd.nist.gov/vuln/detail/CVE-2023-48225
Updates
Simple cloud storage API
import cloud from '@lafjs/cloud'
export default async function (ctx: FunctionContext) {
// get bucket
const bucket = cloud.storage.bucket('cloud-bin')
// create file
await bucket.writeFile('test.html', 'hello, laf', { ContentType: 'text/html' })
// read file
const res = await bucket.readFile('test.html')
console.log(await res.Body.transformToString())
// list files
const result = await bucket.listFiles()
console.log(result.Contents)
// delete file
await bucket.deleteFile('test.html')
return { data: 'hi, laf' }
}
Support npm packages caching
The newly added support for node modules caching includes:
- The npm dependencies added by the application are automatically packaged and cached in the cloud-bin bucket. (
node_modules.tar
) - This effectively improves the speed of application startup.
- A cloud-bin bucket is automatically created when the application starts.
Support offline dependencies installation mode
(runtime)
To support offline dependencies installation mode
:
- Add
LF_NODE_MODULES_CACHE=always
environment variable to your application - Upload your
node_modules.tar
to{appid}-cloud-bin
bucket manually
Then the runtime would skip npm install
command, and use node_modules.tar
instead.
Seperate the custom npm packages from built-in's
You can add npm packages which has different version with built-in packages in runtime.
Logging & monitor optimization and some bug fixes
- Upgrade node 18 to node 20 of runtime
- Fix
ObjectId
problem in laf web database management
check the change logs.
What's Changed
- fix(web): fix app monitor longest array by @newfish-cmyk in #1682
- chore(server): update default resource request of runtime pod by @maslow in #1686
- fix(runtime): upgrade node to v20 to fix importModuleDynamic bug by @maslow in #1687
- fix(runtime): object check by @bestlyg in #1684
- fix(server): add field whitelist for validation by @0fatal in #1692
- chore: harmonise lint configuration by @0fatal in #1688
- chore: lint the remaining codes by @0fatal in #1693
- chore: update readme wechat link by @newfish-cmyk in #1700
- feat(server): Add a consolidated multi-pod, multi-container log query by @HUAHUAI23 in #1689
- feat(web): support consolidated multi-pod, multi-container log query by @newfish-cmyk in #1691
- feat(server): support request-limit ratio conf of runtime resource in region by @maslow in #1702
- chore(build): update github workflows to build images for pr events by @maslow in #1705
- chore: fix workflow pr check error by @maslow in #1706
- fix(runtime): fix module.exports error; fix logs error while response.chunkedEncoding is true by @maslow in #1707
- fix(runtime): fix process.env hot reload by @maslow in #1709
- feat(runtime): detach custom dependency, support node_module caching by @skyoct in #1658
- fix(runtime): fix cloud sdk cannot initialize in custom deps module by @maslow in #1711
- feat(runtime): support relative path import of fn by @maslow in #1712
- fix(web): function return shows when not undefined & update current function after edit name by @newfish-cmyk in #1713
- doc: sync features with beta 13 updates by @nightwhite in #1678
- doc: delete expired content by @nightwhite in #1716
- fix(server): fix get_client_ip method, use x-forwarded-fro first by @maslow in #1717
- doc: deprecated the interceptor fn without next method by @maslow in #1720
- chore(runtime): update cloud sdk version in runtime by @maslow in #1721
- fix(web): cannot update database record with ObjectId #1524 by @maslow in #1723
- fix(server): fix runtime logging interface not authenticated by @HUAHUAI23 in #1725
- feat(cli): cli support env by @skyoct in #1718
- fix(server): Fix logging interface error return by @HUAHUAI23 in #1727
- feat(runtime): add cloud.storage api in cloud sdk by @maslow in #1729
- feat(cloud-sdk): add url api to cloud sdk by @maslow in #1732
- fix(web): jsonviewer support to render large data by @newfish-cmyk in #1731
- doc: opt db-ql documents by @yenche123 in #1726
- fix(services): Changing exporter penalty rules by @HUAHUAI23 in #1733
- refactor(cloud-sdk): refacct readFile returns in cloud-sdk by @maslow in #1734
- refactor(cloud-sdk): refactor listFiles paramsof cloud sdk by @maslow in #1735
- refactor(db-proxy): refactor accessor constructor in database-proxy, add objectid type as global in runtime; by @maslow in #1738
- feat(runtime): support LF_NODE_MODULES_CACHE to control if offline deps installation by @maslow in #1743
- fix(cli): fix cli env command description by @skyoct in #1742
- chore(web): fix styles & optimize tips & add running cancel by @newfish-cmyk in #1740
- chore(ci): add digest for images of the pr by @0fatal in #1736
New Contributors
Full Changelog: v1.0.0-beta.13...v1.0.0-beta.14
Migration Guides
Update laf-server & laf-web images:
# upgrade laf SERVER
kubectl set image deployments/laf-server -n laf-system \
laf-server=docker.io/lafyun/laf-server:1.0.0-beta.14
# upgrade laf WEB
kubectl set image deployments/laf-web -n laf-system \
laf-web=docker.io/lafyun/laf-web:1.0.0-beta.14
Update sys_db.Runtime
to upgrade runtime images in MongoDb
use sys_db
// runtime version
const version = "1.0.0-beta.14"
const main_image = `docker.io/lafyun/runtime-node:${version}`
const init_image = `docker.io/lafyun/runtime-node:${version}`
db.Runtime.updateOne({ latest: true }, {
$set: {
version: version,
image: {
main: main_image,
init: init_image
}
}
})
db.Runtime.find().pretty()
v1.0.0-beta.13
Intro
Performance Enhanced
In this version, we have restructured the cloud function runtime, enhancing the execution performance of cloud functions by over 400%, HTTP request QPS by more than 300% (with CPU usage savings of over 200% under the same concurrency), and Websocket long connection performance by over 500%.
New logger implementent of runtime
Additionally, we have restructured the function log implementation, now directly using Runtime Pod log streams, which supports real-time log viewing and beautification of log formats.
New billing & monitoring implement of application
We have also rewritten application resource monitoring and metered billing, enabling laf in the sealos user namespace to support resource monitoring and metered billing functions.
What's Changed
- fix(web): fix add index bug by @0fatal in #1626
- feat(web): footer add 'about us' page by @newfish-cmyk in #1622
- feat(runtime): refactor log console & enable module cache by @skyoct in #1618
- fix(web): fix upload file entry 100 items limit by @newfish-cmyk in #1629
- fix(runtime): fix DISABLE_MODULE_CACHE condition error by @maslow in #1630
- feat(web): add pods logs modal by @newfish-cmyk in #1634
- feat(server): add pod log interface by @HUAHUAI23 in #1631
- fix(web): fix inner html with LogViewer by @newfish-cmyk in #1636
- feat(runtime): beautify runtime log format by @maslow in #1637
- fix(web): log viewer line height and fontsize by @newfish-cmyk in #1639
- styles(web): fix logs date & adjust logs modal font family by @newfish-cmyk in #1641
- chore: add LOG_DEPTH conf to runtime, beautify log format by @maslow in #1642
- style(web): change log modal style by @0fatal in #1643
- style(web): change log modal style by @0fatal in #1644
- fix(web): fix wrap of log amended by @0fatal in #1645
- feat(exporter): add runtime exporter by @HUAHUAI23 in #1619
- refactor(server): get metering data of billing from prometheus by @0fatal in #1628
- refactor(server): refactor billing by @0fatal in #1648
- refactor(web): handle large header data by @newfish-cmyk in #1649
- chore(web): refactor log req/resp header by @0fatal in #1651
- chore(runtime): use gzip+base64 encode debug request header instead of uri encode by @maslow in #1652
- fix(runtime): fix interceptor main func error by @skyoct in #1638
- chore(server): handle get metering data error by @0fatal in #1650
- refactor(log-server): remove old log server by @0fatal in #1655
- chore(server): add labels to ingress resources by @maslow in #1656
- refactor(web): change old logs position by @newfish-cmyk in #1661
- fix(web): fix pages without logs by @newfish-cmyk in #1662
- fix(services): Fix metrics data caching issue by @HUAHUAI23 in #1663
- fix(services): fix runtime exporter metrics data caching issue by @HUAHUAI23 in #1664
- fix(server): fix billing miss on old app by @0fatal in #1659
- fix(server): fix billing miss on old app by @0fatal in #1666
- chore(server): enhance billing loop when app stop -> start by @0fatal in #1667
- refactor(runtime): refactor the cloud function engine by @maslow in #1668
- refactor(server): use record rules to enhance billing performance by @0fatal in #1671
- feat(web): cpu and memory monitor support "all" option by @newfish-cmyk in #1670
- fix(server): fix get metering data miss quota by @0fatal in #1673
- fix(web): fix mergeArrays function by @newfish-cmyk in #1672
- fix(web): fix padding array with front and end by @newfish-cmyk in #1675
- refactor(web): hide selection when only one pod by @newfish-cmyk in #1676
Full Changelog: v1.0.0-beta.12...v1.0.0-beta.13
Migration Guides
Update laf-server & laf-web images:
# upgrade laf SERVER
kubectl set image deployments/laf-server -n laf-system \
laf-server=docker.io/lafyun/laf-server:1.0.0-beta.13
# upgrade laf WEB
kubectl set image deployments/laf-web -n laf-system \
laf-web=docker.io/lafyun/laf-web:1.0.0-beta.13
Update sys_db.Runtime
to upgrade runtime images in MongoDb
use sys_db
// runtime version
const version = "1.0.0-beta.13"
const main_image = `docker.io/lafyun/runtime-node:${version}`
const init_image = `docker.io/lafyun/runtime-node:${version}`
db.Runtime.updateOne({ latest: true }, {
$set: {
version: version,
image: {
main: main_image,
init: init_image
}
}
})
db.Runtime.find().pretty()
Restart all Running applications by update sys_db.Application
in MongoDb
use sys_db
db.Application.updateMany({ state: 'Running' }, {
$set: {
state: 'Restarting'
}
})
Enabling Resource Monitoring
This version of Laf uses a specialized runtime exporter for runtime resource metrics collection, so you will need to install the runtime exporter into the cluster to enable resource monitoring
kubectl apply --namespace=laf-system -f - <<EOF
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/name: runtime-exporter
name: runtime-exporter
spec:
ports:
- name: http
port: 2342
protocol: TCP
targetPort: http
selector:
app.kubernetes.io/name: runtime-exporter
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/name: runtime-exporter
name: runtime-exporter
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: runtime-exporter
template:
metadata:
labels:
app.kubernetes.io/name: runtime-exporter
spec:
automountServiceAccountToken: true
serviceAccountName: laf-server # It's the same as the laf server's sa.
securityContext: {}
containers:
- image: docker.io/lafyun/runtime-exporter:latest
imagePullPolicy: Always
name: runtime-exporter
ports:
- name: http
containerPort: 2342
protocol: TCP
livenessProbe:
httpGet:
path: /healthz
port: http
readinessProbe:
httpGet:
path: /healthz
port: http
env:
- name: API_SECRET
value: "fafafafa"
- name: NAMESPACE
value: "laf-system" # Depends on the namespace of the runtime.
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
app.kubernetes.io/name: runtime-exporter
release: prometheus
name: runtime-exporter
spec:
endpoints:
- interval: 60s
path: "/runtime/metrics/fafafafa" # fafafafa is consistent with the runtime exporter's environment variable API_SECRET
scrapeTimeout: 10s
honorLabels: true
namespaceSelector:
matchNames:
- laf-system # Depends on the namespace of the runtime exporter.
selector:
matchLabels:
app.kubernetes.io/name: runtime-exporter
---
# Application billing rules
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
labels:
app.kubernetes.io/name: runtime-exporter
release: prometheus
name: prometheus-laf-billing.rules
spec:
groups:
- name: prometheus-laf-billing.rules
interval: 60s
rules:
- record: laf:billing:cpu
expr: max_over_time(sum by (appid) (laf_runtime_cpu_limit{container!=""})[1h:])
- record: laf:billing:memory
expr: max_over_time(sum by (appid) (laf_runtime_memory_limit{container!=""})[1h:])
EOF
v1.0.0-beta.12
What's Changed
- fix(server): fix user quota by @HUAHUAI23 in #1534
- fix(web): fix params not update & change function list type by @newfish-cmyk in #1535
- refactor(web): adjust editor fontsize & optimize function create modal by @newfish-cmyk in #1533
- feat(web): add client settings & change settings directory by @newfish-cmyk in #1536
- refactor(web): change function list & revert create function by @newfish-cmyk in #1537
- fix(web): fix files can't be accessed before refreshing & change file path by @newfish-cmyk in #1538
- feat(cli): support database export and import by @skyoct in #1540
- fix(web): fix create function default code by @newfish-cmyk in #1544
- fix(web): fix style in npm deps list area (#1546) by @yuedanlabs in #1547
- feat(web): add function list desc-name display & fix editor min-h by @newfish-cmyk in #1545
- feat(server): add runtime affinity settings in region by @HUAHUAI23 in #1548
- feat(runtime): reuse context by @skyoct in #1539
- Add auto-compact of apisix-etcd. by @zzjin in #1551
- fix(build): minio console ingress enable websocket by @Itswag in #1555
- fix(web): fix function list folder name display by @newfish-cmyk in #1561
- feat(runtime): proxy cloud storage request to minio by @0fatal in #1560
- feat(gateway): refactor gateway to support ingress by @maslow in #1559
- chore(build): optimize installation sequence by @nightwhite in #1556
- fix(runtime): fix compile error by @maslow in #1563
- fix(server): fix nest deps missing by @maslow in #1564
- fix(gateway): fix cors headers conf of runtime; fix ingress nginx installation by @maslow in #1565
- chore(deploy): fix ingress-nginx image name typo by @maslow in #1566
- fix(server) solving function template sorting problems by @HUAHUAI23 in #1568
- feat(server): add tls config for ingress gateway by @maslow in #1569
- chore(web): add sentry by @0fatal in #1570
- chore(ci): set ci getsentry working directory by @0fatal in #1571
- feat: optimize ctx data definition by @nightwhite in #1558
- doc: fix Cloud function introduction document path error by @nightwhite in #1575
- doc: optimizing Cloud Function naming document by @nightwhite in #1576
- doc: added a tips for appid in cloud storage by @nightwhite in #1573
- doc: add cloud sdk attribute introduction by @nightwhite in #1572
- doc: fix error about ctx.env by @nightwhite in #1574
- feat(web): support github login by @newfish-cmyk in #1543
- feat(server): support github login by @0fatal in #1542
- feat(server): runtime add sealos manager labels by @HUAHUAI23 in #1577
- fix(server): fix app restart not reapply service by @HUAHUAI23 in #1578
- fix(web): disable navigate cache for api endpoint by @0fatal in #1579
- fix(web): fix sign up navigate & storage display by @newfish-cmyk in #1580
- refactor(web): add template page state & optimize use template & fix app restart by @newfish-cmyk in #1554
- fix(server): fixed runtime labels by @HUAHUAI23 in #1583
- chore: remove custom storage class, use default sc; by @maslow in #1584
- fix(server) fix runtime deployment labels by @HUAHUAI23 in #1585
- fix(web): fix sentry allowlist by @0fatal in #1587
- doc: Instructions for modifying cloud function logs by @nightwhite in #1589
- doc: update env.md by @spaceoi in #1582
- feat(cli): improve the cli interface by @nightwhite in #1591
- fix(runtime): fix db stream initialize by @0fatal in #1592
- chore(server): remove minio sts by @HUAHUAI23 in #1593
- refactor(web): cloud storage use ak/sk instead of sts by @newfish-cmyk in #1581
- fix(web): remove storage.credential by @newfish-cmyk in #1594
- feat(runtime): refactor function engine by @skyoct in #1590
- chore(server): remove minio version control by @HUAHUAI23 in #1595
- fix(runtime): fix update function not effective by @skyoct in #1597
- chore(ci): update dockerize-web.yml by @0fatal in #1601
- feat(runtime): support default function by @skyoct in #1602
- fix(runtime): enable cors in runtime; disable cors in gateway ingress by @maslow in #1603
- fix(runtime): default close module cache by @skyoct in #1604
- chore(build): change prometheus url by @0fatal in #1605
- fix(web): fix edit bucket name display by @newfish-cmyk in #1606
- fix(runtime): fix runtime cors options by @maslow in #1607
- fix(cli): fix app init error by @nightwhite in #1608
- fix(cli): fix update func bug by @nightwhite in #1610
- fix(cli): storage server api changed for cli by @nightwhite in #1609
- refactor(gateway): refactor logics of ingress deletion by @maslow in #1612
- fix(server): set deleting phase when deleting app by @0fatal in #1613
- feat: Cors added Access-Control-Max-Age by @nightwhite in #1615
- fix(server): update logic of cronjob deletion by @maslow in #1623
- feat(web&sdk): add index manage by @0fatal in #1611
- chore: remove husky from laf-web by @maslow in #1624
New Contributors
- @zzjin made their first contribution in #1551
- @Itswag made their first contribution in #1555
- @spaceoi made their first contribution in #1582
Full Changelog: v1.0.0-beta.11...v1.0.0-beta.12
Migration Guides
Update laf-server & laf-web images:
# upgrade laf SERVER
kubectl set image deployments/laf-server -n laf-system \
laf-server=docker.io/lafyun/laf-server:1.0.0-beta.12
# upgrade laf WEB
kubectl set image deployments/laf-web -n laf-system \
laf-web=docker.io/lafyun/laf-web:1.0.0-beta.12
Update sys_db
to upgrade runtime images
// runtime version
const version = "1.0.0-beta.12"
// const version = "1.0.0-beta.12"
const main_image = `docker.io/lafyun/runtime-node:${version}`
const init_image = `docker.io/lafyun/runtime-node:${version}`
db.Runtime.updateOne({ latest: true }, {
$set: {
version: version,
image: {
main: main_image,
init: init_image
}
}
})
db.Runtime.find().pretty()
Update sys_db.Region
if you still use apisix gateway:
Deprecated: apisix gateway is deprecated in laf, will not be supported in future.
use sys_db
db.Region.updateOne({}, {
$set: {
namespaceConf: {
mode: 'appid',
prefix: '',
fixed: ''
},
'gatewayConf.tls.wildcardCertificateSecretName': null,
'gatewayConf.driver': 'apisix'
}
})
Migrate apisix gateway to nginx ingress gateway:
First stop all laf applications by update sys_db
:
use sys_db;
db.Application.updateMany({ state: 'Running' }, {
$set: {
state: 'Stopped',
_restart_flag: 'migration-gateway'
}
})
Waiting for all application stopped.
# stop laf-server
kubectl scale deployment laf-server -n laf-system --replicas=0
# uninstall apisix
helm delete apisix --namespace laf-system
sealos run docker.io/labring/ingress-nginx:v1.8.1 \
-e HELM_OPTS="-n ingress-nginx --set controller.hostNetwork=true --set controller.kind=DaemonSet --set controller.service.enabled=false"
kubectl create namespace laf-runtime
use sys_db
db.Region.updateOne({}, {
$set: {
namespaceConf: {
mode: 'fixed',
prefix: '',
fixed: 'laf-runtime'
},
'gatewayConf.tls.wildcardCertificateSecretName': '',
'gatewayConf.driver': 'nginx'
}
})
# start laf-s...
v1.0.0-beta.11
What's Changed
- Change the delete IconText color to red and completion the error color by @imyuanx in #1387
- feat(server): add random username for phone signup by @HUAHUAI23 in #1394
- fix(server): change giftcode dto string length by @HUAHUAI23 in #1397
- refactor(server): add template user infomation by @HUAHUAI23 in #1395
- refactor(web): use react-hook-form & modify styles & add laf-ai apply button by @newfish-cmyk in #1392
- feat(server): replace current logging solution with log server by @0fatal in #1381
- fix(web): fix reset phone smscode type by @newfish-cmyk in #1402
- feat(server): add recycle bin by @HUAHUAI23 in #1396
- feat(web): add functions recycle bin by @newfish-cmyk in #1398
- fix(server): fix function template user information display by @HUAHUAI23 in #1405
- feat(cli): add options for laf dep command by @bingtsingw in #1408
- fix(web): fix display issue when username does not exist by @newfish-cmyk in #1411
- feat(web): Increase the clickable area of the button by @seewhy163 in #1406
- feat(web): optimize the state of app by @imyuanx in #1403
- feat(web): add the pointer style for CopyText by @imyuanx in #1404
- refactor(web): optimize create function & function template component by @newfish-cmyk in #1416
- feat(web): add functions list folder by @newfish-cmyk in #1414
- fix(log-server): miss log for request_id required by @0fatal in #1421
- feat(web): support binding email by @newfish-cmyk in #1418
- feat(web): add app realeasing status by @newfish-cmyk in #1422
- chore(server): add expired time for gift code by @HUAHUAI23 in #1412
- feat(server): add resource(storage&database) usage limit by @0fatal in #1245
- feat(cli): impl trigger command by @skyoct in #1413
- feat: update laf cluster image to deploy laf in a sealos cluster. by @lingdie in #1419
- fix(web): fix template used by total number & template list query by @newfish-cmyk in #1429
- feat(server): support binding email by @0fatal in #1417
- fix(web): fix drag upload folder by @newfish-cmyk in #1426
- feat(cli): support multi folder & path by @skyoct in #1431
- fix(build): fix minio helm custom commands by @0fatal in #1432
- fix(server): miss dependence by @0fatal in #1433
- chore(ci): rebuild sharp for arm64 and cache node_modules by @0fatal in #1434
- fix(server): fix undefined field
memberOf
of minio user by @0fatal in #1436 - refactor(web): add template category constant & add language and color to statusbar by @newfish-cmyk in #1435
- fix(web): change releasing as app phase by @newfish-cmyk in #1423
- feat(server): Add a global http interceptor by @HUAHUAI23 in #1430
- fix(server): increase the request payload limit by @0fatal in #1437
- chore(log): add env for request payload limit by @0fatal in #1439
- fix(server): relock check of domain tls for too long by @0fatal in #1438
- doc: add oss github action by @0fatal in #1441
- fix(cli): fix cannot read properties baseDir by @skyoct in #1447
- feat(server): support resource group by @0fatal in #1442
- feat(web): support resource group by @newfish-cmyk in #1444
- fix(web): fix invite link http by @newfish-cmyk in #1451
- fix(web): add develop-token to load package by @newfish-cmyk in #1455
- fix(server): reapply hpa and check spec when spec changes by @0fatal in #1452
- fix(server): check app auth by createdBy by @0fatal in #1453
- fix(runtime): function source leakage caused by type hint interface by @maslow in #1454
- fix(web): fix statusbar change app specific display by @newfish-cmyk in #1456
- ci(docs): refactor docs build action by @aFlyBird0 in #1457
- fix(web): fix display when specification not in bundle by @newfish-cmyk in #1458
- fix(server): create default group when check miss by @0fatal in #1459
- fix(web): keep function expanded when making modifications by @newfish-cmyk in #1463
- deploy: add metrics-server by @lingdie in #1462
- feat(runtime): check circular dependency by @skyoct in #1448
- fix(runtime): vm add support for Float32Array #1368 by @HUAHUAI23 in #1470
- fix(cli): fix delete website not found by @skyoct in #1473
- fix(server): update apisix plugin
try-path
conf by @0fatal in #1465 - feat(server): support resource monitor by @0fatal in #1468
- feat(web): support resource monitor by @newfish-cmyk in #1471
- feat(server): add id verify by @HUAHUAI23 in #1449
- feat(web): support real name authentication by @newfish-cmyk in #1450
- ci: laf doc preview during pr by @aFlyBird0 in #1472
- doc: fix quick start add function market & Pilot by @zuoFeng59556 in #1481
- fix(web): fix display when monitor data undefined by @newfish-cmyk in #1482
- fix(build): fix prometheus network policy by @0fatal in #1483
- refactor(web): add initial value to monitor bar width & click open detail by @newfish-cmyk in #1484
- refactor(server): refactor function template by @HUAHUAI23 in #1476
- refactor(web): optimize function template market by @newfish-cmyk in #1475
- fix(server): correct monitor metrics promql by @0fatal in #1485
- chore(build): add pvc for prometheus by @0fatal in #1486
- fix(web): fix pods list data & adjust create function ui by @newfish-cmyk in #1487
- feat: support import/export application db by @0fatal in #1479
- fix(build): fix build of laf mage and change the deployment of metering service by @0fatal in #1488
- fix: fix change stream concurrency reconnect by @skyoct in #1480
- fix(server): fix website hosting routes by @0fatal in #1490
- chore(build): localize prometheus helm charts by @0fatal in #1489
- chore(build): localize prometheus helm charts by @0fatal in #1492
- fix(web): add unavailable page for monitor data & fix link of real name by @newfish-cmyk in #1491
- chore(build): upgrade mongodb exporter by @0fatal in #1493
- doc: fix login example param checking by @kaikaibenkai in #1494
- fix(server): change default interceptor policy by @HUAHUAI23 in #1495
- fix(web): fix usage undefined by @newfish-cmyk in #1496
- refactor(web): adjust ui by @newfish-cmyk in #1497
- fix(server): fix apisix try path routes by @0fatal in #1499
- fix(web): fix monitor bar instant data by @newfish-cmyk in #1500
- fix(web): fix real-name auth by @newfish-cmyk in #1504
- fix(server): change hpa metrics value by @0fatal in #1505
- feat(server): support query instant metrics by @0fatal in #1502
- fix(web): fix monitor data instant undefined by @newfish-cmyk in #1506
- fix(server): no need to validate old phone when phone num miss by @0fatal in #1507
- fix(server): fix bind phone dto by @0fatal in #1509
- feat(web): optimize the list display logic by @kkangert in #1510
- fix(server): bind phone failed by @0fatal in #1511
- fix(web): fix real name auth shown by phone ...
v1.0.0-beta.10
What's Changed
- fix: fix init function invoke error by @skyoct in #1230
- chore: upgrade apisix helm version by @skyoct in #1232
- doc: add documents that accesss AI by @nightwhite in #1215
- chore: update apisix plugins version by @skyoct in #1234
- feat(cli): add error prompt & opt init project by @skyoct in #1235
- fix(server): fix billing task perf problem by @maslow in #1236
- fix(server): improve billing task concurrency by @maslow in #1237
- chore(deploy): fix deploy scripts PROJECT_ROOT error by @geeknonerd in #1238
- feat(web): opt function editor ui by @LeezQ in #1233
- fix(web): tabheight by @LeezQ in #1239
- feat(cli): support specify code directory by @skyoct in #1241
- refactor(server): refactor billing task by @maslow in #1249
- fix(cli): fix remote url end with / by @skyoct in #1251
- doc: add cli switch user method by @nightwhite in #1242
- fix(server): opt billing task schedular cron by @maslow in #1253
- ci: repair push laf doc by @nightwhite in #1252
- fix(server): billing task exit abnormally by @maslow in #1255
- fix(web): balance recharge by @luckyyyyy in #1257
- feat(web): add recharge bonus & autoscaling by @newfish-cmyk in #1263
- feat(web): add function template by @newfish-cmyk in #1264
- feat(server): autoscaling for application by @0fatal in #1250
- feat(server): support charge reward by @0fatal in #1261
- fix(web): hide template by @newfish-cmyk in #1265
- fix(web): change typo storage to memory by @newfish-cmyk in #1266
- fix(web): hide bonus when no bonus by @newfish-cmyk in #1267
- fix(server): fix charge reward calculation error by @0fatal in #1269
- fix(cli): fix function exec error by @skyoct in #1270
- fix(cli): opt func pull command by @skyoct in #1271
- fix(web): fix typo by @newfish-cmyk in #1273
- fix(web): fix recharge display & modal open by @newfish-cmyk in #1274
- fix(server): create hpa when hpa is not found by @0fatal in #1275
- fix(runtime): add mongodb stream reconnect by @skyoct in #1276
- chore(web): fix typo in recharge bonus dlg by @maslow in #1278
- feat(web): add function history & add app darkmode by @newfish-cmyk in #1289
- feat(server): support cloud function history by @0fatal in #1283
- doc: fix a small mistake by @nightwhite in #1285
- doc: fix case problem by @nightwhite in #1286
- doc: del invalid image links by @nightwhite in #1287
- doc: del invalid image links en by @nightwhite in #1288
- fix(server): add sort filter to resource bundle & options by @maslow in #1290
- doc: fix syntax error on jwt token by @nightwhite in #1291
- feat(server): implements cloud function template & templates marketplace by @HUAHUAI23 in #1259
- feat(web):add pagination for storage file list by @CooperHash in #1302
- fix(web): change ui & add infomation display by @newfish-cmyk in #1296
- doc: mongo native writing to await mode by @nightwhite in #1297
- doc: change the LAF API login step in actions by @nightwhite in #1300
- doc: add international English section by @nightwhite in #1308
- fix(runtime): update alipay deps by @juukee in #1306
- doc: change the default url by @nightwhite in #1309
- fix(client-sdk): fix #1282 add polyfill for globalThis by @0fatal in #1295
- fix(web): fix navbar github stars & change bundle billing query by @newfish-cmyk in #1305
- fix(runtime): remove alipay-sdk from runtime by @maslow in #1314
- build(main): add sync image for docker.io/labring by @cuisongliu in #1312
- build(main): add sync image for docker.io/labring by @cuisongliu in #1317
- build(main): add sync image for docker.io/labring by @cuisongliu in #1318
- feat(web): support checking dep detail by jumping to
npmjs
by @0fatal in #1315 - feat(web): support pwa by @0fatal in #1311
- build(main): add bot for laf by @cuisongliu in #1319
- fix(web):fix body params storage by @newfish-cmyk in #1320
- feat(server): add
message
field for AccountChargeReward by @0fatal in #1321 - doc: update Readme by @nightwhite in #1322
- feat(web): add recommend template & change ui by @newfish-cmyk in #1323
- fix(web): reset package list when reopen modal &&
Restarting
->Starting
for app stopped by @0fatal in #1324 - fix(server): sort resource options by created time by @maslow in #1327
- fix(web): fix search query hooks by @newfish-cmyk in #1328
- feat(client-sdk): support taro request by @seewhy163 in #1325
- fix(web): fix ignore case & use template by @newfish-cmyk in #1329
- fix(server): add recommended function templates and limits for function templates by @HUAHUAI23 in #1316
- fix(web): remove casing error direction by @maslow in #1330
- fix(web): fix navigate & func delete & title overflow by @newfish-cmyk in #1331
- fix(server): add length limits for function template name by @HUAHUAI23 in #1333
- fix(server): don't add history when debug function by @0fatal in #1334
- fix(web): fix function template popover by @newfish-cmyk in #1335
- feat(server): support setting custom domain for application by @0fatal in #1310
- feat(web): support setting custom domain for application by @newfish-cmyk in #1338
- build: update client header buffer size for apisix by @maslow in #1341
- refactor(server): separate update of debug info from function update by @0fatal in #1339
- refactor(web): separate update of debug info from function update by @newfish-cmyk in #1340
- fix(web): fix rendering issues when custom domain not exist by @newfish-cmyk in #1342
- feat(web): support function rename by @newfish-cmyk in #1343
- feat(server): support function rename by @HUAHUAI23 in #1336
- fix(server): Fix cross-database issues with function templates by @HUAHUAI23 in #1352
- refactor(web): dashboard entrance text by @LeezQ in #1354
- doc: update ServerDocking.md by @kuangzhibin in #1353
- fix(web):fix header mobile adaptation by @CooperHash in #1351
- feat(cli): app init support schemaOnly by @bingtsingw in #1349
- feat(web): support modifying user info (username, phone, avatar) by @newfish-cmyk in #1356
- feat(server): support modifying user info (username, phone, avatar) by @0fatal in #1355
- feat(web): add balance info at header by @LeezQ in #1359
- fix(web): header width by @LeezQ in #1361
- fix(web): fix toast & bill overflow by @newfish-cmyk in #1362
- fix(cli): get website id by
_id
property by @bingtsingw in #1360 - chore(web): sort bundles with createdAt & add copytext on… by @newfish-cmyk in #1366
- fix(web): auto flush cache from service worker by @0fatal in #1367
- fix(web): storage file list hidden (#1363) by @yuedanlabs in #1364
- fix(web): fix function template darkmode & fix function spacing by @newfish-cmyk in https://gi...
v1.0.0-beta.9
What's Changed
- fix(server): cannot restart stopped app by @maslow in #1129
- feat(web): add laf status link by @LeezQ in #1127
- fix(web): cannot restart stopped app by @LeezQ in #1128
- doc: Update install-on-linux.sh add some install command by @yinzhidong in #1124
- feat(server): add npm install flags to region; opt instance starting perf by @maslow in #1133
- fix(runtime): empty volume mounted error in runtime image by @maslow in #1135
- chore(cli): modify some default templates by @nightwhite in #1136
- feat: VSCode supports automatic introduction of cloud functions. by @nightwhite in #1146
- doc: add depend tips by @nightwhite in #1131
- feat: laf-server support i18n (example) by @aFlyBird0 in #1143
- doc: delete old pic by @nightwhite in #1147
- fix(server): default request ephemeral-storeage error by @maslow in #1149
- fix(server): turn off readOnlyRootFilesystem for runtime by @maslow in #1150
- fix(web): running wouldn't publish code by @newfish-cmyk in #1158
- chore(server): update @lafjs/cloud runtime version by @nightwhite in #1152
- feat(web): add signup with invitecode by @newfish-cmyk in #1144
- doc: add 3min wechat example by @nightwhite in #1161
- doc: add two cloud function example by @nightwhite in #1134
- doc: fix wrong format by @nightwhite in #1164
- feat(web): add invitecode to homepage and login by @newfish-cmyk in #1170
- refactor(cli): refactor cli structure by @skyoct in #1166
- feat(web): add function fetch button by @newfish-cmyk in #1163
- fix(cli): fix ignore file by @skyoct in #1174
- feat(cli): add base deploy by @skyoct in #1176
- fix(web): fix function template's indentation by @newfish-cmyk in #1182
- feat(server): add metered billing module, remove subscription module, discard Prisma by @maslow in #1187
- fix(server): fix server dockerfile error; web merge conflict by @maslow in #1188
- fix(server): IResponse type def error by @maslow in #1189
- build: fix laf-server image build slowly by @maslow in #1191
- fix(server): add trial bundle checks in updating application by @maslow in #1192
- feat(cli): add website deploy by @skyoct in #1190
- fix(server): update resource price to 0 in initializer by @maslow in #1193
- fix(web): pat copy missed by @LeezQ in #1194
- fix(server): creating website report not found error by @maslow in #1198
- fix(server): update billings get api; add createdby to billing schema by @maslow in #1197
- fix(server): Fix invitation code signup issue by @HUAHUAI23 in #1201
- fix(server): rename limit to pageSize in func log api by @maslow in #1202
- feat(web): billing page by @LeezQ in #1195
- feat(runtime): support multi-level uri of cloud function by @maslow in #1203
- fix(web): balance value error in cost center page by @maslow in #1204
- fix web balance by @maslow in #1205
- fix(web): fix function name regx error by @maslow in #1206
- fix(web): app env & price show by @LeezQ in #1207
- feat(web): cloud functions support multi-level url by @newfish-cmyk in #1208
- fix(web): Remove billingQuery from useEffect dependencies by @newfish-cmyk in #1209
- feat(cli): compatible with new apis by @skyoct in #1211
- refactor(web): price free show by @LeezQ in #1214
- fix(web): adjust editor tips being obscured and some other style problems by @luckyyyyy in #1179
- fix(server): fix billing task concurrency overflow by @maslow in #1216
- fix(web): fix fetch button zh name and width by @newfish-cmyk in #1217
- feat(server): support website history by @skyoct in #1210
- chore(build): seperate deploy and build dir by @maslow in #1219
- chore(deploy): fix deploy scripts path error by @maslow in #1220
- feat(web): add laf ai chat by @LeezQ in #1221
- feat(web): update laf ai request url by @LeezQ in #1223
- fix(web): fix deploy would clear params by @newfish-cmyk in #1224
- refactor(server): refactor auth api(profile/pat) by @maslow in #1226
- fix(web): fix /v1/profile api url missing by @maslow in #1227
- feat(runtime): add chatgpt package builtin runtime by @maslow in #1228
New Contributors
- @luckyyyyy made their first contribution in #1179
Full Changelog: v1.0.0-beta.8...v1.0.0-beta.9
Key Points
- laf has implemented a new measuring and billing mechanism. #1187
- remove prisma in laf server
- support history mode route in websitehosting
- support multiple-level url for cloud function
- add laf ai polit
Migration Guides
Upgrade the server and web image version:
run this in your master node to upgrade laf-server & laf-web
kubectl set image deployments/laf-server -n laf-system \
laf-server=docker.io/lafyun/laf-server:1.0.0-beta.9
kubectl set image deployments/laf-web -n laf-system \
laf-web=docker.io/lafyun/laf-web:1.0.0-beta.9
To support new billing mechanism, you should add a new field to Application
collection in system database.
run this in your mongodb shell.
use sys_db;
db.Application.updateMany({}, {
$set: {
billingLockedAt: new Date('1970-01-01T00:00:00.000Z')
}
})
To support multi-level url path in cloud function:
run this in your mongodb shell to upgrade runtime version
use sys_db;
// runtime version
const version = "1.0.0-beta.9"
const main_image = `docker.io/lafyun/runtime-node:${version}`
const init_image = `docker.io/lafyun/runtime-node-init:${version}`
db.Runtime.updateOne({ latest: true }, {
$set: {
version: version,
image: {
main: main_image,
init: init_image
}
}
})
db.Runtime.find().pretty()
Add new environment to laf-server deployments:
kubectl edit deployment/laf-server -n laf-system
env:
- name: METERING_DATABASE_URL
value: >-
mongodb://your-root-user:your-password@mongo-cluster-rs0-0.mongo-cluster-rs0.default.svc.cluster.local:27017/sealos-resources?authSource=admin&replicaSet=rs0&w=majority
v1.0.0-beta.8
What's Changed
- doc: Chinese and English formatization by @nightwhite in #1082
- ci(e2e): wait api route in apisix ready by @aFlyBird0 in #1083
- doc: add database aggregate and operator by @nightwhite in #1084
- perf(web): change upload folder to upload folder's files by @newfish-cmyk in #1087
- fix(web): fix bodyparams height by @newfish-cmyk in #1101
- doc: added cloud storage subsequent documents and optimization documents overall structure by @nightwhite in #1099
- doc: fix uniapp use client sdk example by @nightwhite in #1100
- doc: fix the error about H5 call SDK by @nightwhite in #1110
- doc: fix docs typos by @haijie-x in #1102
- ci: modify yarn installation to npm by @nightwhite in #1106
- feat(web): add link copy in oss page by @LeezQ in #1108
- feat(web): hide phone number info by @LeezQ in #1111
- fix(client-sdk): fix bugs in compiling uniapp into WeChat mini programs by @nightwhite in #1105
- doc: add web-ide page and VS Code plugin documentation, and adjust the documentation structure by @nightwhite in #1109
- feat(web): add function params storage by @newfish-cmyk in #1113
- doc: modify the default format of the cloud function by @nightwhite in #1114
- doc: abandon the old environment variable method by @nightwhite in #1116
- chore(deploy): update deploy scripts by @maslow in #1117
- docs(web): change discord link by @LeezQ in #1118
- feat(server): support deployment rolling update by @skyoct in #1112
- fix(server): fix cronService does exist by @skyoct in #1120
- doc: fix env error by @nightwhite in #1119
- chore(build): remove runtime image from cluster image by @maslow in #1122
- doc: fix getOne error by @nightwhite in #1123
- feat(server): add site setting api by @maslow in #1125
- feat(web): add laf site setting config by @LeezQ in #1126
New Contributors
Full Changelog: v1.0.0-beta.7...v1.0.0-beta.8
v1.0.0-beta.7
What's Changed
- feat: add laf new homepage by @LeezQ in #1018
- fix: compress img by @LeezQ in #1019
- doc: fix logo and link by @zuoFeng59556 in #1021
- fix: route dashboard link by @LeezQ in #1020
- fix(deploy): modify the installation order of APISIX by @nightwhite in #1022
- fix(web): copywriting description by @LeezQ in #1025
- docs: update how to use the database by @Otto-J in #1032
- fix(web): Repair document link address by @nightwhite in #1027
- doc: fix image and add http by @zuoFeng59556 in #1031
- feat(cli): add ignore file by @nightwhite in #1030
- feat(web): use laf ai to generate code by @LeezQ in #1029
- doc: fix function-in-client url error by @zuoFeng59556 in #1037
- feat: update @lafjs/cloud runtime version by @nightwhite in #1039
- fix: optimize invoke code prompts and documents by @nightwhite in #1038
- feat(web): common error handler by @LeezQ in #1040
- fix(server): suspend cronjob after instance stopped by @maslow in #1045
- feat(web): add homepage darkmode by @newfish-cmyk in #1043
- fix(web): add scrollbar by @newfish-cmyk in #1046
- feat(web): delete folder in storage (#1047) by @yuedanlabs in #1048
- fix(server): avoid acct-trans addition in free order by @maslow in #1049
- fix(cli): fix cli with function name rule and add laf-cli option to bug_issues template (#1034) by @yuedanlabs in #1035
- doc: improved cloud function related documents by @nightwhite in #1050
- doc: add document for the interceptor by @nightwhite in #1051
- feat(web): add ChatGPT example by @zuoFeng59556 in #1052
- feat(server): add func debug params, add envs update api by @maslow in #1055
- doc: optimize cloud function document && add document search function by @nightwhite in #1057
- refactor(web): update env modify modal by @LeezQ in #1058
- fix(web): opt ide typings for response & request, opt function templates by @maslow in #1059
- refactor(web): editor scrollbar & colorMode fix by @LeezQ in #1061
- doc: optimize the search button style && add database quickstart by @nightwhite in #1062
- doc: change start button name by @nightwhite in #1064
- fix(server): check env name regex for batch update by @maslow in #1065
- fix(server): remove minio alias init by @maslow in #1066
- ci: init e2e(check deployment and app create) by @aFlyBird0 in #1056
- ci: report broken links as an issue by @aFlyBird0 in #1060
- doc: database document optimization and hosting document optimization by @nightwhite in #1068
- feat(web): add status bar by @newfish-cmyk in #1054
- feat(web): add loginpage darkmode by @newfish-cmyk in #1070
- fix(web): common error handler by @LeezQ in #1071
- fix(runtime): fix func logging order by @maslow in #1072
- fix(server): use _id to sort logs instead of created_at by @maslow in #1073
- feat(runtime): support process.env in runtime by @maslow in #1074
- fix(server): fix waiting time in instance starting task by @maslow in #1075
- doc: optimize cloud function documents and database documents by @nightwhite in #1076
- feat(server): hot load environments for runtime instead of restarting runtime by @maslow in #1077
- feat(web): update environment variables without app restart by @maslow in #1079
- feat(runtime): add init hook in runtime by @maslow in #1081
New Contributors
- @Otto-J made their first contribution in #1032
- @newfish-cmyk made their first contribution in #1043
Full Changelog: v1.0.0-beta.6...v1.0.0-beta.7
Upgrade Guide
run this in your master node to upgrade laf-server & laf-web
kubectl set image deployments/laf-server -n laf-system \
laf-server=docker.io/lafyun/laf-server:1.0.0-beta.7
kubectl set image deployments/laf-web -n laf-system \
laf-web=docker.io/lafyun/laf-web:1.0.0-beta.7
run this in your mongodb shell to upgrade runtime version
use sys_db;
// runtime version
const version = "1.0.0-beta.7"
const main_image = `docker.io/lafyun/runtime-node:${version}`
const init_image = `docker.io/lafyun/runtime-node-init:${version}`
db.Runtime.updateOne({ latest: true }, {
$set: {
version: version,
image: {
main: main_image,
init: init_image
}
}
})
db.Runtime.find().pretty()
``
v1.0.0-beta.6
What's Changed
- chore(deploy): remove casdoor charts by @maslow in #954
- feat(server): support website custom domain ssl cert auto-gen by @maslow in #956
- fix(server): fixed the error of repeatedly deleting website routes by @maslow in #957
- feat(server): add check if password had binded by @sulnong in #951
- refactor(web): optimize the tag selection by @LeezQ in #955
- feat: fix login bg && add welcome text by @walle233 in #941
- doc: add db query by @zuoFeng59556 in #958
- fix(server): add website count limit, opt website task by @maslow in #959
- fix(deploy): upgrade minio version to fix CVE-2023-28432 by @maslow in #960
- fix(web): add types for ctx.request by @maslow in #963
- fix(server): error on deleting cronjob; app stucked in starting by @maslow in #964
- fix(server): fixed illegal removal of unowned trigger by @maslow in #965
- feat(web): reset password by @walle233 in #974
- doc: add website hosting and laf-cli by @zuoFeng59556 in #972
- fix(server): rm minio alias init in boot, fix multi region limit; by @maslow in #976
- feat(web): generate function code with AI prompt by @LeezQ in #978
- fix(web): remove withCredentials by @LeezQ in #979
- fix(server): cancel namespace removal while stopping app by @maslow in #980
- fix(server): bucket deletion didn't remove related website by @maslow in #983
- feat(server): add notes field to region,bundle,pay,auth by @maslow in #986
- fix(server): fix tasks state handler logic by @maslow in #987
- fix(server): fix instance task error by @maslow in #988
- style(web): Responsive styles for home page by @yuedanlabs in #985
- fix(server): add existing check in creating phase of tasks by @maslow in #990
- refactor(web): sort tailwind css classname by @LeezQ in #989
- doc: fix laf-cli and add websocket doc by @zuoFeng59556 in #991
- feat(web): add bundle note messages by @LeezQ in #992
- fix(server): return notes fields in region & bundles by @maslow in #993
- fix: phone register(web) by @walle233 in #994
- fix(web): fixed the path issue when clicking pathlink(#995) by @RicardoErii in #996
- fix(server): check site deleting state in site creation by @maslow in #997
- feat(web): add region info on logo by @LeezQ in #1001
- feat(web): format code on save by @LeezQ in #1002
- doc: update image and add cli-mind websocket laf client sdk by @zuoFeng59556 in #1004
- fix: fix app url protocol error & update default url by @skyoct in #1006
- feat: feat app list display by @skyoct in #1007
- chore(deploy): optimize install-on-linux.sh by @bxy4543 in #1010
- fix(web): appid confict if open 2 tabs by @LeezQ in #1011
- feat(server): add account transaction by @maslow in #1014
- chore: sealos does not support pulling multiple cluster images by @bxy4543 in #1016
- feat(runtime): impl cloud function import and cache function by @skyoct in #1005
- fix(server): check website hosting in bucket deletion, add error handle to tasks; by @maslow in #1017
New Contributors
- @yuedanlabs made their first contribution in #985
- @RicardoErii made their first contribution in #996
- @bxy4543 made their first contribution in #1010
Full Changelog: v1.0.0-beta.5...v1.0.0-beta.6
Upgrade Guide
kubectl set image deployments/laf-server -n laf-system \
laf-server=docker.io/lafyun/laf-server:1.0.0-beta.6
kubectl set image deployments/laf-web -n laf-system \
laf-web=docker.io/lafyun/laf-web:1.0.0-beta.6
! Urgent Security Upgrade
It is crucial to update your Minio version to RELEASE.2023-03-22T06-36-24Z
in order to address the critical vulnerability CVE-2023-28432
New Configurations
To support auto-ssl-cert for website hosting, run this in your master node
kubectl apply -f - <<EOF
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: laf-issuer
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: [email protected]
privateKeySecretRef:
name: letsencrypt-prod
solvers:
- http01:
ingress:
class: apisix
EOF
v1.0.0-beta.5
What's Changed
- fix(cli): fix axios config by @skyoct in #881
- fix(web): fix MoreButton tooltip and npm package deletion confirm tip by @genie88 in #879
- feat(cli): cli invoke function support parameters (#842) by @genie88 in #884
- fix(cli): remove private npm mirror and replace AxiosRequestConfig to any by @skyoct in #886
- feat(cli): init app support sync data by @skyoct in #895
- feat(cli): rename name.meta.yaml to name.yaml by @skyoct in #893
- fix(cli): fix publish package ignore file by @skyoct in #899
- feat(web): add dark mode support (#891) by @genie88 in #900
- fix(README): add chatGPT example by @zuoFeng59556 in #902
- feat(subscription): impl subscription and account by @maslow in #894
- feat(web): add subscription and wechat pay by @LeezQ in #904
- feat(docs): add quick start todo by @zuoFeng59556 in #907
- fix(server): add max renewal time in bundle; fix subscription price by @maslow in #908
- doc: fix login example by @zuoFeng59556 in #911
- chore(server): add sub field to find app api by @maslow in #913
- refactor subscription dialog experience by @LeezQ in #914
- fix(web): fix some dark mode ui bugs by @genie88 in #919
- feat(cli): upgrade s3 sdk version by @skyoct in #922
- refactor(web): upgrade icon by @LeezQ in #915
- fix(server): fix bucket name regex by @maslow in #924
- feat(server): add limit to update app state depends on subscription state by @maslow in #925
- chore: remove contrib docs of laf web by @maslow in #927
- feat(server): new authentication implements by @sulnong in #897
- feat(web): impl new signup & signin method by @walle233 in #910
- fix(server): change password signup phone filed to optional by @sulnong in #934
- fix: web signup phone err by @walle233 in #935
- fix: auth i18n english too long by @walle233 in #936
- fix(server): fix init auth provider params by @maslow in #937
- fix: sign up provider err by @walle233 in #938
- doc: add cli README.md by @skyoct in #921
- fix(server): deal with existed app without namespace by @maslow in #943
- fix(web): update data use merge mode by @LeezQ in #940
- fix(server): add regex for environment name by @maslow in #944
- fix(server): stuck-starting instance blocked the task handler by @maslow in #945
- doc: add function param and data query by @zuoFeng59556 in #948
- refactor(web): updrage npm dependencies by @LeezQ in #950
New Contributors
Full Changelog: v1.0.0-beta.4...v1.0.0-beta.5
Migration points
Update Key Points
- Add and adjust bundle fields
- Subscription module
- Account module
- WeChat payment service
- Improve multiple-region support
Breaks Changes
-
Database: Bundle schema changes
- add
limitCountPerUser
field - remove
resource.limitCountPerUser
field - add
subscriptionOptions
field - add
resource.reservedTimeAfterExpired
field - add
maxRenewalTime
field - remove
specialPrice
andprice
field
-
Operations
db.Bundle.updateMany({}, { $set: { limitCountPerUser: 1, maxRenewalTime: 3888000, subscriptionOptions: [ { "name": "monthly", "displayName": "1 Month", "duration": 2678400, "price": 0, "specialPrice": 0 } ], "resource.reservedTimeAfterExpired": 2678400 } })
- add
-
Database: ApplicationBundle schema changes
- remove
resource.limitCountPerUser
field - add
resource.reservedTimeAfterExpired
field - add
bundleId
field
-
Operations
db.ApplicationBundle.updateMany({}, { $set: { "resource.reservedTimeAfterExpired": 2678400, bundleId: new ObjectId("6405ffe6103ead6d468b1a17"), } })
- remove
-
Database: Region schema changes
- add
storageConf.controlEndpoint
field - add
databaseConf.controlConnectionUri
field
- add
-
API: remove
POST /v1/applications
- use
POST /v1/subscriptions
instead
- use
-
API: remove
DELETE /v1/applications/:appid
- use
DELETE v1/subscriptions
instead
- use
-
Database: Add Subscriptions for existed applications
- expiredAt set to 1 month in future
-
Operations
// write cloud function to insert subscriptions import cloud from '@lafjs/cloud' import { MongoClient, ObjectId, Db } from 'mongodb' const sys_db_uri = cloud.env.SYS_DB_URI // set your existed bundle id const bundleId = new ObjectId('6407200ca35fb4d684296d5c') export async function main(ctx: FunctionContext) { const client = new MongoClient(sys_db_uri) await client.connect() const db = client.db('sys_db') const apps = await db.collection('Application') .find() .toArray() for(let app of apps) { const res = await addSubscription(db, app, bundleId) console.log(app.appid, res) } return { data: 'hi, laf' } } async function addSubscription(db: Db, app: any, bundleId: ObjectId) { const sub = { "bundleId": bundleId, "appid": app.appid, "state": "Created", "phase": "Valid", "renewalPlan": "Manual", "expiredAt": new Date('2023-12-31T00:00:00.733Z'), "lockedAt": new Date('1970-01-01T00:00:00.000Z'), "createdAt": new Date(), "updatedAt": new Date(), "createdBy": app.createdBy, "input": { "name": app.name, "state": app.state, "regionId": app.regionId, "runtimeId": app.runtimeId } } return await db.collection('Subscription').insertOne(sub) }
New Configrations
Config phone auth provider
db.AuthProvider.updateOne({ name: "phone" }, {
$set: {
state: "Enabled",
"config.alisms": {
"accessKeyId": "",
"accessKeySecret": "",
"api_entrypoint": "https://dysmsapi.aliyuncs.com",
"signName": "",
"templateCode": "SMS_000004"
}
}
})
Add Wechat payment channel
// db.PaymentChannel.find().pretty()
db.PaymentChannel.insertOne({
type: "WeChat",
name: "WeChat Pay",
spec: {
mchid: "",
appid: "",
apiV3Key: "",
certificateSerialNumber: "",
privateKey: "-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----",
publicKey: "----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"
},
state: "Active",
createdAt: new Date(),
updatedAt: new Date()
})