Files
cloudron-box/src/constants.js

96 lines
3.1 KiB
JavaScript
Raw Normal View History

'use strict';
const fs = require('node:fs'),
path = require('node:path');
2019-07-25 15:43:51 -07:00
const CLOUDRON = process.env.BOX_ENV === 'cloudron',
TEST = process.env.BOX_ENV === 'test';
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
// 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
// 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',
// Reserved groups
'admins', 'users' // ldap code uses 'users' pseudo group
],
2022-07-14 15:18:17 +05:30
DASHBOARD_SUBDOMAIN: 'my',
2019-07-25 15:43:51 -07:00
PORT: CLOUDRON ? 3000 : 5454,
GRAPHITE_PORT: 2003,
2019-07-25 15:27:28 -07:00
INTERNAL_SMTP_PORT: 2525, // this value comes from the mail container
AUTHWALL_PORT: 3001,
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
OIDC_PORT: 3005,
TURN_PORT: 3478, // tcp and udp
TURN_TLS_PORT: 5349, // tcp and udp
TURN_UDP_PORT_START: 50000,
2025-06-04 13:23:47 +02:00
TURN_UDP_PORT_END: 50100,
// docker IPs
DOCKER_IPv4_SUBNET: '172.18.0.0/16',
2025-04-28 18:06:26 +02:00
DOCKER_IPv4_RANGE: '172.18.0.0/20', // addresses are dynamically allocated within this range (172.18.0.0-172.18.15.255)
DOCKER_IPv4_GATEWAY: '172.18.0.1',
2025-04-28 18:06:26 +02:00
APPS_IPv4_START: '172.18.16.1', // after DOCKER_IPv4_RANGE
APPS_IPv4_END: '172.18.20.255',
2025-04-28 18:20:04 +02:00
DOCKER_IPv6_SUBNET: 'fd00:c107:d509::/64',
// 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',
2025-01-02 23:31:57 +01:00
MAIL_SERVICE_IPv4: '172.18.30.4',
GRAPHITE_SERVICE_IPv4: '172.18.30.5',
2025-12-04 09:09:19 +01:00
SFTP_SERVICE_IPv4: '172.18.30.6',
NGINX_DEFAULT_CONFIG_FILE_NAME: 'default.conf',
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',
2024-05-23 09:52:05 +02:00
DEMO_BLOCKED_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
PROXY_APP_APPSTORE_ID: 'io.cloudron.builtin.appproxy',
2022-06-06 20:04:22 +02:00
CRON_PATTERN_NEVER: 'never',
2019-02-15 10:55:15 -08:00
SNAPSHOT_INFO_FILENAME: 'snapshot-info.json',
CLOUDRON,
TEST,
PORT25_CHECK_SERVER: 'port25check.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
FOOTER: '© %YEAR% [Cloudron](https://cloudron.io)',
2024-06-03 19:34:22 +02:00
VERSION: process.env.BOX_ENV === 'cloudron' ? fs.readFileSync(path.join(__dirname, '../VERSION'), 'utf8').trim() : '8.0.0-test'
};