Giter Club home page Giter Club logo

seafile-docker's Introduction

About

  • Docker is an open source project to pack, ship and run any Linux application in a lighter weight, faster container than a traditional virtual machine.

  • Docker makes it much easier to deploy a Seafile server on your servers and keep it updated.

  • The base image configures Seafile with the Seafile team's recommended optimal defaults.

If you are not familiar with docker commands, please refer to docker documentation.

Getting Started

Please refer to the Deploy Documentation.

seafile-docker's People

Contributors

300481 avatar alexcxc avatar bestlibre avatar cuihaikuo avatar fakuivan avatar freeplant avatar kklein33 avatar libeanim avatar lins05 avatar mainboarder avatar mjkent avatar moritzschaefer avatar renfeipeng avatar shoeper avatar skywalkerspace avatar stevesbrain avatar wacmkxiaoyi avatar wenbinhou avatar yatesco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

seafile-docker's Issues

migration + upgrade issues - start docker without starting seafile server

I'm struggling to migrate from an old non-docker seafile install to a docker install, and at present it seems I will need a way to enter the seafile container without immediately launching the seafile servers to be able to update mysql databases and to run the update scripts of seafile data. If the seafile services are stopped from within the container, the container exits due to a watchdog iincluded in scripts/start.py

Since this turned out to be a bit of a challenge I thought to document the need and the key points of the process here. Upon starting the seafile container it executes scripts/start.py so I decided to include a mechanism to interrupt the normal startup procedure before starting the seafile services. At present I simply do this by adding to start.py a snippet

controller_pid = get_command_output('ls /shared/seafile-block-pid || true').strip()
if not controller_pid:
    print 'Starting normally'
else:
    print 'dont start, exit after sleep period'
    time.sleep(10000000);
    sys.exit(1)

just after the wait_for_mysql() command. (note that this probably requires also disabling the check for consistent git-image in ./launcher - see the issue " installation process does not work for SELinux enabled host #11" )

This prevents seafile services from starting if the file shared/seafile-block-pid exists. Then the normal launcher enter command can be used to work in the container without seafile. Removing/renaming the file then enables the normal startup process.

Is there a better/less ugly way to enter the container/migrate a setup from an old server to seafile? I also stumbled upon the ability to mount existing containers to a new temporary container using docker run --volumes-from CONTAINER -v container_path :mountpoint, but I wasn't able to figure out if this would be useful or not.

upgrade.py - wrong order of updates - includes fix info

I had the surprise to have applied first some 6.* upgrade instead of a 5.0 to 5.1 when data was hosted under NFS (exported from zfs). It worked ok on my local machine.

Reason is that glob() call does not guarantee any order, so you need to do a "sorted(glob....)"
Hope that helps.
Have a nice day!

How to start seafile again

Rather a beginner question than a real issue I guess.

I followed the manual and the seafile docker image started.
I could login with an admin user.

I then stopped the seafile docker image

docker stop seafile

How can I start it again now?

The initial code

docker run -d --name seafile
-e SEAFILE_SERVER_HOSTNAME=seafile.example.com
-e SEAFILE_ADMIN_EMAIL=[email protected]
-e SEAFILE_ADMIN_PASSWORD=a_very_secret_password
-v /opt/seafile-data:/shared
-p 80:80
seafileltd/seafile:latest

gives the error:

docker: Error response from daemon: Conflict. The container name "/seafile" is already in use by container "d083bda8da18d2524bddcdb22c7118830ab80a8834fb4c97b74cebd47c5ca4c0". You have to remove (or rename) that container to be able to reuse that name.

Migration from launcher

The commands for the migration are not working, because the image is not published. Also you have to mount some more directories to get the container working, e.g for my configuration behind a proxy:

docker run -d --restart=always --name seafile -h seafile -v /var/seafile/shared:/shared -v /var/seafile/shared/logs/var-log:/var/log -v /var/seafile/shared/db:/var/lib/mysql -v /var/seafile/shared/.bash_history:/root/.bash_history -p 127.0.0.1:81:80 local_seafile/server:latest

