Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
get flow bind address working
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed May 20, 2022
1 parent 3d68319 commit 978c25f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions docs/tutorials/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ Hence the typical way to launch the container with docker runtime would be::

$ CONFIG=$HOME/.config/gphotos-sync
$ STORAGE=$HOME/My_photos_backup
$ docker run --rm -v $CONFIG:/config -v $STORAGE:/storage --net=host -it ghcr.io/gilesknap/gphotos-sync /storage
$ docker run --rm -v $CONFIG:/config -v $STORAGE:/storage -p 8080:8080 -it ghcr.io/gilesknap/gphotos-sync /storage

The options --net=host -it are required for the first invocation only, so that the
browser can find authentication service.
The options ``-p 8080:8080 -it`` are required for the first invocation only,
so that the browser can find authentication service.

Note that the authentication flow uses a redirect url that sends authentication
token back to the process. The default redirect is localhost:8080 and you can
adjust the port with ``--port<PORT_NUMBER>``. The
flow only accepts localhost for security reasons so the first run must always
flow only allows localhost for security reasons so the first run must always
be done on a machine with a browser.

Note that if you are running on a NAS or other headless server you will first
If you are running on a NAS or other headless server you will first
need to run locally so that you can do initial login flow with a browser.
Then copy <TARGET>/.gphotos.token to the server. For this
first run you could use the following options so that no backup is performed:
Expand Down
2 changes: 1 addition & 1 deletion src/gphotos_sync/authorize.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def authorize(self):
)
# localhost and bind to 0.0.0.0 always works even in a container.
flow.run_local_server(
open_browser=False, bind_host="0.0.0.0", port=self.port
open_browser=False, bind_addr="0.0.0.0", port=self.port
)

self.session = flow.authorized_session()
Expand Down

0 comments on commit 978c25f

Please sign in to comment.