30 points
Since setting up your own servers for things is demonstrably fine, let's go for it with git
.
It's simple as always: set up an SSH-accessible git server, create an empty repository there for us and let us push some stuff to it.
Once the server is up and running, configured according to what you got from the problem endpoint, hit the /_/git
endpoint (see below, under pulling the trigger) to trigger a push. You'll need to pass in the hostname of the server we should push to. We'll grab a tube of glue, prepend the username, append the path and we'll try calling that number.
We won't push much - just a simple solution.txt
file with the secret key inside. Pass that to the solution endpoint and grab some sweet points.
GET /challenges/hosting_git/problem?access_token=...
Problem JSON structure is simple:
ssh_key
: the SSH key our server will use to authorize over at your serverusername
: the username we want to use when connectingrepo_path
: the repository path we want to usepush_token
: the token you'll use to trigger a pushTo trigger the push, POST
a JSON to /_/git/$push_token
with a single key inside:
repo_host
: the host we should connect toProper values are foo.example.com
, git.nasa.gov
and so on. The final repo URL we try connecting to is usually something like hack@<repo_host>:folly/woot.git
(here for username = hack
and repo_path = folly/woot.git
).
Once the request is received, we'll start a push. The request blocks until the push has completed.
POST /challenges/hosting_git/solve?access_token=...
Your solution should be a JSON with a single key inside:
secret
: the secret you found in solution.txt
It's sort of fun and brings you one step closer to undestanding how brutally simple git hosting is.
h^
by buying me a coffee. Cheers!h^
profile is here.