mandarons / icloud-drive-docker

Dockerized iCloud Client - make a local copy of your iCloud documents and photos, and keep it automatically up-to-date.
BSD 3-Clause "New" or "Revised" License
962 stars 46 forks source link

Fix: everything created as root and honors PUID, PGID and UMASK environment variables #206

Closed DorianMazur closed 1 month ago

DorianMazur commented 2 months ago

I replaced the image. Image from linuxserver is better and supports PGID/PUID out of the box.

Fixes #205 #140

mandarons commented 2 months ago

@DorianMazur Thanks for submitting the PR. Have you tried these changes on your local machine? I am suspecting that linuxserver/baseimage-alpine might not have Python3 installed.

DorianMazur commented 2 months ago

@mandarons I've successfully built it locally, but you may be right. I will update this PR with a more suitable image.

DorianMazur commented 2 months ago

I modified Dockerfile and it's working now:

dorianmazur@Dorians-MacBook-954 icloud-drive-docker % docker build .
[+] Building 0.6s (16/16) FINISHED                                          docker:desktop-linux
 => [internal] load .dockerignore                                                           0.0s
 => => transferring context: 229B                                                           0.0s
 => [internal] load build definition from Dockerfile                                        0.0s
 => => transferring dockerfile: 857B                                                        0.0s
 => [internal] load metadata for ghcr.io/linuxserver/baseimage-alpine:3.16                  0.6s
 => [build 1/7] FROM ghcr.io/linuxserver/baseimage-alpine:3.16@sha256:c090393f5bd02f9f5132  0.0s
 => [internal] load build context                                                           0.0s
 => => transferring context: 1.64kB                                                         0.0s
 => CACHED [stage-1 2/5] WORKDIR /app                                                       0.0s
 => CACHED [build 2/7] RUN apk update && apk add git gcc musl-dev py3-pip python3 python3-  0.0s
 => CACHED [build 3/7] WORKDIR /app                                                         0.0s
 => CACHED [build 4/7] COPY requirements.txt .                                              0.0s
 => CACHED [build 5/7] RUN python3 -m venv venv                                             0.0s
 => CACHED [build 6/7] RUN pip3 install -U pip                                              0.0s
 => CACHED [build 7/7] RUN pip3 install -r requirements.txt                                 0.0s
 => CACHED [stage-1 3/5] COPY --from=build /app/venv /app/venv                              0.0s
 => CACHED [stage-1 4/5] RUN apk update && apk add python3 libmagic                         0.0s
 => CACHED [stage-1 5/5] COPY . /app/                                                       0.0s
 => exporting to image                                                                      0.0s
 => => exporting layers                                                                     0.0s
 => => writing image sha256:462242f1677535c727cb0c6dc9d71d309ab854bc7c6ef7f3caa31762b236bf  0.0s
