Compare commits

..

No commits in common. "ff95f2fdfc46c775f38b862a3b7e3b3ef1539f97" and "f981518d8807ae6ea9b851de6be0a7308c7d5432" have entirely different histories.

7 changed files with 10 additions and 28 deletions

View file

@ -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";

View file

@ -1,10 +1,10 @@
import { buildForgejo } from "./build.js";
import { Alpine } from "../../alpine.js";
import { Runit } from "../../runit/index.js";
import { writeFile } from "node:fs/promises";
import { Alpine } from "../alpine.js";
import { Runit } from "../runit/index.js";
import { constants, writeFile } from "node:fs/promises";
import { join } from "node:path";
import { loadForgejoSecretsFile } from "./secrets.js";
import { sudoChown, sudoCopy } from "../../helpers/sudo.js";
import { sudoChmod, sudoChown, sudoCopy } from "../helpers/sudo.js";
export async function setupForgejo(alpine: Alpine, runit: Runit) {
const bin = await buildForgejo();

View file

@ -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 {

View file

@ -3,14 +3,13 @@ import { tmpdir } from "node:os";
import path from "node:path";
import { cwd, exit } from "node:process";
import { Alpine } from "./alpine.js";
import { setupForgejo } from "./services/forgejo/index.js";
import { generateForgejoSecretsFile } from "./services/forgejo/secrets.js";
import { setupForgejo } from "./forgejo/index.js";
import { generateForgejoSecretsFile } from "./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();
@ -31,7 +30,6 @@ 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);

View file

@ -5,7 +5,7 @@
"description": "",
"main": "index.js",
"scripts": {
"build": "esbuild --log-level=warning --target=node18 --sourcemap --outdir=build-javascript --outbase=. *.ts **/*.ts **/**/*.ts",
"build": "esbuild --log-level=warning --target=node18 --sourcemap --outdir=build-javascript --outbase=. *.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"

View file

@ -1,16 +0,0 @@
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
`
);
}