99 Commits

Author SHA1 Message Date
Harvey Tindall
5fa528fd2d invites: add /invites/send, store more details in new SentTo field
deprecated SendTo string field for SentTo, which holds successful send
addresses, and failures with a reason that isn't plain text. Will soon
add an interface for sending invites after their creation. For #444
(ha).
2025-12-05 12:03:21 +00:00
Harvey Tindall
b59cd73e43 messages: switch to new template package
rewrote and put in its own repo. Now supports {if a ==/!= b}, string
literals ({if a == "b"}), else/else if and nested if statements.
2025-12-04 11:50:14 +00:00
Harvey Tindall
8781e48601 email: change font, template common parts
Using the newer Jellyfin logo font for the header and hanken grotesk for the body.
Tried to redo emails with maizzle because using tailwind sounded nice, but getting it
to look like a17t would be more trouble than it's worth, since you can't
use CSS vars in emails and a17t uses them heavily. Instead, cleaned up
the mj-header a little and stored it in a separate file, and also the
header & footer, and changed the template vars with {{ .header }}  and
{{ .footer }} for all emails. Values are determined by
CustomContentInfo.Header/FooterText funcs. nil values are replaced at
program start by _runtimeValidator.

also, i beg of you don't try to do light/dark mode with mjml, you'll
want to die.
2025-09-01 15:31:28 +01:00
Harvey Tindall
87c0f54a8d email_test: allow running with INTERNAL=on 2025-08-31 17:46:37 +01:00
Harvey Tindall
e67f1bf1a9 emails: fix and confirm function of all emails
both custom and standard emails tested, quite a few fixes made,
including to an old bug with admin notifs.
2025-08-31 17:12:50 +01:00
Harvey Tindall
60dbfa2d1e messages: custom content described in customcontent.go, message tests
customcontent.go constains a structure with all the custom content,
methods for getting display names, subjects, etc., and a list of
variables, conditionals, and placeholder values. Tests for constructX
methods included in email_test.go, and all jfa-go tests can be run with
make INTERNAL=off test.
2025-08-30 14:21:26 +01:00
Harvey Tindall
94efe9f746 expiry: add "remind N days before"
new setting to send an email/message N days before a user is due to
expire. Multiple can be set.
2025-08-04 20:44:29 +01:00
Harvey Tindall
aab8d6ed77 template: report errors/warnings
error field is now logged at all points of use.
2025-08-03 18:39:47 +01:00
Harvey Tindall
7cb66e26e5 http: add "Use reverse proxy host" option
added "Use reverse-proxy reported "Host" when possible" option, which
will prefer using the "Host" or "X-Forwarded-Host" values instead of
"External jfa-go URL" in the web app. To do so, app.ExternalDomain/URI
are now functions which take *gin.Context (the latter optionally). The
protocol for the request is determined from X-Forwarded-Proto(col), so
make sure your proxy includes it.

