The svgtranslate tool should now be setup in the production instance. We got approval from instance owner to take it over, Everyone under the community-tech-tools project should have access to that instance. Existing files in the tool repo can be deleted.
Description
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | Samwilson | T210888 Move svgtranslate tool to production instance | |||
Resolved | Samwilson | T214973 [oauthclient] Undefined offset when decoding JWT | |||
Resolved | Reedy | T215243 Update mediawiki/oauthclient on Packagist |
Event Timeline
I've done the first part of this.
- Backed up existing app to 2019-01-28_old_site.tgz
- Installed new app to ~/app/ and symlinked public_html/ to app/public/
- Configured URL rewriting
I started configuring OAuth (re-using the existing OAuth consumer, and redirecting the old callback URL) but it's currently failing after redirection with the super-helpful error "Notice: Undefined offset: 1". So I'll keep looking at that soon.
I think there is an issue with the old OAuth consumer (like a different callback URL, and the redirect I've been trying might be breaking something), so have registered a new one. It's https://meta.wikimedia.org/wiki/Special:OAuthListConsumers/view/b92b2d7697f16a8f7a82435b7c20b3dc
With the 1.0.2 version of oauthclient we're now getting the following error when authenticating to Commons:
[2019-02-05 04:33:17] request.CRITICAL: Uncaught PHP Exception MediaWiki\OAuthClient\Exception: "JWT has incorrect format. Received: {"error":"mwoauth-invalid-authorization-wrong-wiki","message":"The authorization headers in your request are not valid for metawiki"}" at /data/project/svgtranslate/app/vendor/mediawiki/oauthclient/src/Client.php line 327 {"exception":"[object] (MediaWiki\\OAuthClient\\Exception(code: 0): JWT has incorrect format. Received: {\"error\":\"mwoauth-invalid-authorization-wrong-wiki\",\"message\":\"The authorization headers in your request are not valid for metawiki\"} at /data/project/svgtranslate/app/vendor/mediawiki/oauthclient/src/Client.php:327)"} []
Is this because the consumer is limited to Commons? I'd thought that even those consumers were still supposed to start the auth process at Meta?
Oh. Yep, that was the problem. :) Logging in now works on the prod site.
I'm now setting up auto deployment of releases (not that we have any yet).
We've been installing svgtranslate without using --no-dev for composer install, so we can use the .env file. There doesn't seem to be a reason to not continue to do this, but it'd be better to not also install all the other dev requirements. So https://github.com/wikimedia/svgtranslate/pull/61 moves symfony/dotenv requirement to the prod requirements section.
I've got a draft of the auto-deployment here: https://github.com/wikimedia/ToolforgeBundle/pull/12
Although this task as written is complete, I'm going to keep it open until the auto-deployment PR is merged.
Actually, scratch that. If we're not running on Kubernetes (T213669) then the deployment script can be simplified.
The PR that's waiting for review here is https://github.com/wikimedia/ToolforgeBundle/pull/12
Both staging and production are now running with continuous deployment (the latest tag for production, and the latest master for staging).
There's no QA to be done here I think (although next time we merge to master or tag a commit we'll want to check that the sites update as they should).
Thanks Sam! This is going to revolutionize our deployment process. I hope we can do this for all our ToolForge projects, going forward.