Skip to content

Commit ff4bc42

Browse files
committed
docs: fix structure
1 parent c037751 commit ff4bc42

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ snapshot: man
2828

2929
assemble-docs: build/git-pipe
3030
cat _header.md > README.md
31-
find _docs -name '*.md' -type f | sort | xargs -n 1 cat | sed 's/^#/\n##/' >> README.md
31+
find _docs -name '*.md' -type f | sort | xargs -n 1 sed 's/^#/\n\n##/' | sed 's/\n\n/\n/' >> README.md
3232
echo '\n\n## Usage\n\n' >> README.md
3333
stty rows 1024 cols 1024
3434
./build/git-pipe --help | grep ' ' | sed -n -r '/^\s+[a-z]/p' | tail -n +2 | sed -E 's/^\s+([a-z]+)\s+(.*)?/* `\1` - \2/' >> README.md

README.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,11 @@ Wait a bit to finish building and go to
7272
* [ ] support GitHub-like webhooks
7373
* [ ] lazy initialization
7474
* [x] path routing as alternative to domain-based
75+
7576
## Installation
7677

7778

79+
7880
### Requirements
7981

8082
* `docker`
@@ -87,11 +89,13 @@ During the first deployment, the following images will be downloaded automatical
8789
* busybox
8890

8991

92+
9093
### Pre-built binary
9194

