Pulumi code for my server setup
0
fork

Configure Feed

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

split tangled file

+110 -103
+56
services/haring/atproto/knot.ts
··· 1 + import { DnsRecord } from "@pulumi/cloudflare"; 2 + import { Image } from "@pulumi/docker-build"; 3 + import { getEnv } from "~lib/env"; 4 + import { confMount, nvmeMount } from "~lib/service/mounts"; 5 + import { ContainerService } from "~lib/service/service"; 6 + import { getLatestCommit } from "~lib/util"; 7 + 8 + const knotImage = new Image( 9 + "knot", 10 + { 11 + tags: ["knot:latest"], 12 + context: { 13 + // location: "https://tangled.org/tangled.org/knot-docker.git", 14 + location: "https://tangled.org/bas.sh/knot-docker.git#spindle", 15 + }, 16 + target: "knot", 17 + buildArgs: { 18 + BUILDKIT_CONTEXT_KEEP_GIT_DIR: "true", 19 + }, 20 + exports: [ 21 + { 22 + docker: {}, 23 + }, 24 + ], 25 + push: false, 26 + buildOnPreview: false, 27 + }, 28 + { 29 + replacementTrigger: await getLatestCommit( 30 + "https://tangled.org/bas.sh/knot-docker/commits/spindle", 31 + ), 32 + }, 33 + ); 34 + 35 + export const knotService = new ContainerService("knot", { 36 + localImage: knotImage.digest, 37 + servicePort: 5555, 38 + ports: [22], 39 + mounts: [confMount("knot", "/app"), nvmeMount("knot", "/home/git/repositories")], 40 + volumes: [{ volumeName: "knot-keys", containerPath: "/etc/ssh/keys" }], 41 + envs: { 42 + KNOT_SERVER_HOSTNAME: "knot.bas.sh", 43 + KNOT_SERVER_OWNER: getEnv("ATPROTO_DID"), 44 + KNOT_SERVER_DB_PATH: "/app/knotserver.db", 45 + KNOT_SERVER_INTERNAL_LISTEN_ADDR: "localhost:5444", 46 + }, 47 + }); 48 + 49 + export const knotDnsRecord = new DnsRecord("knot", { 50 + zoneId: getEnv("CLOUDFLARE_ZONE_ID"), 51 + name: "knot", 52 + ttl: 1, 53 + type: "CNAME", 54 + content: "haring.bas.sh", 55 + proxied: false, 56 + });
+52
services/haring/atproto/spindle.ts
··· 1 + import { DnsRecord } from "@pulumi/cloudflare"; 2 + import { Image } from "@pulumi/docker-build"; 3 + import { getEnv } from "~lib/env"; 4 + import { dockerSocketRw, nvmeMount } from "~lib/service/mounts"; 5 + import { ContainerService } from "~lib/service/service"; 6 + import { getLatestCommit } from "~lib/util"; 7 + 8 + const spindleImage = new Image( 9 + "spindle", 10 + { 11 + tags: ["spindle:latest"], 12 + context: { 13 + // location: "https://tangled.org/tangled.org/knot-docker.git", 14 + location: "https://tangled.org/bas.sh/knot-docker.git#spindle", 15 + }, 16 + target: "spindle", 17 + buildArgs: { 18 + BUILDKIT_CONTEXT_KEEP_GIT_DIR: "true", 19 + }, 20 + exports: [ 21 + { 22 + docker: {}, 23 + }, 24 + ], 25 + push: false, 26 + buildOnPreview: false, 27 + }, 28 + { 29 + replacementTrigger: await getLatestCommit( 30 + "https://tangled.org/bas.sh/knot-docker/commits/spindle", 31 + ), 32 + }, 33 + ); 34 + 35 + export const spindleService = new ContainerService("spindle", { 36 + localImage: spindleImage.digest, 37 + servicePort: 6555, 38 + mounts: [nvmeMount("spindle", "/app"), dockerSocketRw], 39 + envs: { 40 + SPINDLE_SERVER_HOSTNAME: "spindle.bas.sh", 41 + SPINDLE_SERVER_OWNER: getEnv("ATPROTO_DID"), 42 + }, 43 + }); 44 + 45 + export const spindleDnsRecord = new DnsRecord("spindle", { 46 + zoneId: getEnv("CLOUDFLARE_ZONE_ID"), 47 + name: "spindle", 48 + ttl: 1, 49 + type: "CNAME", 50 + content: "haring.bas.sh", 51 + proxied: false, 52 + });
-102
services/haring/atproto/tangled.ts
··· 1 - import { DnsRecord } from "@pulumi/cloudflare"; 2 - import { Image } from "@pulumi/docker-build"; 3 - import { getEnv } from "~lib/env"; 4 - import { confMount, dockerSocketRw, nvmeMount } from "~lib/service/mounts"; 5 - import { ContainerService } from "~lib/service/service"; 6 - import { getLatestCommit } from "~lib/util"; 7 - 8 - const knotImage = new Image( 9 - "knot", 10 - { 11 - tags: ["knot:latest"], 12 - context: { 13 - // location: "https://tangled.org/tangled.org/knot-docker.git", 14 - location: "https://tangled.org/bas.sh/knot-docker.git#spindle", 15 - }, 16 - target: "knot", 17 - buildArgs: { 18 - BUILDKIT_CONTEXT_KEEP_GIT_DIR: "true", 19 - }, 20 - exports: [ 21 - { 22 - docker: {}, 23 - }, 24 - ], 25 - push: false, 26 - buildOnPreview: false, 27 - }, 28 - { 29 - replacementTrigger: await getLatestCommit( 30 - "https://tangled.org/bas.sh/knot-docker/commits/spindle", 31 - ), 32 - }, 33 - ); 34 - 35 - export const knotService = new ContainerService("knot", { 36 - localImage: knotImage.digest, 37 - servicePort: 5555, 38 - ports: [22], 39 - mounts: [confMount("knot", "/app"), nvmeMount("knot", "/home/git/repositories")], 40 - volumes: [{ volumeName: "knot-keys", containerPath: "/etc/ssh/keys" }], 41 - envs: { 42 - KNOT_SERVER_HOSTNAME: "knot.bas.sh", 43 - KNOT_SERVER_OWNER: getEnv("ATPROTO_DID"), 44 - KNOT_SERVER_DB_PATH: "/app/knotserver.db", 45 - KNOT_SERVER_INTERNAL_LISTEN_ADDR: "localhost:5444", 46 - }, 47 - }); 48 - 49 - export const knotDnsRecord = new DnsRecord("knot", { 50 - zoneId: getEnv("CLOUDFLARE_ZONE_ID"), 51 - name: "knot", 52 - ttl: 1, 53 - type: "CNAME", 54 - content: "haring.bas.sh", 55 - proxied: false, 56 - }); 57 - 58 - const spindleImage = new Image( 59 - "spindle", 60 - { 61 - tags: ["spindle:latest"], 62 - context: { 63 - // location: "https://tangled.org/tangled.org/knot-docker.git", 64 - location: "https://tangled.org/bas.sh/knot-docker.git#spindle", 65 - }, 66 - target: "spindle", 67 - buildArgs: { 68 - BUILDKIT_CONTEXT_KEEP_GIT_DIR: "true", 69 - }, 70 - exports: [ 71 - { 72 - docker: {}, 73 - }, 74 - ], 75 - push: false, 76 - buildOnPreview: false, 77 - }, 78 - { 79 - replacementTrigger: await getLatestCommit( 80 - "https://tangled.org/bas.sh/knot-docker/commits/spindle", 81 - ), 82 - }, 83 - ); 84 - 85 - export const spindleService = new ContainerService("spindle", { 86 - localImage: spindleImage.digest, 87 - servicePort: 6555, 88 - mounts: [nvmeMount("spindle", "/app"), dockerSocketRw], 89 - envs: { 90 - SPINDLE_SERVER_HOSTNAME: "spindle.bas.sh", 91 - SPINDLE_SERVER_OWNER: getEnv("ATPROTO_DID"), 92 - }, 93 - }); 94 - 95 - const _spindleDnsRecord = new DnsRecord("spindle", { 96 - zoneId: getEnv("CLOUDFLARE_ZONE_ID"), 97 - name: "spindle", 98 - ttl: 1, 99 - type: "CNAME", 100 - content: "haring.bas.sh", 101 - proxied: false, 102 - });
+2 -1
services/haring/index.ts
··· 60 60 export * from "./atproto/pds"; 61 61 export * from "./atproto/relay"; 62 62 // export * from "./atproto/social-app"; 63 - export * from "./atproto/tangled"; 63 + export * from "./atproto/knot"; 64 + export * from "./atproto/spindle"; 64 65 65 66 export * from "./communication/ergo"; 66 67 export * from "./communication/thelounge";