abbysmal / Canopy

A git-blogging unikernel written using MirageOS
ISC License
120 stars 27 forks source link

serving canopy blogs from a local git repository #67

Open gasche opened 8 years ago

gasche commented 8 years ago

I would like to test a local git repository for Canopy blog posts before pushing it to the actual repo. I built Canopy locally, but then I have not manage to get it to read posts from a local git repository.

$ ./mir-canopy -r /home/gasche/Scolaire/neu/icfp-sv/icfp2016-blog/ -i Welcome -p 8080 -u 12345
Manager: connect
Manager: configuring
2016-10-14 20:45.10: INF [git.memory] Reading HEAD
Pulling repository
Fail pull (Failure "Unknown Git protocol")
2016-10-14 20:45.10: INF [git.memory] Reading HEAD
2016-10-14 20:45.10: INF [git.memory] Reading refs/heads/master
2016-10-14 20:45.10: INF [git.memory] Reading HEAD
2016-10-14 20:45.10: INF [git.memory] Reading HEAD
2016-10-14 20:45.10: INF [git.memory] Reading refs/heads/master
HTTP server listening on port 8080
$ ./mir-canopy -r file:///home/gasche/Scolaire/neu/icfp-sv/icfp2016-blog/ -i Welcome -p 8080 -u 12345
Manager: connect
Manager: configuring
2016-10-14 20:44.41: INF [git.memory] Reading HEAD
Pulling repository
Fail pull (Failure "file is not a supported Git protocol")
2016-10-14 20:44.41: INF [git.memory] Reading HEAD
2016-10-14 20:44.41: INF [git.memory] Reading refs/heads/master
2016-10-14 20:44.41: INF [git.memory] Reading HEAD
2016-10-14 20:44.41: INF [git.memory] Reading HEAD
2016-10-14 20:44.41: INF [git.memory] Reading refs/heads/master
HTTP server listening on port 8080

Could this be supported? I grepped for not a supported protocol in the sources but couldn't find any hit for this error message. Which piece of the ecosystem is it that fails to support file?

Also, why does Canopy still run a server and loops infinitely when it failed to resolve the Git repository? Is there anything useful in that, or could it just not quit on this error?

hannesm commented 8 years ago

Canopy should quit if it fails to load its remote git repository.

I suspect the code responsible for resolution of protocol to how to communicate there is likely hidden somewhere in git or in conduit, but I'm not able to spot it right now... @samoht might be able to quickly point out where the code is

samoht commented 8 years ago

See https://github.com/mirage/ocaml-git/blob/master/lib/unix/git_unix.ml#L128 and https://github.com/mirage/ocaml-git/issues/27