mirror of
https://github.com/hrfee/jellyfin-accounts.git
synced 2025-12-08 11:39:33 +00:00
Remove config from readme, bump to 0.2.5
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
__version__ = "0.2.2"
|
||||
__version__ = "0.2.5"
|
||||
|
||||
import secrets
|
||||
import configparser
|
||||
@@ -56,7 +56,7 @@ if data_dir.exists() is False or (data_dir / "config.ini").exists() is False:
|
||||
from jellyfin_accounts.generate_ini import generate_ini
|
||||
|
||||
default_path = local_dir / "config-default.ini"
|
||||
generate_ini(config_base_path, default_path)
|
||||
generate_ini(config_base_path, default_path, __version__)
|
||||
shutil.copy(str(default_path), str(config_path))
|
||||
print("Setup through the web UI, or quit and edit the configuration manually.")
|
||||
first_run = True
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
"required": true,
|
||||
"requires_restart": true,
|
||||
"type": "text",
|
||||
"value": "0.2.4"
|
||||
"value": "{version}"
|
||||
},
|
||||
"device": {
|
||||
"name": "Device Name",
|
||||
@@ -62,7 +62,7 @@
|
||||
"required": true,
|
||||
"requires_restart": true,
|
||||
"type": "text",
|
||||
"value": "jf-accounts-0.2.4"
|
||||
"value": "jf-accounts-{version}"
|
||||
}
|
||||
},
|
||||
"ui": {
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
[jellyfin]
|
||||
; settings for connecting to jellyfin
|
||||
; it is recommended to create a limited admin account for this program.
|
||||
username = username
|
||||
password = password
|
||||
; jellyfin server address. can be public, or local for security purposes.
|
||||
server = http://jellyfin.local:8096
|
||||
; publicly accessible jellyfin address for invite form. leave blank to reuse the above address.
|
||||
public_server = https://jellyf.in:443
|
||||
; this and below settings will show on the jellyfin dashboard when the program connects. you may as well leave them alone.
|
||||
client = jf-accounts
|
||||
version = 0.2.4
|
||||
device = jf-accounts
|
||||
device_id = jf-accounts-0.2.4
|
||||
|
||||
[ui]
|
||||
; settings related to the ui and program functionality.
|
||||
; set 0.0.0.0 to run on localhost
|
||||
host = 0.0.0.0
|
||||
port = 8056
|
||||
; enable this to use jellyfin users instead of the below username and pw.
|
||||
jellyfin_login = true
|
||||
; allows only admin users on jellyfin to access the admin page.
|
||||
admin_only = true
|
||||
; username for admin page (leave blank if using jellyfin_login)
|
||||
username = your username
|
||||
; password for admin page (leave blank if using jellyfin_login)
|
||||
password = your password
|
||||
debug = false
|
||||
; displayed at bottom of all pages except admin
|
||||
contact_message = Need help? contact me.
|
||||
; display at top of invite form.
|
||||
help_message = Enter your details to create an account.
|
||||
; displayed when a user creates an account
|
||||
success_message = Your account has been created. Click below to continue to Jellyfin.
|
||||
|
||||
[password_validation]
|
||||
; password validation (minimum length, etc.)
|
||||
enabled = true
|
||||
min_length = 8
|
||||
upper = 1
|
||||
lower = 0
|
||||
number = 1
|
||||
special = 0
|
||||
|
||||
[email]
|
||||
; general email settings. ignore if not using email features.
|
||||
; use email address from invite form as username on jellyfin.
|
||||
no_username = false
|
||||
use_24h = true
|
||||
; date format used in emails. follows datetime.strftime format.
|
||||
date_format = %d/%m/%y
|
||||
; message displayed at bottom of emails.
|
||||
message = Need help? contact me.
|
||||
; method of sending email to use.
|
||||
method = smtp
|
||||
; address to send emails from
|
||||
address = jellyfin@jellyf.in
|
||||
; the name of the sender
|
||||
from = Jellyfin
|
||||
|
||||
[password_resets]
|
||||
; settings for the password reset handler.
|
||||
; enable to store provided email addresses, monitor jellyfin directory for pw-resets, and send reset pins
|
||||
enabled = true
|
||||
; path to the folder jellyfin puts password-reset files.
|
||||
watch_directory = /path/to/jellyfin
|
||||
; path to custom email html
|
||||
email_html =
|
||||
; path to custom email in plain text
|
||||
email_text =
|
||||
; subject of password reset emails.
|
||||
subject = Password Reset - Jellyfin
|
||||
|
||||
[invite_emails]
|
||||
; settings for sending invites directly to users.
|
||||
enabled = true
|
||||
; path to custom email html
|
||||
email_html =
|
||||
; path to custom email in plain text
|
||||
email_text =
|
||||
; subject of invite emails.
|
||||
subject = Invite - Jellyfin
|
||||
; base url for jf-accounts. this is necessary because using a reverse proxy means the program has no way of knowing the url itself.
|
||||
url_base = http://accounts.jellyf.in:8056/invite
|
||||
|
||||
[mailgun]
|
||||
; mailgun api connection settings
|
||||
api_url = https://api.mailgun.net...
|
||||
api_key = your api key
|
||||
|
||||
[smtp]
|
||||
; smtp server connection settings.
|
||||
; your email provider should provide different ports for each encryption method. generally 465 for ssl_tls, 587 for starttls.
|
||||
encryption = starttls
|
||||
; smtp server address.
|
||||
server = smtp.jellyf.in
|
||||
port = 465
|
||||
password = smtp password
|
||||
|
||||
[files]
|
||||
; optional settings for changing storage locations.
|
||||
; location of stored invites (json).
|
||||
invites =
|
||||
; location of stored email addresses (json).
|
||||
emails =
|
||||
; location of stored user policy template (json).
|
||||
user_template =
|
||||
; location of stored user configuration template (used for setting homescreen layout) (json)
|
||||
user_configuration =
|
||||
; location of stored displaypreferences template (also used for homescreen layout) (json)
|
||||
user_displayprefs =
|
||||
; location of custom bootstrap css.
|
||||
custom_css =
|
||||
|
||||
@@ -3,7 +3,7 @@ import json
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def generate_ini(base_file, ini_file):
|
||||
def generate_ini(base_file, ini_file, version):
|
||||
"""
|
||||
Generates .ini file from config-base file.
|
||||
"""
|
||||
@@ -25,6 +25,11 @@ def generate_ini(base_file, ini_file):
|
||||
value = str(value)
|
||||
ini.set(section, entry, value)
|
||||
|
||||
ini["jellyfin"]["version"] = version
|
||||
ini["jellyfin"]["device_id"] = ini["jellyfin"]["device_id"].replace(
|
||||
"{version}", version
|
||||
)
|
||||
|
||||
with open(Path(ini_file), "w") as config_file:
|
||||
ini.write(config_file)
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user