mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 05:31:47 +00:00
# v0.4.36 (2026-05-13)
## Features - Add MiniMax TTS provider support (#1043) - Docker images now published on both GHCR & Docker Hub (decolua/9router) — pull from your preferred registry ## Improvements - Replace browser confirm dialogs with custom ConfirmModal (#1060) ## Fixes - Fix Docker `Cannot find module 'next'` error in standalone build - Restore /app/server.js in Docker standalone build (#1064, #1067) - Fix CLI TUI menu arrow-key escape sequences leaking (^[[A^[[B) - Switch macOS/Linux tray to systray2 fork (fixes Kaspersky AV false-positive) (#1080) - Fix zoom controls contrast in topology view (#1066)
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// Build Docker image locally for current platform (test/dev).
|
||||
// Usage: node app/scripts/dockerBuild.js
|
||||
|
||||
const { execSync } = require("child_process");
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
|
||||
const IMAGE = "decolua/9router";
|
||||
const appDir = path.resolve(__dirname, "..");
|
||||
const cliPkgPath = path.resolve(appDir, "cli", "package.json");
|
||||
const version = JSON.parse(fs.readFileSync(cliPkgPath, "utf8")).version;
|
||||
const tag = `v${version}`;
|
||||
|
||||
console.log(`\n🐳 Building ${IMAGE}:${tag} (local platform)...\n`);
|
||||
|
||||
try {
|
||||
execSync(
|
||||
`docker build -t ${IMAGE}:${tag} -t ${IMAGE}:latest .`,
|
||||
{ stdio: "inherit", cwd: appDir }
|
||||
);
|
||||
console.log(`\n✅ Built ${IMAGE}:${tag} + ${IMAGE}:latest`);
|
||||
console.log(`▶️ Run: docker run --rm -p 20128:20128 -v "$HOME/.9router:/app/data" -e DATA_DIR=/app/data ${IMAGE}:${tag}`);
|
||||
} catch (e) {
|
||||
console.error("❌ Docker build failed");
|
||||
process.exit(1);
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// Build & push multi-platform Docker image to Docker Hub.
|
||||
// Requires: docker login + buildx (Docker Desktop ships with it).
|
||||
// Usage: node app/scripts/dockerPublish.js
|
||||
|
||||
const { execSync } = require("child_process");
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
|
||||
const IMAGE = "decolua/9router";
|
||||
const PLATFORMS = "linux/amd64,linux/arm64";
|
||||
const BUILDER = "9router-builder";
|
||||
|
||||
const appDir = path.resolve(__dirname, "..");
|
||||
const cliPkgPath = path.resolve(appDir, "cli", "package.json");
|
||||
const version = JSON.parse(fs.readFileSync(cliPkgPath, "utf8")).version;
|
||||
const tag = `v${version}`;
|
||||
|
||||
function run(cmd, opts = {}) {
|
||||
console.log(`$ ${cmd}`);
|
||||
execSync(cmd, { stdio: "inherit", cwd: appDir, ...opts });
|
||||
}
|
||||
|
||||
console.log(`\n🐳 Publishing ${IMAGE}:${tag} (${PLATFORMS}) to Docker Hub...\n`);
|
||||
|
||||
// Verify docker login by checking config
|
||||
try {
|
||||
const cfg = path.join(process.env.HOME || "", ".docker", "config.json");
|
||||
if (fs.existsSync(cfg)) {
|
||||
const json = JSON.parse(fs.readFileSync(cfg, "utf8"));
|
||||
if (!json.auths || Object.keys(json.auths).length === 0) {
|
||||
console.error("❌ Not logged in to Docker Hub. Run: docker login");
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
} catch {}
|
||||
|
||||
// Ensure buildx builder exists with multi-arch support
|
||||
try {
|
||||
execSync(`docker buildx inspect ${BUILDER}`, { stdio: "ignore", cwd: appDir });
|
||||
console.log(`✅ Builder "${BUILDER}" exists`);
|
||||
} catch {
|
||||
console.log(`🔧 Creating buildx builder "${BUILDER}"...`);
|
||||
run(`docker buildx create --name ${BUILDER} --driver docker-container --use`);
|
||||
run(`docker buildx inspect --bootstrap`);
|
||||
}
|
||||
|
||||
// Build + push multi-platform image
|
||||
run(
|
||||
`docker buildx build --builder ${BUILDER} --platform ${PLATFORMS} ` +
|
||||
`-t ${IMAGE}:${tag} -t ${IMAGE}:latest --push .`
|
||||
);
|
||||
|
||||
console.log(`\n✅ Published:`);
|
||||
console.log(` - ${IMAGE}:${tag}`);
|
||||
console.log(` - ${IMAGE}:latest`);
|
||||
console.log(`🔗 https://hub.docker.com/r/${IMAGE.replace("/", "/")}`);
|
||||
Reference in New Issue
Block a user