@zeroexcore/tuna 0.1.0 → 0.1.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/.turbo/turbo-test.log +4 -4
- package/.turbo/turbo-typecheck.log +1 -1
- package/README.md +161 -0
- package/package.json +1 -1
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
> @zeroexcore/tuna@0.1.
|
|
2
|
+
> @zeroexcore/tuna@0.1.1 test /home/runner/work/tuna/tuna/packages/cli
|
|
3
3
|
> vitest run
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
[1m[46m RUN [49m[22m [36mv4.0.18 [39m[90m/home/runner/work/tuna/tuna/packages/cli[39m
|
|
7
7
|
|
|
8
|
-
[32m✓[39m tests/unit/config.test.ts [2m([22m[2m23 tests[22m[2m)[22m[32m
|
|
8
|
+
[32m✓[39m tests/unit/config.test.ts [2m([22m[2m23 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
9
9
|
|
|
10
10
|
[2m Test Files [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
11
11
|
[2m Tests [22m [1m[32m23 passed[39m[22m[90m (23)[39m
|
|
12
|
-
[2m Start at [22m 07:
|
|
13
|
-
[2m Duration [22m
|
|
12
|
+
[2m Start at [22m 07:15:46
|
|
13
|
+
[2m Duration [22m 184ms[2m (transform 48ms, setup 0ms, import 66ms, tests 8ms, environment 0ms)[22m
|
|
14
14
|
|
package/README.md
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# @zeroexcore/tuna
|
|
2
|
+
|
|
3
|
+
**Cloudflare Tunnels for humans.** Wrap any dev command with a secure, persistent tunnel.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@zeroexcore/tuna)
|
|
6
|
+
[](https://github.com/zeroexcore/tuna/actions/workflows/ci.yml)
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
8
|
+
|
|
9
|
+
## Links
|
|
10
|
+
|
|
11
|
+
- **Website:** [tuna.oxc.sh](https://tuna.oxc.sh)
|
|
12
|
+
- **Documentation:** [docs.tuna.oxc.sh](https://docs.tuna.oxc.sh)
|
|
13
|
+
- **GitHub:** [github.com/zeroexcore/tuna](https://github.com/zeroexcore/tuna)
|
|
14
|
+
|
|
15
|
+
## What is tuna?
|
|
16
|
+
|
|
17
|
+
tuna wraps your development server commands with automatic Cloudflare Tunnel setup. No more manual tunnel configuration, DNS management, or random ngrok URLs.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Before: Manual tunnel setup
|
|
21
|
+
cloudflared tunnel create my-tunnel
|
|
22
|
+
cloudflared tunnel route dns my-tunnel my-app.example.com
|
|
23
|
+
cloudflared tunnel run my-tunnel &
|
|
24
|
+
vite dev
|
|
25
|
+
|
|
26
|
+
# After: Just prefix with tuna
|
|
27
|
+
tuna vite dev
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Your local server is instantly available at `https://my-app.example.com`.
|
|
31
|
+
|
|
32
|
+
## Features
|
|
33
|
+
|
|
34
|
+
- **Free custom domains** - Use your own domain, no random URLs
|
|
35
|
+
- **Persistent tunnels** - Runs as a service, survives terminal restarts
|
|
36
|
+
- **Team collaboration** - `$USER` variable gives each dev their own subdomain
|
|
37
|
+
- **Zero Trust Access** - Restrict access by email/domain in config
|
|
38
|
+
- **Transparent wrapper** - Colors, TTY, exit codes all preserved
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install -g @zeroexcore/tuna
|
|
44
|
+
# or
|
|
45
|
+
pnpm add -g @zeroexcore/tuna
|
|
46
|
+
# or
|
|
47
|
+
npx @zeroexcore/tuna <command>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Quick Start
|
|
51
|
+
|
|
52
|
+
### 1. Login to Cloudflare
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
tuna --login
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
You'll need a Cloudflare API token with these permissions:
|
|
59
|
+
- Account → Cloudflare Tunnel → Edit
|
|
60
|
+
- Account → Access: Apps and Policies → Edit
|
|
61
|
+
- Zone → DNS → Edit
|
|
62
|
+
- Account → Account Settings → Read
|
|
63
|
+
|
|
64
|
+
### 2. Configure your project
|
|
65
|
+
|
|
66
|
+
Add to `package.json`:
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"tuna": {
|
|
71
|
+
"forward": "my-app.example.com",
|
|
72
|
+
"port": 3000
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Or use the interactive setup:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
tuna --init
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### 3. Run your dev server
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
tuna vite dev
|
|
87
|
+
# or
|
|
88
|
+
tuna npm run dev
|
|
89
|
+
# or
|
|
90
|
+
tuna next dev
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
That's it! Your local server is now available at your custom domain.
|
|
94
|
+
|
|
95
|
+
## Team Collaboration
|
|
96
|
+
|
|
97
|
+
Use `$USER` to give each developer their own subdomain:
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"tuna": {
|
|
102
|
+
"forward": "$USER-api.example.com",
|
|
103
|
+
"port": 3000
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
- Alice runs `tuna vite dev` → `https://alice-api.example.com`
|
|
109
|
+
- Bob runs `tuna vite dev` → `https://bob-api.example.com`
|
|
110
|
+
|
|
111
|
+
## Access Control
|
|
112
|
+
|
|
113
|
+
Restrict who can access your tunnel:
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"tuna": {
|
|
118
|
+
"forward": "staging.example.com",
|
|
119
|
+
"port": 3000,
|
|
120
|
+
"access": ["@mycompany.com", "contractor@gmail.com"]
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Commands
|
|
126
|
+
|
|
127
|
+
| Command | Description |
|
|
128
|
+
|---------|-------------|
|
|
129
|
+
| `tuna <command>` | Wrap command with tunnel |
|
|
130
|
+
| `tuna --init` | Interactive project setup |
|
|
131
|
+
| `tuna --login` | Setup Cloudflare credentials |
|
|
132
|
+
| `tuna --list` | List all tunnels |
|
|
133
|
+
| `tuna --stop` | Stop cloudflared service |
|
|
134
|
+
| `tuna --delete [name]` | Delete tunnel |
|
|
135
|
+
| `tuna --help` | Show help |
|
|
136
|
+
| `tuna --version` | Show version |
|
|
137
|
+
|
|
138
|
+
## Configuration
|
|
139
|
+
|
|
140
|
+
| Field | Type | Required | Description |
|
|
141
|
+
|-------|------|:--------:|-------------|
|
|
142
|
+
| `forward` | `string` | Yes | Domain to expose (supports `$USER`, `$TUNA_USER`) |
|
|
143
|
+
| `port` | `number` | Yes | Local port to forward |
|
|
144
|
+
| `access` | `string[]` | No | Email addresses/domains for access control |
|
|
145
|
+
|
|
146
|
+
## Requirements
|
|
147
|
+
|
|
148
|
+
- Node.js 18+
|
|
149
|
+
- macOS (Linux/Windows support planned)
|
|
150
|
+
- A Cloudflare account with a domain
|
|
151
|
+
|
|
152
|
+
## Security
|
|
153
|
+
|
|
154
|
+
- **Credentials** stored in macOS Keychain with biometric auth
|
|
155
|
+
- **No secrets** in package.json or environment variables
|
|
156
|
+
- **Zero Trust Access** for fine-grained access control
|
|
157
|
+
- **TLS everywhere** via Cloudflare
|
|
158
|
+
|
|
159
|
+
## License
|
|
160
|
+
|
|
161
|
+
MIT - see [LICENSE](https://github.com/zeroexcore/tuna/blob/main/LICENSE) for details.
|