2024-04-14 13:20:37 [migrations] started
2024-04-14 13:20:37 [migrations] no migrations found
2024-04-14 13:20:37 ───────────────────────────────────────
2024-04-14 13:20:37   _____ __ __ _____ _____ _____ _____ 
2024-04-14 13:20:37  |     |  |  |   __|_   _|     |     |
2024-04-14 13:20:37  |   --|  |  |__   | | | |  |  | | | |
2024-04-14 13:20:37  |_____|_____|_____| |_| |_____|_|_|_|
2024-04-14 13:20:37        _____ __ __ _ __    ____  
2024-04-14 13:20:37       | __  |  |  | |  |  |    \ 
2024-04-14 13:20:37       | __ -|  |  | |  |__|  |  |
2024-04-14 13:20:37       |_____|_____|_|_____|____/ 
2024-04-14 13:20:37 
2024-04-14 13:20:37   Based on images from linuxserver.io
2024-04-14 13:20:37 ───────────────────────────────────────
2024-04-14 13:20:37 
2024-04-14 13:20:37 To support LSIO projects visit:
2024-04-14 13:20:37 https://www.linuxserver.io/donate/
2024-04-14 13:20:37 
2024-04-14 13:20:37 ───────────────────────────────────────
2024-04-14 13:20:37 GID/UID
2024-04-14 13:20:37 ───────────────────────────────────────
2024-04-14 13:20:37 
2024-04-14 13:20:37 User UID:    501
2024-04-14 13:20:37 User GID:    20
2024-04-14 13:20:37 ───────────────────────────────────────
2024-04-14 13:20:37 
2024-04-14 13:20:37 [custom-init] No custom files found, skipping...
2024-04-14 13:20:37 [ls.io-init] done.
2024-04-14 13:20:38 Loading config from /app/config.yaml ...
2024-04-14 13:20:38 Loading config from /app/config.yaml ...
2024-04-14 13:20:38 2024-04-14 11:20:38,291 :: ERROR :: root :: sync.py :: 111 :: Password is not stored in keyring. Please save the password in keyring.
2024-04-14 13:20:38 2024-04-14 11:20:38,291 :: INFO :: root :: config_parser.py :: 65 :: Retrying login every 600 seconds.
2024-04-14 13:20:38 2024-04-14 11:20:38,291 :: INFO :: root :: sync.py :: 118 :: Retrying login at Sun Apr 14 11:30:38 2024 ...
2024-04-14 13:20:38 2024-04-14 11:20:38,291 :: WARNING :: root :: config_parser.py :: 402 :: Warning: bot_token is not found in app > telegram > bot_token.
2024-04-14 13:20:38 2024-04-14 11:20:38,292 :: WARNING :: root :: config_parser.py :: 415 :: Warning: chat_id is not found in app > telegram > chat_id.
2024-04-14 13:20:38 2024-04-14 11:20:38,292 :: WARNING :: root :: notify.py :: 36 :: Not sending 2FA notification because Telegram is not configured.
2024-04-14 13:20:38 2024-04-14 11:20:38,292 :: WARNING :: root :: config_parser.py :: 429 :: Warning: webhook_url is not found in app > discord > webhook_url.
2024-04-14 13:20:38 2024-04-14 11:20:38,292 :: WARNING :: root :: config_parser.py :: 443 :: Warning: username is not found in app > discord > username.
2024-04-14 13:20:38 2024-04-14 11:20:38,292 :: WARNING :: root :: notify.py :: 81 :: Not sending 2FA notification because Discord is not configured.
2024-04-14 13:20:38 2024-04-14 11:20:38,292 :: WARNING :: root :: config_parser.py :: 173 :: Warning: host is not found in app > smtp > host
2024-04-14 13:20:38 2024-04-14 11:20:38,292 :: WARNING :: root :: config_parser.py :: 186 :: Warning: port is not found in app > smtp > port
2024-04-14 13:20:38 2024-04-14 11:20:38,292 :: WARNING :: root :: config_parser.py :: 199 :: Warning: no_tls is not found in app > smtp > no_tls
2024-04-14 13:20:38 2024-04-14 11:20:38,292 :: WARNING :: root :: config_parser.py :: 160 :: Warning: password is not found in app > smtp > password
2024-04-14 13:20:38 2024-04-14 11:20:38,292 :: WARNING :: root :: notify.py :: 127 :: Not sending 2FA notification because SMTP is not configured

Files are created as PUID/PGID:


dorianmazur@Dorians-MacBook-954 Documents % cd test_icloud_storage
dorianmazur@Dorians-MacBook-954 test_icloud_storage % ls -a
.   ..  .data
dorianmazur@Dorians-MacBook-954 test_icloud_storage % ls -a -o
total 8
drwxr-xr-x   3 dorianmazur   96 Apr 14 13:20 .
drwx------@ 30 dorianmazur  960 Apr 14 13:18 ..
-rw-r--r--   1 dorianmazur    2 Apr 14 13:20 .data
dorianmazur@Dorians-MacBook-954 test_icloud_storage % 
DorianMazur commented 2 months ago

@mandarons I also moved main.py outside of src folder, as it should be in the main folder and it was not working when main.py was placed inside the src folder.

DorianMazur commented 2 months ago

Here are also plain logs:

dorianmazur@Dorians-MacBook-954 icloud-drive-docker % docker build --no-cache --progress=plain  . 
#0 building with "desktop-linux" instance using docker driver

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 857B done
#1 DONE 0.0s

#2 [internal] load .dockerignore
#2 transferring context: 229B done
#2 DONE 0.0s

#3 [internal] load metadata for ghcr.io/linuxserver/baseimage-alpine:3.16
#3 DONE 0.9s

#4 [build 1/7] FROM ghcr.io/linuxserver/baseimage-alpine:3.16@sha256:c090393f5bd02f9f51321dada9f7ec6f02b562e4bc21a096c80fa01a4a5eb817
#4 CACHED

#5 [stage-1 2/5] WORKDIR /app
#5 CACHED

#6 [internal] load build context
#6 transferring context: 2.26kB done
#6 DONE 0.0s

