From 28127eb3ecf6527a06642f489cbd368763bab7f0 Mon Sep 17 00:00:00 2001 From: Nulo Date: Thu, 16 Feb 2023 21:38:49 -0300 Subject: [PATCH] usar nueva api para guardar config --- services/forgejo/index.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/services/forgejo/index.ts b/services/forgejo/index.ts index 9eda351..970d606 100644 --- a/services/forgejo/index.ts +++ b/services/forgejo/index.ts @@ -1,10 +1,9 @@ import { buildForgejo } from "./build.js"; 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 { sudoChown, sudoCopy, sudoWriteFile } from "../../helpers/sudo.js"; +import { sudoCopy } from "../../helpers/sudo.js"; export async function setupForgejo(alpine: Alpine, runit: Runit) { const bin = await buildForgejo(); @@ -20,9 +19,8 @@ export async function setupForgejo(alpine: Alpine, runit: Runit) { }); const secrets = await loadForgejoSecretsFile(); - const configPath = join(alpine.dir, "/etc/forgejo.conf"); - await sudoWriteFile( - configPath, + await alpine.writeFile( + "/etc/forgejo.conf", ` ; see https://docs.gitea.io/en-us/config-cheat-sheet/ for additional documentation. @@ -145,9 +143,8 @@ ALLOWED_HOST_LIST=external,loopback REPO_INDEXER_ENABLED=true REPO_INDEXER_EXCLUDE=**.mp4,**.jpg `, - { mode: 0o600 } + entry ); - await sudoChown(configPath, `${entry.uid}:${entry.gid}`); await runit.addService( "forgejo", `#!/bin/sh