Package build fixes

oggit
Vadim vtroshchinskiy 2025-06-04 16:48:08 +02:00 committed by Vadim Trochinsky
parent b04bf3c5b1
commit 3c2fc27e2e
2 changed files with 23 additions and 6 deletions

5
debian/changelog vendored
View File

@ -1,3 +1,8 @@
ogrepository (1.1.0) unstable; urgency=medium
* OgGit
-- Tu Nombre <tuemail@example.com> Tue, 11 Mar 2025 04:43:58 +0000
ogrepository (1.0.0+deb-packages20250311-1) unstable; urgency=medium
* First debian version

View File

@ -1,7 +1,7 @@
#!/bin/sh
set -e
set -x
set -x
. /usr/share/debconf/confmodule
@ -38,7 +38,7 @@ SAMBA_PASS="$RET"
USER="opengnsys"
# Provisionar base de datos si es necesario en caso de instalación.
# Provisionar base de datos si es necesario en caso de instalación.
# Detectar si es una instalación nueva o una actualización
@ -53,6 +53,16 @@ USER="opengnsys"
# done
# "
if [ "$1" = "configure" ] && [ -z "$2" ]; then
systemd-run --no-block /bin/bash -c "
sleep 10;
apt update -y;
for pkg in bittorrent bittornado ctorrent; do
if ! dpkg -l | grep -qw \"\$pkg\"; then
apt install -y \"\$pkg\"
fi
done
"
sed -i "s/%%OGREPOSITORY_USER%%/$SAMBA_USER/g" /etc/systemd/system/ogrepo-api.service
sed -i "s/%%OGREPOSITORY_USER%%/$SAMBA_USER/g" /etc/samba/ogrepo-smb.conf
@ -68,7 +78,7 @@ if [ "$1" = "configure" ] && [ -z "$2" ]; then
chmod 700 $OPENGNSYS_HOME/.ssh
chmod 600 $OPENGNSYS_HOME/.ssh/id_ed25519
chmod 644 $OPENGNSYS_HOME/.ssh/id_ed25519.pub
# Genera authorized_keys
# Genera authorized_keys
cat $OPENGNSYS_HOME/.ssh/id_ed25519.pub >> $OPENGNSYS_HOME/.ssh/authorized_keys
chmod 600 $OPENGNSYS_HOME/.ssh/authorized_keys
chown -R opengnsys:opengnsys $OPENGNSYS_HOME/.ssh
@ -89,11 +99,11 @@ if [ "$1" = "configure" ] && [ -z "$2" ]; then
sed -i "s/OGCOREIP/$OGCORE_IP/g" /opt/opengnsys/ogrepository/etc/ogAdmRepo.cfg
# Copiar sudoers file ogrepository/etc/opengnsys-repository
cp /opt/opengnsys/ogrepository/etc/opengnsys-repository /etc/sudoers.d/opengnsys
cp /opt/opengnsys/ogrepository/etc/opengnsys-repository /etc/sudoers.d/opengnsys
elif [ "$1" = "configure" ] && [ -n "$2" ]; then
echo "Actualización desde la versión $2"
# Recopy static files without configuration
cp /opt/opengnsys/ogrepository/etc/opengnsys-repository /etc/sudoers.d/opengnsys-repository
# Recopy static files without configuration
cp /opt/opengnsys/ogrepository/etc/opengnsys-repository /etc/sudoers.d/opengnsys-repository
OPENGNSYS_HOME=$(getent passwd opengnsys | cut -d: -f6)
# Create .ssh directory
mkdir -p $OPENGNSYS_HOME/.ssh
@ -115,8 +125,10 @@ fi
# Cambiar la propiedad de los archivos al usuario especificado
chown opengnsys:www-data /opt/opengnsys/
chown -R opengnsys:www-data /opt/opengnsys/ogrepository
chmod 755 /opt/opengnsys
chmod 755 /opt/opengnsys/ogrepository/bin/*
# Install http server stuff
# Reiniciar servicios si es necesario
# systemctl restart nombre_del_servicio