@@ -1597,6 +1597,7 @@ public function configure_xmpp($options = '') {
15971597 // Copy isp libs
15981598 if (!@is_dir ('/usr/lib/metronome/isp-modules ' )) mkdir ('/usr/lib/metronome/isp-modules ' , 0755 , true );
15991599 caselog ('cp -rf apps/metronome_libs/* /usr/lib/metronome/isp-modules/ ' , __FILE__ , __LINE__ );
1600+ caselog ('chmod 755 /usr/lib/metronome/isp-modules/mod_auth_external/authenticate_isp.sh ' , __FILE__ , __LINE__ );
16001601 // Process db config
16011602 $ full_file_name = '/usr/lib/metronome/isp-modules/mod_auth_external/db_conf.inc.php ' ;
16021603 $ content = rf ($ full_file_name );
@@ -1609,13 +1610,14 @@ public function configure_xmpp($options = '') {
16091610
16101611 if (!stristr ($ options , 'dont-create-certs ' )){
16111612 // Create SSL Certificate for localhost
1612- echo "writing new private key to 'localhost.key' \n----- \n" ;
1613- $ ssl_country = $ this ->free_query ('Country Name (2 letter code) ' , 'AU ' );
1614- $ ssl_locality = $ this ->free_query ('Locality Name (eg, city) ' , '' );
1613+ // Ensure no line is left blank
1614+ echo "writing new private key to 'localhost.key' \n----- \n" ;
1615+ $ ssl_country = $ this ->free_query ('Country Name (2 letter code) ' , 'AU ' );
1616+ $ ssl_locality = $ this ->free_query ('Locality Name (eg, city) ' , 'City Name ' );
16151617 $ ssl_organisation = $ this ->free_query ('Organization Name (eg, company) ' , 'Internet Widgits Pty Ltd ' );
1616- $ ssl_organisation_unit = $ this ->free_query ('Organizational Unit Name (eg, section) ' , '' );
1618+ $ ssl_organisation_unit = $ this ->free_query ('Organizational Unit Name (eg, section) ' , 'Infrastructure ' );
16171619 $ ssl_domain = $ this ->free_query ('Common Name (e.g. server FQDN or YOUR name) ' , $ conf ['hostname ' ]);
1618- $ ssl_email = $ this ->free_query ('Email Address ' , '' );
1620+ $ ssl_email = $ this ->free_query ('Email Address ' , 'hostmaster@ ' . $ conf [ ' hostname ' ] );
16191621
16201622 $ tpl = new tpl ('metronome_conf_ssl.master ' );
16211623 $ tpl ->setVar ('ssl_country ' ,$ ssl_country );
@@ -1632,6 +1634,14 @@ public function configure_xmpp($options = '') {
16321634 exec ("(cd /etc/metronome/certs && make localhost.cert) " );
16331635 exec ('chmod 0400 /etc/metronome/certs/localhost.key ' );
16341636 exec ('chown metronome /etc/metronome/certs/localhost.key ' );
1637+
1638+ echo "IMPORTANT: \n" ;
1639+ echo "Localhost Key, Csr and a self-signed Cert have been saved to /etc/metronome/certs \n" ;
1640+ echo "In order to work with all clients, the server must have a trusted certificate, so use the Csr \n" ;
1641+ echo "to get a trusted certificate from your CA or replace Key and Cert with already signed files for \n" ;
1642+ echo "your domain. Clients like Pidgin dont allow to use untrusted self-signed certificates. \n" ;
1643+ echo "\n" ;
1644+
16351645 }else {
16361646 echo "----- \n" ;
16371647 echo "Metronome XMPP SSL server certificate is not renewed. Run the following command manual as root to recreate it: \n" ;
@@ -1645,45 +1655,6 @@ public function configure_xmpp($options = '') {
16451655 caselog ('update-rc.d metronome defaults ' , __FILE__ , __LINE__ );
16461656
16471657 exec ($ this ->getinitcommand ($ conf ['xmpp ' ]['init_script ' ], 'restart ' ));
1648-
1649- /*
1650- writing new private key to 'smtpd.key'
1651- -----
1652- You are about to be asked to enter information that will be incorporated
1653- into your certificate request.
1654- What you are about to enter is what is called a Distinguished Name or a DN.
1655- There are quite a few fields but you can leave some blank
1656- For some fields there will be a default value,
1657- If you enter '.', the field will be left blank.
1658- -----
1659- Country Name (2 letter code) [AU]:
1660- State or Province Name (full name) [Some-State]:
1661- Locality Name (eg, city) []:
1662- Organization Name (eg, company) [Internet Widgits Pty Ltd]:
1663- Organizational Unit Name (eg, section) []:
1664- Common Name (e.g. server FQDN or YOUR name) []:
1665- Email Address []:
1666- * */
1667-
1668- /*// Dont just copy over the virtualhost template but add some custom settings
1669- $tpl = new tpl('apache_apps.vhost.master');
1670-
1671- $tpl->setVar('apps_vhost_port',$conf['web']['apps_vhost_port']);
1672- $tpl->setVar('apps_vhost_dir',$conf['web']['website_basedir'].'/apps');
1673- $tpl->setVar('apps_vhost_basedir',$conf['web']['website_basedir']);
1674- $tpl->setVar('apps_vhost_servername',$apps_vhost_servername);
1675- $tpl->setVar('apache_version',getapacheversion());
1676-
1677-
1678- // comment out the listen directive if port is 80 or 443
1679- if($conf['web']['apps_vhost_ip'] == 80 or $conf['web']['apps_vhost_ip'] == 443) {
1680- $tpl->setVar('vhost_port_listen','#');
1681- } else {
1682- $tpl->setVar('vhost_port_listen','');
1683- }
1684-
1685- wf($vhost_conf_dir.'/apps.vhost', $tpl->grab());
1686- unset($tpl);*/
16871658 }
16881659
16891660
0 commit comments