Merge lp://qastaging/~systemdisc/shutter/imgur-fix into lp://qastaging/shutter

Proposed by Timothy Zorn
Status: Merged
Merged at revision: 1279
Proposed branch: lp://qastaging/~systemdisc/shutter/imgur-fix
Merge into: lp://qastaging/shutter
Diff against target: 341 lines (+190/-62)
4 files modified
bin/shutter (+5/-2)
share/shutter/resources/modules/Shutter/App/Common.pm (+1/-1)
share/shutter/resources/modules/Shutter/App/SimpleDialogs.pm (+4/-0)
share/shutter/resources/system/upload_plugins/upload/Imgur.pm (+180/-59)
To merge this branch: bzr merge lp://qastaging/~systemdisc/shutter/imgur-fix
Reviewer Review Type Date Requested Status
Mario Kemper (Romario) Approve
Michael Kogan Approve
Manuel Razzari (community) Approve
Review via email: mp+313977@code.qastaging.launchpad.net

Description of the change

I fixed Imgur Guest uploading and added Imgur OAuth uploading. Feel free to swap out the Client ID and Client Secret for your own imgur app registered here: https://api.imgur.com/oauth2/addclient (OAuth 2 authorization without a callback URL).

To post a comment you must log in.
Revision history for this message
Timothy Zorn (systemdisc) wrote :
Revision history for this message
Manuel Razzari (manael) wrote :

This worked for me!

Would be great if guest uploads had a wizard to create a config file.

For anyone who needs it:

1. Register here: https://api.imgur.com/oauth2/addclient (OAuth 2 authorization without a callback URL).
2. Create ~/.imgur-api-config (this will be a JSON config file in your home dir)
3. Populate it with the imgur keys from step 1:

{
"client_id": "xxxxxxxxxxxxxxx",
"client_secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}

review: Approve
Revision history for this message
Timothy Zorn (systemdisc) wrote :

> This worked for me!
>
> Would be great if guest uploads had a wizard to create a config file.

There's not need for guest uploads to create a config file, since the user does not need to authenticate themselves.

>
> For anyone who needs it:
>
> 1. Register here: https://api.imgur.com/oauth2/addclient (OAuth 2
> authorization without a callback URL).
> 2. Create ~/.imgur-api-config (this will be a JSON config file in your home
> dir)
> 3. Populate it with the imgur keys from step 1:
>
> {
> "client_id": "xxxxxxxxxxxxxxx",
> "client_secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
> }

This is incorrect. The client_id and client_secret should be set by the software, not the end user. I was letting the owner of this repository know how to get their own client_id and client_secret if they wanted it.

Revision history for this message
Manuel Razzari (manael) wrote :

> There's not need for guest uploads to create a config file, since the user
> does not need to authenticate themselves.

Apologies for the confusion. Maybe it should've been a comment on #1565048.

My note was aimed at other people trying to use this Shutter feature, since it hasn't been updated in 2+ years, and your patch does fix it.

Since I had to get my own imgur keys for it to work, I wanted to let people know how to do it without having to review the code :)

Revision history for this message
Michael Kogan (michael-kogan) wrote :

Since it is quite improbably that Mario will review this any time soon: Is there any way to make the guest upload work without user interaction? I would like to include this patch into Shutter's Arch Linux package and get stuck with a connection error.

Revision history for this message
Timothy Zorn (systemdisc) wrote :

Guest uploading to Imgur should work without anything more than selecting Imgur Guest. Can you provide more details on the issue you're having?

Revision history for this message
Michael Kogan (michael-kogan) wrote :

I'm getting this error in a popup window when trying Imgur guest uploading:

Invalid client_id: Maybe you or Imgur revoked or expired an access token. Please close this dialog and try again. Your account will be re-authenticated the next time you upload a file.

Revision history for this message
Michael Kogan (michael-kogan) wrote :

P.S.: Obviously I tried to close the dialog and give the uploading another go, but I always get the same message.

Revision history for this message
Timothy Zorn (systemdisc) wrote :

I'll fix it as soon as I can. This is when choosing Imgur Guest, not Imgur OAuth, correct?

Revision history for this message
Manuel Razzari (manael) wrote :

> I'm getting this error in a popup window when trying Imgur guest uploading:
>
> Invalid client_id: Maybe you or Imgur revoked or expired an access token.
> Please close this dialog and try again. Your account will be re-authenticated
> the next time you upload a file.

You just need to create an ~/.imgur-api-config file (see my comment on 01-13).

Or, since you will be distributing this, edit the hardcoded client_id and client_secret you'll find in shutter/resources/system/upload_plugins/upload/Imgur.pm

