Skip to content

Commit ebc6006

Browse files
committed
Update readme to reflect the new default locations.
Signed-off-by: Gregory Schofield <greg.c.schofield@gmail.com>
1 parent 7c688ff commit ebc6006

File tree

1 file changed

+98
-7
lines changed

1 file changed

+98
-7
lines changed

README.md

Lines changed: 98 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ Gemfast is currently distributed in two different ways, a `docker` image and pre
3333

3434
When running Gemfast as a container, its important to mount the following directories:
3535

36-
* /var/gemfast - The directory for the Gemfast data including gems and database
37-
* /etc/gemfast - The directory for the gemfast.hcl config file. It is possible to configure the config file path using `env GEMFAST_CONFIG_FILE=/path/to/my/file.hcl`
36+
* /var/lib/gemfast/data - The directory for the Gemfast data including gems and database
37+
* /etc/gemfast - The directory for the gemfast.hcl config file
3838

3939
```bash
4040
docker run -d --name gemfast-server \
4141
-p 2020:2020 \
42-
-v /etc/gemfast:/etc/gemfast \
43-
-v /var/gemfast:/var/gemfast \
42+
-v ./gemfast.hcl:/etc/gemfast/gemfast.hcl:ro \
43+
-v ./data:/var/lib/gemfast/data \
4444
ghcr.io/gemfast/server:latest
4545
```
4646

@@ -63,11 +63,102 @@ make
6363
./bin/gemfast-server
6464
```
6565

66-
## Docs
66+
## Configuration
6767

68-
You can configure gemfast settings using the `/etc/gemfast/gemfast.hcl` file. There are many options all of which are listed in the documentation.
68+
### Configuration File
6969

70-
For more information see: https://gemfast.io/docs/configuration/
70+
Gemfast is configured using an HCL file. You can customize the location of this file using the `$GEMFAST_CONFIG_FILE` environment variable or by passing the `--config` argument when starting the server.
71+
72+
The places Gemfast automatically checks for configuration files are: `["/etc/gemfast/gemfast.hcl", "~/.config/gemfast/gemfast.hcl"]`
73+
74+
### Configuration Options
75+
76+
```terraform
77+
# ========== gemfast.hcl ==========
78+
79+
# Port to bind the HTTP server to. Defaults to 2020.
80+
port = 2020
81+
82+
# Log level (trace, debug, info, warn, error, fatal, panic)
83+
log_level = "info"
84+
85+
# Base data directory for gemfast. If not set, defaults to platform-specific user data dir.
86+
dir = "/var/lib/gemfast/data"
87+
88+
# Directory to store downloaded gem files.
89+
gem_dir = "/var/lib/gemfast/data/gems"
90+
91+
# Directory to store SQLite database files.
92+
db_dir = "/var/lib/gemfast/data/db"
93+
94+
# Optional path to an ACL file (Casbin policy).
95+
acl_path = "/var/lib/gemfast/data/acl.csv"
96+
97+
# Optional path to an authorization model file (Casbin model).
98+
auth_model_path = "/var/lib/gemfast/data/model.conf"
99+
100+
# Namespace prefix for private gems (default is "private").
101+
private_gems_namespace = "private"
102+
103+
# Disable the web UI if true.
104+
ui_disabled = false
105+
106+
# Disable Prometheus metrics endpoint if true.
107+
metrics_disabled = false
108+
109+
# ==== Mirror block ====
110+
# Define external sources to mirror gems from.
111+
mirror "https://rubygems.org" {
112+
enabled = true # Set to false to disable this mirror
113+
# hostname is auto-derived from upstream, but can be overridden
114+
# hostname = "rubygems.org"
115+
}
116+
117+
# ==== Filter block ====
118+
# Configure regex-based gem allow/deny logic.
119+
filter {
120+
enabled = true # Enable filtering
121+
action = "deny" # Action can be "allow" or "deny"
122+
regex = ["^evil-.*", "^bad-gem$"] # Regex list for filtering gem names
123+
}
124+
125+
# ==== CVE block ====
126+
# Control Ruby CVE integration.
127+
cve {
128+
enabled = true # Enable CVE scanning
129+
max_severity = "high" # Only block gems above this severity
130+
ruby_advisory_db_dir = "/var/lib/gemfast/data/ruby-advisory-db" # Directory to store the CVE DB
131+
}
132+
133+
# ==== Auth block ====
134+
# Configure authentication settings. You can only specify a single auth block.
135+
auth "local" { # can be local, github, or none
136+
bcrypt_cost = 10 # bcrypt cost for hashing passwords
137+
allow_anonymous_read = false # Allow unauthenticated read access
138+
default_user_role = "read" # Default role for newly created users
139+
140+
# If no users are specified, a default admin user will be created and the password written to the logs
141+
user { # repeat this block to add more users
142+
username = "admin"
143+
password = "changeme"
144+
role = "admin"
145+
}
146+
147+
# JWT secret used to sign access tokens (you can provide one or generate it automatically)
148+
secret_key_path = "/var/lib/gemfast/data/.jwt_secret_key"
149+
}
150+
151+
# GitHub OAuth integration
152+
# auth "github" {
153+
154+
# github_client_id = ""
155+
# github_client_secret = ""
156+
# github_user_orgs = ["my-org"] # Restrict access to users in these GitHub orgs
157+
# }
158+
159+
# No auth
160+
# auth "none" {}
161+
```
71162

72163
## UI
73164

0 commit comments

Comments
 (0)