~blowry/sourcehut-vanity

931a7a729fc006025f0d97ed1ffb2d25258f671b — Benjamin Lowry 3 years ago 7a90dea
Add systemd service file and revise readme
2 files changed, 20 insertions(+), 1 deletions(-)

M README.md
A sourcehut-vanity.service
M README.md => README.md +7 -1
@@ 12,4 12,10 @@ sudo make install
```
$ sourcehut-vanity blowry 0.0.0.0:8080
```
Replace my username with yours, and enter an alternative address to bind to if desired.
Replace my username with yours, and enter an alternative address to bind to if desired. Redirects will be served like this:
```
localhost:8080/sourcehut-vanity redirects to https://git.sr.ht/~blowry/sourchut-vanity
localhost:8080/sourcehut-vanity/README.md redirects to https://git.sr.ht/~blowry/sourcehut-vanity/tree/master/README.md
localhost:8080/sourcehut-vanity?go-get=1 returns an HTML page with meta tags so go get can find the correct repository
```
There's no HTTPS support, so I'd recommend putting this in front of a reverse proxy like nginx. A sample systemd service file is included in the repository as well.

A sourcehut-vanity.service => sourcehut-vanity.service +13 -0
@@ 0,0 1,13 @@
[Unit]
Description=Sourcehut vanity URL redirector
After=network.target

[Service]
Type=simple
Restart=always
RestartSec=1
User=www-data
ExecStart=/usr/bin/sourcehut-vanity blowry

[Install]
WantedBy=multi-user.target