Skip to content
This repository was archived by the owner on Nov 23, 2022. It is now read-only.

Commit e005a44

Browse files
committed
Auto-prepend dot to baseDomain if it's not present,
Document baseDomain usage in readme a bit more. Addresses: exoframejs/exoframe#111
1 parent 35d54ac commit e005a44

File tree

3 files changed

+43
-14
lines changed

3 files changed

+43
-14
lines changed

README.md

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,43 @@ Exoframe stores its config in `~/.exoframe/server.config.yml`.
5858
Currently it contains the following settings:
5959

6060
```yaml
61-
debug: false # whether debug mode is enabled, default "false"
62-
letsencrypt: false # whether to enable letsencrypt, default "false"
63-
letsencryptEmail: your@email.com # email used for letsencrypt
64-
compress: true # whether to apply gzip compression, default "true"
65-
baseDomain: false # base domain to use for deployments without domains specified, default "false"
66-
cors: false # CORS support; can be "true" ("*" header) or object with "origin" property, default "false"
67-
traefikImage: 'traefik:latest' # Traefik image to be used; set to "false" to disable traefik management, default "traefik:latest"
68-
traefikName: 'exoframe-traefik' # Traefik container name, default "exoframe-traefik"
69-
traefikArgs: [] # Additional Traefik start args, default []
70-
exoframeNetwork: 'exoframe' # Network used by traefik to connect services to, default "exoframe"
71-
updateChannel: 'stable' # server image update channel; can be "stable" or "nightly", default "stable"
72-
publicKeysPath: '/path/to/your/public/keys' # path to folder with authorized_keys, default "~/.ssh"
61+
# whether debug mode is enabled, default "false"
62+
debug: false
63+
64+
# whether to enable letsencrypt, default "false"
65+
letsencrypt: false
66+
67+
# email used for letsencrypt
68+
letsencryptEmail: your@email.com
69+
70+
# whether to apply gzip compression, default "true"
71+
compress: true
72+
73+
# base top-level domain to use for deployments without domains specified, default "false"
74+
# used as postfix, e.g. if you specify ".example.com" (dot is auto-prepended if not present)
75+
# all your deployments will be autodeployed as "deployment-id.example.com"
76+
baseDomain: false
77+
78+
# CORS support; can be "true" ("*" header) or object with "origin" property, default "false"
79+
cors: false
80+
81+
# Traefik image to be used; set to "false" to disable traefik management, default "traefik:latest"
82+
traefikImage: 'traefik:latest'
83+
84+
# Traefik container name, default "exoframe-traefik"
85+
traefikName: 'exoframe-traefik'
86+
87+
# Additional Traefik start args, default []
88+
traefikArgs: []
89+
90+
# Network used by traefik to connect services to, default "exoframe"
91+
exoframeNetwork: 'exoframe'
92+
93+
# server image update channel; can be "stable" or "nightly", default "stable"
94+
updateChannel: 'stable'
95+
96+
# path to folder with authorized_keys, default "~/.ssh"
97+
publicKeysPath: '/path/to/your/public/keys'
7398
```
7499
75100
_Warning:_ Most changes to config are applied immediately. With exception of Letsencrypt config. If you are enabling letsencrypt after Traefik instance has been started, you'll need to remove Traefik and then restart Exoframe server for changes to take effect.

src/docker/start.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ module.exports = async ({image, username, resultStream}) => {
1414
const config = getProjectConfig();
1515

1616
// generate host
17-
const defaultDomain = serverConfig.baseDomain ? `${name}${serverConfig.baseDomain}` : undefined;
17+
// construct base domain from config, prepend with "." if it's not there
18+
const baseDomain = serverConfig.baseDomain ? serverConfig.baseDomain.replace(/^(\.?)/, '.') : undefined;
19+
// construc default domain using given base domain
20+
const defaultDomain = baseDomain ? `${name}${baseDomain}` : undefined;
21+
// construct host
1822
const host = config.domain === undefined ? defaultDomain : config.domain;
1923

2024
// generate env vars

test/fixtures/server.config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
debug: true
22
letsencrypt: false
33
letsencryptEmail: test@gmail.com
4-
baseDomain: '.test'
4+
baseDomain: 'test'
55
cors:
66
origin: 'http://test.com'

0 commit comments

Comments
 (0)