Skip to content

Commit

Permalink
fix keyring management params for icloud in docker (icloud-photos-dow…
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyNikiforov committed Nov 29, 2023
1 parent c64e70c commit d4cce47
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- fix: `icloud --username` parameter reported as not an option [#719](https://github.com/icloud-photos-downloader/icloud_photos_downloader/issues/719)

## 1.16.2 (2023-09-30)

- fix: send logs to stdout [#697](https://github.com/icloud-photos-downloader/icloud_photos_downloader/issues/697)
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ COPY src src

RUN pip3 install -e .[dev]

RUN pyinstaller -y --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata src/starters/exec.py
RUN pyinstaller -y --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile src/starters/icloudpd_ex.py

FROM alpine:3.18 as runtime

WORKDIR /app

ENV TZ="America/Los_Angeles"

COPY --from=build /app/dist/exec .
COPY --from=build /app/dist/icloudpd_ex .

ENTRYPOINT ["/app/exec"]
ENTRYPOINT ["/app/icloudpd_ex"]

# RUN set -xe \
# && ln -s /app/icloudpd /usr/local/bin/icloudpd \
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Homepage="https://github.com/icloud-photos-downloader/icloud_photos_downloader"
[project.scripts]
icloudpd = "icloudpd.base:main"
icloud = "pyicloud_ipd.cmdline:main"
icloudpd_ex = "starters.icloudpd_ex:main"

[tool.pytest.ini_options]
log_format = "%(levelname)-8s %(message)s"
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_bin_linux
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ set -euo pipefail

pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile src/starters/icloudpd.py src/starters/icloud.py --name icloudpd-$1-linux-$2
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile src/starters/icloud.py --name icloud-$1-linux-$2
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile src/starters/exec.py --name icloudpd-ex-$1-linux-$2
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile src/starters/icloudpd_ex.py --name icloudpd-ex-$1-linux-$2
2 changes: 1 addition & 1 deletion scripts/build_bin_macos
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ set -euo pipefail

pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile src/starters/icloudpd.py src/starters/icloud.py --name icloudpd-$1-macos-$2
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile src/starters/icloud.py --name icloud-$1-macos-$2
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile src/starters/exec.py --name icloudpd-ex-$1-macos-$2
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile src/starters/icloudpd_ex.py --name icloudpd-ex-$1-macos-$2
2 changes: 1 addition & 1 deletion scripts/build_bin_windows
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ set -euo pipefail

pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile src/starters/icloudpd.py src/starters/icloud.py --name icloudpd-$1-windows-$2
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile src/starters/icloud.py --name icloud-$1-windows-$2
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile src/starters/exec.py --name icloudpd-ex-$1-windows-$2
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile src/starters/icloudpd_ex.py --name icloudpd-ex-$1-windows-$2
34 changes: 32 additions & 2 deletions src/starters/exec.py → src/starters/icloudpd_ex.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,35 @@ def commands():
pass

@commands.command()
def icloud():
@click.option("--username",
default="",
help="Apple ID to Use")
@click.option(
"--password",
default="",
help=(
"Apple ID Password to Use; if unspecified, password will be "
"fetched from the system keyring."
)
)
@click.option(
"-n", "--non-interactive",
default=True,
help="Disable interactive prompts."
)
@click.option(
"--delete-from-keyring",
default=False,
help="Delete stored password in system keyring for this username.",
)
@click.option(
"--domain",
default="com",
help="Root Domain for requests to iCloud. com or cn",
)
def icloud(username, password, non_interactive, delete_from_keyring, domain):
"""Legacy iCloud utils (keyring)"""
# raise Exception("blah")
icloud_main(sys.argv[2:])

@commands.command()
Expand Down Expand Up @@ -56,8 +83,11 @@ def delete(appleid):
def watch():
"""Watch for iCloud changes"""

if __name__ == "__main__":
def main():
commands.add_command(icloudpd_main, name="icloudpd")
watch.add_command(copy)
watch.add_command(move)
commands()

if __name__ == "__main__":
main()

0 comments on commit d4cce47

Please sign in to comment.