16 Commits

Author SHA1 Message Date
fe30792dbf fix: chown sock directory
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-02-23 00:16:05 +01:00
0483f61904 fix: create sock directory if not existing
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-02-23 00:05:14 +01:00
ac5a23350d fix: add systemctl restart
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-02-22 22:57:20 +01:00
5870da6249 fix: create db users after service start
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-02-22 22:42:53 +01:00
5bf84b3719 fix: add drop-in directory in spec file
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-02-22 22:35:06 +01:00
c55e4199e8 fix: postgresql conf quotes
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-02-22 22:28:21 +01:00
fde6b4b621 fix: override execstart
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-02-22 21:58:30 +01:00
98dbfe8da5 feat: add db users
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-02-22 16:24:16 +01:00
94e6f55e4d feat: create user and db
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-02-22 15:11:58 +01:00
ade97d52e6 feat: redirect logs to stderr
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-02-22 12:52:16 +01:00
a5bfa7de35 ci: fix syntax
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-02-22 00:27:38 +01:00
abb5fbf448 ci: fix syntax 2026-02-22 00:23:29 +01:00
d3d2e35f48 fix: files mode 2026-02-22 00:19:14 +01:00
3f82dedad2 fix: typo makefile 2026-02-22 00:11:50 +01:00
c9c870b0b5 fix: add postgres files
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-02-22 00:10:25 +01:00
0ac3985acc fix: file names 2026-02-22 00:09:02 +01:00
6 changed files with 36 additions and 9 deletions

View File

@@ -17,4 +17,4 @@ jobs:
- name: Build tarball - name: Build tarball
run: make tarball run: make tarball
- name: Build rpm file - name: Build rpm file
run: rpmbuild -ba %(make name).spec run: rpmbuild -ba "$(make name).spec"

View File

@@ -30,9 +30,9 @@ build_arch:
.PHONY: install .PHONY: install
install: install:
install --directory $(DESTDIR)$(RPM_SYSCONFDIR)/postgres $(DESTDIR)$(RPM_UNITDIR)/postgresql.service.d install --mode=755 --directory $(DESTDIR)$(RPM_SYSCONFDIR)/postgres $(DESTDIR)$(RPM_UNITDIR)/postgresql.service.d
install --target-directory=$(DESTDIR)$(RPM_SYSCONFDIR)/postgres files/postgres/postgresql.conf files/nginx/default.conf install --mode=644 --target-directory=$(DESTDIR)$(RPM_SYSCONFDIR)/postgres files/postgres/postgresql.conf files/postgres/pg_hba.conf
install --target-directory=$(DESTDIR)$(RPM_UNITDIR)/postgresql.service.d filrs/systemd/postgres.conf install --mode=644 --target-directory=$(DESTDIR)$(RPM_UNITDIR)/postgresql.service.d files/systemd/postgres.conf
$(RPM_TARBALL_PATH): * $(RPM_TARBALL_PATH): *
git archive --format=tar.gz \ git archive --format=tar.gz \

View File

@@ -5,7 +5,7 @@
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Change pg_hba location # Change pg_hba location
hba_file = "/etc/postgres/pg_hba.conf" hba_file = '/etc/postgres/pg_hba.conf'
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
@@ -16,4 +16,14 @@ hba_file = "/etc/postgres/pg_hba.conf"
# Empty listen addresses to disable listening via TCP/IP # Empty listen addresses to disable listening via TCP/IP
# because we want only uni socket connections # because we want only uni socket connections
listen_addresses = "" listen_addresses = ''
#-------------------------------------------------------------------------------
# REPORTING AND LOGGING
# Please refer to official doc before editing this section:
# https://www.postgresql.org/docs/current/runtime-config-logging.html
#-------------------------------------------------------------------------------
# Redirect logs to stderr to be managed by journald
log_destination = 'stderr'

View File

@@ -1,2 +1,3 @@
[Service] [Service]
ExecStart=
ExecStart=/usr/bin/postgres -D ${PGDATA} -c config_file=/etc/postgres/postgresql.conf ExecStart=/usr/bin/postgres -D ${PGDATA} -c config_file=/etc/postgres/postgresql.conf

View File

@@ -5,7 +5,7 @@ Version: %(make version)
Release: %(make release) Release: %(make release)
Summary: Netoik Reverse Proxy Summary: Netoik Reverse Proxy
License: MIT License: MIT
URL: https://git.netoik.io/samuel/netoik-rp URL: https://git.netoik.io/samuel/%(make name)
Source0: %{name}-%{version}.tar.gz Source0: %{name}-%{version}.tar.gz
Buildarch: %(make build_arch) Buildarch: %(make build_arch)
@@ -22,14 +22,30 @@ Install the database management system called postgresql with a predefined confi
%make_install %make_install
%post %post
# Create sock directory if not existing
mkdir --parents --mode 755 "%{_rundir}/postgresql"
chown postgres:postgres "%{_rundir}/postgresql"
# Restart services # Restart services
systemctl daemon-reload systemctl daemon-reload
systemctl reenable --now postgresql.service systemctl reenable postgresql.service
systemctl restart postgresql.service
# Create databases and users from DB_USERS variable (separator is ",") if not existing
IFS="," read -ra users <<< "$DB_USERS";
for user in "${users[@]}"; do
if ! runuser --user=postgres -- psql --quiet --tuples-only --command='\du' | grep --invert-match postgres | grep --quiet "$user"; then
runuser --user=postgres -- createuser "$user"
runuser --user=postgres -- createdb --owner="$user" "$user"
fi
done
%files %files
%attr(755, root, root) %{_sysconfdir}/postgres %dir %attr(755, root, root) %{_sysconfdir}/postgres
%attr(644, root, root) %{_sysconfdir}/postgres/postgresql.conf %attr(644, root, root) %{_sysconfdir}/postgres/postgresql.conf
%attr(644, root, root) %{_sysconfdir}/postgres/pg_hba.conf %attr(644, root, root) %{_sysconfdir}/postgres/pg_hba.conf
%dir %attr(755, root, root) %{_unitdir}/postgresql.service.d
%attr(644, root, root) %{_unitdir}/postgresql.service.d/postgres.conf %attr(644, root, root) %{_unitdir}/postgresql.service.d/postgres.conf
%changelog %changelog