@ngocsangairvds/vsaf 4.1.10 → 4.1.12
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 +1 -1
- package/skills/vds-skill/install-deps.mjs +60 -9
- package/skills/vds-skill/runtime/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/config.py +0 -1
- package/skills/vds-skill/runtime/confluence_orchestrator/src/confluence_orchestrator/config.py +0 -2
- package/skills/vds-skill/runtime/docs/.confluence.yaml +1 -2
- package/skills/vds-skill/runtime/jira_orchestrator/src/vds_jira_orchestrator/config.py +1 -1
- package/skills/vds-skill/runtime/jira_viettelmoney_orchestrator/src/vds_jira_viettelmoney_orchestrator/config.py +2 -4
- package/skills/vds-skill/runtime/vds_cli/src/vds_cli/confluence_sync.py +10 -1
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import { execSync } from 'child_process';
|
|
20
|
-
import { existsSync, cpSync, mkdirSync, writeFileSync, rmSync } from 'fs';
|
|
20
|
+
import { existsSync, cpSync, mkdirSync, writeFileSync, rmSync, readFileSync } from 'fs';
|
|
21
21
|
import { join } from 'path';
|
|
22
22
|
import { homedir } from 'os';
|
|
23
23
|
|
|
@@ -182,11 +182,26 @@ const ENV_TEMPLATE = `# VDS Environment Configuration
|
|
|
182
182
|
VDS_USERNAME=
|
|
183
183
|
VDS_PASSWORD=
|
|
184
184
|
|
|
185
|
+
# ── Jira ──
|
|
186
|
+
JIRA_BASE_URL=
|
|
187
|
+
# JIRA_TOKEN=
|
|
188
|
+
|
|
189
|
+
# ── Jira ViettelMoney ──
|
|
190
|
+
JIRA_VIETTELMONEY_BASE_URL=
|
|
191
|
+
# JIRA_VIETTELMONEY_USERNAME=
|
|
192
|
+
# JIRA_VIETTELMONEY_PASSWORD=
|
|
193
|
+
# JIRA_VIETTELMONEY_PROXY=
|
|
194
|
+
|
|
185
195
|
# ── Bitbucket ──
|
|
186
|
-
BITBUCKET_ACCESS_TOKEN=
|
|
187
196
|
VDS_BITBUCKET_URL=
|
|
197
|
+
BITBUCKET_ACCESS_TOKEN=
|
|
198
|
+
# BITBUCKET_TOKEN=
|
|
199
|
+
# BITBUCKET_MODE=server
|
|
200
|
+
# BITBUCKET_CLOUD_WORKSPACE=
|
|
188
201
|
|
|
189
202
|
# ── Confluence ──
|
|
203
|
+
CONFLUENCE_INTERNAL_URL=
|
|
204
|
+
CONFLUENCE_EXTERNAL_URL=
|
|
190
205
|
INTERNAL_CONFLUENCE_TOKEN=
|
|
191
206
|
EXTERNAL_CONFLUENCE_TOKEN=
|
|
192
207
|
|
|
@@ -202,18 +217,54 @@ VDS_GIT_CONCURRENCY_DEFAULT=8
|
|
|
202
217
|
# VDS_GIT_HTTP_LOW_SPEED_LIMIT=1000
|
|
203
218
|
# VDS_GIT_HTTP_LOW_SPEED_TIME=300
|
|
204
219
|
# VDS_GIT_AUTO_REGENERATE_MANIFEST=
|
|
205
|
-
# BITBUCKET_TOKEN=
|
|
206
220
|
`;
|
|
207
221
|
|
|
208
222
|
function provisionEnv() {
|
|
209
|
-
|
|
210
|
-
|
|
223
|
+
mkdirSync(ENV_DIR, { recursive: true });
|
|
224
|
+
|
|
225
|
+
if (!existsSync(ENV_FILE)) {
|
|
226
|
+
writeFileSync(ENV_FILE, ENV_TEMPLATE, 'utf-8');
|
|
227
|
+
log('✓', `.env template created at ${ENV_FILE}`);
|
|
228
|
+
log('⚠', `Fill in your credentials: ${ENV_FILE}`);
|
|
211
229
|
return;
|
|
212
230
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
231
|
+
|
|
232
|
+
if (force) {
|
|
233
|
+
writeFileSync(ENV_FILE, ENV_TEMPLATE, 'utf-8');
|
|
234
|
+
log('✓', `.env overwritten at ${ENV_FILE}`);
|
|
235
|
+
log('⚠', `Fill in your credentials: ${ENV_FILE}`);
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// Merge: add missing variables from template into existing .env
|
|
240
|
+
const existing = readFileSync(ENV_FILE, 'utf-8');
|
|
241
|
+
const existingKeys = new Set(
|
|
242
|
+
existing.split('\n')
|
|
243
|
+
.map(line => line.trim())
|
|
244
|
+
.filter(line => line && !line.startsWith('#'))
|
|
245
|
+
.map(line => line.split('=')[0].trim()),
|
|
246
|
+
);
|
|
247
|
+
|
|
248
|
+
const newLines = [];
|
|
249
|
+
for (const line of ENV_TEMPLATE.split('\n')) {
|
|
250
|
+
const trimmed = line.trim();
|
|
251
|
+
if (!trimmed || trimmed.startsWith('#')) continue;
|
|
252
|
+
const key = trimmed.split('=')[0].trim();
|
|
253
|
+
if (!existingKeys.has(key)) {
|
|
254
|
+
newLines.push(line);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (newLines.length > 0) {
|
|
259
|
+
const append = '\n# ── Added by vds-skill installer ──\n' + newLines.join('\n') + '\n';
|
|
260
|
+
writeFileSync(ENV_FILE, existing.trimEnd() + '\n' + append, 'utf-8');
|
|
261
|
+
log('✓', `${newLines.length} new variable(s) added to ${ENV_FILE}`);
|
|
262
|
+
for (const line of newLines) {
|
|
263
|
+
log(' +', line.split('=')[0]);
|
|
264
|
+
}
|
|
265
|
+
} else {
|
|
266
|
+
log('⊘', `.env already up-to-date at ${ENV_FILE}`);
|
|
267
|
+
}
|
|
217
268
|
}
|
|
218
269
|
|
|
219
270
|
// ── Main ──
|
package/skills/vds-skill/runtime/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/config.py
CHANGED
|
@@ -43,7 +43,6 @@ class BitbucketSettings(HTTPClientSettings, BaseSettings):
|
|
|
43
43
|
# Backward-compatible aliases: BITBUCKET_BASE_URL, VDS_BITBUCKET_HTTP_BASE
|
|
44
44
|
# Priority: VDS_BITBUCKET_URL > BITBUCKET_BASE_URL > VDS_BITBUCKET_HTTP_BASE
|
|
45
45
|
base_url: str = Field(
|
|
46
|
-
default="http://bitbucket.digital.vn",
|
|
47
46
|
validation_alias=AliasChoices(
|
|
48
47
|
"VDS_BITBUCKET_URL", # Primary (highest priority)
|
|
49
48
|
"BITBUCKET_BASE_URL", # Legacy alias
|
package/skills/vds-skill/runtime/confluence_orchestrator/src/confluence_orchestrator/config.py
CHANGED
|
@@ -52,11 +52,9 @@ class ConfluenceSettings(HTTPClientSettings, BaseSettings):
|
|
|
52
52
|
|
|
53
53
|
# Canonical URLs
|
|
54
54
|
internal_url: AnyHttpUrl = Field(
|
|
55
|
-
default="http://confluence.digital.vn",
|
|
56
55
|
alias="CONFLUENCE_INTERNAL_URL",
|
|
57
56
|
)
|
|
58
57
|
external_url: AnyHttpUrl = Field(
|
|
59
|
-
default="http://10.254.136.35:8090",
|
|
60
58
|
alias="CONFLUENCE_EXTERNAL_URL",
|
|
61
59
|
)
|
|
62
60
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
bitbucket:
|
|
2
|
-
base_url: http://bitbucket.digital.vn
|
|
3
2
|
project: WHO
|
|
4
3
|
server: internal
|
|
5
4
|
pages:
|
|
@@ -154,4 +153,4 @@ repos:
|
|
|
154
153
|
name: vds-ai-memory
|
|
155
154
|
slug: vds-ai-memory
|
|
156
155
|
space_key: TTCN24
|
|
157
|
-
confluence_url
|
|
156
|
+
# confluence_url is resolved at runtime from CONFLUENCE_INTERNAL_URL env var
|
|
@@ -43,7 +43,7 @@ class JiraSettings(HTTPClientSettings, BaseSettings):
|
|
|
43
43
|
|
|
44
44
|
# Non-sensitive fields
|
|
45
45
|
username: str | None = Field(default=None, alias="VDS_USERNAME")
|
|
46
|
-
base_url: str = Field(
|
|
46
|
+
base_url: str = Field(alias="JIRA_BASE_URL")
|
|
47
47
|
|
|
48
48
|
# Sensitive credentials - stored as SecretStr for security
|
|
49
49
|
password_secret: SecretStr | None = Field(default=None, alias="VDS_PASSWORD")
|
|
@@ -34,11 +34,9 @@ class JiraViettelMoneySettings(HTTPClientSettings, BaseSettings):
|
|
|
34
34
|
)
|
|
35
35
|
|
|
36
36
|
username: str | None = Field(default=None, alias="JIRA_VIETTELMONEY_USERNAME")
|
|
37
|
-
base_url: str = Field(
|
|
38
|
-
default="https://jira.viettelmoney.vn", alias="JIRA_VIETTELMONEY_BASE_URL"
|
|
39
|
-
)
|
|
37
|
+
base_url: str = Field(alias="JIRA_VIETTELMONEY_BASE_URL")
|
|
40
38
|
# Proxy is passed per-request via requests.Session — not set system-wide
|
|
41
|
-
proxy_url: str | None = Field(default=
|
|
39
|
+
proxy_url: str | None = Field(default=None, alias="JIRA_VIETTELMONEY_PROXY")
|
|
42
40
|
|
|
43
41
|
password_secret: SecretStr | None = Field(default=None, alias="JIRA_VIETTELMONEY_PASSWORD")
|
|
44
42
|
token_secret: SecretStr | None = Field(default=None, alias="JIRA_VIETTELMONEY_TOKEN")
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import logging
|
|
6
|
+
import os
|
|
6
7
|
import re
|
|
7
8
|
from dataclasses import dataclass, field
|
|
8
9
|
from datetime import UTC, datetime
|
|
@@ -306,11 +307,19 @@ def load_confluence_config(repo_root: Path) -> ConfluenceHubConfig:
|
|
|
306
307
|
)
|
|
307
308
|
)
|
|
308
309
|
|
|
310
|
+
# Resolve bitbucket_base_url from env (VDS_BITBUCKET_URL) with YAML fallback
|
|
311
|
+
bitbucket_base_url = os.environ.get(
|
|
312
|
+
"VDS_BITBUCKET_URL",
|
|
313
|
+
raw.get("bitbucket", {}).get("base_url", ""),
|
|
314
|
+
)
|
|
315
|
+
if not bitbucket_base_url:
|
|
316
|
+
raise ValueError("VDS_BITBUCKET_URL env var is required (or set bitbucket.base_url in .confluence.yaml)")
|
|
317
|
+
|
|
309
318
|
return ConfluenceHubConfig(
|
|
310
319
|
parent_page_id=raw["parent_page_id"],
|
|
311
320
|
space_key=raw["space_key"],
|
|
312
321
|
bitbucket_project=raw["bitbucket"]["project"],
|
|
313
|
-
bitbucket_base_url=
|
|
322
|
+
bitbucket_base_url=bitbucket_base_url.rstrip("/"),
|
|
314
323
|
bitbucket_server=raw["bitbucket"].get("server", "internal"),
|
|
315
324
|
repos=repos,
|
|
316
325
|
pages=pages,
|