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}" \
|
RAILS_ENV="${RAILS_ENV:-development}" \
|
||||||
JEKYLL_ENV="${JEKYLL_ENV:-development}" \
|
JEKYLL_ENV="${JEKYLL_ENV:-development}" \
|
||||||
EDITOR="nano" \
|
EDITOR="nano" \
|
||||||
|
PAGER="less -niSFX" \
|
||||||
bwrap \
|
bwrap \
|
||||||
--unshare-user-try \
|
--unshare-user-try \
|
||||||
--unshare-ipc \
|
--unshare-ipc \
|
||||||
|
@ -74,6 +75,9 @@ crear_entorno() {
|
||||||
|
|
||||||
# Descargar y extraer Alpine
|
# Descargar y extraer Alpine
|
||||||
test -f "$ENTORNO/etc/os-release" || ${download} "${ALPINE_URL}" | tar xz --directory "$ENTORNO"
|
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
|
# Instalar las dependencias solo si cambiaron
|
||||||
if test "$ENTORNO/etc/apk/world" -ot "$DIR/packages"; then
|
if test "$ENTORNO/etc/apk/world" -ot "$DIR/packages"; then
|
||||||
|
@ -95,6 +99,11 @@ crear_entorno() {
|
||||||
|
|
||||||
# Resaltado de sintaxis en nano
|
# Resaltado de sintaxis en nano
|
||||||
grep -q "^include " "$ENTORNO/etc/nanorc" || echo "include \"/usr/share/nano/*.nanorc\"" >> "$ENTORNO/etc/nanorc"
|
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
|
crear_entorno
|
||||||
|
|
3
packages
3
packages
|
@ -1,4 +1,5 @@
|
||||||
bash
|
bash
|
||||||
|
daemonize
|
||||||
ffmpeg
|
ffmpeg
|
||||||
file
|
file
|
||||||
git
|
git
|
||||||
|
@ -13,6 +14,8 @@ nano-syntax
|
||||||
ncurses-terminfo
|
ncurses-terminfo
|
||||||
nginx
|
nginx
|
||||||
nodejs
|
nodejs
|
||||||
|
postgresql
|
||||||
|
postgresql-contrib
|
||||||
postgresql-libs
|
postgresql-libs
|
||||||
py3-brotli
|
py3-brotli
|
||||||
py3-cffi
|
py3-cffi
|
||||||
|
|
Loading…
Reference in a new issue