2015-07-20 00:09:47 -07:00
'use strict' ;
2019-07-25 14:40:52 -07:00
let fs = require ( 'fs' ) ,
path = require ( 'path' ) ;
2019-07-25 15:43:51 -07:00
const CLOUDRON = process . env . BOX _ENV === 'cloudron' ,
TEST = process . env . BOX _ENV === 'test' ;
2015-07-20 00:09:47 -07:00
exports = module . exports = {
2016-05-04 15:35:59 -07:00
SMTP _LOCATION : 'smtp' ,
IMAP _LOCATION : 'imap' ,
2016-09-26 22:17:35 -07:00
// These are combined into one array because users and groups become mailboxes
RESERVED _NAMES : [
// Reserved usernames
// https://github.com/gogits/gogs/blob/52c8f691630548fe091d30bcfe8164545a05d3d5/models/repo.go#L393
2018-01-19 22:10:10 -08:00
// apps like wordpress, gogs don't like these
// postmaster is used in dovecot and haraka
'admin' , 'no-reply' , 'postmaster' , 'mailer-daemon' ,
2016-09-26 22:17:35 -07:00
// Reserved groups
'admins' , 'users' // ldap code uses 'users' pseudo group
] ,
2021-05-05 12:29:04 -07:00
DASHBOARD _LOCATION : 'my' ,
2015-07-20 00:09:47 -07:00
2019-07-25 15:43:51 -07:00
PORT : CLOUDRON ? 3000 : 5454 ,
2019-07-25 15:27:28 -07:00
INTERNAL _SMTP _PORT : 2525 , // this value comes from the mail container
2020-11-09 20:34:48 -08:00
AUTHWALL _PORT : 3001 ,
2019-07-25 15:33:34 -07:00
LDAP _PORT : 3002 ,
DOCKER _PROXY _PORT : 3003 ,
2022-01-07 14:06:13 +01:00
USER _DIRECTORY _LDAPS _PORT : 3004 , // user directory LDAP with TLS rerouting in iptables, public port is 636
2021-11-22 21:10:36 +01:00
2018-11-10 22:02:42 -08:00
NGINX _DEFAULT _CONFIG _FILE _NAME : 'default.conf' ,
2017-01-06 14:19:38 +01:00
2021-04-30 10:31:09 -07:00
DEFAULT _TOKEN _EXPIRATION _MSECS : 365 * 24 * 60 * 60 * 1000 , // 1 year
DEFAULT _TOKEN _EXPIRATION _DAYS : 365 ,
2016-08-01 10:14:45 +02:00
2016-08-31 21:00:05 -07:00
DEFAULT _MEMORY _LIMIT : ( 256 * 1024 * 1024 ) , // see also client.js
2016-12-14 14:54:17 +01:00
DEMO _USERNAME : 'cloudron' ,
2021-01-11 22:04:12 -08:00
DEMO _BLACKLISTED _APPS : [
'com.github.cloudtorrent' ,
'net.alltubedownload.cloudronapp' ,
'com.adguard.home.cloudronapp' ,
'com.transmissionbt.cloudronapp' ,
2021-01-11 22:29:21 -08:00
'io.github.sickchill.cloudronapp' ,
'to.couchpota.cloudronapp'
2021-01-11 22:04:12 -08:00
] ,
2021-11-15 13:55:29 -08:00
DEMO _APP _LIMIT : 20 ,
2016-12-14 14:54:17 +01:00
2019-02-15 10:55:15 -08:00
AUTOUPDATE _PATTERN _NEVER : 'never' ,
2021-07-08 10:40:10 +02:00
// the db field is a blob so we make this explicit
AVATAR _NONE : Buffer . from ( '' , 'utf8' ) ,
AVATAR _GRAVATAR : Buffer . from ( 'gravatar' , 'utf8' ) ,
AVATAR _CUSTOM : Buffer . from ( 'custom' , 'utf8' ) , // this is not used here just for reference. The field will contain a byte buffer instead of the type string
2021-07-07 14:31:39 +02:00
2020-05-14 23:04:08 +02:00
SECRET _PLACEHOLDER : String . fromCharCode ( 0x25CF ) . repeat ( 8 ) , // also used in dashboard client.js
2019-07-25 14:40:52 -07:00
2019-07-25 15:43:51 -07:00
CLOUDRON : CLOUDRON ,
TEST : TEST ,
2019-07-25 14:40:52 -07:00
2022-01-31 16:55:45 -08:00
PORT25 _CHECK _SERVER : 'port25check.cloudron.io' ,
2020-02-04 13:07:26 -08:00
SUPPORT _EMAIL : 'support@cloudron.io' ,
2022-01-07 14:06:13 +01:00
USER _DIRECTORY _LDAP _DN : 'cn=admin,ou=system,dc=cloudron' ,
2022-01-07 09:57:02 +01:00
2020-10-18 10:15:36 -07:00
FOOTER : '© %YEAR% [Cloudron](https://cloudron.io) [Forum <i class="fa fa-comments"></i>](https://forum.cloudron.io)' ,
2020-03-06 18:08:26 -08:00
2021-11-17 11:14:33 -08:00
VERSION : process . env . BOX _ENV === 'cloudron' ? fs . readFileSync ( path . join ( _ _dirname , '../VERSION' ) , 'utf8' ) . trim ( ) : '7.0.0-test'
2015-07-20 00:09:47 -07:00
} ;