Skip to content

Commit a11eaab

Browse files
committed
made config file path less stupid
1 parent 7d07a68 commit a11eaab

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,29 +36,33 @@ To use it with your repos, please note the following.
3636
REPO_DIR=/repositories
3737
```
3838

39-
3. A `config.toml` file also needs to be created and placed at `$HOME/.config/config`. Within the `config.toml` there must be a list of namespace dirs and repo dirs which are allowed to be served, and a title, which may be left blank if unneeded.
39+
3. A `gemini-git-browser.toml` file also needs to be created and placed at `$XDG_CONFIG_HOME/gemini-git-browser`. `XDG_CONFIG_HOME` is usually set to `$HOME/.config` on linux. Within the `gemini-git-browser.toml` there must be a list of namespace dirs and repo dirs which are allowed to be served, and a title, which may be left blank if unneeded.
4040

4141
```
42-
# $HOME/.config/config/config.toml
42+
# $HOME/.config/gemini-git-browser/gemini-git-browser.toml
4343
allowed = ["masalachai", "masalachai/gemini-git-browser"]
4444
title = ""
4545
```
4646

47-
Once the `REPO_DIR` variable and `config.toml` file is set, executing the binary should serve the repos at the gemini port.
47+
Once the `REPO_DIR` variable and `gemini-git-browser.toml` file is set, executing the binary should serve the repos at the gemini port.
4848

4949
## Run from Docker
5050

51-
The UI is also packaged as a docker image for easy deployment. To run it, create the `config.toml` file and a TLS certificate and private key first (gemini uses TLS by default), then mount the `config.toml`, the certificate and private key and your repository directory into the container with the following command.
51+
The UI is also packaged as a docker image for easy deployment. To run it:
52+
53+
- create the `gemini-git-browser.toml` file
54+
- a TLS certificate and private key (gemini uses TLS by default)
55+
- mount the `gemini-git-browser.toml`, the certificate and private key and your repository directory into the container with the following command:
5256

5357
```
54-
# Paths used for the certificate and key are default let's encrypt paths
5558
docker run -p 1965:1965 \
5659
-v /etc/letsencrypt/live/yourdomain.com/fullchain.pem:/app/cert/cert.pem \
5760
-v /etc/letsencrypt/live/yourdomain.com/privkey.pem:/app/cert/key.pem \
5861
-v /my-repositories:/repositories
5962
-v $HOME/.config/config/config.toml:/root/.config/config/config.toml
6063
-it ayravat/gemini-git-browser:latest
6164
```
65+
The paths used in this example are the default let's encrypt certificate and key paths and the default location of the `gemini-git-browser.toml` file. Please adjust the command accordingly if your certificate or toml file paths are different.
6266

6367
Once the container is running you can access the UI at gemini://localhost/
6468

src/repo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ impl RepoDir {
224224
panic!("Error reading REPO_DIR: {}", err);
225225
});
226226

227-
let config: util::Config = match confy::load("config") {
227+
let config: util::Config = match confy::load("gemini-git-browser") {
228228
Ok(cfg) => cfg,
229229
Err(e) => panic!("Config read error: {}", e),
230230
};

0 commit comments

Comments
 (0)