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

Commit d3b564c

Browse files
committed
Merge branch 'develop', prepare v4.0
2 parents 2daeeda + 7558de1 commit d3b564c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+5406
-3179
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
node_modules/
33
coverage/
44
.nyc_output/
5+
dist/

.eslintrc

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,13 @@
11
{
2-
"extends": ["airbnb", "prettier"],
3-
"parserOptions": {
4-
"ecmaVersion": 2017,
5-
"sourceType": "module",
6-
"ecmaFeatures": {
7-
"jsx": true
8-
}
9-
},
2+
"parser": "babel-eslint",
3+
"extends": ["standard", "prettier"],
104
"plugins": ["prettier"],
11-
"env": {
12-
"es6": true,
13-
"node": true
14-
},
155
"rules": {
16-
"arrow-parens": "off",
17-
"object-curly-spacing": ["warn", "never"],
186
"max-len": ["error", 120, 4],
19-
"no-confusing-arrow": "warn",
20-
"global-require": "off",
21-
"no-underscore-dangle": "off",
22-
"no-await-in-loop": "off",
23-
"no-plusplus": "off",
7+
"camelcase": "off",
8+
"promise/param-names": "off",
249
"prefer-promise-reject-errors": "off",
25-
"comma-dangle": [
26-
"error",
27-
{
28-
"arrays": "always-multiline",
29-
"objects": "always-multiline",
30-
"imports": "always-multiline",
31-
"exports": "always-multiline",
32-
"functions": "ignore"
33-
}
34-
],
10+
"no-control-regex": "off",
3511
"prettier/prettier": [
3612
"error",
3713
{

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ node_modules
33
coverage
44
test/fixtures/auth.db
55
test/fixtures/deploying/
6-
test/fixtures/deploying-swarm/
6+
test/fixtures/secrets.db
7+
dist/
8+
bin/server-core.js

.travis.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,44 @@ language: node_js
55
services:
66
- docker
77

8-
node_js: 8
8+
node_js: 10
99

1010
cache: yarn
1111

1212
before_install:
13-
- curl -L https://github.com/docker/compose/releases/download/1.13.0/docker-compose-`uname -s`-`uname -m` > docker-compose
13+
- curl -L https://github.com/docker/compose/releases/download/1.23.2/docker-compose-`uname -s`-`uname -m` > docker-compose
1414
- chmod +x docker-compose
15-
- docker swarm init
1615

1716
after_success:
1817
- docker rmi $(docker images -q)
1918
- yarn coveralls
19+
# build npm binary
20+
- yarn build-bundle
21+
- mv dist/index.js bin/server-core.js
22+
# build main docker image
2023
- yarn build
2124
- docker login -u $HUB_USER -p $HUB_PASS
2225
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`
26+
- export DEBUG_TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "debug_latest"; else echo "debug_$TRAVIS_BRANCH" ; fi`
2327
- docker build --pull -t exoframe/server:$TAG .
2428
- if [ -z "$TRAVIS_TAG" ]; then echo "No tag, skipping"; else docker tag exoframe/server:$TAG exoframe/server:$TRAVIS_TAG; fi
29+
# build debug docker image
30+
- docker build --pull -f Dockerfile-debug -t exoframe/server:$DEBUG_TAG .
31+
# push all images to registry
2532
- docker push exoframe/server
2633

2734
env:
2835
global:
29-
- secure: MaXI0FCf4/HYQLiR/5Nhm7cGPVkAwzZTnargcHRLZwOWbGZ29zcEHOtO8r71LC9XHx8cHnxgpWMJkZOlgNY7Y84KNQfnnVNJpxZ66uzIQyMblndIlNJ7Y0CtLVBEQO7GAswDLx1XAobLxaCaQ7ZTr1CDLRaY2N7DJT76mAN20Q4Yet3PxBWwn6bBK/imptD3ZIRMi7OztnUVdc5Y7GicTWQOXju0K3sSOJDKBKvTJRtLER/qYWJnOKRrWVkAo3J6/hyW1wR+50i3zDnsbSOTvK0UgXx5z0ak7sLByCtPyCCgGU2vs0pauoJhEsN1lhtzKzrVmgqg5Ink0E0x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_branches: true
48+
condition: $TRAVIS_BRANCH =~ ^master|develop$

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# 3.3.0 / 2018-12-13
2+
3+
- Add basic secrets implementation
4+
5+
# 3.2.1 / 2018-12-10
6+
7+
- Mock github API to evade issues with rate-limits in CI
8+
9+
# 3.2.0 / 2018-12-10
10+
11+
- Moved server docs to main repo
12+
- Added support for frontend basic auth
13+
114
# 3.1.0 / 2018-09-19
215

316
- Better checks for compose version in template for swarm

Dockerfile-debug

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM node:lts
2+
3+
# install required libs, docker-compose and yarn
4+
RUN apt-get update && apt-get install python-pip -y && pip install docker-compose
5+
6+
# create folder and set it as workdir
7+
RUN mkdir -p /usr/src/app
8+
WORKDIR /usr/src/app
9+
10+
# copy binary
11+
COPY bin/server-core.js /usr/src/app/server-core.js
12+
COPY bin/exoframe-server.js /usr/src/app/exoframe-server.js
13+
14+
# expose ports
15+
EXPOSE 8080
16+
17+
CMD ["node", "exoframe-server.js"]

README.md

Lines changed: 2 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -10,127 +10,9 @@
1010

1111
Exoframe is a self-hosted tool that allows simple one-command deployments using Docker.
1212

13-
## Installation and Usage
13+
## Installation, usage and docs
1414

15-
1. Make sure you have Docker [installed and running](https://docs.docker.com/engine/installation/) on your host.
16-
2. Pull and run Exoframe server using docker:
17-
18-
```sh
19-
docker run -d \
20-
-v /var/run/docker.sock:/var/run/docker.sock \
21-
-v /path/to/exoframe-folder:/root/.exoframe \
22-
-v /home/user/.ssh/authorized_keys:/root/.ssh/authorized_keys:ro \
23-
-e EXO_PRIVATE_KEY=your_private_key \
24-
--label traefik.backend=exoframe-server \
25-
--label traefik.frontend.rule=Host:exoframe.your-host.com \
26-
--restart always \
27-
--name exoframe-server \
28-
exoframe/server
29-
30-
# Explanation for arguments:
31-
# this allows Exoframe to access your docker
32-
-v /var/run/docker.sock:/var/run/docker.sock
33-
34-
# /path/to/exoframe-folder should be path on your server
35-
# to desired folder that'll hold Exoframe configs
36-
-v /path/to/exoframe-folder:/root/.exoframe
37-
38-
# /home/user/.ssh/authorized_keys should point to your authorized_keys file
39-
# for SSH that holds allowed public keys
40-
-v /home/user/.ssh/authorized_keys:/root/.ssh/authorized_keys:ro
41-
42-
# this is your private key used for JWT encryption
43-
-e EXO_PRIVATE_KEY=your_jwt_encryption_key
44-
45-
# this is used to tell traefik to which deployment current docker service belongs
46-
--label traefik.backend=exoframe-server
47-
48-
# this is used to tell traefik on which domain should Exoframe server be listening
49-
--label traefik.frontend.rule=Host:exoframe.your-host.com
50-
```
51-
52-
3. Edit config file to fit your needs (see section below)
53-
54-
Then install [Exoframe CLI](https://github.com/exoframejs/exoframe), point it to your new Exoframe server and use it.
55-
56-
## Installation and usage in Swarm mode
57-
58-
Exoframe also supports running in [Swarm mode](https://docs.docker.com/engine/swarm/).
59-
To run Exoframe server in swarm, you need to do the following:
60-
61-
1. Make sure you have Docker on your host.
62-
2. Make sure your Docker has [Swarm mode enabled](https://docs.docker.com/engine/swarm/swarm-tutorial/create-swarm/).
63-
3. Pull and run Exoframe server using Docker on your manager node:
64-
65-
```
66-
docker service create \
67-
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
68-
--mount type=bind,source=/path/to/exoframe-folder,target=/root/.exoframe \
69-
--mount type=bind,source=/home/user/.ssh/authorized_keys,target=/root/.ssh/authorized_keys,readonly \
70-
-e EXO_PRIVATE_KEY=your_private_key \
71-
--label traefik.backend=exoframe-server \
72-
--label traefik.frontend.rule=Host:exoframe.your-host.com \
73-
--label traefik.port=8080 \
74-
--constraint=node.role==manager \
75-
--name exoframe-server \
76-
exoframe/server
77-
```
78-
79-
Note that both Exoframe server and Traefik will be run on your manager node.
80-
81-
## Configuration
82-
83-
Exoframe stores its config in `~/.exoframe/server.config.yml`.
84-
Currently it contains the following settings:
85-
86-
```yaml
87-
# whether debug mode is enabled, default "false"
88-
debug: false
89-
90-
# whether to enable letsencrypt, default "false"
91-
letsencrypt: false
92-
93-
# email used for letsencrypt
94-
letsencryptEmail: [email protected]
95-
96-
# whether to apply gzip compression, default "true"
97-
compress: true
98-
99-
# base top-level domain to use for deployments without domains specified, default "false"
100-
# used as postfix, e.g. if you specify ".example.com" (dot is auto-prepended if not present)
101-
# all your deployments will be autodeployed as "deployment-id.example.com"
102-
baseDomain: false
103-
104-
# CORS support; can be "true" ("*" header) or object with "origin" property, default "false"
105-
cors: false
106-
107-
# Traefik image to be used; set to "false" to disable traefik management, default "traefik:latest"
108-
traefikImage: 'traefik:latest'
109-
110-
# Traefik container name, default "exoframe-traefik"
111-
traefikName: 'exoframe-traefik'
112-
113-
# Additional Traefik start args, default []
114-
traefikArgs: []
115-
116-
# Network used by traefik to connect services to, default "exoframe"
117-
exoframeNetwork: 'exoframe'
118-
119-
# server image update channel; can be "stable" or "nightly", default "stable"
120-
updateChannel: 'stable'
121-
122-
# path to folder with authorized_keys, default "~/.ssh"
123-
publicKeysPath: '/path/to/your/public/keys'
124-
125-
# whether Exoframe server whould be running in swarm mode, default "false"
126-
swarm: false
127-
```
128-
129-
_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.
130-
131-
## Docs
132-
133-
[Read more about Exoframe and how it works in the main repo](https://github.com/exoframejs/exoframe).
15+
For more details on how to get it up and running please follow the following link [how to setup exoframe-server](https://github.com/exoframejs/exoframe/tree/master/docs).
13416

13517
## License
13618

bin/exoframe-server.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const {start} = require('./server-core');
2+
3+
start();

package.json

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,51 @@
11
{
22
"name": "exoframe-server",
3-
"version": "3.1.0",
3+
"version": "3.9.0-dev",
44
"description": "Exoframe is a self-hosted tool that allows simple one-command deployments using Docker",
5-
"main": "index.js",
6-
"bin": "index.js",
5+
"main": "bin/server-core.js",
6+
"bin": "bin/exoframe-server.js",
77
"scripts": {
88
"start": "node index.js",
99
"test": "NODE_ENV=testing jest --coverage --silent --maxWorkers=2 --ci",
1010
"coveralls": "cat ./coverage/lcov.info | coveralls",
11-
"build": "pkg -t node8.11.3-alpine -o exoframe-server ."
11+
"build-bundle": "ncc build src/index.js -o dist",
12+
"build": "pkg -t node10.4.1-alpine -o exoframe-server ."
1213
},
1314
"pkg": {
1415
"assets": "src/templates/*.html"
1516
},
17+
"files": [
18+
"bin/exoframe-server.js",
19+
"bin/server-core.js"
20+
],
1621
"repository": "[email protected]:exoframejs/exoframe-server.git",
1722
"author": "Tim Ermilov <[email protected]>",
1823
"license": "MIT",
19-
"dependencies": {
20-
"chokidar": "^2.0.4",
24+
"devDependencies": {
25+
"@zeit/ncc": "^0.15.0",
2126
"cors": "^2.8.4",
27+
"coveralls": "^3.0.2",
2228
"dockerode": "^2.5.6",
23-
"fastify": "^1.11.2",
29+
"fastify": "^1.14.0",
2430
"fastify-auth": "^0.3.0",
31+
"get-port": "^4.0.0",
2532
"highland": "^2.13.0",
33+
"jest": "^24.0.0",
2634
"js-yaml": "^3.12.0",
2735
"jsonwebtoken": "^8.3.0",
2836
"lodash": "^4.17.11",
2937
"lokijs": "^1.5.5",
3038
"mkdirp": "^0.5.1",
39+
"nock": "^10.0.4",
3140
"node-fetch": "^2.2.0",
41+
"pkg": "^4.3.4",
3242
"rimraf": "^2.6.2",
3343
"semver-compare": "^1.0.0",
3444
"signale": "^1.3.0",
3545
"sshpk": "^1.14.2",
36-
"tar-fs": "^1.16.3",
46+
"tar-fs": "^2.0.0",
3747
"uuid": "^3.3.2"
3848
},
39-
"devDependencies": {
40-
"coveralls": "^3.0.2",
41-
"get-port": "^4.0.0",
42-
"jest": "^23.6.0",
43-
"pkg": "^4.3.4"
44-
},
4549
"jest": {
4650
"testEnvironment": "node"
4751
}

0 commit comments

Comments
 (0)