Compare commits

...

8 Commits

Author SHA1 Message Date
6ddea566f3 fix: separate systemctl restart and reenable commands
All checks were successful
Continuous Integration / lint_n_build (push) Successful in 21s
Continuous Delivery / build_n_upload (push) Successful in 22s
2026-03-08 16:45:36 +01:00
844e727b7d doc: update readme
All checks were successful
Continuous Integration / lint_n_build (push) Successful in 19s
Continuous Delivery / build_n_upload (push) Successful in 19s
2026-03-08 16:39:06 +01:00
7e59f820a3 feat: add csp data type
All checks were successful
Continuous Integration / lint_n_build (push) Successful in 21s
Continuous Delivery / build_n_upload (push) Successful in 22s
2026-03-08 16:08:13 +01:00
89e3d510df fix: rename nginx default file 2026-03-08 16:07:59 +01:00
99067e5ead ci: fix upload pkg command
All checks were successful
Continuous Integration / lint_n_build (push) Successful in 21s
Continuous Delivery / build_n_upload (push) Successful in 22s
2026-03-08 02:55:17 +01:00
16b36fe751 ci: typo depth
Some checks failed
Continuous Integration / lint_n_build (push) Successful in 1m16s
Continuous Delivery / build_n_upload (push) Failing after 19s
2026-03-08 02:49:03 +01:00
781a21a209 ci: set depth 0
Some checks failed
Continuous Integration / lint_n_build (push) Failing after 13s
2026-03-08 02:45:49 +01:00
bb08a22ad5 ci: add .gitea folder
Some checks failed
Continuous Integration / lint_n_build (push) Failing after 1m11s
2026-03-08 02:43:22 +01:00
8 changed files with 69 additions and 13 deletions

20
.gitea/workflows/cd.yaml Normal file
View File

@@ -0,0 +1,20 @@
name: Continuous Delivery
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
build_n_upload:
runs-on: self-hosted
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- run: make tarball
- run: rpmbuild -ba "$(make name).spec"
- run: make upload
env:
PKG_TOKEN: ${{ secrets.PKG_TOKEN }}

18
.gitea/workflows/ci.yaml Normal file
View File

@@ -0,0 +1,18 @@
name: Continuous Integration
on:
push:
branches:
- main
jobs:
lint_n_build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- run: shellcheck files/sbin/certbot_renew
- run: make tarball
- run: rpmbuild -ba "$(make name).spec"

View File

@@ -15,7 +15,7 @@ RPM_SYSCONFDIR = $(shell rpm --eval '%{_sysconfdir}')
RPM_UNITDIR = $(shell rpm --eval '%{_unitdir}') RPM_UNITDIR = $(shell rpm --eval '%{_unitdir}')
RPM_TARBALL_PATH = $(RPM_SOURCEDIR)/$(SOURCE0) RPM_TARBALL_PATH = $(RPM_SOURCEDIR)/$(SOURCE0)
RPM_BUILD_PATH = $(RPM_RPMDIR)/$(BUILD_ARCH)/$(NAME)-$(VERSION)-$(RELEASE).$(ARCH).rpm RPM_BUILD_PATH = $(RPM_RPMDIR)/$(ARCH)/$(NAME)-$(VERSION)-$(RELEASE).$(ARCH).rpm
.PHONY: name .PHONY: name
name: name:
@@ -56,7 +56,7 @@ source0:
.PHONY: install .PHONY: install
install: install:
install --directory $(DESTDIR)$(RPM_SYSCONFDIR)/nginx/conf.d $(DESTDIR)$(RPM_SYSCONFDIR)/certbot $(DESTDIR)$(RPM_UNITDIR) $(DESTDIR)$(RPM_SBINDIR) install --directory $(DESTDIR)$(RPM_SYSCONFDIR)/nginx/conf.d $(DESTDIR)$(RPM_SYSCONFDIR)/certbot $(DESTDIR)$(RPM_UNITDIR) $(DESTDIR)$(RPM_SBINDIR)
install --target-directory=$(DESTDIR)$(RPM_SYSCONFDIR)/nginx/conf.d files/nginx/0_security.conf files/nginx/default.conf install --target-directory=$(DESTDIR)$(RPM_SYSCONFDIR)/nginx/conf.d files/nginx/0_security.conf files/nginx/z_default.conf
install --mode=600 --target-directory=$(DESTDIR)$(RPM_SYSCONFDIR)/certbot files/certbot/ovh.ini install --mode=600 --target-directory=$(DESTDIR)$(RPM_SYSCONFDIR)/certbot files/certbot/ovh.ini
install --mode=644 --target-directory=$(DESTDIR)$(RPM_UNITDIR) files/systemd/certbot-renew.service files/systemd/certbot-renew.timer install --mode=644 --target-directory=$(DESTDIR)$(RPM_UNITDIR) files/systemd/certbot-renew.service files/systemd/certbot-renew.timer
install --mode=755 --target-directory=$(DESTDIR)$(RPM_SBINDIR) files/sbin/certbot_renew install --mode=755 --target-directory=$(DESTDIR)$(RPM_SBINDIR) files/sbin/certbot_renew

