[Seafile] Synchronize your files

,

Hi,

I’ve packaged Seafile for Yunohost, feedbacks are welcome.

Sources: https://github.com/mbugeia/seafile_ynh

2 Likes

Thanks for doing the package!

I always get the error “502 bad getway”, when I install seafile via the moulinette. other apps work just fine. Any idea what could be wrong? (Processor architecture, path and those should be okay).

Best,

zohan

Hi,
“502 bad getway” usually means that the application service behind nginx is not running, it’s a very generic error. To troubleshoot I need some additional informations:

  • What’s architecture are you using ?
  • Are you running yunohost with 512Mb or less of ram without swap ?
  • Can you provide the full install log (anonymize domain/user/passwords before if you want to)

Otherwise you can look at seafiles log wich are located in /var/www/seafile/logs maybe you can find something useful.

Thanks for the quick answer!

My yunohost-Server has 524 MB RAM and an Intel Vcore, Linux 3.2.0-4-amd64, so its 64Bit. 324 MB is used for swaping.

The log-directory is empty unfortunately.

Ok, no problem with your hardware I think. Since the log directory is empty there has probably been a problem during installation. Can you try to uninstall, install it again and provide me the install log ?

It works! I installed it from the console now and there I could see, that the domain did not work for the installation. This was because I added “www” in front of the URL, but forgot that the URL oft the server works without “www.”

But if you install seafile via the Moulinette, it never works if your domain starts without “www”, perhaps you can fix that in the install scripts?

Thanks for your help anyway!

Hi, I tried to install Seafile via the moulinette but I have an issue at the end of the installation. Then, if I try to access at mydomain/seafile I have “502 Bad Gateway”

I have a 64bit architecture. Here the install log if it can help anyone (I deleted my domain/username/password):

