Commit Graph

54 Commits

Author SHA1 Message Date
Harvey Tindall e97b90d4d7
Matrix: Setup bot, add PIN verification
PIN is verified but not used currently. Works a little different than
the others, you input your matrix user ID and then the PIN is sent to
you. The bot doesn't support E2EE, so the bot being the first one to
message ensures the chat is unencrypted.
2021-05-29 17:43:11 +01:00
Harvey Tindall 7035a3fe9c
Tray: Add button to open logs 2021-05-25 20:16:42 +01:00
Harvey Tindall 62c29d55cc
Log output to TEMP/jfa-go.log when Tray enabled
-H=windowsgui completely disables Stdout/Stderr on Windows, so logging
is enabled.
2021-05-25 17:59:41 +01:00
Harvey Tindall 85536ff79e
expand CONTRIBUTING, print if tray enabled on startup 2021-05-24 15:58:43 +01:00
Harvey Tindall d928df7ab2
Discord: Start bot, add !start and pin validity check
The bot should be created by the admin and added to a discord server
mutual to the intended new user(s). On !start in the server,
communication is moved to DMs. Currently !start works, and validity of a
given PIN is checked although nothing it done with this yet.
2021-05-17 23:42:33 +01:00
Harvey Tindall a62648ee68
fix cross compilation in goreleaser/drone
Necessary for go-autostart to work on windows. Tray will be enabled by
default for x86_64 windows/linux binaries.
2021-05-16 21:01:31 +01:00
Harvey Tindall 5dee414596
add "autostart on login" option to tray 2021-05-16 17:40:03 +01:00
Harvey Tindall 8cf9b1f905
add basic tray functionality
enable with `make TRAY=on ...`. Cross compilation apparently should work
from linux to linux & windows.
2021-05-16 16:23:28 +01:00
Harvey Tindall 99875b9176
almost complete telegram user verification
When signing up, the user is given a pin code which they send to a
telegram bot. This provides user verification, but more importantly
allows the bot to message the user, as the Telegram API requires the
user to interact with the bot before it can do the opposite.

The bot should recognize the correct language, but a /lang command is
also provided to change it.

The verification process is pretty much functional but ui is still
broken, and it isn't properly integrated yet.
2021-05-07 01:08:12 +01:00
Harvey Tindall a2c344de83
add shorthand flag names
along with an ugly wrapper for the help message that merges the
descriptions for the short & long versions.
2021-04-24 23:54:56 +01:00
Harvey Tindall 3f8414c70a
use unix timestamp for inv created & usedBy
usedBy is still stored as a string in invites.json to cope with existing
invites with times stored formatted. knz/strtime requires cgo for
strptime, so it has been replaced with the native itchyny/timefmt-go.
2021-04-06 21:25:44 +01:00
Harvey Tindall ab3d5f3321
fix logging for expiry extension
also delete expiries for users that no longer exist.
2021-04-06 13:31:42 +01:00
Harvey Tindall e1d42c8a87
Update CONTRIBUTING.md, mb 0.3.3
One last missing field added for #76.
2021-04-05 16:34:47 +01:00
Harvey Tindall f53c852a4d
bump mb to v0.3.2
includes missing struct fields for user Policy, fixes #76.
2021-04-05 15:07:30 +01:00
Harvey Tindall 2a0edeb3c5
bump mediabrowser version, more consistent logs
uses descriptive errors added in mb v0.2.0. Also improved
the consistency of logs in api.go/main.go.
2021-04-02 22:13:04 +01:00
Harvey Tindall e16f05b130
use build constraints for embed, clean up makefile
internal-files/external-files and compile-debug are gone, the
environment variables INTERNAL=on/off and DEBUG=on/off replace them.
2021-04-01 14:22:11 +01:00
Harvey Tindall 9370913ace
add password reset link option
When enabled (in Settings > Password Resets), a magic link will be sent
instead of a PIN when the user tries reset their password. By doing
this the user doesn't have to keep the Jellyfin tab open to enter the
code.
2021-03-30 22:41:28 +01:00
Harvey Tindall 762dac2581
move mediabrowser to separate repo 2021-03-29 21:49:46 +01:00
Harvey Tindall eb8f2777ae
fix naming conflict with goreleaser, add buildrone key to other steps 2021-03-07 15:54:32 +00:00
Harvey Tindall 92332206f0
add basic update functionality
If enabled, jfa-go pings buildrone (hosted at builds.hrfee.pw) every 30
min for new updates. If there is one, it gets information (and if
applicable, a binary) from the appropriate source (buildrone, github, or
dockerhub) and displays it on the admin page. You can switch update
channels between stable and unstable. For binary releases, updates are
downloaded automatically and installed when the user presses update.

Since this obviously introduces some "phone-home" functionality into
jfa-go, I just want to say IPs are not and will not be logged by
buildrone, although I may later introduce functionality to give a rough
idea of the number of users (again, no IPs stored). The whole thing can
also be turned off in settings.
2021-03-07 15:23:44 +00:00
Harvey Tindall 40fc5e9604
Fix email editor when plaintext setting enabled 2021-02-22 16:40:37 +00:00
Harvey Tindall 5c87d109a3
use descriptive variable names in email translations
in preparation for an email editor.
2021-02-19 17:50:50 +00:00
Harvey Tindall 78157f763f
use different color library, wrap logger functions with it 2021-02-19 16:12:14 +00:00
Harvey Tindall 93b5b483cc
add plaintext email option, use text/template
text/template is used on plaintext emails to avoid escaping of certain
characters.
2021-02-18 18:26:23 +00:00
Harvey Tindall fa433c88a8
add announcement emails
After selecting users in the accounts tab, you can press 'Announce',
then write a subject and message (with markdown), and an email will be
sent to each selected user.
2021-02-18 14:58:53 +00:00
Harvey Tindall 8dd72c95ab
switch image for drone builds 2021-02-17 11:19:51 +00:00
Harvey Tindall f794322392
Merge branch 'go1.16'
merge go1.16 changes

