Password Compromise Monitoring Tool
Go to file
2023-05-20 18:58:09 +02:00
app go(refactor): clean up run.go 2023-05-17 20:40:24 +02:00
assets css: stage the tailwind-built file 2023-05-16 12:13:49 +02:00
config config: expand comment [skip ci] 2023-05-13 21:33:55 +02:00
ent go: add db module for preps/checks 2023-05-05 22:52:59 +02:00
handlers fix(session panic): check if nil before use 2023-05-16 13:49:02 +02:00
modules go(funcmap): add sha384,sha512 funcs 2023-05-14 22:53:25 +02:00
slogging slogger: rename Logger to Slogger 2023-05-11 17:06:20 +02:00
templates tmpls: set required attr for form fields 2023-05-15 18:37:34 +02:00
.air.toml air: update config [skip ci] 2023-05-06 13:49:23 +02:00
.dockerignore ci,just,pre-commit: add Containerfile 2023-05-20 18:05:26 +02:00
.drone.yml ci,just,pre-commit: add Containerfile 2023-05-20 18:05:26 +02:00
.editorconfig update .editorconfig [skip ci] 2023-04-12 23:14:21 +02:00
.envrc nix: add devenv 2023-05-05 19:43:28 +02:00
.gitattributes go: redo asset handling 2023-05-08 00:13:33 +02:00
.gitignore css: stage the tailwind-built file 2023-05-16 12:13:49 +02:00
.golangci.yml add .golangci.yml [skip ci] 2023-04-19 02:40:08 +02:00
.hadolint.yaml ci,just,pre-commit: add Containerfile 2023-05-20 18:05:26 +02:00
.pre-commit-config.yaml ci,just,pre-commit: add Containerfile 2023-05-20 18:05:26 +02:00
bs.js browserSync: update what gets watched [skip ci] 2023-05-15 15:25:58 +02:00
Containerfile ci,just,pre-commit: add Containerfile 2023-05-20 18:05:26 +02:00
devenv.lock nix: add devenv 2023-05-05 19:43:28 +02:00
devenv.nix go: allow choosing db type, setting connstr 2023-05-05 23:10:56 +02:00
devenv.yaml nix: add devenv 2023-05-05 19:43:28 +02:00
Dockerfile ci,just,pre-commit: add Containerfile 2023-05-20 18:05:26 +02:00
embed.go go: redo asset handling 2023-05-08 00:13:33 +02:00
error.go go: add some more startup checks for DB 2023-05-17 13:35:13 +02:00
exampleConfig.dhall dhall: switch to using the versioned config 2023-05-06 01:48:03 +02:00
gen.go go: redo asset handling 2023-05-08 00:13:33 +02:00
go.mod app: set debug lvl also to gommon Echo logger 2023-05-11 04:48:24 +02:00
go.sum app: set debug lvl also to gommon Echo logger 2023-05-11 04:48:24 +02:00
justfile ci,just,pre-commit: add Containerfile 2023-05-20 18:05:26 +02:00
LICENSE initial commit 2023-01-30 20:19:53 +01:00
main.go go: handle host+port combinations,shutdown better 2023-05-02 00:04:04 +02:00
package-lock.json add bulk changes 2023-04-13 00:07:08 +02:00
package.json go: redo asset handling 2023-05-08 00:13:33 +02:00
README.md readme: add pods example [skip ci] 2023-05-20 18:58:09 +02:00
run_test.go go: add more tests (+return instead of exit) 2023-05-03 04:26:42 +02:00
run.go add TODOs [skip ci] 2023-05-17 20:55:09 +02:00
svgo.config.js tmpl,just: process SVGs with svgo 2023-05-08 23:42:27 +02:00
tailwind.config.js add bulk changes 2023-04-13 00:07:08 +02:00

pcmt

Password Compromise Monitoring Tool

pre-commit Build Status Go Report Card Go Documentation

🚧 note: this project is being developed as a part of my thesis and is currently a work in progress. 🚧

pcmt Gopher logo
pcmt Gopher logo based on the Egon Elbre's awesome Gopher designs.

How to try this out

with podman and just installed, run the following:

# build the image locally using kaniko.
just kaniko

# start postgres.
just dbstart

# in another terminal, run the application.
# make sure to supply real CONNSTRING values for production environment.
podman run --rm -it -e PCMT_DBTYPE=postgres \
    -e PCMT_CONNSTRING="host=127.0.0.1 port=5432 sslmode=disable dbname=postgres password=postgres"
    -e PCMT_LIVE=False docker.io/immawanderer/pcmt:testbuild \
    -config /etc/pcmt/config.dhall

while the above is fine, running in pods is more close to a production setting (assuming rootless setup):

# create a pod.
podman pod create --userns=keep-id -p3005:3000 --name pcmt

# run a db in the pod.
podman run --pod pcmt --replace -d --name "pcmt-pg" --rm \
    -e POSTGRES_INITDB_ARGS="--auth-host=scram-sha-256 --auth-local=scram-sha-256" \
    -e POSTGRES_PASSWORD=postgres -v $PWD/tmp/db:/var/lib/postgresql/data \
    docker.io/library/postgres:15.2-alpine3.17

# run the application in the pod (assuming that you have built it as in the
# previous example). do note that we're connecting to the db using its
# container name, while localhost would also work. inside the pod, every
# container is reachable on localhost.
podman run --pod pcmt --replace --name pcmt-og -d --rm \
    -e PCMT_LIVE=False \
    -e PCMT_DBTYPE="postgres" \
    -e PCMT_CONNSTRING="host=pcmt-pg port=5432 sslmode=disable user=postgres dbname=postgres password=postgres" \
    -v $PWD/config.dhall:/config.dhall:ro \
    docker.io/immawanderer/pcmt:testbuild -config /config.dhall

# also, if we try to connect to the db from the host we get an error (unless
there is another database running on localhost already, such as the one from
the previous example).

curl localhost:5432
--> curl: (7) Failed to connect to localhost port 5432 after 0 ms: Couldn't connect to server

# that is because the database port has not been exposed from the pod (recall
the pod creation command).

Custom config

Make sure to check out the Dhall configuration schema to see what's possible, or have a look at the example config.

If you're new to Dhall, its documentation page is a good resource to start at.

LICENSE

AGPL-3.0-only (see LICENSE for details).