ai-or-die 0.1.6 → 0.1.7
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/bin/ai-or-die.js +12 -22
- package/package.json +1 -1
package/bin/ai-or-die.js
CHANGED
|
@@ -54,15 +54,14 @@ async function main() {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
// Handle authentication logic
|
|
57
|
+
// Tunnel mode disables auth — the tunnel itself controls access
|
|
57
58
|
let authToken = null;
|
|
58
|
-
let noAuth = options.disableAuth === true;
|
|
59
|
+
let noAuth = options.disableAuth === true || options.tunnel === true;
|
|
59
60
|
|
|
60
61
|
if (!noAuth) {
|
|
61
62
|
if (options.auth) {
|
|
62
|
-
// Use provided token
|
|
63
63
|
authToken = options.auth;
|
|
64
64
|
} else {
|
|
65
|
-
// Generate random token
|
|
66
65
|
authToken = generateRandomToken();
|
|
67
66
|
}
|
|
68
67
|
}
|
|
@@ -91,35 +90,26 @@ async function main() {
|
|
|
91
90
|
console.log(`Plan: ${options.plan}`);
|
|
92
91
|
console.log(`Aliases: Claude → "${serverOptions.claudeAlias}", Codex → "${serverOptions.codexAlias}", Copilot → "${serverOptions.copilotAlias}", Gemini → "${serverOptions.geminiAlias}", Terminal → "${serverOptions.terminalAlias}"`);
|
|
93
92
|
|
|
94
|
-
// Display authentication status
|
|
95
|
-
if (
|
|
93
|
+
// Display authentication status
|
|
94
|
+
if (options.tunnel) {
|
|
95
|
+
console.log('\n🌍 TUNNEL MODE — authentication disabled (tunnel controls access)');
|
|
96
|
+
} else if (noAuth) {
|
|
96
97
|
console.log('\n⚠️ AUTHENTICATION DISABLED - Server is accessible without a token');
|
|
97
98
|
console.log(' (Use without --disable-auth flag for security in production)');
|
|
98
99
|
} else {
|
|
99
100
|
console.log('\n🔐 AUTHENTICATION ENABLED');
|
|
100
|
-
if (options.auth) {
|
|
101
|
-
console.log(' Using provided authentication token');
|
|
102
|
-
} else {
|
|
103
|
-
console.log(' Generated random authentication token:');
|
|
104
|
-
console.log(` \x1b[1m\x1b[33m${authToken}\x1b[0m`);
|
|
105
|
-
console.log(' \x1b[2mSave this token - you\'ll need it to access the interface\x1b[0m');
|
|
106
|
-
}
|
|
107
101
|
}
|
|
108
102
|
|
|
109
103
|
const server = await startServer(serverOptions);
|
|
110
104
|
|
|
111
105
|
const protocol = options.https ? 'https' : 'http';
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
106
|
+
const baseUrl = `${protocol}://localhost:${port}`;
|
|
107
|
+
// For localhost with auth, embed token in URL so user can just click it
|
|
108
|
+
const url = authToken ? `${baseUrl}?token=${authToken}` : baseUrl;
|
|
115
109
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
console.log(' Use your provided authentication token to access the interface');
|
|
120
|
-
} else {
|
|
121
|
-
console.log(` Enter this token when prompted: \x1b[1m\x1b[33m${authToken}\x1b[0m`);
|
|
122
|
-
}
|
|
110
|
+
console.log(`\n🚀 ai-or-die is running at: \x1b[1m\x1b[4m${url}\x1b[0m`);
|
|
111
|
+
if (authToken) {
|
|
112
|
+
console.log(` Auth token: \x1b[1m\x1b[33m${authToken}\x1b[0m`);
|
|
123
113
|
}
|
|
124
114
|
|
|
125
115
|
// Dev tunnel or browser open
|