2015-07-20 00:09:47 -07:00
'use strict' ;
2022-04-02 17:09:08 -07:00
const fs = require ( 'fs' ) ,
2019-07-25 14:40:52 -07:00
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 = {
2022-07-14 15:18:17 +05:30
SMTP _SUBDOMAIN : 'smtp' ,
IMAP _SUBDOMAIN : 'imap' ,
2016-05-04 15:35:59 -07:00
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
2023-03-05 10:52:30 +01:00
'admin' , 'no-reply' , 'postmaster' , 'mailer-daemon' , 'root' ,
2016-09-26 22:17:35 -07:00
// Reserved groups
'admins' , 'users' // ldap code uses 'users' pseudo group
] ,
2022-07-14 15:18:17 +05:30
DASHBOARD _SUBDOMAIN : '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
2023-03-21 14:39:58 +01:00
OIDC _PORT : 3005 ,
2021-11-22 21:10:36 +01:00
2023-02-21 12:03:58 +01:00
// docker IPs
DOCKER _IPv4 _SUBNET : '172.18.0.0/16' ,
DOCKER _IPv4 _RANGE : '172.18.0.0/20' ,
DOCKER _IPv4 _GATEWAY : '172.18.0.1' ,
APPS _IPv4 _START : '172.18.16.1' ,
APPS _IPv4 _END : '172.18.20.255' ,
// these are hardcoded to allow connections from outside. this is not in "172.18.0.xx" since docker starts allocating from there
MYSQL _SERVICE _IPv4 : '172.18.30.1' ,
POSTGRESQL _SERVICE _IPv4 : '172.18.30.2' ,
MONGODB _SERVICE _IPv4 : '172.18.30.3' ,
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
2023-08-04 14:13:30 +05:30
DEMO : fs . existsSync ( '/etc/cloudron/DEMO' ) ,
2016-12-14 14:54:17 +01:00
DEMO _USERNAME : 'cloudron' ,
2021-01-11 22:04:12 -08:00
DEMO _BLACKLISTED _APPS : [
2022-11-30 21:36:29 +01:00
'org.jupyter.cloudronapp' ,
2021-01-11 22:04:12 -08:00
'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' ,
2023-11-01 23:54:09 +01:00
'to.couchpota.cloudronapp' ,
'org.qbittorrent.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
2022-06-09 13:57:57 +02:00
PROXY _APP _APPSTORE _ID : 'io.cloudron.builtin.appproxy' ,
2022-06-06 20:04:22 +02: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' ,
2022-04-01 13:44:46 -07:00
FORUM _URL : 'https://forum.cloudron.io' ,
2022-03-30 14:27:39 -07:00
SUPPORT _USERNAME : 'cloudron-support' ,
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
2022-11-30 19:56:51 +01:00
VERSION : process . env . BOX _ENV === 'cloudron' ? fs . readFileSync ( path . join ( _ _dirname , '../VERSION' ) , 'utf8' ) . trim ( ) : '7.3.0-test'
2015-07-20 00:09:47 -07:00
} ;