- Go 80.5%
- Go Template 19.1%
- Dockerfile 0.3%
Cusul
Commons User Stats & Upload Linter
Stats about your Wikimedia Commons images
https://codeberg.org/strubbl/cusul
Credentials for Authentification
File
A credenitals file will be generated on the first launch of this application. You need to fill this with your bot password and oauth2 parameters. See the following chapters how to get these.
Bot password
A bot password is needed to make calls against the MediaWiki JSON API with the help of the go-mwclient library. A password can be generated here:
https://commons.wikimedia.org/w/index.php?title=Special:BotPasswords
OAuth2
OAuth2 is used to make authenticated download requests for thumbnails, which are going to be cached to disk. An OAuth2 consumer can be registered here: https://meta.wikimedia.org/wiki/Special:OAuthConsumerRegistration/propose/oauth2
Example .env file for Docker
For the Docker container, you can create an environment file like the following:
APP_USER_UID=1000
APP_GROUP_GID=1000
TARGET_USER=Strubbl
PORT=3131
SERVE_DIR=/
The environment file is only used in the Docker container to prefill the command line parameters for the cusul executable. If you are running cusul without docker, you have to use the cli parameters of the application.
Command-line parameters
$ ./cusul -h
Usage of ./cusul:
-c string
cache directory path (default "cache")
-cred string
path to the credentials JSON file (default "credentials.json")
-d print debug output
-dd
like parameter -d, but print more debug output
-ddd
like parameter -dd, but print even more debug output
-no-server
do not start a webserver after fetching data
-no-thumbs
do not cache any thumbnails
-no-update
do not update data and use the already fetched one
-o string
output path for the collected stats data JSON file (default "data.json")
-port int
change the port number to bind to (default 3131)
-u string
Wikimedia Commons user to be linted
-v print the program's version