From c0f79397dd75e03a7a40303f82926e8187697d07 Mon Sep 17 00:00:00 2001 From: M.Gergo Date: Fri, 8 Mar 2019 23:32:47 +0100 Subject: Rev: 4455 --- .../install/install.d/05env.sh | 17 +++ .../install/install.d/15createconfig.sh | 68 ++++++++++++ .../install/install.d/35createdatabases.sh | 114 +++++++++++++++++++++ .../install/install.d/40binary.sh | 25 +++++ .../install/install.d/45intezmeny.sh | 68 ++++++++++++ .../install/install.d/47tanev.sh | 60 +++++++++++ .../install/install.d/50linker.sh | 53 ++++++++++ .../install/install.d/55tex.sh | 13 +++ .../install/install.d/60portal.sh | 90 ++++++++++++++++ .../install/mayor-installer-sulix/ldap/group.lidf | 32 ++++++ .../install/mayor-installer-sulix/ldap/user.ldif | 49 +++++++++ mayor-orig/mayor-installer-sulix/install/setup | 38 +++++++ 12 files changed, 627 insertions(+) create mode 100755 mayor-orig/mayor-installer-sulix/install/install.d/05env.sh create mode 100755 mayor-orig/mayor-installer-sulix/install/install.d/15createconfig.sh create mode 100755 mayor-orig/mayor-installer-sulix/install/install.d/35createdatabases.sh create mode 100755 mayor-orig/mayor-installer-sulix/install/install.d/40binary.sh create mode 100755 mayor-orig/mayor-installer-sulix/install/install.d/45intezmeny.sh create mode 100755 mayor-orig/mayor-installer-sulix/install/install.d/47tanev.sh create mode 100755 mayor-orig/mayor-installer-sulix/install/install.d/50linker.sh create mode 100755 mayor-orig/mayor-installer-sulix/install/install.d/55tex.sh create mode 100755 mayor-orig/mayor-installer-sulix/install/install.d/60portal.sh create mode 100644 mayor-orig/mayor-installer-sulix/install/mayor-installer-sulix/ldap/group.lidf create mode 100644 mayor-orig/mayor-installer-sulix/install/mayor-installer-sulix/ldap/user.ldif create mode 100755 mayor-orig/mayor-installer-sulix/install/setup (limited to 'mayor-orig/mayor-installer-sulix/install') diff --git a/mayor-orig/mayor-installer-sulix/install/install.d/05env.sh b/mayor-orig/mayor-installer-sulix/install/install.d/05env.sh new file mode 100755 index 00000000..90d18659 --- /dev/null +++ b/mayor-orig/mayor-installer-sulix/install/install.d/05env.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# + +cat < " + PW=`mypwgen` +# echo "$MAYORDIR/config/$file.sulix" sed -e "s/%SQLPW%/${PW}/" -e "s/%BASEDN%/${BASEDN}/" -e "s#%MAYORDIR%#${MAYORDIR}#" + cat "$MAYORDIR/config/$file.sulix" | sed -e "s/%SQLPW%/${PW}/" -e "s/%BASEDN%/${BASEDN}/" -e "s#%MAYORDIR%#${MAYORDIR}#" > "$MAYORDIR/config/$file" + echo $file + fi +done + +echo -n " module-naplo/config.php.sulix --> " +PW=`mypwgen` +PWREAD=`mypwgen` +if [ -e "$MAYORDIR/config/module-naplo/config.php" ]; then echo " module-naplo/config.php létezik."; else + cat "$MAYORDIR/config/module-naplo/config.php.sulix" | sed -e "s/%SQLPW%/${PW}/" -e "s/%SQLPWREAD%/${PWREAD}/" > "$MAYORDIR/config/module-naplo/config.php" + echo "module-naplo/config.php" +fi + +if [ -e "$MAYORDIR/config/skin-classic/naplo-config.php" ]; then echo " skin-classic/naplo-config.php létezik."; else + echo -n " skin-classic/naplo-config.php.sulix --> " + cp $MAYORDIR/config/skin-classic/naplo-config.php.sulix $MAYORDIR/config/skin-classic/naplo-config.php + echo "config/skin-classic/naplo-config.php" +fi + +# A private menü átalakítása (nincs Kilépés, Felhasználói adatok - ahol nem kell...) +if [ -e "$MAYORDIR/config/menu/private/menu-hu_HU.php" ]; then echo " menu/private/menu-hu_HU.php"; else + echo -n " menu/private/menu-hu_HU.php.sulix --> " + cp $MAYORDIR/config/menu/private/menu-hu_HU.php.sulix $MAYORDIR/config/menu/private/menu-hu_HU.php + echo "menu/private/menu-hu_HU.php" +fi + +# A public menü átalakítása (szülői bejelentkezés) +if [ -e "$MAYORDIR/config/menu/public/menu-hu_HU.php" ]; then echo " menu/public/menu-hu_HU.php"; else + echo -n " menu/public/menu-hu_HU.php.sulix --> " + cp $MAYORDIR/config/menu/public/menu-hu_HU.php.sulix $MAYORDIR/config/menu/public/menu-hu_HU.php + echo "menu/public/menu-hu_HU.php" +fi + +# A parent menü átalakítása (utolsó két menüpont törlése) +if [ -e "$MAYORDIR/config/menu/parent/menu-hu_HU.php" ]; then echo " menu/parent/menu-hu_HU.php"; else + echo -n " menu/parent/menu-hu_HU.php.sulix --> " + cp $MAYORDIR/config/menu/parent/menu-hu_HU.php.sulix $MAYORDIR/config/menu/parent/menu-hu_HU.php + echo "menu/parent/menu-hu_HU.php" +fi + +# IFRAME-be ágyazás engedélyezése +if [ -e "$MAYORDIR/config/skin-sulix/config.php" ]; then echo " skin-sulix/config.php"; else + echo -n " skin-sulix/config.php.sulix --> " + cp $MAYORDIR/config/skin-sulix/config.php.sulix $MAYORDIR/config/skin-sulix/config.php + echo "skin-sulix/config.php" +fi + diff --git a/mayor-orig/mayor-installer-sulix/install/install.d/35createdatabases.sh b/mayor-orig/mayor-installer-sulix/install/install.d/35createdatabases.sh new file mode 100755 index 00000000..2ca1a258 --- /dev/null +++ b/mayor-orig/mayor-installer-sulix/install/install.d/35createdatabases.sh @@ -0,0 +1,114 @@ +#!/bin/bash +# + +cat < mayor-login.sql +DB=`grep db $MAYORDIR/config/parent-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` +USER=`grep user $MAYORDIR/config/parent-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` +PW=`grep pw $MAYORDIR/config/parent-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` +cat $MAYORDIR/install/base/mysql/mayor-auth.sql | sed -e "s/%MYSQL_AUTH_DB%/$DB/g" -e "s/%MYSQL_AUTH_USER%/$USER/g" \ + -e "s/%MYSQL_AUTH_PW%/$PW/g" > mayor-parent.sql + +# A private hozzáférési szint LDAP-ot használ!! +#DB=`grep db $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` +#USER=`grep 'mysql user' $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` +#PW=`grep pw $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` +#cat $MAYORDIR/install/base/mysql/mayor-auth.sql | sed -e "s/%MYSQL_AUTH_DB%/$DB/g" -e "s/%MYSQL_AUTH_USER%/$USER/g" \ +# -e "s/%MYSQL_AUTH_PW%/$PW/g" > mayor-private.sql + +DB=`grep db $MAYORDIR/config/module-naplo/config.php | grep naplo_base | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g"` +USER=`egrep 'userWrite.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g"` +USERREAD=`egrep 'userRead.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g"` +PW=`egrep 'pwWrite.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g"` +PWREAD=`egrep 'pwRead.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g"` +cat $MAYORDIR/install/module-naplo/mysql/base.sql | sed -e "s/%MYSQL_NAPLO_DB%/$DB/g" -e "s/%MYSQL_NAPLO_USER%/$USER/g" \ + -e "s/%MYSQL_NAPLO_PW%/$PW/g" -e "s/%MYSQL_NAPLO_USER_READ%/$USERREAD/g" \ + -e "s/%MYSQL_NAPLO_PW_READ%/$PWREAD/g" > base.sql + +# A private hozzáférési szint LDAP-ot használ!! +# DB=`grep db $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` +#cat $MAYORDIR/install/base/mysql/private-users.sql | sed -e "s/%MYSQL_PRIVATE_DB%/$DB/g" > private-users.sql +#cat $MAYORDIR/install/module-naplo/mysql/naplo-users.sql | sed -e "s/%MYSQL_PRIVATE_DB%/$DB/g" > naplo-users.sql + +echo " A létrejött sql fileok:" +FILES=`ls *.sql` +for f in $FILES +do + echo " * ${f}"; +done; +echo -e "\n" + +if [ ! -e $MAYORDIR/config/main.conf ]; then + cat $MAYORDIR/config/main.conf.sulix | sed -e s/%SQLPW%/$MYSQLROOTPW/ -e s/%BASEDN%/$BASEDN/g > $MAYORDIR/config/main.conf + chmod 600 $MAYORDIR/config/main.conf +fi + +if [ "$MYSQLROOTPW" != "" ]; then MYSQLROOTPW="-p$MYSQLROOTPW"; fi +cat $TMPDIR/mysql/mayor-login.sql | mysql $MYSQLROOTPW --user=root --default-character-set=utf8 +cat $TMPDIR/mysql/mayor-parent.sql | mysql $MYSQLROOTPW --user=root --default-character-set=utf8 + +# A private hozzáférési szint LDAP-ot használ!! +#cat $TMPDIR/mysql/mayor-private.sql | mysql $MYSQLROOTPW --user=root --default-character-set=utf8 +#cat $TMPDIR/mysql/private-users.sql | mysql $MYSQLROOTPW --user=root --default-character-set=utf8 +#cat $TMPDIR/mysql/naplo-users.sql | mysql $MYSQLROOTPW --user=root --default-character-set=utf8 + +cat $TMPDIR/mysql/base.sql | mysql $MYSQLROOTPW --user=root --default-character-set=utf8 diff --git a/mayor-orig/mayor-installer-sulix/install/install.d/40binary.sh b/mayor-orig/mayor-installer-sulix/install/install.d/40binary.sh new file mode 100755 index 00000000..ab6ac346 --- /dev/null +++ b/mayor-orig/mayor-installer-sulix/install/install.d/40binary.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# + +cat < $TMPDIR/mysql/intezmeny.sql + +insert into $DB.intezmeny (OMKod, rovidNev, nev, alapertelmezett) VALUES ('$OMKOD','$ROVID','$INTEZMENYNEV',1); +create database intezmeny_$ROVID character set utf8 collate utf8_hungarian_ci; +grant select,execute on intezmeny_$ROVID.* to '$USERREAD'@'localhost'; +grant all on intezmeny_$ROVID.* to '$USER'@'localhost'; +use intezmeny_$ROVID; + +EOF + +#if [ "$MYSQLROOTPW" == "" ]; then +# read -p " A mysql root jelszó (a begépelt szöveg nem látszik!): " -s MYSQLROOTPW +#fi + +if [ "$MYSQLROOTPW" != "" ]; then MYSQLROOTPW="-p$MYSQLROOTPW"; fi + +cat $TMPDIR/mysql/intezmeny.sql $MAYORDIR/install/module-naplo/mysql/intezmeny.sql | mysql $MYSQLROOTPW $INTEZMENYDB --default-character-set=utf8 + diff --git a/mayor-orig/mayor-installer-sulix/install/install.d/47tanev.sh b/mayor-orig/mayor-installer-sulix/install/install.d/47tanev.sh new file mode 100755 index 00000000..f529bc9d --- /dev/null +++ b/mayor-orig/mayor-installer-sulix/install/install.d/47tanev.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# + +cat < $TMPDIR/mysql/tanev.sql + +create database $DB character set utf8 collate utf8_hungarian_ci; +grant select,execute on $DB.* to '$USERREAD'@'localhost'; +grant all on $DB.* to '$USER'@'localhost'; + +update $INTEZMENYDB.szemeszter SET statusz='aktív' where tanev=$TANEV; + +use $DB; + +EOF + +#if [ "$MYSQLROOTPW" == "" ]; then +# read -p " A mysql root jelszó (a begépelt szöveg nem látszik!): " -s MYSQLROOTPW +#fi + +if [ "$MYSQLROOTPW" != "" ]; then MYSQLROOTPW="-p$MYSQLROOTPW"; fi + +cat $TMPDIR/mysql/tanev.sql $MAYORDIR/install/module-naplo/mysql/tanev.sql | sed -e s/%DB%/$INTEZMENYDB/g | mysql $MYSQLROOTPW $INTEZMENYDB --default-character-set=utf8 + diff --git a/mayor-orig/mayor-installer-sulix/install/install.d/50linker.sh b/mayor-orig/mayor-installer-sulix/install/install.d/50linker.sh new file mode 100755 index 00000000..96d17007 --- /dev/null +++ b/mayor-orig/mayor-installer-sulix/install/install.d/50linker.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +cat < $MAYORDIR/www/policy/$POLICY/$file" + ln -s $MAYORDIR/www/policy/private/$file $MAYORDIR/www/policy/$POLICY/$file + else + echo " Hiányzó file: $MAYORDIR/www/policy/private/$file" + fi + else + echo " [OK] A file már létezik: " $file + fi + done + done +done diff --git a/mayor-orig/mayor-installer-sulix/install/install.d/55tex.sh b/mayor-orig/mayor-installer-sulix/install/install.d/55tex.sh new file mode 100755 index 00000000..c0886c08 --- /dev/null +++ b/mayor-orig/mayor-installer-sulix/install/install.d/55tex.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# +cat < " + PW=`mypwgen` + if [ "$ROVID" = "" ]; then + ROVID="demo" + fi + cat "$MAYORDIR/config/$file.sulix" | sed -e "s/%SQLPW%/$PW/" -e "s/demo/${ROVID}/" > "$MAYORDIR/config/$file" + echo $file +fi + +echo -e "\n SQL file létrehozása... " +if [ ! -d $TMPDIR/mysql ]; then + mkdir -p $TMPDIR/mysql +fi +cd $TMPDIR/mysql +PDB=`grep db $MAYORDIR/config/$file | sed -e "s/.*=\ *['\"]//g" -e "s/['\"];//g"` +USER=`grep user $MAYORDIR/config/$file | sed -e "s/.*=\ *['\"]//g" -e "s/['\"];//g"` +PW=`grep pw $MAYORDIR/config/$file | sed -e "s/.*=\ *['\"]//g" -e "s/['\"];//g"` + +cat $MAYORDIR/install/mayor-portal/mysql/mayor-portal.sql | sed \ + -e "s/%MYSQL_PORTAL_DB%/$PDB/g" \ + -e "s/%MYSQL_PORTAL_USER%/$USER/g" \ + -e "s/%MYSQL_PORTAL_PW%/$PW/g" > mayor-portal.sql + +# Ezek LDAP-ból jönnének!!! +#DB=`grep db $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` +#cat $MAYORDIR/install/mayor-portal/mysql/portal-init.sql | sed \ +# -e "s/%MYSQL_PRIVATE_DB%/$DB/g" \ +# -e "s/%MYSQL_PORTAL_DB%/$PDB/g" > portal-init.sql + + +#if [ "$MYSQLROOTPW" == "" ]; then +# read -p " A mysql root jelszó (a begépelt szöveg nem látszik!): " -s MYSQLROOTPW +#fi + +if [ "$MYSQLROOTPW" != "" ]; then MYSQLROOTPW="-p$MYSQLROOTPW"; fi +#cat $TMPDIR/mysql/mayor-portal.sql $TMPDIR/mysql/portal-init.sql | mysql -p$MYSQLROOTPW --user=root --default-character-set=utf8 +cat $TMPDIR/mysql/mayor-portal.sql | mysql $MYSQLROOTPW --user=root --default-character-set=utf8 + +echo "" +for file in private-conf.php parent-conf.php public-conf.php; do + echo -n " $file ... " + sed -i.60portal -e "s/^[ \t]*\$DEFAULT_PSF\[\(.*\)\]\(.*\)/\/\/\t\$DEFAULT_PSF\[\1\]\2\n\t\$DEFAULT_PSF\[\1\] = array('page'=>'portal', 'sub' => 'portal', 'f' => 'portal');/" $MAYORDIR/config/$file + echo ok +done + +if [ "$ROVID" != "demo" ]; then + echo -e "\nEgyedi kezdőoldalak létrehozása:" + for policy in private public parent; do + echo -n " $policy " + for skin in classic pda; do + cp $MAYORDIR/www/policy/$policy/portal/portal/portal_demo.$skin.php $MAYORDIR/www/policy/$policy/portal/portal/portal_$ROVID.$skin.php + echo -n "... " + done + echo "ok" + done +fi + diff --git a/mayor-orig/mayor-installer-sulix/install/mayor-installer-sulix/ldap/group.lidf b/mayor-orig/mayor-installer-sulix/install/mayor-installer-sulix/ldap/group.lidf new file mode 100644 index 00000000..49a852df --- /dev/null +++ b/mayor-orig/mayor-installer-sulix/install/mayor-installer-sulix/ldap/group.lidf @@ -0,0 +1,32 @@ +# naploadmin, group, vmayort.hu +dn: cn=naploadmin,ou=group,dc=vmayort,dc=hu +cn: naploadmin +displayName: naploadmin +sambaSID: S-1-5-21-3317027340-1707170271-2205240687-3095 +sambaGroupType: 2 +MailCommand: "|/usr/bin/formail -I \"From \" | sudo -u mail /usr/lib/cyrus-ima + pd/deliver -r 12D -a cyrus -m 12D" +gidNumber: 1047 +description:: T3N6dMOhbHk= +member: uid=admin,ou=people,dc=vmayort,dc=hu +memberUid: admin +phpgwAccountType: g +phpgwAccountStatus: A +phpgwAccountExpires: -1 +objectClass: top +objectClass: posixGroup +objectClass: MailRecipient +objectClass: sambaGroupMapping +objectClass: groupOfNames +objectClass: SchoolClass +objectClass: phpgwAccount +parentList: 12D-szulok +parentListAdminEmail: admin@vmayort.hu +parentListCommand: "|/usr/sbin/filter_parent_list 12D" + +# search result +search: 2 +result: 0 Success + +# numResponses: 2 +# numEntries: 1 diff --git a/mayor-orig/mayor-installer-sulix/install/mayor-installer-sulix/ldap/user.ldif b/mayor-orig/mayor-installer-sulix/install/mayor-installer-sulix/ldap/user.ldif new file mode 100644 index 00000000..5f8824f0 --- /dev/null +++ b/mayor-orig/mayor-installer-sulix/install/mayor-installer-sulix/ldap/user.ldif @@ -0,0 +1,49 @@ +# mayoradmin, People, vmayort.hu +dn: uid=mayoradmin,ou=People,dc=vmayort,dc=hu +uid: mayoradmin +sn: mayoradmin +cn: mayoradmin +uidNumber: 10000 +gidNumber: 500 +homeDirectory: /home/mayor +preferredLanguage: HU +o:: VsOhcm9zbWFqb3JpIFRlc3p0IEdpbW7DoXppdW0= +c: HU +OXGroupID: 500 +loginShell: /bin/bash +shadowLastChange: 15393 +shadowMax: 99999 +shadowMin: 0 +shadowWarning: 7 +shadowInactive: 0 +phpgwAccountType: u +phpgwAccountStatus: A +phpgwAccountExpires: -1 +OXTaskDays: 5 +OXAppointmentDays: 5 +mailEnabled: ok +internetDisabled: false +objectClass: top +objectClass: shadowAccount +objectClass: posixAccount +objectClass: person +objectClass: inetOrgPerson +objectClass: OXUserObject +objectClass: phpgwAccount +objectClass: SchoolAccount +objectClass: MailRecipient +objectClass: organizationalPerson +objectClass: sambaSamAccount +sambaSID: S-1-5-21-3317027340-1707170271-2205240687-1001 +displayName: admin +sambaLMPassword: 5918854540F40002AAD3B435B51404EE +sambaNTPassword: F05F2E35765692F94D23CC3F3691C94E +sambaPasswordHistory: 00000000000000000000000000000000000000000000000000000000 + 00000000 +sambaPwdLastSet: 1330016069 +sambaAcctFlags: [U ] +mailDomain: vmayort.hu +imapServer: mailserver.vmayort.hu +smtpServer: mailserver.vmayort.hu +imapPort: 143 +sievePort: 4190 diff --git a/mayor-orig/mayor-installer-sulix/install/setup b/mayor-orig/mayor-installer-sulix/install/setup new file mode 100755 index 00000000..a293dab6 --- /dev/null +++ b/mayor-orig/mayor-installer-sulix/install/setup @@ -0,0 +1,38 @@ +#!/bin/bash +clear +echo "-------------------------------------------" +echo " MaYoR Setup " +echo "-------------------------------------------" + +MAYORDIR="/srv/mayor" +TMPDIR="/tmp" +TGZDIR="/root/mayor/tgz" +MYSQLROOTPW=$(tdbdump /var/lib/samba/private/secrets.tdb | grep -A 2 LDAP_BIND_PW | grep data | sed -e 's/\\00"//' -e 's/^.*"//') +VERSION="current" +SCHOOLSERVERCONF="/etc/sysconfig/schoolserver" +export SCHOOLSERVERCONF +export MAYORDIR +export TMPDIR +export TGZDIR +export MYSQLROOTPW +export VERSION + +# --------- Ez a main.conf-ban bent van - jobb lenne itt nem megadni... + +BACKUPDIR=/backup/mayor/ +export BACKUPDIR +BASEDN=$(grep LDAPBASE $SCHOOLSERVERCONF | sed -e 's/LDAPBASE="//' -e 's/"//') +export BASEDN + +function mypwgen() { eval 'head /dev/urandom | tr -dc A-Za-z0-9_ | head -c8'; } +export -f mypwgen + +echo -e "A MaYoR keretrendszer és elektronikus napló telepítője...\n" + +for f in install.d/* +do + echo -e "\n----------------------------------------------\n$f\n----------------------------------------------\n" + ./$f $@ +done + +echo -e "MaYoR (c) setup 2012.\n" -- cgit v1.2.3