Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/greenpau/caddy-git
Git Plugin for Caddy v2
https://github.com/greenpau/caddy-git
Last synced: 3 months ago
JSON representation
Git Plugin for Caddy v2
- Host: GitHub
- URL: https://github.com/greenpau/caddy-git
- Owner: greenpau
- License: apache-2.0
- Created: 2022-01-11T23:04:28.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-04T15:33:41.000Z (over 1 year ago)
- Last Synced: 2024-05-23T02:31:54.111Z (8 months ago)
- Language: Go
- Size: 152 KB
- Stars: 66
- Watchers: 6
- Forks: 11
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- my-awesome-github-stars - greenpau/caddy-git - Git Plugin for Caddy v2 (Go)
README
# caddy-git
Git Plugin for [Caddy v2](https://github.com/caddyserver/caddy).
Inspired by [this comment](https://github.com/vrongmeal/caddygit/pull/5#issuecomment-1010440830).
Please ask questions either here or via LinkedIn. I am happy to help you! @greenpau
Please see other plugins:
* [caddy-security](https://github.com/greenpau/caddy-security)
* [caddy-trace](https://github.com/greenpau/caddy-trace)
* [caddy-systemd](https://github.com/greenpau/caddy-systemd)## Table of Contents
* [Overview](#overview)
* [Getting Started](#getting-started)## Overview
The `caddy-git` allows updating a directory backed by a git repo.
## Getting Started
Configuration examples:
* [Public repo over HTTPS](./assets/config/Caddyfile)
* [Private or public repo over SSH with key-based authentication](./assets/config/ssh/Caddyfile)
* [Repo with Webhooks](./assets/config/webhook/Caddyfile)
* [Repo with post pull execution scripts](./assets/config/post_cmd_exec/Caddyfile)
* [Routeless config](./assets/config/routeless/Caddyfile)For example, the following configuration sets up a definition for `authp.github.io`
repo. The request to `authp.myfiosgateway.com/update/authp.github.io` trigger
`git pull` of the `authp.github.io` repository.```
{
git {
repo authp.github.io {
base_dir /tmp
url https://github.com/authp/authp.github.io.git
branch gh-pages
post pull exec {
name Pager
command /usr/bin/echo
args "pulled authp.github.io repo"
}
}
}
}authp.myfiosgateway.com {
route /version* {
respond * "1.0.0" 200
}
route /update/authp.github.io {
git update repo authp.github.io
}
route {
file_server {
root /tmp/authp.github.io
}
}
}
```The cloning of the repository happens on startup. Additionally, the cloning
happens when `/update/authp.github.io` is being hit.```
curl https://authp.myfiosgateway.com/update/authp.github.io
```