Compare commits

..

9 Commits

Author SHA1 Message Date
1a14fbb5f1 doc: update pkg repo owner
All checks were successful
Continuous Integration / lint_n_build (push) Successful in 1m53s
2026-04-19 14:16:12 +02:00
200dbf50fc fix: remove space
All checks were successful
Continuous Delivery / build_n_upload (push) Successful in 20s
2026-04-19 12:50:53 +02:00
c17d1c49f1 ci: change repo owner 2026-04-19 12:49:30 +02:00
abb193a03c fix: add ssl dhparams in all cases
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-04-11 18:24:52 +02:00
d26a6e5ec8 fix: create self-signed certificate for local use
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-04-11 16:18:34 +02:00
3d50d99368 fix: remove ssl entries if skipping certbot
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-04-04 06:59:18 +02:00
3a9d39de4c doc: fix dnf command search 2026-04-04 06:47:43 +02:00
d7d87e0162 feat: add skip certbot option
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-04-04 06:38:58 +02:00
48792673dc fix: use absolute path in service file 2026-03-15 18:21:11 +01:00
4 changed files with 34 additions and 19 deletions

View File

@@ -2,7 +2,7 @@ NAME = netoik-rp
VERSION = $(shell git describe --abbrev=0)
RELEASE = $(shell git rev-parse --short HEAD)
ARCH = noarch
OWNER = samuel
OWNER = netoik
SUMMARY = "Netoïk Reverse Proxy"
LICENSE = "MIT"
URL = "https://git.netoik.io/$(OWNER)/$(NAME)"

View File

@@ -66,13 +66,13 @@ Some commands to deploy the RPM package on server
- Add Gitea repo to your repo list:
```shell
dnf config-manager --add-repo https://git.netoik.io/api/packages/samuel/rpm.repo
dnf config-manager --add-repo https://git.netoik.io/api/packages/netoik/rpm.repo
dnf repolist | grep gitea-samuel
```
- Show available versions:
```shell
dnf --showduplicates netoik-rp
dnf search --showduplicates netoik-rp
```
- Create certbot ovh credentials here:
@@ -98,6 +98,11 @@ Some commands to deploy the RPM package on server
set +a
```
- Install or upgrade without certbot (for testing environment)
```shell
SKIP_CERTBOT=true dnf --nogpgcheck --refresh --assumeyes --best install netoik-rp
```
# Security Notes

View File

@@ -2,4 +2,4 @@
Description=Renew certbot certificates
[Service]
ExecStart=certbot_renew
ExecStart=/usr/sbin/certbot_renew

View File

@@ -22,14 +22,19 @@ Install the reverse proxy called nginx with a predefined configuration and with
%make_install
%post
if [ -z $SKIP_CERTBOT ]; then
# Check required OVH variables
if [ -z $OVH_ENDPOINT ]; then echo "Missing env var OVH_ENDPOINT!" 1>&2; exit 1; fi
if [ -z $OVH_APPLICATION_NAME ]; then echo "Missing env var OVH_APPLICATION_KEY!" 1>&2; exit 1; fi
if [ -z $OVH_APPLICATION_DESCRIPTION ]; then echo "Missing env var OVH_APPLICATION_DESCRIPTION!" 1>&2; exit 1; fi
if [ -z $OVH_APPLICATION_KEY ]; then echo "Missing env var OVH_APPLICATION_KEY!" 1>&2; exit 1; fi
if [ -z $OVH_APPLICATION_SECRET ]; then echo "Missing env var OVH_APPLICATION_SECRET!" 1>&2; exit 1; fi
if [ -z $OVH_CONSUMER_KEY ]; then echo "Missing env var OVH_CONSUMER_KEY!" 1>&2; exit 1; fi
# Replace secrets in ovh.ini
envsubst < %{_sysconfdir}/certbot/ovh.ini > %{_sysconfdir}/certbot/.ovh.ini.new
if cmp --silent %{_sysconfdir}/certbot/.ovh.ini.new %{_sysconfdir}/certbot/ovh.ini; then
rm %{_sysconfdir}/certbot/.ovh.ini.new
else
mv %{_sysconfdir}/certbot/.ovh.ini.new %{_sysconfdir}/certbot/ovh.ini
chmod 600 %{_sysconfdir}/certbot/ovh.ini
fi
# Create virtualenv with certot
if [ ! -d "/opt/certbot" ]; then
@@ -42,6 +47,11 @@ fi
if ! certbot certificates --cert-name netoik.io | grep --quiet netoik.io; then
certbot certonly --cert-name netoik.io --non-interactive --agree-tos --email samuel.campos@netoik.io --dns-ovh --dns-ovh-credentials %{_sysconfdir}/certbot/ovh.ini -d *.netoik.io -d *.samuel-campos.fr
fi
else
# Skipping certbot, so create self-signed certificate
mkdir --parents /etc/letsencrypt/live/netoik.io
openssl req -newkey rsa:4096 -nodes -keyout /etc/letsencrypt/live/netoik.io/privkey.pem -x509 -days 365 -out /etc/letsencrypt/live/netoik.io/fullchain.pem -subj "/C=US/ST=State/L=City/O=Organization/OU=Department/CN=netoik.io"
fi
# Create ssl dh params if not already exists
if [ ! -f "%{_sysconfdir}/letsencrypt/ssl-dhparams.pem" ]; then