Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5bf84b3719 | |||
| c55e4199e8 | |||
| fde6b4b621 | |||
| 98dbfe8da5 | |||
| 94e6f55e4d | |||
| ade97d52e6 | |||
| a5bfa7de35 | |||
| abb5fbf448 | |||
| d3d2e35f48 | |||
| 3f82dedad2 | |||
| c9c870b0b5 | |||
| 0ac3985acc |
@@ -17,4 +17,4 @@ jobs:
|
||||
- name: Build tarball
|
||||
run: make tarball
|
||||
- name: Build rpm file
|
||||
run: rpmbuild -ba %(make name).spec
|
||||
run: rpmbuild -ba "$(make name).spec"
|
||||
|
||||
6
Makefile
6
Makefile
@@ -30,9 +30,9 @@ build_arch:
|
||||
|
||||
.PHONY: install
|
||||
install:
|
||||
install --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 --target-directory=$(DESTDIR)$(RPM_UNITDIR)/postgresql.service.d filrs/systemd/postgres.conf
|
||||
install --mode=755 --directory $(DESTDIR)$(RPM_SYSCONFDIR)/postgres $(DESTDIR)$(RPM_UNITDIR)/postgresql.service.d
|
||||
install --mode=644 --target-directory=$(DESTDIR)$(RPM_SYSCONFDIR)/postgres files/postgres/postgresql.conf files/postgres/pg_hba.conf
|
||||
install --mode=644 --target-directory=$(DESTDIR)$(RPM_UNITDIR)/postgresql.service.d files/systemd/postgres.conf
|
||||
|
||||
$(RPM_TARBALL_PATH): *
|
||||
git archive --format=tar.gz \
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
# 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
|
||||
# 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'
|
||||
@@ -1,2 +1,3 @@
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=/usr/bin/postgres -D ${PGDATA} -c config_file=/etc/postgres/postgresql.conf
|
||||
|
||||
@@ -5,7 +5,7 @@ Version: %(make version)
|
||||
Release: %(make release)
|
||||
Summary: Netoik Reverse Proxy
|
||||
License: MIT
|
||||
URL: https://git.netoik.io/samuel/netoik-rp
|
||||
URL: https://git.netoik.io/samuel/%(make name)
|
||||
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
Buildarch: %(make build_arch)
|
||||
@@ -22,14 +22,25 @@ Install the database management system called postgresql with a predefined confi
|
||||
%make_install
|
||||
|
||||
%post
|
||||
# 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
|
||||
|
||||
# Restart services
|
||||
systemctl daemon-reload
|
||||
systemctl reenable --now postgresql.service
|
||||
|
||||
%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/pg_hba.conf
|
||||
|
||||
%dir %attr(755, root, root) %{_unitdir}/postgresql.service.d
|
||||
%attr(644, root, root) %{_unitdir}/postgresql.service.d/postgres.conf
|
||||
|
||||
%changelog
|
||||
|
||||
Reference in New Issue
Block a user