Compare commits

6 Commits

Author SHA1 Message Date
554e032bd6 Fix certbot arguments for non intercative mode 2025-12-31 17:29:37 +01:00
6f822f786d Fix certbot venv dir in install 2025-12-31 17:18:01 +01:00
0912b637b4 Add symbolic link in rpm files 2025-12-31 17:16:40 +01:00
ba6e4c9e38 Add --force to cerbot link 2025-12-31 16:54:10 +01:00
2161cac791 Fix makefile typo 2025-12-31 16:48:37 +01:00
41afd81c9b Add missing directory on install 2025-12-31 16:47:49 +01:00
2 changed files with 8 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ NAME = $(shell basename $(PWD))
VERSION = $(shell git describe | sed 's/-/./g')
BRANCH = $(shell git branch --show-current)
RPM_SBINDIR = $(shell rpm --eval '%{_sbindir}')
RPM_SOURCEDIR = $(shell rpm --eval '%{_sourcedir}')
RPM_SYSCONFDIR = $(shell rpm --eval '%{_sysconfdir}')
RPM_UNITDIR = $(shell rpm --eval '%{_unitdir}')
@@ -30,4 +31,8 @@ install:
install --directory $(DESTDIR)$(RPM_SYSCONFDIR)/netoik-rp
install --target-directory=$(DESTDIR)$(RPM_SYSCONFDIR)/netoik-rp/ conf/netoik-rp.conf
install --target-directory=$(DESTDIR)$(RPM_SYSCONFDIR)/netoik-rp/ conf/ovh.ini
install --directory $(DESTDIR)$(RPM_UNITDIR)
install --target-directory=$(DESTDIR)$(RPM_UNITDIR)/ services/netoik-rp.service
install --directory $(DESTDIR)/opt/certbot
install --directory $(DESTDIR)$(RPM_SBINDIR)
touch $(DESTDIR)$(RPM_SBINDIR)/certbot

View File

@@ -31,7 +31,7 @@ if [ $1 == 1 ]; then
%{_bindir}/env python3 -m venv /opt/certbot
/opt/certbot/bin/pip install --upgrade pip certbot certbot-dns-ovh
%{_bindir}/env ln --symbolic --target-directory %{_sbindir} /opt/certbot/bin/certbot
%{_bindir}/env certbot certonly --dns-ovh --dns-ovh-credentials "%{_sysconfdir}/%{name}/ovh.ini" -d "*.netoik.io" -d "*.samuel-campos.fr"
%{_bindir}/env certbot certonly --non-interactive --agree-tos --email samuel.campos@netoik.io --dns-ovh --dns-ovh-credentials "%{_sysconfdir}/%{name}/ovh.ini" -d "*.netoik.io" -d "*.samuel-campos.fr"
%{_bindir}/env printf "\nAutomatic certbot renew\n0 12 * * * root sleep $((RANDOM % 3600)) && certbot renew -q\n" >> %{_sysconfdir}/crontab
fi
%{_bindir}/env systemctl disable nginx
@@ -44,6 +44,8 @@ fi
%attr(600, root, root) %config %{_sysconfdir}/%{name}/ovh.ini
%attr(644, root, root) %config %{_sysconfdir}/%{name}/netoik-rp.conf
%attr(644, root, root) %config %{_unitdir}/%{name}.service
%attr(755, root, root) %dir /opt/certbot
%attr(755, root, root) %{_sbindir}/certbot
%changelog
%autochangelog