Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Oct 12, 2023
2 parents c74dc66 + eceeb4b commit 3bb7118
Show file tree
Hide file tree
Showing 124 changed files with 749 additions and 486 deletions.
31 changes: 30 additions & 1 deletion creator/packages/steedos-creator/client/views/amis_action.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: baozhoutao@steedos.com
* @Date: 2022-09-06 11:54:55
* @LastEditors: baozhoutao@steedos.com
* @LastEditTime: 2023-08-23 09:57:34
* @LastEditTime: 2023-10-10 10:50:02
* @Description:
*/
const normalizeLink = (to, location = window.location) => {
Expand Down Expand Up @@ -100,6 +100,35 @@ const getEvn = ()=>{
} else {
FlowRouter.go(to);
}
},
requestAdaptor: (config)=>{
// url是相对路径
if(config.url && (!/^http[s]?:\/\//i.test(config.url))){
if(Meteor.isCordova){
config.url = Meteor.absoluteUrl(config.url)
}

if(!config.headers){
config.headers = {}
}

if(!config.headers.Authorization && Builder.settings.context && Builder.settings.context.tenantId && Builder.settings.context.authToken){
config.headers.Authorization = `Bearer ${Builder.settings.context.tenantId},${Builder.settings.context.authToken}`;
}
}else if(config.url && Meteor.isCordova && Builder.settings.context && Builder.settings.context.rootUrl && config.url.startsWith(Builder.settings.context.rootUrl)){
// 是绝对路径,且是cordova环境, 且以root url开头, 则自动处理认证
if(Meteor.isCordova){
if(!config.headers){
config.headers = {}
}

if(!config.headers.Authorization && Builder.settings.context && Builder.settings.context.tenantId && Builder.settings.context.authToken){
config.headers.Authorization = `Bearer ${Builder.settings.context.tenantId},${Builder.settings.context.authToken}`;
}
}
}
console.log('env.requestAdaptor=action==', config);
return config;
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion creator/packages/steedos-formbuilder/lib/transform.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ getFormFieldOptions = (field)->
else
default_value = []
_.each options, (option)->
if _.contains(default_value, option)
itemValue = option
if option.indexOf(':') > -1
itemValue = option.split(':')[1]
if _.contains(default_value, itemValue)
values.push {label: option, value: option, selected: true}
else
values.push {label: option, value: option}
Expand Down Expand Up @@ -130,6 +133,8 @@ Creator.formBuilder.transformFormFieldsOut = (fields)->
if ['radio-group', 'select'].includes(field.type)
field.default_value = (_.find field.values, (v)->
return v.selected)?.label
if field.default_value && field.default_value.indexOf(':') > -1
field.default_value = field.default_value.split(':')[1];
if ['checkbox-group'].includes(field.type)
field.default_value = (_.pluck (_.filter field.values, (v)->
return v.selected
Expand Down
16 changes: 16 additions & 0 deletions deploy/cluster/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Initial Steedos Packages
STEEDOS_INITIAL_PACKAGES=

# Secrets
MINIO_ROOT_USER=steedos
MINIO_ROOT_PASSWORD=steedos123
MINIO_DEFAULT_BUCKETS=steedos
MONGODB_ROOT_PASSWORD=steedos
MONGODB_DATABASE=steedos
MONGODB_REPLICA_SET_NAME=steedos
MONGODB_REPLICA_SET_KEY=steedos
REDIS_PASSWORD=steedos
NATS_USERNAME=steedos
NATS_PASSWORD=steedos
NODE_RED_USERNAME=steedos
NODE_RED_PASSWORD=steedos
43 changes: 43 additions & 0 deletions deploy/cluster/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Steedos Enterprise Edition

## Getting Started

### Setup environment variables

```
cp .env.sample .env
```

### Start Services

```
docker-compose up
```

### Stop Services

```
docker-compose down
```

## Data Backup

https://docs.docker.com/storage/volumes/#backup-restore-or-migrate-data-volumes

## Data Clean

Clean all data.

```
docker-compose down
docker volume rm steedos-enterprise_steedos-minio-data
docker volume rm steedos-enterprise_steedos-mongodb-data
```

## Connect to MongoDB Cluster

vi /etc/hosts

```
127.0.0.1 mongodb-primary mongodb-secondary mongodb-arbiter
```
120 changes: 96 additions & 24 deletions deploy/cluster/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,50 +13,122 @@ services:
- 8080:80

steedos:
image: steedos/steedos-enterprise:2.5.15-beta.12
scale: 2
image: steedos/steedos-enterprise:2.5
deploy:
mode: replicated
replicas: 2
environment:
- MONGO_URL=mongodb://mongodb:27017/steedos
- MONGO_OPLOG_URL=mongodb://mongodb:27017/local
- STEEDOS_LICENSE=trial
- MONGO_URL=mongodb://root:${MONGODB_ROOT_PASSWORD}@mongodb-primary,mongodb-secondary/${MONGODB_DATABASE}?authSource=admin
- MONGO_OPLOG_URL=mongodb://root:${MONGODB_ROOT_PASSWORD}@mongodb-primary:27017/local?authSource=admin
- STEEDOS_CFS_STORE=S3
- STEEDOS_CFS_AWS_S3_ENDPOINT=http://minio:9000
- STEEDOS_CFS_AWS_S3_FORCE_PATH_STYLE=true
- STEEDOS_CFS_AWS_S3_BUCKET=${MINIO_DEFAULT_BUCKETS:-steedos}
- STEEDOS_CFS_AWS_S3_ACCESS_KEY_ID=${MINIO_ROOT_USER}
- STEEDOS_CFS_AWS_S3_SECRET_ACCESS_KEY=${MINIO_ROOT_PASSWORD}
volumes:
- "./stacks:/steedos-stacks"
- "steedos-storage:/steedos-storage"
tty: true
depends_on:
mongodb:
mongodb-primary:
condition: service_healthy

steedos-cron:
image: steedos/steedos-enterprise:2.5.15-beta.10
image: steedos/steedos-enterprise:2.5
environment:
- MONGO_URL=mongodb://mongodb:27017/steedos
- MONGO_OPLOG_URL=mongodb://mongodb:27017/local
- STEEDOS_LICENSE=trial
- MONGO_URL=mongodb://root:${MONGODB_ROOT_PASSWORD}@mongodb-primary,mongodb-secondary/${MONGODB_DATABASE}?authSource=admin
- MONGO_OPLOG_URL=mongodb://root:${MONGODB_ROOT_PASSWORD}@mongodb-primary:27017/local?authSource=admin
- STEEDOS_CFS_STORE=S3
- STEEDOS_CFS_AWS_S3_ENDPOINT=http://minio:9000
- STEEDOS_CFS_AWS_S3_FORCE_PATH_STYLE=true
- STEEDOS_CFS_AWS_S3_BUCKET=${MINIO_DEFAULT_BUCKETS:-steedos}
- STEEDOS_CFS_AWS_S3_ACCESS_KEY_ID=${MINIO_ROOT_USER}
- STEEDOS_CFS_AWS_S3_SECRET_ACCESS_KEY=${MINIO_ROOT_PASSWORD}
- STEEDOS_CRON=true
volumes:
- "./stacks:/steedos-stacks"
- "steedos-storage:/steedos-storage"
tty: true
depends_on:
mongodb:
mongodb-primary:
condition: service_healthy

mongodb:
image: mongo:4.4

# Database Service Cluster
mongodb-primary:
image: 'bitnami/mongodb:4.4'
ports:
- 27017:27017
command: "--bind_ip_all --replSet steedos --logpath /var/log/mongodb/mongod.log"
environment:
- MONGODB_ADVERTISED_HOSTNAME=mongodb-primary
- MONGODB_REPLICA_SET_MODE=primary
- MONGODB_ROOT_PASSWORD=${MONGODB_ROOT_PASSWORD}
- MONGODB_REPLICA_SET_NAME=${MONGODB_REPLICA_SET_NAME}
- MONGODB_REPLICA_SET_KEY=${MONGODB_REPLICA_SET_KEY}
volumes:
- 'steedos-mongo-primary-data:/bitnami'
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongo --quiet | grep 1
test: echo 'rs.status().ok' | mongo admin -u root -p ${MONGODB_PASSWORD:-steedos} --quiet | grep 1
interval: 10s
timeout: 10s
retries: 5
volumes:
- './mongo-data:/data/db'

mongodb-init:
image: mongo:4.4
restart: "no"
mongodb-secondary:
image: 'bitnami/mongodb:4.4'
depends_on:
mongodb:
condition: service_healthy
command: >
mongo --host mongodb:27017 --eval "rs.initiate({ _id: 'steedos', members: [{_id: 0, host: 'mongodb:27017'}]})"
- mongodb-primary
environment:
- MONGODB_ADVERTISED_HOSTNAME=mongodb-secondary
- MONGODB_REPLICA_SET_MODE=secondary
- MONGODB_INITIAL_PRIMARY_HOST=mongodb-primary
- MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017
- MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=${MONGODB_ROOT_PASSWORD}
- MONGODB_REPLICA_SET_NAME=${MONGODB_REPLICA_SET_NAME}
- MONGODB_REPLICA_SET_KEY=${MONGODB_REPLICA_SET_KEY}
healthcheck:
test: echo 'rs.status().ok' | mongo admin -u root -p ${MONGODB_PASSWORD:-steedos} --quiet | grep 1
interval: 10s
timeout: 10s
retries: 5

mongodb-arbiter:
image: 'bitnami/mongodb:4.4'
depends_on:
- mongodb-primary
environment:
- MONGODB_ADVERTISED_HOSTNAME=mongodb-arbiter
- MONGODB_REPLICA_SET_MODE=arbiter
- MONGODB_INITIAL_PRIMARY_HOST=mongodb-primary
- MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017
- MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=${MONGODB_ROOT_PASSWORD}
- ALLOW_EMPTY_PASSWORD=yes
- MONGODB_REPLICA_SET_NAME=${MONGODB_REPLICA_SET_NAME}
- MONGODB_REPLICA_SET_KEY=${MONGODB_REPLICA_SET_KEY}
healthcheck:
test: echo 'rs.status().ok' | mongo admin -u root -p ${MONGODB_PASSWORD:-steedos} --quiet | grep 1
interval: 10s
timeout: 10s
retries: 5

# S3 Storage Service
minio:
image: bitnami/minio
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-steedos}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-steedos123}
MINIO_DEFAULT_BUCKETS: ${MINIO_DEFAULT_BUCKETS:-steedos}
volumes:
- steedos-minio-data:/data
ports:
- "9000:9000"
- "9001:9001"


volumes:
steedos-storage:
driver: local
steedos-minio-data:
driver: local
steedos-mongo-primary-data:
driver: local
10 changes: 5 additions & 5 deletions ee/sso-oidc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@steedos/ee_sso-oidc",
"version": "2.5.16-beta.1",
"version": "2.5.16-beta.2",
"main": "package.service.js",
"scripts": {
"build": "tsc"
Expand All @@ -11,14 +11,14 @@
"access": "public"
},
"dependencies": {
"@steedos/accounts": "2.5.16-beta.1",
"@steedos/objectql": "2.5.16-beta.1",
"@steedos/service-package-loader": "2.5.16-beta.1",
"@steedos/accounts": "2.5.16-beta.2",
"@steedos/objectql": "2.5.16-beta.2",
"@steedos/service-package-loader": "2.5.16-beta.2",
"@techpass/passport-openidconnect": "^0.3.2",
"express": "4.18.1",
"node-fetch": "^2.6.7",
"passport": "^0.6.0",
"request-ip": "^2.2.0"
},
"gitHead": "a49fccb59a464a337093f027f5d5279d738f5570"
"gitHead": "f8b3f647c00f580f9a10547a4a8afec0398bcbe2"
}
4 changes: 2 additions & 2 deletions examples/with-datadog/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "with-datadog",
"version": "2.5.16-beta.1",
"version": "2.5.16-beta.2",
"private": true,
"scripts": {
"start": "steedos start"
},
"dependencies": {
"@steedos/service-community": "2.5.16-beta.1"
"@steedos/service-community": "2.5.16-beta.2"
},
"devDependencies": {
"dd-trace": "3.7.1"
Expand Down
4 changes: 2 additions & 2 deletions examples/with-k6/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "with-k6",
"version": "2.5.16-beta.1",
"version": "2.5.16-beta.2",
"private": true,
"scripts": {
"start": "steedos start",
"k6:graphql": "k6 run -e ROOT_URL=http://127.0.0.1:5000 -e API_KEY=xxx ./.script/test.graphql.js",
"k6:menus": "k6 run -e ROOT_URL=http://127.0.0.1:5100 -e API_KEY=apikey,8FzpeOTInPZcqWeFoCdSEy8s6FDpuITWPz15bIM0kNL ./.script/test.menus.js"
},
"dependencies": {
"@steedos/service-community": "2.5.16-beta.1"
"@steedos/service-community": "2.5.16-beta.2"
},
"devDependencies": {
"dd-trace": "3.7.1"
Expand Down
4 changes: 2 additions & 2 deletions examples/with-postgres/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@steedos-examples/with-postgres",
"version": "2.5.16-beta.1",
"version": "2.5.16-beta.2",
"private": true,
"scripts": {
"start": "steedos start"
},
"dependencies": {
"@steedos/service-community": "2.5.16-beta.1"
"@steedos/service-community": "2.5.16-beta.2"
}
}
4 changes: 2 additions & 2 deletions examples/with-tracing-jaeger/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "with-tracing-jaeger",
"version": "2.5.16-beta.1",
"version": "2.5.16-beta.2",
"private": true,
"scripts": {
"start": "steedos start"
},
"dependencies": {
"@steedos/service-community": "2.5.16-beta.1"
"@steedos/service-community": "2.5.16-beta.2"
},
"devDependencies": {
"jaeger-client": "^3.19.0"
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
],
"useWorkspaces": true,
"npmClient": "yarn",
"version": "2.5.16-beta.1"
"version": "2.5.16-beta.2"
}
Loading

0 comments on commit 3bb7118

Please sign in to comment.