• Stars
    star
    261
  • Rank 156,630 (Top 4 %)
  • Language
    Clojure
  • License
    MIT License
  • Created over 8 years ago
  • Updated over 4 years ago

Reviews

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

Repository Details

Memory Hole is a support issue organizer application

Memory Hole

When one knew that any document was due for destruction, or even when one saw a scrap of waste paper lying about, it was an automatic action to lift the flap of the nearest memory hole and drop it in, whereupon it would be whirled away on a current of warm air to the enormous furnaces which were hidden somewhere in the recesses of the building


Memory Hole is a support issue organizer. It's designed to provide a way to organize and search common support issues and their resolution.

screenshots

1.0 Features

  • The app uses LDAP and/or internal table to handle authentication
  • Issues are ranked based on the number of views and last time of access
  • File attachments for issues
  • Issues are organized by user generated tags
  • Markdown with live preview for issues
  • Weighted full text search using PostgreSQL citext extension
  • Users can view/edit issues based on their group membership
  • If using LDAP, issues can be assigned to LDAP groups
  • LDAP groups can be aliased with user friendly names

Prerequisites

You will need the following to compile and run the application:

Running with Docker

mkdir memory-hole
cd memory-hole
curl -O https://raw.githubusercontent.com/yogthos/memory-hole/master/docker-compose.yml
docker-compose up

The app will be available at http://localhost:8000 once it starts.

Configuring the database

PostgreSQL

Follow these steps to configure the database for the application:

  1. Make sure you have the CITEXT extension installed on PostgreSQL.

  2. Run the psql command:

     psql -U <superuser|postgres user> -d postgres -h localhost
    
  3. Create the role role for accessing the database:

     CREATE ROLE memoryhole;
    
  4. Set the password for the role:

     \password memoryhole;
    
  5. Optionally, create a schema and grant the memoryhole role authorization:

     CREATE SCHEMA memoryhole AUTHORIZATION memoryhole;
     GRANT ALL ON SCHEMA memoryhole TO memoryhole;
     GRANT ALL ON ALL TABLES IN SCHEMA memoryhole TO memoryhole;
    
  6. Add the CITEXT extension to the schema:

     CREATE EXTENSION IF NOT EXISTS citext WITH SCHEMA memoryhole;
    
  7. Make sure memoryhole is allowed to login:

     ALTER ROLE "memoryhole" WITH LOGIN;
    
  8. Exit the shell

     \q
    

This setup should lead to similar :database-url (eg. on local machine).

:database-url "jdbc:postgresql://localhost/postgres?user=memoryhole&password=memoryhole"

H2

H2 DB can use various hosting scenarios, which are available on its feature list.

This setup can lead to following :database-url on local machine.

:database-url "jdbc:h2:~/memory-hole-dev"

When H2 DB is used for development or production, it needs to have properly set migratus :migration-dir pointing to H2 specific migrations for populating schema.

:migration-dir "migrations/h2"

Running during development

Create a profiles.clj file in the project directory with the configuration settings for the database. Optionally migrations directory and LDAP can be configured, e.g:

{:profiles/dev
 {:env
  {:database-url "jdbc:postgresql://localhost/postgres?user=memoryhole&password=memoryhole"
  :migration-dir "migrations/postgresql"
  ;;ldap is optional, will use internal table otherwise
  ;;Admin users (able to manage groups) defined by their sAMAccountName
  :ldap-admin-users ["my-ldap-sAMAccountName" "another-ldap-sAMAccountName"]
  ;;Or Admin Groups defined by their distinguished names
  :ldap-admin-groups ["CN=some-ldap-group,OU=foo123,DC=domain,DC=ca"]
  :ldap
  {:host
     {:address         "my-ldap-server.ca"
      :domain          "domain.ca"
      :port            389
      :connect-timeout (* 1000 5)
      :timeout         (* 1000 30)}}}}}

Run the migrations

lein run migrate

This will create the tables and add a default admin user, The default login is: admin/admin.

To start a web server for the application, run:

lein run

To compile ClojureScript front-end, run:

lein figwheel

Building for production

lein uberjar

This will produce target/uberjar/memory-hole.jar archive that can be run as follows:

java -Dconf=conf.edn -jar memory-hole.jar migrate
java -Dconf=conf.edn -jar memory-hole.jar

The conf.edn file should contain the configuration such as the database URL that will be used in production. The following options are available.

Database URL

:database-url "jdbc:postgresql://localhost/postgres?user=memoryhole&password=memoryhole"

Migration directory

Depending on selected DB backend, migration directory needs to be set, eg.

:migration-dir "migrations/postgresql"

HTTP Port

The HTTP port defaults to 3000, to set a custom port add the following key to the config:

:port 80

Session Configuration

The app defaults to using a server-side memory based session store.

The number of sessions before a memory session times out can be set using the :memory-session key as follows:

:memory-session
{:max-age 3600}

