Commit Graph

269 Commits

Author SHA1 Message Date
leo
c4d0cb209b
go: add settings struct
All checks were successful
continuous-integration/drone/push Build is passing
* let the settings struct be the single source of truth
* rm app fields that are covered by settings
* pass around a pointer to settings instead of config
* consolidate config+flags into settings on start-up
* update tests
* rm empty settings.go file

fixes #4
2023-05-03 02:18:29 +02:00
leo
9ab2d0ae0b
go: handle host+port combinations,shutdown better
All checks were successful
continuous-integration/drone Build is passing
continuous-integration/drone/push Build is passing
* add log messages telling the user what went wrong if the app fails to
  start
* improve existing log messages
* cleanup: close channels when exiting
* cleanup: stop listening for signals when exiting
2023-05-02 00:04:04 +02:00
leo
a053103000
config: use the in-house logger
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-01 23:09:36 +02:00
leo
593454d616
go: add user email handling + improve sessions
All checks were successful
continuous-integration/drone/push Build is passing
* add Email field to User entity (+codegen)
* switch to Echo contrib sessions backed by Gorilla sessions
* use SessionCookieSecret value from the config
* stage mod,sum changes
* add clearer signup/signin redirect logic
* render error pages on 500/404s and only fall back to returning raw
  errors when the error is some unexpected kind
* add username/email "exists" funcs+tests - handle "not found" and "not
  unique" errors, return errors otherwise
2023-05-01 22:48:11 +02:00
leo
61ec8bfea1
app: add routes_test.go
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-01 15:48:53 +02:00
leo
3439ec7c2a
app: set devel mode earlier
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-01 15:47:39 +02:00
leo
1d421465f5
go: have a dynamic {asset,tmpl}Path
All checks were successful
continuous-integration/drone/push Build is passing
* handle errors more specifically when loading assets/tmpls
2023-04-28 23:16:58 +02:00
leo
ba869f9a65
app: handle global debug mode better
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-28 23:05:32 +02:00
leo
9b22ec35ee
log: allow setting log level dynamically
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-28 23:01:35 +02:00
leo
6bd3b2845b
log: add Debugf method
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-28 22:58:50 +02:00
leo
269c63c661
log: return logger on Init
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-28 22:54:09 +02:00
leo
3cb2da457e
routes: change 303 -> 301 for /static -> /assets
All checks were successful
continuous-integration/drone/push Build is passing
* should enable users' browsers to make use of the status code and cache
  the redirect (in case anybody accesses the older version of the app
  and hits /static)
2023-04-28 19:07:43 +02:00
leo
82bc22e192
head.tmpl: use canonical /assets to avoid redirect
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-28 19:07:02 +02:00
leo
946360e489
signin.tmpl: reorder attrs [skip ci] 2023-04-28 00:47:20 +02:00
leo
bde8cfc88e
fix: properly redirect /static/* to /assets/*
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-27 17:43:34 +02:00
leo
d99d86a2be
go(app): use embedded variable value
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-26 23:11:58 +02:00
leo
8c7c84f6f9
go: rm deadcode from app/routes.go
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-26 23:05:48 +02:00
leo
fe9fd0fa5a
ci: rm vet,fmt from os pipelines
All checks were successful
continuous-integration/drone/push Build is passing
...since it runs in the golangci-lint pipeline.

also, use `assets` instead of `static` for tailwind as per last commit.
2023-04-26 23:01:32 +02:00
leo
1655d6b792
go: /static -> /assets in varnames,routes,dirs
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-26 22:44:18 +02:00
leo
70ec7f5e53
config: add fields
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-23 19:23:00 +02:00
leo
e58c15f1c9
ent: add HIBP model
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-21 13:57:32 +02:00
leo
555bc65502
handlers: update error handling
All checks were successful
continuous-integration/drone/push Build is passing
* have a common error page tmpl
2023-04-21 12:33:14 +02:00
leo
b1c926befd
justfile: foolproof+document targets [skip ci] 2023-04-20 13:30:10 +02:00
leo
5b63997aaf
app: clarify log msg [skip ci] 2023-04-20 13:23:48 +02:00
leo
c762bc137c
air: build in app version [skip ci] 2023-04-20 13:21:34 +02:00
leo
8bcb133c14
air: thoroughly ignore node_modules [skip ci] 2023-04-20 13:17:39 +02:00
leo
798f245b40
air: run in devel mode [skip ci] 2023-04-20 13:05:07 +02:00
leo
edf720bcb9
go: create proper (non-string) ctx key in user pkg
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 23:44:49 +02:00
leo
b5373602ba
run.go: add license flag
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 23:36:12 +02:00
leo
f00b5bdaf8
handlers: add a TODO [skip ci] 2023-04-19 23:23:22 +02:00
leo
574693ebb2
add .air.toml [skip ci] 2023-04-19 23:23:02 +02:00
leo
7c200b7488
readme: add goreportcard|godocs labels [skip ci] 2023-04-19 23:08:45 +02:00
leo
77a5f190a2
ci: add golangci-lint|godocs pipeline
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 23:05:30 +02:00
leo
aa63dafad4
go(handlers): add bluemonday HTML sanitiser
All checks were successful
continuous-integration/drone/push Build is passing
should aid at thwarting XSS.
2023-04-19 22:46:20 +02:00
leo
25335293eb
chore: clean up handlers pkg
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 22:08:17 +02:00
leo
ee98acef74
pre-commit: rm gofumpt hook
gofumpt is already ran as a part of golangci-lint linting process

[skip ci]
2023-04-19 21:48:05 +02:00
leo
8622539294
chore: clean up app pkg
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 21:46:56 +02:00
leo
dc0ce9b27a
chore: clean up run.go
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 21:41:51 +02:00
leo
733f232c49
banner: add moar bling
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 21:22:00 +02:00
leo
aadb409606
go: fully switch to slogging
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 05:30:52 +02:00
leo
c6378d7dd3
pass logger ctx under key 'l'
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 05:18:01 +02:00
leo
608b0952b2
handlers: clean up
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 04:45:49 +02:00
leo
773b10e60b
handlers: handle err on redirects
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 04:09:24 +02:00
leo
ff252df692
handlers: streamline SignupPost
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 04:01:03 +02:00
leo
62e038fa3e
simplify: funcMap member func
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 03:57:07 +02:00
leo
c6896bdee2
modules/password: simplify return
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 03:51:42 +02:00
leo
63e5a86cdc
slogging: clean up deadcode
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 03:49:45 +02:00
leo
58c9446130
handlers: clean up deadcode
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 03:48:47 +02:00
leo
6ba09987a9
handlers: set cookie with SameSiteStrictMode
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 03:34:23 +02:00
leo
33c9b8a30e
tmpl: fix 500 on logout
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 03:29:44 +02:00