forked from pterodactyl/wings
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocs2.htom
More file actions
482 lines (458 loc) · 32.9 KB
/
Copy pathdocs2.htom
File metadata and controls
482 lines (458 loc) · 32.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
<!DOCTYPE html>
<html lang="en">
<head>
<title>Better Files Manager Ainx guide</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
<style>
::-webkit-scrollbar { height: 8px; }
::-webkit-scrollbar-track { background-color: #57534e; border-radius: 10px; }
::-webkit-scrollbar-thumb { background-color: #b8aca1; border-radius: 10px; }
</style>
</head>
<body class="bg-stone-800">
<div class="justify-center items-center flex flex-col px-3 md:px-4 pb-20 gap-4">
<h1 class="text-white font-bold text-2xl md:text-4xl mt-20">Better Files Manager - V-A.1.0.0</h1>
<p class="text-stone-400 text-[16px] font-medium">Installation guide</p>
<h1 class="mt-10 text-white font-bold text-lg">Install using install script</h1>
<div class="flex flex-col md:flex-row gap-5 w-full max-w-[1420px] justify-center">
<div class="code-block bg-emerald-600 rounded-lg p-3 flex flex-row justify-between items-center gap-2 mt-2 w-full md:w-auto">
<div class="flex items-center gap-2 min-w-0">
<span class="text-emerald-200 font-mono shrink-0">$</span>
<code class="text-white font-mono text-sm break-all">ainx install betterfilesmanager.ainx</code>
</div>
<button onclick="copyButton(this)" class="bg-emerald-700 text-white px-3 py-1 rounded cursor-pointer hover:bg-emerald-800 transition duration-200 shrink-0">
<i class="fa-solid fa-copy"></i>
</button>
</div>
<div class="code-block bg-blue-600 rounded-lg p-3 flex flex-row justify-between items-center gap-2 mt-2 w-full md:w-auto">
<div class="flex items-center gap-2 min-w-0">
<span class="text-blue-200 font-mono shrink-0">$</span>
<code class="text-white font-mono text-sm break-all">blueprint -install betterfilesmanager</code>
</div>
<button onclick="copyButton(this)" class="bg-blue-700 text-white px-3 py-1 rounded cursor-pointer hover:bg-blue-800 transition duration-200 shrink-0">
<i class="fa-solid fa-copy"></i>
</button>
</div>
</div>
<div class="flex items-center gap-4 w-[200px] mt-5">
<div class="flex-1 h-px bg-stone-500"></div>
<p class="text-stone-400 font-bold">Or</p>
<div class="flex-1 h-px bg-stone-500"></div>
</div>
<h1 class="mt-2 text-white font-bold text-lg mb-10">Using manual steps</h1>
<div class="w-full max-w-[1420px] bg-yellow-500/15 border border-yellow-500/60 border-l-4 rounded-lg p-4 mt-10">
<div class="flex items-start gap-3">
<i class="fa-solid fa-triangle-exclamation text-yellow-300 mt-1"></i>
<div>
<h2 class="text-yellow-100 font-bold text-lg">Only do this if you used the old standalone/manual install</h2>
<p class="text-yellow-100/90 mt-2">
If this is a fresh Blueprint or Ainx install, skip the cleanup section. If your Panel already has the old manual standalone version, remove those manual edits first, then install with Ainx.
</p>
</div>
</div>
</div>
<div class="w-full max-w-[1420px] bg-stone-700 rounded-lg p-4">
<h2 class="text-white font-bold text-xl">Old standalone cleanup checklist</h2>
<p class="text-stone-300 mt-3">
These are the old manual Panel edits to reverse before switching to Ainx. Red blocks are code or files to remove. Green blocks are code to restore. Each code box scrolls if the snippet is longer than the visible area.
</p>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-4 mt-5">
<div class="bg-stone-800 rounded-lg p-4 min-w-0">
<h3 class="text-white font-bold">resources/scripts/routers/routes.ts</h3>
<p class="text-stone-300 mt-2">1. Remove this Better Files import if it exists:</p>
<div class="code-block bg-stone-950 rounded-lg p-3 mt-2 border-l-4 border-red-500 max-h-48 overflow-auto">
<div class="flex justify-end mb-2">
<button onclick="copyButton(this)" class="bg-stone-700 text-white px-3 py-1 rounded cursor-pointer hover:bg-stone-600 transition duration-200 text-sm">
<i class="fa-solid fa-copy"></i> Copy
</button>
</div>
<pre><code class="text-white text-sm">import { BetterFileManagerContainer } from '@/components/server/betterfiles';</code></pre>
</div>
<p class="text-stone-300 mt-3">2. Remove this old standalone route replacement:</p>
<div class="code-block bg-stone-950 rounded-lg p-3 mt-2 border-l-4 border-red-500 max-h-56 overflow-auto">
<div class="flex justify-end mb-2">
<button onclick="copyButton(this)" class="bg-stone-700 text-white px-3 py-1 rounded cursor-pointer hover:bg-stone-600 transition duration-200 text-sm">
<i class="fa-solid fa-copy"></i> Copy
</button>
</div>
<pre><code class="text-white text-sm">{
path: '/files',
permission: 'file.*',
name: 'Files',
component: BetterFileManagerContainer,
},</code></pre>
</div>
<p class="text-stone-300 mt-3">3. Restore the normal Pterodactyl file manager routes:</p>
<div class="code-block bg-stone-950 rounded-lg p-3 mt-2 border-l-4 border-emerald-500 max-h-64 overflow-auto">
<div class="flex justify-end mb-2">
<button onclick="copyButton(this)" class="bg-stone-700 text-white px-3 py-1 rounded cursor-pointer hover:bg-stone-600 transition duration-200 text-sm">
<i class="fa-solid fa-copy"></i> Copy
</button>
</div>
<pre><code class="text-white text-sm">{
path: '/files',
permission: 'file.*',
name: 'Files',
component: FileManagerContainer,
},
{
path: '/files/:action(edit|new)',
permission: 'file.*',
name: undefined,
component: FileEditContainer,
},</code></pre>
</div>
</div>
<div class="bg-stone-800 rounded-lg p-4 min-w-0">
<h3 class="text-white font-bold">routes/api-client.php</h3>
<p class="text-stone-300 mt-2">Remove this manual route include if it exists:</p>
<div class="code-block bg-stone-950 rounded-lg p-3 mt-2 border-l-4 border-red-500 max-h-48 overflow-auto">
<div class="flex justify-end mb-2">
<button onclick="copyButton(this)" class="bg-stone-700 text-white px-3 py-1 rounded cursor-pointer hover:bg-stone-600 transition duration-200 text-sm">
<i class="fa-solid fa-copy"></i> Copy
</button>
</div>
<pre><code class="text-white text-sm">require __DIR__ . '/api-better-files.php';</code></pre>
</div>
<p class="text-stone-300 mt-3">Then delete this old standalone route file if it exists:</p>
<div class="code-block bg-stone-950 rounded-lg p-3 mt-2 border-l-4 border-red-500 max-h-48 overflow-auto">
<div class="flex justify-end mb-2">
<button onclick="copyButton(this)" class="bg-stone-700 text-white px-3 py-1 rounded cursor-pointer hover:bg-stone-600 transition duration-200 text-sm">
<i class="fa-solid fa-copy"></i> Copy
</button>
</div>
<pre><code class="text-white text-sm">routes/api-better-files.php</code></pre>
</div>
</div>
<div class="bg-stone-800 rounded-lg p-4 min-w-0">
<h3 class="text-white font-bold">routes/admin.php</h3>
<p class="text-stone-300 mt-2">Remove these old standalone admin routes if they exist:</p>
<div class="code-block bg-stone-950 rounded-lg p-3 mt-2 border-l-4 border-red-500 max-h-56 overflow-auto">
<div class="flex justify-end mb-2">
<button onclick="copyButton(this)" class="bg-stone-700 text-white px-3 py-1 rounded cursor-pointer hover:bg-stone-600 transition duration-200 text-sm">
<i class="fa-solid fa-copy"></i> Copy
</button>
</div>
<pre><code class="text-white text-sm">Route::get('/better-files', [Admin\Settings\BetterFilesController::class, 'index'])->name('admin.settings.betterfiles');
Route::patch('/better-files', [Admin\Settings\BetterFilesController::class, 'update']);</code></pre>
</div>
</div>
<div class="bg-stone-800 rounded-lg p-4 min-w-0">
<h3 class="text-white font-bold">resources/views/partials/admin/settings/nav.blade.php</h3>
<p class="text-stone-300 mt-2">Remove this old Better Files settings navigation link if it exists:</p>
<div class="code-block bg-stone-950 rounded-lg p-3 mt-2 border-l-4 border-red-500 max-h-48 overflow-auto">
<div class="flex justify-end mb-2">
<button onclick="copyButton(this)" class="bg-stone-700 text-white px-3 py-1 rounded cursor-pointer hover:bg-stone-600 transition duration-200 text-sm">
<i class="fa-solid fa-copy"></i> Copy
</button>
</div>
<pre><code class="text-white text-sm"><li @if($activeTab === 'better-files')class="active"@endif><a href="{{ route('admin.settings.betterfiles') }}">Better Files</a></li></code></pre>
</div>
</div>
<div class="bg-stone-800 rounded-lg p-4 min-w-0">
<h3 class="text-white font-bold">app/Console/Kernel.php</h3>
<p class="text-stone-300 mt-2">Remove this old standalone trash cleanup scheduler entry if it exists:</p>
<div class="code-block bg-stone-950 rounded-lg p-3 mt-2 border-l-4 border-red-500 max-h-48 overflow-auto">
<div class="flex justify-end mb-2">
<button onclick="copyButton(this)" class="bg-stone-700 text-white px-3 py-1 rounded cursor-pointer hover:bg-stone-600 transition duration-200 text-sm">
<i class="fa-solid fa-copy"></i> Copy
</button>
</div>
<pre><code class="text-white text-sm">$schedule->command(\Pterodactyl\Console\Commands\BetterFilesTrashCleanupCommand::class)->daily();</code></pre>
</div>
</div>
<div class="bg-stone-800 rounded-lg p-4 min-w-0">
<h3 class="text-white font-bold">webpack.config.js</h3>
<p class="text-stone-300 mt-2">Remove the old standalone Monaco plugin import if it was added manually:</p>
<div class="code-block bg-stone-950 rounded-lg p-3 mt-2 border-l-4 border-red-500 max-h-48 overflow-auto">
<div class="flex justify-end mb-2">
<button onclick="copyButton(this)" class="bg-stone-700 text-white px-3 py-1 rounded cursor-pointer hover:bg-stone-600 transition duration-200 text-sm">
<i class="fa-solid fa-copy"></i> Copy
</button>
</div>
<pre><code class="text-white text-sm">const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');</code></pre>
</div>
<p class="text-stone-300 mt-3">Remove the old manually added Monaco plugin entry if it exists:</p>
<div class="code-block bg-stone-950 rounded-lg p-3 mt-2 border-l-4 border-red-500 max-h-56 overflow-auto">
<div class="flex justify-end mb-2">
<button onclick="copyButton(this)" class="bg-stone-700 text-white px-3 py-1 rounded cursor-pointer hover:bg-stone-600 transition duration-200 text-sm">
<i class="fa-solid fa-copy"></i> Copy
</button>
</div>
<pre><code class="text-white text-sm">new MonacoWebpackPlugin({
filename: isProduction ? 'monaco/[name].[contenthash:8].worker.js' : 'monaco/[name].worker.js',
publicPath: process.env.WEBPACK_PUBLIC_PATH || '/assets/',
}),</code></pre>
</div>
<p class="text-stone-300 mt-3">If you added this rule only for the standalone install, remove it too:</p>
<div class="code-block bg-stone-950 rounded-lg p-3 mt-2 border-l-4 border-red-500 max-h-48 overflow-auto">
<div class="flex justify-end mb-2">
<button onclick="copyButton(this)" class="bg-stone-700 text-white px-3 py-1 rounded cursor-pointer hover:bg-stone-600 transition duration-200 text-sm">
<i class="fa-solid fa-copy"></i> Copy
</button>
</div>
<pre><code class="text-white text-sm">{
test: /\.(woff|woff2|ttf)$/i,
type: 'asset/resource',
},</code></pre>
</div>
</div>
<div class="bg-stone-800 rounded-lg p-4 min-w-0 lg:col-span-2">
<h3 class="text-white font-bold">Finish cleanup</h3>
<p class="text-stone-300 mt-2">After removing the old standalone edits above, clear caches and rebuild the Panel:</p>
<div class="code-block bg-stone-950 rounded-lg p-3 mt-2 border-l-4 border-emerald-500 max-h-48 overflow-auto">
<div class="flex justify-end mb-2">
<button onclick="copyButton(this)" class="bg-stone-700 text-white px-3 py-1 rounded cursor-pointer hover:bg-stone-600 transition duration-200 text-sm">
<i class="fa-solid fa-copy"></i> Copy
</button>
</div>
<pre><code class="text-white text-sm">php artisan optimize:clear
yarn build:production
php artisan optimize</code></pre>
</div>
</div>
</div>
</div>
<div class="w-full max-w-[1420px] bg-stone-700 rounded-lg p-4 mt-6">
<h2 class="text-white font-bold text-xl">What Ainx handles</h2>
<p class="text-stone-300 mt-3">
The Ainx package handles the Panel-side addon install. Do not run the old standalone artisan installer. Do not repeat the old manual Panel file edits after installing Ainx.
</p>
<p class="text-stone-300 mt-3">
The only manual section kept below is for Wings. Use it only if you want the daemon-backed Better Files features such as live collaboration, search streaming, media streaming, archive tools, and Git daemon endpoints. NBT and database previews run through the Panel and do not need Wings edits.
</p>
</div>
<h1 class="mt-20 text-white text-2xl md:text-4xl font-bold">Wings modifications guide</h1>
<p class="text-stone-400 text-[16px] font-medium mb-10">Daemon-side changes</p>
<div class="w-full max-w-[1420px]">
<div class="bg-emerald-500/15 border border-emerald-500/60 border-l-4 rounded-lg p-4 mb-5">
<div class="flex items-start gap-3">
<i class="fa-solid fa-circle-info text-emerald-300 mt-1"></i>
<div>
<h2 class="text-emerald-100 font-bold text-lg">Recommended Wings install</h2>
<p class="text-emerald-100/90 mt-2">
We recommend using the pre-built Wings binary or applying the full patch file. The full patched daemon also includes fixes for Pterodactyl Wings bugs that may not be patched upstream yet.
</p>
<p class="text-emerald-100/90 mt-2">
If you need to apply Wings edits from other addons, apply this patch first or clone our daemon repo first, then add the other addon changes on top.
</p>
</div>
</div>
</div>
<div class="flex flex-col md:flex-row justify-center gap-2 bg-stone-900 rounded-lg p-2 mb-5" role="tablist" aria-label="Wings install options">
<button type="button" data-wings-tab="prebuilt" onclick="setWingsOption('prebuilt')" class="w-full md:w-auto bg-emerald-600 text-white font-bold px-4 py-2 rounded-md cursor-pointer transition duration-200 focus:outline-none focus:ring-2 focus:ring-emerald-300" role="tab" aria-selected="true" aria-controls="wings-prebuilt">
Pre-built
</button>
<button type="button" data-wings-tab="patch" onclick="setWingsOption('patch')" class="w-full md:w-auto bg-stone-800 text-stone-300 font-bold px-4 py-2 rounded-md cursor-pointer hover:bg-stone-600 transition duration-200 focus:outline-none focus:ring-2 focus:ring-emerald-300" role="tab" aria-selected="false" aria-controls="wings-patch">
Patch file
</button>
<button type="button" data-wings-tab="manual" onclick="setWingsOption('manual')" class="w-full md:w-auto bg-stone-800 text-stone-300 font-bold px-4 py-2 rounded-md cursor-pointer hover:bg-stone-600 transition duration-200 focus:outline-none focus:ring-2 focus:ring-emerald-300" role="tab" aria-selected="false" aria-controls="wings-manual">
Manual edits
</button>
</div>
<div id="wings-prebuilt" data-wings-panel="prebuilt" class="bg-stone-700 rounded-lg p-4 min-w-0" role="tabpanel">
<h1 class="text-white font-bold text-xl">Install the prebuilt Wings binary</h1>
<p class="text-stone-300 mt-3">Use this if you just want the daemon already patched and built with the Better Files Wings handlers.</p>
<div class="code-block bg-stone-900 rounded-lg p-3 mt-2 border-l-4 border-emerald-500">
<div class="flex justify-end mb-2">
<button onclick="copyButton(this)" class="bg-stone-700 text-white px-3 py-1 rounded cursor-pointer hover:bg-stone-600 transition duration-200 text-sm">
<i class="fa-solid fa-copy"></i> Copy
</button>
</div>
<div class="overflow-x-auto">
<pre><code class="text-white text-sm">sudo mkdir -p /etc/pterodactyl
ARCH="$([[ "$(uname -m)" == "x86_64" ]] && echo "amd64" || echo "arm64")"
sudo curl -L -o /usr/local/bin/wings \
"https://github.com/Tomaxikz/daemon/releases/download/dev-latest/wings_linux_${ARCH}"
sudo chmod u+x /usr/local/bin/wings
sudo systemctl restart wings</code></pre>
</div>
</div>
<p class="text-stone-400 mt-3 text-sm">
Release page:
<a class="text-emerald-400 hover:text-emerald-300 underline break-all" href="https://github.com/Tomaxikz/daemon/releases/tag/dev-latest">https://github.com/Tomaxikz/daemon/releases/tag/dev-latest</a>
</p>
</div>
<div id="wings-patch" data-wings-panel="patch" class="bg-stone-700 rounded-lg p-4 min-w-0" role="tabpanel" hidden>
<h1 class="text-white font-bold text-xl">Apply the patch from the Wings root</h1>
<p class="text-stone-300 mt-3">
Run this inside the root folder of the Wings source repo, the same folder that contains <code class="bg-stone-900 rounded-lg px-2 py-1 text-emerald-400 text-sm">go.mod</code>.
</p>
<div class="code-block bg-stone-900 rounded-lg p-3 mt-2 border-l-4 border-emerald-500">
<div class="flex justify-end mb-2">
<button onclick="copyButton(this)" class="bg-stone-700 text-white px-3 py-1 rounded cursor-pointer hover:bg-stone-600 transition duration-200 text-sm">
<i class="fa-solid fa-copy"></i> Copy
</button>
</div>
<div class="overflow-x-auto">
<pre><code class="text-white text-sm">curl -L -o tomaxikz.patch \
"https://raw.githubusercontent.com/Tomaxikz/daemon/develop/tomaxikz.patch"
git apply tomaxikz.patch
go build
sudo systemctl stop wings
sudo mv wings /usr/local/bin/wings
sudo systemctl start wings</code></pre>
</div>
</div>
<p class="text-stone-400 mt-3 text-sm">
Patch file:
<a class="text-emerald-400 hover:text-emerald-300 underline break-all" href="https://github.com/Tomaxikz/daemon/blob/develop/tomaxikz.patch">https://github.com/Tomaxikz/daemon/blob/develop/tomaxikz.patch</a>
</p>
</div>
<div id="wings-manual" data-wings-panel="manual" class="bg-stone-700 rounded-lg p-4 min-w-0" role="tabpanel" hidden>
<h1 class="text-white font-bold text-xl">Edit Wings by hand</h1>
<p class="text-stone-300 mt-3">
Run the file download block from the root of the Wings source repo. These files are copied directly from the patched daemon branch.
</p>
<div class="code-block bg-stone-900 rounded-lg p-3 mt-2 border-l-4 border-emerald-500">
<div class="flex justify-end mb-2">
<button onclick="copyButton(this)" class="bg-stone-700 text-white px-3 py-1 rounded cursor-pointer hover:bg-stone-600 transition duration-200 text-sm">
<i class="fa-solid fa-copy"></i> Copy
</button>
</div>
<div class="overflow-x-auto">
<pre><code class="text-white text-sm">mkdir -p router/websocket environment/docker
curl -L -o router/websocket/limiter.go \
"https://raw.githubusercontent.com/Tomaxikz/daemon/develop/router/websocket/limiter.go"
curl -L -o router/websocket/betterfiles_collaboration.go \
"https://raw.githubusercontent.com/Tomaxikz/daemon/develop/router/websocket/betterfiles_collaboration.go"
curl -L -o router/router_server_git.go \
"https://raw.githubusercontent.com/Tomaxikz/daemon/develop/router/router_server_git.go"
curl -L -o router/router_server_files_search.go \
"https://raw.githubusercontent.com/Tomaxikz/daemon/develop/router/router_server_files_search.go"
curl -L -o router/router_server_betterfiles_collaboration.go \
"https://raw.githubusercontent.com/Tomaxikz/daemon/develop/router/router_server_betterfiles_collaboration.go"
curl -L -o router/router_server_archive_nbt.go \
"https://raw.githubusercontent.com/Tomaxikz/daemon/develop/router/router_server_archive_nbt.go"
curl -L -o router/router_cdn_stream.go \
"https://raw.githubusercontent.com/Tomaxikz/daemon/develop/router/router_cdn_stream.go"
curl -L -o router/router_download_helpers.go \
"https://raw.githubusercontent.com/Tomaxikz/daemon/develop/router/router_download_helpers.go"
curl -L -o environment/docker/client_accessor.go \
"https://raw.githubusercontent.com/Tomaxikz/daemon/develop/environment/docker/client_accessor.go"</code></pre>
</div>
</div>
<div class="border-t border-stone-600 mt-6 pt-5">
<h2 class="text-white font-bold text-lg">Add Better Files routes</h2>
<div class="flex flex-wrap gap-2 items-center mt-3">
<p class="text-stone-300">In</p>
<code class="bg-stone-900 rounded-lg px-2 py-1 text-emerald-400 text-sm break-all">/usr/local/dev/wings/router/router.go</code>
</div>
<p class="text-stone-300 mt-3">Add the Git routes near the other server routes:</p>
<div class="code-block bg-stone-900 rounded-lg p-3 mt-2 border-l-4 border-emerald-500">
<div class="flex justify-end mb-2">
<button onclick="copyButton(this)" class="bg-stone-700 text-white px-3 py-1 rounded cursor-pointer hover:bg-stone-600 transition duration-200 text-sm">
<i class="fa-solid fa-copy"></i> Copy
</button>
</div>
<div class="overflow-x-auto">
<pre><code class="text-white text-sm">git := server.Group("/git")
{
git.GET("/status", getServerGitStatus)
git.POST("/clone", postServerGitClone)
git.POST("/pull", postServerGitPull)
git.POST("/diff", postServerGitDiff)
}</code></pre>
</div>
</div>
<p class="text-stone-300 mt-3">Add these inside the existing <code class="bg-stone-900 rounded-lg px-2 py-1 text-emerald-400 text-sm">files := server.Group("/files")</code> block:</p>
<div class="code-block bg-stone-900 rounded-lg p-3 mt-2 border-l-4 border-emerald-500">
<div class="flex justify-end mb-2">
<button onclick="copyButton(this)" class="bg-stone-700 text-white px-3 py-1 rounded cursor-pointer hover:bg-stone-600 transition duration-200 text-sm">
<i class="fa-solid fa-copy"></i> Copy
</button>
</div>
<div class="overflow-x-auto">
<pre><code class="text-white text-sm">files.GET("/search", getServerFilesSearch)
files.GET("/archive/list", getServerArchiveList)
files.POST("/archive/extract", postServerArchiveExtract)
files.POST("/collaboration/revoke", postServerBetterFilesCollaborationRevoke)</code></pre>
</div>
</div>
<p class="text-stone-300 mt-3">Add the stream route near the existing download routes:</p>
<div class="code-block bg-stone-900 rounded-lg p-3 mt-2 border-l-4 border-emerald-500">
<div class="flex justify-end mb-2">
<button onclick="copyButton(this)" class="bg-stone-700 text-white px-3 py-1 rounded cursor-pointer hover:bg-stone-600 transition duration-200 text-sm">
<i class="fa-solid fa-copy"></i> Copy
</button>
</div>
<div class="overflow-x-auto">
<pre><code class="text-white text-sm">router.GET("/download/stream", getDownloadStream)</code></pre>
</div>
</div>
</div>
<div class="border-t border-stone-600 mt-6 pt-5">
<h2 class="text-white font-bold text-lg">Add collaboration websocket hook</h2>
<div class="flex flex-wrap gap-2 items-center mt-3">
<p class="text-stone-300">In</p>
<code class="bg-stone-900 rounded-lg px-2 py-1 text-emerald-400 text-sm break-all">/usr/local/dev/wings/router/websocket/websocket.go</code>
</div>
<p class="text-stone-300 mt-3">
Paste this after the non-auth token validation block and before <code class="bg-stone-900 rounded-lg px-2 py-1 text-emerald-400 text-sm">switch m.Event</code>:
</p>
<div class="code-block bg-stone-900 rounded-lg p-3 mt-2 border-l-4 border-emerald-500">
<div class="flex justify-end mb-2">
<button onclick="copyButton(this)" class="bg-stone-700 text-white px-3 py-1 rounded cursor-pointer hover:bg-stone-600 transition duration-200 text-sm">
<i class="fa-solid fa-copy"></i> Copy
</button>
</div>
<div class="overflow-x-auto">
<pre><code class="text-white text-sm">if handled, err := h.HandleBetterFilesCollaboration(ctx, m); handled {
return err
}</code></pre>
</div>
</div>
</div>
<div class="border-t border-stone-600 mt-6 pt-5">
<h2 class="text-white font-bold text-lg">Build and restart Wings</h2>
<p class="text-stone-300 mt-3">Execute:</p>
<div class="code-block bg-stone-900 rounded-lg p-3 mt-2 border-l-4 border-emerald-500">
<div class="flex justify-end mb-2">
<button onclick="copyButton(this)" class="bg-stone-700 text-white px-3 py-1 rounded cursor-pointer hover:bg-stone-600 transition duration-200 text-sm">
<i class="fa-solid fa-copy"></i> Copy
</button>
</div>
<div class="overflow-x-auto">
<pre><code class="text-white text-sm">go build
sudo systemctl stop wings
sudo mv wings /usr/local/bin/wings
sudo systemctl start wings</code></pre>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
function copyButton(button) {
const code = button.closest(".code-block").querySelector("code").innerText;
const textarea = document.createElement("textarea");
textarea.value = code;
document.body.appendChild(textarea);
textarea.select();
document.execCommand("copy");
document.body.removeChild(textarea);
button.innerHTML = '<i class="fa-solid fa-check"></i> Copied!';
setTimeout(() => {
button.innerHTML = '<i class="fa-solid fa-copy"></i> Copy';
}, 2000);
}
function setWingsOption(option) {
const activeClasses = ["bg-emerald-600", "text-white"];
const inactiveClasses = ["bg-stone-800", "text-stone-300", "hover:bg-stone-600"];
document.querySelectorAll("[data-wings-panel]").forEach((panel) => {
panel.hidden = panel.dataset.wingsPanel !== option;
});
document.querySelectorAll("[data-wings-tab]").forEach((tab) => {
const isActive = tab.dataset.wingsTab === option;
tab.setAttribute("aria-selected", isActive ? "true" : "false");
tab.classList.remove(...activeClasses, ...inactiveClasses);
tab.classList.add(...(isActive ? activeClasses : inactiveClasses));
});
}
</script>
</body>
</html>