Commit Graph

107 Commits

Author SHA1 Message Date
Harvey Tindall 9944cc2db9
refactor; move logger to module 2021-05-01 00:13:57 +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 886ae64feb
add "systemd" command to generate a .service file
never got around to adding this from jellyfin-accounts for some reason.
2021-04-24 18:54:31 +01:00
Harvey Tindall 47ac505cac
shutdown your background workers!
I believe everything #74 was caused by not shutting down the userDaemon
when we do a pseudo-restart. shutdown of it and the invite daemon are
now deferred so this should fix any problems and reduce log spam.
2021-04-06 18:12:06 +01:00
Harvey Tindall 78049d4a33
hyphenate/dehyphenate users.json if necessary
doubt this would have caused problems anyway but why not.
2021-04-06 15:46:28 +01:00
Harvey Tindall 76b822213e
add more error logging; mutex for app.storage.users 2021-04-06 13:44:52 +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 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 1cf8d3037b
remove dependency on common from mediabrowser 2021-03-29 20:57:13 +01:00
Harvey Tindall f0dccc58aa
separate pprof from debug mode
enabled with -pprof now.
2021-03-23 21:59:04 +00:00
Harvey Tindall 1a6d78352c
add comments, fix user expiry log spam
now actually removes the already deleted user from the expiry list.
2021-03-21 22:50:33 +00:00
Harvey Tindall de92516d52
add updates section to setup 2021-03-20 18:00:01 +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 1e9d184508
implement user expiry functionality
All works now, but i'll add a field on the accounts tab for users with
an expiry, as well as a 'disabled' badge.
2021-02-28 15:41:06 +00:00
Harvey Tindall b3fa667db1
version with ldflags instead of script 2021-02-22 01:23:42 +00:00
Harvey Tindall 78157f763f
use different color library, wrap logger functions with it 2021-02-19 16:12:14 +00:00
Harvey Tindall 76fa171575
cleanup logs and use structs in jf/emby api
Also means times are directly parsed when pulling data from jf/emby,
which was *painful* to get working (something broke the whole program and it
took me an hour to figure out it was this lol). Time parsing should be a
lot stabler too.
2021-02-19 00:47:01 +00:00
Harvey Tindall adbb5b9d38
Fix filepath separator and external files on windows
For some reason, '/' is used instead of '\' on windows when loading
lang. FSJoin will now use whatever already exists in the path.
app.GetPath now creates a DirFS from the containing directory instead of
app.systemFS, which fixes loading on windows.
2021-02-18 12:58:30 +00:00
Harvey Tindall ea99966057
refactor, move route loading to router.go 2021-02-12 14:59:16 +00:00
Harvey Tindall aaed272bf2
use embed.fs wrapper on data 2021-02-12 14:35:16 +00:00
Harvey Tindall e6775cd2d1
use embed.fs wrapper for langFS so lang/ is not needed in paths
[files]lang_files is now the path to the lang directory, not path to a
directory containing it.
2021-02-12 14:35:16 +00:00
Harvey Tindall 72cf3e2240
add external/internal data options
"make all" will build with internal data, whereas "make debug"/"make
all-external" will make an external "data/" directory.
2021-02-12 14:32:48 +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 4c653fea36
fix url base on invite and broken getLanguages 2021-02-12 12:52:08 +00:00
Harvey Tindall f72def0399
serve on / and URL base for easy proxying 2021-02-11 23:06:51 +00:00
Harvey Tindall d061721f56
explicitly set js mimetype 2021-02-08 15:25:02 +00:00
Harvey Tindall b037b08152
respect URL Base in http preloads and inline html links 2021-02-05 13:10:47 +00:00
Harvey Tindall 90c6cee780
add restart button 2021-01-31 19:01:20 +00:00
Harvey Tindall 8c871bc5fa
Add ts to link setting dependance
Also make store each setting as classes in a settings object, to make it
easier to serialize on submitting. Also, added
"substitute_jellyfin_strings", "no_username" and welcome_email.
2021-01-26 22:57:29 +00:00
Harvey Tindall bf1e6230dc
split some strings into common file; use lang file to setup page 2021-01-25 21:26:54 +00:00
Harvey Tindall cd2ea2e579
reload email after lang is loaded
fixes #37.
2021-01-21 18:57:32 +00:00
Harvey Tindall e834445b0b
Restructure language loading to support incomplete translations
On startup, files are scanned and any missing values are replaced with
the english version.
2021-01-19 00:29:29 +00:00
Harvey Tindall 772e12d11c
add optional tls/http2 support
Allows for http2 server push, see the advanced section.
2021-01-15 14:43:32 +00:00
Harvey Tindall bc99dc34ee
Add email translation, add part of french translations
Admin translation from @Killianbe, Email translation from
@Cornichon420. French is currently not functional, a few things are
missing which i'm waiting on.
2021-01-15 14:43:32 +00:00
Harvey Tindall 4679c6f355
add language selector to admin 2021-01-15 14:43:32 +00:00
Harvey Tindall c470e40737
Start adding translation support for admin 2021-01-15 14:43:31 +00:00
Harvey Tindall 3fbbc7f620
add language selector to form 2021-01-11 19:17:43 +00:00
Harvey Tindall e532000ad0 Mention emby in README, add notices about password resets 2021-01-10 16:10:03 +00:00
Harvey Tindall 8d0dc232d7 option to substitute "Jellyfin" in form.html
setting is jellyfin/substitute_jellyfin_strings.
2021-01-10 16:10:03 +00:00
Harvey Tindall f5602f1e96 change settings description and console warning 2021-01-10 16:10:03 +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 5d56ed5378 fix most incompatibilites, start separating api clients 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 ee6f81b9e9
Add ability to revert to non-hyphenated user IDs
The first 10.7.0 build i tried used hyphens, but a later one didn't.
emails.json can now be converted between the two forms depending on what
the server uses.
2020-12-18 15:44:19 +00:00
Harvey Tindall 3c952d21f7
fix 10.7.0 compatibility, simplify scss
Hyphens are added to user IDs from 10.7.0, so if the server is running
it, emails.json will be modified to include them. The existing file is
backed up. Also, scss files have been simplified since bs4-jf and bs5-jf share
much of the same content.
2020-11-29 18:01:10 +00:00
Harvey Tindall 9dbf60e3df
add URL base option for subfolder proxies
also cleaned up the naming of some things.
2020-11-22 16:36:43 +00:00
Harvey Tindall d64e98da37
use Bearer auth instead of Basic
this was a relic from the python version, i'd modeled the auth code off
some random blog post back then.
2020-11-12 21:05:46 +00:00