cleanup database creation, change sogo home to /var/lib/sogo and change default shell to /sbin/nologin

tags/ipasserelle-groupware-0.2.37-1
Daniel Berteaud 12 years ago
parent f2e894d03e
commit a12257afaf
  1. 7
      createlinks
  2. 2
      root/etc/e-smith/events/actions/sogo-backup
  3. 2
      root/etc/e-smith/events/actions/sogo-delete-user
  4. 6
      root/etc/e-smith/events/actions/sogo-upgrade
  5. 1
      root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/31sogo_mysql_update_privileges
  6. 1
      root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/31sogo_upgrade
  7. 0
      root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/sogo
  8. 0
      root/etc/e-smith/templates.metadata/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults
  9. 3
      root/etc/e-smith/templates/etc/e-smith/sql/init/30sogo_mysql_create_database
  10. 3
      root/etc/e-smith/templates/etc/e-smith/sql/init/31sogo_mysql_update_privileges
  11. 3
      root/etc/e-smith/templates/etc/e-smith/sql/init/31sogo_upgrade
  12. 40
      root/etc/e-smith/templates/etc/e-smith/sql/init/sogo
  13. 22
      root/etc/e-smith/templates/home/sogo/smeserver/sogo_mysql_update_privileges.sql
  14. 0
      root/etc/e-smith/templates/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults/10start
  15. 0
      root/etc/e-smith/templates/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults/15mysql
  16. 0
      root/etc/e-smith/templates/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults/16memcached
  17. 0
      root/etc/e-smith/templates/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults/20mail
  18. 0
      root/etc/e-smith/templates/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults/25notifications
  19. 0
      root/etc/e-smith/templates/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults/30defaultPrefs
  20. 0
      root/etc/e-smith/templates/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults/35external
  21. 0
      root/etc/e-smith/templates/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults/40sieve
  22. 0
      root/etc/e-smith/templates/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults/45admins
  23. 0
      root/etc/e-smith/templates/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults/50timezone
  24. 0
      root/etc/e-smith/templates/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults/55authSource
  25. 0
      root/etc/e-smith/templates/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults/60various
  26. 0
      root/etc/e-smith/templates/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults/99end
  27. 0
      root/etc/e-smith/templates/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults/template-begin
  28. 29
      root/home/sogo/smeserver/sogo_mysql_create_database.sql
  29. 1
      root/home/sogo/smeserver/sogo_mysql_update_privileges.sql
  30. 2
      root/usr/share/qpsmtpd/plugins/fix_headers_case
  31. 0
      root/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults
  32. 0
      root/var/lib/sogo/GNUstep/Library/SOGo/Templates/MainUI/SOGoRootPage.wox

@ -5,11 +5,9 @@ use esmith::Build::CreateLinks qw(:all);
service_link_enhanced("memcached-sogo", "S55", "7"); service_link_enhanced("memcached-sogo", "S55", "7");
service_link_enhanced("sogod", "S85", "7"); service_link_enhanced("sogod", "S85", "7");
templates2events("/etc/e-smith/sql/init/30sogo_mysql_create_database", qw(email-update bootstrap-console-save)); templates2events("/etc/e-smith/sql/init/sogo", qw(email-update bootstrap-console-save));
templates2events("/etc/e-smith/sql/init/31sogo_mysql_update_privileges", qw(email-update bootstrap-console-save));
templates2events("/home/sogo/smeserver/sogo_mysql_update_privileges.sql", qw(email-update bootstrap-console-save));
templates2events("/etc/cron.d/sogo-alarm", qw(email-update bootstrap-console-save)); templates2events("/etc/cron.d/sogo-alarm", qw(email-update bootstrap-console-save));
templates2events("/home/sogo/GNUstep/Defaults/.GNUstepDefaults", qw(email-update bootstrap-console-save pre-backup)); templates2events("/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults", qw(email-update bootstrap-console-save pre-backup));
templates2events("/etc/sysconfig/sogo", qw(email-update bootstrap-console-save)); templates2events("/etc/sysconfig/sogo", qw(email-update bootstrap-console-save));
templates2events("/etc/logrotate.d/sogo", qw(email-update bootstrap-console-save)); templates2events("/etc/logrotate.d/sogo", qw(email-update bootstrap-console-save));
@ -21,6 +19,7 @@ event_link("sogo-delete-backup", "pre-backup", "60");
event_link("sogo-delete-backup", "post-backup", "60"); event_link("sogo-delete-backup", "post-backup", "60");
event_link("sogo-backup", "pre-backup", "70"); event_link("sogo-backup", "pre-backup", "70");
event_link("sogo-delete-user", "user-delete", "10"); event_link("sogo-delete-user", "user-delete", "10");
event_link("sogo-upgrade", "email-update", "20");
panel_link("sogo", "manager"); panel_link("sogo", "manager");

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/bash
su - sogo -c "/usr/sbin/sogo-tool backup /home/e-smith/db/sogo ALL" > /dev/null 2>&1 su -l -s /bin/bash sogo -c "/usr/sbin/sogo-tool backup /home/e-smith/db/sogo ALL" > /dev/null 2>&1