Revision history for this message
Michael Kogan (michael-kogan) wrote :

@Timothy Zorn: Exactly!

@Manuel Razzari: I hoped that for guest access this is not necessary, but if it is, I will set the id and secret fields, I guess...

Revision history for this message
Timothy Zorn (systemdisc) wrote :

I'll fix it in under 24 hours. I'm just busy today.

Revision history for this message
Michael Kogan (michael-kogan) wrote :

@Timothy Zorn: No worry, it won't run away. Thanks for taking care of it!

1280. By Timothy Zorn

Fix Imgur Guest upload without config file

1281. By Timothy Zorn

Remove extra debug info which I was using

Revision history for this message
Timothy Zorn (systemdisc) wrote :

It should work out-of-the-box now.

Revision history for this message
Michael Kogan (michael-kogan) wrote :

Cool, works now, added the patch to Arch's Shutter package!

Revision history for this message
Michael Kogan (michael-kogan) :
review: Approve
Revision history for this message
Phil (phd21) wrote :

Hi Everyone,

Could any of you please explain to me so I can explain to others, where I can download these updated file(s), and how to install them? Do I need to download just the "imgur.pm" file, or are there other files needed to get this working with "imgur", if so where? Are there new Shutter ".deb" packages available or a PPA for these updates?

FYI: I am using Linux Mint 17.3 KDE and Linux Mint 18.1 KDE and using the "shutter-testing-team" PPA to keep my Shutter application updated, is this the correct one? Have these changes been uploaded to the Shutter PPAs?

Also, since all of you seem good at this, have you come up with other ".pm" files for other image hosting services like "postimage.org", etc...? It would be really nice if Shutter had a configuration option to add other image hosts as well based upon the host's authentication method ...

Best regards to all of you,
Phil
phd21
<email address hidden>

Revision history for this message
Timothy Zorn (systemdisc) wrote :

You need bzr to download the branch.

sudo apt-get install bzr
bzr branch lp:~systemdisc/shutter/imgur-fix

> Hi Everyone,
>
> Could any of you please explain to me so I can explain to others, where I can
> download these updated file(s), and how to install them? Do I need to download
> just the "imgur.pm" file, or are there other files needed to get this working
> with "imgur", if so where? Are there new Shutter ".deb" packages available or
> a PPA for these updates?
>
> FYI: I am using Linux Mint 17.3 KDE and Linux Mint 18.1 KDE and using the
> "shutter-testing-team" PPA to keep my Shutter application updated, is this the
> correct one? Have these changes been uploaded to the Shutter PPAs?
>
>
> Also, since all of you seem good at this, have you come up with other ".pm"
> files for other image hosting services like "postimage.org", etc...? It would
> be really nice if Shutter had a configuration option to add other image hosts
> as well based upon the host's authentication method ...
>
> Best regards to all of you,
> Phil
> phd21
> <email address hidden>

Revision history for this message
Timothy Zorn (systemdisc) wrote :

Photon also apparently added this patch to Arch's Shutter package: https://aur.archlinux.org/packages/shutter/

It looks like there's a nice patch for my imgur fix there, too: https://aur.archlinux.org/cgit/aur.git/tree/fix-imgur.patch?h=shutter

Revision history for this message
Timothy Zorn (systemdisc) wrote :
Revision history for this message
Timothy Zorn (systemdisc) wrote :

For Debian, you may consider approaching the package maintainer with this merge request.
https://packages.qa.debian.org/s/shutter.html

Revision history for this message
Phil (phd21) wrote :

Hi Timothy Zorn,

Thank you for your replies.

I try to help out the members on the Linux Mint forums. Their main distributions are based on Ubuntu 14.04 (Linux Mint 17.x) and Ubuntu 16.04 (Linux Mint 18.x)

Although I am an experienced computer user, I am not familiar with using Launchpad, or Arch Linux for downloading and installing software and or their updates. I am learning them, and help from people like yourself makes that better (Thanks).

I want to be able to provide the Linux Mint members (including myself) a relatively easy way to update their Shutter application to use your version of the "imgur-fix" which includes the "Guest" and the "0Auth" authentication, that latter is more important. I used the BZR command you provided which downloaded and created your imgur-fix folder underneath my "/home/user69" folder, now what do I do to install it?

Using the Arch method looks like a lot of work, including installing the Arch package manager?. Is this safe to do in my Linux Mint (Ubuntu) system?

Best regards,
Phil
Linux Mint forum user=phd21
<email address hidden>

Revision history for this message
Michael Kogan (michael-kogan) wrote :

Hi Phil,