Custom data directory

I would like to choose a mountpoint (/media/harddrivexyz) for the seafile data directory (currently in shared/seafile). Unfortunately a simple symlink inside shared doesn't work, as the seafile-container won't find the target of the symlink.
Is the best solution to update the launcher file and set custom paths in there to achieve custom data-directories?

安装成功之后 使用docker restart seafile 重启失败

*** Init system aborted.
*** Killing all processes...
*** Running /etc/my_init.d/01_create_data_links.sh...
ln: /opt/seafile/seahub-data: cannot overwrite directory
*** /etc/my_init.d/01_create_data_links.sh failed with status 1
*** Killing all processes...
*** Running /etc/my_init.d/01_create_data_links.sh...
ln: /opt/seafile/seahub-data: cannot overwrite directory
*** /etc/my_init.d/01_create_data_links.sh failed with status 1
*** Killing all processes...

Multisite on a single server

I noticed that seafile-docker is based on discourse-docker project. In discourse by setting the nginx in container to listen on a unix socket, I can host multiple sites using nginx in the host machine.

Is it possible for seafile-docker to do the same? I haven't tried to modify the nginx template yet. Are there more modifications needed?

Error on start

Hi there,
I am trying to start up the Docker image. However it fails with
"cat: /var/seafile/shared/seafile/seafile-data/current_version: No such file or directory"

According to the launcher script the version_stamp_file is supposed to be in the "shared" dir within the docker dir.
However this dir is empty. Any hints what I am missing out here?

How to use Webdav?

I am trying to enable Webdav access to my Seafile server. How to do that? I tried the sample configurations 1 and 2 from the Webdav documentation with no success. Thanks

Unable to write 'random state' e is 65537 (0x10001) during bootstrap

Generating RSA private key, 4096 bit long modulus
.++
..................................................................................++
unable to write 'random state'
e is 65537 (0x10001)
Generating RSA private key, 4096 bit long modulus
..........................................................++
.......++
unable to write 'random state'
e is 65537 (0x10001)

Could it be, that the key generated by the bootstrapping process could not get random numbers, so the cert and key are not secure?

How to run seaf-fuse with the docker container server

I'm interested in fuse access to the seafile file data outside the container so I can use read-only command line tools to copy uploaded files around as needed for our sysadmin workflow. Is support for seaf-fuse planned in seafile-docker?

I can see this work one of two ways --

  1. run seaf-fuse inside the seafile docker container, passing --privileged --cap-add=SYS_ADMIN --device /dev/fuse when started, and mapping the fuse mountpoint out of the container for read-only access.

  2. run seaf-fuse outside the container by accessing the shared/db/... data to create the view at the fuse mountpoint. Is this even possible or does seaf-fuse interact directly with the seafile process?

Thank you.

Upgrade from 6.0.5 to 6.0.7 hangs

Hi all,

I run the 6.0.5 version for a month without any problems.
Now I tried the upgrade with "./launcher rebuild" and after a while the message "Now building the local docker image." appears. From now on the CPU is busy with about 20% and the disk fills, but nothing else happens. After an hour or so I canceled the script before the disk was full. There is nothing to see in the system logs, the new image is correctly pulled but no new container is build.
Obviously it is the command "docker build -f bootstrap/generated/Dockerfile -t local_seafile/server:latest . >/dev/null" that loops(?) and I have noticed that the new Dockerfile differs from the prevoius:

_6.0.7
...
RUN cp -rp /app/scripts /scripts &&
cp -rp /app/bootstrap /bootstrap &&
cp /app/bootstrap/generated/seafile.nginx.conf /etc/nginx/sites-enabled/seafile.nginx.conf

6.0.5
...
RUN cp -rp /app/scripts /scripts &&
cp -rp /app/bootstrap /bootstrap &&
*cp /app/scripts/tmp/check_init_admin.py /opt/seafile/seafile-server-6.0.5/check_init_admin.py && *
cp /app/bootstrap/generated/seafile.nginx.conf /etc/nginx/sites-enabled/seafile.nginx.conf_

