···11+# activitybun
22+33+To install dependencies:
44+55+```bash
66+bun install
77+```
88+99+To run:
1010+1111+```bash
1212+bun run index.ts
1313+```
1414+1515+This project was created using `bun init` in bun v1.1.33. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
bun.lockb
This is a binary file and will not be displayed.
+53
index.ts
···11+import fs from 'node:fs';
22+import os from 'node:os';
33+44+// Type the @ username that you want. Do not include an "@".
55+const username = encodeURI(process.env.USERNAME!);
66+77+// This is the user's "real" name.
88+const realName = process.env.REALNAME!;
99+1010+// This is the bio of your user.
1111+const summary = process.env.SUMMARY!;
1212+1313+// Generate locally or from https://cryptotools.net/rsagen
1414+// Newlines must be replaced with "\n"
1515+const key_private = process.env.KEY_PRIVATE!.replace('\n', '\n');
1616+const key_public = process.env.KEY_PUBLIC!.replace('\n', '\n');
1717+1818+// Password for sending messages
1919+const password = process.env.PASSWORD!;
2020+2121+// Internal data
2222+const server = os.hostname(); // Do not change this!
2323+2424+// Some requests require a User-Agent string.
2525+const USERAGENT = 'activitybun-single-ts-file/0.0';
2626+2727+// Set up where to save logs, posts, and images.
2828+// You can change these directories to something more suitable if you like.
2929+const data = 'data';
3030+const directories = {
3131+ inbox: `${data}/inbox`,
3232+ followers: `${data}/followers`,
3333+ following: `${data}/following`,
3434+ logs: `${data}/logs`,
3535+ posts: 'posts',
3636+ images: 'images',
3737+};
3838+3939+if (!fs.existsSync(data)) fs.mkdirSync(data);
4040+4141+// Create the directories if they don't already exist.
4242+for (const directory of Object.values(directories)) {
4343+ if (!fs.existsSync(directory)) {
4444+ fs.mkdirSync(directory);
4545+ }
4646+}
4747+4848+// Get the information sent to this server
4949+// $input = file_get_contents('php://input');
5050+// $body = json_decode($input, true);
5151+// $bodyData = print_r($body, true);
5252+5353+