Skip to content

Commit 4cd3c40

Browse files
authored
Merge pull request #233 from ctfguide-tech/main
Sync main with dev
2 parents 01128fe + abd18a6 commit 4cd3c40

12 files changed

+19987
-10149
lines changed

.env.development

+3
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ NEXT_PUBLIC_APP_STRIPE_KEY=pk_test_51MAliSF4qMywXyoUvCPG6HDRQaRy4ach2pfDIj4sklm4
3232

3333
NEXT_PUBLIC_KANA_SERVER_URL=kana-server.ctfguide.com
3434
NEXT_PUBLIC_GOOGLE_CLIENT_ID=166652277588-4uk7g7irqlicacelg1nfgt0ejmskmo9h.apps.googleusercontent.com
35+
36+
NEXT_PUBLIC_DOCKET_URL=https://docketinfra.ctfguide.com
37+
NEXT_PUBLIC_DOCKET_API_TOKEN=hellodocket12

package-lock.json

+13,900-6,049
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+5
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"@webcontainer/api": "^1.5.1-internal.5",
3434
"asciinema-player": "3.6.3",
3535
"autoprefixer": "^10.4.12",
36+
"axios": "^1.8.4",
3637
"babel-plugin-macros": "^3.1.0",
3738
"babel-plugin-transform-remove-imports": "^1.8.0",
3839
"chart.js": "^4.4.3",
@@ -66,6 +67,7 @@
6667
"react-dom": "18.2.0",
6768
"react-easy-crop": "^5.0.7",
6869
"react-firebase-hooks": "^5.1.1",
70+
"react-globe.gl": "^2.33.2",
6971
"react-google-charts": "^4.0.1",
7072
"react-image-crop": "^11.0.5",
7173
"react-intersection-observer": "^9.13.1",
@@ -77,6 +79,7 @@
7779
"react-responsive": "^10.0.0",
7880
"react-router-dom": "^6.9.0",
7981
"react-select-country-list": "^2.2.3",
82+
"react-simple-maps": "^3.0.0",
8083
"react-simplemde-editor": "^5.2.0",
8184
"react-swipeable": "^7.0.1",
8285
"react-text-loop": "^2.3.0",
@@ -97,6 +100,8 @@
97100
"tailwind-merge": "^2.3.0",
98101
"tailwindcss": "^3.2.1",
99102
"tailwindcss-animate": "^1.0.7",
103+
"three": "^0.175.0",
104+
"three-globe": "^2.42.4",
100105
"xterm": "^5.3.0",
101106
"xterm-addon-fit": "^0.8.0"
102107
},

public/sw.js

+1-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/workbox-4754cb34.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
import React from 'react';
2+
3+
export default function ConfigureContainerModal({ open, onClose, container }) {
4+
if (!open || !container) return null;
5+
6+
return (
7+
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-80">
8+
<div className="bg-neutral-900 border-t-4 border-blue-500 shadow-lg w-full max-w-3xl mx-4 p-8 relative flex flex-col max-h-[90vh] overflow-y-auto">
9+
<button
10+
className="absolute top-4 right-4 text-gray-400 hover:text-white text-2xl"
11+
onClick={onClose}
12+
aria-label="Close"
13+
>
14+
&times;
15+
</button>
16+
17+
<h2 className="text-2xl font-bold text-white mb-6">Configure Container</h2>
18+
<div className="bg-yellow-900/70 border border-yellow-600 text-yellow-200 rounded p-3 mb-6 flex items-center gap-3">
19+
<i className="fa fa-exclamation-triangle text-yellow-400 text-xl"></i>
20+
<span className="font-semibold">Editing container configurations is not available yet. Please DM support for changes.</span>
21+
</div>
22+
<div className="space-y-4">
23+
<div>
24+
<label className="block text-gray-400 text-sm mb-1">Subdomain</label>
25+
<input
26+
type="text"
27+
className="w-full px-3 py-2 bg-neutral-800 border border-neutral-700 text-white rounded"
28+
value={container.subdomain || ''}
29+
readOnly
30+
disabled
31+
/>
32+
</div>
33+
<div>
34+
<label className="block text-gray-400 text-sm mb-1">Container Name</label>
35+
<input
36+
type="text"
37+
className="w-full px-3 py-2 bg-neutral-800 border border-neutral-700 text-white rounded"
38+
value={container.containerName || ''}
39+
readOnly
40+
disabled
41+
/>
42+
</div>
43+
<div>
44+
<label className="block text-gray-400 text-sm mb-1">Image Name</label>
45+
<input
46+
type="text"
47+
className="w-full px-3 py-2 bg-neutral-800 border border-neutral-700 text-white rounded"
48+
value={container.imageName || ''}
49+
readOnly
50+
disabled
51+
/>
52+
</div>
53+
<div>
54+
<label className="block text-gray-400 text-sm mb-1">Port</label>
55+
<input
56+
type="text"
57+
className="w-full px-3 py-2 bg-neutral-800 border border-neutral-700 text-white rounded"
58+
value={container.port || ''}
59+
readOnly
60+
disabled
61+
/>
62+
</div>
63+
{/* Add more configuration fields here as needed */}
64+
<div>
65+
<label className="block text-gray-400 text-sm mb-1">Environment Variables</label>
66+
<textarea
67+
className="w-full px-3 py-2 bg-neutral-800 border border-neutral-700 text-white rounded"
68+
value={container.env ? JSON.stringify(container.env, null, 2) : ''}
69+
readOnly
70+
disabled
71+
rows={3}
72+
/>
73+
</div>
74+
<div>
75+
<label className="block text-gray-400 text-sm mb-1">Command</label>
76+
<input
77+
type="text"
78+
className="w-full px-3 py-2 bg-neutral-800 border border-neutral-700 text-white rounded"
79+
value={container.command || ''}
80+
readOnly
81+
disabled
82+
/>
83+
</div>
84+
<div>
85+
<label className="block text-gray-400 text-sm mb-1">Created At</label>
86+
<input
87+
type="text"
88+
className="w-full px-3 py-2 bg-neutral-800 border border-neutral-700 text-white rounded"
89+
value={container.createdAt ? new Date(container.createdAt).toLocaleString() : ''}
90+
readOnly
91+
disabled
92+
/>
93+
</div>
94+
</div>
95+
{/* You can add Save/Update actions here in the future */}
96+
</div>
97+
</div>
98+
);
99+
}

