Use server.letsencrypt instead of server.https

This commit is contained in:
Shuai Lin 2016-11-21 11:25:56 +08:00
parent ac72dbc171
commit 500e8a9d15
5 changed files with 13 additions and 8 deletions

View file

@ -14,11 +14,11 @@ if [[ ! -d /var/lib/mysql/mysql ]]; then
rm -rf /var/run/mysqld/* rm -rf /var/run/mysqld/*
echo 'Starting mysqld' echo 'Starting mysqld'
# The sleep 1 is there to make sure that inotifywait starts up before the socket is created mysqld_safe >>/var/log/mysql-bootstrap.log 2>&1 &
mysqld_safe >>/var/log/bootstrap-mysql.log &
echo 'Waiting for mysqld to come online' echo 'Waiting for mysqld to come online'
while [[ ! -x /var/run/mysqld/mysqld.sock ]]; do # The sleep 1 is there to make sure that inotifywait starts up before the socket is created
while [[ ! -S /var/run/mysqld/mysqld.sock ]]; do
sleep 1 sleep 1
done done
@ -38,4 +38,10 @@ if [[ ! -d /var/lib/mysql/mysql ]]; then
echo 'Shutting down mysqld' echo 'Shutting down mysqld'
mysqladmin -uroot shutdown mysqladmin -uroot shutdown
retry=0 maxretry=10
while [[ -e /var/run/mysqld/mysqld.sock && $retry -le $maxretry ]]; do
retry=$((retry+1))
sleep 1
done
fi fi

View file

@ -3,7 +3,7 @@
set -e set -e
shutdown_mysql() { shutdown_mysql() {
if [[ -d /var/run/mysqld/mysqld.sock ]]; then if [[ -S /var/run/mysqld/mysqld.sock ]]; then
mysqladmin -u root shutdown || true mysqladmin -u root shutdown || true
fi fi
} }

View file

@ -1,7 +1,7 @@
# If you edit this file, remember to run ./launcher rebuild # If you edit this file, remember to run ./launcher rebuild
[server] [server]
server.hostname = seafile.example.com server.hostname = seafile.example.com
server.https = true server.letsencrypt = true
admin.email = me@example.com admin.email = me@example.com
admin.password = asecret admin.password = asecret
server.port_mappings = 80:80,443:443 server.port_mappings = 80:80,443:443

View file

@ -70,7 +70,7 @@ def init_letsencrypt():
) )
def is_https(): def is_https():
return get_conf('server.https', '').lower() == 'true' return get_conf('server.letsencrypt', '').lower() == 'true'
def generate_local_dockerfile(): def generate_local_dockerfile():
show_progress('Generating local Dockerfile ...') show_progress('Generating local Dockerfile ...')

View file

@ -10,9 +10,8 @@ ADD bootstrap /bootstrap
ADD scripts/tmp/check_init_admin.py /opt/seafile/seafile-server-{{ seafile_version }}/check_init_admin.py ADD scripts/tmp/check_init_admin.py /opt/seafile/seafile-server-{{ seafile_version }}/check_init_admin.py
{%- endif %} {%- endif %}
ADD bootstrap/generated/seafile.nginx.conf /etc/nginx/sites-enabled/seafile.nginx.conf
{%- if https %} {%- if https %}
ADD bootstrap/generated/seafile.nginx.conf /etc/nginx/sites-enabled/seafile.nginx.conf
ADD bootstrap/generated/letsencrypt.cron /etc/cron.d/letsencrypt.cron ADD bootstrap/generated/letsencrypt.cron /etc/cron.d/letsencrypt.cron
{%- endif %} {%- endif %}