#7 [build 2/7] RUN apk update && apk add git gcc musl-dev py3-pip python3 python3-dev libffi-dev openssl-dev
#7 0.117 fetch http://dl-cdn.alpinelinux.org/alpine/v3.16/main/aarch64/APKINDEX.tar.gz
#7 0.257 fetch http://dl-cdn.alpinelinux.org/alpine/v3.16/community/aarch64/APKINDEX.tar.gz
#7 0.474 v3.16.9-75-g02fe2d55ed8 [http://dl-cdn.alpinelinux.org/alpine/v3.16/main]
#7 0.474 v3.16.9-75-g02fe2d55ed8 [http://dl-cdn.alpinelinux.org/alpine/v3.16/community]
#7 0.474 OK: 16897 distinct packages available
#7 0.622 (1/37) Installing libgcc (11.2.1_git20220219-r2)
#7 0.672 (2/37) Installing libstdc++ (11.2.1_git20220219-r2)
#7 0.740 (3/37) Installing binutils (2.38-r3)
#7 0.833 (4/37) Installing libgomp (11.2.1_git20220219-r2)
#7 0.855 (5/37) Installing libatomic (11.2.1_git20220219-r2)
#7 0.869 (6/37) Installing gmp (6.2.1-r2)
#7 0.893 (7/37) Installing isl22 (0.22-r0)
#7 0.927 (8/37) Installing mpfr4 (4.1.0-r0)
#7 0.950 (9/37) Installing mpc1 (1.2.1-r0)
#7 0.966 (10/37) Installing gcc (11.2.1_git20220219-r2)
#7 1.866 (11/37) Installing expat (2.6.2-r0)
#7 1.884 (12/37) Installing pcre2 (10.42-r0)
#7 1.906 (13/37) Installing git (2.36.6-r0)
#7 2.179 (14/37) Installing linux-headers (5.16.7-r1)
#7 2.261 (15/37) Installing libffi (3.4.2-r1)
#7 2.279 (16/37) Installing pkgconf (1.8.1-r0)
#7 2.298 (17/37) Installing libffi-dev (3.4.2-r1)
#7 2.327 (18/37) Installing musl-dev (1.2.3-r3)
#7 2.427 (19/37) Installing openssl-dev (1.1.1w-r1)
#7 2.456 (20/37) Installing libbz2 (1.0.8-r1)
#7 2.472 (21/37) Installing gdbm (1.23-r0)
#7 2.488 (22/37) Installing mpdecimal (2.5.1-r1)
#7 2.509 (23/37) Installing sqlite-libs (3.40.1-r1)
#7 2.542 (24/37) Installing python3 (3.10.14-r1)
#7 2.981 (25/37) Installing py3-contextlib2 (21.6.0-r2)
#7 2.998 (26/37) Installing py3-tomli (2.0.1-r1)
#7 3.013 (27/37) Installing py3-pep517 (0.12.0-r2)
#7 3.035 (28/37) Installing py3-six (1.16.0-r1)
#7 3.051 (29/37) Installing py3-retrying (1.3.3-r3)
#7 3.067 (30/37) Installing py3-appdirs (1.4.4-r3)
#7 3.083 (31/37) Installing py3-more-itertools (8.13.0-r0)
#7 3.103 (32/37) Installing py3-ordered-set (4.0.2-r3)
#7 3.118 (33/37) Installing py3-parsing (2.4.7-r3)
#7 3.139 (34/37) Installing py3-packaging (21.3-r0)
#7 3.155 (35/37) Installing py3-setuptools (59.4.0-r0)
#7 3.196 (36/37) Installing py3-pip (22.1.1-r0)
#7 3.332 (37/37) Installing python3-dev (3.10.14-r1)
#7 4.036 Executing busybox-1.35.0-r17.trigger
#7 4.041 OK: 269 MiB in 78 packages
#7 DONE 4.2s

#8 [build 3/7] WORKDIR /app
#8 DONE 0.0s

#9 [build 4/7] COPY requirements.txt .
#9 DONE 0.0s

#10 [build 5/7] RUN python3 -m venv venv
#10 DONE 3.1s

#11 [build 6/7] RUN pip3 install -U pip
#11 0.355 Requirement already satisfied: pip in ./venv/lib/python3.10/site-packages (23.0.1)
#11 0.468 Collecting pip
#11 0.534   Downloading pip-24.0-py3-none-any.whl (2.1 MB)
#11 0.631      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 22.5 MB/s eta 0:00:00
#11 0.673 Installing collected packages: pip
#11 0.673   Attempting uninstall: pip
#11 0.674     Found existing installation: pip 23.0.1
#11 0.792     Uninstalling pip-23.0.1:
#11 0.890       Successfully uninstalled pip-23.0.1
#11 1.836 Successfully installed pip-24.0
#11 DONE 2.0s

