Frontier is an application manager for development servers. (Something like pow)
It's not production ready. Use on own risk
Contribution is welcome.
Pow, which I like very much, is out of date, doesn't support HTTPS and is only for rack-based applications. I've used Invoker for some time but was not happy with it. And looks like it's abandoned too.
Clone repo:
$ git clone https://github.com/shir/frontier.git && cd frontier
Install required packages:
$ yarn install
Build project:
$ npm yarn build && npm yarn templates
Install resolver and firewall rules
$ sudo bin/frontier install
If you want to use HTTPS and don't have warning in browsers about invalid certificate you have to generate and install self signed certificate.
To generate certificate run command:
$ bin/frontier gencert
This command will generate certificate files in ~/.frontier
folder.
Run:
$ open ~/.frontier/frontier.crt
to open generated certificate in Keychain application. Certificate with name "Frontier" will appear in "Certificates" category. Double click on it and in appeared window expand "Trust" and change "Secure Socket Layer (SSL)" option to "Always Trust". Now close certificate window. You will be asked for your password to make changes. After you confirm changes certificate will be valid in all browsers.
Link your development application in ~/.frontier/
folder. For example:
$ cd ~/.frontier
$ ln -s ~/projects/my-favorite-project
Create .frontier.json
file in project folder
{
"command": "rvm",
"args": ["in", "$DIR", "do", "bundle", "exec", "rails", "server", "-p", "$PORT", "-b", "$HOST"],
"watchFile": "tmp/restart.txt"
}
{
"command": "npm",
"args": ["run", "start"],
"watchFile": "tmp/restart.txt"
}
{
"command": "~/.nvm/nvm-exec",
"args": ["npm", "run", "start"],
"watchFile": "tmp/restart.txt"
}
command
- command to run. If not set then you have to start application manually. Frontier will work just as usual proxy. In this case you have to passport
option.args
- arguments passed to thecommand
.$HOST
will be replaced with thehostname
.$PORT
will be replaced with theport
.$DIR
will be replaced with thedirectory
.
hostname
- (optional) a hostname by which you want to access the application. by default is the symlink name.port
- (optional) a port on which the application will listen. By default auto assigned from the interval 5000-6000.directory
- (optional) a directory in which thecommand
will be run. By default is the directory to which the symlink is created.- env - (optional) hash of additional environment variables. All current
environment variables will be also available. Also
$HOST
,$PORT
and$DIR
will be set. watchFile
- (optional) touch this file and the application will be restarted on a next request. Relative to thedirectory
.logFile
- allstdout
andstderr
output will be redirect to this file. Relative to thedirectory
.- idleTimeout - (optional) number of seconds after which the application will be
stopped after last request. By default -
10
. If you want not to stop server set it to0
.
Start server:
$ bin/frontier start
The application will be available by address http://my-favorite-project.dev.test