Can anyone help?
Thanks!

Publish Docker Container under Different Port

Hi guys,

I want to deploy the seafile-server under a different port (e.g. 8200).

What I did

  1. Setting the hostname + port mapping in the bootstrap/bootstrap.conf to:

    server.hostname = <local ip>:8200
    server.port_mappings = 8200:80
    

    (where <local ip> represents the lan ip address of the server containing the docker container, e.g. 192.178.1.2)

  2. Build the image: ./launcher bootstrap

  3. Set SERVICE_URL to http://<local ip>:8200 and the FILE_SERVER_ROOTto http://<local ip>:8200/seafhttp via the ccnet.conf and seahub_settings.py

  4. Start the container: ./launcher start

The proplem
When I want to connect, I get redirected to the wrong address. In this case http://<local ip>/accounts/login?next=/ instead of http://<local ip>:8200/accounts/login?next=/

Did I miss something or is there a bug?

Add a flag to use existing MySQL installation

Hey there,
it would be nice to have a flag during install to use a MySQL installation outside of the container. Right now you have to exec

service mysql stop

inside the container to have a portmapping for 3306.

I'm migrating myself to a docker container right now, so maybe I will post a code snippet for the launcher-file myself in the next days/weeks.

Launcher recommends wrong image

shows

Or run this command directly:

   docker rm -f seafile
   docker run -d -it --name seafile -v /opt/projects/seafile/shared:/shared -p 80:80 -p 443:443 seafileltd/server

while it should be
seafileltd/seafile:latest

can't upload and download any files

command like this:

# docker run -d --name seafile -e SEAFILE_SERVER_HOSTNAME=xxx.xxx.xxx.xxx -e SEAFILE_ADMIN_EMAIL=[email protected] -e SEAFILE_ADMIN_PASSWORD=xxxxxx -v /data/seafile-data:/shared -p 80:80 seafileltd/seafile:latest

ERROR

tim 20180420144404

Changing domain name

I'm trying to change and rewrite my domain name. However, nginx still redirects to my old domain name from the new one, invalidating the ssl certificate I created for the new domain.

So far I changed the server.hostname in bootstrap.conf, followed by a rebuild. I also changed the hostname in ccnet.conf and seahub_settings.py, but to no avail.

Any help much appreciated!

A rebuild doesn't remove the old docker image

After calling ./launcher rebuild a new container image is build, however the old image (local_seafile/server:latest) doesn't get removed and is now shown as <none>:<none>:

$ sudo docker images
REPOSITORY             TAG                 IMAGE ID            CREATED             SIZE
local_seafile/server   latest              7960eb51b534        20 seconds ago      824 MB
<none>                 <none>              40f5c8086ec9        21 minutes ago      824 MB
<none>                 <none>              af6c195a6b48        About an hour ago   824 MB
seafileltd/seafile     6.0.7               8654b3e742ad        4 months ago        824 MB

stuck on wait_for_mysql

Hello there,
I'm trying to move seafile-docker to new host, sudo ./launcher rebuild stuck on wait_for_mysql line of main function. if i comment out this line, docker container is created but return 502 as result.
here's a mysql.log:

