Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions dungeon/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM ubuntu:22.04

RUN apt-get update
RUN apt-get install -y telnet

COPY run-app.sh /run-app.sh

WORKDIR /app

COPY . .

RUN chmod +x add-ttyd.sh
RUN ./add-ttyd.sh

RUN rm add-ttyd.sh
RUN rm -rf ttyd

RUN chmod +x /run-app.sh

EXPOSE 8989

ENTRYPOINT [ "/run-app.sh" ]
7 changes: 7 additions & 0 deletions dungeon/add-ttyd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
apt-get update
apt-get install -y build-essential cmake git libjson-c-dev libwebsockets-dev
git clone https://github.com/tsl0922/ttyd.git
cd ttyd && mkdir build && cd build
cmake ..
make && make install
5 changes: 5 additions & 0 deletions dungeon/run-app.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

ulimit -n 65536

ttyd --port 8989 -W telnet 172.238.63.244 4000
40 changes: 40 additions & 0 deletions terminalcraft/app/dungeon/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
export default function DungeonPage() {
const remoteUrl = "https://o4s8sossskck88cwos0kw88o.a.selfhosted.hackclub.com";

return (
<div className="p-8 sm:p-20 min-h-screen bg-[#1E1E1E] flex items-center justify-center">
{/* macOS Terminal Window */}
<div className="w-full max-w-6xl bg-black rounded-lg overflow-hidden shadow-2xl">
{/* Terminal Title Bar */}
<div className="bg-[#2D2D2D] px-4 py-2 flex items-center gap-2 border-b border-[#404040]">
<div className="flex gap-2">
<div className="w-3 h-3 rounded-full bg-[#FF5F56] flex items-center justify-center">
<div className="w-2.5 h-2.5 rounded-full bg-[#FF5F56] shadow-inner"></div>
</div>
<div className="w-3 h-3 rounded-full bg-[#FFBD2E] flex items-center justify-center">
<div className="w-2.5 h-2.5 rounded-full bg-[#FFBD2E] shadow-inner"></div>
</div>
<div className="w-3 h-3 rounded-full bg-[#27C93F] flex items-center justify-center">
<div className="w-2.5 h-2.5 rounded-full bg-[#27C93F] shadow-inner"></div>
</div>
</div>
<div className="flex-1 text-center text-sm text-[#808080] font-medium">remote@hackclub — dungeon</div>
</div>

{/* Terminal Content (Iframe) */}
<div className="bg-black" style={{ height: "70vh" }}>
<iframe
src={remoteUrl}
title="Dungeon Terminal"
className="w-full h-full"
frameBorder={0}
allowFullScreen
referrerPolicy="no-referrer"
/>
</div>
</div>
</div>
);
}


1 change: 1 addition & 0 deletions terminalcraft/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default function Navbar() {
const tabs = [
{ name: 'Terminal', path: '/', icon: '>' },
{ name: 'Gallery', path: '/gallery', icon: '[]' },
{ name: 'Dungeon', path: '/dungeon', icon: '~$' },
];

const toggleMobileMenu = () => {
Expand Down