From 0cab6271540dfcfeb2aca27a33556b481c30a5f6 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Fri, 24 Jun 2022 19:00:16 +0200 Subject: [PATCH] update --- .../2022.03.08/apache/dictionaries/20_web.xml | 1 + .../2022.03.08/apache/templates/server.crt | 2 +- .../2022.03.08/apache/templates/server.key | 2 +- .../dictionaries/00-debian-bullseye.xml | 8 +- .../dictionaries/00-debian-base.xml | 26 --- .../dictionaries/11-debian-base.xml | 15 ++ .../dictionaries/17-debian-base.xml | 17 ++ .../dictionaries/00-fedora-35.xml | 10 -- .../dictionaries/11-fedora-35.xml | 8 + .../dictionaries/00-fedora-version.xml | 10 -- .../dictionaries/11-fedora-version.xml | 8 + .../dictionaries/00-fedora-base.xml | 25 --- .../dictionaries/11-fedora-base.xml | 13 ++ .../dictionaries/17-fedora-base.xml | 17 ++ .../dictionaries/{00-base.xml => 12-base.xml} | 41 ++--- .../2022.03.08/base/funcs/funcs.py | 30 +++- .../2022.03.08/base/manual/install/diff.py | 19 ++- .../dovecot/dictionaries/22_dovecot.xml | 34 ++-- .../dovecot/templates/ca_IMAPServer.crt | 2 +- .../dovecot/templates/ca_MailServer.crt | 2 +- .../dovecot/templates/dovecot-ldap.conf.ext | 6 +- .../2022.03.08/dovecot/templates/dovecot.crt | 7 +- .../2022.03.08/dovecot/templates/dovecot.key | 2 +- .../dovecot/templates/external_imap.crt | 2 +- .../dovecot/templates/external_imap.key | 2 +- .../dovecot/templates/ldapsource.cf | 6 +- .../2022.03.08/dovecot/templates/postfix.crt | 7 +- .../2022.03.08/dovecot/templates/postfix.key | 2 +- .../2022.03.08/dovecot/templates/postfix.pem | 4 +- .../dovecot/templates/postfix_sni.pem | 4 +- .../gitea/dictionaries/31_gitea.xml | 15 +- .../imap-client/templates/ca_IMAPServer.crt | 2 +- .../dictionaries/20_ldap-client-debian.xml | 11 -- .../dictionaries/22_ldap-client-debian.xml | 13 ++ .../dictionaries/20_ldap-client-fedora.xml | 11 -- .../dictionaries/22_ldap-client-fedora.xml | 13 ++ .../dictionaries/21_ldap-client.xml | 97 ++++++----- .../ldap-client/funcs/openldap_client.py | 27 ++- .../ldap-client/templates/ca_LDAP.crt | 2 +- .../ldap-client/templates/ldap.conf | 4 +- .../ldap-client/templates/ldap_client.crt | 2 +- .../ldap-client/templates/ldap_client.key | 2 +- .../dictionaries/70_lemonldap_ng.xml | 16 +- .../2022.03.08/lemonldap/doc.md | 3 +- .../lemonldap/extras/oauth2/00_oauth2.xml | 8 +- .../lemonldap-ng-fastcgi-server.service | 1 + .../lemonldap/templates/lmConf-1.json | 36 ++-- .../dictionaries/20-letsencrypt.xml | 1 + .../letsencrypt/funcs/letsencrypt.py | 3 + .../mailman/dictionaries/31_mailman.xml | 7 +- .../templates/postgresql_postorius.key | 2 +- .../templates/mariadbclient.service | 2 +- .../mariadb/dictionaries/20_mariadb.xml | 1 + .../nextcloud/dictionaries/31_nextcloud.xml | 6 +- .../nextcloud/templates/nextcloud.init | 4 +- .../nginx-common/templates/nginx-options.conf | 2 +- .../nginx-https/templates/nginx.crt | 4 +- .../nginx-https/templates/nginx.key | 2 +- .../dictionaries/25_nginx.xml | 10 +- .../templates/ca_InternalReverseProxy.crt | 4 +- .../templates/certificate.crt | 2 +- .../nginx-reverse-proxy/templates/private.key | 2 +- .../2022.03.08/nsd/dictionaries/20_nsd.xml | 2 +- .../2022.03.08/nsd/templates/risotto.conf | 2 +- .../dictionaries/30_oauth2_client.xml | 15 +- .../dictionaries/21_openldap-server.xml | 158 +++++++----------- .../openldap/extras/accounts/00_account.xml | 44 +++-- .../openldap/templates/admin_ldap.pwd | 2 +- .../2022.03.08/openldap/templates/config.ldif | 20 ++- .../openldap/templates/config_acl.ldif | 22 +-- .../openldap/templates/openldap.crt | 4 +- .../openldap/templates/openldap.key | 2 +- .../openldap/templates/slapd.service | 6 +- .../templates/tmpfile-openldap-server.conf | 1 + .../2022.03.08/openldap/templates/users.ldif | 41 +++-- .../openldap/templates/users_mod.ldif | 4 +- .../peertube/dictionaries/30_peertube.xml | 4 +- .../piwigo/dictionaries/31_piwigo.xml | 3 +- .../pleroma/dictionaries/30_pleroma.xml | 4 +- .../postfix-relay/dictionaries/30_postfix.xml | 11 +- .../postfix-relay/templates/ca_MailServer.crt | 2 +- .../postfix-relay/templates/postfix.crt | 2 +- .../postfix-relay/templates/postfix.key | 2 +- .../2022.03.08/postfix-relay/templates/sni | 2 +- .../postfix-relay/templates/sni.pem | 6 +- .../templates/ca_PostgreSQL.crt | 2 +- .../templates/postgresql.crt | 2 +- .../templates/postgresql.key | 2 +- .../templates/postgresqlclient.service | 4 +- .../postgresql/templates/ca_PostgreSQL.crt | 2 +- .../postgresql/templates/postgresql.crt | 2 +- .../postgresql/templates/postgresql.key | 2 +- .../dictionaries/10-machined.xml | 7 + .../{21-machined.xml => 16-machined.xml} | 18 +- .../extras/machine/11_systemd.xml | 13 ++ .../redis-client/templates/ca_Redis.crt | 2 +- .../redis-client/templates/redis.crt | 2 +- .../redis-client/templates/redis.key | 2 +- .../redis-client/templates/redis.pem | 6 +- .../redis/extras/account/00_account.xml | 3 +- .../2022.03.08/redis/templates/ca_Redis.crt | 2 +- .../2022.03.08/redis/templates/redis.crt | 2 +- .../2022.03.08/redis/templates/redis.key | 2 +- .../templates/ca_MailRelay.crt | 2 +- .../templates/ca_InternalReverseProxy.crt | 2 +- .../templates/revprox.crt | 4 +- .../templates/revprox.key | 2 +- .../roundcube/dictionaries/31_roundcube.xml | 37 +++- .../2022.03.08/roundcube/funcs/roundcube.py | 10 ++ .../roundcube/templates/ca_MailServer.crt | 2 +- .../roundcube/templates/config.inc.php | 5 +- .../roundcube/templates/domain.inc.php | 11 +- .../server/extras/accounts/00_accounts.xml | 3 +- .../{00-systemd.xml => 15-systemd.xml} | 19 ++- .../unbound/dictionaries/20_unbound.xml | 2 +- .../2022.03.08/unbound/templates/risotto.conf | 4 +- .../dictionaries/40_vaultwarden.xml | 7 +- .../templates/vaultwarden_config.env | 1 + 118 files changed, 673 insertions(+), 519 deletions(-) delete mode 100644 seed/applicationservice/2022.03.08/base-debian/dictionaries/00-debian-base.xml create mode 100644 seed/applicationservice/2022.03.08/base-debian/dictionaries/11-debian-base.xml create mode 100644 seed/applicationservice/2022.03.08/base-debian/dictionaries/17-debian-base.xml delete mode 100644 seed/applicationservice/2022.03.08/base-fedora-35/dictionaries/00-fedora-35.xml create mode 100644 seed/applicationservice/2022.03.08/base-fedora-35/dictionaries/11-fedora-35.xml delete mode 100644 seed/applicationservice/2022.03.08/base-fedora-36/dictionaries/00-fedora-version.xml create mode 100644 seed/applicationservice/2022.03.08/base-fedora-36/dictionaries/11-fedora-version.xml delete mode 100644 seed/applicationservice/2022.03.08/base-fedora/dictionaries/00-fedora-base.xml create mode 100644 seed/applicationservice/2022.03.08/base-fedora/dictionaries/11-fedora-base.xml create mode 100644 seed/applicationservice/2022.03.08/base-fedora/dictionaries/17-fedora-base.xml rename seed/applicationservice/2022.03.08/base/dictionaries/{00-base.xml => 12-base.xml} (58%) delete mode 100644 seed/applicationservice/2022.03.08/ldap-client-debian/dictionaries/20_ldap-client-debian.xml create mode 100644 seed/applicationservice/2022.03.08/ldap-client-debian/dictionaries/22_ldap-client-debian.xml delete mode 100644 seed/applicationservice/2022.03.08/ldap-client-fedora/dictionaries/20_ldap-client-fedora.xml create mode 100644 seed/applicationservice/2022.03.08/ldap-client-fedora/dictionaries/22_ldap-client-fedora.xml create mode 100644 seed/applicationservice/2022.03.08/provider-systemd-machined/dictionaries/10-machined.xml rename seed/applicationservice/2022.03.08/provider-systemd-machined/dictionaries/{21-machined.xml => 16-machined.xml} (83%) create mode 100644 seed/applicationservice/2022.03.08/provider-systemd-machined/extras/machine/11_systemd.xml create mode 100644 seed/applicationservice/2022.03.08/roundcube/funcs/roundcube.py rename seed/applicationservice/2022.03.08/systemd/dictionaries/{00-systemd.xml => 15-systemd.xml} (78%) diff --git a/seed/applicationservice/2022.03.08/apache/dictionaries/20_web.xml b/seed/applicationservice/2022.03.08/apache/dictionaries/20_web.xml index 0b6dcf80..eaa7ee23 100644 --- a/seed/applicationservice/2022.03.08/apache/dictionaries/20_web.xml +++ b/seed/applicationservice/2022.03.08/apache/dictionaries/20_web.xml @@ -31,6 +31,7 @@ revprox_client_server_domainname InternalReverseProxy + hide_secret server_ca diff --git a/seed/applicationservice/2022.03.08/apache/templates/server.crt b/seed/applicationservice/2022.03.08/apache/templates/server.crt index 36e5562b..da844246 100644 --- a/seed/applicationservice/2022.03.08/apache/templates/server.crt +++ b/seed/applicationservice/2022.03.08/apache/templates/server.crt @@ -1 +1 @@ -%%get_certificate(%%domain_name_eth0, authority_cn=%%revprox_client_server_domainname, authority_name="InternalReverseProxy") +%%get_certificate(%%domain_name_eth0, authority_cn=%%revprox_client_server_domainname, authority_name="InternalReverseProxy", hide=%%hide_secret) diff --git a/seed/applicationservice/2022.03.08/apache/templates/server.key b/seed/applicationservice/2022.03.08/apache/templates/server.key index 53e9ce02..e8593618 100644 --- a/seed/applicationservice/2022.03.08/apache/templates/server.key +++ b/seed/applicationservice/2022.03.08/apache/templates/server.key @@ -1 +1 @@ -%%get_private_key(%%domain_name_eth0, authority_cn=%%revprox_client_server_domainname, authority_name="InternalReverseProxy") +%%get_private_key(%%domain_name_eth0, authority_cn=%%revprox_client_server_domainname, authority_name="InternalReverseProxy", hide=%%hide_secret) diff --git a/seed/applicationservice/2022.03.08/base-debian-bullseye/dictionaries/00-debian-bullseye.xml b/seed/applicationservice/2022.03.08/base-debian-bullseye/dictionaries/00-debian-bullseye.xml index 3a16d808..a5dd7cf8 100644 --- a/seed/applicationservice/2022.03.08/base-debian-bullseye/dictionaries/00-debian-bullseye.xml +++ b/seed/applicationservice/2022.03.08/base-debian-bullseye/dictionaries/00-debian-bullseye.xml @@ -6,10 +6,8 @@ - - - + diff --git a/seed/applicationservice/2022.03.08/base-debian/dictionaries/00-debian-base.xml b/seed/applicationservice/2022.03.08/base-debian/dictionaries/00-debian-base.xml deleted file mode 100644 index 2c6876f6..00000000 --- a/seed/applicationservice/2022.03.08/base-debian/dictionaries/00-debian-base.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - /tmpfiles.d/0tmp.conf - /etc/default/locale - - - - - - - - - - - - diff --git a/seed/applicationservice/2022.03.08/base-debian/dictionaries/11-debian-base.xml b/seed/applicationservice/2022.03.08/base-debian/dictionaries/11-debian-base.xml new file mode 100644 index 00000000..03d4922b --- /dev/null +++ b/seed/applicationservice/2022.03.08/base-debian/dictionaries/11-debian-base.xml @@ -0,0 +1,15 @@ + + + + + /tmpfiles.d/0tmp.conf + /etc/default/locale + + + + + + + diff --git a/seed/applicationservice/2022.03.08/base-debian/dictionaries/17-debian-base.xml b/seed/applicationservice/2022.03.08/base-debian/dictionaries/17-debian-base.xml new file mode 100644 index 00000000..b17a9da7 --- /dev/null +++ b/seed/applicationservice/2022.03.08/base-debian/dictionaries/17-debian-base.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + diff --git a/seed/applicationservice/2022.03.08/base-fedora-35/dictionaries/00-fedora-35.xml b/seed/applicationservice/2022.03.08/base-fedora-35/dictionaries/00-fedora-35.xml deleted file mode 100644 index 038e8cb9..00000000 --- a/seed/applicationservice/2022.03.08/base-fedora-35/dictionaries/00-fedora-35.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - diff --git a/seed/applicationservice/2022.03.08/base-fedora-35/dictionaries/11-fedora-35.xml b/seed/applicationservice/2022.03.08/base-fedora-35/dictionaries/11-fedora-35.xml new file mode 100644 index 00000000..ef17a8e5 --- /dev/null +++ b/seed/applicationservice/2022.03.08/base-fedora-35/dictionaries/11-fedora-35.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/seed/applicationservice/2022.03.08/base-fedora-36/dictionaries/00-fedora-version.xml b/seed/applicationservice/2022.03.08/base-fedora-36/dictionaries/00-fedora-version.xml deleted file mode 100644 index 2d7cea1a..00000000 --- a/seed/applicationservice/2022.03.08/base-fedora-36/dictionaries/00-fedora-version.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - diff --git a/seed/applicationservice/2022.03.08/base-fedora-36/dictionaries/11-fedora-version.xml b/seed/applicationservice/2022.03.08/base-fedora-36/dictionaries/11-fedora-version.xml new file mode 100644 index 00000000..9e1b8cb0 --- /dev/null +++ b/seed/applicationservice/2022.03.08/base-fedora-36/dictionaries/11-fedora-version.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/seed/applicationservice/2022.03.08/base-fedora/dictionaries/00-fedora-base.xml b/seed/applicationservice/2022.03.08/base-fedora/dictionaries/00-fedora-base.xml deleted file mode 100644 index 7da1647b..00000000 --- a/seed/applicationservice/2022.03.08/base-fedora/dictionaries/00-fedora-base.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - /tmpfiles.d/fedora.conf - - - - - - - - - - - diff --git a/seed/applicationservice/2022.03.08/base-fedora/dictionaries/11-fedora-base.xml b/seed/applicationservice/2022.03.08/base-fedora/dictionaries/11-fedora-base.xml new file mode 100644 index 00000000..fe122088 --- /dev/null +++ b/seed/applicationservice/2022.03.08/base-fedora/dictionaries/11-fedora-base.xml @@ -0,0 +1,13 @@ + + + + + /tmpfiles.d/fedora.conf + + + + + + diff --git a/seed/applicationservice/2022.03.08/base-fedora/dictionaries/17-fedora-base.xml b/seed/applicationservice/2022.03.08/base-fedora/dictionaries/17-fedora-base.xml new file mode 100644 index 00000000..09f1c24c --- /dev/null +++ b/seed/applicationservice/2022.03.08/base-fedora/dictionaries/17-fedora-base.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + diff --git a/seed/applicationservice/2022.03.08/base/dictionaries/00-base.xml b/seed/applicationservice/2022.03.08/base/dictionaries/12-base.xml similarity index 58% rename from seed/applicationservice/2022.03.08/base/dictionaries/00-base.xml rename to seed/applicationservice/2022.03.08/base/dictionaries/12-base.xml index a8e25115..ba360184 100644 --- a/seed/applicationservice/2022.03.08/base/dictionaries/00-base.xml +++ b/seed/applicationservice/2022.03.08/base/dictionaries/12-base.xml @@ -6,24 +6,21 @@ - + + False + + - - - - - @@ -34,16 +31,12 @@ ip ip_dns - - zones_name - number_of_interfaces - zones_name zones_list - number_of_interfaces + zones_name interfaces_list @@ -75,10 +68,6 @@ gateway_eth - - 1 - number_of_interfaces - diff --git a/seed/applicationservice/2022.03.08/base/funcs/funcs.py b/seed/applicationservice/2022.03.08/base/funcs/funcs.py index 8792841f..c9deac13 100644 --- a/seed/applicationservice/2022.03.08/base/funcs/funcs.py +++ b/seed/applicationservice/2022.03.08/base/funcs/funcs.py @@ -1,4 +1,5 @@ import __main__ +from typing import List from secrets import token_urlsafe as _token_urlsafe, token_hex as _token_hex from string import ascii_letters as _ascii_letters from random import choice as _choice @@ -6,6 +7,9 @@ from os.path import dirname as _dirname, abspath as _abspath, join as _join, isf from os import makedirs as _makedirs +from risotto.utils import load_domains, DOMAINS + + _HERE = _dirname(_abspath(__main__.__file__)) _PASSWORD_DIR = _join(_HERE, 'password') @@ -14,9 +18,12 @@ def get_password(server_name: str, username: str, description: str, type: str, + hide: bool, length: int=20, temporary: bool=True, ) -> str: + if hide: + return "XXXXX" def gen_password(): return _token_urlsafe(length)[:length] return _set_password(server_name, @@ -32,8 +39,11 @@ def get_password_alpha_num(server_name, username: str, description: str, length, + hide: bool, starts_with_char=False, ): + if hide: + return "XXXXX" def gen_password(): password = _token_hex() if starts_with_char: @@ -72,14 +82,8 @@ def _set_password(server_name: str, return file_content -def get_range(stop): - return list(range(stop)) - - -def get_number_of_interfaces(zones): - if zones is None: - return 1 - return len(zones) +def get_range(lst): + return list(range(max(1, len(lst)))) def get_zone_name(zones: list, @@ -97,3 +101,13 @@ def get_domain_name(server_name: str, if index == 0: return server_name return extra_domainnames[index - 1] + + +def get_ip(server_name: str, + zones_name: List[str], + index: str, + ) -> str: + load_domains() + host_name, domain_name = server_name.split('.', 1) + domain = DOMAINS[domain_name] + return domain[1][domain[0].index(host_name)] diff --git a/seed/applicationservice/2022.03.08/base/manual/install/diff.py b/seed/applicationservice/2022.03.08/base/manual/install/diff.py index f5780f60..ef9c1a92 100755 --- a/seed/applicationservice/2022.03.08/base/manual/install/diff.py +++ b/seed/applicationservice/2022.03.08/base/manual/install/diff.py @@ -11,6 +11,8 @@ from datetime import datetime, timezone os_name = argv[1] OLD_DIR = argv[2] NEW_DIR = argv[3] +WEBSITE = len(argv) != 5 + FILES = [] def diff_files(dcmp): for name in dcmp.diff_files: @@ -25,7 +27,8 @@ diff_files(dcmp) date = datetime.now(timezone.utc).isoformat() title = f"Nouvelle version de la configuration de {os_name}" subtitle = f"Différence entre les fichiers de configuration de {os_name}" -print(f"""+++ +if WEBSITE: + print(f"""+++ title = "{title}" description = "{subtitle}" date = {date} @@ -41,7 +44,15 @@ lead = "{subtitle}." type = "installe" +++ """) + TITLE = True +else: + TITLE = False for filename in FILES: + if not TITLE: + print(title) + print("=" * len(title)) + print() + TITLE = True print(f'- mise à jour du fichier {filename} :\n') try: with open(join(OLD_DIR, filename[1:]), 'r') as ori: @@ -51,7 +62,9 @@ for filename in FILES: except UnicodeDecodeError: print('fichier binaire') else: - print('```diff') + if WEBSITE: + print('```diff') for line in unified_diff(ori_content, new_content, fromfile=filename, tofile=filename): print(line.rstrip()) - print('```') + if WEBSITE: + print('```') diff --git a/seed/applicationservice/2022.03.08/dovecot/dictionaries/22_dovecot.xml b/seed/applicationservice/2022.03.08/dovecot/dictionaries/22_dovecot.xml index 3383139c..fff7eca5 100644 --- a/seed/applicationservice/2022.03.08/dovecot/dictionaries/22_dovecot.xml +++ b/seed/applicationservice/2022.03.08/dovecot/dictionaries/22_dovecot.xml @@ -50,17 +50,24 @@ - - 587 - 993 - + + + 587 + 993 + + - - dovecot - - - postfix - + + + all + + + dovecot + + + postfix + + @@ -187,12 +194,5 @@ mail_domains well_knowns - - all - ldap_server_address - client_family - domain_name_eth0 - mail_domains_calc - diff --git a/seed/applicationservice/2022.03.08/dovecot/templates/ca_IMAPServer.crt b/seed/applicationservice/2022.03.08/dovecot/templates/ca_IMAPServer.crt index deacd1ec..d0097871 100644 --- a/seed/applicationservice/2022.03.08/dovecot/templates/ca_IMAPServer.crt +++ b/seed/applicationservice/2022.03.08/dovecot/templates/ca_IMAPServer.crt @@ -1 +1 @@ -%%get_chain(%%domain_name_eth0, "IMAPServer") +%%get_chain(%%domain_name_eth0, "IMAPServer", hide=%%hide_secret) diff --git a/seed/applicationservice/2022.03.08/dovecot/templates/ca_MailServer.crt b/seed/applicationservice/2022.03.08/dovecot/templates/ca_MailServer.crt index 10f316a5..7b251cee 100644 --- a/seed/applicationservice/2022.03.08/dovecot/templates/ca_MailServer.crt +++ b/seed/applicationservice/2022.03.08/dovecot/templates/ca_MailServer.crt @@ -1 +1 @@ -%%get_chain(%%domain_name_eth0, "MailServer") +%%get_chain(%%domain_name_eth0, "MailServer", hide=%%hide_secret) diff --git a/seed/applicationservice/2022.03.08/dovecot/templates/dovecot-ldap.conf.ext b/seed/applicationservice/2022.03.08/dovecot/templates/dovecot-ldap.conf.ext index 1bdb6c45..4e3bf82d 100644 --- a/seed/applicationservice/2022.03.08/dovecot/templates/dovecot-ldap.conf.ext +++ b/seed/applicationservice/2022.03.08/dovecot/templates/dovecot-ldap.conf.ext @@ -34,8 +34,8 @@ uris = ldaps://%%ldap_server_address # Password for LDAP server, if dn is specified. #dnpass = #>GNUNUX -dn = %%ldapclient_remote_user -dnpass = %%ldapclient_remote_user_password +dn = %%ldapclient_user +dnpass = %%ldapclient_user_password # - - 2222 - + + + 2222 + + Gitea: Git avec une tasse de thé @@ -54,7 +56,9 @@ RS256 - + + + @@ -63,6 +67,7 @@ secret_key gitea cleartext + hide_secret 105 gitea_secret_key @@ -71,6 +76,7 @@ internal_token gitea cleartext + hide_secret 105 gitea_internal_token @@ -79,6 +85,7 @@ lfs_jwt_secret gitea cleartext + hide_secret 43 gitea_lfs_jwt_secret diff --git a/seed/applicationservice/2022.03.08/imap-client/templates/ca_IMAPServer.crt b/seed/applicationservice/2022.03.08/imap-client/templates/ca_IMAPServer.crt index 9334b3a2..ed24ab89 100644 --- a/seed/applicationservice/2022.03.08/imap-client/templates/ca_IMAPServer.crt +++ b/seed/applicationservice/2022.03.08/imap-client/templates/ca_IMAPServer.crt @@ -1 +1 @@ -%%get_chain(%%imap_address, 'IMAPServer') +%%get_chain(%%imap_address, 'IMAPServer', hide=%%hide_secret) diff --git a/seed/applicationservice/2022.03.08/ldap-client-debian/dictionaries/20_ldap-client-debian.xml b/seed/applicationservice/2022.03.08/ldap-client-debian/dictionaries/20_ldap-client-debian.xml deleted file mode 100644 index c30b952e..00000000 --- a/seed/applicationservice/2022.03.08/ldap-client-debian/dictionaries/20_ldap-client-debian.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/seed/applicationservice/2022.03.08/ldap-client-debian/dictionaries/22_ldap-client-debian.xml b/seed/applicationservice/2022.03.08/ldap-client-debian/dictionaries/22_ldap-client-debian.xml new file mode 100644 index 00000000..85905435 --- /dev/null +++ b/seed/applicationservice/2022.03.08/ldap-client-debian/dictionaries/22_ldap-client-debian.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/seed/applicationservice/2022.03.08/ldap-client-fedora/dictionaries/20_ldap-client-fedora.xml b/seed/applicationservice/2022.03.08/ldap-client-fedora/dictionaries/20_ldap-client-fedora.xml deleted file mode 100644 index e0c77bb2..00000000 --- a/seed/applicationservice/2022.03.08/ldap-client-fedora/dictionaries/20_ldap-client-fedora.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/seed/applicationservice/2022.03.08/ldap-client-fedora/dictionaries/22_ldap-client-fedora.xml b/seed/applicationservice/2022.03.08/ldap-client-fedora/dictionaries/22_ldap-client-fedora.xml new file mode 100644 index 00000000..23e3d61b --- /dev/null +++ b/seed/applicationservice/2022.03.08/ldap-client-fedora/dictionaries/22_ldap-client-fedora.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/seed/applicationservice/2022.03.08/ldap-client/dictionaries/21_ldap-client.xml b/seed/applicationservice/2022.03.08/ldap-client/dictionaries/21_ldap-client.xml index 6b962541..53eeddca 100644 --- a/seed/applicationservice/2022.03.08/ldap-client/dictionaries/21_ldap-client.xml +++ b/seed/applicationservice/2022.03.08/ldap-client/dictionaries/21_ldap-client.xml @@ -10,34 +10,34 @@ - - - - - ldap_base_dn - - - ldap_base_dn - ldapclient_family ldapclient_base_dn - + tls_ca_directory ca_LDAP.crt @@ -56,35 +56,32 @@ / ldap_key_file - - ldap_server_address - clients - domain_name_eth0 + + ldap_server_address + clients + domain_name_eth0 + client_family + ldapclient_family + True dn + ldapclient_user + + + ldap_server_address + ldapclient_user + remote account + cleartext + hide_secret + True + ldapclient_user_password + + + ldap_server_address + client_password + ldapclient_user_password + base_dn domain_name_eth0 - ldapclient_remote_user + ldapclient_base_dn - - ldap_server_address - client_password - domain_name_eth0 - ldapclient_remote_user_password - - - ldap_server_address - ldap_dn - ldap_base_dn - - - ldap_server_address - ldap_port - ldap_port - - - ldap_server_address - client_family - domain_name_eth0 - ldapclient_family - diff --git a/seed/applicationservice/2022.03.08/ldap-client/funcs/openldap_client.py b/seed/applicationservice/2022.03.08/ldap-client/funcs/openldap_client.py index 830b1886..59789164 100644 --- a/seed/applicationservice/2022.03.08/ldap-client/funcs/openldap_client.py +++ b/seed/applicationservice/2022.03.08/ldap-client/funcs/openldap_client.py @@ -7,15 +7,24 @@ def valid_base_dn(base_dn: str) -> None: def calc_ldapclient_base_dn(ldap_base_dn: str, - family_name: str, - accounts: bool=False, + family_name: str=None, + base: bool=False, + group: bool=False, ) -> str: - base = f'ou=accounts,{ldap_base_dn}' - if accounts: - return base + if family_name == 'all': + family_name = None + base = True + if group: + return f'ou=groups,{ldap_base_dn}' + if not ldap_base_dn.startswith('ou=accounts,'): + base_name = f'ou=accounts,{ldap_base_dn}' + else: + base_name = ldap_base_dn + if base: + return base_name if not family_name: - return f'ou=users,{base}' - families = f'ou=families,{base}' + return f'ou=users,{base_name}' + base_name = f'ou=families,{base_name}' if family_name != '-': - return f'ou={family_name},{families}' - return families + base_name = f'ou={family_name},{base_name}' + return base_name diff --git a/seed/applicationservice/2022.03.08/ldap-client/templates/ca_LDAP.crt b/seed/applicationservice/2022.03.08/ldap-client/templates/ca_LDAP.crt index 86dff29e..d04f2f99 100644 --- a/seed/applicationservice/2022.03.08/ldap-client/templates/ca_LDAP.crt +++ b/seed/applicationservice/2022.03.08/ldap-client/templates/ca_LDAP.crt @@ -1 +1 @@ -%%get_chain(%%ldap_server_address, 'LDAP') +%%get_chain(%%ldap_server_address, 'LDAP', hide=%%hide_secret) diff --git a/seed/applicationservice/2022.03.08/ldap-client/templates/ldap.conf b/seed/applicationservice/2022.03.08/ldap-client/templates/ldap.conf index 0b20b64b..7c40a7f5 100644 --- a/seed/applicationservice/2022.03.08/ldap-client/templates/ldap.conf +++ b/seed/applicationservice/2022.03.08/ldap-client/templates/ldap.conf @@ -31,8 +31,8 @@ TLS_CACERT %%ldap_ca_file # Turning this off breaks GSSAPI used with krb5 when rdns = false SASL_NOCANON on -BINDDN %%ldapclient_remote_user +BINDDN %%ldapclient_user TIMELIMIT 10 NETWORK_TIMEOUT 10 TIMEOUT 10 -BINDPW %%ldapclient_remote_user_password +BINDPW %%ldapclient_user_password diff --git a/seed/applicationservice/2022.03.08/ldap-client/templates/ldap_client.crt b/seed/applicationservice/2022.03.08/ldap-client/templates/ldap_client.crt index 1b8dd519..bc9cf4fd 100644 --- a/seed/applicationservice/2022.03.08/ldap-client/templates/ldap_client.crt +++ b/seed/applicationservice/2022.03.08/ldap-client/templates/ldap_client.crt @@ -1 +1 @@ -%%get_certificate(cn=%%domain_name_eth0, authority_cn=%%ldap_server_address, authority_name='LDAP', type='client') +%%get_certificate(cn=%%domain_name_eth0, authority_cn=%%ldap_server_address, authority_name='LDAP', type='client', hide=%%hide_secret) diff --git a/seed/applicationservice/2022.03.08/ldap-client/templates/ldap_client.key b/seed/applicationservice/2022.03.08/ldap-client/templates/ldap_client.key index 65e88b1c..94134b17 100644 --- a/seed/applicationservice/2022.03.08/ldap-client/templates/ldap_client.key +++ b/seed/applicationservice/2022.03.08/ldap-client/templates/ldap_client.key @@ -1,4 +1,4 @@ -%set %%key = %%get_private_key(cn=%%domain_name_eth0, authority_cn=%%ldap_server_address, authority_name='LDAP', type='client') +%set %%key = %%get_private_key(cn=%%domain_name_eth0, authority_cn=%%ldap_server_address, authority_name='LDAP', type='client', hide=%%hide_secret) %if not %%key %raise Exception('empty key') %end if diff --git a/seed/applicationservice/2022.03.08/lemonldap/dictionaries/70_lemonldap_ng.xml b/seed/applicationservice/2022.03.08/lemonldap/dictionaries/70_lemonldap_ng.xml index e73c0719..816e2aaa 100644 --- a/seed/applicationservice/2022.03.08/lemonldap/dictionaries/70_lemonldap_ng.xml +++ b/seed/applicationservice/2022.03.08/lemonldap/dictionaries/70_lemonldap_ng.xml @@ -28,14 +28,12 @@ + + + + all + + + - - - all - ldap_server_address - client_family - domain_name_eth0 - lemon_mail_admin - - diff --git a/seed/applicationservice/2022.03.08/lemonldap/doc.md b/seed/applicationservice/2022.03.08/lemonldap/doc.md index cef4967c..0cb05caa 100644 --- a/seed/applicationservice/2022.03.08/lemonldap/doc.md +++ b/seed/applicationservice/2022.03.08/lemonldap/doc.md @@ -7,6 +7,7 @@ Providers - oauth2_token_signature_algo : algorithme de la signature du jeton - oauth2_name : nom du service affiché à l'utilisateur - oauth2_description : description du service affiché à l'utilisateur -- oauth2_external : adresse du service (de type https://domaine/location/) c'est une variable multiple, dans ce cas plusieurs lien peuvent être généré pour accéder à ce service (par exemple un pour les utilisateurs + un différent pour une famille) +- oauth2_host : adresse du service (de type https://domaine/location/) c'est une variable multiple, dans ce cas plusieurs lien peuvent être généré pour accéder à ce service (par exemple un pour les utilisateurs + un différent pour une famille) +- oauth2_family : famille autoriser à accéder - oauth2_logo : logo visible par l'utilisateur - oauth2_category : catégorie qui permet de classer le service diff --git a/seed/applicationservice/2022.03.08/lemonldap/extras/oauth2/00_oauth2.xml b/seed/applicationservice/2022.03.08/lemonldap/extras/oauth2/00_oauth2.xml index 56a6fec8..7c72c61d 100644 --- a/seed/applicationservice/2022.03.08/lemonldap/extras/oauth2/00_oauth2.xml +++ b/seed/applicationservice/2022.03.08/lemonldap/extras/oauth2/00_oauth2.xml @@ -8,7 +8,12 @@