-
Notifications
You must be signed in to change notification settings - Fork 168
Issues Upgrading a Container to 3.0,0 #351
Comments
TODO: I will add a command line argument to specify the hostname and port for the redirect URL. This would allow you to override port on localhost or even run on a headless server as long as the container can be routed from your workstation that is running the browser. |
Thanks @gilesknap. |
Came here to say that https://registry.hub.docker.com/r/gilesknap/gphotos-sync contains version 2.14.2 (By [gilesknap] Updated 2 years ago) but it looks like you've already identified that above. Will the dockerhub version be upgraded to 3.0.0, or, to put it another way, will dockerhub be synchronized with ghcr.io/gilesknap/gphotos-sync ? |
Well, I was intending to take down the dockerhub and have github only but have had quite a few votes for DockerHub so I'll add it to the CI. |
Not too familiar with docker but once I got everything set up in my container, after I did the oauth prompt I was redirected to a url like I tried with both Anyone else have this issue and find a way to solve it? Thanks EDIT : I was able to get it to complete by going into the container's command line, installing curl in the container ( |
@jdvp it just sounds like your container was not sharing the port to the host. What platform are you on and how are you running the container? |
@aaccioly I agree with changing the docs as you suggest. But I'm working on the change and I cant get exposing the port only to work. This works: docker run -it -v storage:/storage -v/home/giles/.config/gphotos-sync:/config --net=host gphotos-sync --host localhost --port 8989 /storage But the browser can find the redirect URL when I use docker run -it -v storage:/storage -v/home/giles/.config/gphotos-sync:/config -p8989:8989 gphotos-sync --host localhost --port 8989 /storage Did anyone make gphotos-sync 3.0.0 work with -p8080:8080 ? If so did you need to do anything else to make this work. |
Hi @gilesknap , how are you building the image? |
@aaccioly ah right. So I also tried --expose 8080 on the cli. Is that not the same thing? It did not work either (I am building with Dockerfile and not doing EXPOSE currently) |
Just tried adding the EXPOSE but still no joy. |
Just to verify. You have:
All 3 steps, in order, are needed to make it happen. |
Yes - exactly that sequence.
|
As for the custom host, apparently there's a Having said that, host support is not as much of a necessity than custom port. It's a nice to have for sure, but not as inconvenient as the hardcoded port. |
Interesting, maybe try to move the |
My reading of the docs says that -p should work without EXPOSE and its not working even at the end so there must be another issue. For the moment I'm going to do a release that has 2 features:
|
I have release 3.0.3 with the above features. I did not change the docs to use -p8080:8080 because its not working for me and I don't know why. But I'm not aware of any major issue with using --net host for just one invocation. |
Hi @gilesknap, it's more than fine to split in two releases. The primary reason why Now that I think about it, this may be culprit:
run_local_server may be binding to localhost by design. The container localhost is not the host localhost unless --net=host is enabled.
What happens if you pass Finally, why use Kind regards, |
I was doing the setup on Mac, but this documentation from Docker seems to imply that using
It was fine after CLIing into the container itself and going to the redirect url manually so not a big issue on my end but was a bit tricky for me to figure out since I didn't know it was an option lol |
Good catch @jdvp! If so, do you mind sharing the command for the benefit of everyone else. If you are right and |
Apparently @gilesknap, just making you aware of it in case we get a mob of angry users now that the Docker Hub image has been updated. |
@aaccioly so just did it again to make sure I had it right Basically on one terminal I ran the command like regularly mentioned in the docs (with the stuff to not actually pull anything bc I am moving my token to another machine):
This told me the url to navigate to in my browser:
I then went to the docker app and clicked the CLI button (I think this is the same as finding the docker container item and running exec? for me this seemed to run This opened a new terminal window and I tried to curl the redirect URL that I got in the oauth flow:
This gave an error about curl not being installed
So I installed curl with
After the install finished, I tried curling again and got the success message:
|
I'm of the opinion that it is binding to localhost by design - it only uses http for the connection and passes the secret token over that connection. You can try it yourself with 3.0.8, the command line arg --host is passed through to run_local_server but the only values that don't get the above error are 127.0.0.1 and localhost. The first thing I tried was run_console and it still uses the old google hosted uri oauth:2.0:oob which no longer works with unverified apps. According to the docs you linked the other option is a domain that you host and this would be fine for a vendor who is paying for API bandwidth but not for this case. This in combination with the net=host not working on Mac and Windows is a bit of a showstopper. I think I'll have to put @jdvp 's workaround in the docs. I can make it easier by installing curl in the image build. I have to say I tried the curl approach earlier today and was getting an error about missing scope. I'll need need to do more investigation (and get someone with a Mac to try out the approach). |
Oh wait - @jvp is on mac - its windows that has not been tried - I can do that, |
Hi Folks, just posting some hints here if someone stumble in the same problems that I did while upgrading to the new docker version.
If you are deleting your old OAuth credentials and creating new ones don't forge to delete
.gphotos.token
at the root of the storage folder or you will get a message about invalid credentials.This is properly document at https://gilesknap.github.io/gphotos-sync/main/tutorials/installation.html#execute-in-a-container, but if you are using docker you will need
--net=host
and-it
for the auth URL to show, otherwise the app will be stuck in the following message:After your new
.gphotos.token
file is generated the flags above are no longer necessary.Speaking of it, version 3.0.0 is not in Docker Hub (will it be published there as well?), you'll need the full GitHub Container Registry URL to run the latest version:
This may be pretty specific, but port 8080 is already in use on my system and It was not practical to stop the software that is using it. I've tried to remove the
--net=host
flag and use something like-p 98080:8080
, But port 8080 seems to be hard coded in the auth logic and simply replaying the request meant for port 8080 on a different port didn't work for me. Luckily I figured out that I could generate.gphotos.token
using another machine and simply copy the file over.I hope that this is useful to other people.
Originally posted by @aaccioly in #341 (comment)
The text was updated successfully, but these errors were encountered: