haoshoku 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/haoshoku.js +1 -1
- package/package.json +1 -1
- package/src/os_scripts/debian_server.js +11 -3
package/haoshoku.js
CHANGED
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import path from "path";
|
|
|
4
4
|
import fs from "fs";
|
|
5
5
|
import { homedir } from "os";
|
|
6
6
|
import net from "net";
|
|
7
|
+
import { fileURLToPath } from "url";
|
|
7
8
|
|
|
8
9
|
// --- Constants ---
|
|
9
10
|
const HOME = homedir();
|
|
@@ -11,7 +12,9 @@ const FISH_CONFIG_DIR = path.join(HOME, ".config", "fish");
|
|
|
11
12
|
const STARSHIP_CONFIG_PATH = path.join(HOME, ".config", "starship.toml");
|
|
12
13
|
|
|
13
14
|
// Project paths
|
|
14
|
-
const
|
|
15
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
16
|
+
const __dirname = path.dirname(__filename);
|
|
17
|
+
const PROJECT_ROOT = path.resolve(__dirname, "..", "..");
|
|
15
18
|
const CONFIGS_DIR = path.join(PROJECT_ROOT, "configs");
|
|
16
19
|
const CUSTOM_FISH_CONFIG_PATH = path.join(CONFIGS_DIR, "fish", "config.fish");
|
|
17
20
|
|
|
@@ -33,7 +36,10 @@ async function installEssentials() {
|
|
|
33
36
|
// Split installation to ensure core tools are installed even if optional ones fail
|
|
34
37
|
await runCommand("sudo apt install -y curl wget git vim ufw fail2ban");
|
|
35
38
|
// Try installing software-properties-common separately as it might not be available on all minimal images
|
|
36
|
-
await runCommand("sudo apt install -y software-properties-common", { check: false });
|
|
39
|
+
const spcResult = await runCommand("sudo apt install -y software-properties-common", { check: false });
|
|
40
|
+
if (!spcResult) {
|
|
41
|
+
log.warning("Could not install software-properties-common. Some PPAs might not work.");
|
|
42
|
+
}
|
|
37
43
|
}
|
|
38
44
|
|
|
39
45
|
async function setupSsh() {
|
|
@@ -60,10 +66,12 @@ async function setupSsh() {
|
|
|
60
66
|
async function configureFishShell() {
|
|
61
67
|
if (!(await commandExists("fish"))) {
|
|
62
68
|
log.info("Installing Fish shell...");
|
|
63
|
-
// Only try adding PPA if
|
|
69
|
+
// Only try adding PPA if add-apt-repository is available
|
|
64
70
|
if (await commandExists("add-apt-repository")) {
|
|
65
71
|
await runCommand("sudo apt-add-repository -y ppa:fish-shell/release-3");
|
|
66
72
|
await runCommand("sudo apt update");
|
|
73
|
+
} else {
|
|
74
|
+
log.warning("add-apt-repository not found. Installing fish from default repositories (might be older version).");
|
|
67
75
|
}
|
|
68
76
|
await runCommand("sudo apt install -y fish");
|
|
69
77
|
}
|