180108 11:13:41 [Note] /usr/sbin/mysqld (mysqld 10.0.27-MariaDB-0ubuntu0.16.04.1) starting as process 331 ...
180108 11:13:41 [Warning] Can't create test file /var/lib/mysql/846d6bfd2437.lower-test
180108 11:13:41 [ERROR] mysqld: Can't create/write to file '/var/lib/mysql/aria_log_control' (Errcode: 13 "Permission denied")
180108 11:13:41 [ERROR] mysqld: Got error 'Can't create file' when trying to use aria control file '/var/lib/mysql/aria_log_control'
180108 11:13:41 [ERROR] Plugin 'Aria' init function returned error.
180108 11:13:41 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
180108 11:13:41 [Note] InnoDB: Using mutexes to ref count buffer pool pages
180108 11:13:41 [Note] InnoDB: The InnoDB memory heap is disabled
180108 11:13:41 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
180108 11:13:41 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
180108 11:13:41 [Note] InnoDB: Compressed tables use zlib 1.2.8
180108 11:13:41 [Note] InnoDB: Using Linux native AIO
180108 11:13:41 [Note] InnoDB: Using CPU crc32 instructions
180108 11:13:41 [Note] InnoDB: Initializing buffer pool, size = 128.0M
180108 11:13:41 [Note] InnoDB: Completed initialization of buffer pool
180108 11:13:41 [ERROR] InnoDB: ./ibdata1 can't be opened in read-write mode
180108 11:13:41 [ERROR] InnoDB: The system tablespace must be writable!
180108 11:13:41 [ERROR] Plugin 'InnoDB' init function returned error.
180108 11:13:41 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
180108 11:13:41 [Note] Plugin 'FEEDBACK' is disabled.
180108 11:13:41 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
180108 11:13:41 [ERROR] Unknown/unsupported storage engine: InnoDB
180108 11:13:41 [ERROR] Aborting

180108 11:13:41 [Note] /usr/sbin/mysqld: Shutdown complete

do i need to install mysql on my host engine? because I've only moved seafile folder. assuming this mysql is going to started on isolated container.

Probleam restarting container

I've installed seafile docker with

docker run -d --name seafile -e SEAFILE_SERVER_HOSTNAME=files.begtin.tech -v /opt/seafile-data:/shared -p 3080:80 seafileltd/seafile:latest

after restart I've got this in log

*** Killing all processes...
*** Running /etc/my_init.d/01_create_data_links.sh...
ln: /opt/seafile/seahub-data: cannot overwrite directory
*** /etc/my_init.d/01_create_data_links.sh failed with status 1

*** Killing all processes...

Error: Failed to prepare seahub avatars dir: [Errno 39] Directory not empty:

Seems I found a bug with this. When running ./launcher bootstrap I get the following error:

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

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

Error: Failed to prepare seahub avatars dir: [Errno 39] Directory not empty: '/opt/seafile/seafile-server-6.0.7/seahub/media/avatars/groups'
Traceback (most recent call last):
  File "/scripts/bootstrap.py", line 196, in <module>
    main()
  File "/scripts/bootstrap.py", line 189, in main
    init_seafile_server()
  File "/scripts/bootstrap.py", line 141, in init_seafile_server
    call('{} auto -n seafile'.format(setup_script), env=env)
  File "/scripts/utils/__init__.py", line 68, in call
    return subprocess.check_call(*a, **kw)
  File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '/opt/seafile/seafile-server-6.0.7/setup-seafile-mysql.sh auto -n seafile' returned non-zero exit status 1

Version 6.0.9

About

Docker makes it much easier to deploy a Seafile server on your servers and keep it updated.

How can we get version 6.0.9? ;)

Multiple instances on the same machine

As this script uses a static name for the running docker container, it is not possible to start two dockerized seafile instances on the same machine.

Is there any workaround to get a second instance of this seafile container running on the same machine? I want to host two clouds (one for myself and one for my class).

Some feedback

Lets encrypt doesn't seems to work, after its done it will check for verification on the domain with the "acme" check if the domain is not yet life. (think of moving servers)

The example is called server.conf and the destination in the bootstrap folder is bootstrap.conf, usually you copy files "as is" and otherwise call them bootstrap.conf.example. I just copied the files but then it just creates a server that does not function at all

For above ^ error, you would not see port 80/443 as being exposed to the outside. (i presume why you have a PR with EXPOSE 80 443, since it works if you have it correct)

Running multiple sites on 1 server doesn't work because of the nginx using up the same port, adding virtual domains and placing a nginx config in the data folder would be a nice idea. Perhaps creating a shared/domainname/ folder and having a nginx in /shared/nginx/ with domainname.conf per server might do the trick.

Add the option to create a self signed cert, if only for testing purpose. You might not have proper internet to create the letsencrypt certs too, but once you do, you can always rebuild right?

These are just some points i noticed when trying to get this to run, trying to help out on things, other then that it does what i want. Nice work.

