2018-02-11 01:20:58 +01:00
|
|
|
#=================================================
|
|
|
|
# SET ALL CONSTANTS
|
|
|
|
#=================================================
|
2016-12-27 10:44:40 +01:00
|
|
|
|
2023-08-08 23:21:11 +02:00
|
|
|
db_user=seafile
|
|
|
|
time_zone=$(cat /etc/timezone)
|
2017-12-09 20:56:20 +01:00
|
|
|
|
2018-02-11 01:20:58 +01:00
|
|
|
#=================================================
|
|
|
|
# DEFINE ALL COMMON FONCTIONS
|
|
|
|
#=================================================
|
|
|
|
|
2017-07-21 14:56:41 +02:00
|
|
|
install_dependance() {
|
2022-08-23 06:24:57 +02:00
|
|
|
ynh_add_swap --size=2000
|
2020-03-27 13:25:40 +01:00
|
|
|
# We need to do that because we can have some issue about the permission access to the pip cache without this
|
2023-08-08 23:21:11 +02:00
|
|
|
chown -R $seafile_user:$seafile_user $install_dir
|
2021-03-20 19:04:25 +01:00
|
|
|
|
2020-02-19 22:00:10 +01:00
|
|
|
# Note that we install imageio to force the dependance, without this imageio 2.8 is installed and it need python3.5
|
2022-08-02 23:57:57 +02:00
|
|
|
sudo -u $seafile_user pip3 install --user --no-warn-script-location --upgrade future mysqlclient PyMySQL Pillow pylibmc captcha Jinja2 SQLAlchemy psd-tools django-pylibmc django-simple-captcha python3-ldap pycryptodome==3.12.0 cffi==1.14.0
|
2019-10-11 21:40:07 +02:00
|
|
|
ynh_del_swap
|
2017-01-31 23:25:17 +01:00
|
|
|
}
|
|
|
|
|
2021-04-09 21:20:39 +02:00
|
|
|
mv_expect_scripts() {
|
|
|
|
expect_scripts_dir=$(mktemp -d)
|
|
|
|
cp expect_scripts/* $expect_scripts_dir
|
2021-04-25 14:11:51 +02:00
|
|
|
chmod u=rwx,o= -R $expect_scripts_dir
|
2021-04-09 21:20:39 +02:00
|
|
|
chown $seafile_user -R $expect_scripts_dir
|
|
|
|
}
|
|
|
|
|
2019-06-11 22:28:26 +02:00
|
|
|
set_permission() {
|
2023-08-08 23:21:11 +02:00
|
|
|
chown -R $seafile_user:$seafile_user $install_dir
|
|
|
|
chmod -R g-wx,o= $install_dir
|
|
|
|
setfacl -m user:www-data:rX $install_dir
|
|
|
|
setfacl -m user:www-data:rX $install_dir/seafile-server-$seafile_version
|
2022-11-02 17:19:55 +01:00
|
|
|
# At install time theses directory are not available
|
2023-08-08 23:21:11 +02:00
|
|
|
#REMOVEME? test -e $install_dir/seafile-server-latest/seahub && setfacl -m user:www-data:rX $install_dir/seafile-server-latest/seahub
|
|
|
|
#REMOVEME? test -e $install_dir/seafile-server-latest/seahub/media && setfacl -R -m user:www-data:rX $install_dir/seafile-server-latest/seahub/media
|
|
|
|
#REMOVEME? test -e $install_dir/seahub-data && setfacl -R -m user:www-data:rX $install_dir/seahub-data
|
2021-06-26 12:22:45 +02:00
|
|
|
|
2019-08-05 15:41:26 +02:00
|
|
|
# check that this directory exist because in some really old install the data could still be in the main seafile directory
|
2022-08-02 23:57:57 +02:00
|
|
|
# We also check at the install time when data directory is not already initialised
|
2021-04-09 21:20:39 +02:00
|
|
|
if [ -e /home/yunohost.app/seafile-data ]; then
|
|
|
|
chown -R $seafile_user:$seafile_user /home/yunohost.app/seafile-data
|
|
|
|
chmod -R o= /home/yunohost.app/seafile-data
|
|
|
|
fi
|
2019-06-11 22:28:26 +02:00
|
|
|
}
|