Skip to content

Commit

Permalink
环境初始化
Browse files Browse the repository at this point in the history
  • Loading branch information
lizheng-steedos committed Dec 15, 2023
1 parent bb74f10 commit 739852a
Show file tree
Hide file tree
Showing 19 changed files with 543 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
PORT=5000
ROOT_URL=http://127.0.0.1:5000
TRANSPORTER=redis://127.0.0.1:6379
CACHER=redis://127.0.0.1:6379/1
MONGO_URL=mongodb://127.0.0.1:27017/steedos
MONGO_OPLOG_URL=mongodb://127.0.0.1:27017/local

STEEDOS_CFS_STORE=local
STEEDOS_STORAGE_DIR=./storage

# 身份验证
STEEDOS_TENANT_ENABLE_PASSWORD_LOGIN=true
STEEDOS_TENANT_TOKEN_SECRET=

# 启用云端初始化向导
STEEDOS_TENANT_ENABLE_ACTIVATION=true

# 绑定华炎云账户
STEEDOS_CLOUD_API_KEY=
STEEDOS_CLOUD_SPACE_ID=

# vscode 代码同步
METADATA_SERVER=
METADATA_APIKEY=

STEEDOS_IDENTITY_OIDC_ENABLED=true
STEEDOS_IDENTITY_OIDC_ISSUER=https://id.steedos.cn/realms/master
STEEDOS_IDENTITY_OIDC_CONFIG_URL=https://id.steedos.cn/realms/master/.well-known/openid-configuration
STEEDOS_IDENTITY_OIDC_CLIENT_ID=steedos-oidc-public
STEEDOS_IDENTITY_OIDC_CLIENT_SECRET=none
STEEDOS_IDENTITY_OIDC_NAME=Steedos ID

# 初始安装的软件包
STEEDOS_INITIAL_PACKAGES=

STEEDOS_IDENTITY_JWT_ENABLED=true
STEEDOS_IDENTITY_JWT_SECRET=steedos

# Steedos DXP
STEEDOS_ROOT_URL=
STEEDOS_EXPERIENCE_URL=
STEEDOS_EXPERIENCE_PORT=3100

DEVELOPER_STANDARD_OBJECTS=true

# 启用SaaS模式,SaaS运行模式下,禁止安装软件包、创建自定义对象。
STEEDOS_TENANT_ENABLE_SAAS=false
STEEDOS_TENANT_MASTER_ID=
STEEDOS_TENANT_ENABLE_REGISTER=true
STEEDOS_TENANT_ENABLE_CREATE_TENANT=true

STEEDOS_LICENSE=8353b1c47341d8097c3a51a59bd683bf0392690922d4488a3461c0b57fb19a2c33a96b92f7f18a077d2f55211ceb17b4e551829d3772256f3cf940e9bd1f1428c178eac265c231a59a012fe6931e6e3bfe9fe783e9a0bcd833bbc89e30acf55358697657cee237b19626e1f7490d1003be9fbfdb3b0669be3598e105eff5a4737f52d634d158a1ebbb2dd15bacbefed8c4895864d8a5a65cba49387b7eda4a9d823ad7e5e031dd421b29775c86e0ca9f8f2a10dcc6009f97664f44e5e787571a8589102e9a3acd6c9275db5360044a5077457fd0e46a7fa685984ee092ca564558b50f9d023321abecf4a4a9e37b0117ba8fe921d9868545a15e0f1eb8ee03647921446b4e73c443afed31af808c9ee55e9c071b448a0518455e3cdf405ff4dbd848df8f589b35163b4a708b3e931e3db7e07da16d2b677fd11defe581c9bf5bd9961b11b01e629385dafde979577dd7a15de2ac89ca46a6d9ff5156c4c9bb813958474a6dc0079999121bc9aff517d0bf3d5b369583f990b12e1f9e8c153bec4f8ff2da8ed2128e4c62456812a56dd7fb30d550813e79c5a7d0a113ba822895d32a72989edc72bd8dca64eb2f2c13c66af5c1fd7b6080c1246e3a5a72919d74495784290f2d2dcaaaa95dd1f973011f4d5d558dcf13b74a51a2b7fbc5ed0227ecf84668d3b31feb49a598788545b917e08926ecb30f7c1b491cc955fe89d6eba21d30397e51a7b2e17ed31f4cb0df3dc9ca0e4f4253d5e9a554c029916f2afb3f1cbabdf64183fb45da7b6d173e4d814f5fa4716b18c3681287b0463d25e95a3c5ba53efe69ba28ed777a80d58bcd1ae4a51b37089d7d420b9cfaab2eaf9bf90a89adb7aaa1791862cf460fc33403e754789fe01abf19a756fe1842491cfe837292e5a4327f9786ea0698ecfe974f2367b03b96fea007ce1661bca2e47e1841f9fa32a05a7682aeddd91594689abddb13d46beaab11fedd733fd5a17429ed343ddec550c885c6cd7e74ae853cc608d09f1ac4640ccb6163fc18c8e91b24bbdb66c87e7fe70d260a18b8b0338b9cfa4ccad0f98e304377a1a5d9e7c1332112b2,2022-0001

# 对象流程队列的轮询间隔(单位毫秒)
STEEDOS_CRON_INSTANCERECORDQUEUE_INTERVAL=10000

# 百度发票识别、验真(@steedos-labs/invoice)
STEEDOS_LABS_INVOICE_BAIDU_AK=
STEEDOS_LABS_INVOICE_BAIDU_SK=

#考勤模块-月度结算考勤记录
STEEDOS_CRON_ATTENDANCE_MONTHLY_SETTLEMENT='* * 3 1 0/1 *'

#考勤模块-每日考勤结算记录
STEEDOS_CRON_ATTENDANCE_DAILY_SETTLEMENT='0 0 0 * * *'
122 changes: 122 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
# .env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
.env.local

storage

docker-volumes

.DS_Store
.steedos
*.rdb

# *.lock

.node-red
.backup

db

stacks
46 changes: 46 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
image: ecr.aws.steedos.cn/dockerhub/steedos/gitpod-workspace-base:2.2.5

# List the ports you want to expose and what to do when they are served. See https://www.gitpod.io/docs/config-ports/
ports:
- port: 5000
onOpen: ignore
visibility: public
- port: 3000
onOpen: ignore
visibility: public
- port: 3100
onOpen: open-browser
visibility: public
- port: 6379
onOpen: ignore
- port: 4222
onOpen: ignore
- port: 27017
onOpen: ignore
- port: 1880 # node-red-app
onOpen: ignore
visibility: public
- port: 80
onOpen: ignore
visibility: public
# List the start up tasks. You can start them in parallel in multiple terminals. See https://www.gitpod.io/docs/config-start-tasks/
tasks:
- name: Steedos Platform
command: |
cd steedos-platform
echo "ROOT_URL=$(gp url 5000)" >> .env.local
docker-compose up
- name: Steedos Packages
command: |
echo "METADATA_SERVER=$(gp url 5000)" >> .env.local
yarn
gp await-port 5000
yarn dev
vscode:
extensions:
- dbaeumer.vscode-eslint
- redhat.vscode-yaml
- steedos.steedosdx-vscode
- steedos.steedosdx-vscode-core
- ms-ceintl.vscode-language-pack-zh-hans
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmmirror.com
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmmirror.com
1 change: 1 addition & 0 deletions docker/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
21 changes: 21 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM node:14-slim

RUN apt-get update || : && apt-get install -y \
python \
curl \
build-essential

# RUN npm install -g typescript ts-node

WORKDIR /app

COPY ../package.json .
COPY ../lerna.json .
COPY ../steedos.config.js .
COPY ../steedos-packages-hr ./steedos-packages-hr
COPY ../steedos-packages-oa ./steedos-packages-oa
COPY ../steedos-packages-pm ./steedos-packages-pm

RUN yarn --production && yarn cache clean

CMD ["yarn", "dev"]
13 changes: 13 additions & 0 deletions docker/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
export APPS_VERSION=2.6.0
echo "#########################################################################"
echo "steedos apps version: ${APPS_VERSION}"
echo "#########################################################################"

