Pulumi code for my server setup
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

reload unbound on config update

+49 -13
+20 -7
services/haring/networking/unbound/cachedb.conf
··· 1 1 server: 2 2 module-config: "validator cachedb iterator" 3 - # serve-expired: yes 4 - # serve-expired-ttl: 86400 5 - # serve-expired-client-timeout: 0 3 + num-threads: 8 4 + 5 + serve-expired: yes 6 + serve-expired-ttl: 86400 7 + serve-expired-client-timeout: 0 6 8 # cache-min-ttl: 300 9 + 10 + msg-cache-size: 256m 11 + rrset-cache-size: 512m 12 + neg-cache-size: 64m 13 + key-cache-size: 128m 14 + infra-cache-numhosts: 100000 15 + 16 + num-queries-per-thread: 4096 17 + outgoing-range: 8192 18 + jostle-timeout: 200 19 + 7 20 prefetch: yes 8 - msg-cache-size: 64m 9 - rrset-cache-size: 128m 21 + prefetch-key: yes 22 + 10 23 log-time-ascii: yes 11 - log-queries: yes 12 - log-replies: yes 24 + # log-queries: yes 25 + # log-replies: yes 13 26 extended-statistics: yes 14 27 15 28 remote-control:
+29 -6
services/haring/networking/unbound/unbound.ts
··· 1 1 import { remote } from "@pulumi/command"; 2 - import { asset } from "@pulumi/pulumi"; 2 + import { asset, ResourceHook } from "@pulumi/pulumi"; 3 + import { exec } from "child_process"; 3 4 import path from "path"; 4 5 import { confMount } from "~lib/service/mounts"; 5 6 import { defaultNetwork } from "~lib/service/networks"; ··· 9 10 10 11 const valkeyUnboundService = new ContainerService("valkey-unbound", { 11 12 image: "valkey/valkey", 12 - command: ["--save 300 1"], 13 + command: ["--save 300 1", "--loglevel warning"], 13 14 volumes: [{ volumeName: "valkey-unbound", containerPath: "/data" }], 14 15 }); 15 16 16 - const unboundConfig = new remote.CopyToRemote("unbound-config", { 17 - connection: defaultConnection, 18 - source: new asset.FileAsset(path.join(import.meta.dirname, "cachedb.conf")), 19 - remotePath: "/home/bas/docker/unbound/custom.conf.d/cachedb.conf", 17 + const afterConfigUpdateHook = new ResourceHook("after-unbound-config-update", () => { 18 + console.log("reloading unbound config"); 19 + exec("docker exec unbound unbound-control reload", (error, stdout, stderr) => { 20 + if (error) { 21 + console.error(`failed to reload unbound config: ${error}`); 22 + return; 23 + } 24 + 25 + console.log(stdout); 26 + console.error(stderr); 27 + console.log("unbound config reloaded"); 28 + }); 20 29 }); 30 + 31 + const unboundConfig = new remote.CopyToRemote( 32 + "unbound-config", 33 + { 34 + connection: defaultConnection, 35 + source: new asset.FileAsset(path.join(import.meta.dirname, "cachedb.conf")), 36 + remotePath: "/home/bas/docker/unbound/custom.conf.d/cachedb.conf", 37 + }, 38 + { 39 + hooks: { 40 + afterUpdate: [afterConfigUpdateHook], 41 + }, 42 + }, 43 + ); 21 44 22 45 export const UNBOUND_ADDRESS = "172.18.1.1"; 23 46