*note*: only GetConfig has been changed for now.
the config now has "order" and "sections", and each section now has
"meta", "order" and "settings". This allows for the use of a struct for
loading in Go and less janky web code. Also now appears in swagger.
the backend code has been added back in, and the build process has been
modified so that no output files are left outside of build/. Admin page
loads and logs in correctly, nothing else functionality-wise yet.
parseDT only uses the magic json.Unmarshal method if theres an error
with the better version. Error came from some times being sent without a
"Z" at the end denoting UTC.
web UI now uses modules, and relies less on bodge to make things work.
Also fixes an issue where invites where "failed to send to xx" appeared
in invite form.
invites
use table-sm and no form-check-input so profile menu looks normal on
bs4. Profile was being read after being marked as used on invites, so
single-use invites were deleted and no profile was applied.
i wanted to split up the web ui components into multiple files, and
figured it'd be a good chance to try out typescript. run make typescript
to compile everything in ts/ and put it in data/static/.
This is less of a rewrite and more of a refactoring, most of it still
works the same but bits have been cleaned up too.
Remaining javascript found in setup.js and form.html
user templates will become profiles. You will be able to make multiple,
and assign them to invites individually. This commit migrates the
separate template files into one profile entry called "Default", and
lets you select them on invites. No way to create profiles has been
added yet.
It's rough right now, but the accounts tab shows a list of users and
info. Right now the only action available is to apply settings (from
template or another user) to a selection of users. More to come.
If two emails fired off at once, they would previously replace each
other's content and possibly send the wrong email to the wrong person.
construct* methods now return the email content, which is sent
separately.
running 'jfa-go start' will run it as a daemon in the background, and
'jfa-go stop' will tell it to quit via a unix socket. Self-restarts are
now implented by simply exiting the main function (now called start) and
running it again.
with jellyfin_login enabled, the username and password vals in the User
struct would be "". If you disabled 'required' on the login form, blank
username and password would allow you in.
the main JWT is stored temporarily, whereas the refresh token is stored
as a cookie and can only be used to obtain a new main token. Logout
button adds token to blocklist internally and deletes JWT and refresh
token from browser storage.
checkInvite no longer loops over all invites and checks for expiry, that
functionality has moved to checkInvites. Couple more rogue print
statements removed aswell.
Modifying settings also formats it nicely, as a bonus.
Also we using shortuuid instead of normal uuidv4 now because its the same
length as what I used in the python version.
Python utility included to convert config-base.json into a new version
which includes lists that define the order settings should be displayed.
admin.js edited to recognize this.