A Git-based key-value storage service with HTTP API.
# Build
go build -o repokv .
# Run
./repokv
| Variable | Default | Description |
|---|---|---|
PORT | 8080 | HTTP server port |
REPOKV_ADMIN_API_KEY | admin-api-key | Admin API key for reload |
REPOKV_DATA_DIR | ./data | Directory for cloned repositories |
REPOKV_CONF_DIR | ./conf | Directory for repository configs |
REPOKV_REPO_MAX_RETRIES | 3 | Max retries for git operations |
Create YAML files in CONF_DIR (one per repository):
# conf/myrepo.yaml
api_key: secret-key-for-this-repo
url: https://github.com/user/repo.git
username: git-user
password: git-token
branch: main
path: data/config.json
git_user_name: repokv
git_user_email: repokv@example.com
Fields:
api_key - API key for accessing this repositoryurl - Git repository URLusername / password - Git authentication credentialsbranch - Git branch to usepath - Path to JSON file within the repositorygit_user_name / git_user_email - Git commit authorcurl -X POST http://localhost:8080/myrepo \
-H "X-API-Key: secret-key-for-this-repo" \
-d "key1=value1" \
-d "key2=value2"
curl -X POST http://localhost:8080/_reload \
-H "X-API-Key: admin-api-key"
CONF_DIRCONF_DIR for configuration changesMIT License - see LICENSE