mirror of
https://github.com/louislam/dockge.git
synced 2026-05-22 22:42:16 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f339ef525e | ||
|
|
a50da632bb | ||
|
|
99eda980f8 | ||
|
|
f6fffcc064 |
@@ -195,6 +195,7 @@ export class DockgeServer {
|
|||||||
// Create Socket.io
|
// Create Socket.io
|
||||||
this.io = new socketIO.Server(this.httpServer, {
|
this.io = new socketIO.Server(this.httpServer, {
|
||||||
cors,
|
cors,
|
||||||
|
transports: [ "websocket" ],
|
||||||
});
|
});
|
||||||
|
|
||||||
this.io.on("connection", async (socket: Socket) => {
|
this.io.on("connection", async (socket: Socket) => {
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import { LimitQueue } from "./utils/limit-queue";
|
|||||||
import { DockgeSocket } from "./util-server";
|
import { DockgeSocket } from "./util-server";
|
||||||
import {
|
import {
|
||||||
allowedCommandList, allowedRawKeys,
|
allowedCommandList, allowedRawKeys,
|
||||||
|
getComposeTerminalName,
|
||||||
|
getCryptoRandomInt,
|
||||||
PROGRESS_TERMINAL_ROWS,
|
PROGRESS_TERMINAL_ROWS,
|
||||||
TERMINAL_COLS,
|
TERMINAL_COLS,
|
||||||
TERMINAL_ROWS
|
TERMINAL_ROWS
|
||||||
@@ -205,20 +207,14 @@ export class Terminal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static exec(server : DockgeServer, socket : DockgeSocket | undefined, terminalName : string, file : string, args : string | string[], cwd : string) : Promise<number> {
|
public static exec(server : DockgeServer, socket : DockgeSocket | undefined, terminalName : string, file : string, args : string | string[], cwd : string) : Promise<number> {
|
||||||
return new Promise((resolve, reject) => {
|
const terminal = new Terminal(server, terminalName, file, args, cwd);
|
||||||
// check if terminal exists
|
|
||||||
if (Terminal.terminalMap.has(terminalName)) {
|
|
||||||
reject("Another operation is already running, please try again later.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let terminal = new Terminal(server, terminalName, file, args, cwd);
|
|
||||||
terminal.rows = PROGRESS_TERMINAL_ROWS;
|
terminal.rows = PROGRESS_TERMINAL_ROWS;
|
||||||
|
|
||||||
if (socket) {
|
if (socket) {
|
||||||
terminal.join(socket);
|
terminal.join(socket);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return new Promise((resolve) => {
|
||||||
terminal.onExit((exitCode : number) => {
|
terminal.onExit((exitCode : number) => {
|
||||||
resolve(exitCode);
|
resolve(exitCode);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM node:18.17.1-bookworm-slim
|
FROM node:20-bookworm-slim
|
||||||
ENV PNPM_HOME="/pnpm"
|
ENV PNPM_HOME="/pnpm"
|
||||||
ENV PATH="$PNPM_HOME:$PATH"
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
|
|
||||||
@@ -24,3 +24,16 @@ RUN apt update && apt install --yes --no-install-recommends \
|
|||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& npm install pnpm -g \
|
&& npm install pnpm -g \
|
||||||
&& pnpm install -g tsx
|
&& pnpm install -g tsx
|
||||||
|
|
||||||
|
# ensures that /var/run/docker.sock exists
|
||||||
|
# changes the ownership of /var/run/docker.sock
|
||||||
|
RUN touch /var/run/docker.sock && chown node:node /var/run/docker.sock
|
||||||
|
|
||||||
|
# Full Base Image
|
||||||
|
# MariaDB, Chromium and fonts
|
||||||
|
#FROM base-slim AS base
|
||||||
|
#ENV DOCKGE_ENABLE_EMBEDDED_MARIADB=1
|
||||||
|
#RUN apt update && \
|
||||||
|
# apt --yes --no-install-recommends install mariadb-server && \
|
||||||
|
# rm -rf /var/lib/apt/lists/* && \
|
||||||
|
# apt --yes autoremove
|
||||||
|
|||||||
@@ -97,6 +97,5 @@
|
|||||||
"Cannot connect to the socket server.": "Cannot connect to the socket server.",
|
"Cannot connect to the socket server.": "Cannot connect to the socket server.",
|
||||||
"reconnecting...": "Reconnecting...",
|
"reconnecting...": "Reconnecting...",
|
||||||
"connecting...": "Connecting to the socket server...",
|
"connecting...": "Connecting to the socket server...",
|
||||||
"url": "URL | URLs",
|
"url": "URL | URLs"
|
||||||
"extra": "Extra"
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ export default defineComponent({
|
|||||||
}, 1500);
|
}, 1500);
|
||||||
|
|
||||||
socket = io(url, {
|
socket = io(url, {
|
||||||
transports: [ "websocket", "polling" ]
|
transports: [ "websocket" ]
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("connect", () => {
|
socket.on("connect", () => {
|
||||||
|
|||||||
@@ -87,6 +87,14 @@
|
|||||||
<input id="name" v-model="stack.name" type="text" class="form-control" required @blur="stackNameToLowercase">
|
<input id="name" v-model="stack.name" type="text" class="form-control" required @blur="stackNameToLowercase">
|
||||||
<div class="form-text">{{ $t("Lowercase only") }}</div>
|
<div class="form-text">{{ $t("Lowercase only") }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- URLs -->
|
||||||
|
<div class="mb-4">
|
||||||
|
<label class="form-label">
|
||||||
|
{{ $tc("url", 2) }}
|
||||||
|
</label>
|
||||||
|
<ArrayInput name="urls" :display-name="$t('url')" placeholder="https://" object-type="x-dockge" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -120,7 +128,7 @@
|
|||||||
|
|
||||||
<!-- General -->
|
<!-- General -->
|
||||||
<div v-if="isEditMode">
|
<div v-if="isEditMode">
|
||||||
<h4 class="mb-3">{{ $t("extra") }}</h4>
|
<h4 class="mb-3">{{ $t("Extra") }}</h4>
|
||||||
<div class="shadow-box big-padding mb-3">
|
<div class="shadow-box big-padding mb-3">
|
||||||
<!-- URLs -->
|
<!-- URLs -->
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
"name": "dockge",
|
"name": "dockge",
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"engines": {
|
|
||||||
"node": ">= 18.0.0 && <= 18.17.1"
|
|
||||||
},
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"fmt": "eslint \"**/*.{ts,vue}\" --fix",
|
"fmt": "eslint \"**/*.{ts,vue}\" --fix",
|
||||||
"lint": "eslint \"**/*.{ts,vue}\"",
|
"lint": "eslint \"**/*.{ts,vue}\"",
|
||||||
|
|||||||
Reference in New Issue
Block a user