View File

@@ -63,21 +63,38 @@ Two workflows are set up.
Some commands to deploy the RPM package on server Some commands to deploy the RPM package on server
- To add Gitea repo to your repo list: - Add Gitea repo to your repo list:
```shell ```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/samuel/rpm.repo
dnf repolist | grep gitea-samuel dnf repolist | grep gitea-samuel
``` ```
- To show available versions: - Show available versions:
```shell ```shell
dnf --showduplicates netoik-rp dnf --showduplicates netoik-rp
``` ```
- To install or upgrade: - Create certbot ovh credentials here:
[www.ovh.com/auth/api/createToken](https://www.ovh.com/auth/api/createToken)
- Setup environemnt file (fill values):
```shell ```shell
dnf --nogpgcheck install netoik-rp cat > ~/.netoik-rp.env << EOF
dnf --nogpgcheck upgrade netoik-rp OVH_ENDPOINT=""
OVH_APPLICATION_NAME=""
OVH_APPLICATION_DESCRIPTION=""
OVH_APPLICATION_KEY=""
OVH_APPLICATION_SECRET=""
OVH_CONSUMER_KEY=""
EOF
```
- Install or upgrade package:
```shell
set -a
source ~/.netoik-rp.env
dnf --nogpgcheck --refresh --assumeyes --best install netoik-rp
set +a
``` ```

View File

@@ -1,5 +1,5 @@
# OVH API credentials used by Certbot # OVH API credentials used by Certbot
# To generate a new token, go to: https://www.ovh.com/auth/api/createToken # To generate new credentials, go to: https://www.ovh.com/auth/api/createToken
dns_ovh_endpoint = "$OVH_ENDPOINT" dns_ovh_endpoint = "$OVH_ENDPOINT"
dns_ovh_application_name = "$OVH_APPLICATION_NAME" dns_ovh_application_name = "$OVH_APPLICATION_NAME"

View File

@@ -22,7 +22,7 @@ add_header X-XSS-Protection "1;mode=block"
add_header X-Content-Type-Options "nosniff" always; add_header X-Content-Type-Options "nosniff" always;
add_header X-Permitted-Cross-Domain-Policies "none" always; add_header X-Permitted-Cross-Domain-Policies "none" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always; add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Content-Security-Policy "default-src 'self' 'unsafe-inline'; frame-ancestors 'self'; form-action 'self';" always; add_header Content-Security-Policy "default-src 'self' 'unsafe-inline' data:; frame-ancestors 'self'; form-action 'self';" always;
add_header Cross-Origin-Opener-Policy "same-origin" always; add_header Cross-Origin-Opener-Policy "same-origin" always;
add_header Cross-Origin-Resource-Policy "same-site" always; add_header Cross-Origin-Resource-Policy "same-site" always;
add_header Permissions-Policy "geolocation=(), camera=(), microphone=()" always; add_header Permissions-Policy "geolocation=(), camera=(), microphone=()" always;

View File

@@ -50,7 +50,8 @@ fi
# Restart services # Restart services
systemctl daemon-reload systemctl daemon-reload
systemctl reenable --now nginx.service certbot-renew.timer systemctl reenable nginx.service certbot-renew.timer
systemctl restart nginx.service certbot-renew.timer
%postun %postun
# Remove folders after uninstall # Remove folders after uninstall
@@ -62,7 +63,7 @@ fi
%files %files
%attr(644, root, root) %{_sysconfdir}/nginx/conf.d/0_security.conf %attr(644, root, root) %{_sysconfdir}/nginx/conf.d/0_security.conf
%attr(644, root, root) %{_sysconfdir}/nginx/conf.d/default.conf %attr(644, root, root) %{_sysconfdir}/nginx/conf.d/z_default.conf
%attr(755, root, root) %dir %{_sysconfdir}/certbot %attr(755, root, root) %dir %{_sysconfdir}/certbot
%attr(600, root, root) %{_sysconfdir}/certbot/ovh.ini %attr(600, root, root) %{_sysconfdir}/certbot/ovh.ini