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

Conf template #673

Closed
wants to merge 2 commits into from
Closed

Conf template #673

wants to merge 2 commits into from

Conversation

tjaalton
Copy link
Contributor

@tjaalton tjaalton commented Mar 29, 2017

Move conf templates to a common location, make ipa.conf and named.conf portable.

Copy link
Member

@tiran tiran left a 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.

@@ -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/',
Copy link
Member

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/'

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"
Copy link
Member

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 {
Copy link
Member

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";
Copy link
Member

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

@@ -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/"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

${IPA_CUSTODIA_SOCKET}

@tjaalton tjaalton force-pushed the conf-template branch 2 times, most recently from 8ce3ac3 to b484cc5 Compare March 30, 2017 07:38
@tjaalton
Copy link
Contributor Author

Copy link
Member

@tiran tiran left a 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
Copy link
Contributor

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)

Copy link
Contributor Author

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.

Copy link
Member

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.

@@ -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 '',
)
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

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.

@MartinBasti MartinBasti self-assigned this Mar 30, 2017
@MartinBasti MartinBasti removed their assignment May 30, 2017
@pvoborni
Copy link
Member

pvoborni commented Oct 4, 2017

We are lowering the number of opened PRs. @tjaalton could you rebase the PR? So that it applies and CI is run.

@tjaalton tjaalton force-pushed the conf-template branch 2 times, most recently from f52b17d to e210048 Compare December 20, 2017 09:42
@tjaalton
Copy link
Contributor Author

I've dropped the named.conf changes for Debian, that needs more work but the others can be merged now

@felipevolpone felipevolpone added the re-run Trigger a new run of PR-CI label Dec 20, 2017
@freeipa-pr-ci freeipa-pr-ci removed the re-run Trigger a new run of PR-CI label Dec 20, 2017
Copy link
Member

@tiran tiran left a 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)

@tiran
Copy link
Member

tiran commented Feb 8, 2018

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.

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)

@tiran
Copy link
Member

tiran commented Feb 8, 2018

@stlaz @rcritten could you please review the patch, too? It looks fine to me.

@stlaz
Copy link
Contributor

stlaz commented Feb 8, 2018

LGTM, need to test it at least on Fedora.

@stlaz
Copy link
Contributor

stlaz commented Feb 8, 2018

Everything seems to be working, will wait for @rcritten to do the final ACK.

@tiran tiran added the re-run Trigger a new run of PR-CI label Feb 8, 2018
@freeipa-pr-ci freeipa-pr-ci removed the re-run Trigger a new run of PR-CI label Feb 8, 2018
@tiran tiran added the re-run Trigger a new run of PR-CI label Feb 8, 2018
@freeipa-pr-ci freeipa-pr-ci removed the re-run Trigger a new run of PR-CI label Feb 8, 2018
@stlaz
Copy link
Contributor

stlaz commented Feb 9, 2018

May this be ACKed. Thank you, @tjaalton :)

@stlaz stlaz added the ack Pull Request approved, can be merged label Feb 9, 2018
@tiran
Copy link
Member

tiran commented Feb 9, 2018

master:

  • 1adb3ed Move config templates from install/conf to install/share
  • e6c707b ipaplatform, ipa.conf: Use paths variables in ipa.conf.template

@tiran tiran added the pushed Pull Request has already been pushed label Feb 9, 2018
@tiran tiran closed this Feb 9, 2018
@tjaalton tjaalton mentioned this pull request May 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ack Pull Request approved, can be merged pushed Pull Request has already been pushed
Projects
None yet
8 participants