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 10, 2023
2 parents 81cd03b + 8f1a5ae commit 2d0e612
Show file tree
Hide file tree
Showing 156 changed files with 1,145 additions and 718 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/docker-community.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Docker Community

on:
workflow_run:
workflows: [Release NPM]
types:
- completed
push:
branches:
- 'release/**'

jobs:
docker:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set Current Version
run: |
STEEDOS_VERSION=$(node -p 'require("./lerna.json").version')
echo "STEEDOS_VERSION=${STEEDOS_VERSION}" >> $GITHUB_ENV
echo "STEEDOS_VERSION=${STEEDOS_VERSION}"
- name: Generate info.json
run: |
if [[ -f deploy/enterprise/scripts/generate_info_json.sh ]]; then
deploy/enterprise/scripts/generate_info_json.sh
fi
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
with:
driver-opts: network=host

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
steedos/steedos-community
252208178451.dkr.ecr.cn-northwest-1.amazonaws.com.cn/dockerhub/steedos/steedos-community
tags: |
type=semver,pattern={{version}},value=${{ env.STEEDOS_VERSION }}
type=semver,pattern={{major}}.{{minor}},value=${{ env.STEEDOS_VERSION }}
type=semver,pattern={{major}},value=${{ env.STEEDOS_VERSION }}
- uses: docker/login-action@v1
name: Login Docker Hub
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_NINGXIA }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_NINGXIA }}
aws-region: cn-northwest-1
-
name: Login to ECR
uses: docker/login-action@v2
with:
registry: 252208178451.dkr.ecr.cn-northwest-1.amazonaws.com.cn

- name: Replace Version ~2.5 to Tag
uses: jacobtomlinson/gha-find-replace@v2
with:
include: deploy/docker/app/platform/package.json
find: "~2.5"
replace: ${{env.STEEDOS_VERSION}}
regex: false

- name: Build and push docker
uses: docker/build-push-action@v3
with:
context: ./deploy/docker
platforms: linux/amd64 #,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Release Docker EE
name: Docker Enterprise

on:
workflow_run:
workflows: [Disabled-Release NPM]
workflows: [Release NPM]
types:
- completed
push:
Expand Down Expand Up @@ -43,6 +43,7 @@ jobs:
with:
images: |
steedos/steedos-enterprise
252208178451.dkr.ecr.cn-northwest-1.amazonaws.com.cn/dockerhub/steedos/steedos-enterprise
tags: |
type=semver,pattern={{version}},value=${{ env.STEEDOS_VERSION }}
type=semver,pattern={{major}}.{{minor}},value=${{ env.STEEDOS_VERSION }}
Expand All @@ -54,6 +55,18 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_NINGXIA }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_NINGXIA }}
aws-region: cn-northwest-1
-
name: Login to ECR
uses: docker/login-action@v2
with:
registry: 252208178451.dkr.ecr.cn-northwest-1.amazonaws.com.cn

- name: Replace Version ~2.5 to Tag
uses: jacobtomlinson/gha-find-replace@v2
with:
Expand Down
40 changes: 15 additions & 25 deletions .github/workflows/release.yml → .github/workflows/npm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,28 +209,18 @@ jobs:
target_branch: master
github_token: ${{ github.token }}

- name: Sleep 120s, wait for npm cache
uses: juliangruber/sleep-action@v1
with:
time: 120s

- name: Create Docker Release
# if: steps.version.outputs.is_stable == 'true'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.DOCKER_GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
owner: steedos
repo: docker
commitish: main
tag_name: v${{ steps.branch-name.outputs.tag }}
release_name: Release v${{ steps.branch-name.outputs.tag }}
draft: false
prerelease: false

- name: Sync NpmMirror
env:
CI: false
run: |
yarn sync

# - name: Create Docker Release
# # if: steps.version.outputs.is_stable == 'true'
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.DOCKER_GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
# with:
# owner: steedos
# repo: docker
# commitish: main
# tag_name: v${{ steps.branch-name.outputs.tag }}
# release_name: Release v${{ steps.branch-name.outputs.tag }}
# draft: false
# prerelease: false
22 changes: 22 additions & 0 deletions .github/workflows/npm-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
on:
workflow_run:
workflows: [Release NPM]
types:
- completed

jobs:
sync:
runs-on: ubuntu-latest
steps:

- name: Sleep 120s, wait for npm cache
uses: juliangruber/sleep-action@v1
with:
time: 120s

- name: Sync cnpm
env:
CI: true
run: |
yarn sync
4 changes: 4 additions & 0 deletions creator/packages/steedos-creator/client/router.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ checkUserSigned = (context, redirect) ->
app_id = context.params.app_id
if (app_id != "-") && app_id && Session.get("app_id") != app_id
Session.set("app_id", app_id)
else if app_id == '-' && !Session.get("app_id")
firstApp = Steedos.getFirstApp()
Session.set("app_id", firstApp.id)

