Merge branch 'postgresql' into 'antifascista'
postgresql Closes #12 See merge request sutty/haini.sh!17
This commit is contained in:
commit
dedadcfa12
3 changed files with 40 additions and 0 deletions
28
bin/postgresql
Normal file
28
bin/postgresql
Normal file
|
@ -0,0 +1,28 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
export PGVER="${PGVER:-13}"
|
||||
export PGBASE="${PGBASE:-/var/lib/postgresql}"
|
||||
export PGDATA="${PGDATA:-$PGBASE/$PGVER/data}"
|
||||
export PGLANG="${PGLANG:-en_US.utf8}"
|
||||
|
||||
case $1 in
|
||||
stop) pg_ctl stop -D "${PGDATA}" ;;
|
||||
reload) pg_ctl reload -D "${PGDATA}" ;;
|
||||
*)
|
||||
pid=/tmp/postgresql.pid
|
||||
log=${PGDATA}/postgresql.log
|
||||
|
||||
if test ! -f "${PGDATA}/PG_VERSION" ; then
|
||||
/usr/bin/initdb --locale "${PGLANG}" -E UTF8 -D "${PGDATA}"
|
||||
|
||||
echo "host all all samenet trust" >> "${PGDATA}/pg_hba.conf"
|
||||
|
||||
echo "listen_addresses = '*'" >> "${PGDATA}/postgresql.conf"
|
||||
echo "external_pid_file = '${pid}'" >> "${PGDATA}/postgresql.conf"
|
||||
fi
|
||||
|
||||
rm -f "${pid}"
|
||||
daemonize -c "${PGDATA}" -o "${log}" -a -e "${log}" /usr/bin/postgres
|
||||
;;
|
||||
esac
|
9
haini.sh
9
haini.sh
|
@ -34,6 +34,7 @@ correr() {
|
|||
RAILS_ENV="${RAILS_ENV:-development}" \
|
||||
JEKYLL_ENV="${JEKYLL_ENV:-development}" \
|
||||
EDITOR="nano" \
|
||||
PAGER="less -niSFX" \
|
||||
bwrap \
|
||||
--unshare-user-try \
|
||||
--unshare-ipc \
|
||||
|
@ -74,6 +75,9 @@ crear_entorno() {
|
|||
|
||||
# Descargar y extraer Alpine
|
||||
test -f "$ENTORNO/etc/os-release" || ${download} "${ALPINE_URL}" | tar xz --directory "$ENTORNO"
|
||||
# Configurar los repositorios de Sutty
|
||||
grep -q sutty "$ENTORNO/etc/apk/repositories" || echo "https://alpine.sutty.nl/alpine/v${ALPINE%\.*}/sutty" >> "$ENTORNO/etc/apk/repositories"
|
||||
test -f "$ENTORNO/etc/apk/keys/alpine@sutty.nl-5ea884cd.rsa.pub" || wget https://alpine.sutty.nl/alpine/sutty.pub -O "$ENTORNO/etc/apk/keys/alpine@sutty.nl-5ea884cd.rsa.pub"
|
||||
|
||||
# Instalar las dependencias solo si cambiaron
|
||||
if test "$ENTORNO/etc/apk/world" -ot "$DIR/packages"; then
|
||||
|
@ -95,6 +99,11 @@ crear_entorno() {
|
|||
|
||||
# Resaltado de sintaxis en nano
|
||||
grep -q "^include " "$ENTORNO/etc/nanorc" || echo "include \"/usr/share/nano/*.nanorc\"" >> "$ENTORNO/etc/nanorc"
|
||||
|
||||
# Instalar scripts
|
||||
for script in "$DIR/bin/"*; do
|
||||
install -m 755 "$script" "$ENTORNO/usr/local/bin/${script##*/}"
|
||||
done
|
||||
}
|
||||
|
||||
crear_entorno
|
||||
|
|
3
packages
3
packages
|
@ -1,4 +1,5 @@
|
|||
bash
|
||||
daemonize
|
||||
ffmpeg
|
||||
file
|
||||
git
|
||||
|
@ -13,6 +14,8 @@ nano-syntax
|
|||
ncurses-terminfo
|
||||
nginx
|
||||
nodejs
|
||||
postgresql
|
||||
postgresql-contrib
|
||||
postgresql-libs
|
||||
py3-brotli
|
||||
py3-cffi
|
||||
|
|
Loading…
Reference in a new issue