#12 [build 7/7] RUN pip3 install -r requirements.txt
#12 0.708 Collecting icloudpy==0.5.0 (from -r requirements.txt (line 1))
#12 0.795   Downloading icloudpy-0.5.0-py3-none-any.whl.metadata (15 kB)
#12 1.092 Collecting ruamel.yaml==0.16.12 (from -r requirements.txt (line 2))
#12 1.106   Downloading ruamel.yaml-0.16.12-py2.py3-none-any.whl.metadata (35 kB)
#12 1.152 Collecting python-magic==0.4.27 (from -r requirements.txt (line 3))
#12 1.166   Downloading python_magic-0.4.27-py2.py3-none-any.whl.metadata (5.8 kB)
#12 1.213 Collecting requests~=2.28.1 (from -r requirements.txt (line 4))
#12 1.231   Downloading requests-2.28.2-py3-none-any.whl.metadata (4.6 kB)
#12 1.262   Downloading requests-2.28.1-py3-none-any.whl.metadata (4.6 kB)
#12 1.320 Collecting keyring==23.11.0 (from icloudpy==0.5.0->-r requirements.txt (line 1))
#12 1.335   Downloading keyring-23.11.0-py3-none-any.whl.metadata (19 kB)
#12 1.365 Collecting keyrings.alt==4.2.0 (from icloudpy==0.5.0->-r requirements.txt (line 1))
#12 1.382   Downloading keyrings.alt-4.2.0-py3-none-any.whl.metadata (3.9 kB)
#12 1.419 Collecting click==8.1.3 (from icloudpy==0.5.0->-r requirements.txt (line 1))
#12 1.452   Downloading click-8.1.3-py3-none-any.whl.metadata (3.2 kB)
#12 1.480 Collecting six==1.16.0 (from icloudpy==0.5.0->-r requirements.txt (line 1))
#12 1.501   Downloading six-1.16.0-py2.py3-none-any.whl.metadata (1.8 kB)
#12 1.532 Collecting tzlocal==4.2 (from icloudpy==0.5.0->-r requirements.txt (line 1))
#12 1.549   Downloading tzlocal-4.2-py3-none-any.whl.metadata (13 kB)
#12 1.611 Collecting pytz==2022.6 (from icloudpy==0.5.0->-r requirements.txt (line 1))
#12 1.625   Downloading pytz-2022.6-py2.py3-none-any.whl.metadata (21 kB)
#12 1.665 Collecting certifi==2022.12.7 (from icloudpy==0.5.0->-r requirements.txt (line 1))
#12 1.683   Downloading certifi-2022.12.7-py3-none-any.whl.metadata (2.9 kB)
#12 1.708 Collecting future==0.18.2 (from icloudpy==0.5.0->-r requirements.txt (line 1))
#12 1.726   Downloading future-0.18.2.tar.gz (829 kB)
#12 1.780      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 829.2/829.2 kB 16.1 MB/s eta 0:00:00
#12 1.869   Installing build dependencies: started
#12 3.113   Installing build dependencies: finished with status 'done'
#12 3.114   Getting requirements to build wheel: started
#12 3.279   Getting requirements to build wheel: finished with status 'done'
#12 3.282   Installing backend dependencies: started
#12 3.873   Installing backend dependencies: finished with status 'done'
#12 3.874   Preparing metadata (pyproject.toml): started
#12 4.045   Preparing metadata (pyproject.toml): finished with status 'done'
#12 4.142 Collecting charset-normalizer<3,>=2 (from requests~=2.28.1->-r requirements.txt (line 4))
#12 4.158   Downloading charset_normalizer-2.1.1-py3-none-any.whl.metadata (11 kB)
#12 4.186 Collecting idna<4,>=2.5 (from requests~=2.28.1->-r requirements.txt (line 4))
#12 4.214   Downloading idna-3.7-py3-none-any.whl.metadata (9.9 kB)
#12 4.265 Collecting urllib3<1.27,>=1.21.1 (from requests~=2.28.1->-r requirements.txt (line 4))
#12 4.280   Downloading urllib3-1.26.18-py2.py3-none-any.whl.metadata (48 kB)
#12 4.285      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.9/48.9 kB 12.6 MB/s eta 0:00:00
#12 4.366 Collecting jaraco.classes (from keyring==23.11.0->icloudpy==0.5.0->-r requirements.txt (line 1))
#12 4.381   Downloading jaraco.classes-3.4.0-py3-none-any.whl.metadata (2.6 kB)
#12 4.441 Collecting importlib-metadata>=4.11.4 (from keyring==23.11.0->icloudpy==0.5.0->-r requirements.txt (line 1))
#12 4.456   Downloading importlib_metadata-7.1.0-py3-none-any.whl.metadata (4.7 kB)
#12 4.481 Collecting SecretStorage>=3.2 (from keyring==23.11.0->icloudpy==0.5.0->-r requirements.txt (line 1))
#12 4.499   Downloading SecretStorage-3.3.3-py3-none-any.whl.metadata (4.0 kB)
#12 4.527 Collecting jeepney>=0.4.2 (from keyring==23.11.0->icloudpy==0.5.0->-r requirements.txt (line 1))
#12 4.573   Downloading jeepney-0.8.0-py3-none-any.whl.metadata (1.3 kB)
#12 4.744 Collecting pytz-deprecation-shim (from tzlocal==4.2->icloudpy==0.5.0->-r requirements.txt (line 1))
#12 4.800   Downloading pytz_deprecation_shim-0.1.0.post0-py2.py3-none-any.whl.metadata (5.2 kB)
#12 4.897 Collecting zipp>=0.5 (from importlib-metadata>=4.11.4->keyring==23.11.0->icloudpy==0.5.0->-r requirements.txt (line 1))
#12 4.911   Downloading zipp-3.18.1-py3-none-any.whl.metadata (3.5 kB)
#12 5.159 Collecting cryptography>=2.0 (from SecretStorage>=3.2->keyring==23.11.0->icloudpy==0.5.0->-r requirements.txt (line 1))
#12 5.178   Downloading cryptography-42.0.5-cp39-abi3-musllinux_1_2_aarch64.whl.metadata (5.3 kB)
#12 5.254 Collecting more-itertools (from jaraco.classes->keyring==23.11.0->icloudpy==0.5.0->-r requirements.txt (line 1))
#12 5.273   Downloading more_itertools-10.2.0-py3-none-any.whl.metadata (34 kB)
#12 5.325 Collecting tzdata (from pytz-deprecation-shim->tzlocal==4.2->icloudpy==0.5.0->-r requirements.txt (line 1))
#12 5.337   Downloading tzdata-2024.1-py2.py3-none-any.whl.metadata (1.4 kB)
#12 5.488 Collecting cffi>=1.12 (from cryptography>=2.0->SecretStorage>=3.2->keyring==23.11.0->icloudpy==0.5.0->-r requirements.txt (line 1))
#12 5.502   Downloading cffi-1.16.0.tar.gz (512 kB)
#12 5.521      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 512.9/512.9 kB 29.3 MB/s eta 0:00:00
#12 5.585   Installing build dependencies: started
#12 6.598   Installing build dependencies: finished with status 'done'
#12 6.599   Getting requirements to build wheel: started
#12 6.805   Getting requirements to build wheel: finished with status 'done'
#12 6.808   Installing backend dependencies: started
#12 7.252   Installing backend dependencies: finished with status 'done'
#12 7.253   Preparing metadata (pyproject.toml): started
#12 7.455   Preparing metadata (pyproject.toml): finished with status 'done'
#12 7.513 Collecting pycparser (from cffi>=1.12->cryptography>=2.0->SecretStorage>=3.2->keyring==23.11.0->icloudpy==0.5.0->-r requirements.txt (line 1))
#12 7.525   Downloading pycparser-2.22-py3-none-any.whl.metadata (943 bytes)
#12 7.551 Downloading icloudpy-0.5.0-py3-none-any.whl (35 kB)
#12 7.571 Downloading ruamel.yaml-0.16.12-py2.py3-none-any.whl (111 kB)
#12 7.576    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 111.1/111.1 kB 28.5 MB/s eta 0:00:00
#12 7.591 Downloading python_magic-0.4.27-py2.py3-none-any.whl (13 kB)
#12 7.607 Downloading requests-2.28.1-py3-none-any.whl (62 kB)
#12 7.613    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 kB 17.4 MB/s eta 0:00:00
#12 7.629 Downloading certifi-2022.12.7-py3-none-any.whl (155 kB)
#12 7.647    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 155.3/155.3 kB 9.0 MB/s eta 0:00:00
#12 7.660 Downloading click-8.1.3-py3-none-any.whl (96 kB)
#12 7.667    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 96.6/96.6 kB 17.6 MB/s eta 0:00:00
#12 7.694 Downloading keyring-23.11.0-py3-none-any.whl (36 kB)
#12 7.730 Downloading keyrings.alt-4.2.0-py3-none-any.whl (20 kB)
#12 7.752 Downloading pytz-2022.6-py2.py3-none-any.whl (498 kB)
#12 7.768    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 498.1/498.1 kB 35.2 MB/s eta 0:00:00
#12 7.807 Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
#12 7.824 Downloading tzlocal-4.2-py3-none-any.whl (19 kB)
#12 7.840 Downloading charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
#12 7.856 Downloading idna-3.7-py3-none-any.whl (66 kB)
#12 7.861    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 66.8/66.8 kB 19.2 MB/s eta 0:00:00
#12 7.875 Downloading urllib3-1.26.18-py2.py3-none-any.whl (143 kB)
#12 7.881    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 143.8/143.8 kB 35.0 MB/s eta 0:00:00
#12 7.898 Downloading importlib_metadata-7.1.0-py3-none-any.whl (24 kB)
#12 7.914 Downloading jeepney-0.8.0-py3-none-any.whl (48 kB)
#12 7.918    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.4/48.4 kB 14.5 MB/s eta 0:00:00
#12 7.935 Downloading SecretStorage-3.3.3-py3-none-any.whl (15 kB)
#12 7.949 Downloading jaraco.classes-3.4.0-py3-none-any.whl (6.8 kB)
#12 7.967 Downloading pytz_deprecation_shim-0.1.0.post0-py2.py3-none-any.whl (15 kB)
#12 7.987 Downloading cryptography-42.0.5-cp39-abi3-musllinux_1_2_aarch64.whl (4.5 MB)
#12 8.163    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.5/4.5 MB 25.6 MB/s eta 0:00:00
#12 8.177 Downloading zipp-3.18.1-py3-none-any.whl (8.2 kB)
#12 8.198 Downloading more_itertools-10.2.0-py3-none-any.whl (57 kB)
#12 8.204    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.0/57.0 kB 13.9 MB/s eta 0:00:00
#12 8.248 Downloading tzdata-2024.1-py2.py3-none-any.whl (345 kB)
#12 8.261    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 345.4/345.4 kB 32.7 MB/s eta 0:00:00
#12 8.276 Downloading pycparser-2.22-py3-none-any.whl (117 kB)
#12 8.286    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 117.6/117.6 kB 15.1 MB/s eta 0:00:00
#12 8.317 Building wheels for collected packages: future, cffi
#12 8.318   Building wheel for future (pyproject.toml): started
#12 8.628   Building wheel for future (pyproject.toml): finished with status 'done'
#12 8.630   Created wheel for future: filename=future-0.18.2-py3-none-any.whl size=491058 sha256=51309000e1620dedb28f0cd0c5ec5dd6ee1ab3d2adee03532998fa27979ab2dc
#12 8.630   Stored in directory: /root/.cache/pip/wheels/22/73/06/557dc4f4ef68179b9d763930d6eec26b88ed7c389b19588a1c
#12 8.634   Building wheel for cffi (pyproject.toml): started
#12 12.57   Building wheel for cffi (pyproject.toml): finished with status 'done'
#12 12.57   Created wheel for cffi: filename=cffi-1.16.0-cp310-cp310-linux_aarch64.whl size=421302 sha256=529ef4c431ebd5b401e34f21b5d8c0206fd2e46f1639ee868b89ac1061632727
#12 12.57   Stored in directory: /root/.cache/pip/wheels/5b/53/e8/09b4ecf3ce33d4454c109f699f60cc45002087e560eae81257
#12 12.58 Successfully built future cffi
#12 12.73 Installing collected packages: ruamel.yaml, pytz, zipp, urllib3, tzdata, six, python-magic, pycparser, more-itertools, jeepney, idna, future, click, charset-normalizer, certifi, requests, pytz-deprecation-shim, jaraco.classes, importlib-metadata, cffi, tzlocal, keyrings.alt, cryptography, SecretStorage, keyring, icloudpy
#12 13.95 Successfully installed SecretStorage-3.3.3 certifi-2022.12.7 cffi-1.16.0 charset-normalizer-2.1.1 click-8.1.3 cryptography-42.0.5 future-0.18.2 icloudpy-0.5.0 idna-3.7 importlib-metadata-7.1.0 jaraco.classes-3.4.0 jeepney-0.8.0 keyring-23.11.0 keyrings.alt-4.2.0 more-itertools-10.2.0 pycparser-2.22 python-magic-0.4.27 pytz-2022.6 pytz-deprecation-shim-0.1.0.post0 requests-2.28.1 ruamel.yaml-0.16.12 six-1.16.0 tzdata-2024.1 tzlocal-4.2 urllib3-1.26.18 zipp-3.18.1
#12 DONE 14.2s

