jellyfin-accounts/README.md

93 lines
4.8 KiB
Markdown
Raw Normal View History

2020-06-16 21:36:57 +02:00
# ![jellyfin-accounts](https://raw.githubusercontent.com/hrfee/jellyfin-accounts/master/images/jellyfin-accounts-banner-wide.svg)
2020-04-12 22:25:27 +02:00
**This branch uses the bootstrap 5 alpha, which works well enough for the most part, but can sometimes be a bit glitchy. Also no more jquery.**
2020-04-12 22:25:27 +02:00
A basic account management system for [Jellyfin](https://github.com/jellyfin/jellyfin).
* Provides a web interface for creating invite codes, and a simple account creation form
2020-04-12 22:25:27 +02:00
* Sends out emails when a user requests a password reset
2020-04-11 16:20:25 +02:00
* Uses a basic python jellyfin API client for communication with the server.
* Uses [Flask](https://github.com/pallets/flask), [HTTPAuth](https://github.com/miguelgrinberg/Flask-HTTPAuth), [itsdangerous](https://github.com/pallets/itsdangerous), and [Waitress](https://github.com/Pylons/waitress)
* Frontend uses [Bootstrap 5](https://v5.getbootstrap.com)
2020-04-12 22:25:27 +02:00
* Password resets are handled using smtplib, requests, and [jinja](https://github.com/pallets/jinja)
2020-04-17 19:24:07 +02:00
## Interface
2020-04-11 16:20:25 +02:00
<p align="center">
2020-06-16 21:36:57 +02:00
<img src="https://raw.githubusercontent.com/hrfee/jellyfin-accounts/master/images/jfa.gif" width="100%"></img>
2020-04-11 16:20:25 +02:00
</p>
2020-04-17 19:24:07 +02:00
<p align="center">
<img src="https://raw.githubusercontent.com/hrfee/jellyfin-accounts/master/images/admin.png" width="48%" style="margin-right: 1.5%;" alt="Admin page"></img>
2020-06-16 21:36:57 +02:00
<img src="https://raw.githubusercontent.com/hrfee/jellyfin-accounts/master/images/create.png" width="48%" style="margin-left: 1.5%;" alt="Account creation page"></img>
2020-04-17 19:24:07 +02:00
</p>
## Get it
### Requirements
2020-04-12 22:25:27 +02:00
2020-04-13 16:05:37 +02:00
* This should work anywhere Python does, i've tried to not use anything OS-specific. Drop an issue if there's a problem, of course.
2020-04-12 22:25:27 +02:00
```
* python >= 3.6
* flask
* flask_httpauth
2020-04-12 22:25:27 +02:00
* jinja2
* requests
* itsdangerous
* passlib
2020-04-13 15:26:40 +02:00
* pyOpenSSL
* waitress
2020-04-12 22:25:27 +02:00
* pytz
2020-04-13 16:16:48 +02:00
* python-dateutil
2020-04-12 22:25:27 +02:00
* watchdog
* packaging
2020-04-12 22:25:27 +02:00
```
### Install
2020-04-13 16:05:37 +02:00
Usually as simple as:
2020-04-11 16:20:25 +02:00
```
pip install jellyfin-accounts
2020-04-11 16:20:25 +02:00
```
If not, or if you want to use docker, see [install](https://github.com/hrfee/jellyfin-accounts/wiki/Install).
2020-04-11 16:20:25 +02:00
2020-06-29 14:03:09 +02:00
## Usage
2020-04-11 16:20:25 +02:00
* Passing no arguments will run the server
```
usage: jf-accounts [-h] [-c CONFIG] [-d DATA] [--host HOST] [-p PORT] [-g]
jellyfin-accounts
optional arguments:
-h, --help show this help message and exit
-c CONFIG, --config CONFIG
specifies path to configuration file.
-d DATA, --data DATA specifies directory to store data in. defaults to
~/.jf-accounts.
--host HOST address to host web ui on.
-p PORT, --port PORT port to host web ui on.
-g, --get_defaults tool to grab a JF users policy (access, perms, etc.)
and homescreen layout and output it as json to be used
as a user template.
2020-04-11 16:20:25 +02:00
```
2020-06-29 14:03:09 +02:00
## Setup
#### New user template
* You may want to restrict a user from accessing certain libraries (e.g 4K Movies), display their account on the login screen by default, or set a default homecrseen layout. Jellyfin stores these settings in the user's policy, configuration and displayPreferences.
* Make a temporary account and configure it, then in the web UI, go into "Settings => Set new account defaults". Choose the account, and its configuration will be stored for future use.
2020-04-12 22:25:27 +02:00
#### Emails/Password Resets
* When someone initiates forget password on Jellyfin, a file named `passwordreset*.json` is created in its configuration directory. This directory is monitored and when created, the program reads the username, expiry time and PIN, puts it into a template and sends it to whatever address is specified in `emails.json`.
* **The default forget password popup references the `passwordreset*.json` file created. This is confusing for users, so a quick fix is to edit the `MessageForgotPasswordFileCreated` string in Jellyfin's language folder.**
* Currently, jellyfin-accounts supports generic SSL/TLS or STARTTLS secured SMTP, and the [mailgun](https://mailgun.com) REST API.
* Email html is created using [mjml](https://mjml.io), and [jinja](https://github.com/pallets/jinja) templating is used. If you wish to create your own, ensure you use the same jinja expressions (`{{ pin }}`, etc.) as used in `data/email.mjml` or `invite-email.mjml`, and also create plain text versions for legacy email clients.
2020-04-11 16:20:25 +02:00
2020-06-29 14:03:09 +02:00
### Configuration
2020-04-11 16:21:57 +02:00
* Note: Make sure to put this behind a reverse proxy with HTTPS.
On first run, access the setup wizard at `0.0.0.0:8056`. When finished, restart the program.
The configuration is stored at `~/.jf-accounts/config.ini`. Settings can be changed through the web UI, or by manually editing the file.
2020-04-13 16:05:37 +02:00
For detailed descriptions of each setting, see [setup](https://github.com/hrfee/jellyfin-accounts/wiki/Setup).
### Donations
I strongly suggest you send your money to [Jellyfin](https://opencollective.com/jellyfin) or a good charity, but for those who want to help me out, a Paypal link is below.
[Donate](https://www.paypal.me/hrfee)