···11-# Media Server Stack (Old)
22-33-### This is an old version of my media server config. The new version using Pulumi can be found [here](../..). The Docker Swarm setup is only kept for reference.
44-55-My media server is hosted with Docker Swarm. This repo consists of a Docker Compose file written in Jsonnet and compiled to JSON (works with any YAML parser because JSON is a subset of YAML).
66-77-My main server is called Haring (following my device hostname naming scheme of Dutch food).
88-99-Compile and copy to clipboard in WSL:
1010-```bash
1111-jsonnet haring.jsonnet -o haring.json && win32yank.exe -i < haring.json
1212-```
1313-or under Wayland
1414-```bash
1515-jsonnet haring.jsonnet -o haring.json && wl-copy < haring.json
1616-```
1717-or under Xorg
1818-```bash
1919-jsonnet haring.jsonnet -o haring.json && xclip < haring.json
2020-```
2121-2222-## Setup
2323-```bash
2424-docker swarm init
2525-docker stack deploy -c portainer-agent-stack.yml portainer
2626-```
2727-then deploy the media server stack by copying the contents of `haring.json` to Portainer.
···11-# Media Server Stack
22-33-The Pulumi code I use for my single node container-based media server (among other things). Used to be Docker Swarm, generating my Docker Compose file with Jsonnet (my old setup can be found in the [jsonnet](./.old/jsonnet) folder), but I have since switched to orchestrating Docker containers with Pulumi.
44-55-# Setup
66-77-```bash
88-bun install
99-pulumi up
1010-```
11+Experimenting with Pulumi for my single-node server setup.
···11+diff --git a/node_modules/@pulumi/pulumi/.bun-tag-46d0f34eb565d783 b/.bun-tag-46d0f34eb565d783
22+new file mode 100644
33+index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
44+diff --git a/node_modules/@pulumi/pulumi/.bun-tag-48654133d060ad05 b/.bun-tag-48654133d060ad05
55+new file mode 100644
66+index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
77+diff --git a/cmd/run/index.js b/cmd/run/index.js
88+index 0757cf0d31363909f424a0aee2bcd95f264d1b9f..a5d53602878b12b4a44cf46b590babfdf4ae1da6 100644
99+--- a/cmd/run/index.js
1010++++ b/cmd/run/index.js
1111+@@ -152,7 +152,6 @@ async function beforeExitHandler(code) {
1212+ // fact. For example, we want to keep track of ScriptId->FileNames so that we can appropriately
1313+ // report errors for Functions we cannot serialize. This can only be done (up to Node11 at least)
1414+ // by register to hear about scripts being parsed.
1515+-const v8Hooks = __importStar(require("../../runtime/closure/v8Hooks"));
1616+ // This is the entrypoint for running a Node.js program with minimal scaffolding.
1717+ const minimist_1 = __importDefault(require("minimist"));
1818+ function usage() {
1919+@@ -230,7 +229,8 @@ function main(args) {
2020+ addToEnvIfDefined("PULUMI_NODEJS_ENGINE", argv["engine"]);
2121+ addToEnvIfDefined("PULUMI_NODEJS_SYNC", argv["sync"]);
2222+ // Ensure that our v8 hooks have been initialized. Then actually load and run the user program.
2323+- v8Hooks.isInitializedAsync().then(() => {
2424++ const ready = process.versions.bun ? Promise.resolve() : import("../../runtime/closure/v8Hooks.js").then((v8Hooks) => v8Hooks.isInitializedAsync());
2525++ ready.then(() => {
2626+ const promise = require("./run").run(argv,
2727+ /*programStarted: */ () => {
2828+ programRunning = true;
2929+@@ -250,7 +250,7 @@ function main(args) {
3030+ }
3131+ function addToEnvIfDefined(key, value) {
3232+ if (value) {
3333+- process.env[key] = value;
3434++ process.env[key] = `${value}`;
3535+ }
3636+ }
3737+ main(process.argv.slice(2));
3838+diff --git a/cmd/run/run.js b/cmd/run/run.js
3939+index 2e2e1fd9dc9379197bc7a6c9f3e8b47e80c10a22..90a69c07f62c238c0ff36860700b45e8a5099457 100644
4040+--- a/cmd/run/run.js
4141++++ b/cmd/run/run.js
4242+@@ -235,7 +235,7 @@ async function run(argv, programStarted, reportLoggedError, isErrorReported) {
4343+ process.chdir(pwd);
4444+ }
4545+ // If this is a typescript project, we'll want to load node-ts.
4646+- const typeScript = process.env["PULUMI_NODEJS_TYPESCRIPT"] === "true";
4747++ const typeScript = !process.versions.bun && process.env["PULUMI_NODEJS_TYPESCRIPT"] === "true";
4848+ // We provide reasonable defaults for many ts options, meaning you don't need to have a tsconfig.json present
4949+ // if you want to use TypeScript with Pulumi. However, ts-node's default behavior is to walk up from the cwd to
5050+ // find a tsconfig.json. For us, it's reasonable to say that the "root" of the project is the cwd,
5151+diff --git a/cmd/run-plugin/index.js b/cmd/run-plugin/index.js
5252+index 5907d393cf8ac711624e3a77484adddba1c3158e..0c4dc3fe4f7895215619cfce77ddcf4068ed69e8 100644
5353+--- a/cmd/run-plugin/index.js
5454++++ b/cmd/run-plugin/index.js
5555+@@ -82,7 +82,6 @@ process.on("exit", (code) => {
5656+ // fact. For example, we want to keep track of ScriptId->FileNames so that we can appropriately
5757+ // report errors for Functions we cannot serialize. This can only be done (up to Node11 at least)
5858+ // by register to hear about scripts being parsed.
5959+-const v8Hooks = __importStar(require("../../runtime/closure/v8Hooks"));
6060+ // This is the entrypoint for running a Node.js program with minimal scaffolding.
6161+ const minimist_1 = __importDefault(require("minimist"));
6262+ function usage() {
6363+@@ -100,7 +99,8 @@ function main(args) {
6464+ return printUsageAndExit();
6565+ }
6666+ // Ensure that our v8 hooks have been initialized. Then actually load and run the user program.
6767+- v8Hooks.isInitializedAsync().then(() => {
6868++ const ready = process.versions.bun ? Promise.resolve() : import("../../runtime/closure/v8Hooks.js").then((v8Hooks) => v8Hooks.isInitializedAsync());
6969++ ready.then(() => {
7070+ const promise = require("./run").run({
7171+ argv,
7272+ programStarted: () => {
7373+diff --git a/cmd/run-policy-pack/index.js b/cmd/run-policy-pack/index.js
7474+index 1c701d52af34e0a52f2dabca7c52e4137549ae8a..53b3a9d97b1c5cd0b9212484354c55a073bdcd5f 100644
7575+--- a/cmd/run-policy-pack/index.js
7676++++ b/cmd/run-policy-pack/index.js
7777+@@ -82,7 +82,6 @@ process.on("exit", (code) => {
7878+ // fact. For example, we want to keep track of ScriptId->FileNames so that we can appropriately
7979+ // report errors for Functions we cannot serialize. This can only be done (up to Node11 at least)
8080+ // by register to hear about scripts being parsed.
8181+-const v8Hooks = __importStar(require("../../runtime/closure/v8Hooks"));
8282+ // This is the entrypoint for running a Node.js program with minimal scaffolding.
8383+ const minimist_1 = __importDefault(require("minimist"));
8484+ function usage() {
8585+@@ -102,7 +101,8 @@ function main(args) {
8686+ // Remove <engine-address> so we simply execute the program.
8787+ argv._.shift();
8888+ // Ensure that our v8 hooks have been initialized. Then actually load and run the user program.
8989+- v8Hooks.isInitializedAsync().then(() => {
9090++ const ready = process.versions.bun ? Promise.resolve() : import("../../runtime/closure/v8Hooks.js").then((v8Hooks) => v8Hooks.isInitializedAsync());
9191++ ready.then(() => {
9292+ const promise = require("./run").run({
9393+ argv,
9494+ programStarted: () => {
9595+diff --git a/runtime/index.js b/runtime/index.js
9696+index 3c616eed05fd57db76aa37e76c11507ec255ab75..6dd47a8a2b3e62e7a6f018c9f1f0d529ee3901a9 100644
9797+--- a/runtime/index.js
9898++++ b/runtime/index.js
9999+@@ -16,9 +16,14 @@ function __export(m) {
100100+ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
101101+ }
102102+ Object.defineProperty(exports, "__esModule", { value: true });
103103+-var serializeClosure_1 = require("./closure/serializeClosure");
104104+-exports.serializeFunctionAsync = serializeClosure_1.serializeFunctionAsync;
105105+-exports.serializeFunction = serializeClosure_1.serializeFunction;
106106++exports.serializeFunctionAsync = async (...args) => {
107107++ var serializeClosure_1 = await import("./closure/serializeClosure");
108108++ return serializeClosure_1.serializeFunctionAsync(...args);
109109++};
110110++exports.serializeFunction = async (...args) => {
111111++ var serializeClosure_1 = await import("./closure/serializeClosure");
112112++ return serializeClosure_1.serializeFunction(...args);
113113++};
114114+ var codePaths_1 = require("./closure/codePaths");
115115+ exports.computeCodePaths = codePaths_1.computeCodePaths;
116116+ var mocks_1 = require("./mocks");