#13 [stage-1 3/5] COPY --from=build /app/venv /app/venv
#13 DONE 0.3s

#14 [stage-1 4/5] RUN apk update && apk add python3 libmagic
#14 0.093 fetch http://dl-cdn.alpinelinux.org/alpine/v3.16/main/aarch64/APKINDEX.tar.gz
#14 0.253 fetch http://dl-cdn.alpinelinux.org/alpine/v3.16/community/aarch64/APKINDEX.tar.gz
#14 0.446 v3.16.9-75-g02fe2d55ed8 [http://dl-cdn.alpinelinux.org/alpine/v3.16/main]
#14 0.446 v3.16.9-75-g02fe2d55ed8 [http://dl-cdn.alpinelinux.org/alpine/v3.16/community]
#14 0.446 OK: 16897 distinct packages available
#14 0.579 (1/10) Installing libmagic (5.41-r0)
#14 0.682 (2/10) Installing expat (2.6.2-r0)
#14 0.716 (3/10) Installing libbz2 (1.0.8-r1)
#14 0.730 (4/10) Installing libffi (3.4.2-r1)
#14 0.746 (5/10) Installing gdbm (1.23-r0)
#14 0.758 (6/10) Installing libgcc (11.2.1_git20220219-r2)
#14 0.771 (7/10) Installing libstdc++ (11.2.1_git20220219-r2)
#14 0.820 (8/10) Installing mpdecimal (2.5.1-r1)
#14 0.841 (9/10) Installing sqlite-libs (3.40.1-r1)
#14 0.880 (10/10) Installing python3 (3.10.14-r1)
#14 1.479 Executing busybox-1.35.0-r17.trigger
#14 1.483 OK: 77 MiB in 51 packages
#14 DONE 1.6s

