2016-09-23 06:28:20 +00:00
package main // import "github.com/portainer/portainer"
2016-08-03 03:11:09 +00:00
import (
"gopkg.in/alecthomas/kingpin.v2"
)
// main is the entry point of the program
func main ( ) {
2016-09-24 10:33:23 +00:00
kingpin . Version ( "1.9.0" )
2016-08-03 03:11:09 +00:00
var (
2016-08-17 05:25:42 +00:00
endpoint = kingpin . Flag ( "host" , "Dockerd endpoint" ) . Default ( "unix:///var/run/docker.sock" ) . Short ( 'H' ) . String ( )
2016-09-04 02:50:37 +00:00
addr = kingpin . Flag ( "bind" , "Address and port to serve Portainer" ) . Default ( ":9000" ) . Short ( 'p' ) . String ( )
2016-08-17 05:25:42 +00:00
assets = kingpin . Flag ( "assets" , "Path to the assets" ) . Default ( "." ) . Short ( 'a' ) . String ( )
data = kingpin . Flag ( "data" , "Path to the data" ) . Default ( "." ) . Short ( 'd' ) . String ( )
tlsverify = kingpin . Flag ( "tlsverify" , "TLS support" ) . Default ( "false" ) . Bool ( )
tlscacert = kingpin . Flag ( "tlscacert" , "Path to the CA" ) . Default ( "/certs/ca.pem" ) . String ( )
tlscert = kingpin . Flag ( "tlscert" , "Path to the TLS certificate file" ) . Default ( "/certs/cert.pem" ) . String ( )
tlskey = kingpin . Flag ( "tlskey" , "Path to the TLS key" ) . Default ( "/certs/key.pem" ) . String ( )
swarm = kingpin . Flag ( "swarm" , "Swarm cluster support" ) . Default ( "false" ) . Short ( 's' ) . Bool ( )
labels = pairs ( kingpin . Flag ( "hide-label" , "Hide containers with a specific label in the UI" ) . Short ( 'l' ) )
2016-08-10 06:37:25 +00:00
logo = kingpin . Flag ( "logo" , "URL for the logo displayed in the UI" ) . String ( )
2016-09-23 06:28:20 +00:00
templates = kingpin . Flag ( "templates" , "URL to the templates (apps) definitions" ) . Default ( "https://raw.githubusercontent.com/portainer/templates/master/templates.json" ) . Short ( 't' ) . String ( )
2016-08-03 03:11:09 +00:00
)
kingpin . Parse ( )
apiConfig := apiConfig {
Endpoint : * endpoint ,
BindAddress : * addr ,
AssetPath : * assets ,
DataPath : * data ,
SwarmSupport : * swarm ,
TLSEnabled : * tlsverify ,
TLSCACertPath : * tlscacert ,
TLSCertPath : * tlscert ,
TLSKeyPath : * tlskey ,
2016-08-23 06:09:14 +00:00
TemplatesURL : * templates ,
2016-08-03 03:11:09 +00:00
}
2016-08-03 09:12:46 +00:00
settings := & Settings {
2016-08-03 03:11:09 +00:00
Swarm : * swarm ,
HiddenLabels : * labels ,
2016-08-10 06:37:25 +00:00
Logo : * logo ,
2016-08-03 03:11:09 +00:00
}
api := newAPI ( apiConfig )
2016-08-03 09:12:46 +00:00
api . run ( settings )
2016-08-03 03:11:09 +00:00
}