Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| decd39e7c4 | |||
| ad2e228208 | |||
| cf06019d79 | |||
| cf44b0047d | |||
| 260b5364e6 | |||
| 51c1962042 | |||
| d3b78054ad | |||
| d2ae35f0ce |
19
changelog.md
19
changelog.md
@@ -1,5 +1,24 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-03-16 - 1.14.7 - fix(repo)
|
||||||
|
no changes to commit
|
||||||
|
|
||||||
|
|
||||||
|
## 2026-03-16 - 1.14.6 - fix(project)
|
||||||
|
no changes to commit
|
||||||
|
|
||||||
|
|
||||||
|
## 2026-03-16 - 1.14.5 - fix(onebox)
|
||||||
|
move Docker auto-install and swarm initialization into Onebox startup flow
|
||||||
|
|
||||||
|
- removes Docker setup from daemon service installation
|
||||||
|
- ensures Docker is installed before Docker initialization during Onebox startup
|
||||||
|
- preserves automatic Docker Swarm initialization on fresh servers
|
||||||
|
|
||||||
|
## 2026-03-16 - 1.14.4 - fix(repo)
|
||||||
|
no changes to commit
|
||||||
|
|
||||||
|
|
||||||
## 2026-03-16 - 1.14.3 - fix(repo)
|
## 2026-03-16 - 1.14.3 - fix(repo)
|
||||||
no changes to commit
|
no changes to commit
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@serve.zone/onebox",
|
"name": "@serve.zone/onebox",
|
||||||
"version": "1.14.3",
|
"version": "1.14.7",
|
||||||
"exports": "./mod.ts",
|
"exports": "./mod.ts",
|
||||||
"tasks": {
|
"tasks": {
|
||||||
"test": "deno test --allow-all test/",
|
"test": "deno test --allow-all test/",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@serve.zone/onebox",
|
"name": "@serve.zone/onebox",
|
||||||
"version": "1.14.3",
|
"version": "1.14.7",
|
||||||
"description": "Self-hosted container platform with automatic SSL and DNS - a mini Heroku for single servers",
|
"description": "Self-hosted container platform with automatic SSL and DNS - a mini Heroku for single servers",
|
||||||
"main": "mod.ts",
|
"main": "mod.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@serve.zone/onebox',
|
name: '@serve.zone/onebox',
|
||||||
version: '1.14.3',
|
version: '1.14.7',
|
||||||
description: 'Self-hosted container platform with automatic SSL and DNS - a mini Heroku for single servers'
|
description: 'Self-hosted container platform with automatic SSL and DNS - a mini Heroku for single servers'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,59 +46,6 @@ export class OneboxDaemon {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Ensure Docker is installed, installing it if necessary
|
|
||||||
*/
|
|
||||||
private async ensureDocker(): Promise<void> {
|
|
||||||
try {
|
|
||||||
const cmd = new Deno.Command('docker', {
|
|
||||||
args: ['--version'],
|
|
||||||
stdout: 'piped',
|
|
||||||
stderr: 'piped',
|
|
||||||
});
|
|
||||||
const result = await cmd.output();
|
|
||||||
if (result.success) {
|
|
||||||
const version = new TextDecoder().decode(result.stdout).trim();
|
|
||||||
logger.info(`Docker found: ${version}`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
// docker command not found
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.info('Docker not found. Installing Docker...');
|
|
||||||
const installCmd = new Deno.Command('bash', {
|
|
||||||
args: ['-c', 'curl -fsSL https://get.docker.com | sh'],
|
|
||||||
stdin: 'inherit',
|
|
||||||
stdout: 'inherit',
|
|
||||||
stderr: 'inherit',
|
|
||||||
});
|
|
||||||
const installResult = await installCmd.output();
|
|
||||||
if (!installResult.success) {
|
|
||||||
throw new Error('Failed to install Docker. Please install it manually: curl -fsSL https://get.docker.com | sh');
|
|
||||||
}
|
|
||||||
logger.success('Docker installed successfully');
|
|
||||||
|
|
||||||
// Initialize Docker Swarm
|
|
||||||
logger.info('Initializing Docker Swarm...');
|
|
||||||
const swarmCmd = new Deno.Command('docker', {
|
|
||||||
args: ['swarm', 'init'],
|
|
||||||
stdout: 'piped',
|
|
||||||
stderr: 'piped',
|
|
||||||
});
|
|
||||||
const swarmResult = await swarmCmd.output();
|
|
||||||
if (swarmResult.success) {
|
|
||||||
logger.success('Docker Swarm initialized');
|
|
||||||
} else {
|
|
||||||
const stderr = new TextDecoder().decode(swarmResult.stderr);
|
|
||||||
if (stderr.includes('already part of a swarm')) {
|
|
||||||
logger.info('Docker Swarm already initialized');
|
|
||||||
} else {
|
|
||||||
logger.warn(`Docker Swarm init warning: ${stderr.trim()}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Install systemd service
|
* Install systemd service
|
||||||
*/
|
*/
|
||||||
@@ -106,9 +53,6 @@ export class OneboxDaemon {
|
|||||||
try {
|
try {
|
||||||
logger.info('Installing Onebox daemon service...');
|
logger.info('Installing Onebox daemon service...');
|
||||||
|
|
||||||
// Ensure Docker is installed
|
|
||||||
await this.ensureDocker();
|
|
||||||
|
|
||||||
// Initialize smartdaemon if needed
|
// Initialize smartdaemon if needed
|
||||||
if (!this.smartdaemon) {
|
if (!this.smartdaemon) {
|
||||||
this.smartdaemon = new plugins.smartdaemon.SmartDaemon();
|
this.smartdaemon = new plugins.smartdaemon.SmartDaemon();
|
||||||
|
|||||||
@@ -97,6 +97,9 @@ export class Onebox {
|
|||||||
// Ensure default admin user exists
|
// Ensure default admin user exists
|
||||||
await this.ensureDefaultUser();
|
await this.ensureDefaultUser();
|
||||||
|
|
||||||
|
// Ensure Docker is installed (auto-install on fresh servers)
|
||||||
|
await this.ensureDocker();
|
||||||
|
|
||||||
// Initialize Docker
|
// Initialize Docker
|
||||||
await this.docker.init();
|
await this.docker.init();
|
||||||
|
|
||||||
@@ -221,6 +224,59 @@ export class Onebox {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ensure Docker is installed, installing it if necessary
|
||||||
|
*/
|
||||||
|
private async ensureDocker(): Promise<void> {
|
||||||
|
try {
|
||||||
|
const cmd = new Deno.Command('docker', {
|
||||||
|
args: ['--version'],
|
||||||
|
stdout: 'piped',
|
||||||
|
stderr: 'piped',
|
||||||
|
});
|
||||||
|
const result = await cmd.output();
|
||||||
|
if (result.success) {
|
||||||
|
const version = new TextDecoder().decode(result.stdout).trim();
|
||||||
|
logger.info(`Docker found: ${version}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
// docker command not found
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.info('Docker not found. Installing Docker...');
|
||||||
|
const installCmd = new Deno.Command('bash', {
|
||||||
|
args: ['-c', 'curl -fsSL https://get.docker.com | sh'],
|
||||||
|
stdin: 'inherit',
|
||||||
|
stdout: 'inherit',
|
||||||
|
stderr: 'inherit',
|
||||||
|
});
|
||||||
|
const installResult = await installCmd.output();
|
||||||
|
if (!installResult.success) {
|
||||||
|
throw new Error('Failed to install Docker. Please install it manually: curl -fsSL https://get.docker.com | sh');
|
||||||
|
}
|
||||||
|
logger.success('Docker installed successfully');
|
||||||
|
|
||||||
|
// Initialize Docker Swarm
|
||||||
|
logger.info('Initializing Docker Swarm...');
|
||||||
|
const swarmCmd = new Deno.Command('docker', {
|
||||||
|
args: ['swarm', 'init'],
|
||||||
|
stdout: 'piped',
|
||||||
|
stderr: 'piped',
|
||||||
|
});
|
||||||
|
const swarmResult = await swarmCmd.output();
|
||||||
|
if (swarmResult.success) {
|
||||||
|
logger.success('Docker Swarm initialized');
|
||||||
|
} else {
|
||||||
|
const stderr = new TextDecoder().decode(swarmResult.stderr);
|
||||||
|
if (stderr.includes('already part of a swarm')) {
|
||||||
|
logger.info('Docker Swarm already initialized');
|
||||||
|
} else {
|
||||||
|
logger.warn(`Docker Swarm init warning: ${stderr.trim()}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if Onebox is initialized
|
* Check if Onebox is initialized
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@serve.zone/onebox',
|
name: '@serve.zone/onebox',
|
||||||
version: '1.14.3',
|
version: '1.14.7',
|
||||||
description: 'Self-hosted container platform with automatic SSL and DNS - a mini Heroku for single servers'
|
description: 'Self-hosted container platform with automatic SSL and DNS - a mini Heroku for single servers'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user