guestbook-ng/README.md

80 lines
1.9 KiB
Markdown
Raw Permalink Normal View History

2021-12-04 04:58:43 +00:00
# guestbook-ng
2021-12-04 05:11:37 +00:00
The goal of guestbook-ng is to integrate across vendors and customers
with full-service analytics insights by leveraging the latest in Perl
Mojolicious blockchain technologies powered by AI.
2021-12-04 23:36:10 +00:00
## DB Config
$ cat guestbook-ng.conf
{
secrets => ['secret_goes_here'],
2021-12-12 06:50:07 +00:00
'TagHelpers-Pagination' => {
separator => '',
current => '<strong><u>{current}</u></strong>',
next => 'Next',
prev => 'Prev',
ellipsis => '..'
2021-12-12 06:50:07 +00:00
},
dev_env => {
pg_string => 'postgresql://user:PASSWORD@example.com/db'
2021-12-11 23:48:00 +00:00
},
prod_env => {
pg_string => 'postgresql://user:PASSWORD@example.com/db'
2021-12-12 06:50:07 +00:00
},
max_posts => 5
2021-12-04 23:36:10 +00:00
}
`secrets` and the Postgres connection string are mandatory
2021-12-12 06:50:07 +00:00
2022-07-22 15:34:21 +00:00
## Discord Webhook
If you provide a file in the same directory called `.tom.url`
containing a Discord Webhook URL then a notification will go out when
someone signs the Guestbook. If you're using Docker but don't want the
Webhook behavior, just create an empty file to make the Docker build
work:
$ touch .tom.url
2021-12-04 23:36:10 +00:00
## Testing
2021-12-12 06:50:07 +00:00
$ prove -l
2021-12-04 23:36:10 +00:00
t/basic.t .. ok
All tests successful.
Files=1, Tests=6, 1 wallclock secs ( 0.04 usr 0.00 sys + 0.58 cusr 0.05 csys = 0.67 CPU)
Result: PASS
Add the `-v` option for more verbose output
2021-12-19 22:56:45 +00:00
2021-12-31 01:52:34 +00:00
## Docker
### Build
2023-07-26 16:51:57 +00:00
podman build -t guestbook-ng .
2021-12-31 01:52:34 +00:00
2022-01-10 18:16:48 +00:00
### Tag
2024-07-04 05:20:03 +00:00
podman tag guestbook-ng \
git.seriousbusiness.international/swaggboi_priv/guestbook-ng
2022-01-10 18:16:48 +00:00
### Push
2024-07-04 05:20:03 +00:00
podman push git.seriousbusiness.international/swaggboi_priv/guestbook-ng
2023-04-23 04:30:05 +00:00
### Pull
2024-07-04 05:20:03 +00:00
podman pull git.seriousbusiness.international/swaggboi_priv/guestbook-ng
2023-04-23 04:30:05 +00:00
### Run
podman run -dt --rm --name guestbook-ng -p 3001:3000 guestbook-ng:latest
### Generate unit file
podman generate systemd --files --new --name guestbook-ng
2022-01-10 18:16:48 +00:00
2021-12-19 22:56:45 +00:00
## TODOs
2022-07-22 04:56:57 +00:00
1. Do something about the hardcoded URL in Webhook stuff