this repo has no description
0
fork

Configure Feed

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

Initial setup, create directories

alice 63d81982

+312
+12
.editorconfig
··· 1 + # EditorConfig is awesome: https://EditorConfig.org 2 + 3 + # top-most EditorConfig file 4 + root = true 5 + 6 + [*] 7 + indent_style = space 8 + indent_size = 2 9 + end_of_line = lf 10 + charset = utf-8 11 + trim_trailing_whitespace = false 12 + insert_final_newline = true
+180
.gitignore
··· 1 + # Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore 2 + 3 + # Logs 4 + 5 + logs 6 + _.log 7 + npm-debug.log_ 8 + yarn-debug.log* 9 + yarn-error.log* 10 + lerna-debug.log* 11 + .pnpm-debug.log* 12 + 13 + # Caches 14 + 15 + .cache 16 + 17 + # Diagnostic reports (https://nodejs.org/api/report.html) 18 + 19 + report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json 20 + 21 + # Runtime data 22 + 23 + pids 24 + _.pid 25 + _.seed 26 + *.pid.lock 27 + 28 + # Directory for instrumented libs generated by jscoverage/JSCover 29 + 30 + lib-cov 31 + 32 + # Coverage directory used by tools like istanbul 33 + 34 + coverage 35 + *.lcov 36 + 37 + # nyc test coverage 38 + 39 + .nyc_output 40 + 41 + # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 42 + 43 + .grunt 44 + 45 + # Bower dependency directory (https://bower.io/) 46 + 47 + bower_components 48 + 49 + # node-waf configuration 50 + 51 + .lock-wscript 52 + 53 + # Compiled binary addons (https://nodejs.org/api/addons.html) 54 + 55 + build/Release 56 + 57 + # Dependency directories 58 + 59 + node_modules/ 60 + jspm_packages/ 61 + 62 + # Snowpack dependency directory (https://snowpack.dev/) 63 + 64 + web_modules/ 65 + 66 + # TypeScript cache 67 + 68 + *.tsbuildinfo 69 + 70 + # Optional npm cache directory 71 + 72 + .npm 73 + 74 + # Optional eslint cache 75 + 76 + .eslintcache 77 + 78 + # Optional stylelint cache 79 + 80 + .stylelintcache 81 + 82 + # Microbundle cache 83 + 84 + .rpt2_cache/ 85 + .rts2_cache_cjs/ 86 + .rts2_cache_es/ 87 + .rts2_cache_umd/ 88 + 89 + # Optional REPL history 90 + 91 + .node_repl_history 92 + 93 + # Output of 'npm pack' 94 + 95 + *.tgz 96 + 97 + # Yarn Integrity file 98 + 99 + .yarn-integrity 100 + 101 + # dotenv environment variable files 102 + 103 + .env 104 + .env.development.local 105 + .env.test.local 106 + .env.production.local 107 + .env.local 108 + 109 + # parcel-bundler cache (https://parceljs.org/) 110 + 111 + .parcel-cache 112 + 113 + # Next.js build output 114 + 115 + .next 116 + out 117 + 118 + # Nuxt.js build / generate output 119 + 120 + .nuxt 121 + dist 122 + 123 + # Gatsby files 124 + 125 + # Comment in the public line in if your project uses Gatsby and not Next.js 126 + 127 + # https://nextjs.org/blog/next-9-1#public-directory-support 128 + 129 + # public 130 + 131 + # vuepress build output 132 + 133 + .vuepress/dist 134 + 135 + # vuepress v2.x temp and cache directory 136 + 137 + .temp 138 + 139 + # Docusaurus cache and generated files 140 + 141 + .docusaurus 142 + 143 + # Serverless directories 144 + 145 + .serverless/ 146 + 147 + # FuseBox cache 148 + 149 + .fusebox/ 150 + 151 + # DynamoDB Local files 152 + 153 + .dynamodb/ 154 + 155 + # TernJS port file 156 + 157 + .tern-port 158 + 159 + # Stores VSCode versions used for testing VSCode extensions 160 + 161 + .vscode-test 162 + 163 + # yarn v2 164 + 165 + .yarn/cache 166 + .yarn/unplugged 167 + .yarn/build-state.yml 168 + .yarn/install-state.gz 169 + .pnp.* 170 + 171 + # IntelliJ based IDEs 172 + .idea 173 + 174 + # Finder (MacOS) folder config 175 + .DS_Store 176 + 177 + data 178 + images 179 + posts 180 + notes.txt
+12
.prettierrc
··· 1 + { 2 + "trailingComma": "all", 3 + "tabWidth": 2, 4 + "semi": true, 5 + "singleQuote": true, 6 + "printWidth": 120, 7 + "experimentalTernaries": true, 8 + "plugins": ["@trivago/prettier-plugin-sort-imports"], 9 + "importOrder": ["^[./]"], 10 + "importOrderSeparation": true, 11 + "importOrderSortSpecifiers": true 12 + }
+15
README.md
··· 1 + # activitybun 2 + 3 + To install dependencies: 4 + 5 + ```bash 6 + bun install 7 + ``` 8 + 9 + To run: 10 + 11 + ```bash 12 + bun run index.ts 13 + ``` 14 + 15 + 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
··· 1 + import fs from 'node:fs'; 2 + import os from 'node:os'; 3 + 4 + // Type the @ username that you want. Do not include an "@". 5 + const username = encodeURI(process.env.USERNAME!); 6 + 7 + // This is the user's "real" name. 8 + const realName = process.env.REALNAME!; 9 + 10 + // This is the bio of your user. 11 + const summary = process.env.SUMMARY!; 12 + 13 + // Generate locally or from https://cryptotools.net/rsagen 14 + // Newlines must be replaced with "\n" 15 + const key_private = process.env.KEY_PRIVATE!.replace('\n', '\n'); 16 + const key_public = process.env.KEY_PUBLIC!.replace('\n', '\n'); 17 + 18 + // Password for sending messages 19 + const password = process.env.PASSWORD!; 20 + 21 + // Internal data 22 + const server = os.hostname(); // Do not change this! 23 + 24 + // Some requests require a User-Agent string. 25 + const USERAGENT = 'activitybun-single-ts-file/0.0'; 26 + 27 + // Set up where to save logs, posts, and images. 28 + // You can change these directories to something more suitable if you like. 29 + const data = 'data'; 30 + const directories = { 31 + inbox: `${data}/inbox`, 32 + followers: `${data}/followers`, 33 + following: `${data}/following`, 34 + logs: `${data}/logs`, 35 + posts: 'posts', 36 + images: 'images', 37 + }; 38 + 39 + if (!fs.existsSync(data)) fs.mkdirSync(data); 40 + 41 + // Create the directories if they don't already exist. 42 + for (const directory of Object.values(directories)) { 43 + if (!fs.existsSync(directory)) { 44 + fs.mkdirSync(directory); 45 + } 46 + } 47 + 48 + // Get the information sent to this server 49 + // $input = file_get_contents('php://input'); 50 + // $body = json_decode($input, true); 51 + // $bodyData = print_r($body, true); 52 + 53 +
+13
package.json
··· 1 + { 2 + "name": "activitybun", 3 + "module": "index.ts", 4 + "type": "module", 5 + "devDependencies": { 6 + "@trivago/prettier-plugin-sort-imports": "^4.3.0", 7 + "@types/bun": "latest", 8 + "prettier": "^3.3.3" 9 + }, 10 + "peerDependencies": { 11 + "typescript": "^5.0.0" 12 + } 13 + }
+27
tsconfig.json
··· 1 + { 2 + "compilerOptions": { 3 + // Enable latest features 4 + "lib": ["ESNext", "DOM"], 5 + "target": "ESNext", 6 + "module": "ESNext", 7 + "moduleDetection": "force", 8 + "jsx": "react-jsx", 9 + "allowJs": true, 10 + 11 + // Bundler mode 12 + "moduleResolution": "bundler", 13 + "allowImportingTsExtensions": true, 14 + "verbatimModuleSyntax": true, 15 + "noEmit": true, 16 + 17 + // Best practices 18 + "strict": true, 19 + "skipLibCheck": true, 20 + "noFallthroughCasesInSwitch": true, 21 + 22 + // Some stricter flags (disabled by default) 23 + "noUnusedLocals": false, 24 + "noUnusedParameters": false, 25 + "noPropertyAccessFromIndexSignature": false 26 + } 27 + }