Compare commits
2 Commits
033ecb17e7
...
237ccf6675
Author | SHA1 | Date |
---|---|---|
|
237ccf6675 | |
|
b7c3523b10 |
|
@ -171,12 +171,13 @@ do
|
|||
git_checkout_release "$OGREPOSITORY_REPO" "$component_dir/repo" "$OGCORE_BRANCH"
|
||||
cp $CONFIGS_DIR/$config_file $component_dir/installer/config.json
|
||||
REPO_IP=$(jq -r '.ogrepository_ip' $component_dir/installer/config.json)
|
||||
CORE_IP=$(jq -r '.ogcore_ip' $component_dir/installer/config.json)
|
||||
OGUSER=$(jq -r '.ogrepository_samba_user' $component_dir/installer/config.json)
|
||||
OGPASS=$(jq -r '.ogrepository_samba_pass' $component_dir/installer/config.json)
|
||||
mkdir -p $component_dir/bin
|
||||
cp $CONFIGS_DIR/provision_ogrepository.sh $component_dir/bin/
|
||||
chmod 755 $component_dir/bin/provision_ogrepository.sh
|
||||
$component_dir/bin/provision_ogrepository.sh $REPO_IP $OGUSER $OGPASS $component_dir/repo
|
||||
$component_dir/bin/provision_ogrepository.sh $REPO_IP $CORE_IP $OGUSER $OGPASS $component_dir/repo
|
||||
echo - ogRepository >> /etc/issue
|
||||
;;
|
||||
*)
|
||||
|
|
|
@ -4,10 +4,11 @@ set -e
|
|||
|
||||
|
||||
REPO_IP=${1:-"127.0.0.1"}
|
||||
OGUSER=${2:-"opengnsys"}
|
||||
OGPASS=${3:-"og"}
|
||||
CORE_IP=${2:-"127.0.0.1"}
|
||||
OGUSER=${3:-"opengnsys"}
|
||||
OGPASS=${4:-"og"}
|
||||
INSTALL_DIR=/opt/opengnsys/ogrepository
|
||||
DOWNLOAD_DIR=${4:-"/tmp/ogrepository"}
|
||||
DOWNLOAD_DIR=${5:-"/tmp/ogrepository"}
|
||||
DEBIAN_FRONTEND=noninteractive
|
||||
export DEBIAN_FRONTEND
|
||||
export GIT_SSL_NO_VERIFY
|
||||
|
@ -75,6 +76,7 @@ install_files() {
|
|||
chown -R $OGUSER:$OGUSER $INSTALL_DIR
|
||||
chmod 755 $INSTALL_DIR/bin/*
|
||||
echo IPlocal="$REPO_IP" > $INSTALL_DIR/etc/ogAdmRepo.cfg
|
||||
echo IPcore="$CORE_IP" >> $INSTALL_DIR/etc/ogAdmRepo.cfg
|
||||
sudo chown $OGUSER:$OGUSER $INSTALL_DIR/etc/ogAdmRepo.cfg
|
||||
}
|
||||
|
||||
|
|
|
@ -96,9 +96,9 @@ class ComponentForm(npyscreen.ActionForm):
|
|||
return False
|
||||
return True
|
||||
|
||||
def add_password_field(self, key, name, is_confirmation=False):
|
||||
def add_password_field(self, key, name, is_confirmation=False, default_value=""):
|
||||
"""Añade un campo de contraseña con metadatos."""
|
||||
widget = self.add(npyscreen.TitlePassword, name=name)
|
||||
widget = self.add(npyscreen.TitlePassword, name=name, value=default_value)
|
||||
self.fields[key] = {
|
||||
"widget": widget,
|
||||
"is_password_field": not is_confirmation,
|
||||
|
@ -136,7 +136,7 @@ class OgCoreForm(ComponentForm):
|
|||
def configure_fields(self):
|
||||
self.fields["username"] = {"widget": self.add(npyscreen.TitleText, name="Usuario administrador (ogadmin):", value="ogadmin")}
|
||||
self.add_password_field("password", "Contraseña:")
|
||||
self.add_password_field("confirm_password", "Confirmar Contraseña:", is_confirmation=True)
|
||||
self.add_password_field("confirm_password", "Confirmar Contraseña:", is_confirmation=True, default_value="12345678")
|
||||
|
||||
class OgGuiForm(ComponentForm):
|
||||
component_name = "ogGui"
|
||||
|
@ -163,8 +163,8 @@ class OgBootForm(ComponentForm):
|
|||
self.fields["ogBoot_Dir"] = {"widget": self.add(npyscreen.TitleText, name="ogCore Dir (/opt/opengnsys/ogboot):", value="/opt/opengnsys/ogboot")}
|
||||
self.fields["ogLive_Default"] = {"widget": self.add(npyscreen.TitleText, name="ogLive por defecto:", value="ogLive-noble-6.8.0-31-generic-amd64-r20241024.8100be23_20241112")}
|
||||
self.fields["ogBootSambaUser"] = {"widget": self.add(npyscreen.TitleText, name="ogBoot Samba User (opengnsys):", value="opengnsys")}
|
||||
self.add_password_field("ogBootSambaPass", "ogBoot Samba Pass (og):")
|
||||
self.add_password_field("confirm_ogBootSambaPass", "Confirmar ogBoot Samba Pass (og):", value="og" ,is_confirmation=True)
|
||||
self.add_password_field("ogBootSambaPass", "ogBoot Samba Pass (og):", default_value="og")
|
||||
self.add_password_field("confirm_ogBootSambaPass", "Confirmar ogBoot Samba Pass (og):", is_confirmation=True, default_value="og")
|
||||
|
||||
|
||||
class OgRepositoryForm(ComponentForm):
|
||||
|
@ -174,8 +174,8 @@ class OgRepositoryForm(ComponentForm):
|
|||
self.fields["ogrepository_ip"] = {"widget": self.add(npyscreen.TitleText, name="ogRepository IP:", value="127.0.0.1")}
|
||||
self.fields["ogcore_server_ip"] = {"widget": self.add(npyscreen.TitleText, name="ogCoreserver IP(127.0.0.1):", value="127.0.0.1")}
|
||||
self.fields["ogrepository_samba_user"] = {"widget": self.add(npyscreen.TitleText, name="Samba User:", value="opengnsys")}
|
||||
self.add_password_field("ogrepository_samba_pass", "Samba Password:")
|
||||
self.add_password_field("confirm_repository_password", "Confirmar Samba Password:", value="og" ,is_confirmation=True)
|
||||
self.add_password_field("ogrepository_samba_pass", "Samba Password:", default_value="og")
|
||||
self.add_password_field("confirm_repository_password", "Confirmar Samba Password:", is_confirmation=True, default_value="og")
|
||||
|
||||
class ConfigApp(npyscreen.NPSAppManaged):
|
||||
def onStart(self):
|
||||
|
|
Loading…
Reference in New Issue