feat: first commit

This commit is contained in:
2026-02-21 22:52:41 +01:00
commit 593e896e3e
9 changed files with 146 additions and 0 deletions

2
.gitattributes vendored Normal file
View File

@@ -0,0 +1,2 @@
.gitignore export-ignore
.gitattributes export-ignore

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

@@ -0,0 +1,26 @@
name: Continuous Delivery
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
build_n_upload:
runs-on: linux
steps:
- name: Git checkout
uses: actions/checkout@v6
with:
fetch-tags: true
- name: Build tarball
run: make tarball
env:
GIT_REFERENCE: ${{ github.ref }}
- name: Build rpm package
run: rpmbuild -ba "$(make name).spec"
- name: Upload rpm package
run: make upload
env:
GIT_PACKAGES_USERNAME: ${{ vars.GIT_PACKAGES_USERNAME }}
GIT_PACKAGES_TOKEN: ${{ secrets.GIT_PACKAGES_TOKEN }}

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

@@ -0,0 +1,20 @@
name: Continuous Integration
on:
push:
branches:
- main
jobs:
lint_n_build:
runs-on: linux
steps:
- name: Git checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- name: Build tarball
run: make tarball
- name: Build rpm file
run: rpmbuild -ba netoik-rp.spec

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
*.swp
*.env
/.idea

18
LICENSE Normal file
View File

@@ -0,0 +1,18 @@
MIT License
Copyright (c) 2025 samuel
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.

49
Makefile Normal file
View File

@@ -0,0 +1,49 @@
NAME = netoik-db
VERSION = $(shell git describe --abbrev=0)
RELEASE = $(shell git rev-parse --short HEAD)
REFERENCE = $(if $(GIT_REFERENCE),$(GIT_REFERENCE),$(shell git branch --show-current))
BUILD_ARCH = noarch
RPM_RPMDIR = $(shell rpm --eval '%{_rpmdir}')
RPM_SBINDIR = $(shell rpm --eval '%{_sbindir}')
RPM_SOURCEDIR = $(shell rpm --eval '%{_sourcedir}')
RPM_SYSCONFDIR = $(shell rpm --eval '%{_sysconfdir}')
RPM_UNITDIR = $(shell rpm --eval '%{_unitdir}')
RPM_TARBALL_PATH = $(RPM_SOURCEDIR)/$(NAME)-$(VERSION).tar.gz
RPM_BUILD_PATH = $(RPM_RPMDIR)/$(BUILD_ARCH)/$(NAME)-$(VERSION)-$(RELEASE).$(BUILD_ARCH).rpm
.PHONY: name
name:
@echo "$(NAME)"
.PHONY: version
version:
@echo "$(VERSION)"
.PHONY: release
release:
@echo "$(RELEASE)"
.PHONY: build_arch
build_arch:
@echo "$(BUILD_ARCH)"
.PHONY: install
install:
install --directory $(DESTDIR)$(RPM_SYSCONFDIR)/postgres
install --target-directory=$(DESTDIR)$(RPM_SYSCONFDIR)/postgres files/postgres/postgresql.conf files/nginx/default.conf
$(RPM_TARBALL_PATH): *
git archive --format=tar.gz \
--output="$@" \
--prefix="$(NAME)-$(VERSION)/" \
--verbose \
"$(REFERENCE)"
.PHONY: tarball
tarball: $(RPM_TARBALL_PATH)
.PHONY: upload
upload:
curl --fail-with-body --upload-file "$(RPM_BUILD_PATH)" --user "$(GIT_PACKAGES_USERNAME):$(GIT_PACKAGES_TOKEN)" https://git.netoik.io/api/packages/$(GIT_PACKAGES_USERNAME)/rpm/upload

3
README.md Normal file
View File

@@ -0,0 +1,3 @@
# Netoïk Database ![badge](https://git.netoik.io/samuel/netoik-db/actions/workflows/ci.yaml/badge.svg)
Build an RPM package which will install the DBMS called Postgresql with custom configuration.

View File

@@ -0,0 +1,6 @@
# Before editing this file, please refer to official doc:
# https://www.postgresql.org/docs/current/auth-pg-hba-conf.html
# TYPE DATABASE USER ADDRESS METHOD
local sameuser all peer # Allow each unix user accessing its own db
local all postgres peer # Allow postgres user accessing all dbs

View File

@@ -0,0 +1,19 @@
#-------------------------------------------------------------------------------
# FILE LOCATIONS
# Please refer to official doc before editing this section:
# https://www.postgresql.org/docs/current/runtime-config-file-locations.html
#-------------------------------------------------------------------------------
# Change pg_hba location
hba_file = "/etc/postgres/pg_hba.conf"
#-------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
# Please refer to official doc before editing this section:
# https://www.postgresql.org/docs/current/runtime-config-connection.html
#-------------------------------------------------------------------------------
# Empty listen addresses to disable listening via TCP/IP
# because we want only uni socket connections
listen_addresses = ""