unoffical wafrn mirror
wafrn.net
atproto
social-network
activitypub
1import { Environment } from './interfaces/environment.js'
2
3export const baseEnvironment: Environment = {
4 prod: false,
5 // this makes the logs really heavy, but might be useful for queries
6 logSQLQueries: true,
7 workers: {
8 // if you set this to true, workers will start in the main thread. no need for starting the utils/workers.ts in other tmux tab
9 mainThread: true,
10 low: 5,
11 medium: 10,
12 high: 100
13 },
14 // this was a dev thing. leave to true unless you are doing stuff in local or your media url is yourinstance/uploads (not recomended)
15 removeFolderNameFromFileUploads: true,
16 // we use now postgresql.
17 databaseConnectionString: 'postgresql://root:root@localhost:5432/wafrn',
18 // PROD
19 // databaseConnectionString: 'postgresql://wafrn:Skied-Obscurity6-Tightwad@localhost:1111/wafrn',
20
21 listenIp: '0.0.0.0',
22 port: 3002,
23 // In the case of you wantint to put fedi petitions in another thread, use a different port here. You will have to update your apache config
24 fediPort: 3002,
25 // If you want to run the cache routes in another port, same thing!
26 cachePort: 3002,
27 saltRounds: 14,
28 // for jwt secret you should use something like https://www.grc.com/passwords.htm please this is SUPER DUPER SECRET.
29 jwtSecret: Buffer.from('secret', 'base64'),
30 // https://app.wafrn.net
31 frontendUrl: 'https://local.dev.wafrn.net',
32 // app.wafrn.net
33 instanceUrl: 'local.dev.wafrn.net',
34 // https://media.wafrn.net
35 mediaUrl: 'https://local.dev.wafrn.net/api/uploads',
36 // You should run also this project github.com/gabboman/fediversemediacacher. In my case, https://cache.wafrn.net/?media= The cache is there because at some point in the past I configured it to precache images. No need for it to be honest
37 externalCacheurl: 'https://local.dev.wafrn.net/api/cache?media=',
38 // If main cache fails due to IP limits you can install additional proxies, and use them here. The cache will try these as well before failing.
39 // You can deploy https://github.com/sztupy/did-decoder-lambda this project to Netlify or Vercel as a backup for example
40 externalCacheBackups: [],
41 // after the first run, create the admin user. and a deleted user. You will have to edit the user url in db so it starts with an @
42 adminUser: 'admin',
43 // admin email wich you will recive things like "someone registred and you need to review this"
44 adminEmail: 'YOUREMAILGOESHERE',
45 adminPassword: 'ADMINPASSWORD',
46 // after creating the deleted_user we advice to also set the user to BANNED
47 deletedUser: '@DELETEDUSER',
48 // in MB. Please make sure you have the same in the frontend
49 uploadLimit: 250,
50 // 20 is a good number. With the new query we could investigate a higher number but no need to do it
51 postsPerPage: 20,
52 // trace is extreme logging. debug is ok for now
53 logLevel: 'debug',
54 // There is a script that loads the file from this url and blocks the servers
55 blocklistUrl: '',
56 // In some cases we serve the frontend with the backend with a small preprocessing. We need the location of the frontend
57 frontedLocation: '/Users/gabriel/workspace/wafrn/packages/frontend/dist/wafrn/browser',
58 // oh yes, you need TWO redis connections, one for queues other for cache
59 bullmqConnection: {
60 host: 'localhost',
61 port: 6379,
62 db: 0
63 },
64 // second database used for cache
65 redisioConnection: {
66 host: 'localhost',
67 port: 6379,
68 db: 1
69 },
70 // this will create a backendlog.log file on the folder superior to this one.
71 pinoTransportOptions: {
72 targets: [
73 {
74 target: 'pino/file',
75 level: 'trace',
76 options: {
77 destination: 1
78 }
79 }
80 ]
81 },
82 // you can try with gmail but we actually use sendinblue for this. bear in mind that this might require some fiddling in your gmail account too
83 // you might need to enable https://myaccount.google.com/lesssecureapps
84 // https://miracleio.me/snippets/use-gmail-with-nodemailer/
85 emailConfig: {
86 host: 'mail.wafrn.net',
87 port: 587,
88 auth: {
89 user: 'info@wafrn.net',
90 pass: 'didYouThoughtIwouldLeaveThisOneHere?',
91 from: 'info@wafrn.net'
92 }
93 },
94 // you dont have an smtp server and you want to do a single user instance? set this to true!
95 disableRequireSendEmail: true,
96 // if someone is trying to scrap your place you can send a funny message in some petitions (attacks to the frontend)
97 blockedIps: [] as string[],
98 // do you want to manually review registrations or have them open? We advice to leave this one to true
99 reviewRegistrations: true,
100 // if the blocklist youre using turns out to be biased you can tell the script that loads the block host to do not block these hosts
101 ignoreBlockHosts: [] as string[],
102 // default SEO data that will be used when trying to load server data
103 defaultSEOData: {
104 title: 'localhost',
105 description: 'localhost, a wafrn instance',
106 img: 'https://localhost/assets/logo.png'
107 },
108 enableBsky: false,
109 bskyPds: 'at.app.wafrn.net',
110 bskyPdsJwtSecret: 'SENSITIVE',
111 bskyPdsAdminPassword: 'SENSITIVE',
112 bskyMasterInviteCode: 'SENSITIVE-INFO-LOL',
113 bskyConstellationUrl: 'https://constellation.microcosm.blue',
114 bskySlingshotUrl: 'https://slingshot.microcosm.blue',
115 bskyJetstreamUrl: 'wss://jetstream.fire.hose.cam/subscribe',
116 // to generate these keys use the following command: `npx web-push generate-vapid-keys`. Remember to do the environment one too!!
117 webpushPrivateKey: 'CDUUngHrbAUOBg_1-jXZJFj3IOGMTAbR5zhJupKzMOE',
118 webpushPublicKey: 'BIWrO9knKAnPj2TFfU7pIxo0QkO_b2-PZCqYwAPArJdHTQ3Xsvf-E_WXaKGFB531fBOxCE92SZ6R_vHTVM1yTNw',
119 // this is a email that will be sent to the distribution services in the users devices in case the owner of the distribution service wants to contact the server that is sending the notifications
120 webpushEmail: 'mailto:info@wafrn.net',
121 // registration level for the instance
122 registrationLevel: 'PRIVATE',
123 disableShowingBlockedServers: false,
124 bubbleHostsShowType: 'PUBLIC',
125 blockedHostsShowType: 'PUBLIC',
126 autoFollowAdmin: true,
127 minimumAgeToRegister: 18,
128 donationUrl: 'http://localhost/about',
129 bskyRotationKeyK256: '',
130 frontendEnvironment: {
131 logo: '/assets/logo.png',
132 frontUrl: 'http://localhost:4200',
133 baseUrl: 'http://localhost:4200/api',
134 baseMediaUrl: '/api/uploads',
135 externalCacheurl: '/api/cache?media=',
136 shortenPosts: 3,
137 disablePWA: false,
138 maintenance: false,
139 registrationLevel: 'PRIVATE',
140 privateInstanceRegistrationText: 'test 123',
141 minimumAgeToRegister: 18,
142 donationUrl: 'http://localhost/about',
143 disableShowingBlockedServers: true
144 }
145}