If you wish to use a cookie based memory store, then add a :cookie-session key to the configuration. The :cookie-session key should point to a map containing two optional key:

  • :key - a secret key used to encrypt the session cookie
  • :cookie-attrs - a map containing optional cookie attributes:
  • :http-only - restrict the cookie to HTTP if true (default)
  • :secure - restrict the cookie to HTTPS URLs if true
  • :max-age - the number of seconds until the cookie expires

An example configuration might look as follows:

:cookie-session
{:key "a 16-byte secret"
 :cookie-attrs
 {:secure  true
  :max-age 3600}}

LDAP Support

The LDAP connection configuration should be placed under the :ldap key as follows:

:ldap
  {:host
     {:address         "my-ldap-server.ca"
      :domain          "domain.ca"
      :port            389
      :connect-timeout (* 1000 5)
      :timeout         (* 1000 30)}}

There are two options for managing user groups when using LDAP, you can either assign admin users using the sAMAccountName, or specify groups that correspond to the memberOf key.

:ldap-admin-users ["my-ldap-sAMAccountName" "another-ldap-sAMAccountName"]
:ldap-admin-groups ["CN=some-ldap-group,OU=foo123,DC=domain,DC=ca"]

HTTPS Support

To enable HTTPS support in production add the the following configuration under the :ssl key:

:ssl
{:port 3001
 :keystore "keystore.jks"
 :keystore-pass "changeit"}

To disable HTTP access, set the :port to nil:

:port nil

Alternatively, you can front the app with Nginx in production. See here for details on configuring Nginx.

A complete conf.edn example:

{:database-url "jdbc:postgresql://localhost/postgres?user=memoryhole&password=memoryhole"
 :cookie-session
 {:key "a 16-byte secret"
  :cookie-attrs
  {:max-age 60}}
 :port nil
 :ssl
 {:port 3001
  :keystore "keystore.jks"
  :keystore-pass "changeit"}}

Nginx Proxy

The app can be proxied with Nginx to a custom path as follows:

server {
    listen ...;
    ...
    location /memory-hole {
        proxy_pass http://127.0.0.1:3000;
    }
    ...
}

You will then need to add the :app-context in the conf.edn file with the context:

{:database-url "jdbc:postgresql://localhost/postgres?user=memoryhole&password=memoryhole"
 :port 3000
 :app-context "/memory-hole"}

Acknowledgments

The original implementation of the tool was written by Ryan Baldwin. The app is based on the original schema and SQL queries.

License

Copyright © 2016 Dmitri Sotnikov

More Repositories

1

Selmer

A fast, Django inspired template system in Clojure.
Clojure
982
star
2

migratus

MIGRATE ALL THE THINGS!
Clojure
642
star
3

markdown-clj

Markdown parser in Clojure
Clojure
540
star
4

clojure-error-message-catalog

a catalog of common Clojure errors and their meaning
448
star
5

mastodon-bot

a bot for mirroring Twitter/Tumblr accounts and RSS feeds on Mastodon
Clojure
192
star
6

json-html

Provide EDN/JSON and get a DOM node with a human representation of the data
Clojure
160
star
7

config

Library for managing environment variables in Clojure using EDN configuration files
Clojure
155
star
8

yuggoth

my blog engine (no longer maintained)
Clojure
147
star
9

graal-web-app-example

example web application using HTTP Kit and Reitit compiled with GraalVM
Clojure
122
star
10

instant-pdf

A reporting service which generates PDFs from JSON encoded text
Clojure
109
star
11

json-to-pdf

A Library for easily generating PDF documents given JSON markup
Clojure
99
star
12

maestro

FSM library for managing workflows
Clojure
90
star
13

clj-rss

a library for generating RSS feeds
Clojure
59
star
14

compojure-template

A Leiningen template for batteries included projects using Compojure.
Clojure
52
star
15

doc-builder

data driven HTML/PDF document builder using Hiccup and EDN
Clojure
48
star
16

clj-tetris

Example Tetris in Clojure
Clojure
44
star
17

cheatsheets

Shell
40
star
18

lein-asset-minifier

Leiningen plugin for CSS/Js asset minifcation
Clojure
40
star
19

cljs-eval-example

Example of using ClojureSript eval with Reagent
Clojure
32
star
20

gif-to-html

converts GIFs to HTML animation
Clojure
28
star
21

migratus-lein

Clojure
27
star
22

asset-minifier

a library to minify CSS/Js resources
Clojure
27
star
23

reagent-example

Clojure
27
star
24

clj-log

structural logging for Clojure
Clojure
24
star
25

graviton

a small game written in ClojureScript and Pixi.js
Clojure
24
star
26

lein-sass

SASS plugin for Leiningen using Sass.js
Clojure
20
star
27

emoji-id

converts a numeric id to emoji because reasons
Clojure
20
star
28

pg-feed-demo

example application for push notifications from PostgreSQL
Clojure
19
star
29

genetic-algorithm-example

Example of a simple GA using Clojure
Clojure
18
star
30

reagent-secretary-example

Clojure
17
star
31

quil-reagent-demo

example of using Quil with Reagent
Clojure
17
star
32

resume

Clojure
17
star
33

reagent-serverside

example of using Hiccup to generate Reagent elements server-side
Clojure
16
star
34

