Skip to content

Latest commit

 

History

History
62 lines (44 loc) · 1.25 KB

README.md

File metadata and controls

62 lines (44 loc) · 1.25 KB

Trigger Api for updating c:geo F-Droid mirror

We maintain two branch of c:geo.

  • mainline aka release (stable)
  • nightly

The Api

The Api has a single URL: https://fdroid.cgeo.org/update-fdroid.php

It accept a POST request with two parameters:

  • SECRET_KEY to authenticate
  • REPO to indicate which branch to update.

The REPO must be 'mainline' or 'nightly'.

If all tests passed, the update is triggered, and response delayed until the end of the command.

Response

Response are in JSON format.

{
    "status": 0,
    "message": "Command complete."
}

Other return code are as follow:

  • 0 => 'Command complete.'
  • 1 => 'No SECRET_KEY found in POST parameters.'
  • 2 => 'No REPO found in POST parameters. Value: mainline or nightly'
  • 3 => 'Bad SECRET_KEY.'
  • 4 => 'Bad REPO. Must be mainline or nightly'
  • 5 => 'Failed to update the repo.'

Examples

$ time curl -s https://fdroid.cgeo.org/update-fdroid.php -d "SECRET_KEY=good" -d "REPO=nightly" | jshon 
{
 "status": 0,
 "message": "Command complete."
}

real    0m22.387s
user    0m0.015s
sys     0m0.030s
$ curl -s https://fdroid.cgeo.org/update-fdroid.php -d "SECRET_KEY=bad" -d "REPO=nightly" | jshon 
{
 "status": 3,
 "message": "Bad SECRET_KEY."
}