The wiki will have been updated to mention the new option.
2025-07-16 15:22:07 +01:00
Harvey Tindall
fe4097a724 email: remove ssltls mention 2025-05-27 10:27:35 +01:00
Harvey Tindall
da0dc7f1c0 email: Allow no SMTP encryption
added a "none" option.
2025-05-26 21:44:38 +01:00
Harvey Tindall
c52ba2162e config: start adding path parameters
to change the urls of the admin page, the my account page and of
invites. Seems to work, but need to check all the code over and test.
2025-05-13 21:10:40 +01:00
Harvey Tindall
d6f5c91d78 backups: add more info, keep 1 of each version opt
backup's filename format has changed, and includes the commit too now. a
Backup struct for going to/from the filename has been added, and the
option "keep 1 backup from each version" has been added, leaving the
most recent backup from each version always. All pre-this-commit backups
are considered the same "old" version.
2025-05-13 15:07:55 +01:00
Harvey Tindall
b2771e6cc5 auth: source cookie hostname from jfa_url
instead of just applying the cookie to the hostname you accessed jfa-go
on, it is applied to the one you set in jfa-go. The result is you'll
have to login twice if you access on localhost:8056 instead
of accounts.jellyf.in.
2024-08-13 20:39:06 +01:00
Harvey Tindall
e71d492495 config: migrate "url_base" dupes to "jfa_url"
URL Base now refers to JUST the subfolder portion, i.e. `/accounts` if
you access jfa-go at `http://jellyf.in/accounts`. General > "jfa_url"/"External
jfa-go URL" now refers to the WHOLE URL you access jfa-go at, i.e.
`http://jellyf.in/accounts`. The settings in "invite emails" and
"password resets" have been removed, and a value chosen from the two
applied to "jfa_url". Migration also makes a config backup. Adds a
"deprecated" flag to config-base, which just tells the UI to not show
it (for now). Also added some warnings related to the URL base /
External URL.
2024-08-12 18:53:46 +01:00
Harvey Tindall
a52dd26ec6 email: use proxy for mailgun, too
adds proxy transport to the http.Client in the mailgun api client.
2024-08-09 21:11:18 +01:00
Harvey Tindall
2310130e6b api clients: return data, error, no status
jellyseerr already did this, but it's been standardised a little more.

Mediabrowser uses it's own genericErr function and error types due to
being a separate package, while jellyseerr and ombi now share errors
defined in common/.
2024-08-06 14:48:31 +01:00
Harvey Tindall
711394232b logmessages: all log strings in one file
EXCEPT: migrations.go, log strings there aren't gonna be repeated
anywhere else, are very specific, and will probably change a lot.
2024-08-01 20:17:05 +01:00
Harvey Tindall
48a2058e81 accounts: notify users of expiry adjustment
"Send notification message" in the extend expiry dialog will send a
message to the user with their new expiry. For #345.
2024-07-28 16:53:27 +01:00
Harvey Tindall
fbbb03a47d email: add new "expiry adjusted email"
just the email at this point. Also wrote up a little guide on adding new
emails on wiki.jfa-go.com.
2024-07-28 16:02:47 +01:00
Harvey Tindall
1a6897637f userpage: allow manual disable of pwr through username/email/contact
Checkboxes added to userpage settings allowing enabling/disabling of
specific ways of starting a PWR. For #312.
2023-12-20 18:18:39 +00:00
Stefan Schokker
85de1c97ff feat: Add SMTP authentication types to settings 2023-10-14 14:29:34 +02:00
Harvey Tindall
5702e8012c proxy: use for updater & SMTP
imports a new package to create a HTTP proxy dialer for the SMTP client.
2023-10-05 12:32:25 +01:00
Harvey Tindall
bb75bfd15d db: deprecate customEmails/userPage 2023-06-25 19:40:54 +01:00
Harvey Tindall
833be688ac storage: start db migration (badger(hold))
migrating to badger, with the badgerhold frontend. So far, done:
* Announcements (small, for a quick test)
* Discord/Telegram/Matrix/Email

most interaction with badgerhold is done through the standard
Get<x>/Get<x>Key/Set<x>Key/Delete<x>Key. UserExists functions have been
added for email and matrix, and those and the original ones now use a
query against the database rather than sifting through every record.
I've tagged these searched fields as "index" for badgerhold, although this
definitely isn't used yet, and i'm not entirely sure if it'll be useful.

