Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EscapedId #29

Closed
MikeMichel opened this issue Sep 25, 2014 · 6 comments
Closed

EscapedId #29

MikeMichel opened this issue Sep 25, 2014 · 6 comments

Comments

@MikeMichel
Copy link
Contributor

Hi,

any specific reason for the colons in

EscapedId: strings.Replace(appId, "/", "::", -1),
?

The colons mess up my host acl

acl ::socketchat-host hdr(host) -i ::socketchat.example.io

Best,

Mike

@j1n6
Copy link
Contributor

j1n6 commented Sep 25, 2014

Did you use the default template?

EscapedId is only used for HAProxy frontend and backend naming. It shouldn't appeare in the ACL section. In your example, acl ::socketchat-host part is correct. hdr(host) -i ::socketchat.example.io should really be hdr(host) -i socketchat.example.io.

@MikeMichel
Copy link
Contributor Author

I changed the template to my needs

acl {{ $app.EscapedId }}-host hdr(host) -i {{ $app.EscapedId }}.example.io
use_backend {{ $app.EscapedId }}-cluster if {{ $app.EscapedId }}-host

@j1n6
Copy link
Contributor

j1n6 commented Sep 25, 2014

This is the line in template: https://github.com/QubitProducts/bamboo/blob/master/config/haproxy_template.cfg#L52

You probably want to write something like this:

acl {{ $app.EscapedId }}-host hdr(host) -i {{ $appId }}.example.io
use_backend {{ $app.EscapedId }}-cluster if {{ $app.EscapedId }}-host

The complication is '$appId' in new Marathon app ID definition containing slash e.g. '/my-app'. What you want is really just 'my-app'.

This feature #27 might allow you to auto generate domains based on app id.

@j1n6
Copy link
Contributor

j1n6 commented Sep 25, 2014

And the documentation for how to use template should be improved.

@MikeMichel
Copy link
Contributor Author

Yep, i was allready looking for the var which holds the app without any special chars but it's not there yet.

@j1n6
Copy link
Contributor

j1n6 commented Sep 25, 2014

This is probably related to feature request #28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants