diff --git a/README.md b/README.md index e7ea883..84d8268 100644 --- a/README.md +++ b/README.md @@ -16,18 +16,18 @@ services: - SERVER_HOST= - USERNAME= - PASSWORD= - - DATA_DIR= - SEAFILE_UID= - SEAFILE_GID= volumes: - - : + - :/data ``` +Inside container libraries' content will be put in `/data` directory, so map your host directory to it. + ## Environment variables: - `LIBRARY_ID=` ID of library to sync; multiple libraries could be separated by colon `:` - `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=` Seafile account username - `PASSWORD=` Seafile account password - - `DATA_DIR=` The path where to put the files - `SEAFILE_UID=` Downloaded files will have this uid - `SEAFILE_GID=` Downloaded files will have this gid diff --git a/docker-compose.example.yml b/docker-compose.example.yml index c4ba9db..63396f9 100644 --- a/docker-compose.example.yml +++ b/docker-compose.example.yml @@ -9,8 +9,7 @@ services: - SERVER_HOST= - USERNAME= - PASSWORD= - - DATA_DIR= - SEAFILE_UID= - SEAFILE_GID= volumes: - - : + - /home/johndow/seafile:/data diff --git a/start.py b/start.py index 93a1739..d4fef9b 100755 --- a/start.py +++ b/start.py @@ -11,9 +11,9 @@ from seafile_client.misc import setup_uid, create_dir def main(): parser = argparse.ArgumentParser() - parser.add_argument("--uid", default=os.getenv("SEAFILE_UID"), type=int) - parser.add_argument("--gid", default=os.getenv("SEAFILE_GID"), type=int) - parser.add_argument("--data-dir", default=os.getenv("DATA_DIR")) + parser.add_argument("--uid", default=os.getenv("SEAFILE_UID", default=1000), 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", default="/data")) parser.add_argument("--host", default=os.getenv("SERVER_HOST")) parser.add_argument("--username", default=os.getenv("USERNAME")) parser.add_argument("--password", default=os.getenv("PASSWORD"))