9295
Download binary for your OS and arch from [github releases](https://github.com/reddec/git-pipe/releases/latest).
9396

9497

98+
9599
### Docker
96100

97101
Versions
@@ -104,6 +108,7 @@ To download the latest version use:
104108
docker pull reddec/git-pipe:latest
105109

106110

111+
107112
### Debian/Ubuntu installation
108113

109114
Download and install required .deb file from [github releases](https://github.com/reddec/git-pipe/releases/latest).
@@ -112,9 +117,11 @@ Download and install required .deb file from [github releases](https://github.co
112117
[docker-compose](https://docs.docker.com/compose/install/) from the official Docker repository instead of APT. APT repos could be very outdated.
113118

114119

120+
115121
## Supported repo types
116122

117123

124+
118125
### docker-compose
119126

120127
Requires docker-compose.yaml or docker-compose.yaml file in the root directory.
@@ -126,14 +133,17 @@ Flow:
126133
- `start` equal to `docker-compose up`
127134

128135

136+
129137
### docker
130138

131139
Requires Dockerfile in the root directory. Will be executed as-is.
132140

133141
Flow:
134142

135143
- `build` equal to `docker build`
136-
- `start` equal to `docker run`# Docker Compose
144+
- `start` equal to `docker run`
145+
146+
## Docker Compose
137147

138148
> tested on docker-compose 1.27
139149
@@ -152,6 +162,7 @@ Domains will be generated as> `<port?>.<x-domain|service>.<x-domain|project>.<ro
152162
and `<x-domain|project>.<root-domain>` points to `<first x-root: true|www|web|gateway>`
153163

154164

165+
155166
### Minimal example:
156167

157168
```yaml
@@ -183,6 +194,7 @@ Root domain: `mini.localhost` points to `web` service to internal port `80` (the
183194
in array)
184195

185196

197+
186198
### Override everything example
187199

188200
```yaml
@@ -217,6 +229,7 @@ Generated mapping (root domain (`-d,--domain,$DOMAIN`) is `localhost`):
217229
Root domain: `super.localhost` points to `api` service to internal port `80` (the first service with `x-root: yes`, first
218230
port in array)
219231

232+
220233
## Backup
221234

222235
For the single Dockerfile setup:
@@ -236,6 +249,7 @@ by-default equal to `git-pipe-change-me`.
236249
Restore will be done **automatically** before the first run.
237250

238251

252+
239253
### Supported destination
240254

241255
Defined by `-B,--backup,$BACKUP`. Default is `file://backups`
@@ -267,16 +281,19 @@ Backup URL: `s3://<id>:<secret>@s3.<region>.backblazeb2.com/<bucket name>`
267281

268282
> (B2) There is some lag between backup and availability to download. Usually, it's around 2-5 minutes for me.
269283

284+
270285
## Git
271286

272287
git-pipe uses `git` executable so all configuration from `~/.git` is supported.
273288

274289
It is a good idea to generate deployment SSH keys with read-only access for production usage, however, it is not
275290
mandatory.
276291

292+
277293
## Run
278294

279295

296+
280297
### As binary
281298

282299
git-pipe [flags..] <repo, ...>
@@ -305,6 +322,7 @@ two universal methods of how to route traffic from the unknown amount of domains
305322
2. Use automatic DNS registration from [providers](#supported-providers)
306323

307324

325+
308326
### As docker
309327

310328
Version:
@@ -340,6 +358,7 @@ By default, SSH will be used without strict host checking. To harden pulling you
340358
to `/root/.ssh/config`.
341359

342360

361+
343362
#### Volumes
344363

345364
`/app/backups` - default directory for backups. Will not be used in case of non-file (ex: S3) backup. Without S3 it
@@ -352,7 +371,9 @@ re-download repos anytime.
352371
**highly recommended** to persist this volume to prevent hitting rate-limit from Let's Encrypt.
353372

354373
In case you are using your certificates, you should them as `server.key` and `server.crt` and you may mount them in
355-
read-only mode.# Environment variables
374+
read-only mode.
375+
376+
## Environment variables
356377

357378
`git-pipe` will pass the environment to the packs by prefix: where prefix is repo name (simple or FQDN - depends on setup)
358379
in upper case with dash replaced to underscore. Passed keys will be trimmed from suffix: `TINC_BOOT_X_Y_Z` will be
@@ -378,11 +399,13 @@ In case you used `--fqdn` you should specify the full name of repo: `MY_EXAMPLE.
378399

379400

380401

402+
381403
### docker
382404

383405
Trivial: just use environment variables as-is.
384406

385407

408+
386409
### docker-compose
387410

388411
To use env variables in compose
@@ -397,18 +420,21 @@ services:
397420
DB_URL: "${DB_URL:-localhost}"
398421
```
399422

423+
400424
## Router
401425

402426
Router (proxy) provides reverse-proxy concept.
403427

404428
`-D, --dummy, $DUMMY` disables router completely. Could be useful for services deployed without HTTP services.
405429

406430

431+
407432
### Domain routing
408433

409434
By-default, each repo and service deployed as separated domain. Root domain can be defined in `-d,--domain,$DOMAIN`.
410435

411436

437+
412438
### Path routing
413439

414440
In case multiple domains is not an option the path-based routing can be useful. Enabled by
@@ -417,6 +443,7 @@ prefixes. In this mode, `--domain` flag will not be used for services name,
417443
however, it still required for automatic TLS.
418444

419445

446+
420447
## DNS
421448

422449
git-pipe uses domain-based routing system which means that all exposed deployed containers will be externally accessible
@@ -431,9 +458,11 @@ be done in several ways:
431458
use flag `-p, --provider, $PROVIDER` and provider-specific flags.
432459

433460

461+
434462
### Supported providers
435463

436464

465+
437466
#### Cloudflare
438467

439468
Provider name: `cloudflare`
@@ -458,7 +487,9 @@ Options:
458487
* `--cloudflare.proxy` (`$CLOUDFLARE_PROXY`) - Let Cloudflare proxy traffic. Implies some level of protection and
459488
automatic SSL between client and Cloudflare
460489
* `--cloudflare.api-token <TOKEN>` (`$CLOUDFLARE_API_TOKEN`) -
461-
[Cloudflare API token](https://dash.cloudflare.com/profile/api-tokens)# Authorization
490+
[Cloudflare API token](https://dash.cloudflare.com/profile/api-tokens)
491+
492+
## Authorization
462493

463494
It's possible to secure exposed endpoints by JWT.
464495

@@ -489,6 +520,7 @@ Tokens can be (sorted by priority):
489520
* in query: `curl http://app.example.com/?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJjbGllbnQxIn0.tj2xpg4u-IHzqXtjfpmI8QUFKQIQUrxPdCQY4JSfCWI`
490521

491522

523+
492524
### Generate tokens
493525

494526
Check `git-pipe jwt` command in [usage](#usage).

0 commit comments

Comments
 (0)