Richard Halford
Posted on August 12, 2021
Table of Contents
About
GoDo aims to help you get organised with your tasks. Designed to be simple and accessible.
Usage:
godo [command]
Available Commands:
add add a new todo
done toggle todo as done
edit edit a todo
find search for a given string
help help about any command
list list your todos
priority label a todo as a priority
remove remove a todo
version print godo's version
Flags:
--datafile string data file to store todos
-h, --help help for godo
Use "godo [command] --help" for more information about a command.
Go get things done and checked off the list.
Getting Started
Requirements
The best way to ensure GoDo will work on your machine, is to compile it yourself.
- Go (to compile applications)
To do this, all you need is to have Go - the programming language - installed on your computer.
Installation
To install GoDo, all you have to do is run the go get
command.
$ go get -u github.com/rsHalford/godo
Recommendations
If you want to have your GoDo list available online, and accessible to other computers. There is GoAPI. A REST API which can handle the JSON created by GoDo.
To edit the necessary variables to hook up GoAPI with a database. You will need to clone the GoAPI repository.
$ git clone github.com/rsHalford/goapi
Then after making the necessary changes to the source code. Build the GoAPI binary, for the operating server it will be ran on.
$ env GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build github.com/rsHalford/goapi
This example command will build GoAPI to be executable on Debian 10.
Then you would need to have a web server installed and a way to run GoAPI as a daemon.
- Apache2 (ProxyPass to your web address)
- Systemd (daemonize GoAPI to run in the background)
These recommendations are based on what I found to work best for my setup.
Configuration
The config.yaml
can be edited to set-up a connection to GoAPI. As well as, select your preferred text editor.
This file will read from
${XDG_CONFIG_HOME:-$HOME/.config}/godo/config.yaml
.
username: "admin"
password: "secret"
api: "https://example.com/api/v1/todo"
editor: "vim"
If you prefer to use a local JSON file to store your todo list, leave the api address blank - ""
.
By default, GoDo will use whatever text editor you have set as your system's default - $EDITOR
.
GoAPI
GoAPI was built to support the GoDo application, in providing a RESTful API.
To setup the server application, there a three changes that need to be made.
Authentication
To secure your todo list online, you will need to change the api_username
and api_password
variables, required to access the API endpoints. These variables are found in the config.yaml
file.
These values will be what you send to the API with each request, using Basic Authentication.
An example of the config.yaml
can be found in the project's repository
api_username: "username"
api_password: "password"
Currently GoAPI only supports PostgreSQL. To link up the server to a database, make sure to edit the config.yaml
. Providing the db_username
, db_password
, name
and port
- relating to your database address.
db_username: "username"
db_password: "password"
name: "goapi"
port: "5432"
Server
GoAPI by default serves on port :8080
. As an example, below is a basic Apache configuration file to relay GoAPI to your domain.
Apache Configuration Example:
<VirtualHost *:80>
ServerName goapi.example.com
ServerAdmin webmaster@example.com
ProxyRequests Off
<Proxy *>
Require all granted
</Proxy>
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http:127.0.0.1:8080/
ErrorLog ${APACHE_LOG_DIR}/goapi-error.log
CustomLog ${APACHE_LOG_DIR}/goapi-access.log combined
</VirtualHost>
Daemonize
To have GoAPI run at all times in the background. You will need to make it run as a daemon. This is possible by creating one as a service with your init system - such as with systemd.
Systemd Service Example:
[Unit]
Description=GoAPI RESTful API
[Service]
ExecStart=/path/to/goapi/excutable
WorkingDirectory=/path/to/goapi
StandardOutput=journal
StandardError=inherit
SyslogIdentifier=goapi
User=user
Group=group
Type=simple
Restart=on-failure
[Install]
WantedBy=multi-user.target
Licence
GoDo and GoAPI are both released under the GNU General Public License v3.0.
Posted on August 12, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
November 5, 2024
November 23, 2024