-
Notifications
You must be signed in to change notification settings - Fork 137
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
[IMP] runbot: allow custom run path per user #1028
base: 18.0
Are you sure you want to change the base?
Conversation
Duplicate model inheritance for res.users
I had to change the nginx config to allow for the catch-all to keep the path. I tested this change locally on my nginx proxy:
Same expected output without path prod -> need to change custom nginx_config |
runbot/templates/nginx.xml
Outdated
@@ -79,11 +79,11 @@ server { | |||
<t id="server_build_anchor"/> | |||
server { | |||
listen 8080; | |||
server_name ~^<t t-out="re_escape(build.dest)"/>(-[a-z0-9_-]+)?-<t t-out="build._get_run_token()[0]"/>(-[a-z0-9_]+)\.<t t-out="re_escape(build.host)"/>$; | |||
server_name ~^<t t-out="re_escape(build.dest)"/>(?<db>-[a-z0-9_-]+)?-<t t-out="build._get_run_token()[0]"/>(?<fingerprint>-[a-z0-9_]+)\.<t t-out="re_escape(build.host)"/>$; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit unreadable but <name>
is the same as <name>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we coudn't make it easier to read with something like
server_name ~^<t t-out="re_escape(build.dest)"/>(?<db>-[a-z0-9_-]+)?-<t t-out="build._get_run_token()[0]"/>(?<fingerprint>-[a-z0-9_]+)\.<t t-out="re_escape(build.host)"/>$; | |
<t t-set="dest" t-value="re_escape(build.dest)"/> | |
<t t-set="host" t-value="re_escape(build.host)"/> | |
<t t-set="token" t-value="build._get_run_token()[0] "/> | |
<t t-set="db" t-value="(?<db>-[a-z0-9_-]+)?"/> | |
server_name ~^<t t-out="f'{dest}{db}-{token}-[a-z0-9_]+\.{host}"/>$; |
(not sure it is better, not tested)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using an f-string didn't work (context couldn't find variables?).
So I stored and output component individually. I think it's slightly more readable.
I'm worried that the change to the nginx config may break existing config and custom redirect behaviour, to check in details. Anyway I need to go more in depth to check if it is needed but in any case, we are trying to avoid config on users:
We already have some configuration based on cookies, wouldn't it be better to add that there? I don't say that this solution is not correct but we may think about that. |
I understand, for the nginx config, our customization on prod will be broken (the cookie will be invalid, but the redirection will work) if the configuration gets generated before we fix the template. For the user settings, I don't know how practical cookie settings are, if one pays close attention to cookies and clears them often it could cause some confusion as well, what about using res.users.settings ? We can also make a hybrid such that preferences are saved on the user but cookies can also be used to dictate the path to use. |
Looks like a good compromise, if the value is not set in the cookie use the user values as a fallback +1. We could do the same thing for "more info". Using res.user.settings is also a good idea I think, it is the goal of this model IMHO. |
1be3026
to
633c157
Compare
Sounds good :) I didn't do the "more info" stuff now, let's see if we like this system and revisit later if it works out 👍 |
Adds a new setting on users to define a custom path to use when accessing a running build. Can be used to directly access a specific page instead of landing on the home page from a runbot run.
633c157
to
9fc4f2e
Compare
Adds a new setting on users to define a custom path to use when
accessing a running build.
Can be used to directly access a specific page instead of landing on the
home page from a runbot run.