docker-compose build --no-cache \
--build-arg ARCH=amd64 \
--build-arg NODE_VERSION=14 \
--build-arg OS=alpine3.12 \
--build-arg BUILD_DATE="$(date +"%Y-%m-%dT%H:%M:%SZ")"

docker tag steedos/steedos-apps:latest steedos/steedos-apps:${APPS_VERSION}
37 changes: 37 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: "3.9"

services:
steedos-enterprise:
image: steedos/steedos-enterprise:latest
container_name: steedos-enterprise
ports:
- "80:80"
- "443:443"
- "9001:9001"
environment:
- ROOT_URL=http://127.0.0.1
- TRANSPORTER=redis://redis:6379
- CACHER=redis://redis:6379/1
- STEEDOS_LOG_LEVEL=info
- NPM_REGISTRY_URL=https://registry.npmmirror.com
tty: true
volumes:
- "./storage:/steedos-storage"
depends_on:
redis:
condition: service_started
steedos-apps:
build:
context: ../
dockerfile: ./docker/Dockerfile
image: steedos/steedos-apps:latest
container_name: steedos-apps
environment:
- TRANSPORTER=redis://redis:6379
- CACHER=redis://redis:6379/1
depends_on:
redis:
condition: service_started
redis:
image: ecr.aws.steedos.cn/dockerhub/redis:6.2
command: "redis-server --save \"\" --appendonly no --loglevel warning"
8 changes: 8 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"packages": [
"steedos-packages-expense/*"
],
"useNx": false,
"version": "2.6.0",
"npmClient": "yarn"
}
33 changes: 33 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "project-ee",
"version": "0.0.1",
"private": true,
"workspaces": [
"steedos-packages-expense/*"
],
"scripts": {
"start": "./node_modules/moleculer/bin/moleculer-runner.js {steedos-packages-hr,steedos-packages-oa,steedos-packages-pm}/*/package.service.js --config steedos.config.js",
"dev": "ts-node ./node_modules/moleculer/bin/moleculer-runner.js {steedos-packages-hr,steedos-packages-oa,steedos-packages-pm}/*/src/index.{js,ts} --config steedos.config.js --hot --repl",
"repl": "moleculer-runner --repl --config steedos.config.js",
"bootstrap": "lerna clean --yes && lerna bootstrap",
"build": "lerna run build",
"npm:login": "npm login --registry https://registry.npmjs.org",
"version:latest": "yarn build && lerna version --force-publish --exact",
"publish:latest": "lerna publish from-package --registry https://registry.npmjs.org",
"version:beta": "yarn build && lerna version prerelease --preid beta --force-publish --exact",
"publish:beta": "lerna publish from-package --registry https://registry.npmjs.org --dist-tag beta",
"sync_to_npmmirror": "lerna exec --no-private -- npx cnpm sync \\$LERNA_PACKAGE_NAME"
},
"dependencies": {
"@steedos/service-package-loader": "^2.6.2-beta.13",
"dotenv-flow": "^3.2.0",
"moleculer": "^0.14.31",
"ts-node": "^10.9.1",
"typescript": "^4.9.3"
},
"devDependencies": {
"lerna": "^5.4.0",
"moleculer-repl": "^0.7.4",
"ts-jest": "^29.0.3"
}
}
Binary file added steedos-packages-expense/.DS_Store
Binary file not shown.
13 changes: 13 additions & 0 deletions steedos-platform/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# https://docs.steedos.com/deploy/steedos-config

PORT=5000
ROOT_URL=http://127.0.0.1:5000
TRANSPORTER=redis://127.0.0.1:6379
CACHER=redis://127.0.0.1:6379/1
MONGO_URL=mongodb://127.0.0.1:27017/steedos
MONGO_OPLOG_URL=mongodb://127.0.0.1:27017/local

STEEDOS_STORAGE_DIR=./steedos-storage

# 对象流程队列的轮询间隔(单位毫秒)
STEEDOS_CRON_INSTANCERECORDQUEUE_INTERVAL=10000
Loading

0 comments on commit 739852a

Please sign in to comment.