Compare commits

...

4 Commits

Author SHA1 Message Date
Nicolas Arenas 3344157d6b Deploy ssh keys to repo
oginstaller/pipeline/head There was a failure building this commit Details
2025-02-06 12:22:09 +01:00
Nicolas Arenas 22650060af Ensure download repo to exist 2025-02-06 12:11:41 +01:00
Nicolas Arenas 4634061f41 Fix env.json owner 82 82 to allow changes in container 2025-02-06 12:09:46 +01:00
Nicolas Arenas 20a338a0d6 Fixing env.json permissions 2025-02-06 12:05:43 +01:00
3 changed files with 13 additions and 8 deletions

View File

@ -123,7 +123,7 @@ do
mkdir -p $component_dir/etc
cp $component_dir/repo/.env $component_dir/etc/
cp $component_dir/repo/env.json $component_dir/etc/
mkdir -p $component_dir/etc/
chown 82:82 $component_dir/etc/
mkdir -p $component_dir/bin/
cp $CONFIGS_DIR/provision_ogcore.sh $component_dir/bin/
chmod 755 $component_dir/bin/provision_ogcore.sh

View File

@ -3,14 +3,8 @@
set -x
CONF_DIR=/opt/opengnsys/ogCore/etc/
cd /opt/opengnsys/ogCore/repo/
cd /opt/opengnsys/ogCore/repo/ || exit
# Preparar el fichero .yaml
# CONF_DIR=/opt/opengnsys/ogCore/etc/
# mkdir -p $CONF_DIR
# Copiar el fichero de configuración a CONF_DIR
# cp docker-compose-deploy.yml $CONF_DIR/
if [ -f /opt/opengnsys/ogCore/installer/.deployed ]; then
echo "ogCore ya instalado"
@ -48,5 +42,6 @@ curl -k -L --location 'https://localhost:8443/users' \
--header "Authorization: Bearer $bearer" \
--data "{ \"username\": \"$adminuser\", \"password\": \"$adminpass\", \"roles\": [\"ROLE_SUPER_ADMIN\"] }"
touch /opt/opengnsys/ogCore/installer/.deployed
exit 0

View File

@ -37,10 +37,20 @@ add_user_ogrepository() {
echo "User ogrepository does not exist, creating it"
useradd -m -d $OGUSER_HOME -r -s /bin/bash $OGUSER
fi
if [ ! -d $OGUSER_HOME/.ssh ] ; then
mkdir -p $OGUSER_HOME/.ssh
cp ssh-keys/opengnsys $OGUSER_HOME/.ssh/id_ed25519
cp ssh-keys/opengnsys.pub $OGUSER_HOME/.ssh/id_ed25519.pub
cat ssh-keys/opengnsys.pub >> $OGUSER_HOME/.ssh/authorized_keys
chown -R $OGUSER:$OGUSER $OGUSER_HOME/.ssh
chmod 0600 $OGUSER_HOME/.ssh/*
fi
if [ ! -f /etc/sudoers.d/$OGUSER ]; then
echo "User $OGUSER does not have sudo permissions, adding it"
echo "$OGUSER ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/"$OGUSER"
fi
}