Skip to content

Commit 1b8b3da

Browse files
authored
Merge pull request #1 from plingdevelop/release/platform-hardening-and-infra-updates
feature: Platform hardening and infrastructure updates
2 parents 0dde12b + d6f48ce commit 1b8b3da

File tree

159 files changed

+21497
-10940
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+21497
-10940
lines changed

.editorconfig

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,15 @@
1-
# editorconfig.org
2-
31
root = true
42

5-
[**]
6-
indent_size = 4
7-
indent_style = space
3+
[*]
84
charset = utf-8
5+
indent_style = space
6+
indent_size = 4
97
end_of_line = lf
10-
trim_trailing_whitespace = true
11-
12-
[**.html]
13-
indent_size = 2
14-
15-
[**.jade]
16-
indent_size = 2
17-
18-
[**.json]
19-
indent_size = 2
20-
21-
[**.scss]
22-
indent_size = 2
23-
insert_final_newline = true
24-
25-
[**.css]
26-
indent_size = 2
27-
insert_final_newline = true
28-
29-
[**.md]
30-
trim_trailing_whitespace = false
31-
32-
[**.js]
33-
indent_size = 2
348
insert_final_newline = true
9+
trim_trailing_whitespace = true
3510

36-
[**.yml]
11+
[{*.json,*.yml}]
3712
indent_size = 2
3813

3914
[Makefile]
40-
indent_style = tab
15+
indent_style = tab

.env.example

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
###############################################
2+
# CodePush Server Configuration (.env)
3+
###############################################
4+
5+
# -------------------------------
6+
# General / Logs
7+
# -------------------------------
8+
# 클론시 유일한 환경변수 값 (*)
9+
COMPOSE_PROJECT_NAME=code-push-server
10+
LOG_LEVEL=debug
11+
LOG_FORMAT=text
12+
13+
# -------------------------------
14+
# Database (MySQL) (*)
15+
# - 유저/앱/패키지 메타데이터 저장
16+
# -------------------------------
17+
RDS_USERNAME=codepush
18+
RDS_PASSWORD=codepush
19+
RDS_DATABASE=codepush
20+
RDS_HOST=127.0.0.1
21+
RDS_PORT=3306
22+
23+
# -------------------------------
24+
# Storage Settings (*)
25+
# storageType: local | s3 | qiniu | oss | tencentcloud
26+
# -------------------------------
27+
STORAGE_TYPE=local
28+
29+
# Local storage (default) (*)
30+
# 저장 파일이 위치할 경로 (미설정 시 OS tmpdir 사용)
31+
STORAGE_DIR=./storage
32+
33+
# 파일 다운로드 URL - 반드시 본인 서버 URL로 수정
34+
LOCAL_DOWNLOAD_URL=http://127.0.0.1:3000/download
35+
36+
# 공통 Download URL 우선순위:
37+
# LOCAL_DOWNLOAD_URL > DOWNLOAD_URL
38+
DOWNLOAD_URL=http://127.0.0.1:3000/download
39+
40+
# -------------------------------
41+
# JWT Token (*)
42+
# -------------------------------
43+
TOKEN_SECRET=REPLACE_WITH_RANDOM_LONG_SECRET
44+
45+
# -------------------------------
46+
# Common Behavior
47+
# -------------------------------
48+
# 프로덕션 배포 및 계정생성 후 false 로 수정
49+
ALLOW_REGISTRATION=true
50+
TRY_LOGIN_TIMES=4
51+
DIFF_NUMS=3
52+
# DATA_DIR=./data
53+
# 클라우드 배포시 보통 data 디렉토리에 쓰기 권한이 없음
54+
DATA_DIR=
55+
# update_check 결과를 Redis에 캐시(프로덕션 true 사용) (*)
56+
UPDATE_CHECK_CACHE=false
57+
# rollout 대상 여부를 clientUniqueId별로 캐시(프로덕션 true 사용) (*)
58+
ROLLOUT_CLIENT_UNIQUE_ID_CACHE=false
59+
60+
# -------------------------------
61+
# Redis (optional: only needed for login attempt limit or caching) (*)
62+
# -------------------------------
63+
REDIS_HOST=127.0.0.1
64+
REDIS_PORT=6379
65+
REDIS_PASSWORD=
66+
REDIS_DB=0
67+
68+
# -------------------------------
69+
# Email SMTP (optional: only used for registration + verification)
70+
# -------------------------------
71+
SMTP_HOST=
72+
SMTP_PORT=465
73+
SMTP_USERNAME=
74+
SMTP_PASSWORD=
75+
76+
# -------------------------------
77+
# Cloud Storage (Optional)
78+
# Qiniu / S3 / OSS / Tencent Cloud
79+
# -------------------------------
80+
QINIU_ACCESS_KEY=
81+
QINIU_SECRET_KEY=
82+
QINIU_BUCKET_NAME=
83+
QINIU_DOWNLOAD_URL=
84+
85+
# AWS IAM - admin_codepush with the customS3BucketAccessForCodePush policy (*)
86+
AWS_ACCESS_KEY_ID=
87+
AWS_SECRET_ACCESS_KEY=
88+
AWS_SESSION_TOKEN=
89+
AWS_BUCKET_NAME=
90+
AWS_REGION=
91+
AWS_DOWNLOAD_URL=
92+
# 버킷내 경로 프리픽스 (optional)
93+
AWS_S3_KEY_PREFIX=codepush/
94+
95+
OSS_ACCESS_KEY_ID=
96+
OSS_SECRET_ACCESS_KEY=
97+
OSS_ENDPOINT=
98+
OSS_BUCKET_NAME=
99+
OSS_PREFIX=
100+
OSS_DOWNLOAD_URL=
101+
102+
COS_ACCESS_KEY_ID=
103+
COS_SECRET_ACCESS_KEY=
104+
COS_BUCKET_NAME=
105+
COS_REGION=
106+
COS_DOWNLOAD_URL=
107+
108+
# The value should be a comma-separated list of IP addresses, e.g., "127.0.0.1,10.0.0.1".
109+
WEB_UI_WHITELIST=
110+
WEB_UI_ALLOW=

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.js

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['@shm-open/eslint-config-bundle'],
3+
};

.github/workflows/nodejs.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Node.js CI
5+
6+
on:
7+
push:
8+
branches: [master]
9+
pull_request:
10+
branches: [master]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
node-version: [14.x]
19+
20+
services:
21+
redis:
22+
image: redis
23+
ports:
24+
- 6379:6379
25+
mysql:
26+
image: mysql
27+
env:
28+
MYSQL_ROOT_PASSWORD: password
29+
ports:
30+
- 3306:3306
31+
32+
steps:
33+
- uses: actions/checkout@v3
34+
- name: Use Node.js ${{ matrix.node-version }}
35+
uses: actions/setup-node@v3
36+
with:
37+
node-version: ${{ matrix.node-version }}
38+
- run: npm ci
39+
- run: npm run build --if-present
40+
- run: npm test
41+
- run: npm run lint --if-present

.gitignore

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@ pids
77
*.pid
88
*.seed
99
*.DS_Store
10+
bin/
11+
.nyc_output/
1012

11-
.grunt
13+
# deps
14+
node_modules/
1215

13-
# Dependency directory
14-
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
15-
node_modules
16-
17-
coverage
1816

1917
# vs code
2018
.history
21-
.idea
19+
.idea
20+
21+
# environment variables
22+
!.env.example
23+
.env
24+
.env.*

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
CHANGELOG.md
3+
coverage
4+
public

.prettierrc.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@shm-open/eslint-config-bundle/prettier');

.travis.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)