[Claude Code Desktop 자동 설치 환경]
- setup/CLAUDE.md: 트리거 키워드 + 설치 패키지 설명
- setup/.claude/skills/guardia-install/SKILL.md: 6단계 설치 오케스트레이터
Phase 0: 의도 파악 → Phase 1: OS 감지 → Phase 2: 사전 확인
Phase 3: 설치 실행 → Phase 4: 라이선스 발급 → Phase 5: 검증 → Phase 6: 완료보고
[통합 자동 설치 스크립트]
- setup/install_auto.sh: Linux 통합 (OS 자동 감지 ubuntu/centos/rhel)
- --license trial30|trial7|<key> 파라미터
- 설치 완료 후 GUARDiA 자동 실행 + 브라우저 자동 열기
- --test 검증 모드
- setup/install_auto.ps1: Windows 통합 (ASCII 전용, PS 5.1 호환)
- 설치 후 NSSM 서비스 자동 시작 + 브라우저 자동 열기
- -Test 파라미터로 검증 전용 실행
[라이선스 엔진 개선]
- core/license.py: generate_trial_key(days=None) 파라미터 추가
- TRIAL_DURATION_DAYS = TRIAL_DURATION_DAYS 환경변수로 조정 가능
- routers/license.py: TrialRequest.days 필드 + 30일 체험판 지원
POST /api/license/trial {"days": 30} 로 30일 발급
사용자 경험:
1. setup/ 폴더를 새 PC에 복사
2. Claude Code Desktop 열고 해당 폴더 open
3. "GUARDiA 시스템 1달 사용자로 설치해 줘" 입력
4. 자동으로 OS 감지 → 설치 → 30일 라이선스 → 브라우저 열림
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| debug.js | ||
| http.js | ||
| https.js | ||
| index.js | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
Follow Redirects
Drop-in replacement for Node's http and https modules that automatically follows redirects.
follow-redirects provides request and get
methods that behave identically to those found on the native http and https
modules, with the exception that they will seamlessly follow redirects.
const { http, https } = require('follow-redirects');
http.get('http://en.wikipedia.org/', response => {
response.on('data', chunk => {
console.log(chunk);
});
}).on('error', err => {
console.error(err);
});
You can inspect the final redirected URL through the responseUrl property on the response.
If no redirection happened, responseUrl is the original request URL.
const request = https.request({
host: 'en.wikipedia.org',
path: '/',
}, response => {
console.log(response.responseUrl);
// 'http://duckduckgo.com/robots.txt'
});
request.end();
Options
Global options
Global options are set directly on the follow-redirects module:
const followRedirects = require('follow-redirects');
followRedirects.maxRedirects = 10;
followRedirects.maxBodyLength = 20 * 1024 * 1024; // 20 MB
The following global options are supported:
-
maxRedirects(default:21) – sets the maximum number of allowed redirects; if exceeded, an error will be emitted. -
maxBodyLength(default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted.
Per-request options
Per-request options are set by passing an options object:
const url = require('url');
const { http, https } = require('follow-redirects');
const options = url.parse('http://en.wikipedia.org/');
options.maxRedirects = 10;
options.beforeRedirect = (options, response, request) => {
// Use this to adjust the request options upon redirecting,
// to inspect the latest response headers,
// or to cancel the request by throwing an error
// response.headers = the redirect response headers
// response.statusCode = the redirect response code (eg. 301, 307, etc.)
// request.url = the requested URL that resulted in a redirect
// request.headers = the headers in the request that resulted in a redirect
// request.method = the method of the request that resulted in a redirect
if (options.hostname === "example.org") {
options.auth = "user:password";
}
};
http.request(options);
In addition to the standard HTTP and HTTPS options, the following per-request options are supported:
-
followRedirects(default:true) – whether redirects should be followed. -
maxRedirects(default:21) – sets the maximum number of allowed redirects; if exceeded, an error will be emitted. -
maxBodyLength(default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted. -
beforeRedirect(default:undefined) – optionally change the requestoptionson redirects, or abort the request by throwing an error. -
agents(default:undefined) – sets theagentoption per protocol, since HTTP and HTTPS use different agents. Example value:{ http: new http.Agent(), https: new https.Agent() } -
trackRedirects(default:false) – whether to store the redirected response details into theredirectsarray on the response object. -
sensitiveHeaders(default:[]) – names of headers to omit when making redirected requests (such asX-API-Key,X-Auth-Token…)
Advanced usage
By default, follow-redirects will use the Node.js default implementations
of http
and https.
To enable features such as caching and/or intermediate request tracking,
you might instead want to wrap follow-redirects around custom protocol implementations:
const { http, https } = require('follow-redirects').wrap({
http: require('your-custom-http'),
https: require('your-custom-https'),
});
Such custom protocols only need an implementation of the request method.
Browser Usage
Due to the way the browser works,
the http and https browser equivalents perform redirects by default.
By requiring follow-redirects this way:
const http = require('follow-redirects/http');
const https = require('follow-redirects/https');
you can easily tell webpack and friends to replace
follow-redirect by the built-in versions:
{
"follow-redirects/http" : "http",
"follow-redirects/https" : "https"
}
Contributing
Pull Requests are always welcome. Please file an issue
detailing your proposal before you invest your valuable time. Additional features and bug fixes should be accompanied
by tests. You can run the test suite locally with a simple npm test command.
Debug Logging
follow-redirects uses the excellent debug for logging. To turn on logging
set the environment variable DEBUG=follow-redirects for debug output from just this module. When running the test
suite it is sometimes advantageous to set DEBUG=* to see output from the express server as well.