New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generalised caching, more documentation, and other set-up things #29
Changes from 8 commits
0574bef
2b02b92
0573a9a
42865ee
14047dc
e0f1d74
8be5bf6
0b33d96
8acac8b
5e28336
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
; Oauth parameters. | ||
OAUTH_CONSUMER_TOKEN = | ||
OAUTH_SECRET_TOKEN = | ||
OAUTH_ENDPOINT = 'https://meta.wikimedia.org/w/index.php?title=Special:OAuth' | ||
OAUTH_REDIR = 'https://meta.wikimedia.org/wiki/Special:OAuth/authenticate?' | ||
OAUTH_CALLBACK = 'oob' | ||
|
||
; Database connection details. The same username and password is used for both data sources. | ||
DB_DSN_ENWIKI = "mysql:host=127.0.0.1;port=4711;dbname=enwiki_p" | ||
DB_DSN_PLAGIABOT = "mysql:host=127.0.0.1;port=4711;dbname=s51306__copyright_p" | ||
DB_USER = | ||
DB_PASS = | ||
|
||
; Caching system. If a Redis host is not defined, a local Filesystem cache will be used instead. | ||
REDIS_HOST = "tools-redis" | ||
REDIS_PORT = 6379 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We might want to add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea. At the moment we're determining staging with And there's |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
{ | ||
"license": "GPL-3.0+", | ||
"require": { | ||
"ext-intl": "*", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do we need the intl extension for? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's for the number formatting I think. I did not know we could require PHP extensions through composer, so I ended up manually installing/enabling it my php.ini There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it's for NumberFormatter. Composer can't install extensions but it does alert people to the fact that they are required. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of requiring intl (which might require someone to spend half an hour upgrading their PHP), let's just check for the existence of NumberFormatter. After all, number formatting isn't critical to the tool's functionality:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea! And we can make it simpler even, because the Twig defaults are the same as you've set there (dot and comma). |
||
"oyejorge/less.php": "~1.5", | ||
"mediawiki/oauthclient": "~0.1", | ||
"wikimedia/slimapp": "dev-master", | ||
"addwiki/mediawiki-api-base": "~2.1", | ||
"wikimedia/simplei18n": "~1.0" | ||
"wikimedia/simplei18n": "~1.0", | ||
"tedivm/stash": "^0.14" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
|
@@ -23,5 +25,13 @@ | |
"parallel-lint . --exclude vendor", | ||
"phpcs -p" | ||
] | ||
}, | ||
"script": { | ||
"post-install-cmd": [ | ||
"php -r \"file_exists('.env') || copy('.env_example', '.env');\"" | ||
], | ||
"post-update-cmd": [ | ||
"php -r \"file_exists('.env') || copy('.env_example', '.env');\"" | ||
] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. super cool! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, just a shame that there's no |
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is
oob
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Out Of Band', which isn't really correct because we do actually use a callback. (OOB usually means e.g. a desktop application is requesting the auth.) In our case, the callback is fixed by the consumer registration on Meta, so actually this will be ignored; it does have to be something though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. Yeah for us it looks like we need a full URL to
/copypatrol/oauth/callback
. On my local I have the app running atlocalhost/copypatrol
so I usehttp://localhost/copypatrol/oauth/callback
and this works. We might suggest something similar here