mirror of https://git.envs.net/envs/burrow.git
Compare commits
137 Commits
Author | SHA1 | Date |
---|---|---|
~creme | 53c02830c0 | |
James Tomasino | 459de8117e | |
creme | 6a8bbc71de | |
James Tomasino | b83e5056f1 | |
Zachary Lee Andrews | 91d6113fe3 | |
Sven | 2556d9eb40 | |
James Tomasino | 33c1aa0437 | |
creme | af7d8a31c2 | |
creme | 2b99bf98e3 | |
James Tomasino | 8658c7675c | |
creme | 404cd61586 | |
James Tomasino | 478f40ce24 | |
creme | b80a1c6789 | |
creme | 4b3d7364f9 | |
James Tomasino | 8e900ca005 | |
James Tomasino | e6442c9d6f | |
James Tomasino | 4c011fc82e | |
David Harrison | b9a2650819 | |
Munchotaur | d3289ebc94 | |
Munchotaur | 4a01b598fb | |
James Tomasino | 05021a7699 | |
James Tomasino | d83843fba6 | |
fosslinux | e671238848 | |
James Tomasino | 0b915075e5 | |
James Tomasino | f31b5ae218 | |
James Tomasino | cf9e56cc3c | |
James Tomasino | e71e2ae579 | |
James Tomasino | 84cc1efcd5 | |
James Tomasino | 045e7b8f72 | |
James Tomasino | 7782fd066d | |
James Tomasino | 39bd2c500a | |
James Tomasino | 08d172b3f9 | |
James Tomasino | 22387cc6fe | |
James Tomasino | 9f4a61b4f9 | |
James Tomasino | b646c085c1 | |
James Tomasino | 982eb95372 | |
James Tomasino | 9b6f3daeb1 | |
James Tomasino | 1c66e9297d | |
Jelle Besseling | c2eea80929 | |
James Tomasino | b6e2d6efa6 | |
James Tomasino | 95c008c31a | |
James Tomasino | 4cd0a9f498 | |
Samuel Tyler | 52ace7f214 | |
Samuel Tyler | 21688e4fd9 | |
James Tomasino | 49110809c1 | |
James Tomasino | 7158d5eae9 | |
James Tomasino | dd3a7d08d1 | |
James Tomasino | 2518e999af | |
James Tomasino | b715b663ff | |
Stephen Tudor | 516f835ad3 | |
Stephen Tudor | a8ec4d6c57 | |
Paco Esteban | d890a6ef53 | |
James Tomasino | 29253bc254 | |
James Tomasino | 7cd512a082 | |
James Tomasino | fc49cbeb90 | |
James Tomasino | d9a4f0169e | |
James Tomasino | 2cfeda0340 | |
James Tomasino | 3fed90daef | |
James Tomasino | 487574e053 | |
James Tomasino | f0f21df913 | |
Jelle Besseling | 986f3df957 | |
James Tomasino | 6dce0f1924 | |
James Tomasino | d37369df53 | |
James Tomasino | e3f15046b2 | |
James Tomasino | e81fa7d8bd | |
James Tomasino | 9b9377e401 | |
James Tomasino | 3e3bf3a552 | |
James Tomasino | 9b2e0221ca | |
James Tomasino | cbe6256862 | |
James Tomasino | e8c105a51c | |
James Tomasino | 23c2a9909f | |
James Tomasino | d2543cccab | |
James Tomasino | 28e1831369 | |
James Tomasino | 5366ac016b | |
James Tomasino | 93e1c41e9c | |
James Tomasino | 42892d8cfb | |
James Tomasino | 4d08e72352 | |
James Tomasino | 2acf982073 | |
James Tomasino | 6d29f54f93 | |
James Tomasino | 57eb27f8ad | |
James Tomasino | 2bc0894201 | |
James Tomasino | de865b1e5a | |
James Tomasino | 43f504e101 | |
James Tomasino | 2a693f66e5 | |
James Tomasino | 09b031157f | |
James Tomasino | c263bf8903 | |
James Tomasino | 34b61e9e3a | |
James Tomasino | 3d22e5d275 | |
James Tomasino | bc050454ff | |
James Tomasino | d79080ac1e | |
James Tomasino | 694e490353 | |
James Tomasino | 87ffadc19a | |
James Tomasino | 359dea788b | |
James Tomasino | b880efa992 | |
James Tomasino | 56f5c3f3f6 | |
James Tomasino | 7121dd0f29 | |
James Tomasino | 4535f8f571 | |
James Tomasino | fb193ff7b5 | |
James Tomasino | 4abc2496aa | |
James Tomasino | 3487b590ca | |
James Tomasino | 00707c3046 | |
James Tomasino | a7dc326a62 | |
James Tomasino | 488e27ea03 | |
James Tomasino | 445f6a30a9 | |
James Tomasino | e981106dcc | |
James Tomasino | 170817a1eb | |
James Tomasino | f49be1126e | |
James Tomasino | 43e903bbb6 | |
James Tomasino | 11d6b80757 | |
James Tomasino | 6c67e8f7fa | |
James Tomasino | 33ec590cfb | |
James Tomasino | 48f0f0ca0c | |
James Tomasino | 6f5bedded3 | |
James Tomasino | 3d5319afb0 | |
James Tomasino | 31bc38669f | |
James Tomasino | 416f8707b1 | |
James Tomasino | 6b683df3be | |
James Tomasino | 2403bedda8 | |
James Tomasino | b6ea90a866 | |
James Tomasino | ea10ed8356 | |
James Tomasino | 0ea68ff866 | |
James Tomasino | 496adcbf85 | |
James Tomasino | e0c264f6ce | |
James Tomasino | 7366097bf0 | |
James Tomasino | 95c1a61274 | |
James Tomasino | 2971b8a998 | |
James Tomasino | 6a00579db2 | |
James Tomasino | 39372f1d0c | |
James Tomasino | f41090af3e | |
James Tomasino | 09472ab21a | |
James Tomasino | 6ba34bf60f | |
James Tomasino | 78f3d4334d | |
James Tomasino | 6b7bc00308 | |
James Tomasino | b994822eac | |
James Tomasino | b2237e440f | |
James Tomasino | 085d5b43bc | |
James Tomasino | 4c60852713 |
|
@ -0,0 +1,26 @@
|
|||
---
|
||||
kind: pipeline
|
||||
type: ssh
|
||||
name: deploy
|
||||
|
||||
server:
|
||||
host:
|
||||
from_secret: host
|
||||
user:
|
||||
from_secret: username
|
||||
ssh_key:
|
||||
from_secret: ssh_key
|
||||
|
||||
clone:
|
||||
disable: true
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
|
||||
steps:
|
||||
- name: deploy
|
||||
commands:
|
||||
- cd /opt/services/burrow
|
||||
- sudo -Hu services git pull origin master
|
||||
- sudo -Hu root make
|
|
@ -0,0 +1,3 @@
|
|||
language: shell
|
||||
script:
|
||||
- bash -c 'shopt -s globstar && shellcheck burrow'
|
21
Makefile
21
Makefile
|
@ -1,6 +1,6 @@
|
|||
PREFIX ?= /usr/local
|
||||
BINDIR ?= $(PREFIX)/bin
|
||||
MANDIR ?= $(PREFIX)/share/man
|
||||
MANDIR ?= $(PREFIX)/share/man/man1
|
||||
|
||||
# Attempt to find bash completion dir in order of preference
|
||||
ifneq ($(wildcard /etc/bash_completion.d/.),)
|
||||
|
@ -9,29 +9,27 @@ endif
|
|||
|
||||
HAS_BREW := $(shell command -v brew 2> /dev/null)
|
||||
ifdef HAS_BREW
|
||||
ifneq ($(wildcard $$(brew --prefix)/etc/bash_completion.d/),)
|
||||
CPLDIR ?= $$(brew --prefix)/etc/bash_completion.d
|
||||
endif
|
||||
endif
|
||||
|
||||
HAS_PKGCONFIG := $(shell command -v pkg-config 2> /dev/null)
|
||||
ifdef HAS_PKGCONFIG
|
||||
CPLDIR ?= $$(pkg-config --variable=completionsdir bash-completion)
|
||||
CPLDIR ?= $(shell pkg-config --variable=completionsdir bash-completion 2> /dev/null)
|
||||
endif
|
||||
|
||||
install:
|
||||
@echo Installing the executable to $(BINDIR)
|
||||
@mkdir -p $(BINDIR)
|
||||
@cp -f burrow $(BINDIR)/burrow
|
||||
@chmod 755 $(BINDIR)/burrow
|
||||
@install -m 755 burrow $(BINDIR)
|
||||
@echo Installing the manual page to $(MANDIR)/man1
|
||||
@mkdir -p $(MANDIR)
|
||||
@cp -f burrow.1 $(MANDIR)/man1/burrow.1
|
||||
@chmod 644 $(MANDIR)/man1/burrow.1
|
||||
@install -m 644 burrow.1 $(MANDIR)
|
||||
ifdef CPLDIR
|
||||
ifneq ($(CPLDIR),)
|
||||
@echo Installing the command completion to $(CPLDIR)
|
||||
@cp -f burrow.d $(CPLDIR)/burrow
|
||||
@chmod 644 $(CPLDIR)/burrow
|
||||
@mkdir -p $(CPLDIR)
|
||||
@install -m 644 burrow.d $(CPLDIR)/burrow
|
||||
endif
|
||||
endif
|
||||
|
||||
uninstall:
|
||||
|
@ -40,9 +38,10 @@ uninstall:
|
|||
@echo Removing the manual page from $(MANDIR)/man1
|
||||
@rm -f $(BINDIR)/man1/burrow.1
|
||||
ifdef CPLDIR
|
||||
@echo Installing the command completion to $(CPLDIR)
|
||||
ifneq ($(CPLDIR),)
|
||||
@echo Removing the command completion from $(CPLDIR)
|
||||
@rm -f $(CPLDIR)/burrow
|
||||
endif
|
||||
endif
|
||||
|
||||
.PHONY: install uninstall
|
||||
|
|
100
README.md
100
README.md
|
@ -1,54 +1,60 @@
|
|||
# burrow ![status](https://img.shields.io/badge/status-working-green.svg?style=flat-square) ![license](https://img.shields.io/badge/license-GPL3-blue.svg?style=flat-square) ![bash](https://img.shields.io/badge/Bash-4%2B-lightgrey.svg?style=flat-square)
|
||||
# burrow ![status](https://travis-ci.com/jamestomasino/burrow.svg?branch=master) ![license](https://img.shields.io/badge/license-GPL3-blue.svg?style=flat-square)
|
||||
|
||||
**burrow** is a helper for building and managing a gopher hole.
|
||||
|
||||
## Installation
|
||||
|
||||
### Requirements
|
||||
* bash 4+ (OSX: `brew install bash`)
|
||||
* GNU sed (OSX: `brew install gnu-sed --with-default-names`)
|
||||
* GNU getopt (OSX: `brew install gnu-getopt --with-default-names`)
|
||||
|
||||
### Install
|
||||
|
||||
`sudo make install`
|
||||
|
||||
_Note: On systems without admin access the binary can be run directly from the
|
||||
git repo, but will lack `man` support and command completion._
|
||||
|
||||
See the [Getting Started](https://github.com/jamestomasino/burrow/wiki/Getting-Started) guide.
|
||||
|
||||
### Install on Linux / MacOS
|
||||
|
||||
`sudo make install`
|
||||
|
||||
### Install on BSD systems
|
||||
|
||||
#### FreeBSD
|
||||
|
||||
- Installing bash-completion via either `pkg install bash-completion` or via the `shells/bash-completion` port.
|
||||
- Installing the GNU version of make via either `pkg install gmake` or the `port devel/gmake`.
|
||||
- Rather than using `sudo make install`, run `sudo gmake install`.
|
||||
|
||||
#### OpenBSD
|
||||
|
||||
- Install the GNU version of make via either `pkg_add gmake` or the port `devel/gmake`.
|
||||
- There is no bash-completion package or port in OpenBSD. However the source code can be found at https://github.com/scop/bash-completion
|
||||
- Burrow appears to install and run without the presence of bash-completion. Exercise caution.
|
||||
- As root (or via `doas`), run `gmake install`.
|
||||
|
||||
|
||||
### Uninstall
|
||||
|
||||
`sudo make uninstall`
|
||||
`sudo make uninstall` # or gmake uninstall on BSD
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
burrow phlog # create new phlog post
|
||||
burrow recipe # add or update a recipe to box
|
||||
burrow topic # add or update a topic file
|
||||
burrow create-config # generate a default config file
|
||||
burrow gophermap # edit a gophermap
|
||||
burrow rss # generate a RSS feed of phlog entries
|
||||
burrow edit-config # open your config file for editing
|
||||
burrow update-git # pull latest git repo for gopher dir, if exists
|
||||
```
|
||||
|
||||
- `create-config` will auto-generate a configuration file at
|
||||
`$HOME/.config/burrow/config`. It will be populated by the default parameters
|
||||
listed below and provide an easy way to customize your configuration. At a
|
||||
minimum you should update your `config_dir_gopher` to point to the folder on
|
||||
your local computer where your gopher hole resides.
|
||||
- `edit-config` will open your burrow configuration file for easy editing.
|
||||
|
||||
- `phlog` will prompt for the title of a new post, then open it in your default
|
||||
`$EDITOR`. By default it will provide you a template, but you can override this
|
||||
by including a `.template` file in your phlog directory.
|
||||
`$EDITOR`.
|
||||
|
||||
- `recipe` will prompt for the name of your recipe, then open it in your default
|
||||
`$EDITOR`. By default it will provide you a template, but you can override this
|
||||
by including a `.template` file in your recipe box directory.
|
||||
- `gophermap` will open a gophermap file for editing. This will
|
||||
remove any `type i` formatting and allow comments to be added in natural text.
|
||||
You will still need to create links in the proper gophermap formatting.
|
||||
|
||||
- `topic` will prompt for the name of the topic, then open it in your default
|
||||
`$EDITOR`. By default it will provide you a template, but you can override this
|
||||
by including a `.template` file in your topics directory.
|
||||
- `rss` will automatically generate an RSS feed of your most recent phlog
|
||||
entries and output it to the root of your gopher directory. This can be
|
||||
automatically generated by using the config option `config_phlog_autorss`.
|
||||
|
||||
- `update-git` will silently attempt to update a git repository at the location
|
||||
of your gopher hole. It is appropriate for use by a cron job.
|
||||
|
@ -59,9 +65,11 @@ _`man burrow` or `burrow -h` for more information._
|
|||
|
||||
The following locations are available for configuration:
|
||||
|
||||
1) `$HOME/.config/burrow/config`
|
||||
2) `$HOME/.config/burrow`
|
||||
3) `$HOME/.burrow`
|
||||
1) `/etc/burrow/config`
|
||||
2) `$XDG_CONFIG_HOME`
|
||||
3) `$HOME/.config/burrow/config`
|
||||
4) `$HOME/.config/burrow`
|
||||
5) `$HOME/.burrow`
|
||||
|
||||
These files are processed in the order listed. Variables defined in multiple
|
||||
locations will use the last assigned value.
|
||||
|
@ -78,25 +86,33 @@ config_dir_phlog="phlog" # relative path to phlog
|
|||
config_phlog_gophermap=true # phlogs use gophermap format by default
|
||||
config_phlog_usedate=true # use a date-stamp on phlog posts
|
||||
|
||||
config_dir_recipebox="recipebox" # relative path to recipe box
|
||||
config_recipebox_gophermap=false # recipes use plain text by default
|
||||
config_recipebox_usedate=false # do not use a date-stamp on recipe filenames
|
||||
|
||||
config_dir_topics="topics" # relative path to topics directory
|
||||
config_topics_gophermap=true # topic notes use gophermap format by default
|
||||
config_topics_usedate=false # do not use a date-stamp on topic filenames
|
||||
|
||||
config_git_commit=false # automatically commit changes if git repo
|
||||
config_git_push=false # automatically push changes if git repo
|
||||
|
||||
config_autofold=false # automatically break lines at specific width
|
||||
config_foldwidth=66 # width of line used for autofold
|
||||
config_autoindent=true # automatically reformat gophermaps with leading spaces
|
||||
# and parse links at the end of file
|
||||
config_autoindent=true # automatically reformat gophermaps with leading "i"
|
||||
# types and parse links at the end of file
|
||||
|
||||
config_file_rss="rss.xml" # filename of RSS feed
|
||||
config_gopher_name="My Gopher Hole" # used in RSS feed output
|
||||
config_gopher_desc="Description" # used in RSS feed output
|
||||
config_rss_num_entries="10" # number of entries to inclued in RSS feed
|
||||
config_phlog_autorss=false # automatically generate RSS feed
|
||||
|
||||
```
|
||||
|
||||
_Note: This file is a valid Bash script and will be sourced upon load._
|
||||
|
||||
## Disambiguity
|
||||
|
||||
There is [another burrow project](https://github.com/sloumdrone/burrow) created
|
||||
by _sloumdrone_. His burrow project is a GUI gopher client. Please check it out!
|
||||
|
||||
There is also another project called "Burrow the Burrows" which can be found on gopher at: `gopher://kalos.mine.nu/1/burrow/index.gph`. It aims to construct and maintain a graph of the whole Gopherspace.
|
||||
|
||||
There is another [static site generator for gopher](https://github.com/hyperrealgopher/burrow) written in Haskell by @hyperrealgopher. It has similar features to my burrow.
|
||||
|
||||
_Armen_ now has a [gemini & spartan server](https://gitlab.com/armen138/burrow) named burrow.
|
||||
|
||||
## Contributing
|
||||
Pull requests are welcome. For major changes, please open an issue first to
|
||||
discuss what you would like to change.
|
||||
|
|
51
burrow.1
51
burrow.1
|
@ -1,4 +1,4 @@
|
|||
.TH BURROW 1 "03 Mar 2018" "version 1.2.0"
|
||||
.TH BURROW 1 "06 Mar 2020" "version 1.7.9"
|
||||
.SH NAME
|
||||
burrow \- a helper for building and managing a gopher hole
|
||||
.SH SYNOPSIS
|
||||
|
@ -9,43 +9,54 @@ modification, and maintenance of a gopher hole.
|
|||
.SH COMMANDS
|
||||
.TP
|
||||
.B phlog
|
||||
Create a new phlog entry.
|
||||
Prompt for the title of a new post, then open it in your default
|
||||
$EDITOR.
|
||||
.TP
|
||||
.B recipe
|
||||
Add or update a recipe to the recipe box.
|
||||
.B topic
|
||||
Add or update a topic in your topics directory.
|
||||
.B gophermap
|
||||
Open a gophermap file relative to your gopher directory for editing,
|
||||
automatically stripping some special characters for easier editing of info
|
||||
lines.
|
||||
.TP
|
||||
.B create-config
|
||||
Generates a default configuration file at
|
||||
.I ~/.config/burrow/config
|
||||
if no other configuration file exists. It is populated with the default
|
||||
settings.
|
||||
.B rss
|
||||
Automatically generate an RSS feed of your most recent phlog
|
||||
entries and output it to the root of your gopher directory. This can be
|
||||
automatically generated by using the config option config_phlog_autorss.
|
||||
.TP
|
||||
.B quickstart
|
||||
Creates a new configuration file from interactive user prompts.
|
||||
.TP
|
||||
.B edit-config
|
||||
Opens your burrow configuration file for editing if it exists.
|
||||
.TP
|
||||
.B update-git
|
||||
If the gopher directory resides within a git repository, this action will do a
|
||||
silent
|
||||
Silently attempt to update a git repository at the location
|
||||
of your gopher hole. It is appropriate for use by a cron job.
|
||||
.TP
|
||||
.B git-pull
|
||||
which is useful for crons.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B -v, --version
|
||||
.B -v
|
||||
Display current version information.
|
||||
.TP
|
||||
.B -d, --debug
|
||||
.B -d
|
||||
Debug mode.
|
||||
.TP
|
||||
.B -h, --help
|
||||
.TP
|
||||
.B -h
|
||||
Show the help.
|
||||
.SH FILES
|
||||
.I $XDG_CONFIG_HOME
|
||||
,
|
||||
.I ~/.config/burrow/config
|
||||
,
|
||||
,
|
||||
.I ~/.config/burrow
|
||||
,
|
||||
,
|
||||
.I ~/.burrow
|
||||
,
|
||||
.I /etc/burrow/config
|
||||
: configuration settings for burrow. If none of these are available, the default
|
||||
configuration is loaded.
|
||||
.SH BUGS
|
||||
None known.
|
||||
.SH AUTHOR
|
||||
James Tomasino <tomasino (at) sdf (dot) org>
|
||||
James Tomasino <tomasino (at) lavabit (dot) com>
|
||||
|
|
46
burrow.d
46
burrow.d
|
@ -1,22 +1,46 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
_burrow()
|
||||
{
|
||||
# Get basic autocomplete commands from the function itself
|
||||
local helplist
|
||||
helplist=$(burrow shortlist)
|
||||
|
||||
# Combine all the lists for autocomplete
|
||||
_burrow() {
|
||||
local cur
|
||||
cur=${COMP_WORDS[COMP_CWORD]}
|
||||
COMPREPLY=( $( compgen -W "$helplist" -- "$cur" ) )
|
||||
if [ "${COMP_WORDS[1]}" == "gophermap" ]; then
|
||||
local gopher_dir
|
||||
local gophermaps
|
||||
local directories
|
||||
gopher_dir=$(burrow gopherdir)
|
||||
search_dir=${gopher_dir}
|
||||
if [ -n "${COMP_WORDS[2]}" ]; then
|
||||
partial_search_dir="${gopher_dir}${COMP_WORDS[2]}"
|
||||
if [ -d "$partial_search_dir" ]; then
|
||||
search_dir="$partial_search_dir"
|
||||
else
|
||||
partial_search_dir=$(dirname "$partial_search_dir")
|
||||
if [ -d "$partial_search_dir" ]; then
|
||||
search_dir="$partial_search_dir"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
gophermaps=$(find "$search_dir" -mindepth 1 -maxdepth 1 -type f -name "gophermap" -print | sed "s|$gopher_dir||" | sed "s|gophermap$||" )
|
||||
directories=$(find "$search_dir" -mindepth 1 -maxdepth 1 -type d -print | sed "s|$gopher_dir||" )
|
||||
local suggestions=( $( compgen -W "$gophermaps $directories" -- "$cur" ) )
|
||||
if [ "${#suggestions[@]}" == "1" ]; then
|
||||
local resp=$(echo ${suggestions[0]/%\ */})
|
||||
COMPREPLY=("$resp")
|
||||
else
|
||||
COMPREPLY=("${suggestions[@]}")
|
||||
fi
|
||||
else
|
||||
local helplist
|
||||
helplist=$(burrow shortlist)
|
||||
COMPREPLY=( $( compgen -W "$helplist" -- "$cur" ) )
|
||||
fi
|
||||
}
|
||||
|
||||
# Detect if current shell is ZSH, and if so, load this file in bash
|
||||
# compatibility mode.
|
||||
if [ -n "$ZSH_VERSION" ]; then
|
||||
autoload bashcompinit
|
||||
bashcompinit
|
||||
autoload bashcompinit
|
||||
bashcompinit
|
||||
fi
|
||||
|
||||
complete -o default -o nospace -F _burrow burrow
|
||||
|
@ -25,5 +49,5 @@ complete -o default -o nospace -F _burrow burrow
|
|||
# when the user has tab-completed the executable name and consequently
|
||||
# included the '.exe' suffix.
|
||||
if [ Cygwin = "$(uname -o 2>/dev/null)" ]; then
|
||||
complete -o default -o nospace -F _burrow burrow.exe
|
||||
complete -o default -o nospace -F _burrow burrow.exe
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue