diff --git a/seed/base-machine/manual/install/diff.py b/seed/base-machine/manual/install/diff.py index 510dcc5..b203086 100755 --- a/seed/base-machine/manual/install/diff.py +++ b/seed/base-machine/manual/install/diff.py @@ -1,12 +1,11 @@ #!/usr/bin/env python3 -from os.path import join from filecmp import dircmp from difflib import unified_diff from sys import stdout, argv from os import walk -from os.path import join +from os.path import join, islink from datetime import datetime, timezone @@ -87,10 +86,13 @@ for filename in old - new: for filename in new - old: - print(f'\n- fichier {filename} ajouté :\n') - with open(join(NEW_DIR, filename), 'r') as fh: - if WEBSITE: - print('```') - print(fh.read()) - if WEBSITE: - print('```') + if islink(join(NEW_DIR, filename)): + print(f'\n- lien {filename} ajouté\n') + else: + print(f'\n- fichier {filename} ajouté :\n') + with open(join(NEW_DIR, filename), 'r') as fh: + if WEBSITE: + print('```') + print(fh.read()) + if WEBSITE: + print('```') diff --git a/seed/dovecot/templates/dovecot-init.service b/seed/dovecot/templates/dovecot-init.service index b4f9cec..1df2ef4 100644 --- a/seed/dovecot/templates/dovecot-init.service +++ b/seed/dovecot/templates/dovecot-init.service @@ -1,5 +1,5 @@ [Unit] -After=network.target +After=risotto.target [Service] ExecStart= diff --git a/seed/gitea/templates/gitea.service b/seed/gitea/templates/gitea.service index 9f19bf7..abb4929 100644 --- a/seed/gitea/templates/gitea.service +++ b/seed/gitea/templates/gitea.service @@ -1,7 +1,7 @@ #ORIGIN https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/systemd/gitea.service [Unit] Description=Gitea (Git with a cup of tea) -After=network.target postgresqlclient.service +After=risotto.target [Service] # Modify these two values and uncomment them if you have diff --git a/seed/ldap-client/dictionaries/21_ldap-client.xml b/seed/ldap-client/dictionaries/21_ldap-client.xml index ac1ce2f..b0835e4 100644 --- a/seed/ldap-client/dictionaries/21_ldap-client.xml +++ b/seed/ldap-client/dictionaries/21_ldap-client.xml @@ -2,7 +2,7 @@ - + ldap_client_file ldap_ca_file ldap_cert_file diff --git a/seed/ldap-client/templates/ldap-client.service b/seed/ldap-client/templates/ldap-client.service new file mode 100644 index 0000000..6cbf68c --- /dev/null +++ b/seed/ldap-client/templates/ldap-client.service @@ -0,0 +1,8 @@ +[Unit] +After=network-online.target +Before=risotto.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/timeout 90 bash -c 'while ! 3<> /dev/tcp/%%ldap_server_address/%%ldap_port; do sleep 1; done' + diff --git a/seed/lemonldap/templates/lemonldap-ng-fastcgi-server.service b/seed/lemonldap/templates/lemonldap-ng-fastcgi-server.service index f61277e..adbfcf3 100644 --- a/seed/lemonldap/templates/lemonldap-ng-fastcgi-server.service +++ b/seed/lemonldap/templates/lemonldap-ng-fastcgi-server.service @@ -1,7 +1,6 @@ [Unit] -After=nginx.service +After=risotto.target nginx.service [Service] -ExecStartPre=/usr/bin/timeout 90 bash -c 'while ! 3<> /dev/tcp/%%ldap_server_address/%%ldap_port; do sleep 1; done' ExecStartPost=-/usr/bin/timeout 10 bash -c 'while ! /usr/local/lib/sbin/interne_well_known.pl > /var/www/html/.well-known/openid-configuration/int; do sleep 1; done' ExecStartPost=-/bin/bash -c '/usr/local/lib/sbin/interne_well_known.pl no > /var/www/html/.well-known/openid-configuration/ext' diff --git a/seed/mailman/templates/mailman3.service b/seed/mailman/templates/mailman3.service index 58932c6..5727c46 100644 --- a/seed/mailman/templates/mailman3.service +++ b/seed/mailman/templates/mailman3.service @@ -1,6 +1,6 @@ [Unit] Description=Postorius WSGI Service -After=postgresqlclient.service +After=risotto.target [Service] %for %%domain in %%mailman_domains diff --git a/seed/mailman/templates/postorius.service b/seed/mailman/templates/postorius.service index 1f29c6c..83374d6 100644 --- a/seed/mailman/templates/postorius.service +++ b/seed/mailman/templates/postorius.service @@ -1,6 +1,6 @@ [Unit] Description=Postorius WSGI Service -After=network.target postgresqlclient.service +After=risotto.target [Service] Type=notify diff --git a/seed/mariadb-client/dictionaries/20_mariadb.xml b/seed/mariadb-client/dictionaries/20_mariadb.xml index 39ac585..36155f6 100644 --- a/seed/mariadb-client/dictionaries/20_mariadb.xml +++ b/seed/mariadb-client/dictionaries/20_mariadb.xml @@ -1,7 +1,7 @@ - + diff --git a/seed/mariadb-client/templates/mariadbclient.service b/seed/mariadb-client/templates/mariadbclient.service index 0b583e1..007e422 100644 --- a/seed/mariadb-client/templates/mariadbclient.service +++ b/seed/mariadb-client/templates/mariadbclient.service @@ -1,6 +1,7 @@ [Unit] Description=Waiting for mariadb server -Before=network.target +After=network-online.target +Before=risotto.target [Service] Type=oneshot diff --git a/seed/nextcloud/templates/nextcloud.service b/seed/nextcloud/templates/nextcloud.service index 0a9339f..16c79b5 100644 --- a/seed/nextcloud/templates/nextcloud.service +++ b/seed/nextcloud/templates/nextcloud.service @@ -1,6 +1,6 @@ [Unit] Description=Nextcloud management -After=postgresqlclient.service +After=risotto.target Before=apache.service php-fpm.service [Service] diff --git a/seed/nsd/templates/nsd.service b/seed/nsd/templates/nsd.service index 6f45f4e..f48cf18 100644 --- a/seed/nsd/templates/nsd.service +++ b/seed/nsd/templates/nsd.service @@ -1,2 +1,2 @@ [Unit] -After=network.target +After=risotto.target diff --git a/seed/oauth2-client/dictionaries/30_oauth2_client.xml b/seed/oauth2-client/dictionaries/30_oauth2_client.xml index cc6e415..80a28a6 100644 --- a/seed/oauth2-client/dictionaries/30_oauth2_client.xml +++ b/seed/oauth2-client/dictionaries/30_oauth2_client.xml @@ -1,5 +1,8 @@ + + + diff --git a/seed/oauth2-client/manual/image/preinstall/oauth2-client.sh b/seed/oauth2-client/manual/image/preinstall/oauth2-client.sh new file mode 100644 index 0000000..c6335d9 --- /dev/null +++ b/seed/oauth2-client/manual/image/preinstall/oauth2-client.sh @@ -0,0 +1 @@ +PKG="$PKG curl" diff --git a/seed/oauth2-client/templates/oauth2-client.service b/seed/oauth2-client/templates/oauth2-client.service new file mode 100644 index 0000000..c2bb776 --- /dev/null +++ b/seed/oauth2-client/templates/oauth2-client.service @@ -0,0 +1,7 @@ +[Unit] +After=network-online.target +Before=risotto.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/timeout 90 bash -c 'while ! [ "$(/usr/bin/curl --write-out '%{http_code}' --silent --output /dev/null https://%%oauth2_client_server_domainname/.well-known/openid-configuration)" = 200 ]; do sleep 1; done;' diff --git a/seed/piwigo/templates/piwigo.service b/seed/piwigo/templates/piwigo.service index e75c1c1..16b5b98 100644 --- a/seed/piwigo/templates/piwigo.service +++ b/seed/piwigo/templates/piwigo.service @@ -1,6 +1,6 @@ [Unit] Description=Piwigo management -After=mariadbclient.service +After=risotto.target Before=nginx.service php-fpm.service [Service] diff --git a/seed/postgresql-client/dictionaries/23_postgresql.xml b/seed/postgresql-client/dictionaries/23_postgresql.xml index 138f7d3..9afde85 100644 --- a/seed/postgresql-client/dictionaries/23_postgresql.xml +++ b/seed/postgresql-client/dictionaries/23_postgresql.xml @@ -1,7 +1,7 @@ - + /secrets/postgresql.pass /etc/pki/ca-trust/source/anchors/ca_PostgreSQL.crt /etc/pki/tls/certs/postgresql.crt diff --git a/seed/postgresql-client/templates/postgresqlclient.service b/seed/postgresql-client/templates/postgresqlclient.service index 7addde1..fd8b647 100644 --- a/seed/postgresql-client/templates/postgresqlclient.service +++ b/seed/postgresql-client/templates/postgresqlclient.service @@ -1,6 +1,7 @@ [Unit] Description=Waiting for postgresql server -Before=network.target +After=network-online.target +Before=risotto.target [Service] Type=oneshot diff --git a/seed/roundcube/templates/roundcube.service b/seed/roundcube/templates/roundcube.service index 92913e3..19b462b 100644 --- a/seed/roundcube/templates/roundcube.service +++ b/seed/roundcube/templates/roundcube.service @@ -1,6 +1,6 @@ [Unit] Description=Roundcube database init -After=postgresqlclient.service +After=risotto.target Before=nginx.service php-fpm.service [Service] diff --git a/seed/systemd/dictionaries/15-systemd.xml b/seed/systemd/dictionaries/15-systemd.xml index 6819b86..deaf2e7 100644 --- a/seed/systemd/dictionaries/15-systemd.xml +++ b/seed/systemd/dictionaries/15-systemd.xml @@ -29,6 +29,7 @@ /secrets/root.pwd /tmpfiles.d/risotto-volatile.conf + diff --git a/seed/systemd/templates/risotto.target b/seed/systemd/templates/risotto.target new file mode 100644 index 0000000..8f4c5e6 --- /dev/null +++ b/seed/systemd/templates/risotto.target @@ -0,0 +1,5 @@ +[Unit] +Description=Waiting for all dependencies +Before=multi-user.target +After=network-online.target +Wants=network-online.target