Commit Graph

50 Commits

Author SHA1 Message Date
leo ff68a7dbe3
go: fix port default,flag handling
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-23 16:37:33 +02:00
leo 547f6e7b3c
add user creation
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-22 06:47:33 +02:00
leo 97ea29d043
add user listing
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-22 03:22:58 +02:00
leo 6ce05ea74d
feat: add initial admin user creation
All checks were successful
continuous-integration/drone/push Build is passing
have the app create the initial admin user:
* if the db has not yet been set up
* if there are not users
* if the config value for Init.CreateAdmin is True
* if the admin password is not empty

default username, email values can be seen in modules/user/const.go
2023-05-21 18:50:41 +02:00
leo 9eb811169d
feat: bump configuration schema to 0.0.1-rc.2
All checks were successful
continuous-integration/drone/push Build is passing
this entails a couple of breaking changes due to schema evolution. once
the schema is stabilised, backward compatibility promise will be given.

* update config struct and accompanying scructs
* update tests
* update exampleConfig.dhall
* update local dev environment (devenv)
* make settings reflect the config schema changes
* make use of some settings/config updates
2023-05-21 12:44:18 +02:00
leo 3a2f85f683
feat: add license headers (+spdx id)
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-20 20:15:57 +02:00
leo 72723d951d
go(refactor): clean up run.go
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-17 20:40:24 +02:00
leo 31ab083f8a
handlers: add health-check endpoints
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-13 22:33:38 +02:00
leo fc4460d5e1
go: delete pertinent ENVs after loading settings
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-12 22:43:36 +02:00
leo e8ac4e39ce
modules/funcmap: add funcs to calculate SRI hashes
All checks were successful
continuous-integration/drone/push Build is passing
* correctly handle LiveMode resp. whether or not to set/read embeds
2023-05-12 00:11:23 +02:00
leo 1fb7479d8e
slogger: rename Logger to Slogger
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-11 17:06:20 +02:00
leo 9bbfbe923e
app: set debug lvl also to gommon Echo logger
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-11 04:48:24 +02:00
leo 741af20b6e
app: call logger consistently
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-11 04:45:33 +02:00
leo bef3cb228e
app(logger): restore the old behaviour
All checks were successful
continuous-integration/drone/push Build is passing
that is - have the Logger() method return pointer to the local (s)logger
2023-05-11 04:42:38 +02:00
leo 122ea638c9
go: refactor template rendering
All checks were successful
continuous-integration/drone/push Build is passing
* create pkg 'modules/template'
* move template rendering code from 'handlers' to 'modules/template'
* update call sites
* walk the 'templates' dir to discover nested hierarchies
* solidify LiveMode handling (vs embedded assets)
* break out funcMap to it's own file
* general clean-up
2023-05-11 04:32:39 +02:00
leo 61760fa373
app/assets.go: add info on what path failed
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-11 03:09:12 +02:00
leo 813d0c233e
echo settings: enable rate-limiting
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-10 17:48:02 +02:00
leo a879704535
go: partially rework how slogging works
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-09 17:35:00 +02:00
leo df0c280ad1
go: redo asset handling
All checks were successful
continuous-integration/drone/push Build is passing
* only embed substructure of assets
* create subfolders for css, imgs
* add .gitattributes file specifying pcmt.css as generated (by tailwind)
2023-05-08 00:13:33 +02:00
leo 9dbc475145
go: implement the Echo renderer for templates
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-06 21:50:35 +02:00
leo eafc9c1e92
go,tmpl: conditionally show content to users
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-06 00:03:41 +02:00
leo 0a34bca1c1
go: allow choosing db type, setting connstr
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-05 23:10:56 +02:00
leo f1bb52c58f
go: add a setting val for whether db is set up
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-05 22:58:13 +02:00
leo bfafc4a8be
config: update schema
All checks were successful
continuous-integration/drone/push Build is passing
* couple session-related attrs in a record
* couple logger-pertaining attrs in a record
* update config Go representation
* update Go config consumers
2023-05-05 19:31:43 +02:00
leo 746eb82f67
go: make sure flags are properly checked
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-04 21:28:30 +02:00
leo 9fd55dbc0b
app: pre-declare errors
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-04 16:38:15 +02:00
leo 38f72825e0
app: switch a couple of Info statements to Debug
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-04 16:35:41 +02:00
leo 0a5d4e7d30
go: use enttest in tests
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-03 23:21:47 +02:00
leo d83a4bbc4c
rename app/startup.go to app/echoSettings.go
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-03 02:37:04 +02:00
leo 258d9a5352
fix: set develMode again
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-03 02:35:35 +02:00
leo 066d5da42f
chore: rm empty app/config.go [skip ci] 2023-05-03 02:26:24 +02:00
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 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 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 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 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 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 5b63997aaf
app: clarify log msg [skip ci] 2023-04-20 13:23:48 +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 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 f129606b8f
add bulk changes
All checks were successful
continuous-integration/drone/push Build is passing
* add handlers for signin,singup,logout...
* introduce ent ORM and add user schema
* add live mode, devel mode to selectively turn on features via
  config/flags
* add templates, handle embedding moar smarter:
  * live mode uses live folder structure, else embedded templates are
    used
* start using tailwindcss to style stuff
* add development goodies for hot-reloading (browser-sync - bs.js)
* pimp-up config.dhall with actual custom config Type (enables remote
  schema and local values only as needed)
* add justfile (alternative to makefile for process automation)
2023-04-13 00:07:08 +02:00
leo 345838cc76
go: add secure middleware 2023-03-22 23:15:04 +01:00
leo 5937a24ad9
go: add a handler for admin endpoint(s) 2023-03-22 23:11:14 +01:00
leo 5cfad662fc
go: make StartupSettings a method 2023-03-22 23:04:57 +01:00
leo c945c9fcb7
go: add a method to setup routes 2023-03-22 23:03:21 +01:00
leo 6194f36d73
go: add app struct bearing e,logger; own startup 2023-03-22 22:13:23 +01:00