Choisissez un domaine pour Seafile : xxxxxx
Choisissez un chemin pour Seafile (default: /seafile) : 
Choisissez un nom (default: Seafile) : 
Choisissez l'administrateur de Seafile : xxxxx@xxxxxxxx
Entrez un mot de passe pour l'administrateur : xxxxxxxxxxxxx
Est-ce un site public ? Pour utiliser un client sur PC ou l'application mobile, Seafile doit être public (Yes|No) (default: Yes) : 
Quelle est l'architecture du serveur ? (x86-64|i386|arm) (default: x86-64) : 
Exécution du script...
+ domain=xxxxxxxx
+ path=/seafile
+ server_name=Seafile
+ admin=xxxxxxx@xxxxxxxx
+ admin_password=xxxxxxx
+ is_public=Yes
+ architecture=x86-64
+ final_path=/var/www/seafile
+ seafile_data=/home/yunohost.app/seafile-data
+ seafile_version=4.0.6
++ sed 's/mail: //g'
++ grep mail:
++ sudo yunohost user info xxxxxxx@xxxxxx
+ admin_email=xxxxxx@xxxxxx
+ port=
+ sudo yunohost app checkurl xxxxxx/seafile -a seafile
+ [[ ! 0 -eq 0 ]]
+ sudo apt-get install -qq python2.7 python-setuptools python-simplejson python-imaging python-mysqldb python-flup expect
+ sudo mkdir -p /var/www/seafile
+ sudo mkdir -p /var/www/seafile/installed
+ sudo mkdir -p /var/www/seafile/logs
+ sudo mkdir -p /var/www/seafile/seafile-data
+ sudo mkdir -p /var/www/seafile/seafile-server-4.0.6
+ sudo tar xzf ../sources/seafile-server_4.0.6_x86-64.tar
+ sudo mv seafile-server-4.0.6/check_init_admin.py seafile-server-4.0.6/reset-admin.sh seafile-server-4.0.6/runtime seafile-server-4.0.6/seaf-fuse.sh seafile-server-4.0.6/seaf-gc.sh seafile-server-4.0.6/seafile seafile-server-4.0.6/seafile.sh seafile-server-4.0.6/seahub seafile-server-4.0.6/seahub.sh seafile-server-4.0.6/setup-seafile-mysql.py seafile-server-4.0.6/setup-seafile-mysql.sh seafile-server-4.0.6/setup-seafile.sh seafile-server-4.0.6/upgrade /var/www/seafile/seafile-server-4.0.6
+ sudo mv ../sources/seafile-server_4.0.6_x86-64.tar /var/www/seafile/installed
+ findPort 10001
+ port=10001
+ sudo yunohost app checkport 10001
Erreur : Le port 10001 n'est pas disponible
+ [[ ! 22 -eq 0 ]]
+ port=10002
+ sudo yunohost app checkport 10002
Succès ! Le port 10002 est disponible
+ [[ ! 0 -eq 0 ]]
+ return 10002
+ ccnet_port=10002
+ findPort 12001
+ port=12001
+ sudo yunohost app checkport 12001
Erreur : Le port 12001 n'est pas disponible
+ [[ ! 22 -eq 0 ]]
+ port=12002
+ sudo yunohost app checkport 12002
Succès ! Le port 12002 est disponible
+ [[ ! 0 -eq 0 ]]
+ return 12002
+ seafile_port=12002
+ findPort 8000
+ port=8000
+ sudo yunohost app checkport 8000
Erreur : Le port 8000 n'est pas disponible
+ [[ ! 22 -eq 0 ]]
+ port=8001
+ sudo yunohost app checkport 8001
Succès ! Le port 8001 est disponible
+ [[ ! 0 -eq 0 ]]
+ return 8001
+ seahub_port=8001
+ findPort 8082
+ port=8082
+ sudo yunohost app checkport 8082
Erreur : Le port 8082 n'est pas disponible
+ [[ ! 22 -eq 0 ]]
+ port=8083
+ sudo yunohost app checkport 8083
Succès ! Le port 8083 est disponible
+ [[ ! 0 -eq 0 ]]
+ return 8083
+ fileserver_port=8083
+ sudo yunohost app setting seafile ccnet_port -v 10002
+ sudo yunohost app setting seafile seafile_port -v 12002
+ sudo yunohost app setting seafile seahub_port -v 8001
+ sudo yunohost app setting seafile fileserver_port -v 8083
+ sudo yunohost app setting seafile is_public -v Yes
+ sudo yunohost app setting seafile architecture -v x86-64
+ sudo yunohost app setting seafile installed_version -v 4.0.6
+ db_user=seafile
++ dd if=/dev/urandom bs=1 count=200
++ tr -c -d A-Za-z0-9
++ sed -n 's/\(.\{24\}\).*/\1/p'
+ db_pwd=g51SMPrBsnNxfZ9wGzIPC7gc
+ sudo yunohost app initdb -d ccnetdb -p g51SMPrBsnNxfZ9wGzIPC7gc seafile
Succès ! Base de donnée MySQL initialisée avec succès
+ sudo yunohost app initdb -d seafiledb -p g51SMPrBsnNxfZ9wGzIPC7gc seafile
Succès ! Base de donnée MySQL initialisée avec succès
+ sudo yunohost app initdb -d seahubdb -p g51SMPrBsnNxfZ9wGzIPC7gc seafile
Succès ! Base de donnée MySQL initialisée avec succès
+ sudo yunohost app setting seafile db_pwd -v g51SMPrBsnNxfZ9wGzIPC7gc
+ sudo chmod +x ../conf/install.exp
+ sudo chmod +x /var/www/seafile/seafile-server-4.0.6/setup-seafile-mysql.sh
+ sudo ../conf/install.exp Seafile xxxxxxx 10002 /home/yunohost.app/seafile-data 12002 8083 g51SMPrBsnNxfZ9wGzIPC7gc
spawn /var/www/seafile/seafile-server-4.0.6/setup-seafile-mysql.sh
Checking python on this machine ...
  Checking python module: setuptools ... Done.
  Checking python module: python-imaging ... Done.
  Checking python module: python-mysqldb ... Done.

-----------------------------------------------------------------
This script will guide you to setup your seafile server using MySQL.
Make sure you have read seafile server manual at

        https://github.com/haiwen/seafile/wiki

Press ENTER to continue
-----------------------------------------------------------------



What is the name of the server? It will be displayed on the client.
3 - 15 letters or digits
[ server name ] Seafile

