robincsamuel / ghost-google-drive

Google drive storage for ghost
MIT License
68 stars 26 forks source link

Images no longer loading properly #36

Closed sinisterkid closed 2 years ago

sinisterkid commented 2 years ago

First, let me say I'm a novice frontend developer, at best. However, I managed to get a ghost blog running and successfully implemented this code. After several posts and about 2 dozen photo uploads, the images no longer load properly. Sometimes I can see them, sometimes I only see some of them. And after a few page loads, I no longer see any images. I have to wait several hours before they appear again. What is happening? Is google throttling the requests?

CleanShot 2022-03-24 at 15 11 57@2x

CleanShot 2022-03-24 at 15 12 55@2x

vo0doO commented 2 years ago

It looks like authorization requests are not working well, try it - https://github.com/vo0doO/google-drive-ghost-storage-adapter, this is here api v3 and credentials generated instead of jwt, I'm not sure but should work better

robincsamuel commented 2 years ago

@sinisterkid It looks like an auth issue, I'll verify the issue. @vo0doO Thanks for your inputs, I'll check and see if that's the issue and if so will try to migrate to v3.

sinisterkid commented 2 years ago

Thanks @robincsamuel! In what time frame do you expect to verify issue? I would like to continue to use the addon but I have a monthly newsletter to maintain now.

behoyh commented 2 years ago

I'm taking a look at rewriting the integration in v3, trying to figure out why the image id casing is incorrect.

38

behoyh commented 2 years ago

After a lot of pain & suffering I managed to get up and running with Google Drive API v3! There should be no breaking changes (tested on an existing server) and should be compatible with new installations as well (verified with my docker image)

Currently I am working on getting image uploads to work. Feel free to pull into your installations and test the crap out of downloading pre-existing images, though.

behoyh commented 2 years ago

I was also able to fix uploads! give it a try with git clone https://github.com/behoyh/ghost-google-drive.git and let me know how it works for you!

sinisterkid commented 2 years ago

Thanks @behoyh! I'll try to test your solution but I could use some help from the rest of the community since I'm still learning.

behoyh commented 2 years ago

No problem! It should be a drop-in replacement, let me know if you have any difficulties.

sinisterkid commented 2 years ago

I see the changes from @behoyh were merged into master. Do I need to reinstall ghost-google-drive or restart ghost to see changes in my blog?

behoyh commented 2 years ago

The files won't update automatically. However you installed ghost-google-drive would need to be done again in order to reflect changes.

behoyh commented 2 years ago

Also, I made a small project to help access service account drives, google-drive-ui if you are interested. It was helpful for me!

sinisterkid commented 2 years ago

I haven't been able to verify the fix because I can't get the new version installed. I follow the install instructions exactly but I'm getting several vulnerabilities when I install in the current directory. When I check the index.js file, it is still the old version. The files aren't overriding.

Screen Shot 2022-04-23 at 3 53 57 PM
behoyh commented 2 years ago

Hmm. Looks like we forgot to update the npm package to match the version on GitHub. @robincsamuel should we release to npm as 3.0.0?

https://github.com/robincsamuel/ghost-google-drive/blob/963b2996a676cb9c917d2c70f3eaa33598784046/package.json#L3

robincsamuel commented 2 years ago

@behoyh Since there are no breaking changes, I think we should make it 2.1.0

robincsamuel commented 2 years ago

Released 2.1.0!

I see the changes from @behoyh were merged into master. Do I need to reinstall ghost-google-drive or restart ghost to see changes in my blog?

Please install 2.1.0 and it should work.

robincsamuel commented 2 years ago

Also, I made a small project to help access service account drives, google-drive-ui if you are interested. It was helpful for me!

This is great, @behoyh! A lot of people asked about accessing the storage in the past. I think It'd be nice to add the link to this repo's readme.

behoyh commented 2 years ago

Also, I made a small project to help access service account drives, google-drive-ui if you are interested. It was helpful for me!

This is great, @behoyh! A lot of people asked about accessing the storage in the past. I think It'd be nice to add the link to this repo's readme.

Thanks, Robin! Lets add a pr for that.

The other solution we could consider is making a content folder at the drive root, which would be natively sharable in Google Drive.

robincsamuel commented 2 years ago

@behoyh I think the google-drive-ui is the best option since it keeps the current implementation as-is. Also, that's the easiest we could do. shall we proceed with the readme update for now and discuss this separately if required?

behoyh commented 2 years ago

Hey @robincsamuel, that's a good point! Sounds good, the pr is ready to go.