diff options
author | Frederick Yin <fkfd@macaw.me> | 2020-06-14 18:39:50 +0800 |
---|---|---|
committer | Frederick Yin <fkfd@macaw.me> | 2020-06-14 18:39:50 +0800 |
commit | d34ba645c25f13ed53c64025d7a08ebda192af8a (patch) | |
tree | 0138c29b65b6541f6ddac9c47fd25fc40c3c6712 /README.md | |
parent | 59c2e948797d088e795cc2290fa8c3004ddb71c1 (diff) |
Update README.md
Add Usage
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 43 |
1 files changed, 41 insertions, 2 deletions
@@ -10,6 +10,45 @@ It's in the MVP stage, with the ability to view summary, trees, blobs, and commi ## Usage -TODO +Dependencies: -You need to edit the shebang of `cgi.py`. +- relatively new version of Python (3.8.3 personally) +- pygit2 (`pip install pygit2`) +- a gemini server capable of serving CGI + +You need to edit the shebang of `git-gmi/cgi`: + +```python +# change this: +#!/home/fakefred/p/git.gmi/venv/bin/python3.8 +# to the path to your python executable as a shebang +import gateway +``` + +also stuff in `const.py`: + +```python +GIT_CATALOG = "/home/fakefred/p/gemini/repos/" # dir where your repos are placed +CGI_PATH = "/git/cgi/" # path after the host part of URL that invokes the CGI script +# for example, gemini://fkfd.me/git/cgi/ is the entrance URL, hence /git/cgi/ +GIT_GMI_SITE_TITLE = "git.gmi demo instance" # whatever you want +# ... +``` + +Let's suppose you put your Gemini static files in `/path/to/gemini/`. Clone git.gmi to `/path/to/git.gmi/`. Then, symlink the `git-gmi` subdir to `/path/to/gemini/git/`. + +``` +$ cd /path/to +$ git clone https://git.sr.ht/~fkfd/git.gmi +$ ln -s /path/to/git.gmi/git-gmi gemini/git` +$ ls gemini/git # this is your cgi-bin dir +cgi const.py gateway.py git.py +``` + +Then, if you use Jetforce, run: + +``` +$ jetforce --dir /path/to/gemini --cgi-dir git [other arguments] +``` + +Access your instance at `gemini://your-domain-or-ip/git/cgi/`. Don't forget the trailing slash.
\ No newline at end of file |