src/components/FileEditorModal.jsx

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { useState } from 'react';
2+
import { createPortal } from 'react-dom';
3+
4+
export default function FileEditorModal({ fileName, initialValue, onSave, onClose }) {
5+
const [value, setValue] = useState(initialValue);
6+
7+
return createPortal(
8+
<div className="fixed inset-0 bg-black bg-opacity-60 z-50 flex items-center justify-center">
9+
<div className="bg-neutral-900 border-t-4 border-blue-500 shadow-lg p-4 w-full max-w-5xl">
10+
<div className="flex justify-between items-center mb-2">
11+
<div className="font-bold text-white text-lg">Edit: <span className="bg-neutral-700 px-2 text-gray-300">{fileName}</span></div>
12+
<button onClick={onClose} className="text-gray-500 hover:text-red-600"></button>
13+
</div>
14+
<div className="mb-4">
15+
<textarea
16+
className="w-full h-64 font-mono bg-neutral-900 text-white rounded p-2 border border-neutral-700"
17+
value={value}
18+
onChange={e => setValue(e.target.value)}
19+
spellCheck={false}
20+
style={{ minHeight: 250 }}
21+
/>
22+
</div>
23+
<div className="flex justify-end gap-2">
24+
<button
25+
className="px-4 py-2 bg-blue-600 text-white = hover:bg-blue-700"
26+
onClick={() => onSave(value)}
27+
>Save</button>
28+
<button
29+
className="px-4 py-2 bg-neutral-700 text-white = hover:bg-neutral-800"
30+
onClick={onClose}
31+
>Cancel</button>
32+
</div>
33+
</div>
34+
</div>,
35+
document.body
36+
);
37+
}

src/components/StandardNav.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ export function StandardNav({ guestAllowed, alignCenter = true }) {
788788
/>
789789
<Upgrade open={upgradeModalOpen} setOpen={setUpgradeModalOpen} />
790790

791-
<div className="mx-auto w-full bg-yellow-800 py-1 text-center text-sm text-white ">
791+
<div className="mx-auto hidden w-full bg-yellow-800 py-1 text-center text-sm text-white ">
792792
<h1 className="mx-auto px-4 text-left">
793793
We're experiencing issues with our database and API. You may encounter errors while using the platform. We're working on fixing it. Please join the Discord for updates. https://discord.gg/XJ8QfS6D
794794
</h1>

src/pages/create.jsx

+12
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,17 @@ export default function Create() {
495495
>
496496
Home
497497
</Link>
498+
<Link
499+
href="/create/compute"
500+
className={`text-sm font-medium border-b-2 h-full flex items-center transition-colors ${
501+
false // Replace with actual route check
502+
? 'border-blue-500 text-white'
503+
: 'border-transparent text-neutral-400 hover:text-white hover:border-[#333333]'
504+
}`}
505+
>
506+
<i className="fas fa-server mr-2"></i>
507+
Docker Containers <span className="text-xs text-blue-400 px-1 ml-2 rounded bg-blue-900 text-white ">BETA</span>
508+
</Link>
498509
<Link
499510
href="/create/earnings"
500511
className={`text-sm font-medium border-b-2 h-full flex items-center transition-colors ${
@@ -506,6 +517,7 @@ export default function Create() {
506517
<i className="fas fa-wallet mr-2"></i>
507518
Earnings
508519
</Link>
520+
509521
<Link
510522
href="/create/settings"
511523
className={`hidden text-sm font-medium border-b-2 h-full flex items-center transition-colors ${

0 commit comments

Comments
 (0)