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
Conf template #673
Conf template #673
Conversation
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 like it 👍
Please use ${id} syntax and use ipaplatform.NAME to detect Debian.
ipaserver/install/bindinstance.py
Outdated
| @@ -775,6 +775,8 @@ def __setup_sub_dict(self): | |||
| NAMED_PID=paths.NAMED_PID, | |||
| NAMED_VAR_DIR=paths.NAMED_VAR_DIR, | |||
| BIND_LDAP_SO=paths.BIND_LDAP_SO, | |||
| DATA_DIR='' if ipautil.file_exists(paths.ETC_DEBIAN_VERSION) else 'data/', | |||
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.
You can use ipaplatform.NAME instead. It would also fix the pylint isues
import ipaplatform
...
DATA_DIR='' if ipaplatform.NAME == 'debian' else 'data/'
install/share/ipa.conf.template
Outdated
| Alias /ipa/ui/fonts/open-sans "/usr/share/fonts/open-sans" | ||
| Alias /ipa/ui/fonts/fontawesome "/usr/share/fonts/fontawesome" | ||
| <Directory "/usr/share/fonts"> | ||
| Alias /ipa/ui/fonts/open-sans "$FONTS_DIR/open-sans" |
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.
${FONTS_DIR}
| type hint; | ||
| file "named.ca"; | ||
| }; | ||
| $DISABLE_DEBIANzone "." IN { |
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.
${DISABLE_DEBIAN}
| dump-file "data/cache_dump.db"; | ||
| statistics-file "data/named_stats.txt"; | ||
| memstatistics-file "data/named_mem_stats.txt"; | ||
| dump-file "$DATA_DIRcache_dump.db"; |
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 really hard to read and probably does not work as intended. https://docs.python.org/3/library/string.html#template-strings supports ${id} syntax, so ${DATA_DIR}cache_dump.db
install/share/ipa.conf.template
Outdated
| @@ -146,7 +146,7 @@ Alias /ipa/session/cookie "/usr/share/ipa/gssapi.login" | |||
| # Custodia stuff is redirected to the custodia daemon | |||
| # after authentication | |||
| <Location "/ipa/keys/"> | |||
| ProxyPass "unix:/run/httpd/ipa-custodia.sock|http://localhost/keys/" | |||
| ProxyPass "unix:$IPA_CUSTODIA_SOCKET|http://localhost/keys/" | |||
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.
${IPA_CUSTODIA_SOCKET}
8ce3ac3
to
b484cc5
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.
Thanks! LGTM
| @@ -47,7 +47,7 @@ FileETag None | |||
|
|
|||
| # FIXME: WSGISocketPrefix is a server-scope directive. The mod_wsgi package | |||
| # should really be fixed by adding this its /etc/httpd/conf.d/wsgi.conf: | |||
| WSGISocketPrefix /run/httpd/wsgi | |||
| WSGISocketPrefix $WSGI_PREFIX_DIR | |||
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.
shouldn't be this ${WSGI_PREFIX_DIR} (on multiple places in this file)
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.
Maybe, but I also left the original variables be like they were.
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.
$WSGI_PREFIX_DIR is fine. The syntax ${WSGI_PREFIX_DIR} is only required when the variable is surrounded by alphanumeric chars.
ipaserver/install/bindinstance.py
Outdated
| @@ -775,6 +776,8 @@ def __setup_sub_dict(self): | |||
| NAMED_PID=paths.NAMED_PID, | |||
| NAMED_VAR_DIR=paths.NAMED_VAR_DIR, | |||
| BIND_LDAP_SO=paths.BIND_LDAP_SO, | |||
| DATA_DIR='' if ipaplatform.NAME == 'debian' else 'data/', | |||
| DISABLE_DEBIAN='//' if ipaplatform.NAME == 'debian' else '', | |||
| ) | |||
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 don't like platform dependent code outside of ipaplatform module, I prefer to move this logic into tasks, or even better to have template files per platform if needed.
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'm fine with having a separate conffile for bind, just need to first create one that fits Debian better
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 like Martin's suggestion to move the variables to tasks.
I'd rename DISABLE_DEBIAN to DISABLE_ROOTS or something more generic. Maintaining two files could be prone to error especially since the diffs at the moment seem to be relatively small.
|
We are lowering the number of opened PRs. @tjaalton could you rebase the PR? So that it applies and CI is run. |
f52b17d
to
e210048
Compare
|
I've dropped the named.conf changes for Debian, that needs more work but the others can be merged now |
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.
Please address PEP 8 violations and rebase your branch. You can use make fastcheck to perform pylint and pep8 checks locally.
PEP-8 errors:
./ipaserver/install/dogtaginstance.py:235:80: E501 line too long (81 > 79 characters)
./ipaserver/install/httpinstance.py:224:80: E501 line too long (86 > 79 characters)
./ipaserver/install/server/upgrade.py:1693:80: E501 line too long (80 > 79 characters)
./ipaserver/install/server/upgrade.py:1695:80: E501 line too long (88 > 79 characters)
./ipaserver/install/server/upgrade.py:1700:80: E501 line too long (85 > 79 characters)
e210048
to
d9687c9
Compare
|
pycodestyle complains about a couple of PEP 8 violations. IPA only runs pycodestyle on git diff. If you change a line, then you have to fix PEP 8 violations in the surrounding lines, too. |
d9687c9
to
e8af75d
Compare
|
LGTM, need to test it at least on Fedora. |
|
Everything seems to be working, will wait for @rcritten to do the final ACK. |
|
May this be ACKed. Thank you, @tjaalton :) |
Move conf templates to a common location, make ipa.conf and named.conf portable.