From 307c14bd03bc590196a0eddeac363427871d8275 Mon Sep 17 00:00:00 2001 From: Nicolas Arenas Date: Mon, 30 Jun 2025 13:02:35 +0200 Subject: [PATCH 1/3] refs #2356, modify setsmbpass for using new output format from oglivecli --- bin/setsmbpass | 47 +++-------------------------------------------- 1 file changed, 3 insertions(+), 44 deletions(-) diff --git a/bin/setsmbpass b/bin/setsmbpass index 85d6285..26b0d93 100755 --- a/bin/setsmbpass +++ b/bin/setsmbpass @@ -1,8 +1,7 @@ #!/bin/bash PROG=$(basename $0) -OPENGNSYS=${OPENGNSYS:-"/opt/ogboot"} -OGCFGFILE=$OPENGNSYS/etc/ogboot_samba.json +OPENGNSYS=${OPENGNSYS:-"/opt/opengnsys/ogboot"} SAMBAUSER="opengnsys" # Usuario por defecto. TFTPDIR=$OPENGNSYS/tftpboot INITRD=oginitrd.img @@ -18,7 +17,7 @@ fi case $# in 0) # Cambios en todos los clientes ogLive instalados. if which oglivecli &>/dev/null; then - LIST=$(oglivecli list | awk '{print $2}') + LIST=$(./oglivecli list_installed_oglives | jq -r '.installed_ogLives[].directory' | xargs -n1 basename) else LIST="ogclient" fi ;; @@ -95,42 +94,6 @@ for OGLIVE in $LIST; do sudo sed -i "s/OPTIONS=\(.*\)user=\w*\(.*\)pass=\w*\(.*\)/OPTIONS=\1user=$SAMBAUSER\2pass=$SAMBAPASS\3/" scripts/ogfunctions # TEMPORAL: solución ticket 554, actualizar cliente en caché (ogLive r3257). sudo sed -i "s/busybox reboot/reboot/" scripts/ogfunctions - # FIN CÓDIGO TEMPORAL. - # Ticket 565, preparar acceso Rsync cliente. - echo "$SAMBAPASS" | sudo tee scripts/passrsync > /dev/null - echo "Guardar tokens de seguridad" - cat < /dev/null -CLIENTID=$(jq -r .client.id $OGCFGFILE) -CLIENTSECRET=$(jq -r .client.secret $OGCFGFILE) -EOT - sudo chown ogboot:ogboot scripts/passrsync scripts/client.cfg -# pwd -# sudo find . -print > /tmp/filelist.txt -# if [ $? -ne 0 ]; then -# echo "Error: No se pudo encontrar los archivos." -# exit 5 -# fi - -# cpio -H newc -oa < /tmp/filelist.txt > /tmp/initrd.cpio -# if [ $? -ne 0 ]; then -# echo "Error: No se pudo crear el archivo CPIO." -# exit 5 -# fi -# $COMPRESS_CMD < /tmp/initrd.cpio > /tmp/initrd.cpio.gz -# if [ $? -ne 0 ]; then -# echo "Error: No se pudo comprimir el archivo CPIO." -# exit 5 -# fi -# echo "Copiando el contenido del archivo /tmp/initrd.cpio.gz al archivo /opt/opengnsys/tftpboot/ogLive-5.11.0-r20210413/oginitrd.img." -# echo $CLIENTINITRD -# dd if=/tmp/initrd.cpio.gz of=/opt/opengnsys/tftpboot/ogLive-5.11.0-r20210413/oginitrd.img -# echo "dd ejecutado correctamente" -# if [ $? -ne 0 ]; then -# echo "Error: No se pudo escribir el archivo comprimido en el destino." -# exit 5 -# fi -# echo "borrando rm /tmp/initrd.cpio /tmp/initrd.cpio.gz" -# sudo rm /tmp/initrd.cpio /tmp/initrd.cpio.gz find . | cpio -H newc -oa | gzip -9c > "$CLIENTINITRD" else echo "$PROG: Aviso: no se ha modificado la clave del cliente \"$OGLIVE\"." @@ -146,12 +109,8 @@ EOT done if [[ $CHANGES != 0 ]]; then - # Ticket 565, preparar acceso Rsync servidor. - echo "$SAMBAUSER:$SAMBAPASS" | sudo tee /etc/rsyncd.secrets > /dev/null - echo "chown debugging" - sudo chown root:root /etc/rsyncd.secrets - sudo chmod 600 /etc/rsyncd.secrets # Cambiar clave Samba. + echo "Cambiando clave samba en el servidor" echo -ne "$SAMBAPASS\n$SAMBAPASS\n" | sudo smbpasswd -a -s $SAMBAUSER echo "setsmbpass finish" else -- 2.40.1 From 9dedc8d51306eff129fcce5eec16cd9a158e1641 Mon Sep 17 00:00:00 2001 From: lgromero Date: Mon, 30 Jun 2025 11:42:06 +0200 Subject: [PATCH 2/3] refs #2355 deletes obsolete samba directory and changes postinstall to use samba-ogboot.tmpl --- debian/ogboot.postinst | 2 +- etc/samba/smb-ogboot.conf | 6 ------ etc/samba/smb-ogclient.conf | 7 ------- 3 files changed, 1 insertion(+), 14 deletions(-) delete mode 100644 etc/samba/smb-ogboot.conf delete mode 100644 etc/samba/smb-ogclient.conf diff --git a/debian/ogboot.postinst b/debian/ogboot.postinst index 345e02f..be302a2 100755 --- a/debian/ogboot.postinst +++ b/debian/ogboot.postinst @@ -153,7 +153,7 @@ configure_nginx_and_fpm() { configure_samba(){ echo "Configurando Samba" - cp /opt/opengnsys/ogboot/etc/samba/smb-ogboot.conf /etc/samba/ + cp /opt/opengnsys/ogboot/etc/smb-ogboot.conf.tmpl /etc/samba/smb-ogboot.conf sed -i "s|__OGBOOTDIR__|$OGBOOT_ROOT|g" /etc/samba/smb-ogboot.conf INCLUDE_LINE="include = /etc/samba/smb-ogboot.conf" if ! grep -q "$INCLUDE_LINE" /etc/samba/smb.conf; then diff --git a/etc/samba/smb-ogboot.conf b/etc/samba/smb-ogboot.conf deleted file mode 100644 index 9807528..0000000 --- a/etc/samba/smb-ogboot.conf +++ /dev/null @@ -1,6 +0,0 @@ -[tftpboot] - comment = OpenGnsys init files - browseable = no - writeable = no - path = __OGBOOTDIR__/tftpboot - guest ok = no diff --git a/etc/samba/smb-ogclient.conf b/etc/samba/smb-ogclient.conf deleted file mode 100644 index 8eee2dd..0000000 --- a/etc/samba/smb-ogclient.conf +++ /dev/null @@ -1,7 +0,0 @@ -[ogclient] - comment = OpenGnsys Client - browseable = no - writeable = no - locking = no - path = __OGBOOTDIR__/client - guest ok = no \ No newline at end of file -- 2.40.1 From 47b12afc634299c9360617d21dba8d54305db0e5 Mon Sep 17 00:00:00 2001 From: lgromero Date: Mon, 30 Jun 2025 11:45:02 +0200 Subject: [PATCH 3/3] refs #2355 updates changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index df56653..464aa9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.8.9] - 2024-06-30 +### Changed +- Borra directorio samba de etc y modifica postint para que copie el fichero de configuración de la plantilla de samba + ## [0.8.8] - 2024-06-27 ### Changed - Actualiza grub.exe para que soporte sistemas de particiones ext -- 2.40.1