foxel / seafile-docker Goto Github PK
View Code? Open in Web Editor NEWSeafile docker image for swift setup
Home Page: https://hub.docker.com/r/foxel/seafile
Seafile docker image for swift setup
Home Page: https://hub.docker.com/r/foxel/seafile
After setting the root password in the docker-compose.override.yml file, I am getting ERROR 1045 (28000): Access denied for user 'root'@'172.xx.x.x' (using password: YES) when running docker-compose exec seafile setup
.
@foxel I would be happy to have a try now,
Could you add some more details :
eg :
These are core features and cannot be ignored or untested.
I don't use docker-compose
I use ansible. (on the bottom is the script).
The problem is, when I run this:
docker exec seafile <password>
I get this
tcp://172.17.0.5:3306 is not a valid port
I could nail it down to this call which breaks
exec python2.7 setup-seafile-mysql.py auto -e 1 -n seafile -p 8082 -o mysql -u seafile -w seafile -c ccnet_db -s seafile_db -b seahub_db
in /seafile/seafile-server/setup-seafile-mysql.sh auto -e 1 -n seafile -p 8082 -o mysql -u seafile -w seafile -c ccnet_db -s seafile_db -b seahub_db
from the setup
script.
Here is the Ansible script:
- name: Run Mysql Container
docker_container:
name: seafile_mysql
image: mysql:5.7
state: started
env:
MYSQL_ROOT_PASSWORD: "{{ lookup('passwordstore', 'seafile/mysql/root create=true') }}"
volumes:
- "{{ seafile.mysql.home }}:/var/lib/mysql"
notify:
restart-seafile
- name: Run Seafile Container
docker_container:
name: seafile
image: foxel/seafile:6.3.3
state: started
ports:
- "{{ seafile.port }}:80"
volumes:
- "{{ seafile.home }}:/seafile"
env:
SEAFILE_URL: "{{ seafile.domain }}"
links:
- "seafile_mysql:mysql"
- name: Init Run Seafile Container
shell: >
docker exec seafile \
setup {{ lookup('passwordstore', 'seafile/mysql/root' ) }}
args:
creates: "{{ seafile.home }}/.installed"
notify:
restart-seafile
I tried to build the image on my own here, however, executing fails with this error:
seafile_1 | Starting seafile server, please wait ...
seafile_1 | Traceback (most recent call last):
seafile_1 | File "/opt/seafile/6.3.2/seahub/thirdpart/gunicorn", line 9, in <module>
seafile_1 | load_entry_point('gunicorn==19.8.1', 'console_scripts', 'gunicorn')()
seafile_1 | File "/opt/seafile/6.3.2/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/app/wsgiapp.py", line 61, in run
seafile_1 | WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
seafile_1 | File "/opt/seafile/6.3.2/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/app/base.py", line 223, in run
seafile_1 | super(Application, self).run()
seafile_1 | File "/opt/seafile/6.3.2/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/app/base.py", line 72, in run
seafile_1 | Arbiter(self).run()
seafile_1 | File "/opt/seafile/6.3.2/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/arbiter.py", line 60, in __init__
seafile_1 | self.setup(app)
seafile_1 | File "/opt/seafile/6.3.2/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/arbiter.py", line 120, in setup
seafile_1 | self.app.wsgi()
seafile_1 | File "/opt/seafile/6.3.2/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/app/base.py", line 67, in wsgi
seafile_1 | self.callable = self.load()
seafile_1 | File "/opt/seafile/6.3.2/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/app/wsgiapp.py", line 52, in load
seafile_1 | return self.load_wsgiapp()
seafile_1 | File "/opt/seafile/6.3.2/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
seafile_1 | return util.import_app(self.app_uri)
seafile_1 | File "/opt/seafile/6.3.2/seahub/thirdpart/gunicorn-19.8.1-py2.7.egg/gunicorn/util.py", line 350, in import_app
seafile_1 | __import__(module)
seafile_1 | File "/opt/seafile/6.3.2/seahub/seahub/wsgi.py", line 25, in <module>
seafile_1 | application = get_wsgi_application()
seafile_1 | File "/opt/seafile/6.3.2/seahub/thirdpart/django/core/wsgi.py", line 13, in get_wsgi_application
seafile_1 | django.setup(set_prefix=False)
seafile_1 | File "/opt/seafile/6.3.2/seahub/thirdpart/django/__init__.py", line 27, in setup
seafile_1 | apps.populate(settings.INSTALLED_APPS)
seafile_1 | File "/opt/seafile/6.3.2/seahub/thirdpart/django/apps/registry.py", line 108, in populate
seafile_1 | app_config.import_models()
seafile_1 | File "/opt/seafile/6.3.2/seahub/thirdpart/django/apps/config.py", line 202, in import_models
seafile_1 | self.models_module = import_module(models_module_name)
seafile_1 | File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
seafile_1 | __import__(name)
seafile_1 | File "/opt/seafile/6.3.2/seahub/thirdpart/django/contrib/sessions/models.py", line 3, in <module>
seafile_1 | from django.contrib.sessions.base_session import (
seafile_1 | File "/opt/seafile/6.3.2/seahub/thirdpart/django/contrib/sessions/base_session.py", line 30, in <module>
seafile_1 | class AbstractBaseSession(models.Model):
seafile_1 | File "/opt/seafile/6.3.2/seahub/thirdpart/django/db/models/base.py", line 124, in __new__
seafile_1 | new_class.add_to_class('_meta', Options(meta, app_label))
seafile_1 | File "/opt/seafile/6.3.2/seahub/thirdpart/django/db/models/base.py", line 325, in add_to_class
seafile_1 | value.contribute_to_class(cls, name)
seafile_1 | File "/opt/seafile/6.3.2/seahub/thirdpart/django/db/models/options.py", line 214, in contribute_to_class
seafile_1 | self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
seafile_1 | File "/opt/seafile/6.3.2/seahub/thirdpart/django/db/__init__.py", line 33, in __getattr__
seafile_1 | return getattr(connections[DEFAULT_DB_ALIAS], item)
seafile_1 | File "/opt/seafile/6.3.2/seahub/thirdpart/django/db/utils.py", line 211, in __getitem__
seafile_1 | backend = load_backend(db['ENGINE'])
seafile_1 | File "/opt/seafile/6.3.2/seahub/thirdpart/django/db/utils.py", line 115, in load_backend
seafile_1 | return import_module('%s.base' % backend_name)
seafile_1 | File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
seafile_1 | __import__(name)
seafile_1 | File "/opt/seafile/6.3.2/seahub/thirdpart/django/db/backends/mysql/base.py", line 30, in <module>
seafile_1 | 'Did you install mysqlclient or MySQL-python?' % e
seafile_1 | django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: /opt/seafile/6.3.2/seafile/lib/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20).
seafile_1 | Did you install mysqlclient or MySQL-python?
After running docker-compose logs
I don't see where I am supposed to find the root password.
docker compose exec -it seafile bash
cd /opt/seafile/6.3.3/
./seaf-fsck.sh --export some-library-id /seafile/export/
seaf-fsck.c(156): Current user (0) is not the user for running seafile server (999). Unable to run fsck.
Trying to use seafile user (999) does not seem possible : su - seafile
logs back to root.
seafile image 6.3.3
Hi, first thanks for your this project, it is much better than the official seafile docker.
I am using a nginx reverse-proxy docker container to redirect to other docker containers (it eases HTTPS and port mapping) as described here : https://blog.linuxserver.io/2017/11/28/how-to-setup-a-reverse-proxy-with-letsencrypt-ssl-for-all-your-docker-apps/
One of the containers being of course foxel/seafile (seafile container itself embedding a nginx reverse-proxy server to its seahub and seafile servers visible here : https://github.com/foxel/seafile-docker/blob/master/etc/nginx/sites-available/seafile.conf).
I use the env var - "SEAFILE_URL=https://domain.com/seafile"
and I tried several things for the nginx conf :
location /seafile/ {
proxy_pass http://seafile;
rewrite ^/grafana/(.*) /$1 break;
proxy_set_header Host $host;
}
location /seafile {
proxy_pass http://seafile;
include /config/nginx/proxy.conf;
}
location /seafile {
proxy_pass http://seafile;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /seafile {
proxy_pass http://seafile;
proxy_bind $server_addr;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-Ssl on;
include /config/nginx/proxy.conf;
}
location /seafile {
proxy_pass http://seafile/seafile;
include /config/nginx/proxy.conf;
}
location /seafile {
proxy_pass http://seafile/seafile;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /seafile {
proxy_pass http://seafile;
proxy_read_timeout 310s;
proxy_set_header Host $host;
proxy_set_header Forwarded "for=$remote_addr;proto=$scheme";
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Connection "";
proxy_http_version 1.1;
}
Note : http://seafile is resolved via docker own DNS system, seafile
o being the name of the container declared in docker-compose.yml
, I launch the reverse-proxy and the seafile container on the same network using networks: lets-encrypt-docker_nginx-net
The only configuration that seemed to work, but only for setup (docker-compose exec seafile setup
) is the following (from https://forum.seafile.com/t/solved-using-nginx-reverse-proxy-for-seafile-docker/6109/8) :
location /seafile {
proxy_pass http://seafile;
proxy_read_timeout 310s;
proxy_set_header Host $host;
proxy_set_header Forwarded "for=$remote_addr;proto=$scheme";
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Connection "";
proxy_http_version 1.1;
}
However seafile is still not working at https://mydomain.com/seafile (it shows a seafile error webpage stating "Sorry, but the requested page could not be found." with different languages).
Could you help me on that ?
Until now the user-id is hardcoded in the dockerimage and fixed to userid 999. To provide some customization of the container and give users the option to set the uid to an appropriate value there should be an ENV line to pass a custom uid.
Hello! When I access seahub directly it shows and works fine. But when I access it through the Caddy server proxy it shows a blank page. Something is happening because it does redirect to [myserver]/accounts/login/?next=/ and it loads the title but the page shows nothing. There are no errors logged in either the docker logs or the dev. tools console.
Backing up SeaFile involves dumping the contents of the Database and Data folders. (Steps shown here https://manual.seafile.com/maintain/backup_recovery.html)
A simple QoL enhancement to this docker image would be to provide a helper script that we could execute to initiate a backup or restore.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.