This includes embedded files for releases (no extra 'data' directory!)
and support for a custom language file directory, allowing one to
customize the text accross the app.
2021-02-17 11:15:21 +00:00
Harvey Tindall ba7370171a
lowercase lang, go mod tidy 2021-02-16 14:31:31 +00:00
Harvey Tindall a6a7710a79
use filepath.Join wrapper for different embed and os path styles
If using internal, "/" is used as a separator always, and with external,
filepath.Join is used.
2021-02-12 14:59:35 +00:00
Harvey Tindall 815bdc35ac
fully self-contained
paths are pretty janky, but it works. Also, [files]/lang_files now must
be the path to a directory CONTAINING a "lang/" directory. I'll work
around this at a later date.
2021-02-12 14:28:09 +00:00
Harvey Tindall 0330540f87
Use fs for language, add lang_files option
The local app translations are loaded, and then if [files]/lang_files
is provided (a directory containing custom translations), any found
inside it are loaded over top. This makes customizing much easier.
2021-02-12 14:28:09 +00:00
Harvey Tindall fefe2d82a4
rebase 12/02, use go1.16rc1 in make, remove ioutil, start switching to io/fs for file i/o
ioutil's contents are now in io and os.
Eventually jfa-go's files will be embedded in the binary with go1.16's
new embed feature. Using io/fs will provide abstraction for accessing
these files, and allow for both embedded and non-embedded versions.
Also, internal paths to things like email templates, etc. will be
prefixed with "jfa-go:" to indicate to use the app's own Filesystem
instead of reading the file normally. This also allows for custom files
to continue to be used as they are currently.
2021-02-12 14:27:01 +00:00
Harvey Tindall c2e68bdc77
add GOESBUILD option for platform without esbuild on npm 2021-02-11 18:21:21 +00:00
Harvey Tindall 406fef6595
bundle typescript 2021-01-23 19:08:27 +00:00
Harvey Tindall d9e1e2f58b compiles, basic issues fixed
Server type is found under the Jellyfin settings tab, where you can
change it to emby. Currently:

* logs in
* creates users
* parses accounts
2021-01-10 16:10:03 +00:00
Harvey Tindall eb370d64df
Merge a17t-redesign, kinda ts-ify setup.js
the web ui has been redesigned with the a17t toolkit, which imo looks a
lot better than bootstrap. This also brought a complete rework of the
web code, which now makes a lot more sense hopefully. the setup page is
still stuck with bootstrap, its not much of a priority but i'll rewrite
it eventually.
2021-01-05 18:16:23 +00:00
Harvey Tindall c79f86137e
separate head into template, add description meta tag 2020-12-07 22:46:17 +00:00
Harvey Tindall e35d0579c8
package upgrades 2020-11-15 17:20:19 +00:00
Harvey Tindall fa96f21429
Fix smtp sending
there were a bunch of problems, namely using the jfa-go host address
instead of that of the smtp server in smtp.PlainAuth. For #15.
2020-11-14 15:33:25 +00:00
Harvey Tindall ba601935b5
add "re-enter password" field on form
for #14.
2020-11-04 20:46:06 +00:00
Harvey Tindall 9d62b70daa
Fix esbuild and snapshot versioning in goreleaser
snapshots are now "jfa-go_git-<commit>..." instead of
"jfa-go_v0.0.0...".
2020-10-22 17:57:05 +01:00
Harvey Tindall 9abb177427
use typescript for form.html in separate file, allow customization of
requirement strings

Password requirement text is now loaded by the typescript, and can be
customized by changing the validationStrings variable. See wiki for more
info.
2020-10-20 23:00:30 +01:00
Harvey Tindall 8e6cf799cd
use npx to avoid looking for node_modules, get rid of useless
get_node_deps

makefile works without interaction by default now.
2020-10-18 00:57:53 +01:00
Harvey Tindall a12678bd4d
upload tar.gz instead of zip 2020-10-08 21:37:44 +01:00
Harvey Tindall 04a4a4ca95
use esbuild to compile and minify ts
tsc is still used for ts-debug.
2020-09-29 20:35:06 +01:00
Harvey Tindall 64ad8ccf6e
Fix docker build; add some color 2020-09-24 21:59:08 +01:00
Harvey Tindall b6537cef65
Add basic swagger documentation
accessible by running with -swagger. Accessible at /swagger/index.html.
Currently doesn't have authentication setup, so no requests will work.
2020-09-24 17:51:13 +01:00
Harvey Tindall dd0eabf157
Upgrade packages 2020-08-16 14:33:10 +01:00
Harvey Tindall 8ed1662a2f
add pprof middleware 2020-08-03 00:13:09 +01:00
Harvey Tindall a38d56f362 add smtp email 2020-08-02 17:20:50 +01:00