Problem with docker-compose

Hello. I'm trying to run seafile-docker via docker compose.
my docker-compose file looks like that:

version: '3'

services:
  seafile:
    image: seafileltd/seafile:6.2.5
    volumes:
      - ./shared:/shared
    ports:
      - 80:80
    env_file:
      - seafile.env

seafile.env looks like that:

SEAFILE_SERVER_HOSTNAME='seafile.domain.tld'
SEAFILE_ADMIN_EMAIL='[email protected]'
SEAFILE_ADMIN_PASSWORD='megasecret'

The first launch is no problem. everthing is set up correctly (imho).
now i clean up everything docker related:

docker rm $(docker ps -a -q)

When relaunching the compose with docker-compose up i get the following error:

 07:52:07  docker-compose up
Starting seafiledocker_seafile_1 ... done
Attaching to seafiledocker_seafile_1
seafile_1  | *** Running /etc/my_init.d/01_create_data_links.sh...
seafile_1  | ln: /opt/seafile/seahub-data: cannot overwrite directory
seafile_1  | *** /etc/my_init.d/01_create_data_links.sh failed with status 1
seafile_1  |
seafile_1  | *** Killing all processes...
seafiledocker_seafile_1 exited with code 1

launching it via docker-compose up -Vworks fine.

=> there seems to be something strange with the docker volumes?

EDIT: this seems NOT to be reproducable:

  1. initial setup
  2. stop and remove container
  3. start works not
  4. start with -V works
  5. start without -V works
  6. stop and remove container
  7. works without -V
  8. restart without -V works NOT

quite confusing

main : Unable to find type [CommandNotFoundException].

I know nothing about .NET or Powershell or windows, but tried the Windows specific README and got this error:

PS C:\Users\server\seafile-docker> .\launcher.ps1 bootstrap
main : Unable to find type [CommandNotFoundException].
En C:\Users\server\seafile-docker\launcher.ps1: 602 Character: 1
+ main @args
+ ~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (CommandNotFoundException:TypeName) [main], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound,main

Actually i edited the launcher.ps1 where the CommandNotFoundException was catched, leaving just "Exception" (as a Java developer, it made sense), and it worked.

I have Windows 10 installed, these are the versions of .NET:

``PS C:\Users\server\seafile-docker> Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse |
>> Get-ItemProperty -name Version -EA 0 |
>> Where { $_.PSChildName -match '^(?!S)\p{L}'} |
>> Select PSChildName, Version

PSChildName Version
----------- -------
Client      4.7.02556
Full        4.7.02556
Client      4.0.0.0

Diffie Helman key implementation

Hi,

So far this docker image runs perfectly on a Debian 9 VPS, thanks!

What I want to do now is edit the config files to include a dh key. I tried including the generated key in /image/base/Dockerfile, in order to copy it into the Docker filesystem, and then editing /templates/seafile.nginx.conf.template to point to it, but nginx reports it cannot find the file after running ./launcher rebuild.

Any help with this would be much appreciated!

installation process does not work for SELinux enabled host

The present version of the installer does not appear to support installation on SELinux enabled hosts.

To enable installation I needed to edit the launcher script to include the option :Z for each volume mount (e.g. -v ${dockerdir}/scripts:/scripts:Z or $dockerdir/scripts:/scripts:ro,Z in case :ro was already used) as instructed in http://stackoverflow.com/questions/24288616/permission-denied-on-accessing-host-directory-in-docker.

((In addition, to disable checking launcher overwrites upon each container rebuild I also needed to replace for now the line
# if [[ "e$(git symbolic-ref --short HEAD)" == "master" ]]; then
with
if [[ "e$(git symbolic-ref --short HEAD)" == "masteriii" ]]; then
in the rebuild() function in launcher ))

Would it be possible to include the :Z (or :ro,Z) flag by default in the launcher script, or will it harm the installation on non-SElinux systems?

mysql does not start on bootstrap

I'm following the installation of the README.

  • Copied boostrap.conf and edited it.
  • running ./launcher bootstrap:
[root@bread:/srv/docker/seafile/seafile-docker] master ± ./launcher -v bootstrap
*** Running /etc/my_init.d/99_mysql_setup.sh...
*** Running /etc/my_init.d/create_data_links.sh...
*** Running /etc/rc.local...
*** Booting runit daemon...
*** Runit started as PID 10
*** Running /scripts/bootstrap.py...
[2017-07-04 09:31:27] Generating local Dockerfile ...
[2017-07-04 09:31:27] [debug] waiting for mysql server to be ready
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111 "Connection refused")'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111 "Connection refused")'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
[2017-07-04 09:31:29] [debug] mysql server is ready
[2017-07-04 09:31:29] Now running setup-seafile-mysql.py in auto mode.
Checking python on this machine ...
  Checking python module: setuptools ... Done.
  Checking python module: python-imaging ... Done.
  Checking python module: python-mysqldb ... Done.


verifying password of user root ...  
verifying password of user root ...  
Failed to connect to mysql server using user "root" and password "***": Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)                                                     

Traceback (most recent call last):
  File "/scripts/bootstrap.py", line 196, in <module>
    main()
  File "/scripts/bootstrap.py", line 189, in main
    init_seafile_server()
  File "/scripts/bootstrap.py", line 141, in init_seafile_server
    call('{} auto -n seafile'.format(setup_script), env=env)
  File "/scripts/utils/__init__.py", line 68, in call
    return subprocess.check_call(*a, **kw)
  File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '/opt/seafile/seafile-server-6.0.9/setup-seafile-mysql.sh auto -n seafile' returned non-zero exit status 255
*** /scripts/bootstrap.py exited with status 1.
*** Shutting down runit daemon (PID 10)...
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111 "Connection refused")'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
*** Killing all processes...

Why does MySQL not start?

I'm running this on basic ArchLinux System. Running with docker 17.05.

ttyname failed: Inappropriate ioctl for device

test the docker on hub, with:

docker run -d --name=seafile -p 9080:80 -p 9445:443 seafileorg/server:6.0.7

can't start the container, logs:

*** Running /etc/my_init.d/99_mysql_setup.sh...
*** Running /etc/my_init.d/create_data_links.sh...
*** Running /etc/rc.local...
*** Booting runit daemon...
*** Runit started as PID 15
*** Running bash -l...
mesg: ttyname failed: Inappropriate ioctl for device
*** bash exited with status 0.
*** Shutting down runit daemon (PID 15)...
*** Killing all processes...
*** Running /etc/my_init.d/99_mysql_setup.sh...
*** Running /etc/my_init.d/create_data_links.sh...
*** Running /etc/rc.local...
*** Booting runit daemon...
*** Runit started as PID 14
*** Running bash -l...
mesg: ttyname failed: Inappropriate ioctl for device
*** bash exited with status 0.
*** Shutting down runit daemon (PID 14)...
*** Killing all processes...

lets encrypt is not updating itself

lets encrypt certificates are not updated by default

-> problem was homemade -> server was only available over https -> and that is not working with letsencrypt at least in the default configuration.
-> did the job by manual renewing the certificate

Support non-root use

On my server, I set up my user account to be able to control Docker. I also run Discourse, which works perfectly fine like that.

However, at least the bootstrap command currently runs into an error when a container already exists:

fuzzy@server:/opt/seafile $ ./launcher bootstrap
touch: cannot touch '/opt/seafile/shared/logs/var-log/syslog': Permission denied

There may be other instances where the launcher tries to access container files that would be owned by UID 0.

My suggestion: Either go through docker run to deal with those files or evaluate if accessing them is really necessary. touching the syslog doesn’t appear all that important to me. 😄

/edit: Starting also does not work:

fuzzy@server /opt/seafile $ ./launcher start
cat: /opt/seafile/shared/seafile/seafile-data/current_version: Permission denied

6.2.5 ist not published in docker:hub

# docker pull seafileltd/seafile:6.2.5
Error response from daemon: manifest for seafileltd/seafile:6.2.5 not found
# docker pull seafileltd/seafile:latest
Error response from daemon: manifest for seafileltd/seafile:latest not found

