Commit Graph

7 Commits

Author SHA1 Message Date
ngoomie 07977292fe Prettify `login_do` action and remove one session per user limit
`login_do` now uses a try/catch control structure instead of the
horrifying nested if/else control structure it used before. I'd think a
failed login attempt counts as an exception, so it should be fair to use
it here?

I have also removed the one session per user limit for now. I'm going to
replace it with a manual session manager in user settings later
hopefully, and some sort of periodically run script that deletes any
expired sessions from the DB, plus maybe other places where they get
deleted.

any `use experimental 'name'` instances have been removed too since
Mojolicious complains about your use of experimental features no matter
what anyways!
2023-05-07 22:16:22 -06:00
ngoomie c4f02ec4b6 `thread_id` in `posts` table should not autoincrement 2023-05-07 19:15:24 -06:00
ngoomie e12849508e Implement login, fix more formatting 2023-05-07 08:50:39 -06:00
ngoomie c5785301ca Some prep for user sign in implementation + formatting changes
global changes:
  - config now uses snake_case instead of camelCase for config entry
    names
  - closing brackets/braces never occur on their own line
  - there are almost never spaces inside brackets/braces before and
    after the actual content
  - I also removed a bunch of linebreaks I really shouldn't have because
    it just ended up worsening readability, so I'm going to put them
    back tomorrow lol

`lib/CharmBoard.pm` :
  - removed PostgreSQL from the database driver detector, I just wanna
    stick with SQLite and MySQL initially since I'm only really familiar
    with those
  - detect dev environment (from conf file setting) and only shut
    caching off in that situation
  - removed the default layout config option

`lib/CharmBoard/Crypt/Password.pm`
  - renamed subroutines from snake_case to whateverthisiscalled
  - changed what format `passgen` outputs salts and hashes in
  - changed size and factor for reasons I honestly don't remember at
    this point. I should probably recalibrate that properly tomorrow
  - added `passchk` subroutine for verifying of passwords on the login
    screen
  - nice and helpful comments

`lib/CharmBoard/Crypt/Seasoning.pm`
  - this is what used to be `tools/pepper.pl`. it's not currently used
    for anything but it will be used for pepper generation during setup
    if CharmBoard ever gets to that point. also might use it for
    generating salts actually

`lib/CharmBoard/Controller/Auth.pm`
  - realized I had the salt and hash variable assignments the wrong way
    'round like an idiot, so I fixed that
  - added part of signup (password auth)
  - also lots of hopefully-helpful comments?

`lib/CharmBoard/Schema/*.pm`
  - added more params for each column

`lib/CharmBoard/Schema/Session.pm`
  - added `is_ip_bound` and `bound_ip` columns

`database.sql`
  - as for stuff not mentioned in the schema module changes, I added
    `ON CONFLICT` behavior (it's all `ABORT`, which rolls back the
    entire transaction)

i'm tired i'm spenfing too much time either reading about mojolicious/perl or actually programming in them (usually the former atm) i need to chillax and play some videogames
2023-05-07 00:04:15 -06:00
ngoomie 5880920e5f Forgot to commit qw format change for Schema.pm, oops 2023-05-06 00:05:47 -06:00
ngoomie 2ad959ffa8 Change schema definitions, change qw formatting
- Added `belongs_to` properties for foreign keys
- Added subforums table and restructured database around that
- `qw` formatting was changed (was `qw/ foo bar baz /` in some places, is now `qw(foo bar baz)` everywhere I think)
2023-05-06 00:02:47 -06:00
ngoomie 744c916fde Set up basic registration (but not login, yet) 2023-05-05 22:24:49 -06:00