diff --git a/.Jenkinsfile b/.Jenkinsfile index 7947dcb..7f72f3d 100644 --- a/.Jenkinsfile +++ b/.Jenkinsfile @@ -1,24 +1,15 @@ pipeline { - agent { label 'docker' } + agent { label 'sbuild' } stages { stage('Build Debian package') { - agent { - docker { - image 'evolix/gbp:bullseye' - args '-u root --privileged' - } - } when { branch 'debian' } steps { script { - sh 'mk-build-deps --install --remove debian/control' - sh 'rm -rf {source,*.gz,*.bz2,*.xz,*.deb,*.dsc,*.changes,*.buildinfo,lintian.txt}' - sh "gbp clone --debian-branch=$GIT_BRANCH $GIT_URL source" - sh 'cd source && git checkout $GIT_BRANCH && gbp buildpackage -us -uc' + sh 'gbp buildpackage' } - archiveArtifacts allowEmptyArchive: true, artifacts: '*.gz,*.bz2,*.xz,*.deb,*.dsc,*.changes,*.buildinfo,lintian.txt' + archiveArtifacts allowEmptyArchive: true, artifacts: 'build-area/*.gz,build-area/*.bz2,build-area/*.xz,build-area/*.deb,build-area/*.dsc,build-area/*.changes,build-area/*.buildinfo,build-area/*.build,build-area/lintian.txt' } } @@ -28,10 +19,7 @@ pipeline { } steps { script { - sh 'echo Dummy line to remove once something actually happens.' - /* No crendentials yet. - sh 'rsync -avP evoadmin-mail* droneci@pub.evolix.net:/home/droneci/evoadmin-mail/' - */ + sh 'rsync -avP build-area/evoadmin-mail*.deb build-area/evoadmin-mail*.buildinfo build-area/evoadmin-mail*.changes pub.evolix.org:/srv/upload/' } } } diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index d81733a..0000000 --- a/.drone.yml +++ /dev/null @@ -1,34 +0,0 @@ -kind: pipeline -name: default - -steps: -- name: fetch - image: alpine/git - commands: - - git fetch --tags - -- name: build debian package - image: evolix/gbp:bullseye - branches: - - debian - commands: - - mk-build-deps --install --remove debian/control - - gbp buildpackage -us -uc - when: - branch: - - debian - -- name: upload debian package - image: drillster/drone-rsync - settings: - hosts: ["pub.evolix.net"] - port: 22 - user: droneci - key: - from_secret: drone_private_key - target: /home/droneci/evoadmin-mail/ - source: ../evoadmin-mail* - delete: true - when: - branch: - - debian diff --git a/README.md b/README.md index 7fe61ba..6bea525 100644 --- a/README.md +++ b/README.md @@ -9,20 +9,20 @@ Evoadmin-mail requirements are an LDAP server, a web server and PHP. See [INSTALL](docs/install.md) for instructions. Multiples services can be configured to use the LDAP directory -managed by Evoadmin-mail : +managed by Evoadmin-mail: - TODO ## Test -You can deploy a test environment with Vagrant : +You can deploy a test environment with Vagrant: ~~~ vagrant up ~~~ Evoadmin-mail uses the evoadminmail.packmail.example.com domain -on localhost, so update your /etc/hosts : +on localhost, so update your /etc/hosts: ~~~ 127.0.0.1 evoadminmail.packmail.example.com @@ -34,7 +34,7 @@ https://evoadminmail.packmail.example.com:8443 ### Authentication The default admin user is "evoadmin", the password is randomly -generated and can be recovered from LDAP : +generated and can be recovered from LDAP: ~~~ vagrant ssh @@ -45,7 +45,7 @@ ldapvi --ldapsearch "(uid=evoadmin)" | grep userPassword | awk '{ print $2 }' ### Deployment Launch rsync-auto in a terminal to automatically synchronise your -local code with the Vagrant VM : +local code with the Vagrant VM: ~~~ vagrant rsync-auto diff --git a/docs/install.md b/docs/install.md index 1d457ef..75bbd89 100644 --- a/docs/install.md +++ b/docs/install.md @@ -1,8 +1,8 @@ # Install -Evoadmin-mail need an LDAP server, a Web server and PHP. This documentation explain how to configure OpenLDAP and Apache with mod_php. +Evoadmin-mail needs an LDAP server, a Web server and PHP. This documentation explains how to configure OpenLDAP and Apache with mod_php. -Following files extract are [Jinja2](http://jinja.pocoo.org) templates, **{{ varname }}** must be replaced by custom value, eg. +Following files extract are [Jinja2](http://jinja.pocoo.org) templates, **{{ varname }}** must be replaced by custom value, e.g. ~~~ ldap_hostname: "mailserver" @@ -237,7 +237,7 @@ git clone https://forge.evolix.org/evoadmin-mail.git /home/evoadmin-mail/www ; ; You need to copy and edit config-sample.ini to config.ini. ; This INI file is loaded by evoadmin-mail and contains the -; following configurations : +; following configurations: ; ; * Global settings ; * LDAP settings @@ -257,4 +257,4 @@ admin_pass = "{{ ldap_admin_password }}" superadmin[] = "evoadmin" ~~~ -You can now connect to your Evoadmin-mail with **evoadmin** user and your precedently defined password ! +You can now connect to your Evoadmin-mail with **evoadmin** user and your previously defined password! diff --git a/htdocs/lib/Config.php b/htdocs/lib/Config.php index bdf2907..f979136 100644 --- a/htdocs/lib/Config.php +++ b/htdocs/lib/Config.php @@ -1,7 +1,7 @@ 1, 'message' => 'Suppression du domaine '.self::$form['cn'].' ...'); try { self::$server->delDomain(self::$form['cn']); - PageController::$alerts[] = array('type' => 0, 'message' => 'Suppression effectué.'); + PageController::$alerts[] = array('type' => 0, 'message' => 'Suppression effectuée.'); } catch (Exception $e_ad) { PageController::$alerts[] = array('type' => 2, 'message' => $e_ad->getMessage()); } @@ -149,8 +149,8 @@ class FormController { private static function delAccount() { PageController::$alerts[] = array('type' => 1, 'message' => 'Suppression du compte '.self::$form['uid'].'...'); try { - self::$domain->delAccount(self::$form['uid'],self::$form['cn']); - PageController::$alerts[] = array('type' => 0, 'message' => "Suppression effectué."); + self::$domain->delAccount(self::$form['uid'],self::$form['domain']); + PageController::$alerts[] = array('type' => 0, 'message' => "Suppression effectuée.")); } catch (Exception $e) { PageController::$alerts[] = array('type' => 2, 'message' => $e->getMessage()); } diff --git a/scripts/evoadmin.sh b/scripts/evoadmin.sh index eb36b53..3dbbddc 100755 --- a/scripts/evoadmin.sh +++ b/scripts/evoadmin.sh @@ -39,11 +39,12 @@ if [ "$PASSWORD" != "$READPASS" ]; then fi # mv pseudo-homeDir to directory. for deleted users +USERDIR=${USERIS%%@$DOMAINIS} if [ "$DEL" == "on" ]; then - if [[ -n $USERIS && -n $DOMAINIS && -e "/home/vmail/$DOMAINIS" && -e "/home/vmail/$DOMAINIS/$USERIS" ]]; then - mv /home/vmail/$DOMAINIS/$USERIS /home/vmail/$DOMAINIS/$USERIS.$DATE - chown -R root:root /home/vmail/$DOMAINIS/$USERIS.$DATE - chmod -R 700 /home/vmail/$DOMAINIS/$USERIS.$DATE + if [[ -n $USERIS && -n $DOMAINIS && -n $USERDIR && -e "/home/vmail/$DOMAINIS" && -e "/home/vmail/$DOMAINIS/$USERDIR" ]]; then + mv /home/vmail/$DOMAINIS/$USERDIR /home/vmail/$DOMAINIS/$USERDIR.$DATE + chown -R root:root /home/vmail/$DOMAINIS/$USERDIR.$DATE + chmod -R 700 /home/vmail/$DOMAINIS/$USERDIR.$DATE fi exit 0 fi