Run on subdomain only

Hi, great image! Thanks for taking the time to put this together.

I am using seafile-docker on a server that (will) have multiple sites, for example

files.mydomain.com for Seafile
blog.mydomain.com for a blog
mydomain.com for the main website

Because Nginx seems to be running in the same container as seafile-docker, is it actually possible to support the above configuration? Or is this image designed to only be run on it's own server?

I'm not sure how I can configure multiple docker sites on port 80 as I'd have to configure everything after running ./launcher enter which doesn't seem ideal.

Any ideas how I could approach this?

Cheers!

launcher bootstrap hangs on "Waiting for mysqld to come online"

I tried using your docker setup on my macOS Sierra laptop with the up to date Docker for Mac.

It hangs on:

./launcher bootstrap
[...]
Rebuilding mysql data dir
chown: changing ownership of '/var/lib/mysql': Operation not permitted
/etc/my_init.d/99_mysql_setup.sh: line 11: /var/log/mysql-bootstrap.log: Permission denied
Starting mysqld
Waiting for mysqld to come online
/etc/my_init.d/99_mysql_setup.sh: line 17: /var/log/mysql-bootstrap.log: Permission denied

Since I just wanted to play around with it on macOS, but actually use it on a Linux server, I didn't dig into those permission errors, but just tried out running it inside the provided vagrant.

inside the freshly provisioned vagrant I run:

sudo -i
./launcher bootstrap
[...]
Rebuilding mysql data dir
Starting mysqld
Waiting for mysqld to come online

In the vagrant machine, it's the same - it infinitely waits for the mysqld to start.

Update
Found the mysql-bootsrap.log:

Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
170211 18:23:06 [Note] /usr/sbin/mysqld (mysqld 10.0.27-MariaDB-0ubuntu0.16.04.1) starting as process 34 ...
170211 18:23:06 [ERROR] mysqld: Can't create/write to file '/var/lib/mysql/aria_log_control' (Errcode: 13 "Permission denied")
170211 18:23:06 [ERROR] mysqld: Got error 'Can't create file' when trying to use aria control file '/var/lib/mysql/aria_log_control'
170211 18:23:06 [ERROR] Plugin 'Aria' init function returned error.
170211 18:23:06 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
170211 18:23:06 [Note] InnoDB: Using mutexes to ref count buffer pool pages
170211 18:23:06 [Note] InnoDB: The InnoDB memory heap is disabled
170211 18:23:06 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
170211 18:23:06 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
170211 18:23:06 [Note] InnoDB: Compressed tables use zlib 1.2.8
170211 18:23:06 [Note] InnoDB: Using Linux native AIO
170211 18:23:06 [Note] InnoDB: Using CPU crc32 instructions
170211 18:23:06 [Note] InnoDB: Initializing buffer pool, size = 128.0M
170211 18:23:06 [Note] InnoDB: Completed initialization of buffer pool
2017-02-11 18:23:06 7f31099e8780  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
2017-02-11 18:23:06 7f31099e8780  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
170211 18:23:06 [ERROR] InnoDB: Creating or opening ./ibdata1 failed!
170211 18:23:06 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
170211 18:23:06 [ERROR] Plugin 'InnoDB' init function returned error.
170211 18:23:06 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
170211 18:23:06 [ERROR] Unknown/unsupported storage engine: InnoDB
170211 18:23:06 [ERROR] Aborting

170211 18:23:06 [Note] /usr/sbin/mysqld: Shutdown complete

cat: write error: Broken pipe

Installation of system tables failed!  Examine the logs in
/var/lib/mysql for more information.

The problem could be conflicting information in an external
my.cnf files. You can ignore these by doing:

    shell> /usr/scripts/scripts/mysql_install_db --defaults-file=~/.my.cnf

You can also try to start the mysqld daemon with:

    shell> /usr/sbin/mysqld --skip-grant --general-log &

and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:

    shell> /usr/bin/mysql -u root mysql
    mysql> show tables;

