https://github.com/dmolik/githubfs
A weird little C program to fetch your stared repos and mount to a directory
https://github.com/dmolik/githubfs
c github graphql libcurl libfastjson libfuse lmdb
Last synced: 7 months ago
JSON representation
A weird little C program to fetch your stared repos and mount to a directory
- Host: GitHub
- URL: https://github.com/dmolik/githubfs
- Owner: dmolik
- License: mpl-2.0
- Created: 2019-10-28T11:38:39.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-11T10:44:52.000Z (about 6 years ago)
- Last Synced: 2025-03-30T08:32:16.522Z (10 months ago)
- Topics: c, github, graphql, libcurl, libfastjson, libfuse, lmdb
- Language: C
- Homepage:
- Size: 71.3 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: COPYING.md
Awesome Lists containing this project
README
# GitHubFS
I got curious over the weekend and wonder what it would be like to query the GitHub API in C using [libCurl](https://curl.haxx.se/libcurl/). I quickly realized I was going to need a JSON parser, so I reached for [libfastjson](https://github.com/rsyslog/libfastjson), which is a fork of json-c brought to us by the rsyslog folks.
The project has evolved! it now mounts a full list of your stared repos to a directory of your choosing using [Fuse](https://github.com/libfuse/libfuse).
The code has now been refactored to use [LMDB](https://symas.com/lmdb/) for persistence, and Repo access.
## Prerequisites
You're going to need a; Compiler, Make of some sort, libfastjson with headers, and libcurl with it's headers, libfuse, and now lmdb with it's headers.
## Building
All you need to do is run:
make
## Running
The fetcher needs two environment variables `GH_USER`; your github username, and `GH_TOKEN`; a personal access token to your public repos. Execution might look something like this:
export GH_USER=dmolik
export GH_TOKEN=
./githubfs
For example:
> export GH_USER=dmolik
> export GH_TOKEN=example123
> ./githubfs t
> githubfs t
t
├── aalhour
│ └── awesome-compilers
├── acassen
│ └── keepalived
├── adapta-project
│ └── adapta-gtk-theme
├── admiraltyio
│ └── multicluster-scheduler
└── AidoP
└── Skypaper
> cat t/acassen/keepalived
URL: git@github.com:acassen/keepalived.git
Description: Keepalived