Commit Graph

25 Commits

Author SHA1 Message Date
ngoomie 569aa1c95b Run perltidy 2024-08-24 00:02:27 -06:00
ngoomie 77365cc0c3 Change `use feature` to `':5.34`, suppress warnings for try/catch 2024-08-23 23:37:21 -06:00
ngoomie c8c1b7aeb1 Change `$self` var names in accordance with #21 and #20 2024-08-23 22:44:45 -06:00
ngoomie 6cf65a8edd Session verification-related changes 2024-08-23 22:41:52 -06:00
ngoomie cf91c02ba0 Add session verification helper (#19) 2024-08-22 21:45:55 -06:00
ngoomie dca1e2bca5 Push session management into helper functions as per #18 2024-08-22 03:07:50 -06:00
ngoomie 185a5bb6e1 Include htmx, make some doc changes 2024-08-20 22:34:54 -06:00
ngoomie 4b4e61e474 Change subforum-related routes as per #17 2024-08-20 22:06:06 -06:00
ngoomie f10dab805a Fix bug with subforum routes
Subforum-related routes have been repositioned to the bottom of the
routes list, as putting them above other routes would make them
"override" the routes below. i.e. `/logout` would be treated as though
you were trying to view a subforum named `logout`
2024-08-19 21:41:58 -06:00
ngoomie 9c16cd0da5 Split cat/subf listing into its own Model module as per #12
I was struggling with getting the model to access my schema helper and,
I'm gonna be real with you chief, I don't even know how I managed to fix
it. But it works... I guess? lmao
2024-08-19 21:28:05 -06:00
ngoomie e86434f300 Change all vars to snake_case (#5) + misc changes
- Remaining camelCase variables in `lib/CharmBoard/Controller/Register.pm` have been swapped to snake_case
- Dev/prod environment check is now case insensitive
- Change `pass_crypt => scheme` in conf to an array
2024-08-19 02:28:14 -06:00
ngoomie 1b179fb08d Stop using smartmatch (#15) and add 5.20 features (part of #13) 2024-08-19 02:13:01 -06:00
ngoomie 44eeaa80e6 Switch to imageboard-like IDs (#7) 2024-08-19 01:39:50 -06:00
ngoomie ebcaf364ac Move Crypt and Schema into Model namespace (#6) 2024-08-08 02:05:26 -06:00
ngoomie 83a64651c2 Issue #10 fix 2024-08-08 01:57:57 -06:00
ngoomie ff55197474 Add thread creation ability 2024-08-08 01:22:31 -06:00
ngoomie 51b2c54e9a Set up + run perltidy, plus some manual format changes too 2023-05-17 10:12:48 -06:00
ngoomie fd585edc80 Work a bit on subforum viewing/thread listing 2023-05-16 22:18:25 -06:00
ngoomie b7c57b277b Partial subforum listing on index, add some perlcritic stuff 2023-05-15 17:50:44 -06:00
ngoomie 4eec3f79c5 Largely just add POD doc 2023-05-13 17:49:55 -06:00
ngoomie dc9a42f0e6 Add logout, POD documentation, various organizational things, et al
a bunch of POD documentation was addded to various .pm files

`CharmBoard::Controller::Auth` has been split into
`CharmBoard::Controller::Register`, `CharmBoard::Controller::Login`,
and `CharmBoard::Controller:Logout` (that last one is new, too!)

`Main.pm` has been renamed to `Index.pm` like it was in the beginning

the config value `board_name` now works

`CharmBoard::Schema` namespaces were changed (`ResultSource` is now
`Source`, `ResultSet` is now `Set`)

templates were mildly reorganized

almost switched from EPL to HAML. decided I really shouldn't because I
utterly despise anything whitespace sensitive, so it doesn't matter how
compact HAML is in comparison!
2023-05-09 00:37:07 -06:00
ngoomie f0ab7713cc Finish improving Auth.pm control structure; fix other minor mistakes
both `register_do` and `login_do` in `CharmBoard::Controller::Auth` now
use two try/catch blocks instead of heavily nested if/elsif/else blocks.

I also reverted the change where I removed all of the
`use experimental 'feature-name'` declarations because, while
Mojolicious still whines about experimental features being experimental,
if you don't have `use experimental 'try'` set somewhere, then it just
does not work, unlike smartmatch which will work either way but cause
perl to get mad at you. plus, it feels weird not having those there
anyways!
2023-05-08 04:26:11 -06:00
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 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 744c916fde Set up basic registration (but not login, yet) 2023-05-05 22:24:49 -06:00