Compare commits
3 commits
f981518d88
...
ff95f2fdfc
Author | SHA1 | Date | |
---|---|---|---|
ff95f2fdfc | |||
265b3843bf | |||
436c1a0f76 |
7 changed files with 28 additions and 10 deletions
6
index.ts
6
index.ts
|
@ -3,13 +3,14 @@ import { tmpdir } from "node:os";
|
|||
import path from "node:path";
|
||||
import { cwd, exit } from "node:process";
|
||||
import { Alpine } from "./alpine.js";
|
||||
import { setupForgejo } from "./forgejo/index.js";
|
||||
import { generateForgejoSecretsFile } from "./forgejo/secrets.js";
|
||||
import { setupForgejo } from "./services/forgejo/index.js";
|
||||
import { generateForgejoSecretsFile } from "./services/forgejo/secrets.js";
|
||||
import { execFile } from "./helpers/better-api.js";
|
||||
import { sudoChownToRunningUser } from "./helpers/sudo.js";
|
||||
import { setupKernel } from "./kernel.js";
|
||||
import { runQemu } from "./qemu.js";
|
||||
import { Runit } from "./runit/index.js";
|
||||
import { setupDhcpcd } from "./services/dhcpcd.js";
|
||||
|
||||
if (process.argv[2] === "generate-secrets") {
|
||||
await generateForgejoSecretsFile();
|
||||
|
@ -30,6 +31,7 @@ if (process.argv[2] === "generate-secrets") {
|
|||
|
||||
await alpine.addPackages(["helix", "iproute2-ss", "socat"]);
|
||||
const runit = await Runit.setup(alpine);
|
||||
await setupDhcpcd(alpine, runit);
|
||||
await setupForgejo(alpine, runit);
|
||||
const kernel = await setupKernel(alpine, kernelDir);
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "esbuild --log-level=warning --target=node18 --sourcemap --outdir=build-javascript --outbase=. *.ts **/*.ts",
|
||||
"build": "esbuild --log-level=warning --target=node18 --sourcemap --outdir=build-javascript --outbase=. *.ts **/*.ts **/**/*.ts",
|
||||
"run": "pnpm build && node --enable-source-maps build-javascript/index.js",
|
||||
"test": "pnpm build && node --enable-source-maps build-javascript/**/*.test.js",
|
||||
"tsc:check": "tsc --noEmit"
|
||||
|
|
16
services/dhcpcd.ts
Normal file
16
services/dhcpcd.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
import { Alpine } from "../alpine.js";
|
||||
import { Runit } from "../runit/index.js";
|
||||
|
||||
export async function setupDhcpcd(alpine: Alpine, runit: Runit) {
|
||||
await alpine.addPackages(["dhcpcd"]);
|
||||
|
||||
await alpine.symlink("/run/resolv.conf", "/etc/resolv.conf");
|
||||
await alpine.fstab.addTmpfs("/var/lib/dhcpcd");
|
||||
|
||||
await runit.addService(
|
||||
"dhcpcd",
|
||||
`#!/bin/sh
|
||||
exec dhcpcd --nobackground
|
||||
`
|
||||
);
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
import { chmod, mkdir, readFile, writeFile } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
import { reproRun } from "../helpers/repro-run.js";
|
||||
import { reproRun } from "../../helpers/repro-run.js";
|
||||
|
||||
const FORGEJO_VERSION = "v1.18.3-0";
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
import { buildForgejo } from "./build.js";
|
||||
import { Alpine } from "../alpine.js";
|
||||
import { Runit } from "../runit/index.js";
|
||||
import { constants, writeFile } from "node:fs/promises";
|
||||
import { Alpine } from "../../alpine.js";
|
||||
import { Runit } from "../../runit/index.js";
|
||||
import { writeFile } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
import { loadForgejoSecretsFile } from "./secrets.js";
|
||||
import { sudoChmod, sudoChown, sudoCopy } from "../helpers/sudo.js";
|
||||
import { sudoChown, sudoCopy } from "../../helpers/sudo.js";
|
||||
|
||||
export async function setupForgejo(alpine: Alpine, runit: Runit) {
|
||||
const bin = await buildForgejo();
|
|
@ -1,5 +1,5 @@
|
|||
import { execFile } from "../helpers/better-api.js";
|
||||
import { generateSecretsFile, loadSecretsFile } from "../helpers/secrets.js";
|
||||
import { execFile } from "../../helpers/better-api.js";
|
||||
import { generateSecretsFile, loadSecretsFile } from "../../helpers/secrets.js";
|
||||
import { buildForgejo } from "./build.js";
|
||||
|
||||
export interface ForgejoSecrets {
|
Loading…
Reference in a new issue