boids

boids example using Quil and PixiJS
Clojure
14
star
35

components-example

example of creating reusable re-frame components
Clojure
14
star
36

swagger-service

swagger-service tutorial using Duct
Clojure
13
star
37

figwheel-library-template

a template for developing ClojureScript libraries using Figwheel
Clojure
13
star
38

clojure-maven-examples

Some examples for building Clojure with the clojure-maven-plugin
Clojure
12
star
39

krueger

federated news
Clojure
12
star
40

reagent-dnd

Reagent wrapper for react-dnd
Clojure
11
star
41

pulsar-example

Clojure
11
star
42

reagent-server-rendering

An example using Nashorn to render Reagent on the server
Clojure
10
star
43

alpha-id

creates a short alphanumeric ID from a numeric ID
Clojure
10
star
44

prag-prog-re-frame-article

source code for the re-frame article
Clojure
10
star
45

ReagentPerf

Reagent version of the VueReactPerf benchmark
Clojure
9
star
46

semantic-ui-react-example

Example of using semantic-ui-react with shadow-cljs
HTML
8
star
47

markov-chains

a simple markov-chain generator example
Clojure
7
star
48

hiccup-template

a minimal Clojure/Script library for Hiccup style templating
Clojure
6
star
49

Space-Invaders

Sample Java 2D game of Space Invaders
Java
6
star
50

semantic-ui-example

an example of using React Semantic UI from Reagent
Clojure
6
star
51

yogthos.net

source for my blog yogthos.net
HTML
5
star
52

liberator-example

Sample project for Liberator
Clojure
5
star
53

particle-constellations

Clojure
4
star
54

escher-mask

example of using Escher.js from Reagent
Clojure
4
star
55

ring-http-cat-status

Ring middleware for serving status images from https://http.cat/
Clojure
4
star
56

kit-workshop

Clojure
4
star
57

reagent-pythagorean-tree

Clojure
4
star
58

clojurescript-error-reporting-example

Sample project illustrating reporting client-side errors to the server with source maps
Clojure
3
star
59

configs

my configs
Shell
3
star
60

selmer-java

Java wrapper for Selmer
Clojure
3
star
61

guestbook-with-auth

Guestbook example for Web Development With Clojure
Clojure
3
star
62

cli-test

CLI example using GraalVM
Clojure
3
star
63

guestbook

Web development with Clojure (2nd edition) - Guestbook application
Clojure
3
star
64

clj-forum

a forum for Clojure related news and discussions
Clojure
3
star
65

oauth-example

Clojure
3
star
66

json-to-pdf-example

example project for the json-to-pdf library
Java
2
star
67

picture-gallery

sample Reagent project
Clojure
2
star
68

buddhabrot

Nakkaya's Buddhabrot Fractal (http://nakkaya.com/2009/10/04/fractals-in-clojure-buddhabrot-fractal/)
Clojure
2
star
69

Lorenz-Attractor

Clojure
2
star
70

repo-tracker

Clojure
2
star
71

hoplon-app

sample Hoplon project using Leiningen and Figwheel
Clojure
2
star
72

Noir-tutorial

the project for my Noir tutorial http://yogthos.net/blog/22-Noir+tutorial+-+part+1
Clojure
2
star
73

luminusdiff

Clojure
1
star
74

guestbook-sente

sample sente app
Clojure
1
star
75

ring-external-assets

Ring middleware to serve static assets from the specified fielsystem location
Clojure
1
star
76

lein-js

updated version of https://github.com/maravillas/lein-js
Clojure
1
star
77

mojs-reagent

Clojure
1
star
78

kit-ruuter-example

Clojure
1
star
79

reagent-talk

example for the Reagent lightning talk
Clojure
1
star
80

undertow-test

Clojure
1
star
81

selmer-test

Clojure
1
star
82

yogthos.github.com

docs
HTML
1
star
83

instant-html-pdf

HTML to PDF generation service
Clojure
1
star
84

quil-lorenz-attractor

Clojure
1
star
85

re-frame-mobile-test

Clojure
1
star
86

rewrite-clj-experiments

Clojure
1
star
87

forms-test

test project for reagent-forms
Clojure
1
star
88

jar-migrations

Clojure
1
star
89

hyperfiler

fork from https://codeberg.org/chowderman/hyperfiler
TypeScript
1
star
90

puppeteer-service

a service for generating PDF documents from HTML
Clojure
1
star
91

luminus-reitit-swagger

Clojure
1
star
92

bb-htmx-examples

Clojure
1
star
93

metaballs

metaballs test in Clojure
Clojure
1
star
94

jipsi

an implementation of the Java Print Service API (JPS) for IPP / CUPS
Java
1
star
95

clojure.jdbc

JDBC library for Clojure
Clojure
1
star
96

http-kit-ws-benchmark

HTTP Kit WebSocket benchmark
Clojure
1
star
97

parity-translator

translates through languages until parity is reached :)
Clojure
1
star
98

ga-image-evolver-test

An experminet in evolving an image using polygons, based on the Clojure-Genetic-Algorithm-Example
Clojure
1
star