#15 [stage-1 5/5] COPY . /app/
#15 DONE 0.0s

#16 exporting to image
#16 exporting layers
#16 exporting layers 0.2s done
#16 writing image sha256:1675050315e10ff60d1a370961061cd17868309c93d056f3457d3c36595c8e49 done
#16 DONE 0.2s
mandarons commented 1 month ago

@DorianMazur Is the new image working for you? It is not working for me. Throwing below error when I run the container:

**** Permissions could not be set. This is probably because your volume mounts are remote or read-only. ****
**** The app may not work properly and we will not provide support for it. ****
find: unrecognized: -xtype

I am looking into it...

Sev7nrayne commented 1 month ago

I tried building the merged mandarons:main from DorianMazur:fix/everything_created_as_root

and I get this error:

Permissions could not be set. This is probably because your volume mounts are remote or read-only. The app may not work properly and we will not provide support for it. Permissions could not be set. This is probably because your volume mounts are remote or read-only. The app may not work properly and we will not provide support for it. [custom-init] No custom files found, skipping... [ls.io-init] done. Loading config from /app/config.yaml ... [migrations] started [migrations] no migrations found usermod: no changes ───────────────────────────────────────


| | | | | | | | | --| | | | | | | | | | | | |||____| || |____||||


  | __  |  |  | |  |  |    \ 
  | __ -|  |  | |  |__|  |  |
  |_____|_____|_|_____|____/ 

