Removed DATA_DIR environment variable

This commit is contained in:
Maks Snegov 2021-02-28 23:24:37 +03:00
parent 6eadca4041
commit 4dcac70520
3 changed files with 7 additions and 8 deletions

View File

@ -16,18 +16,18 @@ services:
- SERVER_HOST=<server-host> - SERVER_HOST=<server-host>
- USERNAME=<username> - USERNAME=<username>
- PASSWORD=<password> - PASSWORD=<password>
- DATA_DIR=<directory-path-to-sync>
- SEAFILE_UID=<your_uid> - SEAFILE_UID=<your_uid>
- SEAFILE_GID=<your_gid> - SEAFILE_GID=<your_gid>
volumes: volumes:
- <host-volume-path>:<directory-path-to-sync> - <host-volume-path>:/data
``` ```
Inside container libraries' content will be put in `/data` directory, so map your host directory to it.
## Environment variables: ## Environment variables:
- `LIBRARY_ID=<your-library-id-here>` ID of library to sync; multiple libraries could be separated by colon `:` - `LIBRARY_ID=<your-library-id-here>` ID of library to sync; multiple libraries could be separated by colon `:`
- `SERVER_HOST=<server-host>` Hostname of your seafile server, eg: seafile.example.com. If you're using non-standart port, specify it here, eg: seafile.example.com:8080 - `SERVER_HOST=<server-host>` Hostname of your seafile server, eg: seafile.example.com. If you're using non-standart port, specify it here, eg: seafile.example.com:8080
- `USERNAME=<username>` Seafile account username - `USERNAME=<username>` Seafile account username
- `PASSWORD=<password>` Seafile account password - `PASSWORD=<password>` Seafile account password
- `DATA_DIR=<directory-path-to-sync>` The path where to put the files
- `SEAFILE_UID=<uid>` Downloaded files will have this uid - `SEAFILE_UID=<uid>` Downloaded files will have this uid
- `SEAFILE_GID=<gid>` Downloaded files will have this gid - `SEAFILE_GID=<gid>` Downloaded files will have this gid

View File

@ -9,8 +9,7 @@ services:
- SERVER_HOST=<server-host> - SERVER_HOST=<server-host>
- USERNAME=<username> - USERNAME=<username>
- PASSWORD=<password> - PASSWORD=<password>
- DATA_DIR=<directory-path-to-sync>
- SEAFILE_UID=<your_uid> - SEAFILE_UID=<your_uid>
- SEAFILE_GID=<your_gid> - SEAFILE_GID=<your_gid>
volumes: volumes:
- <host-volume-path>:<directory-path-to-sync> - /home/johndow/seafile:/data

View File

@ -11,9 +11,9 @@ from seafile_client.misc import setup_uid, create_dir
def main(): def main():
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument("--uid", default=os.getenv("SEAFILE_UID"), type=int) parser.add_argument("--uid", default=os.getenv("SEAFILE_UID", default=1000), type=int)
parser.add_argument("--gid", default=os.getenv("SEAFILE_GID"), type=int) parser.add_argument("--gid", default=os.getenv("SEAFILE_GID", default=100), type=int)
parser.add_argument("--data-dir", default=os.getenv("DATA_DIR")) parser.add_argument("--data-dir", default=os.getenv("DATA_DIR", default="/data"))
parser.add_argument("--host", default=os.getenv("SERVER_HOST")) parser.add_argument("--host", default=os.getenv("SERVER_HOST"))
parser.add_argument("--username", default=os.getenv("USERNAME")) parser.add_argument("--username", default=os.getenv("USERNAME"))
parser.add_argument("--password", default=os.getenv("PASSWORD")) parser.add_argument("--password", default=os.getenv("PASSWORD"))