Skip to content

Commit

Permalink
Merge pull request #27 from nihn/introduce-realm-concept
Browse files Browse the repository at this point in the history
Add Realm concept to Nixy.
  • Loading branch information
martensson authored Jul 11, 2017
2 parents c236c83 + f39ee28 commit 868c6f6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions marathon.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ func syncApps(jsonapps *MarathonApps) bool {
apps := make(map[string]App)
for _, app := range jsonapps.Apps {
var newapp = App{}
if config.Realm != "" && app.Labels["NIXY_REALM"] != config.Realm {
continue
}
for _, task := range app.Tasks {
// lets skip tasks that does not expose any ports.
if len(task.Ports) == 0 {
Expand Down
1 change: 1 addition & 0 deletions nixy.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ type App struct {
type Config struct {
sync.RWMutex
Xproxy string
Realm string
Port string `json:"-"`
Marathon []string `json:"-"`
User string `json:"-"`
Expand Down
3 changes: 3 additions & 0 deletions nixy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ xproxy = ""
marathon = ["http://example01:8080", "http://example02:8080"] # add all HA cluster nodes in priority order.
user = "" # leave empty if no auth is required.
pass = ""
# Nixy realm, set this if you want to be able to filter your apps (e.g. when you have different loadbalancers which should expose different apps)
# You will also need to set "NIXY_REALM" label at your app to be included in generated conf
realm = ""
# Nginx
nginx_config = "/etc/nginx/nginx.conf"
nginx_template = "/etc/nginx/nginx.tmpl"
Expand Down

0 comments on commit 868c6f6

Please sign in to comment.