mirror of
https://github.com/YunoHost-Apps/seafile_ynh.git
synced 2024-09-03 20:26:01 +02:00
For push to github
not working commit
This commit is contained in:
parent
621f69e3da
commit
ad02ca97bb
4 changed files with 66 additions and 11 deletions
12
README.md
12
README.md
|
@ -1 +1,11 @@
|
||||||
Seafile 3.1.1 64bit packaged for Yunohost
|
Seafile for Yunohost
|
||||||
|
============
|
||||||
|
|
||||||
|
THIS DON'T WORK FOR NOW !
|
||||||
|
|
||||||
|
only x64 architecture
|
||||||
|
|
||||||
|
[Yunohost project](https://yunohost.org/#/)
|
||||||
|
|
||||||
|
|
||||||
|
Seafile server v4.0.6
|
||||||
|
|
18
conf/first_launch.exp
Normal file
18
conf/first_launch.exp
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#!/usr/bin/expect
|
||||||
|
set timeout 10
|
||||||
|
|
||||||
|
set admin_email [lindex $argv 0]
|
||||||
|
set admin_password [lindex $argv 1]
|
||||||
|
|
||||||
|
spawn /var/www/seafile/seafile-server-4.0.6/seahub.sh start
|
||||||
|
|
||||||
|
expect "for the admin account?"
|
||||||
|
send "$admin_email\r";
|
||||||
|
|
||||||
|
expect "for the admin account?"
|
||||||
|
send "$admin_password\r";
|
||||||
|
|
||||||
|
expect "Enter the"
|
||||||
|
send "$admin_password\r";
|
||||||
|
|
||||||
|
interact
|
|
@ -39,6 +39,22 @@
|
||||||
"example": "Seafile",
|
"example": "Seafile",
|
||||||
"default": "Seafile"
|
"default": "Seafile"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "admin",
|
||||||
|
"ask": {
|
||||||
|
"en": "Choose the admin user for Seafile",
|
||||||
|
"fr": "Choisissez l'administrateur de Seafile"
|
||||||
|
},
|
||||||
|
"example": "johndoe"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "admin_password",
|
||||||
|
"ask": {
|
||||||
|
"en": "Enter a password for the administrator",
|
||||||
|
"fr": "Entrez un mot de passe pour l'administrateur"
|
||||||
|
},
|
||||||
|
"example": "**Sup3rS3cr3t**"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "public_site",
|
"name": "public_site",
|
||||||
"ask": {
|
"ask": {
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
domain=$1
|
domain=$1
|
||||||
path=$2
|
path=$2
|
||||||
server_name=$3
|
server_name=$3
|
||||||
is_public=$4
|
admin=$4
|
||||||
|
admin_password=$5
|
||||||
|
is_public=$6
|
||||||
final_path=/var/www/seafile
|
final_path=/var/www/seafile
|
||||||
seafile_data=/home/yunohost.app/seafile-data
|
seafile_data=/home/yunohost.app/seafile-data
|
||||||
seafile_version=4.0.6
|
seafile_version=4.0.6
|
||||||
|
@ -44,9 +46,6 @@ sudo tar xzf ../sources/'seafile-server_'$seafile_version'_x86-64.tar'
|
||||||
sudo mv seafile-server-$seafile_version/* $final_path/seafile-server-$seafile_version
|
sudo mv seafile-server-$seafile_version/* $final_path/seafile-server-$seafile_version
|
||||||
sudo mv ../sources/'seafile-server_'$seafile_version'_x86-64.tar' $final_path/installed
|
sudo mv ../sources/'seafile-server_'$seafile_version'_x86-64.tar' $final_path/installed
|
||||||
|
|
||||||
# Set permissions to seafile directory
|
|
||||||
sudo chown -R www-data: $final_path
|
|
||||||
|
|
||||||
# Find available ports
|
# Find available ports
|
||||||
findPort 10001
|
findPort 10001
|
||||||
ccnet_port=$port
|
ccnet_port=$port
|
||||||
|
@ -72,16 +71,17 @@ sudo yunohost app initdb -d seafiledb -p $db_pwd $db_user
|
||||||
sudo yunohost app initdb -d seahubdb -p $db_pwd $db_user
|
sudo yunohost app initdb -d seahubdb -p $db_pwd $db_user
|
||||||
|
|
||||||
# Run install script
|
# Run install script
|
||||||
sudo cp ../conf/install.exp $final_path/seafile-server-$seafile_version
|
sudo chmod +x ../conf/install.exp
|
||||||
sudo chmod +x $final_path/seafile-server-$seafile_version/install.exp
|
|
||||||
sudo chmod +x $final_path/seafile-server-$seafile_version/setup-seafile-mysql.sh
|
sudo chmod +x $final_path/seafile-server-$seafile_version/setup-seafile-mysql.sh
|
||||||
sudo $final_path/seafile-server-$seafile_version/install.exp $server_name $domain $ccnet_port $seafile_data $seafile_port $fileserver_port $db_pwd
|
sudo ../conf/install.exp $server_name $domain $ccnet_port $seafile_data $seafile_port $fileserver_port $db_pwd
|
||||||
|
|
||||||
# Update seafile config
|
# Update seafile config
|
||||||
sudo sed -i "s@http://@https://@g" $final_path/ccnet/ccnet.conf
|
sudo sed -i "s@http://@https://@g" $final_path/ccnet/ccnet.conf
|
||||||
sudo sed -i "s@:8000@$path@g" $final_path/ccnet/ccnet.conf
|
sudo sed -i "s@:8000@$path@g" $final_path/ccnet/ccnet.conf
|
||||||
echo 'FILE_SERVER_ROOT = "https://'$domain'/seafhttp"' | sudo tee -a $final_path/seahub_settings.py
|
echo 'FILE_SERVER_ROOT = "https://'$domain'/seafhttp"' | sudo tee -a $final_path/seahub_settings.py
|
||||||
echo 'SITE_ROOT = "'$path'/"' | sudo tee -a $final_path/seahub_settings.py
|
echo 'SITE_ROOT = "'$path'/"' | sudo tee -a $final_path/seahub_settings.py
|
||||||
|
echo 'SERVE_STATIC = False' | sudo tee -a $final_path/seahub_settings.py
|
||||||
|
echo 'MEDIA_URL = "'$path'/media/"' | sudo tee -a $final_path/seahub_settings.py
|
||||||
|
|
||||||
# LDAP configuration
|
# LDAP configuration
|
||||||
echo '[LDAP]' | sudo tee -a $final_path/ccnet/ccnet.conf
|
echo '[LDAP]' | sudo tee -a $final_path/ccnet/ccnet.conf
|
||||||
|
@ -103,10 +103,16 @@ sed -i "s@SEAHUB_PORT@$seahub_port@g" ../conf/nginx.conf
|
||||||
sed -i "s@SEAFILE_FILESERVER_PORT@$fileserver_port@g" ../conf/nginx.conf
|
sed -i "s@SEAFILE_FILESERVER_PORT@$fileserver_port@g" ../conf/nginx.conf
|
||||||
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/seafile.conf
|
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/seafile.conf
|
||||||
|
|
||||||
|
# Set permissions to seafile directory
|
||||||
|
sudo chown -R www-data:www-data $final_path
|
||||||
|
sudo chown -R www-data:www-data $seafile_data
|
||||||
|
|
||||||
# Open port
|
# Open port
|
||||||
sudo yunohost firewall allow $ccnet_port
|
sudo yunohost firewall allow $ccnet_port
|
||||||
sudo yunohost firewall allow $seafile_port
|
sudo yunohost firewall allow $seafile_port
|
||||||
|
|
||||||
|
sudo yunohost app setting seafile skipped_uris -v "/media"
|
||||||
|
|
||||||
if [ "$is_public" = "No" ];
|
if [ "$is_public" = "No" ];
|
||||||
then
|
then
|
||||||
sudo yunohost app setting seafile skipped_uris -d
|
sudo yunohost app setting seafile skipped_uris -d
|
||||||
|
@ -115,9 +121,14 @@ else
|
||||||
sudo yunohost app setting seafile skipped_uris -v "/"
|
sudo yunohost app setting seafile skipped_uris -v "/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Start seafile, seahub and populate admin account
|
||||||
|
sudo /var/www/seafile/seafile-server-4.0.6/seafile.sh start
|
||||||
|
sudo chmod +x ../conf/first_launch.exp
|
||||||
|
sudo ../conf/first_launch.exp $admin_email $admin_password
|
||||||
|
|
||||||
|
# register yunohost service
|
||||||
|
sudo yunohost service add seafile-server
|
||||||
|
|
||||||
# Reload Nginx and regenerate SSOwat conf
|
# Reload Nginx and regenerate SSOwat conf
|
||||||
sudo service nginx reload
|
sudo service nginx reload
|
||||||
sudo yunohost app ssowatconf
|
sudo yunohost app ssowatconf
|
||||||
|
|
||||||
# Start Seafile Server
|
|
||||||
sudo service seafile-server start
|
|
Loading…
Reference in a new issue