zioinfo-mail/app/node_modules/@expo/devcert/src/user-interface.ts
DESKTOP-TKLFCPR\ython 11c670f2a0 refactor: 101.79.17.164 → zioinfo.co.kr 전체 도메인 변환 + Manager UI 배포
- 37개 파일 IP → zioinfo.co.kr 치환 (소스/매뉴얼/설정/하네스)
- Manager DrConsole/NetworkConsole/CsapConsole 빌드 + /var/www/manager/ 배포
- 테스트: Manager HTTP 200, ITSM 신규 API 7개 전체 200

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 10:09:17 +09:00

91 lines
2.9 KiB
TypeScript

import readline from 'node:readline';
import { waitForUser } from './utils';
export interface UserInterface {
getWindowsEncryptionPassword(): Promise<string>;
warnChromeOnLinuxWithoutCertutil(): Promise<void>;
closeFirefoxBeforeContinuing(): Promise<void>;
startFirefoxWizard(certificateHost: string): Promise<void>;
firefoxWizardPromptPage(certificateURL: string): Promise<string>;
waitForFirefoxWizard(): Promise<void>;
}
async function passwordPrompt(prompt: string): Promise<string> {
const input = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
return new Promise((resolve, reject) => {
input.on('SIGINT', () => {
reject(new Error('SIGINT'));
});
input.question(prompt, (answer) => {
readline.moveCursor(process.stdout, 0, -1);
readline.clearLine(process.stdout, 0);
input.write(prompt + answer.replace(/./g, '*') + '\n');
input.close();
resolve(answer);
});
});
}
const DefaultUI: UserInterface = {
async getWindowsEncryptionPassword() {
return await passwordPrompt('devcert password (http://bit.ly/devcert-what-password?):');
},
async warnChromeOnLinuxWithoutCertutil() {
console.warn(`
WARNING: It looks like you have Chrome installed, but you specified
'skipCertutilInstall: true'. Unfortunately, without installing
certutil, it's impossible get Chrome to trust devcert's certificates
The certificates will work, but Chrome will continue to warn you that
they are untrusted.
`);
},
async closeFirefoxBeforeContinuing() {
console.log('Please close Firefox before continuing');
},
async startFirefoxWizard(certificateHost) {
console.log(`
devcert was unable to automatically configure Firefox. You'll need to
complete this process manually. Don't worry though - Firefox will walk
you through it.
When you're ready, hit any key to continue. Firefox will launch and
display a wizard to walk you through how to trust the devcert
certificate. When you are finished, come back here and we'll finish up.
(If Firefox doesn't start, go ahead and start it and navigate to
${ certificateHost } in a new tab.)
If you are curious about why all this is necessary, check out
https://github.com/davewasmer/devcert#how-it-works
<Press any key to launch Firefox wizard>
`);
await waitForUser();
},
async firefoxWizardPromptPage(certificateURL: string) {
return `
<html>
<head>
<meta http-equiv="refresh" content="0; url=${certificateURL}" />
</head>
</html>
`;
},
async waitForFirefoxWizard() {
console.log(`
Launching Firefox ...
Great! Once you've finished the Firefox wizard for adding the devcert
certificate, just hit any key here again and we'll wrap up.
<Press any key to continue>
`)
await waitForUser();
}
}
export default DefaultUI;