• Stars
    star
    119
  • Rank 297,930 (Top 6 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 5 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

exitus is a very simple issue tracking API

exitus

exitus is a very simple issue tracking API, it was built to illustrate a backend microservice written in Go which serves data from a PostgreSQL database.

The name is derived from the origin of the word "issue".

Middle English (in the sense โ€˜outflowingโ€™): from Old French, based on Latin exitus, past participle of exire โ€˜go outโ€™.

One thing to note is I am using some of the patterns from https://github.com/sourcegraph/sourcegraph to power this service, so big shout out to a great product and project.

Goals

The goal of the project is to cover a few key pillars:

  1. Perform the core function of providing a REST service for data stored in a PostgreSQL database.
  2. Be observable, through the delivery of metrics, structured logs and open tracing data to a monitoring system.
  3. Be operations friendly, configuration via env variables, and simple deployment model using docker or binary.
  4. Illustrate good test coverage across the entire service, both unit and integration.
  5. Be secure, provide standard robust authentication, authorisation and auditing facilities.

Overview

Authentication

Authentication for this service is provided by an external OpenID provider such as AWS Cognito or Keycloak. Clients authenticate with one of these services and then provide their JWT token, which is validated by the exitus service using go-oidc developed by CoreOS.

Infrastructure

The exitus service uses AWS ECS to schedule the service, and AWS RDS to host the PostgreSQL database. This is deployed using the recently released AWS Cloud Development Kit, the code is here.

Secrets

With the help of CDK the RDS credentials are available from AWS secrets manager using Specifying Sensitive Data feature of ECS. This is neatly wrapped by CDK, and the JSON value containing host, port, database, username and password is unmarshalled by my service. This eleminates display of these values in the ECS console environment variables section.

Development

To run the tests, and run locally you will need two environment variables, being:

# Used to connect to AWS for deployments and monitoring
export AWS_PROFILE=whatever
export AWS_REGION=ap-southeast-2

# Nice random passwords go here to seed the passwords used by docker compose because security
export POSTGRES_PASSWORD=xxx
export POSTGRES_ROOT_PASSWORD=xxx

# Used for development locally
export OAUTH_CLIENT_ID=xxx
export OAUTH_CLIENT_SECRET=xxx
export OPENID_PROVIDER_URL=https://cognito-idp.ap-southeast-2.amazonaws.com/ap-southeast-2_XXXXXXXXXS

# Used by CDK for deployment
export STAGE=dev
export BRANCH=master
export DOMAIN_NAME=whatever.cloud.
export HOSTED_ZONE_ID=XXXXXXXXXXXXX
export ACM_CERTIFICATE_ARN=arn:aws:acm:ap-southeast-2:123456789012:certificate/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

These vars are used in docker compose when configuring the PostgreSQL database.

Note: I recommend using direnv to load environment variables when you navigate into the project, there is an .envrc.example which can be renamed to .envrc to set these values.

Once these variables are configured run:

make docker-compose-test

Dependencies

References

License

This code is Copyright Mark Wolfe and licensed under Apache License 2.0

More Repositories

1

hotwire-golang-website

This project provides some working examples using Go and Hotwire Turbo.
Go
201
star
2

cognito-vue-bootstrap

This application illustrates how to use the Amazon Amplify with vue.js.
Vue
181
star
3

esp32-hid-joystick

C
91
star
4

golang-massl

Simple examples of configuring mutual authentication (MASSL)
Go
52
star
5

ofuda

HMAC Authentication Module for NodeJS.
JavaScript
39
star
6

rake-bamboo-plugin

Plugin for bamboo which enables building of ruby projects using rake
Java
34
star
7

go-bootstrap

Go
32
star
8

humanhash

humanhash - make a hash more human.
Go
31
star
9

website-openid-proxy

This service provides authenticated access to a static website hosted in an s3 bucket.
Go
30
star
10

esp32-blufi

This component provides bluetooth onboarding for the ESP32 boards.
C
28
star
11

appsync-apollo-links

TypeScript
27
star
12

keycloak-docker-compose

JavaScript
26
star
13

mqtt-rpc

This module provides an RPC over MQTT.
JavaScript
23
star
14

unflatten

This library will "unflatten" a map[string]interface{} where the keys represent some flattened structure.
Go
21
star
15

lifx

Minimal lifx api for go
Go
20
star
16

aws-iot-go

This is a small project illustrating how to use golang to provision then connect to the Amazon Webservices IoT Service.
Go
19
star
17

mqtt-router

This module a router for use with MQTT subscriptions.
JavaScript
17
star
18

buildkite-serverless-agent

A serverless buildkite agent which uses codebuild.
Go
15
star
19

dynalock

This is a small lock library written Go, which uses AWS DynamoDB as the data store.
Go
15
star
20

coffer

This command line tool is designed to simplify storage and retrieval of secrets in Amazon Web Services.
Go
14
star
21

esp32-blufi-demo

This is the demo of bluetooth onboarding for the ESP32 boards.
C
13
star
22

connect-leveldb

This module provides a session store for connect which uses leveldb
JavaScript
12
star
23

winston-request-logger

Winston based http request logger for express.
JavaScript
12
star
24

ansible-esp8266-role

This role installs all the esp8266 development environment.
Shell
12
star
25

webpack-docker-example

JavaScript
11
star
26

aws-billing-store

This project automates setup of Cost and Usage Reports (CUR) in a billing account with an Athena table enabling querying of the latest data for each month.
Go
11
star
27

mbedtls

C
11
star
28

grunt-express-bootstrap

Grunt Express project bootstrap command.
JavaScript
10
star
29

s3iofs

This package provides an S3 implementation for Go1.16 filesystem interface.
Go
10
star
30

echo-esbuild-middleware

This module provides an echo middleware which automatically bundles assets using esbuild.
Go
10
star
31

rifter

MQTT reverse proxy.
Go
9
star
32

postit

This project illustrates how you can use https://github.com/twitchtv/twirp running in lambda
Go
8
star
33

esp8266-led-lamp

C
7
star
34

serverless-acm-approver

This serverless application provides an acm approver function.
Go
7
star
35

cognito-cli

This is the missing CLI tool for working with AWS Cognito
Go
7
star
36

timeseries

A time series micro service in golang.
Go
7
star
37

ros-mpu9250-node

C++
7
star
38

nonpm

This aim of this module is to establish whether I can make a small scale npm replacement using node and leveldb.
JavaScript
7
star
39

buildkite-packer

Makefile
6
star
40

gbc

Golang library which provides a net.Conn with buffering preconfigured.
Go
6
star
41

dynastorev2

This package provides a CRUD store for AWS DynamoDB
Go
6
star
42

lidar-mqtt

This service reads scan data from the ydlidar and writes it to an MQTT topic.
C++
6
star
43

realworld-aws-api

This project illustrates how to build an API in AWS using Go.
Go
5
star
44

gointro

A brief introduction to go
Go
5
star
45

node-netif

Node module which reads the mac address of a given network interface name.
C++
5
star
46

lambda-cache-example

Go
5
star
47

buildkite-cli

A simple command line interface to the buildkite service.
Go
5
star
48

lambda-go-extras

This module provides a middleware layer for github.com/aws/aws-lambda-go.
Go
5
star
49

gioctl

Simple library which provides golang versions of the ioctl macros in linux.
Go
4
star
50

epoller

Just a simple golang based reader which uses epoll on Linux.
Go
4
star
51

ansible-buildkite

This is an ansible role for the buildkite agent.
Python
4
star
52

nodebots_MeWIFI

C
4
star
53

serverless-cognito-auth

This serverless application provides a AWS Cognito user pool
Go
4
star
54

l7proxify

l7proxify is a transparently proxy TLS traffic traversing a NAT host.
Go
4
star
55

node-raspberrysensor

Library for accessing various sensors via the bcm2835 library.
C++
4
star
56

twitter-bootstrap-rails31

Ruby
4
star
57

arrow-gh-processor

This project illustrates how to build a data processor using a Go, Apache Arrow.
Go
4
star
58

echo-go-templates

This project provides some template helpers with the Go IOFS and HTML templates packages for use with echo.
Go
3
star
59

superlumic-config

Shell
3
star
60

terraform-cloud-aws-blog

This is the code related to a blog post I am posting about deploying infrastructure to AWS using Terraform Cloud without using IAM User Credentials.
HCL
3
star
61

sysinfo-ui

CSS
3
star
62

cloudtrail-log-processor

Process and filter cloudtrail logs using lambda to produce a clean feed for downstream systems.
Go
3
star
63

riak-log4j-appender

Java
3
star
64

lambda-typescript-skeleton

This skeleton contains a basic lambda function written in typescript with tests.
Makefile
3
star
65

sfn-golang-example

This is a basic example of how to use AWS step functions with lambda's written in Go.
Go
3
star
66

VicSafe

JavaScript
3
star
67

basic_esp_board

KiCad Layout
3
star
68

node-rrdtool

This module is a very basic wrapper over rrdtool using the nodejs child_process module.
JavaScript
3
star
69

wolfeidau_site

Source code to my website which is located at http://wolfe.id.au
CSS
3
star
70

node-collectd

JavaScript
3
star
71

duckdb-adbc-go

This is an runnable example project of using DuckDB, with ADBC and Go.
Go
3
star
72

duckdb-docker-iceberg

This is a docker image containing the C++ libs required to run DuckDB with apache Iceberg
Makefile
3
star
73

sam-golang-multi-lambda

Go
2
star
74

meshthing-serial-bridge

Go
2
star
75

dynastore

Storage library which provides a simple key value abstraction over dynamodb.
Go
2
star
76

bamboo-git-plugin

Plugin for Atlassian's Bamboo supporting Git SCM.
Java
2
star
77

ec2-operating-hours

Go
2
star
78

chef-solo-base

Base project for a chef solo repository.
Ruby
2
star
79

queue-stream

This module provides a simple stream interface to an AMQP message queue.
JavaScript
2
star
80

nodejsinprod-talk

JavaScript
2
star
81

sysinfo-mqtt

Go
2
star
82

reverseproxy

Simple reverse proxy written in golang.
Go
2
star
83

jsontemplate

jsontemplate
Go
2
star
84

ssmcache

This is a simple cache library which only retrieves params from SSM parameter store.
Go
2
star
85

dashboard

Messing around with AngularJS and some REST Services to build a dashboard.
JavaScript
2
star
86

buildbox-lifx

This is a small service to monitor buildbox builds and change the color of a lifx globe.
Go
2
star
87

opensolaris-documentation

A collection of guides and documentation for open solaris.
2
star
88

envfile

Small env file loader in go.
Go
2
star
89

gophermq-stack

2
star
90

tribs

JIRA Plugin for contributions
Java
2
star
91

agent86

Agent to broker information to and from a Linux Router
Shell
2
star
92

cognito-vue-oauth2-demo

JavaScript
2
star
93

nodejs-compose

Pretty basic example of using docker compose to deploy a NodeJS.
2
star
94

appsync-lamba-ts

TypeScript
2
star
95

cloudfront-simple-analytics

simple analytics service for CloudFront
Go
2
star
96

syslogasuarus

Small simple UDP syslog server written in golang, aim is to display log messages in a nice bright colorful way.
Go
2
star
97

github-action-workflow-check

CLI which checks if the version of actions used in your workflow are up to date
Go
2
star
98

parquet-schema-parser

This is a work in progress Go parser for Parquet schema definitions.
Go
1
star
99

arrow-cookbook-golang

Go
1
star
100

test-ec2-vagrant

Ruby
1
star