Based on images from linuxserver.io ───────────────────────────────────────

To support LSIO projects visit: https://www.linuxserver.io/donate/

─────────────────────────────────────── GID/UID ───────────────────────────────────────

User UID: 100 User GID: 100 ───────────────────────────────────────

find: unrecognized: -xtype BusyBox v1.35.0 (2022-08-01 15:14:44 UTC) multi-call binary.

Usage: find [-HL] [PATH]... [OPTIONS] [ACTIONS]

Search for files and perform actions on them. First failed action stops processing of current file. Defaults: PATH is current directory, action is '-print'

    -L,-follow      Follow symlinks
    -H              ...on command line only
    -xdev           Don't descend directories on other filesystems
    -maxdepth N     Descend at most N levels. -maxdepth 0 applies
                    actions to command line arguments only
    -mindepth N     Don't act on first N levels
    -depth          Act on directory *after* traversing it

Actions: ( ACTIONS ) Group actions for -o / -a ! ACT Invert ACT's success/failure ACT1 [-a] ACT2 If ACT1 fails, stop, else do ACT2 ACT1 -o ACT2 If ACT1 succeeds, stop, else do ACT2 Note: -a has higher priority than -o -name PATTERN Match file name (w/o directory name) to PATTERN -iname PATTERN Case insensitive -name -path PATTERN Match path to PATTERN -ipath PATTERN Case insensitive -path -regex PATTERN Match path to regex PATTERN -type X File type is X (one of: f,d,l,b,c,s,p) -executable File is executable -perm MASK At least one mask bit (+MASK), all bits (-MASK), or exactly MASK bits are set in file's mode -mtime DAYS mtime is greater than (+N), less than (-N), or exactly N days in the past -atime DAYS atime +N/-N/N days in the past -ctime DAYS ctime +N/-N/N days in the past -mmin MINS mtime is greater than (+N), less than (-N), or exactly N minutes in the past -newer FILE mtime is more recent than FILE's -inum N File has inode number N -user NAME/ID File is owned by given user -group NAME/ID File is owned by given group -size N[bck] File size is N (c:bytes,k:kbytes,b:512 bytes(def.)) +/-N: file size is bigger/smaller than N -links N Number of links is greater than (+N), less than (-N), or exactly N -empty Match empty file/directory -prune If current file is directory, don't descend into it If none of the following actions is specified, -print is assumed -print Print file name -print0 Print file name, NUL terminated -exec CMD ARG ; Run CMD with all instances of {} replaced by file name. Fails if CMD exits with nonzero -exec CMD ARG + Run CMD with {} replaced by list of file names -delete Delete current file/directory. Turns on -depth option -quit Exit Permissions could not be set. This is probably because your volume mounts are remote or read-only. The app may not work properly and we will not provide support for it. find: unrecognized: -xtype BusyBox v1.35.0 (2022-08-01 15:14:44 UTC) multi-call binary. [custom-init] No custom files found, skipping... [ls.io-init] done. Loading config from /app/config.yaml ... Traceback (most recent call last): File "/app/./main.py", line 4, in from src import sync File "/app/src/init.py", line 138, in LOGGER = get_logger() File "/app/src/init.py", line 109, in get_logger logger_config = get_logger_config(config=read_config()) File "/app/src/init.py", line 39, in read_config if config["app"]["credentials"]["username"] is not None TypeError: string indices must be integers

