fix(fix3): runtime env hardening and public endpoint source-of-truth
This commit is contained in:
@@ -28,7 +28,7 @@ async function rollbackCurrentState(): Promise<void> {
|
||||
}
|
||||
|
||||
export async function reconfigure(options: ReconfigureOptions): Promise<void> {
|
||||
const configRaw = await readText(options.configPath);
|
||||
const configRaw = await readText(options.sourceConfigPath);
|
||||
const config = parseRuntimeEnv(configRaw);
|
||||
|
||||
const context: ReconfigureContext & { packageVersion: string; packageBuildId: string; installDate: string; hysteriaAuthPassword: string; hysteriaVersion: string } = {
|
||||
@@ -46,7 +46,8 @@ export async function reconfigure(options: ReconfigureOptions): Promise<void> {
|
||||
|
||||
if (options.dryRun) {
|
||||
info("reconfigure dry-run: validated config and execution graph");
|
||||
info(`config file: ${options.configPath}`);
|
||||
info(`config source: ${options.sourceConfigPath}`);
|
||||
info(`runtime file: ${options.runtimeConfigPath}`);
|
||||
info(`ui bind: ${config.uiBindHost}:${config.uiPort}`);
|
||||
info(`hysteria bind: ${config.hysteriaBindHost}:${config.hysteriaPort}`);
|
||||
info(`public endpoint: ${config.publicHost}:${config.publicPort}`);
|
||||
@@ -64,7 +65,7 @@ export async function reconfigure(options: ReconfigureOptions): Promise<void> {
|
||||
step("firewall");
|
||||
await applyFirewall(context);
|
||||
step("write env artifacts");
|
||||
await writeText(options.configPath, renderRuntimeEnv(config), 0o600);
|
||||
await writeText(options.runtimeConfigPath, renderRuntimeEnv(config), 0o600);
|
||||
await writePostInstallEnv(context);
|
||||
step("smoke checks");
|
||||
await smoke(context);
|
||||
|
||||
Reference in New Issue
Block a user