@ -12,5 +12,5 @@ if [ -z "$USER" ]; then
exit 1 exit 1
fi fi
su - sogo -c "/usr/sbin/sogo-tool remove $USER" > /dev/null 2>&1 su -l -s /bin/bash sogo -c "/usr/sbin/sogo-tool remove $USER" > /dev/null 2>&1

@ -0,0 +1,6 @@
#!/bin/bash
/usr/bin/getent passwd sogo | grep -q '/home/sogo'
if [ $? -eq 0 ]; then
/usr/sbin/usermod -d /var/lib/sogo -m -s /sbin/nologin -c "SOGo daemon" sogo 2>/dev/null
fi

@ -1,3 +0,0 @@
#! /bin/sh
exec mysql < /home/sogo/smeserver/sogo_mysql_create_database.sql

@ -1,3 +0,0 @@
#! /bin/sh
exec mysql < /home/sogo/smeserver/sogo_mysql_update_privileges.sql

@ -1,3 +0,0 @@
#! /bin/sh
exec /etc/e-smith/events/actions/sogo_upgrade

@ -0,0 +1,40 @@
{
my $db = ${'sogod'}{'DbName'} || 'sogo';
my $user = ${'sogod'}{'DbUser'} || 'sogo';
my $pass = ${'sogod'}{'DbPassword'} || 'secret';
$OUT .= <<"END";
/usr/bin/mysql <<EOF
CREATE DATABASE IF NOT EXISTS $db CHARACTER SET='utf8';
USE mysql;
REPLACE INTO user (
host,
user,
password)
VALUES (
'localhost',
'$user',
PASSWORD ('$pass'));
REPLACE INTO db (
host,
db,
user,
select_priv, insert_priv, update_priv, delete_priv,
create_priv, alter_priv, index_priv, drop_priv, create_tmp_table_priv,
grant_priv, lock_tables_priv, references_priv)
VALUES (
'localhost',
'$db',
'$user',
'Y', 'Y', 'Y', 'Y',
'Y', 'Y', 'Y', 'Y', 'Y',
'N', 'Y', 'Y');
FLUSH PRIVILEGES;
EOF
END
}

@ -1,22 +0,0 @@
CONNECT mysql;
REPLACE INTO user (host, user, password)
VALUES (
'localhost',
'sogo',
password('{$sogod{DbPassword}}')
);
REPLACE INTO db (host, db, user, select_priv, insert_priv, update_priv,
delete_priv, create_priv, drop_priv, alter_priv, index_priv,
references_priv)
VALUES (
'localhost',
'sogo',
'sogo',
'Y', 'Y', 'Y', 'Y',
'Y', 'Y', 'Y', 'Y',
'Y'
);
FLUSH PRIVILEGES;

@ -1,29 +0,0 @@
-- SOGo Database Creation
CREATE DATABASE IF NOT EXISTS `sogo`;
CONNECT `sogo`;
CREATE TABLE IF NOT EXISTS `sogo_folder_info` (
`c_folder_id` bigint(20) unsigned NOT NULL auto_increment,
`c_path` varchar(255) NOT NULL,
`c_path1` varchar(255) NOT NULL,
`c_path2` varchar(255) default NULL,
`c_path3` varchar(255) default NULL,
`c_path4` varchar(255) default NULL,
`c_foldername` varchar(255) NOT NULL,
`c_location` varchar(2048) NOT NULL,
`c_quick_location` varchar(2048) default NULL,
`c_acl_location` varchar(2048) default NULL,
`c_folder_type` varchar(255) NOT NULL,
PRIMARY KEY (`c_path`),
UNIQUE KEY `c_folder_id` (`c_folder_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE IF NOT EXISTS `sogo_user_profile` (
`c_uid` varchar(255) NOT NULL,
`c_defaults` text,
`c_settings` text,
PRIMARY KEY (`c_uid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

@ -1 +0,0 @@
-- sogo_mysql_privileges.sql template

@ -32,7 +32,7 @@ sub fix_headers_case {
$mailer =~ m/^SOGoMail/ or return DECLINED; $mailer =~ m/^SOGoMail/ or return DECLINED;
$self->log(LOGINFO, "SOGo mailer detected, going to fix headers case"); $self->log(LOGINFO, "SOGo mailer detected, going to fix headers case");
foreach my $header (qw/From To Cc Subject Message-ID Content-Type Date Content-Length Content-Transfer-Encoding/){ foreach my $header (qw/From To Cc Subject Message-ID Content-Type Date Content-Length Content-Transfer-Encoding/){
my $value = $self->get_header($transaction,$header) or return DECLINED; my $value = $self->get_header($transaction,$header) or next;
$self->set_header($transaction, $header, $value); $self->set_header($transaction, $header, $value);
} }
return DECLINED; return DECLINED;

Loading…
Cancel
Save