return
# listTreeCompany = localStorage.getItem("listTreeCompany")
# if listTreeCompany
Expand Down
2 changes: 0 additions & 2 deletions creator/packages/steedos-creator/client/theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ body {

zoom: 1 !important;

// iOS 上平滑滚动
-webkit-overflow-scrolling: touch;
}

.steedos {
Expand Down
53 changes: 18 additions & 35 deletions creator/packages/steedos-huaweipush/server/huaweiProvider.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const request = require('requestretry');
const tokenUrl = "https://login.vmall.com/oauth2/token";
const apiUrl = "https://api.push.hicloud.com/pushsend.do";
const tokenUrl = "https://oauth-login.cloud.huawei.com/oauth2/v3/token";
const apiUrl = "https://push-api.cloud.huawei.com/v1/[clientid]/messages:send";
const timeout = 5000;

HuaweiPush = {
Expand Down Expand Up @@ -50,11 +50,11 @@ HuaweiPush.doSendMany = function(notification, package_name, tokens, timeToLive)
console.log("sendMany ", notification, timeToLive);
const postData = this.getPostData(notification, package_name, tokens, timeToLive);
request.post({
url: apiUrl,
qs: {
nsp_ctx: `{"ver":1,"appId":"${this.authInfo[package_name].client_id}"}`
url: apiUrl.replace('[clientid]', this.authInfo[package_name].client_id),
body: JSON.stringify(postData),
'headers': {
'Authorization': 'Bearer '+ this.authInfo[package_name].access_token
},
form: postData,
timeout: timeout,
maxAttempts: 2,
retryDelay: 5000,
Expand All @@ -76,39 +76,22 @@ HuaweiPush.doSendMany = function(notification, package_name, tokens, timeToLive)

HuaweiPush.getPostData = function(notification, package_name, tokens, timeToLive) {
const postData = {
access_token: this.authInfo[package_name].access_token,
nsp_svc: "openpush.message.api.send",
nsp_ts: Math.floor(Date.now() / 1000)
};
postData.payload = {
hps: {
msg: {
type: 3,
body: {
content: notification.android.message,
title: notification.android.title
},
action: {
type: 3,
param: {
appPkgName: package_name
"validate_only": false,
"message": {
"android": {
"notification": {
"title": notification.android.title,
"body": notification.android.message,
"click_action": {
"type": 3
}
},
category: 'WORK' // 工作事项提醒
"category": "WORK"
},
ext: {
customize: this.extras(notification.extras)
}
"token": tokens,
"data": JSON.stringify(notification.extras)
}
};
postData.payload = JSON.stringify(postData.payload);
postData.device_token_list = JSON.stringify(tokens);

if (timeToLive > 0) {
postData.expire_time = this.formatHuaweiDate(new Date(Date.now() + timeToLive));
if (HuaweiPush.debug)
console.log("postData.expire_time ", postData.expire_time);
}
}
return postData;
}

Expand Down
5 changes: 3 additions & 2 deletions deploy/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
stacks
storage
.env
mongo-data
mongo-data
info.json
2 changes: 1 addition & 1 deletion deploy/cluster/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
- 8080:80

steedos:
image: steedos/steedos-enterprise:2.5.15-beta.10
image: steedos/steedos-enterprise:2.5.15-beta.12
scale: 2
environment:
- MONGO_URL=mongodb://mongodb:27017/steedos
Expand Down
29 changes: 5 additions & 24 deletions deploy/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,16 @@
FROM node:14-slim as builder
FROM node:14-slim

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

WORKDIR /app
COPY ./app/platform /app

ADD package.json .
ADD steedos.config.js .
WORKDIR /app

ENV NODE_ENV=production

RUN npm i --production && npm cache clean --force

FROM node:14-slim

RUN apt-get update \
&& apt-get install curl -y \
&& apt-get install -y build-essential \
&& apt-get clean -y

WORKDIR /

RUN mkdir -p /app

# copy npm scripts
COPY --from=builder /app/package.json ./app/package.json
COPY --from=builder /app/steedos.config.js ./app/steedos.config.js
COPY --from=builder /app/node_modules ./app/node_modules

WORKDIR /app
RUN yarn --production && yarn cache clean

CMD ["npm", "start"]
CMD ["yarn", "start"]
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ module.exports = {
namespace: "steedos",
// Default log level for built-in console logger. It can be overwritten in logger options above.
// Available values: trace, debug, info, warn, error, fatal
logLevel: "warn",
logLevel: process.env.STEEDOS_LOG_LEVEL || "warn",

// Called after broker started.
started(broker) {
broker.createService(require("@steedos/service-community"));
},

};
Loading

0 comments on commit 2d0e612

Please sign in to comment.