Compare commits
No commits in common. "ff95f2fdfc46c775f38b862a3b7e3b3ef1539f97" and "f981518d8807ae6ea9b851de6be0a7308c7d5432" have entirely different histories.
ff95f2fdfc
...
f981518d88
7 changed files with 10 additions and 28 deletions
|
@ -1,6 +1,6 @@
|
||||||
import { chmod, mkdir, readFile, writeFile } from "node:fs/promises";
|
import { chmod, mkdir, readFile, writeFile } from "node:fs/promises";
|
||||||
import { join } from "node:path";
|
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";
|
const FORGEJO_VERSION = "v1.18.3-0";
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { buildForgejo } from "./build.js";
|
import { buildForgejo } from "./build.js";
|
||||||
import { Alpine } from "../../alpine.js";
|
import { Alpine } from "../alpine.js";
|
||||||
import { Runit } from "../../runit/index.js";
|
import { Runit } from "../runit/index.js";
|
||||||
import { writeFile } from "node:fs/promises";
|
import { constants, writeFile } from "node:fs/promises";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
import { loadForgejoSecretsFile } from "./secrets.js";
|
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) {
|
export async function setupForgejo(alpine: Alpine, runit: Runit) {
|
||||||
const bin = await buildForgejo();
|
const bin = await buildForgejo();
|
|
@ -1,5 +1,5 @@
|
||||||
import { execFile } from "../../helpers/better-api.js";
|
import { execFile } from "../helpers/better-api.js";
|
||||||
import { generateSecretsFile, loadSecretsFile } from "../../helpers/secrets.js";
|
import { generateSecretsFile, loadSecretsFile } from "../helpers/secrets.js";
|
||||||
import { buildForgejo } from "./build.js";
|
import { buildForgejo } from "./build.js";
|
||||||
|
|
||||||
export interface ForgejoSecrets {
|
export interface ForgejoSecrets {
|
6
index.ts
6
index.ts
|
@ -3,14 +3,13 @@ import { tmpdir } from "node:os";
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import { cwd, exit } from "node:process";
|
import { cwd, exit } from "node:process";
|
||||||
import { Alpine } from "./alpine.js";
|
import { Alpine } from "./alpine.js";
|
||||||
import { setupForgejo } from "./services/forgejo/index.js";
|
import { setupForgejo } from "./forgejo/index.js";
|
||||||
import { generateForgejoSecretsFile } from "./services/forgejo/secrets.js";
|
import { generateForgejoSecretsFile } from "./forgejo/secrets.js";
|
||||||
import { execFile } from "./helpers/better-api.js";
|
import { execFile } from "./helpers/better-api.js";
|
||||||
import { sudoChownToRunningUser } from "./helpers/sudo.js";
|
import { sudoChownToRunningUser } from "./helpers/sudo.js";
|
||||||
import { setupKernel } from "./kernel.js";
|
import { setupKernel } from "./kernel.js";
|
||||||
import { runQemu } from "./qemu.js";
|
import { runQemu } from "./qemu.js";
|
||||||
import { Runit } from "./runit/index.js";
|
import { Runit } from "./runit/index.js";
|
||||||
import { setupDhcpcd } from "./services/dhcpcd.js";
|
|
||||||
|
|
||||||
if (process.argv[2] === "generate-secrets") {
|
if (process.argv[2] === "generate-secrets") {
|
||||||
await generateForgejoSecretsFile();
|
await generateForgejoSecretsFile();
|
||||||
|
@ -31,7 +30,6 @@ if (process.argv[2] === "generate-secrets") {
|
||||||
|
|
||||||
await alpine.addPackages(["helix", "iproute2-ss", "socat"]);
|
await alpine.addPackages(["helix", "iproute2-ss", "socat"]);
|
||||||
const runit = await Runit.setup(alpine);
|
const runit = await Runit.setup(alpine);
|
||||||
await setupDhcpcd(alpine, runit);
|
|
||||||
await setupForgejo(alpine, runit);
|
await setupForgejo(alpine, runit);
|
||||||
const kernel = await setupKernel(alpine, kernelDir);
|
const kernel = await setupKernel(alpine, kernelDir);
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"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",
|
"run": "pnpm build && node --enable-source-maps build-javascript/index.js",
|
||||||
"test": "pnpm build && node --enable-source-maps build-javascript/**/*.test.js",
|
"test": "pnpm build && node --enable-source-maps build-javascript/**/*.test.js",
|
||||||
"tsc:check": "tsc --noEmit"
|
"tsc:check": "tsc --noEmit"
|
||||||
|
|
|
@ -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
|
|
||||||
`
|
|
||||||
);
|
|
||||||
}
|
|
Loading…
Reference in a new issue