migrateToBadger is now in migrations.go, and a temporary config key
"migrated_to_badger" has been added, although it isn't being used yet,
migration is just running every time during development.
2023-06-24 17:05:04 +01:00
Harvey Tindall
22c91be127 userpage: make pwr accept username too 2023-06-22 12:39:05 +01:00
Harvey Tindall
86daa70ccb userpage: password resets
click "forgot password" on login modal, enter a contact method
address/username, submit and check for a link. Requires link reset to be
enabled.
2023-06-22 12:08:18 +01:00
Harvey Tindall
7b9b0d8a84 userpage: implement login message card
Shares code with custom emails, so most related functions have had a
%s/Email/Message/g. Press the edit button on the user page setting to
add a message.
2023-06-20 21:43:25 +01:00
Harvey Tindall
68004e1d34 storage: user set/get methods for contact method access
Get/GetKey/SetKey/DeleteKey methods are used for access to
email/discord/telegram/matrix, everywhere. Mutex added for each, avoids
concurrent read/write issues. Will also make potential transition to
database easier.
2023-06-20 12:19:24 +01:00
Harvey Tindall
609039baeb userpage: change email (+ confirmation)
edit/add button added for email address. Confirmation works too.
2023-06-18 19:38:09 +01:00
Harvey Tindall
48403ce940 discord: proper support for discriminator-less
names with no discriminator are shown as @username, and search works
with the @ too. Also bumped go version to 1.20, since it was stuck on
1.16 and i felt like trying generics (in an ugly way).
2023-06-12 16:32:40 +01:00
Harvey Tindall
8888807780 remove debug print, add another 2021-12-30 17:30:29 +00:00
Harvey Tindall
d19f7d6b53 mailgun: better handle different api url formats 2021-12-30 02:55:00 +00:00
Harvey Tindall
36f3860c4c SMTP: Always use plaintext as main body
Adding the HTML as the alternative body caused the plaintext email to
always appear. Should fix #164.
2021-11-10 20:12:31 +00:00
Stefan Schokker
b7236319ec Actually use correct variable, actually use variable correctly and added a loadConfig entry 2021-11-09 21:18:54 +01:00
Stefan Schokker
556c31d4ea Add checkbox that allows invalid SMTP certificates to be used. 2021-11-08 20:48:55 +01:00
Harvey Tindall
eeb9b07bce admin: add manual "Send Password reset" to accounts tab
Only appears with Reset links enabled.
Pressing this sends a PWR link to the users selected.
if one user is selected, or if one of you selected users doesn't have a
method of contact, a link is given to the admin to send to them
manually.
2021-10-13 15:04:22 +01:00
Harvey Tindall
77799b2917 smtp: only construct email once
also switch layout in email file to group each driver and its methods
together.
2021-10-07 16:19:06 +01:00
Harvey Tindall
d560df5b1e switch smtp library, add, HELLO hostname option
now using xhit/go-simple-mail, as I wanted to add an option to change
the hostname sent in the HELLO message but this is only possible with
STARTTLS in jordan-wright/email. New option can be seen in Settings >
SMTP with advanced settings turned on.
2021-10-07 12:01:42 +01:00
Harvey Tindall
548dceda28 don't give smtp plainauth if no username & password
for #141, just a guess
2021-08-26 21:03:02 +01:00
Harvey Tindall
e67b2e91fb invite: auto-append /invite if missing to url_base 2021-08-26 18:53:22 +01:00
Harvey Tindall
9693ce3dcd settings: add redundant URL base for pwr
having it under "Invite Emails" when they weren't in use was confusing.
If only one is set in the config file, it'll be used for both.
2021-07-27 16:53:16 +01:00
Harvey Tindall
9885c25a2e email: cleanup; allow re-enabling of custom email without changes 2021-07-24 19:49:08 +01:00
Harvey Tindall
f763cfb53a announcements: fix [] on {{ .username }} 2021-07-16 20:57:11 +01:00
Harvey Tindall
25a8d3807e announcements: {{ .username }} 2021-07-16 19:46:05 +01:00
Harvey Tindall
b10b558358 announcements: add {username}
also works in the subject.
2021-07-16 19:39:06 +01:00
Harvey Tindall
833d02b032 matrix: end-to-end encryption by default
Existing chats will remain unencrypted but new ones will be.
2021-07-13 19:02:16 +01:00
Harvey Tindall
d4096d0062 pwr: trim suffix, not prefix for links 2021-06-24 14:24:08 +01:00
Harvey Tindall
6fb8f1ed7f Merge pull request #112 from hrfee/matrix
Matrix Integration
2021-05-31 21:12:57 +01:00
Harvey Tindall
561c461a18 PWR: TrimPrefix instead of Replace for PWR links 2021-05-30 00:07:18 +01:00