From 69233ebbcd2d026a6f5d2c983d9f8a6f97ec4f4a Mon Sep 17 00:00:00 2001 From: Jordan Christiansen Date: Mon, 19 Jun 2017 23:45:39 -0500 Subject: [PATCH] Added a man page * Added a man page * Added build rules to Makefile --- .gitignore | 3 +- Makefile | 7 +++- TODO | 2 +- doc/squirrelbot.txt | 89 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 98 insertions(+), 3 deletions(-) create mode 100644 doc/squirrelbot.txt diff --git a/.gitignore b/.gitignore index a85034b..6dfa227 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ bin/ -/squirrelbot +squirrelbot +*.1 *.swp vendor diff --git a/Makefile b/Makefile index 61f9096..4ff48c9 100644 --- a/Makefile +++ b/Makefile @@ -7,16 +7,21 @@ systemd_unit_path=/etc/systemd/system build: go build -o "$(binname)" ./cmd/squirrelbot +squirrelbot.1: doc/squirrelbot.txt + a2x -f manpage doc/squirrelbot.txt + fmt: gofmt -s -l -w $(shell find . -name '*.go' -not -path '*vendor*') -install: +install: squirrelbot.1 install -m 755 "$(binname)" "$(prefix)/bin/" install -m 644 system/squirrelbot.service "$(systemd_unit_path)/" + install -m 644 doc/squirrelbot.1 "$(prefix)/share/man/" uninstall: rm -f "$(prefix)/bin/$(binname)" rm -f "$(systemd_unit_path)/squirrelbot.service" + rm -f "$(prefix)/share/man/squirrelbot.1" clean: rm squirrelbot diff --git a/TODO b/TODO index 6218f8c..210348d 100644 --- a/TODO +++ b/TODO @@ -16,7 +16,7 @@ SquirrelBot [X] Generate thumbnail files [ ] ~~Generate .nfo files~~ [X] Write a Makefile for packagers -[ ] Write a man page +[X] Write a man page Post-1.0 -------- diff --git a/doc/squirrelbot.txt b/doc/squirrelbot.txt new file mode 100644 index 0000000..3787d29 --- /dev/null +++ b/doc/squirrelbot.txt @@ -0,0 +1,89 @@ +SQUIRRELBOT(1) +============== +:doctype: manpage + +NAME +---- + +squirrelbot - a Telegram bot that stashes links + +SYNOPSIS +-------- + +*squirrelbot* --server-name=VALUE [--port=VALUE] --token=VALUE [--dir=VALUE] + +*squirrelbot* --help | -h + +DESCRIPTION +----------- + +SquirrelBot is a Telegram bot that saves links that you send it for viewing +later. It saves Youtube videos and formats them for easy viewing in Kodi. + +OPTIONS +------- + +*--server-name*= :: + The domain name of the server where this bot can be reached. + +*--token*= :: + The authentication token for the Telegram API. You can find directions for + obtaining your token at . + +*--port*= :: ++ +-- +The port to run the server on. *Default*: 1327 + +I use a reverse proxy to forward traffic from port 443 to SquirrelBot's +default port. You can also set up SquirrelBot directly on port 80 or 443. +Just make sure to use the appropriate port for your url scheme: + +* Port 80 for http:// +* Port 443 for https:// +-- + +*--dir, -d*= :: + The directory to store downloaded files. + +*--version, -v* :: + Show the version and exit. + +*--help, -h* :: + Show the help message and exit. + +TRANSFERING VIDEO FILES +----------------------- + +SquirrelBot downloads videos to a local directory that can be specified with the +`--dir` option. The videos are formatted to be easy to view in Kodi. If you run +this bot on a different server than your Kodi/media center, you will want to +transfer your video files to your Kodi or media center box. Here are a couple +ways to do that. + +.Sync with rsync + +* On the receiving end, set up an rsync daemon that allows write-only access + to the right directory. +* On the sending end, write a simple script that uses `inotifywait` to copy + files via rsync. +* Optionally, after the file is successfully send, the script should delete + the file from the server. + +.Sync with Syncthing + +You can use Syncthing to send video files to their final destination. See +https://docs.syncthing.net/intro/getting-started.html for instructions. + +COPYRIGHT +--------- + +Copyright © 2017 Jordan Christiansen. License GPLv3+: GNU GPL version 3 or later +. This is free software: you are free to +change and redistribute it. There is NO WARRANTY, to the extent permitted by +law. + +SEE ALSO +-------- + +youtube-dl(1)