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://postgres:root@localhost:5432/wafrn',
18 listenIp: '0.0.0.0',
19 port: 9000,
20 // 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
21 fediPort: 9000,
22 // If you want to run the cache routes in another port, same thing!
23 cachePort: 9000,
24 saltRounds: 14,
25 // for jwt secret you should use something like https://www.grc.com/passwords.htm please this is SUPER DUPER SECRET.
26 jwtSecret: Buffer.from('secret', 'base64'),
27 // https://app.wafrn.net
28 frontendUrl: 'https://localhost',
29 // app.wafrn.net
30 instanceUrl: 'localhost',
31 // https://media.wafrn.net
32 mediaUrl: 'https://localhost/api/uploads',
33 // 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
34 externalCacheurl: 'https://localhost/api/cache?media=',
35 // 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.
36 // You can deploy https://github.com/sztupy/did-decoder-lambda this project to Netlify or Vercel as a backup for example
37 externalCacheBackups: [],
38 // 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 @
39 adminUser: 'admin',
40 // admin email wich you will recive things like "someone registred and you need to review this"
41 adminEmail: 'admin@example.com',
42 adminPassword: 'Password1!',
43 // after creating the deleted_user we advice to also set the user to BANNED
44 deletedUser: '@DELETEDUSER',
45 // in MB. Please make sure you have the same in the frontend
46 uploadLimit: 250,
47 // 20 is a good number. With the new query we could investigate a higher number but no need to do it
48 postsPerPage: 20,
49 // trace is extreme logging. debug is ok for now
50 logLevel: 'debug',
51 // There is a script that loads the file from this url and blocks the servers
52 blocklistUrl: '',
53 // In some cases we serve the frontend with the backend with a small preprocessing. We need the location of the frontend
54 frontedLocation: '${{ROOT_DIR}}/packages/frontend/dist/wafrn/browser/',
55 // oh yes, you need TWO redis connections, one for queues other for cache
56 bullmqConnection: {
57 host: 'localhost',
58 port: 6379,
59 db: 0
60 },
61 // second database used for cache
62 redisioConnection: {
63 host: 'localhost',
64 port: 6379,
65 db: 1
66 },
67 // this will create a backendlog.log file on the folder superior to this one.
68 pinoTransportOptions: {
69 targets: [
70 {
71 target: 'pino/file',
72 level: 'debug',
73 options: {
74 destination: 1
75 }
76 }
77 ]
78 },
79 // 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
80 // you might need to enable https://myaccount.google.com/lesssecureapps
81 // https://miracleio.me/snippets/use-gmail-with-nodemailer/
82 emailConfig: {
83 host: 'localhost',
84 port: 587,
85 auth: {
86 user: 'username',
87 pass: 'password',
88 from: 'wafrn@example.com'
89 }
90 },
91 // you dont have an smtp server and you want to do a single user instance? set this to true!
92 disableRequireSendEmail: true,
93 // if someone is trying to scrap your place you can send a funny message in some petitions (attacks to the frontend)
94 blockedIps: [] as string[],
95 // do you want to manually review registrations or have them open? We advice to leave this one to true
96 reviewRegistrations: true,
97 // 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
98 ignoreBlockHosts: [] as string[],
99 // default SEO data that will be used when trying to load server data
100 defaultSEOData: {
101 title: 'localhost',
102 description: 'localhost, a wafrn instance',
103 img: 'https://localhost/assets/logo.png'
104 },
105 enableBsky: false,
106 bskyPds: 'pds.localhost',
107 // to generate these keys use the following command: `npx web-push generate-vapid-keys`. Remember to do the environment one too!!
108 webpushPrivateKey: '${{WEBPUSH_PRIVATE}}',
109 webpushPublicKey: '${{WEBPUSH_PUBLIC}}',
110 // 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
111 webpushEmail: '${{WEBPUSH_EMAIL}}',
112 frontendEnvironment: {
113 logo: '/assets/logo.png',
114 frontUrl: 'https://localhost',
115 baseUrl: '/api',
116 baseMediaUrl: '/api/uploads',
117 externalCacheurl: '/api/cache?media=',
118 shortenPosts: 3,
119 disablePWA: false,
120 maintenance: false
121 }
122}