This is my config.yaml

app: logger:

level - debug, info (default), warning or error

level: info
# log filename icloud.log (default)
filename: icloud.log

credentials:

iCloud drive username

username: *redacted*
# Retry login interval - default is 10 minutes
retry_login_interval: 600

Drive destination

destination: "/app/icloud/" smtp:

If you want to recieve email notifications about expired/missing 2FA credentials then uncomment

# email: user@test.com
## optional, to email address. Default is sender email.
# to: receiver@test.com
# password:
# host: smtp.test.com
# port: 587
# If your email provider doesn't handle TLS
# no_tls: true

drive: destination: "/app/icloud/" remove_obsolete: false sync_interval: 300 filters:

File filters to be included in syncing iCloud drive content

folders:
 # - folder1
file_extensions:
  # File extensions to be included
  - pdf
  - png
  - jpg
  - jpeg

photos: destination: "/app/icloud/" remove_obsolete: false sync_inteval: 500 filters: albums:

mandarons commented 1 month ago

@Sev7nrayne yeah, same as mine. I will look into it.

matt-valdez commented 1 month ago

Ever since this was merged in, when I have PUID PGUID as environment variables defined while running in UNRAID it fails and restarts. I can not capture logs since it is restarted but I figured I would let you know. I was using 99/100 but I reverted to not using any as a workaround.

mandarons commented 1 month ago

Thanks. Not sure what's so unique about Unraid as I don't have it set up to figure out. BTW, it is usually recommended to use values higher than 1000 for PUID and PGID to avoid any conflicts.

miafoo commented 1 month ago

I've had issues with 1.18.1 and newer, reverting back to 1.18.0 works perfectly for me on unRAID. I also tried changing the PUID and PGID which did prevent the crashing but instead it could never find the password in the keyring, even after running the icloud command to login again... not really sure why though.

Verkhovskyi commented 1 month ago

I've had issues with 1.18.1 and newer, reverting back to 1.18.0 works perfectly for me on unRAID. I also tried changing the PUID and PGID which did prevent the crashing but instead it could never find the password in the keyring, even after running the icloud command to login again... not really sure why though.

Same. Reverted to older version.

I don't have it set up to figure out.

@mandarons, I can provide you with access to clean Unraid setup if needed

nicx commented 4 weeks ago

same here with unraid. @Verkhovskyi @miafoo did you find a solution with the current version?

miafoo commented 4 weeks ago

same here with unraid. @Verkhovskyi @miafoo did you find a solution with the current version?

Unfortunately no, but 1.18.0 has been rock stable for me so will probably not bother attempting upgrading for a few months.

mandarons commented 2 weeks ago

Sorry folks, for messing this one. I thought that docker works the same in all environments. Clearly, that's not the case. There must be something wrong with my PUID, PGID implementation for UNRAID.

@mandarons, I can provide you with access to clean Unraid setup if needed

@Verkhovskyi : that would be great. I never used UNRAID before. Meanwhile, I will start digging through how UNRAID uses Docker to see if there is any conflict with my implementation.

Verkhovskyi commented 2 weeks ago

@nicx, no, using 1.16.1 for now

@mandarons, I'll set it up and DM you credentials on reddit (or anywhere else if you wish). Most likely tomorrow or the day after. Will access through Wireguard be ok?

mandarons commented 2 weeks ago

@Verkhovskyi : Thank you for the offer. Someone recently sponsored to help me purchase an Unraid license. I will be using it to resolve this issue.