create-entity-server 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "백업 설정 파일입니다. 데이터베이스, 파일, 스키마 백업 옵션과 알림 설정을 포함합니다. 백업을 활성화하려면 'enabled'를 true로 변경하세요. storage 옵션은 백업 파일의 저장 위치를 지정합니다. 데이터베이스 백업은 스케줄에 따라 자동으로 수행되며, 포함/제외할 엔티티를 세밀하게 설정할 수 있습니다. 파일 백업은 실시간 또는 예약 모드로 설정할 수 있으며, 실패 시 재시도 옵션도 제공합니다. 스키마 백업은 엔티티 정의의 버전 관리를 위해 유용합니다. 알림 설정을 통해 백업 성공 또는 실패 시 로그 기록이나 이메일 알림을 받을 수 있습니다.",
|
|
3
|
+
"enabled": false,
|
|
4
|
+
"storage": "local-backup",
|
|
5
|
+
"prefix": "backups",
|
|
6
|
+
|
|
7
|
+
"database": {
|
|
8
|
+
"enabled": true,
|
|
9
|
+
"schedule": "0 2 * * *",
|
|
10
|
+
"db_group": ["default"],
|
|
11
|
+
"entities": {
|
|
12
|
+
"include": ["account_login_log"],
|
|
13
|
+
"exclude": [],
|
|
14
|
+
"exclude_patterns": ["*_log"]
|
|
15
|
+
},
|
|
16
|
+
"include_history": false,
|
|
17
|
+
"format": "jsonl",
|
|
18
|
+
"compress": true,
|
|
19
|
+
"encrypt_passphrase": "${BACKUP_ENCRYPT_KEY}",
|
|
20
|
+
"batch_size": 500,
|
|
21
|
+
"max_concurrent_entities": 3,
|
|
22
|
+
"retention": {
|
|
23
|
+
"keep_count": 7,
|
|
24
|
+
"keep_days": 30
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
"files": {
|
|
29
|
+
"enabled": true,
|
|
30
|
+
"mode": "realtime",
|
|
31
|
+
"max_retries": 3,
|
|
32
|
+
"retry_interval_sec": 60
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
"schema": {
|
|
36
|
+
"enabled": true
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
"notification": {
|
|
40
|
+
"on_success": false,
|
|
41
|
+
"on_failure": true,
|
|
42
|
+
"channels": ["log", "smtp"]
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "파일 저장 설정 파일입니다. 여러 스토리지 드라이버를 지원하며, 각 드라이버에 대한 설정을 포함합니다. 파일 업로드 기능을 활성화하려면 'enabled'를 true로 변경하세요. 'default'는 기본 스토리지 드라이버를 지정하며, 'max_file_size_mb'는 업로드 가능한 최대 파일 크기를 메가바이트 단위로 설정합니다. 'storages' 섹션에서는 각 스토리지 드라이버의 구체적인 설정을 정의할 수 있습니다. 썸네일 생성 옵션도 포함되어 있어, 자동 회전과 다양한 크기의 썸네일을 생성할 수 있습니다. 저장 공간이 부족할 때 알림을 받을 수 있도록 쿼터 설정도 제공하며, 가비지 컬렉션 기능을 통해 고아 파일을 정기적으로 청소할 수 있습니다.",
|
|
3
|
+
"enabled": true,
|
|
4
|
+
"default": "local-main",
|
|
5
|
+
"max_file_size_mb": 20,
|
|
6
|
+
"storages": {
|
|
7
|
+
"local-main": {
|
|
8
|
+
"driver": "local",
|
|
9
|
+
"root": "./uploads"
|
|
10
|
+
},
|
|
11
|
+
"local-backup": {
|
|
12
|
+
"driver": "local",
|
|
13
|
+
"root": "./backup"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"thumbnail": {
|
|
17
|
+
"enabled": true,
|
|
18
|
+
"auto_orient": true,
|
|
19
|
+
"sizes": {
|
|
20
|
+
"sm": {
|
|
21
|
+
"width": 160,
|
|
22
|
+
"height": 160
|
|
23
|
+
},
|
|
24
|
+
"md": {
|
|
25
|
+
"width": 480,
|
|
26
|
+
"height": 480
|
|
27
|
+
},
|
|
28
|
+
"lg": {
|
|
29
|
+
"width": 1024,
|
|
30
|
+
"height": 1024
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"quality": 85
|
|
34
|
+
},
|
|
35
|
+
"quota": {
|
|
36
|
+
"default_limit_gb": 0,
|
|
37
|
+
"threshold_percent": 80,
|
|
38
|
+
"notify": ["log", "smtp"]
|
|
39
|
+
},
|
|
40
|
+
"gc": {
|
|
41
|
+
"enabled": true,
|
|
42
|
+
"orphan_threshold_hours": 24,
|
|
43
|
+
"cron": "0 3 * * *"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -187,31 +187,46 @@ case "$1" in
|
|
|
187
187
|
fi
|
|
188
188
|
|
|
189
189
|
# 새로 생성된 API 키 조회 후 .env 업데이트
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
FIRST_SEQ=$("$ENTITY_CLI_BIN" api-key list 2>/dev/null | awk 'NR>4 && /^[0-9]/ {print $1; exit}')
|
|
191
|
+
API_KEY_OUTPUT=""
|
|
192
|
+
if [ -n "$FIRST_SEQ" ]; then
|
|
193
|
+
API_KEY_OUTPUT=$("$ENTITY_CLI_BIN" api-key show --seq="$FIRST_SEQ" --reveal-secret 2>/dev/null)
|
|
194
|
+
fi
|
|
195
|
+
NEW_API_KEY=$(echo "$API_KEY_OUTPUT" | grep -E '^key_value' | awk '{print $NF}' || true)
|
|
196
|
+
NEW_HMAC=$(echo "$API_KEY_OUTPUT" | grep -E '^hmac_secret' | awk '{print $NF}' || true)
|
|
192
197
|
|
|
193
198
|
if [ -n "$NEW_API_KEY" ] && [ -n "$NEW_HMAC" ]; then
|
|
199
|
+
# 게이트웨이 .env 자동 업데이트 (개발 환경: entity-app-server/ 폴더가 같은 레벨에 있을 때만)
|
|
200
|
+
GW_DIR="$(dirname "$PROJECT_ROOT")/entity-app-server"
|
|
201
|
+
GW_ENV="$GW_DIR/.env"
|
|
202
|
+
GW_UPDATED=0
|
|
203
|
+
if [ -d "$GW_DIR" ] && [ -f "$GW_ENV" ]; then
|
|
204
|
+
sed -i "s|^ENTITY_API_KEY=.*|ENTITY_API_KEY=$NEW_API_KEY|" "$GW_ENV"
|
|
205
|
+
sed -i "s|^ENTITY_HMAC_SECRET=.*|ENTITY_HMAC_SECRET=$NEW_HMAC|" "$GW_ENV"
|
|
206
|
+
GW_UPDATED=1
|
|
207
|
+
fi
|
|
208
|
+
|
|
194
209
|
echo ""
|
|
210
|
+
echo "=================================================="
|
|
195
211
|
if [ "$LANGUAGE" = "en" ]; then
|
|
196
212
|
echo "🔑 New API Key generated:"
|
|
197
213
|
else
|
|
198
214
|
echo "🔑 새 API 키가 생성되었습니다:"
|
|
199
215
|
fi
|
|
200
|
-
echo "
|
|
216
|
+
echo ""
|
|
217
|
+
echo " ENTITY_API_KEY = $NEW_API_KEY"
|
|
201
218
|
echo " ENTITY_HMAC_SECRET = $NEW_HMAC"
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
GW_DIR="$(dirname "$PROJECT_ROOT")/entity-app-server"
|
|
205
|
-
GW_ENV="$GW_DIR/.env"
|
|
206
|
-
if [ -d "$GW_DIR" ] && [ -f "$GW_ENV" ]; then
|
|
207
|
-
sed -i "s|^ENTITY_API_KEY=.*|ENTITY_API_KEY=$NEW_API_KEY|" "$GW_ENV"
|
|
208
|
-
sed -i "s|^ENTITY_HMAC_SECRET=.*|ENTITY_HMAC_SECRET=$NEW_HMAC|" "$GW_ENV"
|
|
219
|
+
echo ""
|
|
220
|
+
if [ "$GW_UPDATED" = "1" ]; then
|
|
209
221
|
if [ "$LANGUAGE" = "en" ]; then
|
|
210
222
|
echo " ✓ Updated: entity-app-server/.env"
|
|
211
223
|
else
|
|
212
224
|
echo " ✓ 업데이트 완료: entity-app-server/.env"
|
|
213
225
|
fi
|
|
226
|
+
echo ""
|
|
214
227
|
fi
|
|
228
|
+
echo "=================================================="
|
|
229
|
+
echo ""
|
|
215
230
|
fi
|
|
216
231
|
;;
|
|
217
232
|
*)
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"enabled": false,
|
|
3
|
-
|
|
4
|
-
"data": {
|
|
5
|
-
"enabled": true,
|
|
6
|
-
"schedule": "0 2 * * *",
|
|
7
|
-
"db_groups": ["default"],
|
|
8
|
-
"entities": {
|
|
9
|
-
"include": [],
|
|
10
|
-
"exclude": [],
|
|
11
|
-
"exclude_patterns": ["*_log"]
|
|
12
|
-
},
|
|
13
|
-
"include_history": false,
|
|
14
|
-
"format": "jsonl",
|
|
15
|
-
"compress": true,
|
|
16
|
-
"encrypt_passphrase": "${BACKUP_ENCRYPT_KEY}",
|
|
17
|
-
"batch_size": 500,
|
|
18
|
-
"max_concurrent_entities": 3,
|
|
19
|
-
"retention": {
|
|
20
|
-
"keep_count": 7,
|
|
21
|
-
"keep_days": 30
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
"files": {
|
|
26
|
-
"enabled": true,
|
|
27
|
-
"mode": "realtime",
|
|
28
|
-
"max_retries": 3,
|
|
29
|
-
"retry_interval_sec": 60
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
"schema": {
|
|
33
|
-
"enabled": true
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
"target": {
|
|
37
|
-
"storage_key": "s3-backup",
|
|
38
|
-
"prefix": "backups"
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
"notification": {
|
|
42
|
-
"on_success": false,
|
|
43
|
-
"on_failure": true,
|
|
44
|
-
"channels": ["log", "smtp"]
|
|
45
|
-
}
|
|
46
|
-
}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"enabled": true,
|
|
3
|
-
"default": "local-main",
|
|
4
|
-
"max_file_size_mb": 20,
|
|
5
|
-
"storages": {
|
|
6
|
-
"local-main": {
|
|
7
|
-
"driver": "local",
|
|
8
|
-
"root": "./uploads"
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
"s3-aws": {
|
|
12
|
-
"driver": "s3",
|
|
13
|
-
"bucket": "my-entity-files",
|
|
14
|
-
"region": "ap-northeast-2",
|
|
15
|
-
"access_key": "${AWS_ACCESS_KEY_ID}",
|
|
16
|
-
"secret_key": "${AWS_SECRET_ACCESS_KEY}",
|
|
17
|
-
"prefix": "entity-files"
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
"s3-r2": {
|
|
21
|
-
"driver": "s3",
|
|
22
|
-
"bucket": "my-files",
|
|
23
|
-
"region": "auto",
|
|
24
|
-
"endpoint": "https://${CF_ACCOUNT_ID}.r2.cloudflarestorage.com",
|
|
25
|
-
"access_key": "${R2_ACCESS_KEY}",
|
|
26
|
-
"secret_key": "${R2_SECRET_KEY}",
|
|
27
|
-
"prefix": "",
|
|
28
|
-
"_comment": "Cloudflare R2 (S3 호환) — 이그레스 무료"
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
"s3-b2": {
|
|
32
|
-
"driver": "s3",
|
|
33
|
-
"bucket": "my-files",
|
|
34
|
-
"region": "us-west-004",
|
|
35
|
-
"endpoint": "https://s3.us-west-004.backblazeb2.com",
|
|
36
|
-
"access_key": "${B2_KEY_ID}",
|
|
37
|
-
"secret_key": "${B2_APP_KEY}",
|
|
38
|
-
"_comment": "Backblaze B2 (S3 호환) — S3 대비 1/4 가격"
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
"s3-wasabi": {
|
|
42
|
-
"driver": "s3",
|
|
43
|
-
"bucket": "my-files",
|
|
44
|
-
"region": "ap-northeast-2",
|
|
45
|
-
"endpoint": "https://s3.ap-northeast-2.wasabisys.com",
|
|
46
|
-
"access_key": "${WASABI_ACCESS_KEY}",
|
|
47
|
-
"secret_key": "${WASABI_SECRET_KEY}",
|
|
48
|
-
"_comment": "Wasabi (S3 호환) — 저가 hot storage"
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
"s3-do-spaces": {
|
|
52
|
-
"driver": "s3",
|
|
53
|
-
"bucket": "my-files",
|
|
54
|
-
"region": "sgp1",
|
|
55
|
-
"endpoint": "https://sgp1.digitaloceanspaces.com",
|
|
56
|
-
"access_key": "${DO_SPACES_KEY}",
|
|
57
|
-
"secret_key": "${DO_SPACES_SECRET}",
|
|
58
|
-
"_comment": "DigitalOcean Spaces (S3 호환)"
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
"s3-minio": {
|
|
62
|
-
"driver": "s3",
|
|
63
|
-
"bucket": "entity-files",
|
|
64
|
-
"region": "us-east-1",
|
|
65
|
-
"endpoint": "http://minio.internal:9000",
|
|
66
|
-
"access_key": "minioadmin",
|
|
67
|
-
"secret_key": "minioadmin",
|
|
68
|
-
"_comment": "MinIO (S3 호환) — 자체 호스팅"
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
"s3-ncloud": {
|
|
72
|
-
"driver": "s3",
|
|
73
|
-
"bucket": "my-files",
|
|
74
|
-
"region": "kr-standard",
|
|
75
|
-
"endpoint": "https://kr.object.ncloudstorage.com",
|
|
76
|
-
"access_key": "${NCLOUD_ACCESS_KEY}",
|
|
77
|
-
"secret_key": "${NCLOUD_SECRET_KEY}",
|
|
78
|
-
"_comment": "Naver Cloud Object Storage (S3 호환)"
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
"azure-example": {
|
|
82
|
-
"driver": "azure",
|
|
83
|
-
"container": "files",
|
|
84
|
-
"account_name": "${AZURE_STORAGE_ACCOUNT}",
|
|
85
|
-
"account_key": "${AZURE_STORAGE_KEY}",
|
|
86
|
-
"prefix": "entity-files"
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
"gcs-example": {
|
|
90
|
-
"driver": "gcs",
|
|
91
|
-
"bucket": "my-entity-files",
|
|
92
|
-
"credentials_file": "./configs/keys/gcp-sa.json",
|
|
93
|
-
"prefix": "entity-files",
|
|
94
|
-
"_comment": "GKE/Cloud Run에서는 credentials_file 불필요 (Workload Identity)"
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
"sftp-example": {
|
|
98
|
-
"driver": "sftp",
|
|
99
|
-
"host": "nas.company.com",
|
|
100
|
-
"port": 22,
|
|
101
|
-
"user": "backup",
|
|
102
|
-
"private_key_file": "./configs/keys/backup_rsa",
|
|
103
|
-
"root": "/volume1/entity-files",
|
|
104
|
-
"_comment": "NAS/온프레미스 서버 연동"
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
"swift-kt": {
|
|
108
|
-
"driver": "swift",
|
|
109
|
-
"auth_url": "https://ssproxy.ucloudbiz.olleh.com/identity/v3",
|
|
110
|
-
"container": "my-files",
|
|
111
|
-
"user": "${KT_USER}",
|
|
112
|
-
"password": "${KT_PASSWORD}",
|
|
113
|
-
"tenant_name": "${KT_TENANT}",
|
|
114
|
-
"domain_name": "Default",
|
|
115
|
-
"region": "kr1",
|
|
116
|
-
"_comment": "KT Cloud Storage (OpenStack Swift)"
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
"thumbnail": {
|
|
120
|
-
"enabled": true,
|
|
121
|
-
"auto_orient": true,
|
|
122
|
-
"sizes": {
|
|
123
|
-
"sm": {
|
|
124
|
-
"width": 160,
|
|
125
|
-
"height": 160
|
|
126
|
-
},
|
|
127
|
-
"md": {
|
|
128
|
-
"width": 480,
|
|
129
|
-
"height": 480
|
|
130
|
-
},
|
|
131
|
-
"lg": {
|
|
132
|
-
"width": 1024,
|
|
133
|
-
"height": 1024
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
"quality": 85
|
|
137
|
-
},
|
|
138
|
-
"quota": {
|
|
139
|
-
"default_limit_gb": 0,
|
|
140
|
-
"threshold_percent": 80,
|
|
141
|
-
"notify": ["log", "smtp"]
|
|
142
|
-
},
|
|
143
|
-
"gc": {
|
|
144
|
-
"enabled": true,
|
|
145
|
-
"orphan_threshold_hours": 24,
|
|
146
|
-
"cron": "0 3 * * *"
|
|
147
|
-
}
|
|
148
|
-
}
|