diff --git a/.gitignore b/.gitignore index 5dd8f9c..0d27c2f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ data/config-base.json data/config-default.ini data/*.html data/*.txt +dist/* diff --git a/.goreleaser.yml b/.goreleaser.yml index ac02b94..066f0fd 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,35 +1,45 @@ # This is an example goreleaser.yaml file with some sane defaults. # Make sure to check the documentation at http://goreleaser.com +project_name: jfa-go +release: + github: + owner: hrfee + name: jfa-go + name_template: "v{{.Version}} {{.Env.USER}}" before: hooks: # You may remove this if you don't use go modules. - go mod download - - python3 fixconfig/fixconfig.py -i fixconfig/config-base.json -o data/config-base.json - - python3 fixconfig/generate_ini.py -i fixconfig/config-base.json -o data/config-default.ini + - python3 config/fixconfig.py -i config/config-base.json -o data/config-base.json + - python3 config/generate_ini.py -i config/config-base.json -o data/config-default.ini + - python3 -m pip install libsass - python3 scss/get_node_deps.py - python3 scss/compile.py - python3 mail/generate.py builds: -- env: - - CGO_ENABLED=0 - goos: - - linux - - windows - - darwin + - dir: ./ + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin archives: -- replacements: - darwin: Darwin - linux: Linux - windows: Windows - 386: i386 - amd64: x86_64 + - replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 + files: + - data/* checksum: - name_template: 'checksums.txt' + name_template: 'checksums.txt' snapshot: - name_template: "{{ .Tag }}-next" + name_template: "{{ .Tag }}-next" changelog: - sort: asc - filters: - exclude: - - '^docs:' - - '^test:' + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' diff --git a/data/config-default.ini b/data/config-default.ini deleted file mode 100644 index 6c0d5dd..0000000 --- a/data/config-default.ini +++ /dev/null @@ -1,134 +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.3.7 -device = jf-accounts -device_id = jf-accounts-0.3.7 - -[ui] -; settings related to the ui and program functionality. -; default appearance for all users. -theme = Jellyfin (Dark) -; 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 -; address to send notifications to (leave blank if using jellyfin_login) -email = example@example.com -debug = false -; displayed at bottom of all pages except admin -contact_message = Need help? contact me. -; displayed 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. -; use bootstrap 5 (currently in alpha). this also removes the need for jquery, so the page should load faster. -bs5 = false - -[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 - -[notifications] -; notification related settings. -; enabling adds optional toggles to invites to notify on expiry and user creation. -enabled = true -; path to expiry notification email html. -expiry_html = -; path to expiry notification email in plaintext. -expiry_text = -; path to user creation notification email html. -created_html = -; path to user creation notification email in plaintext. -created_text = - -[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 = - diff --git a/data/created.html b/data/created.html deleted file mode 100644 index ab0b216..0000000 --- a/data/created.html +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- -
- - - - -
-
jellyfin-accounts
-
-
- -
-
- -
- - - - - - -
- -
- - - - - - - -
-
-

User Created

-

A user was created using code {{ .code }}.

-
-
- - - - - - - - - - -
NameAddressTime
{{ .username }}{{ .address }}{{ .time }}
-
-
- -
-
- -
- - - - - - -
- -
- - - - -
-
Notification emails can be toggled on the admin dashboard.
-
-
- -
-
- -
- - - diff --git a/data/email.html b/data/email.html deleted file mode 100644 index 10f9e68..0000000 --- a/data/email.html +++ /dev/null @@ -1,243 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- -
- - - - -
-
Jellyfin
-
-
- -
-
- -
- - - - - - -
- -
- - - - - - - -
-
-

Hi {{ .username }},

-

Someone has recently requested a password reset on Jellyfin.

-

If this was you, enter the below pin into the prompt.

-

The code will expire on {{ .expiry_date }}, at {{ .expiry_time }} UTC, which is in {{ .expires_in }}.

-

If this wasn't you, please ignore this email.

-
-
- - - - -
-

- {{ .pin }} -

-
-
-
- -
-
- -
- - - - - - -
- -
- - - - -
-
{{ .message }}
-
-
- -
-
- -
- - - diff --git a/data/expired.html b/data/expired.html deleted file mode 100644 index 2f76c54..0000000 --- a/data/expired.html +++ /dev/null @@ -1,227 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- -
- - - - -
-
jellyfin-accounts
-
-
- -
-
- -
- - - - - - -
- -
- - - - -
-
-

Invite Expired.

-

Code {{ .code }} expired at {{ .expiry }}.

-
-
-
- -
-
- -
- - - - - - -
- -
- - - - -
-
Notification emails can be toggled on the admin dashboard.
-
-
- -
-
- -
- - - diff --git a/data/invite-email.html b/data/invite-email.html deleted file mode 100644 index 49f98b7..0000000 --- a/data/invite-email.html +++ /dev/null @@ -1,240 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- -
- - - - -
-
Jellyfin
-
-
- -
-
- -
- - - - - - -
- -
- - - - - - - -
-
-

Hi,

-

You've been invited to Jellyfin.

-

To join, click the button below.

-

This invite will expire on {{ .expiry_date }}, at {{ .expiry_time }}, which is in {{ .expires_in }}, so act quick.

-
-
- - - - -
- Setup your account -
-
-
- -
-
- -
- - - - - - -
- -
- - - - -
-
{{ .message }}
-
-
- -
-
- -
- - - diff --git a/jfa-go b/jfa-go deleted file mode 100755 index 1920e88..0000000 Binary files a/jfa-go and /dev/null differ diff --git a/main.go b/main.go index f098199..1d0ab1f 100644 --- a/main.go +++ b/main.go @@ -104,7 +104,6 @@ func main() { port := flag.Int("port", 0, "alternate port to host web ui on.") flag.Parse() - fmt.Println(*dataPath, *configPath, *host, *port) if ctx.config_path == *configPath && ctx.data_path != *dataPath { ctx.config_path = filepath.Join(*dataPath, "config.ini") } else {