Try 'mysqld --help' if you have problems with paths.  Using
--general-log gives you a log in /var/lib/mysql that may be helpful.

The latest information about mysql_install_db is available at
https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
MariaDB is hosted on launchpad; You can find the latest source and
email lists at http://launchpad.net/maria

Please check all of the above before submitting a bug report
at http://mariadb.org/jira

170211 18:23:06 mysqld_safe Logging to syslog.
170211 18:23:06 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170211 18:23:06 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

chown -R mysql.mysql /var/lib/mysql in 99_mysql_setup.sh maybe fails. When running it manually, it results in chown: invalid user: ‘mysql.mysql’; there is no mysql-server or mariasql-server installed apparantly?

HTTPS Error

[2018-03-14 00:25:25] Generating local Dockerfile ... [2018-03-14 00:25:25] Preparing for letsencrypt ... [2018-03-14 00:25:25] Starting letsencrypt verification Already up-to-date. Parsing account key... Parsing CSR... Registering account... Already registered! Verifying seafile.link15.de... Traceback (most recent call last): File "/shared/ssl/letsencrypt/acme_tiny.py", line 198, in <module> main(sys.argv[1:]) File "/shared/ssl/letsencrypt/acme_tiny.py", line 194, in main signed_crt = get_crt(args.account_key, args.csr, args.acme_dir, log=LOGGER, CA=args.ca) File "/shared/ssl/letsencrypt/acme_tiny.py", line 123, in get_crt wellknown_path, wellknown_url)) ValueError: Wrote file to /var/www/challenges/HY8vyXX7cRndr1JZ3wqylNUjQnSoE9_O_0ovdC3dN_4, but couldn't download http://seafile.link15.de/.well-known/acme-challenge/HY8vyXX7cRndr1JZ3wqylNUjQnSoE9_O_0ovdC3dN_4 Traceback (most recent call last): File "/scripts/bootstrap.py", line 196, in <module> main() File "/scripts/bootstrap.py", line 185, in main init_letsencrypt() File "/scripts/bootstrap.py", line 67, in init_letsencrypt call('/scripts/ssl.sh {0} {1}'.format(ssl_dir, domain)) File "/scripts/utils/__init__.py", line 68, in call return subprocess.check_call(*a, **kw) File "/usr/lib/python2.7/subprocess.py", line 541, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '/scripts/ssl.sh /shared/ssl seafile.link15.de' returned non-zero exit status 1

Any help on that? HTTP works fine, HTTPS dont.. The Certs are created in shared/ssl but https connection is not working

SEAFILE_SERVER_HOSTNAME and https

I'm using Seafile with Docker-compose, and behind Traefik with Let's encrypt.

When setting SEAFILE_SERVER_HOSTNAME in docker-compose, seafile does not check to see if the address starts with http:// or https:// . It will just append it to SERVICE_URL and FILE_SERVER_ROOT.

For example:
In my docker-compose file, I have the following:

 seafile: 
    image: seafileltd/seafile
    container_name: Seafile
    restart: unless-stopped
    environment:
      SEAFILE_ADMIN_EMAIL: [email protected]
      SEAFILE_ADMIN_PASSWORD: My_Password
      SEAFILE_SERVER_HOSTNAME: https://seafile.example.com
    labels:
      - traefik.enable=true
      - traefik.frontend.rule=Host:seafile.example.com
      - traefik.port=80
      - traefik.backend=Seafile
      - traefik.docker.network=web
    volumes:
      - seafile:/shared
    networks:
      - web

If I check my settings panel, it shows:
SERVICE_URL: http://https://seafile.example.com
FILE_SERVER_ROOT: http://https://seafile.example.com/seafhttp

Removing http:// in the settings panel manually fixes the issue.

Nginx Proxy

Okay, need some help here.. I just spend the last 3 hours trying ti figure this out and tried anything I could think about.

I want to use my Nginx Proxy to proxy connections to the Seafile container.
Nginx redirects from port 80 to 443.
Nginx has the SSL certificates.

No matter what I try, I cant figure it out. Help me here mate.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.