What is the ip or domain of the server?
For example: www.mycompany.com, 192.168.1.101
[ This server's ip or domain ] xxxxxxx

Which port do you want to use for the ccnet server?
[ default "10001" ] 10002

Where do you want to put your seafile data?
Please use a volume with enough free space
[ default "/var/www/seafile/seafile-data" ] /home/yunohost.app/seafile-data

Which port do you want to use for the seafile server?
[ default "12001" ] 12002

Which port do you want to use for the seafile fileserver?
[ default "8082" ] 8083

-------------------------------------------------------
Please choose a way to initialize seafile databases:
-------------------------------------------------------

[1] Create new ccnet/seafile/seahub databases
[2] Use existing ccnet/seafile/seahub databases

[ 1 or 2 ] 2

What is the host of mysql server?
[ default "localhost" ] localhost

What is the port of mysql server?
[ default "3306" ] 3306

Which mysql user to use for seafile?
[ mysql user for seafile ] seafile

What is the password for mysql user "seafile"?
[ password for seafile ]

verifying password of user seafile ...  done

Enter the existing database name for ccnet:
[ ccnet database ] ccnetdb

verifying user "seafile" access to database ccnetdb ...  done

Enter the existing database name for seafile:
[ seafile database ] seafiledb

verifying user "seafile" access to database seafiledb ...  done

Enter the existing database name for seahub:
[ seahub database ] seahubdb

verifying user "seafile" access to database seahubdb ...  done

---------------------------------
This is your configuration
---------------------------------

    server name:            Seafile
    server ip/domain:       xxxxxxx
    ccnet port:             10002

    seafile data dir:       /home/yunohost.app/seafile-data
    seafile port:           12002
    fileserver port:        8083

    database:               use exising
    ccnet database:         ccnetdb
    seafile database:       seafiledb
    seahub database:        seahubdb
    database user:          seafile



---------------------------------
Press ENTER to continue, or Ctrl-C to abort
---------------------------------

Generating ccnet configuration ...

done
Successly create configuration dir /var/www/seafile/ccnet.
Generating seafile configuration ...

Done.
done
Generating seahub configuration ...

----------------------------------------
Now creating seahub database tables ...

----------------------------------------

creating seafile-server-latest symbolic link ...  done




-----------------------------------------------------------------
Your seafile server configuration has been finished successfully.
-----------------------------------------------------------------

run seafile server:     ./seafile.sh { start | stop | restart }
run seahub  server:     ./seahub.sh  { start <port> | stop | restart <port> }

-----------------------------------------------------------------
If you are behind a firewall, remember to allow input/output of these tcp ports:
-----------------------------------------------------------------

port of ccnet server:         10002
port of seafile server:       12002
port of seafile fileserver:   8083
port of seahub:               8000

When problems occur, Refer to

        https://github.com/haiwen/seafile/wiki

for information.


+ sudo sed -i s@http://@https://@g /var/www/seafile/ccnet/ccnet.conf
+ sudo sed -i s@:8000@/seafile@g /var/www/seafile/ccnet/ccnet.conf
+ echo 'FILE_SERVER_ROOT = "https://xxxxxxxxxx/seafhttp"'
+ sudo tee -a /var/www/seafile/seahub_settings.py
FILE_SERVER_ROOT = "https://xxxxxxxxxxx/seafhttp"
+ echo 'SITE_ROOT = "/seafile/"'
+ sudo tee -a /var/www/seafile/seahub_settings.py
SITE_ROOT = "/seafile/"
+ echo 'SERVE_STATIC = False'
+ sudo tee -a /var/www/seafile/seahub_settings.py
SERVE_STATIC = False
+ echo 'MEDIA_URL = "/seafile/media/"'
+ sudo tee -a /var/www/seafile/seahub_settings.py
MEDIA_URL = "/seafile/media/"
+ echo 'EMAIL_USE_TLS = False'
+ sudo tee -a /var/www/seafile/seahub_settings.py
EMAIL_USE_TLS = False
+ echo 'EMAIL_HOST = "localhost"'
+ sudo tee -a /var/www/seafile/seahub_settings.py
EMAIL_HOST = "localhost"
+ echo 'EMAIL_HOST_USER = "seafile@xxxxxxx"'
+ sudo tee -a /var/www/seafile/seahub_settings.py
EMAIL_HOST_USER = "seafile@xxxxxxxxx"
+ echo 'EMAIL_HOST_PASSWORD = ""'
+ sudo tee -a /var/www/seafile/seahub_settings.py
EMAIL_HOST_PASSWORD = ""
+ echo 'EMAIL_PORT = "25"'
+ sudo tee -a /var/www/seafile/seahub_settings.py
EMAIL_PORT = "25"
+ echo 'DEFAULT_FROM_EMAIL = "seafile@xxxxxxxx"'
+ sudo tee -a /var/www/seafile/seahub_settings.py
DEFAULT_FROM_EMAIL = "seafile@xxxxxxx"
+ echo 'SERVER_EMAIL = "seafile@xxxxxxx"'
+ sudo tee -a /var/www/seafile/seahub_settings.py
SERVER_EMAIL = "seafile@xxxxxxxxx"
+ echo '[LDAP]'
+ sudo tee -a /var/www/seafile/ccnet/ccnet.conf
[LDAP]
+ echo 'HOST = ldap://localhost:389'
+ sudo tee -a /var/www/seafile/ccnet/ccnet.conf
HOST = ldap://localhost:389
+ echo 'BASE = ou=users,dc=yunohost,dc=org'
+ sudo tee -a /var/www/seafile/ccnet/ccnet.conf
BASE = ou=users,dc=yunohost,dc=org
+ echo 'LOGIN_ATTR = mail'
+ sudo tee -a /var/www/seafile/ccnet/ccnet.conf
LOGIN_ATTR = mail
+ sudo cp ../conf/seafile-server /etc/init.d
+ sudo sed -i s@SEAHUB_PORT@8001@g /etc/init.d/seafile-server
+ sudo sed -i s@SEAFILE_DIR@/var/www/seafile@g /etc/init.d/seafile-server
+ sudo chmod +x /etc/init.d/seafile-server
+ sudo update-rc.d seafile-server defaults
update-rc.d: using dependency based boot sequencing
+ sed -i s@PATHTOCHANGE@/seafile@g ../conf/nginx.conf
+ sed -i s@ALIASTOCHANGE@/var/www/seafile/@g ../conf/nginx.conf
+ sed -i s@SEAHUB_PORT@8001@g ../conf/nginx.conf
+ sed -i s@SEAFILE_FILESERVER_PORT@8083@g ../conf/nginx.conf
+ sudo cp ../conf/nginx.conf /etc/nginx/conf.d/xxxxxxxxxx.d/seafile.conf
+ sudo cp ../conf/first_launch.exp /var/www/seafile
+ sudo chmod +x /var/www/seafile/first_launch.exp
+ sudo chown -R www-data:www-data /var/www/seafile
+ sudo chown -R www-data:www-data /home/yunohost.app/seafile-data
+ sudo yunohost firewall allow 10002
usage: yunohost firewall allow [-h] [--no-upnp] [--no-reload] [-6] [-4]
                               {TCP,UDP,Both} port
yunohost firewall allow: error: argument protocol: invalid choice: '10002' (choose from 'TCP', 'UDP', 'Both')
+ sudo yunohost firewall allow 12002
usage: yunohost firewall allow [-h] [--no-upnp] [--no-reload] [-6] [-4]
                               {TCP,UDP,Both} port
yunohost firewall allow: error: argument protocol: invalid choice: '12002' (choose from 'TCP', 'UDP', 'Both')
+ sudo su - www-data -c '/var/www/seafile/seafile-server-4.0.6/seafile.sh start'

Seafile controller is already running, pid 6264

+ sudo su - www-data -c '/var/www/seafile/first_launch.exp xxxxxxxx@xxxxxxxx xxxxxxxxxx'
spawn /var/www/seafile/seafile-server-4.0.6/seahub.sh start-fastcgi

Seahub is already running.
send: spawn id exp5 not open
    while executing
"send "$admin_email\r""
    (file "/var/www/seafile/first_launch.exp" line 10)
+ sudo cp ../conf/add_sso_conf.py /var/www/seafile
+ sudo cp ../conf/remove_sso_conf.py /var/www/seafile
+ sudo python /var/www/seafile/add_sso_conf.py
+ sudo yunohost app setting seafile unprotected_uris -v /media
+ '[' Yes = No ']'
+ sudo yunohost app setting seafile unprotected_uris -v /
+ sudo yunohost service add seafile-server
Succès ! Service ajouté avec succès
+ sudo service nginx reload
Reloading nginx configuration: nginx.
+ sudo yunohost app ssowatconf
Succès ! Configuration de SSOwat générée avec succès
+ sudo service seafile-server start
Erreur : Échec de l'installation

Any idea what could be wrong ?

Hi,

Try starting seafile with:

sudo service seafile-server start

I’ve realized that I had forgotten in the script to launch the service at the end of installation but it worked nonetheless in some cases. (corrected now)

Did you try to installl seafile with another package (like this one: https://github.com/CotzaDev/seafile_ynh) before that? It seems that some ports are already in use and that specific package remove script does not clean properly so I do not advise to use it.

Otherwise I need to update the script with new seafile version that only use https for syncing.

Thanks for your help !

I tried starting seafile :

admin@Host-003:~$ sudo service seafile-server start
admin@Host-003:~$ 

But nothing happend.
I tried to install the CotzaDev package before that (it didn’t work), I removed it and install yours (thanks for your work by the way).

Is there a file to remove in this other package before installing seafile mbugeia ?

I tried to upgrade with:

sudo yunohost app upgrade Seafile https://github.com/mbugeia/seafile_ynh seafile

But it tell me that Seafile is not installed and it not appears in Yunohost admin api (but it is in the user portail). However I didn’t removed it, the files are still in /var/www/seafile. What did I do wrong ?

Sorry, I did miss one part of your install log that said “Seafile controller is already running, pid 6264” that cause the install to failed so my package is not really installed.

I think this is caused by the CotzaDev package. You need to remove all trace of both package manually :confused: Following command should do the trick, replace your domain in the first line

domain=yourdomain.tld
root_pwd=$(sudo cat /etc/yunohost/mysql)

sudo service seafile-server stop
sudo rm -rf /var/www/seafile
sudo rm -f /etc/nginx/conf.d/$domain.d/seafile.conf
sudo rm -f /etc/init.d/seafile-server
sudo rm -rf /home/yunohost.app/seafile-data
mysql -u root -p$root_pwd -e "DROP DATABASE ccnetdb ; DROP DATABASE seafiledb ; DROP DATABASE seahubdb ; DROP USER seafile@localhost ;"
sudo yunohost service remove seafile-server

sudo yunohost firewall disallow 10001
sudo yunohost firewall disallow 10002
sudo rm -rf /etc/yunohost/apps/seafile
sudo rm -r /etc/yunohost/apps/seahack

sudo service nginx reload
sudo yunohost app ssowatconf

I’m not completely sure for ports thing (there is an edge effect, my script is not very robust too unfortunatly).

After that you can try to reinstall my package.

Now it works ! Big thanks !

However I always have an issue at the end of the installation. Yunohost doesn’t seem detect the app and I can’t upgrade it (it tells me Seafile is not installed).

Here the new install log if it can help you :

admin@Host-003:~$ sudo yunohost app install -l Seafile https://github.com/mbugeia/seafile_ynh
Téléchargement...
Extraction...
Terminé.
Choisissez un domaine pour Seafile : xxxxxxxxx
Choisissez un chemin pour Seafile (default: /seafile) : 
Choisissez un nom (default: Seafile) : 
Choisissez l'administrateur de Seafile : xxxxxxxxx@xxxxxxxxx
Entrez un mot de passe pour l'administrateur : xxxxxxxxx
Est-ce un site public ? Pour utiliser un client sur PC ou l'application mobile, Seafile doit être public (Yes|No) (default: Yes) : 
Quelle est l'architecture du serveur ? (x86-64|i386|arm) (default: x86-64) : 
Exécution du script...
+ domain=xxxxxxxxx
+ path=/seafile
+ server_name=Seafile
+ admin=xxxxxxxxx@xxxxxxxxx
+ admin_password=xxxxxxxxx
+ is_public=Yes
+ architecture=x86-64
+ final_path=/var/www/seafile
+ seafile_data=/home/yunohost.app/seafile-data
+ seafile_version=4.0.6
++ sed 's/mail: //g'
++ grep mail:
++ sudo yunohost user info xxxxxxxxx@xxxxxxxxx
+ admin_email=xxxxxxxxx@xxxxxxxxx
+ port=
+ sudo yunohost app checkurl xxxxxxxxx/seafile -a seafile
+ [[ ! 0 -eq 0 ]]
+ sudo apt-get install -qq python2.7 python-setuptools python-simplejson python-imaging python-mysqldb python-flup expect
+ sudo mkdir -p /var/www/seafile
+ sudo mkdir -p /var/www/seafile/installed
+ sudo mkdir -p /var/www/seafile/logs
+ sudo mkdir -p /var/www/seafile/seafile-data
+ sudo mkdir -p /var/www/seafile/seafile-server-4.0.6
+ sudo tar xzf ../sources/seafile-server_4.0.6_x86-64.tar
+ sudo mv seafile-server-4.0.6/check_init_admin.py seafile-server-4.0.6/reset-admin.sh seafile-server-4.0.6/runtime seafile-server-4.0.6/seaf-fuse.sh seafile-server-4.0.6/seaf-gc.sh seafile-server-4.0.6/seafile seafile-server-4.0.6/seafile.sh seafile-server-4.0.6/seahub seafile-server-4.0.6/seahub.sh seafile-server-4.0.6/setup-seafile-mysql.py seafile-server-4.0.6/setup-seafile-mysql.sh seafile-server-4.0.6/setup-seafile.sh seafile-server-4.0.6/upgrade /var/www/seafile/seafile-server-4.0.6
+ sudo mv ../sources/seafile-server_4.0.6_x86-64.tar /var/www/seafile/installed
+ findPort 10001
+ port=10001
+ sudo yunohost app checkport 10001
Succès ! Le port 10001 est disponible
+ [[ ! 0 -eq 0 ]]
+ return 10001
+ ccnet_port=10001
+ findPort 12001
+ port=12001
+ sudo yunohost app checkport 12001
Succès ! Le port 12001 est disponible
+ [[ ! 0 -eq 0 ]]
+ return 12001
+ seafile_port=12001
+ findPort 8000
+ port=8000
+ sudo yunohost app checkport 8000
Succès ! Le port 8000 est disponible
+ [[ ! 0 -eq 0 ]]
+ return 8000
+ seahub_port=8000
+ findPort 8082
+ port=8082
+ sudo yunohost app checkport 8082
Succès ! Le port 8082 est disponible
+ [[ ! 0 -eq 0 ]]
+ return 8082
+ fileserver_port=8082
+ sudo yunohost app setting seafile ccnet_port -v 10001
+ sudo yunohost app setting seafile seafile_port -v 12001
+ sudo yunohost app setting seafile seahub_port -v 8000
+ sudo yunohost app setting seafile fileserver_port -v 8082
+ sudo yunohost app setting seafile is_public -v Yes
+ sudo yunohost app setting seafile architecture -v x86-64
+ sudo yunohost app setting seafile installed_version -v 4.0.6
+ db_user=seafile
++ dd if=/dev/urandom bs=1 count=200
++ sed -n 's/\(.\{24\}\).*/\1/p'
++ tr -c -d A-Za-z0-9
+ db_pwd=HUkPA39MxKSnfnRtOdtEtopE
+ sudo yunohost app initdb -d ccnetdb -p HUkPA39MxKSnfnRtOdtEtopE seafile
Succès ! Base de donnée MySQL initialisée avec succès
+ sudo yunohost app initdb -d seafiledb -p HUkPA39MxKSnfnRtOdtEtopE seafile
Succès ! Base de donnée MySQL initialisée avec succès
+ sudo yunohost app initdb -d seahubdb -p HUkPA39MxKSnfnRtOdtEtopE seafile
Succès ! Base de donnée MySQL initialisée avec succès
+ sudo yunohost app setting seafile db_pwd -v HUkPA39MxKSnfnRtOdtEtopE
+ sudo chmod +x ../conf/install.exp
+ sudo chmod +x /var/www/seafile/seafile-server-4.0.6/setup-seafile-mysql.sh
+ sudo ../conf/install.exp Seafile xxxxxxxxx 10001 /home/yunohost.app/seafile-data 12001 8082 HUkPA39MxKSnfnRtOdtEtopE
spawn /var/www/seafile/seafile-server-4.0.6/setup-seafile-mysql.sh
Checking python on this machine ...
  Checking python module: setuptools ... Done.
  Checking python module: python-imaging ... Done.
  Checking python module: python-mysqldb ... Done.

-----------------------------------------------------------------
This script will guide you to setup your seafile server using MySQL.
Make sure you have read seafile server manual at

        https://github.com/haiwen/seafile/wiki

Press ENTER to continue
-----------------------------------------------------------------


What is the name of the server? It will be displayed on the client.
3 - 15 letters or digits
[ server name ] Seafile

What is the ip or domain of the server?
For example: www.mycompany.com, 192.168.1.101
[ This server's ip or domain ] xxxxxxxxx

Which port do you want to use for the ccnet server?
[ default "10001" ] 10001

Where do you want to put your seafile data?
Please use a volume with enough free space
[ default "/var/www/seafile/seafile-data" ] /home/yunohost.app/seafile-data

Which port do you want to use for the seafile server?
[ default "12001" ] 12001

Which port do you want to use for the seafile fileserver?
[ default "8082" ] 8082

-------------------------------------------------------
Please choose a way to initialize seafile databases:
-------------------------------------------------------

[1] Create new ccnet/seafile/seahub databases
[2] Use existing ccnet/seafile/seahub databases

[ 1 or 2 ] 2

What is the host of mysql server?
[ default "localhost" ] localhost

What is the port of mysql server?
[ default "3306" ] 3306

Which mysql user to use for seafile?
[ mysql user for seafile ] seafile

What is the password for mysql user "seafile"?
[ password for seafile ]

verifying password of user seafile ...  done

Enter the existing database name for ccnet:
[ ccnet database ] ccnetdb

verifying user "seafile" access to database ccnetdb ...  done

Enter the existing database name for seafile:
[ seafile database ] seafiledb

verifying user "seafile" access to database seafiledb ...  done

Enter the existing database name for seahub:
[ seahub database ] seahubdb

verifying user "seafile" access to database seahubdb ...  done

---------------------------------
This is your configuration
---------------------------------

    server name:            Seafile
    server ip/domain:       xxxxxxxxx
    ccnet port:             10001

    seafile data dir:       /home/yunohost.app/seafile-data
    seafile port:           12001
    fileserver port:        8082

    database:               use exising
    ccnet database:         ccnetdb
    seafile database:       seafiledb
    seahub database:        seahubdb
    database user:          seafile



---------------------------------
Press ENTER to continue, or Ctrl-C to abort
---------------------------------

Generating ccnet configuration ...

done
Successly create configuration dir /var/www/seafile/ccnet.
Generating seafile configuration ...

Done.
done
Generating seahub configuration ...

----------------------------------------
Now creating seahub database tables ...

----------------------------------------

creating seafile-server-latest symbolic link ...  done




-----------------------------------------------------------------
Your seafile server configuration has been finished successfully.
-----------------------------------------------------------------

run seafile server:     ./seafile.sh { start | stop | restart }
run seahub  server:     ./seahub.sh  { start <port> | stop | restart <port> }

-----------------------------------------------------------------
If you are behind a firewall, remember to allow input/output of these tcp ports:
-----------------------------------------------------------------

port of ccnet server:         10001
port of seafile server:       12001
port of seafile fileserver:   8082
port of seahub:               8000

When problems occur, Refer to

        https://github.com/haiwen/seafile/wiki

for information.


+ sudo sed -i s@http://@https://@g /var/www/seafile/ccnet/ccnet.conf
+ sudo sed -i s@:8000@/seafile@g /var/www/seafile/ccnet/ccnet.conf
+ echo 'FILE_SERVER_ROOT = "https://xxxxxxxxx/seafhttp"'
+ sudo tee -a /var/www/seafile/seahub_settings.py
FILE_SERVER_ROOT = "https://xxxxxxxxx/seafhttp"
+ echo 'SITE_ROOT = "/seafile/"'
+ sudo tee -a /var/www/seafile/seahub_settings.py
SITE_ROOT = "/seafile/"
+ echo 'SERVE_STATIC = False'
+ sudo tee -a /var/www/seafile/seahub_settings.py
SERVE_STATIC = False
+ echo 'MEDIA_URL = "/seafile/media/"'
+ sudo tee -a /var/www/seafile/seahub_settings.py
MEDIA_URL = "/seafile/media/"
+ echo 'EMAIL_USE_TLS = False'
+ sudo tee -a /var/www/seafile/seahub_settings.py
EMAIL_USE_TLS = False
+ echo 'EMAIL_HOST = "localhost"'
+ sudo tee -a /var/www/seafile/seahub_settings.py
EMAIL_HOST = "localhost"
+ echo 'EMAIL_HOST_USER = "seafile@xxxxxxxxx"'
+ sudo tee -a /var/www/seafile/seahub_settings.py
EMAIL_HOST_USER = "seafile@xxxxxxxxx"
+ echo 'EMAIL_HOST_PASSWORD = ""'
+ sudo tee -a /var/www/seafile/seahub_settings.py
EMAIL_HOST_PASSWORD = ""
+ echo 'EMAIL_PORT = "25"'
+ sudo tee -a /var/www/seafile/seahub_settings.py
EMAIL_PORT = "25"
+ echo 'DEFAULT_FROM_EMAIL = "seafile@xxxxxxxxx"'
+ sudo tee -a /var/www/seafile/seahub_settings.py
DEFAULT_FROM_EMAIL = "seafile@xxxxxxxxx"
+ echo 'SERVER_EMAIL = "seafile@xxxxxxxxx"'
+ sudo tee -a /var/www/seafile/seahub_settings.py
SERVER_EMAIL = "seafile@xxxxxxxxx"
+ echo '[LDAP]'
+ sudo tee -a /var/www/seafile/ccnet/ccnet.conf
[LDAP]
+ echo 'HOST = ldap://localhost:389'
+ sudo tee -a /var/www/seafile/ccnet/ccnet.conf
HOST = ldap://localhost:389
+ echo 'BASE = ou=users,dc=yunohost,dc=org'
+ sudo tee -a /var/www/seafile/ccnet/ccnet.conf
BASE = ou=users,dc=yunohost,dc=org
+ echo 'LOGIN_ATTR = mail'
+ sudo tee -a /var/www/seafile/ccnet/ccnet.conf
LOGIN_ATTR = mail
+ sudo cp ../conf/seafile-server /etc/init.d
+ sudo sed -i s@SEAHUB_PORT@8000@g /etc/init.d/seafile-server
+ sudo sed -i s@SEAFILE_DIR@/var/www/seafile@g /etc/init.d/seafile-server
+ sudo chmod +x /etc/init.d/seafile-server
+ sudo update-rc.d seafile-server defaults
update-rc.d: using dependency based boot sequencing
+ sed -i s@PATHTOCHANGE@/seafile@g ../conf/nginx.conf
+ sed -i s@ALIASTOCHANGE@/var/www/seafile/@g ../conf/nginx.conf
+ sed -i s@SEAHUB_PORT@8000@g ../conf/nginx.conf
+ sed -i s@SEAFILE_FILESERVER_PORT@8082@g ../conf/nginx.conf
+ sudo cp ../conf/nginx.conf /etc/nginx/conf.d/xxxxxxxxx.d/seafile.conf
+ sudo cp ../conf/first_launch.exp /var/www/seafile
+ sudo chmod +x /var/www/seafile/first_launch.exp
+ sudo chown -R www-data:www-data /var/www/seafile
+ sudo chown -R www-data:www-data /home/yunohost.app/seafile-data
+ sudo yunohost firewall allow 10001
usage: yunohost firewall allow [-h] [--no-upnp] [--no-reload] [-6] [-4]
                               {TCP,UDP,Both} port
yunohost firewall allow: error: argument protocol: invalid choice: '10001' (choose from 'TCP', 'UDP', 'Both')
+ sudo yunohost firewall allow 12001
usage: yunohost firewall allow [-h] [--no-upnp] [--no-reload] [-6] [-4]
                               {TCP,UDP,Both} port
yunohost firewall allow: error: argument protocol: invalid choice: '12001' (choose from 'TCP', 'UDP', 'Both')
+ sudo su - www-data -c '/var/www/seafile/seafile-server-4.0.6/seafile.sh start'

Starting seafile server, please wait ...
Seafile server started

Done.
+ sudo su - www-data -c '/var/www/seafile/first_launch.exp xxxxxxxxx@xxxxxxxxx xxxxxxxxx'
spawn /var/www/seafile/seafile-server-4.0.6/seahub.sh start-fastcgi

Starting seahub (fastcgi) at 127.0.0.1:8000 ...

----------------------------------------
It's the first time you start the seafile server. Now let's create the admin account
----------------------------------------

What is the email for the admin account?
[ admin email ] xxxxxxxxx@xxxxxxxxx

What is the password for the admin account?
[ admin password ]

Enter the password again:
[ admin password again ]



----------------------------------------
Successfully created seafile admin
----------------------------------------



Loading ccnet config from /var/www/seafile/ccnet
Loading seafile config from /home/yunohost.app/seafile-data

Seahub is started

Done.

+ sudo cp ../conf/add_sso_conf.py /var/www/seafile
+ sudo cp ../conf/remove_sso_conf.py /var/www/seafile
+ sudo python /var/www/seafile/add_sso_conf.py
+ sudo yunohost app setting seafile unprotected_uris -v /media
+ '[' Yes = No ']'
+ sudo yunohost app setting seafile unprotected_uris -v /
+ sudo yunohost service add seafile-server
Succès ! Service ajouté avec succès
+ sudo service nginx reload
Reloading nginx configuration: nginx.
+ sudo yunohost app ssowatconf
Succès ! Configuration de SSOwat générée avec succès
+ sudo service seafile-server start
Erreur : Échec de l'installation

After the installation, I opened ports 10001 and 12001 manually because the script seems have an issue with that.

It’s not a big problem but maybe it can help you to make it better.

EDIT: In English please :wink:

Bonjour, j’ai enfin réussi l’instal de seafile. Par contre j’arrive sur cette page :

Une idée ? (j’ai bien ouvert les ports)

Page unavailable

Sorry, but the requested page is unavailable due to a
server hiccup.

Our engineers have been notified, so check back later.

Merci !

having a little trouble every time i restart the server seafile disappears

sudo yunohost firewall allow xxxx
usage: yunohost firewall allow [-h] [–no-upnp] [–no-reload] [-6] [-4]
{TCP,UDP,Both} port
yunohost firewall allow: error: argument protocol: invalid choice: ‘xxxx’ (choose from ‘TCP’, ‘UDP’, ‘Both’)

error i have open the ports by hand but still having the problem of seafile diapering from yunohost after a while

found that seafile disappears after removing any other app dont know why or is it just me having this issue???

Hi, what do you mean when you say “seafile disappears” ? Does it disappears on the yunohost panel ? Can you still access it by the url ?

Anyway I don’t have this issue on my yunohost.

Thanks to @Josue the package is now up to date :grinning:

Update to Seafile v4.3.2 changelog
Update script
Add armhf support but please see this issue : https://github.com/haiwen/seafile/issues/1358
Add logrotate
Add webdav

Upgrade from command line with:

sudo yunohost app upgrade -u https://github.com/mbugeia/seafile_ynh seafile

Hello,

I understand that this package can’t use the SSO auto-login because of login is an email. Right?
But I have also see on this rainloop package that the SSO is working.
Is there anyway to use the trick on your Seafile package?
I don’t code and i dont fully understand where to look inside the code. So I ask :wink:

Hi @juliencognito,
Seafile can’t use the SSO because it does not support HTTP basic authentification. The package connect seafile to the LDAP so you can login with email.

It’s unlikely to makes seafile work with the SSO soon because Seafile only support email login, not username from now (but maybe that will change). The rainloop trick won’t work, mainly because it’s PHP and Seafile is written in python.