diff --git a/seed/base-machine/manual/install/diff.py b/seed/base-machine/manual/install/diff.py index 510dcc5d..b2030863 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 b4f9cecd..1df2ef4f 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 9f19bf7b..abb4929c 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 ac1ce2f4..b0835e48 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 00000000..6cbf68c8 --- /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 f61277e7..adbfcf36 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 58932c6c..5727c469 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 1f29c6c4..83374d6d 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 39ac585e..36155f66 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 0b583e18..007e4223 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 0a9339fe..16c79b59 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 6f45f4ef..f48cf183 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 cc6e415c..80a28a6c 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 00000000..c6335d96 --- /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 00000000..c2bb7768 --- /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 e75c1c11..16b5b987 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 138f7d3f..9afde856 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 7addde19..fd8b647a 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 92913e35..19b462b2 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 6819b861..deaf2e74 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 00000000..8f4c5e63 --- /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