separate SEAFILE_SERVER_HOSTNAME and SEAFILE_URL

SEAFILE_SERVER_HOSTNAME is for the internal hostname
SEAFILE_URL is for the external URL
This commit is contained in:
Gerrit Gogel 2023-11-05 14:07:51 +01:00
parent 8ebb42472b
commit ff7b840b9f
5 changed files with 6 additions and 6 deletions

View file

@ -128,7 +128,7 @@ Networks:
This will be used for the SERVICE_URL and FILE_SERVER_ROOT. This will be used for the SERVICE_URL and FILE_SERVER_ROOT.
Important: Changing those values in the config files later won't have any effect because they are written to the database. Those values have priority over the config files. To change them enter the "System Admin" section on the web-ui. If you encounter issues with file upload, it's likely that those are configured incorrectly. Important: Changing those values in the config files later won't have any effect because they are written to the database. Those values have priority over the config files. To change them enter the "System Admin" section on the web-ui. If you encounter issues with file upload, it's likely that those are configured incorrectly.
``` ```
- SEAFILE_SERVER_HOSTNAME=seafile.mydomain.com - SEAFILE_URL=seafile.mydomain.com
``` ```
If you plan to use a reverse proxy with https, set this to true. This will replace http with https in the SERVICE_URL and FILE_SERVER_ROOT. If you plan to use a reverse proxy with https, set this to true. This will replace http with https in the SERVICE_URL and FILE_SERVER_ROOT.
``` ```

View file

@ -9,7 +9,7 @@ services:
- DB_ROOT_PASSWD=db_dev - DB_ROOT_PASSWD=db_dev
- TIME_ZONE=Europe/Berlin - TIME_ZONE=Europe/Berlin
- HTTPS=false - HTTPS=false
- SEAFILE_SERVER_HOSTNAME=localhost - SEAFILE_URL=localhost
depends_on: depends_on:
- db - db
- memcached - memcached

View file

@ -11,7 +11,7 @@ services:
- SEAFILE_ADMIN_EMAIL=me@example.com - SEAFILE_ADMIN_EMAIL=me@example.com
- SEAFILE_ADMIN_PASSWORD=asecret - SEAFILE_ADMIN_PASSWORD=asecret
- HTTPS=false # Set this to true if you plan to use a reverse proxy with HTTPS. Can be changed later in the admin settings on the web-ui. - HTTPS=false # Set this to true if you plan to use a reverse proxy with HTTPS. Can be changed later in the admin settings on the web-ui.
- SEAFILE_SERVER_HOSTNAME=seafile.mydomain.com # Mandatory on first deployment! - SEAFILE_URL=seafile.mydomain.com # Mandatory on first deployment!
networks: networks:
- seafile-net - seafile-net
deploy: deploy:

View file

@ -9,7 +9,7 @@ services:
- DB_ROOT_PASSWD=db_dev - DB_ROOT_PASSWD=db_dev
- TIME_ZONE=Europe/Berlin - TIME_ZONE=Europe/Berlin
- HTTPS=true - HTTPS=true
- SEAFILE_SERVER_HOSTNAME=seafile.mydomain.com # Mandatory on first deployment! - SEAFILE_URL=seafile.mydomain.com # Mandatory on first deployment!
depends_on: depends_on:
- db - db
- memcached - memcached

View file

@ -53,7 +53,7 @@ def init_seafile_server():
loginfo('Now running setup-seafile-mysql.py in auto mode.') loginfo('Now running setup-seafile-mysql.py in auto mode.')
env = { env = {
'SERVER_NAME': 'seafile', 'SERVER_NAME': 'seafile',
'SERVER_IP': get_conf('SEAFILE_SERVER_HOSTNAME', 'seafile.example.com'), 'SERVER_IP': get_conf('SEAFILE_URL', 'seafile.example.com'),
'MYSQL_USER': 'seafile', 'MYSQL_USER': 'seafile',
'MYSQL_USER_PASSWD': str(uuid.uuid4()), 'MYSQL_USER_PASSWD': str(uuid.uuid4()),
'MYSQL_USER_HOST': '%.%.%.%', 'MYSQL_USER_HOST': '%.%.%.%',
@ -76,7 +76,7 @@ def init_seafile_server():
setup_script = get_script('setup-seafile-mysql.sh') setup_script = get_script('setup-seafile-mysql.sh')
call('{} auto -n seafile'.format(setup_script), env=env) call('{} auto -n seafile'.format(setup_script), env=env)
domain = get_conf('SEAFILE_SERVER_HOSTNAME', 'seafile.example.com') domain = get_conf('SEAFILE_URL', 'seafile.example.com')
proto = 'https' if is_https() else 'http' proto = 'https' if is_https() else 'http'
with open(join(topdir, 'conf', 'seahub_settings.py'), 'a+') as fp: with open(join(topdir, 'conf', 'seahub_settings.py'), 'a+') as fp:
fp.write('\n') fp.write('\n')