mygensite 2.4.0 → 2.5.1
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.en.md +4 -4
- package/README.ko.md +4 -4
- package/README.md +2 -2
- package/lib/deploy.js +5 -1
- package/lib/validate.js +4 -4
- package/package.json +1 -1
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Share your localhost or static sites via mygen.site with guided access control, 2-layer security, rules, and hooks",
|
|
9
|
-
"version": "2.
|
|
9
|
+
"version": "2.5.1"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
13
13
|
"name": "mygensite",
|
|
14
14
|
"source": "./",
|
|
15
15
|
"description": "Share what you built via mygen.site — tunnels and static deploys with interactive access control, rules for safe defaults and deployment awareness, hooks for git/tunnel safety, and multi-tunnel support",
|
|
16
|
-
"version": "2.
|
|
16
|
+
"version": "2.5.1",
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "TheConnectSoft"
|
|
19
19
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mygensite",
|
|
3
3
|
"description": "Share your localhost or static sites via mygen.site — guided access control, 2-layer security, rules for safe defaults, hooks for git/tunnel safety, multi-tunnel support",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.5.1",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "TheConnectSoft",
|
|
7
7
|
"email": "dev@theconnectsoft.com",
|
package/README.en.md
CHANGED
|
@@ -167,7 +167,7 @@ await tunnel.extendTTL(3600);
|
|
|
167
167
|
|
|
168
168
|
### Slug (subdomain)
|
|
169
169
|
|
|
170
|
-
-
|
|
170
|
+
- 4–63 characters, lowercase letters (`a-z`), numbers (`0-9`), and hyphens (`-`) only
|
|
171
171
|
- Must start and end with a letter or number (not a hyphen)
|
|
172
172
|
- Reserved words cannot be used: `www`, `api`, `dashboard`, `admin`, `mail`, `ftp`, `static`, `docs`, `status`, `health`, `internal`, `tunnel`, `app`, `web`
|
|
173
173
|
- A slug used as a tunnel cannot be reused for static deployment (and vice versa). Delete the existing service first.
|
|
@@ -220,7 +220,7 @@ const tunnel = await mygensite({ port: 3000, subdomain: 'INVALID' });
|
|
|
220
220
|
const { validate } = require('mygensite');
|
|
221
221
|
|
|
222
222
|
validate.validateSlug('my-app'); // { valid: true }
|
|
223
|
-
validate.validateSlug('AB'); // { valid: false, error: 'Slug must be
|
|
223
|
+
validate.validateSlug('AB'); // { valid: false, error: 'Slug must be 4-63 characters' }
|
|
224
224
|
validate.validateFilePath('assets/x.js');// { valid: true, cleaned: 'assets/x.js' }
|
|
225
225
|
validate.validateFilePath('../etc'); // { valid: false, error: 'Path traversal...' }
|
|
226
226
|
validate.validateTTL(30); // { valid: false, error: 'TTL must be...' }
|
|
@@ -233,7 +233,7 @@ validate.validateAccessMode('public'); // { valid: true }
|
|
|
233
233
|
|
|
234
234
|
| status | error | description | fix |
|
|
235
235
|
| --- | --- | --- | --- |
|
|
236
|
-
| 400 | `invalid_slug` | Slug must be
|
|
236
|
+
| 400 | `invalid_slug` | Slug must be 4-63 chars, lowercase alphanumeric and hyphens | Use a valid slug format, e.g. `my-app-1` |
|
|
237
237
|
| 400 | `reserved_slug` | This slug is reserved and cannot be used | Choose a different slug. Reserved: www, api, dashboard, admin, etc. |
|
|
238
238
|
| 400 | `invalid_ttl` | TTL must be between 60 and 86400 seconds | Use a value between 60 (1 min) and 86400 (24 hours) |
|
|
239
239
|
| 400 | `invalid_access` | Access must be: public, ip | Use one of the valid access modes |
|
|
@@ -414,7 +414,7 @@ await site.delete(true);
|
|
|
414
414
|
| status | error | description | fix |
|
|
415
415
|
| --- | --- | --- | --- |
|
|
416
416
|
| 400 | `no_files` | At least one file is required | Provide `directory` or `files` option |
|
|
417
|
-
| 400 | `invalid_slug` | Invalid slug format | Use
|
|
417
|
+
| 400 | `invalid_slug` | Invalid slug format | Use 4-63 chars, lowercase alphanumeric and hyphens |
|
|
418
418
|
| 400 | `reserved_slug` | Slug is reserved | Choose a different slug |
|
|
419
419
|
| 409 | `slug_in_use` | Slug taken by another owner | Use a different slug |
|
|
420
420
|
| 409 | `type_conflict` | Slug is in use as a tunnel | Use a different slug for static deployment |
|
package/README.ko.md
CHANGED
|
@@ -164,7 +164,7 @@ await tunnel.extendTTL(3600);
|
|
|
164
164
|
|
|
165
165
|
### Slug (서브도메인)
|
|
166
166
|
|
|
167
|
-
-
|
|
167
|
+
- 4–63자, 소문자 영문(`a-z`), 숫자(`0-9`), 하이픈(`-`)만 허용
|
|
168
168
|
- 영문자 또는 숫자로 시작/끝나야 함 (하이픈으로 시작/끝 불가)
|
|
169
169
|
- 예약어 사용 불가: `www`, `api`, `dashboard`, `admin`, `mail`, `ftp`, `static`, `docs`, `status`, `health`, `internal`, `tunnel`, `app`, `web`
|
|
170
170
|
- 터널로 사용 중인 slug에 정적 배포 불가 (반대도 동일). 기존 서비스를 먼저 삭제해야 함.
|
|
@@ -217,7 +217,7 @@ const tunnel = await mygensite({ port: 3000, subdomain: 'INVALID' });
|
|
|
217
217
|
const { validate } = require('mygensite');
|
|
218
218
|
|
|
219
219
|
validate.validateSlug('my-app'); // { valid: true }
|
|
220
|
-
validate.validateSlug('AB'); // { valid: false, error: 'Slug must be
|
|
220
|
+
validate.validateSlug('AB'); // { valid: false, error: 'Slug must be 4-63 characters' }
|
|
221
221
|
validate.validateFilePath('assets/x.js');// { valid: true, cleaned: 'assets/x.js' }
|
|
222
222
|
validate.validateFilePath('../etc'); // { valid: false, error: '경로 탈출 불가...' }
|
|
223
223
|
validate.validateTTL(30); // { valid: false, error: 'TTL 범위 초과...' }
|
|
@@ -230,7 +230,7 @@ validate.validateAccessMode('public'); // { valid: true }
|
|
|
230
230
|
|
|
231
231
|
| 상태 | 에러 | 설명 | 해결 |
|
|
232
232
|
| --- | --- | --- | --- |
|
|
233
|
-
| 400 | `invalid_slug` | slug는
|
|
233
|
+
| 400 | `invalid_slug` | slug는 4-63자, 소문자 영숫자와 하이픈만 가능 | 올바른 형식 사용, 예: `my-app-1` |
|
|
234
234
|
| 400 | `reserved_slug` | 예약된 slug로 사용 불가 | 다른 slug 사용. 예약어: www, api, dashboard, admin 등 |
|
|
235
235
|
| 400 | `invalid_ttl` | TTL은 60-86400초 범위여야 함 | 60(1분) ~ 86400(24시간) 사이 값 사용 |
|
|
236
236
|
| 400 | `invalid_access` | 접근 모드는 public, ip 중 하나 | `public` 또는 `ip` 중 하나를 지정 |
|
|
@@ -412,7 +412,7 @@ await site.delete(true);
|
|
|
412
412
|
| 상태 | 에러 | 설명 | 해결 |
|
|
413
413
|
| --- | --- | --- | --- |
|
|
414
414
|
| 400 | `no_files` | 최소 1개 파일 필요 | `directory` 또는 `files` 옵션 제공 |
|
|
415
|
-
| 400 | `invalid_slug` | 잘못된 slug 형식 |
|
|
415
|
+
| 400 | `invalid_slug` | 잘못된 slug 형식 | 4-63자, 소문자 영숫자와 하이픈 사용 |
|
|
416
416
|
| 400 | `reserved_slug` | 예약된 slug | 다른 slug 사용 |
|
|
417
417
|
| 409 | `slug_in_use` | 다른 소유자가 사용 중인 slug | 다른 slug 사용 |
|
|
418
418
|
| 409 | `type_conflict` | 터널로 사용 중인 slug | 정적 배포용으로 다른 slug 사용 |
|
package/README.md
CHANGED
|
@@ -182,7 +182,7 @@ Full runnable examples in [`examples/`](https://github.com/theconnectsoft/mygens
|
|
|
182
182
|
|
|
183
183
|
### Slug (subdomain)
|
|
184
184
|
|
|
185
|
-
-
|
|
185
|
+
- 4–63 characters, lowercase letters, numbers, and hyphens only
|
|
186
186
|
- Must start and end with a letter or number (not a hyphen)
|
|
187
187
|
- Reserved: `www`, `api`, `dashboard`, `admin`, `docs`, `status`, `health`, etc.
|
|
188
188
|
- A slug used as a tunnel cannot be reused for static deploy (and vice versa)
|
|
@@ -224,7 +224,7 @@ validate.validateTTL(30); // { valid: false, error: '...' }
|
|
|
224
224
|
|
|
225
225
|
| status | error | when | fix |
|
|
226
226
|
|--------|-------|------|-----|
|
|
227
|
-
| 400 | `invalid_slug` | slug format invalid | use
|
|
227
|
+
| 400 | `invalid_slug` | slug format invalid | use 4-63 chars, lowercase alphanum + hyphen (e.g. `my-app-1`) |
|
|
228
228
|
| 400 | `reserved_slug` | slug is reserved | choose different slug. reserved: www, api, dashboard, admin, etc. |
|
|
229
229
|
| 400 | `invalid_ttl` | TTL out of range | tunnels: 60-86400s, static: 0 (unlimited) or 60-259200s. Unlimited requires auth. |
|
|
230
230
|
| 400 | `invalid_access` | bad access mode | use: public, ip |
|
package/lib/deploy.js
CHANGED
|
@@ -211,7 +211,11 @@ async function deploy(options) {
|
|
|
211
211
|
headers.Authorization = `Bearer ${apiToken}`;
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
const res = await axios.post(`${host}/api/deploy`, form, {
|
|
214
|
+
const res = await axios.post(`${host}/api/deploy`, form, {
|
|
215
|
+
headers,
|
|
216
|
+
maxBodyLength: 200 * 1024 * 1024,
|
|
217
|
+
maxContentLength: 200 * 1024 * 1024,
|
|
218
|
+
});
|
|
215
219
|
const data = res.data;
|
|
216
220
|
|
|
217
221
|
debug('deploy response: %j', data);
|
package/lib/validate.js
CHANGED
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
// Must match: server/src/api/routes/tunnels.ts SLUG_REGEX
|
|
11
|
-
const SLUG_REGEX = /^[a-z0-9][a-z0-9-]{
|
|
11
|
+
const SLUG_REGEX = /^[a-z0-9][a-z0-9-]{2,61}[a-z0-9]$/;
|
|
12
12
|
|
|
13
13
|
const RESERVED_SLUGS = new Set([
|
|
14
14
|
'www', 'api', 'dashboard', 'admin', 'mail',
|
|
15
15
|
'ftp', 'static', 'docs', 'status', 'health',
|
|
16
|
-
'internal', 'tunnel', 'app', 'web',
|
|
16
|
+
'internal', 'tunnel', 'app', 'web', 'mcp',
|
|
17
17
|
]);
|
|
18
18
|
|
|
19
19
|
// Must match: server/src/api/routes/deploy.ts SAFE_PATH_SEGMENT
|
|
@@ -31,8 +31,8 @@ function validateSlug(slug) {
|
|
|
31
31
|
if (!slug || typeof slug !== 'string') {
|
|
32
32
|
return { valid: false, error: 'Slug is required' };
|
|
33
33
|
}
|
|
34
|
-
if (slug.length <
|
|
35
|
-
return { valid: false, error: 'Slug must be
|
|
34
|
+
if (slug.length < 4 || slug.length > 63) {
|
|
35
|
+
return { valid: false, error: 'Slug must be 4-63 characters' };
|
|
36
36
|
}
|
|
37
37
|
if (!SLUG_REGEX.test(slug)) {
|
|
38
38
|
return { valid: false, error: 'Slug must be lowercase alphanumeric and hyphens, starting and ending with alphanumeric' };
|