mirror of
https://github.com/ggogel/seafile-containerized.git
synced 2024-11-16 09:01:38 +00:00
Drop sqlite3 support.
Using mysql is much better in general. And now that we're using docker, setting up with mysql is as easy as setting up with sqlite3.
This commit is contained in:
parent
99d2c8456b
commit
d8561eb442
|
@ -10,6 +10,6 @@ install:
|
|||
|
||||
script:
|
||||
- cd image && make base && make && cd ..
|
||||
- cp samples/server-sqlite3.conf bootstrap/bootstrap.conf
|
||||
- cp samples/server.conf bootstrap/bootstrap.conf
|
||||
- ./launcher bootstrap
|
||||
- ./launcher start
|
||||
|
|
|
@ -5,7 +5,7 @@ FROM phusion/baseimage:0.9.19
|
|||
ENV UPDATED_AT=20161110 \
|
||||
DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update -qq && apt-get -qq -y install memcached sqlite3 mariadb-server nginx \
|
||||
RUN apt-get update -qq && apt-get -qq -y install memcached mariadb-server nginx \
|
||||
python2.7-dev python-imaging python-ldap python-mysqldb
|
||||
|
||||
# Utility tools
|
||||
|
|
|
@ -12,7 +12,6 @@ dirs=(
|
|||
ccnet
|
||||
seafile-data
|
||||
seahub-data
|
||||
seahub.db
|
||||
)
|
||||
|
||||
for d in ${dirs[*]}; do
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
[server]
|
||||
server.hostname = seafile.example.com
|
||||
admin.email = me@example.com
|
||||
admin.password = asecret
|
||||
db.type = sqlite3
|
|
@ -1,5 +1,4 @@
|
|||
[server]
|
||||
server.hostname = seafile.example.com
|
||||
admin.email = me@example.com
|
||||
admin.password = asecret
|
||||
db.type = mysql
|
||||
admin.password = asecret
|
|
@ -22,33 +22,24 @@ shared_seafiledir = '/shared/seafile'
|
|||
def main():
|
||||
if not exists(shared_seafiledir):
|
||||
os.mkdir(shared_seafiledir)
|
||||
db_type = get_conf('db.type', 'mysql')
|
||||
env = {
|
||||
'SERVER_NAME': 'seafile',
|
||||
'SERVER_IP': get_conf('server.hostname'),
|
||||
'MYSQL_USER': 'seafile',
|
||||
'MYSQL_USER_PASSWD': str(uuid.uuid4()),
|
||||
'MYSQL_USER_HOST': '127.0.0.1',
|
||||
# Default MariaDB root user has empty password and can only connect from localhost.
|
||||
'MYSQL_ROOT_PASSWD': '',
|
||||
}
|
||||
|
||||
if db_type == 'sqlite3':
|
||||
setup_script = get_script('setup-seafile.sh')
|
||||
else:
|
||||
setup_script = get_script('setup-seafile-mysql.sh')
|
||||
env.update({
|
||||
'MYSQL_USER': 'seafile',
|
||||
'MYSQL_USER_PASSWD': str(uuid.uuid4()),
|
||||
'MYSQL_USER_HOST': '127.0.0.1',
|
||||
# Default MariaDB root user has empty password and can only connect from localhost.
|
||||
'MYSQL_ROOT_PASSWD': '',
|
||||
})
|
||||
# Change the script to allow mysql root password to be empty
|
||||
call('''sed -i -e 's/if not mysql_root_passwd/if not mysql_root_passwd and "MYSQL_ROOT_PASSWD" not in os.environ/g' {}'''
|
||||
.format(get_script('setup-seafile-mysql.py')), check_call=True)
|
||||
# Change the script to allow mysql root password to be empty
|
||||
call('''sed -i -e 's/if not mysql_root_passwd/if not mysql_root_passwd and "MYSQL_ROOT_PASSWD" not in os.environ/g' {}'''
|
||||
.format(get_script('setup-seafile-mysql.py')), check_call=True)
|
||||
|
||||
setup_script = get_script('setup-seafile-mysql.sh')
|
||||
call('{} auto -n seafile'.format(setup_script), env=env)
|
||||
|
||||
files_to_copy = ['conf', 'ccnet', 'seafile-data', 'seahub-data',]
|
||||
if db_type in ('sqlite', 'sqlite3'):
|
||||
files_to_copy += ['seahub.db']
|
||||
|
||||
for fn in files_to_copy:
|
||||
src = join(topdir, fn)
|
||||
dst = join(shared_seafiledir, fn)
|
||||
|
|
Loading…
Reference in a new issue