cleanup database creation, change sogo home to /var/lib/sogo and change default shell to /sbin/nologin
parent
f2e894d03e
commit
a12257afaf
32 changed files with 52 additions and 70 deletions
@ -1,4 +1,4 @@ |
||||
#!/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 |
||||
|
||||
|
@ -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 +0,0 @@ |
||||
PERMS=0540 |
@ -1 +0,0 @@ |
||||
PERMS=0540 |
@ -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 |
Loading…
Reference in new issue