I think, you cannot install an AUR package in Mint. You can either install Shutter from source (not a good practice because there will be no easy way to remove it but possible), report the bug to the Debian people (Timothy Zorn posted a link to Debian's bug tracker above) wait till some Ubuntu dev incorporates the fix by Timothy Zorn into Ubuntu's Shutter package (there is already a pretty old bug report against Ubuntu's package: https://bugs.launchpad.net/shutter/+bug/1565048), report the bug to the Mint people and hope that they do this in the Mint package, find somebody who agrees to create a PPA for Shutter, switch to an Arch based distro and use my AUR package or not use the upload functionality. :)

Revision history for this message
Elvis de Freitas Souza (edigitalb) wrote :

I really want to know why this PR is not merged yet.

Revision history for this message
Michael Kogan (michael-kogan) wrote :

Because development is dead for years already, unfortunately. I think, this needs to be fixed on packaging level unless somebody likes to take over the development and at least merge all the patches which accumulated to far.

Revision history for this message
Timothy Zorn (systemdisc) wrote :

> Because development is dead for years already, unfortunately. I think, this
> needs to be fixed on packaging level unless somebody likes to take over the
> development and at least merge all the patches which accumulated to far.

How does one become the owner of lp:shutter? I wouldn't mind taking ownership and doing an initial cleanup just to keep the project alive - I could always assign other interested parties as contributors or however it works on LaunchPad/bzr.

Revision history for this message
Michael Kogan (michael-kogan) wrote :

Probably you need to get in touch with Mario (contact information in https://launchpad.net/~mario-kemper). If he is not reachable, maybe make a fork?

Revision history for this message
Adam Stokes (adam-stokes) wrote :

I think we should fork this project and get those merges in. Also create a team that could have several members who are willing to review code, get changes merged, and packages pushed out.

I'd like to participate and also would like to see what we can do about getting a confined snap built so that Fedora, Arch, Mint, and other Debian based distros can get these updates from a single distribution code base.

Revision history for this message
Michael Kogan (michael-kogan) wrote :

In principle I would like to participate as well since I was involved in translating and testing from the very beginning of Shutter's development (it was called GScrot back then) and have now taken over the packaging for Arch Linux. However, I don't know Perl and have very little programming experience, so I would be not much of a help, I guess. But maybe we should try to get some reply from Mario before making further plans.

Revision history for this message
Michael Kogan (michael-kogan) wrote :

P.S.: Just got a notification that Mario added me to the Shutter team and I added you guys!

Revision history for this message
Mario Kemper (Romario) (mario-kemper) :
review: Approve
Revision history for this message
Mario Kemper (Romario) (mario-kemper) wrote :

Hi all,

sorry for being silent for some time, but unfortunately my time is very limited nowadays. I have added Michael Kogan to both relevant groups (Shutter Team and Shutter Testing Team) as Administrator. Please let me know if you are able to push/merge to lp:shutter (trunk) and please also let me know if you need any further information. Most of the things are working automatically (creating packages for PPAs via recipe et cetera).

Good luck and thanks for your contribution.

Bye
Mario

Revision history for this message
Michael Kogan (michael-kogan) wrote :

Thanks, Mario, I hope, we will manage!

Adam, Thimothy: I added you to both groups as well, but I won't have time to deal with the merging before Saturday, so feel free to go ahead!

Revision history for this message
Timothy Zorn (systemdisc) wrote :

I won't be available until this weekend, either.

Revision history for this message
Adam Stokes (adam-stokes) wrote :

I attempted to do the merge tonight but I don't seem to have access to push to trunk

Revision history for this message
Michael Kogan (michael-kogan) wrote :

Sorry for the delay, guys, I will look into it in the evening!

Revision history for this message
Michael Kogan (michael-kogan) wrote :

Looks like the permissions for the lp:shutter branch do not give push permissions to the Shutter group. I wrote a mail to Mario and asked for further instructions.

Revision history for this message
Timothy Zorn (systemdisc) wrote :

Do we have somewhere we can communicate in real-time, instead of communicating through the issue tracker? (IRC, Facebook, etc)

Maybe we should set up a channel in freenode or something.

Revision history for this message
Adam Stokes (adam-stokes) wrote :

Agreed, how about #shutter on freenode?

Revision history for this message
Timothy Zorn (systemdisc) wrote :

Sounds good to me

Revision history for this message
Michael Kogan (michael-kogan) wrote :

I joined you at the channel, guys!

Revision history for this message
Timothy Zorn (systemdisc) wrote :

Make sure to mention my nickname in IRC so I get a notification

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to status/vote changes: