-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
More string fixes #367757
More string fixes #367757
Conversation
2b1698f
to
fe92d10
Compare
66ac215
to
08f3db0
Compare
08f3db0
to
08c9d92
Compare
@@ -105,27 +105,27 @@ in | |||
virtualHosts.${cfg.hostname} = { | |||
locations = { | |||
# /etc/nginx/includes/ds-docservice.conf | |||
"~ ^(\/[\d]+\.[\d]+\.[\d]+[\.|-][\d]+)?\/(web-apps\/apps\/api\/documents\/api\.js)$".extraConfig = | |||
"~ ^(\\/[\\d]+\\.[\\d]+\\.[\\d]+[\\.|-][\\d]+)?\\/(web-apps\\/apps\\/api\\/documents\\/api\\.js)$".extraConfig = |
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.
nix-repl> "~ ^(\/[\d]+\.[\d]+\.[\d]+[\.|-][\d]+)?\/(web-apps\/apps\/api\/documents\/api\.js)$"
"~ ^(/[d]+.[d]+.[d]+[.|-][d]+)?/(web-apps/apps/api/documents/api.js)$"
nix-repl> "~ ^(\\/[\\d]+\\.[\\d]+\\.[\\d]+[\\.|-][\\d]+)?\\/(web-apps\\/apps\\/api\\/documents\\/api\\.js)$"
"~ ^(\\/[\\d]+\\.[\\d]+\\.[\\d]+[\\.|-][\\d]+)?\\/(web-apps\\/apps\\/api\\/documents\\/api\\.js)$"
These strike me as broken due to the use of /
when i think |
was intended
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.
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.
Apparently that's how it is in the source, see $(nix-build '<nixpkgs>' -A onlyoffice-documentserver)/etc/nginx/includes/ds-docservice.conf
:
#disable caching for api.js
location ~ ^(\/[\d]+\.[\d]+\.[\d]+[\.|-][\d]+)?\/(web-apps\/apps\/api\/documents\/api\.js)$ {
expires -1;
# gzip_static on;
alias /var/www/onlyoffice/documentserver/$2;
}
@infinisil, i remember you onboarding someone new to help with |
08c9d92
to
04e7ab7
Compare
@@ -93,7 +93,7 @@ let | |||
# The idea is to match everything that looks like `$term =` | |||
# but not `# $term something something` | |||
# or `# $term = some value` because those are comments. | |||
configContainsSetting = lines: term: (match "^[^#]*\b${term}\b.*=" lines) != null; | |||
configContainsSetting = lines: term: (match "^[^#]*${term}[[:blank:]]*=.*" lines) != null; |
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.
@2xsaiko Nix does not know about
\b
(or any other escape sequence), what's the intent of the regex here?
I didn't write that, but I think this now almost does what is intended. It matches "xfoo =" for term="foo" though. I would write
configContainsSetting = lines: term: (match "^[^#]*${term}[[:blank:]]*=.*" lines) != null; | |
configContainsSetting = lines: term: (match "[[:blank:]]*${term}[[:blank:]]*=.*" lines) != null; |
@RaitoBezarius what do you think? Looks like you wrote this originally.
Good to know it doesn't support these escapes.
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.
So my version more closely matches the original regex which has the same over-matching, but I'm unsure if it is intended like that or not. I read up on the dovecot configuration docs, still unclear.
04e7ab7
to
6d43f83
Compare
6d43f83
to
dd7d533
Compare
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.
Should ideally hook up CI to check for future regressions, but this seems fine. The manual failure is unrelated, I tested that it works after a merge with recent master.
Oh well. So turns out due to a silly mistake, my script previously only ran onto the
pkgs
subfolder. So here's the remaining fixes for the rest of Nixpkgs. Follow-up to #350296, #350774 and #365186.Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.