~gsthnz/satellite

708d5148caf7093a12896cde572e8cd3dd5ffc38 — Gustavo Heinz 3 years ago 2373fdf
Add man pages
5 files changed, 100 insertions(+), 4 deletions(-)

M .gitignore
M Makefile
M README.md
A doc/satellite.1.scd
A doc/satellite.toml.5.scd
M .gitignore => .gitignore +2 -0
@@ 1,2 1,4 @@
satellite
satellite.toml
*.1
*.5

M Makefile => Makefile +24 -4
@@ 1,3 1,7 @@
.POSIX:
.SUFFIXES:
.SUFFIXES: .1 .5 .1.scd .5.scd

GO?=go

GOSRC!=find . -name '*.go'


@@ 8,7 12,7 @@ BINDIR?=$(PREFIX)/bin
SHAREDIR?=$(PREFIX)/share/satellite
MANDIR?=$(PREFIX)/share/man

all: satellite satellite.toml
all: satellite satellite.toml doc

satellite: $(GOSRC)
	$(GO) build -o $@


@@ 16,18 20,34 @@ satellite: $(GOSRC)
satellite.toml: config/satellite.toml.in
	sed -e 's:@SHAREDIR@:$(SHAREDIR):g' > $@ < config/satellite.toml.in

DOCS := \
	doc/satellite.1 \
	doc/satellite.toml.5

.1.scd.1:
	scdoc < $< > $@

.5.scd.5:
	scdoc < $< > $@

doc: $(DOCS)

install: all
	mkdir -m755 -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1 $(DESTDIR)$(MANDIR)/man5 $(DESTDIR)$(MANDIR)/man7 \
	mkdir -m755 -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1 $(DESTDIR)$(MANDIR)/man5 \
		$(DESTDIR)$(SHAREDIR)
	install -m755 satellite $(DESTDIR)$(BINDIR)/satellite
	install -m644 satellite.toml $(DESTDIR)$(SHAREDIR)/satellite.toml
	install -m644 doc/satellite.1 $(DESTDIR)$(MANDIR)/man1/satellite.1
	install -m644 doc/satellite.toml.5 $(DESTDIR)$(MANDIR)/man5/satellite.toml.5

uninstall: all
	rm -r $(DESTDIR)$(BINDIR)/satellite
	rm -fr $(DESTDIR)$(SHAREDIR)
	rm -fr $(DESTDIR)$(MANDIR)/man1/satellite.1
	rm -fr $(DESTDIR)$(MANDIR)/man5/satellite.5.toml

clean:
	rm -rf satellite satellite.toml
	rm -rf $(DOCS) satellite satellite.toml

.PHONY:
	satellite satellite.toml clean
	all doc satellite satellite.toml clean

M README.md => README.md +4 -0
@@ 7,6 7,8 @@ Satellite is a small Gemini server for serving static files.
satellite
```

See satellite(1)

## Configuration
By default, Satellite uses `/etc/satellite.toml`, but a custom config file can
be supplied with the `-c` flag.


@@ 33,6 35,8 @@ root = "/srv/gemini/example2.com"
The SSL certificate generation will be managed by Satellite and will be
automatically regenerated on the certificate expiry date.

More information on satellite.toml(5)

## Installation

It depends on OpenSSL and Go to be installed. Consult your OS system package

A doc/satellite.1.scd => doc/satellite.1.scd +22 -0
@@ 0,0 1,22 @@
satellite(1)

# NAME

satellite - serve files over the gemini protocol

# SYNOPSIS

*satellite* [-c _config-file_]

# DESCRIPTION

Satellite is a gemini server. It requires a config file which by *default* will
be read from */etc/satellite.toml* unless the user provides a -c flag.

# OPTIONS

*-c* _path_
	Alternate path to read the config file.

# SEE ALSO
*satellite.toml*(5)

A doc/satellite.toml.5.scd => doc/satellite.toml.5.scd +48 -0
@@ 0,0 1,48 @@
satellite.toml(5)

# NAME

*satellite.toml* - configuration file for *satellite*(1)

# EXAMPLE CONFIGURATION
```
# Address to listen to requests (default: 0.0.0.0:1965)
listen = "0.0.0.0"

[tls]
# Directory to save certificates
directory = "/var/lib/gemini/certs"

# Multiple domains can be set with the [[domain]] section
[[domain]]
name = "example.com"
root = "/srv/gemini/example.com"

[[domain]]
name = "example2.com"
root = "/srv/gemini/example2.com"
```

# ANONYMOUS KEYS

*listen*
	Address to listen to requests, if unspecified, it defaults to 0.0.0.0:1965

# TLS KEYS

*directory*
	Directory to save certificates. This should be a persistent directory
	writeable by the daemon. No user interaction is required, the daemon will
	automatically create and regenerate certificates.

# DOMAIN KEYS

Domain sections must be set using the double bracket *[[domain]]* format.

*name*
	Name of the domain. Will be used as a virtual host and also be used for
	certificate generation.

*root*
	Path on disk to serve files for this domain. The path of the URL will be
	appended to this value to form the full filepath of the files to serve.