diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index ea15e75..0000000 --- a/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -FROM golang:latest AS build - -COPY . /opt/build - -RUN apt update -y \ - && apt install build-essential python3-pip curl software-properties-common sed upx -y \ - && (curl -sL https://deb.nodesource.com/setup_14.x | bash -) \ - && apt install nodejs \ - && (cd /opt/build; make all; make compress) \ - && sed -i 's#id="pwrJfPath" placeholder="Folder"#id="pwrJfPath" value="/jf" disabled#g' /opt/build/build/data/templates/setup.html - -FROM golang:latest - -COPY --from=build /opt/build/build /opt/jfa-go - -EXPOSE 8056 - -CMD [ "/opt/jfa-go/jfa-go", "-data", "/data" ] - - diff --git a/LICENSE b/LICENSE deleted file mode 100644 index dc91e2a..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Harvey Tindall - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/Makefile b/Makefile deleted file mode 100644 index d126cfb..0000000 --- a/Makefile +++ /dev/null @@ -1,57 +0,0 @@ -configuration: - $(info Fixing config-base) - python3 config/fixconfig.py -i config/config-base.json -o data/config-base.json - $(info Generating config-default.ini) - python3 config/generate_ini.py -i config/config-base.json -o data/config-default.ini - -sass: - $(info Getting libsass) - python3 -m pip install libsass - $(info Getting node dependencies) - npm install - $(info Compiling sass) - python3 scss/compile.py - -email: - $(info Generating email html) - python3 mail/generate.py - -typescript: - $(info Compiling typescript) - npx esbuild ts/*.ts ts/modules/*.ts --outdir=data/static --minify - -rm -r data/static/ts - -rm -r data/static/typings - -rm data/static/*.map - -ts-debug: - -npx tsc -p ts/ --sourceMap - -rm -r data/static/ts - -rm -r data/static/typings - cp -r ts data/static/ - -swagger: - go get github.com/swaggo/swag/cmd/swag - swag init -g main.go - -version: - python3 version.py auto version.go - -compile: - $(info Downloading deps) - go mod download - $(info Building) - mkdir -p build - CGO_ENABLED=0 go build -o build/jfa-go *.go - -compress: - upx --lzma build/jfa-go - -copy: - $(info Copying data) - cp -r data build/ - -install: - cp -r build $(DESTDIR)/jfa-go - -all: configuration sass email version typescript swagger compile copy -debug: configuration sass email version ts-debug swagger compile copy diff --git a/README.md b/README.md index d52f9b6..43ade54 100644 --- a/README.md +++ b/README.md @@ -1,89 +1,11 @@ -# ![jfa-go](data/static/banner.svg) +This branch is for experimenting with [a17t](https://a17t.miles.land/) to possibly replace bootstrap in the future. Currently just working on the page structures, so none of this is actually usable in jfa-go yet. -jfa-go is a user management app for [Jellyfin](https://github.com/jellyfin/jellyfin) that provides invite-based account creation as well as other features that make one's instance much easier to manage. +#### currently done: +- [x] invites tab mockup (partially complete) +- [ ] accounts tab mockup +- [ ] settings tab mockup +- [ ] modals (may not use them at all, who knows) +- [ ] animations -I chose to rewrite the python [jellyfin-accounts](https://github.com/hrfee/jellyfin-accounts) in Go mainly as a learning experience, but also to slightly improve speeds and efficiency. - -#### Features -* 🧑 Invite based account creation: Sends invites to your friends or family, and let them choose their own username and password without relying on you. - * Send invites via a link and/or email - * Granular control over invites: Validity period as well as number of uses can be specified. - * Account profiles: Assign settings profiles to invites so new users have your predefined permissions, homescreen layout, etc. applied to their account on creation. - * Password validation: Ensure users choose a strong password. -* 🔗 Ombi Integration: Automatically creates Ombi accounts for new users using their email address and login details, and your own defined set of permissions. -* Account management: Apply settings to your users individually or en masse, and delete users, optionally sending them an email notification with a reason. -* 📨 Email storage: Add your existing users email addresses through the UI, and jfa-go will ask new users for them on account creation. - * Email addresses can optionally be used instead of usernames -* 🔑 Password resets: When user's forget their passwords and request a change in Jellyfin, jfa-go reads the PIN from the created file and sends it straight to the user via email. -* Notifications: Get notified when someone creates an account, or an invite expires. -* Authentication via Jellyfin: Instead of using separate credentials for jfa-go and Jellyfin, jfa-go can use it as the authentication provider. - * Enables the usage of jfa-go by multiple people -* 🌓 Customizable look - * Specify contact and help messages to appear in emails and pages - * Light and dark themes available - * Optionally provide custom CSS - -## Interface -

- -

- -

- Invites tab - Accounts tab -

- -#### Install - -Available on the AUR as [jfa-go](https://aur.archlinux.org/packages/jfa-go/) or [jfa-go-git](https://aur.archlinux.org/packages/jfa-go-git/). - -For other platforms, grab an archive from the release section for your platform (or nightly builds [here](https://builds.hrfee.pw/view/hrfee/jfa-go)), and extract `jfa-go` and `data` to the same directory. -* For linux users, you can place them inside `/opt/jfa-go` and then run -`sudo ln -s /opt/jfa-go/jfa-go /usr/bin/jfa-go` to place it in your PATH. - -Run the executable to start. - -For [docker](https://hub.docker.com/repository/docker/hrfee/jfa-go), run: -``` -docker create \ - --name "jfa-go" \ # Whatever you want to name it - -p 8056:8056 \ - -v /path/to/.config/jfa-go:/data \ # Path to wherever you want to store the config file and other data - -v /path/to/jellyfin:/jf \ # Path to jellyfin config directory - -v /etc/localtime:/etc/localtime:ro \ # Makes sure time is correct - hrfee/jfa-go # hrfee/jfa-go:unstable for latest build from git -``` - -#### Build from source -If you're using docker, a Dockerfile is provided that builds from source. - -Otherwise, full build instructions can be found [here](https://github.com/hrfee/jfa-go/wiki/Build). - -#### Usage -Simply run `jfa-go` to start the application. A setup wizard will start on `localhost:8056` (or your own specified address). Upon completion, refresh the page. - -Note: jfa-go does not run as a daemon by default. You'll need to figure this out yourself. - -``` -Usage of ./jfa-go: - -config string - alternate path to config file. (default "~/.config/jfa-go/config.ini") - -data string - alternate path to data directory. (default "~/.config/jfa-go") - -debug - Enables debug logging and exposes pprof. - -host string - alternate address to host web ui on. - -port int - alternate port to host web ui on. - -swagger - Enable swagger at /swagger/index.html -``` - -If you're switching from jellyfin-accounts, copy your existing `~/.jf-accounts` to: - -* `XDG_CONFIG_DIR/jfa-go` (usually ~/.config/jfa-go) on \*nix systems, -* `%AppData%/jfa-go` on Windows, -* `~/Library/Application Support/jfa-go` on macOS. - -(or specify config/data path with `-config/-data` respectively.) +#### screenshots +![invites](images/invites.png) diff --git a/api.go b/api.go deleted file mode 100644 index e01920f..0000000 --- a/api.go +++ /dev/null @@ -1,1264 +0,0 @@ -package main - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "path/filepath" - "strconv" - "strings" - "time" - - "github.com/gin-gonic/gin" - "github.com/knz/strtime" - "github.com/lithammer/shortuuid/v3" - "gopkg.in/ini.v1" -) - -func respond(code int, message string, gc *gin.Context) { - resp := stringResponse{} - if code == 200 || code == 204 { - resp.Response = message - } else { - resp.Error = message - } - gc.JSON(code, resp) - gc.Abort() -} - -func respondBool(code int, val bool, gc *gin.Context) { - resp := boolResponse{} - if !val { - resp.Error = true - } else { - resp.Success = true - } - gc.JSON(code, resp) - gc.Abort() -} - -func (app *appContext) loadStrftime() { - app.datePattern = app.config.Section("email").Key("date_format").String() - app.timePattern = `%H:%M` - if val, _ := app.config.Section("email").Key("use_24h").Bool(); !val { - app.timePattern = `%I:%M %p` - } - return -} - -func (app *appContext) prettyTime(dt time.Time) (date, time string) { - date, _ = strtime.Strftime(dt, app.datePattern) - time, _ = strtime.Strftime(dt, app.timePattern) - return -} - -func (app *appContext) formatDatetime(dt time.Time) string { - d, t := app.prettyTime(dt) - return d + " " + t -} - -// https://stackoverflow.com/questions/36530251/time-since-with-months-and-years/36531443#36531443 THANKS -func timeDiff(a, b time.Time) (year, month, day, hour, min, sec int) { - if a.Location() != b.Location() { - b = b.In(a.Location()) - } - if a.After(b) { - a, b = b, a - } - y1, M1, d1 := a.Date() - y2, M2, d2 := b.Date() - - h1, m1, s1 := a.Clock() - h2, m2, s2 := b.Clock() - - year = int(y2 - y1) - month = int(M2 - M1) - day = int(d2 - d1) - hour = int(h2 - h1) - min = int(m2 - m1) - sec = int(s2 - s1) - - // Normalize negative values - if sec < 0 { - sec += 60 - min-- - } - if min < 0 { - min += 60 - hour-- - } - if hour < 0 { - hour += 24 - day-- - } - if day < 0 { - // days in month: - t := time.Date(y1, M1, 32, 0, 0, 0, 0, time.UTC) - day += 32 - t.Day() - month-- - } - if month < 0 { - month += 12 - year-- - } - return -} - -func (app *appContext) checkInvites() { - currentTime := time.Now() - app.storage.loadInvites() - changed := false - for code, data := range app.storage.invites { - expiry := data.ValidTill - if !currentTime.After(expiry) { - continue - } - app.debug.Printf("Housekeeping: Deleting old invite %s", code) - notify := data.Notify - if app.config.Section("notifications").Key("enabled").MustBool(false) && len(notify) != 0 { - app.debug.Printf("%s: Expiry notification", code) - for address, settings := range notify { - if !settings["notify-expiry"] { - continue - } - go func() { - msg, err := app.email.constructExpiry(code, data, app) - if err != nil { - app.err.Printf("%s: Failed to construct expiry notification", code) - app.debug.Printf("Error: %s", err) - } else if err := app.email.send(address, msg); err != nil { - app.err.Printf("%s: Failed to send expiry notification", code) - app.debug.Printf("Error: %s", err) - } else { - app.info.Printf("Sent expiry notification to %s", address) - } - }() - } - } - changed = true - delete(app.storage.invites, code) - } - if changed { - app.storage.storeInvites() - } -} - -func (app *appContext) checkInvite(code string, used bool, username string) bool { - currentTime := time.Now() - app.storage.loadInvites() - changed := false - inv, match := app.storage.invites[code] - if !match { - return false - } - expiry := inv.ValidTill - if currentTime.After(expiry) { - app.debug.Printf("Housekeeping: Deleting old invite %s", code) - notify := inv.Notify - if app.config.Section("notifications").Key("enabled").MustBool(false) && len(notify) != 0 { - app.debug.Printf("%s: Expiry notification", code) - for address, settings := range notify { - if settings["notify-expiry"] { - go func() { - msg, err := app.email.constructExpiry(code, inv, app) - if err != nil { - app.err.Printf("%s: Failed to construct expiry notification", code) - app.debug.Printf("Error: %s", err) - } else if err := app.email.send(address, msg); err != nil { - app.err.Printf("%s: Failed to send expiry notification", code) - app.debug.Printf("Error: %s", err) - } else { - app.info.Printf("Sent expiry notification to %s", address) - } - }() - } - } - } - changed = true - match = false - delete(app.storage.invites, code) - } else if used { - changed = true - del := false - newInv := inv - if newInv.RemainingUses == 1 { - del = true - delete(app.storage.invites, code) - } else if newInv.RemainingUses != 0 { - // 0 means infinite i guess? - newInv.RemainingUses -= 1 - } - newInv.UsedBy = append(newInv.UsedBy, []string{username, app.formatDatetime(currentTime)}) - if !del { - app.storage.invites[code] = newInv - } - } - if changed { - app.storage.storeInvites() - } - return match -} - -func (app *appContext) getOmbiUser(jfID string) (map[string]interface{}, int, error) { - ombiUsers, code, err := app.ombi.GetUsers() - if err != nil || code != 200 { - return nil, code, err - } - jfUser, code, err := app.jf.UserByID(jfID, false) - if err != nil || code != 200 { - return nil, code, err - } - username := jfUser["Name"].(string) - email := "" - if e, ok := app.storage.emails[jfID]; ok { - email = e.(string) - } - for _, ombiUser := range ombiUsers { - ombiAddr := "" - if a, ok := ombiUser["emailAddress"]; ok && a != nil { - ombiAddr = a.(string) - } - if ombiUser["userName"].(string) == username || (ombiAddr == email && email != "") { - return ombiUser, code, err - } - } - return nil, 400, fmt.Errorf("Couldn't find user") -} - -// Routes from now on! - -// @Summary Creates a new Jellyfin user without an invite. -// @Produce json -// @Param newUserDTO body newUserDTO true "New user request object" -// @Success 200 -// @Router /users [post] -// @Security Bearer -// @tags Users -func (app *appContext) NewUserAdmin(gc *gin.Context) { - var req newUserDTO - gc.BindJSON(&req) - existingUser, _, _ := app.jf.UserByName(req.Username, false) - if existingUser != nil { - msg := fmt.Sprintf("User already exists named %s", req.Username) - app.info.Printf("%s New user failed: %s", req.Username, msg) - respond(401, msg, gc) - return - } - user, status, err := app.jf.NewUser(req.Username, req.Password) - if !(status == 200 || status == 204) || err != nil { - app.err.Printf("%s New user failed: Jellyfin responded with %d", req.Username, status) - respond(401, "Unknown error", gc) - return - } - var id string - if user["Id"] != nil { - id = user["Id"].(string) - } - if len(app.storage.policy) != 0 { - status, err = app.jf.SetPolicy(id, app.storage.policy) - if !(status == 200 || status == 204 || err == nil) { - app.err.Printf("%s: Failed to set user policy: Code %d", req.Username, status) - app.debug.Printf("%s: Error: %s", req.Username, err) - } - } - if len(app.storage.configuration) != 0 && len(app.storage.displayprefs) != 0 { - status, err = app.jf.SetConfiguration(id, app.storage.configuration) - if (status == 200 || status == 204) && err == nil { - status, err = app.jf.SetDisplayPreferences(id, app.storage.displayprefs) - } - if !((status == 200 || status == 204) && err == nil) { - app.err.Printf("%s: Failed to set configuration template: Code %d", req.Username, status) - } - } - if app.config.Section("password_resets").Key("enabled").MustBool(false) { - app.storage.emails[id] = req.Email - app.storage.storeEmails() - } - if app.config.Section("ombi").Key("enabled").MustBool(false) { - app.storage.loadOmbiTemplate() - if len(app.storage.ombi_template) != 0 { - errors, code, err := app.ombi.NewUser(req.Username, req.Password, req.Email, app.storage.ombi_template) - if err != nil || code != 200 { - app.info.Printf("Failed to create Ombi user (%d): %s", code, err) - app.debug.Printf("Errors reported by Ombi: %s", strings.Join(errors, ", ")) - } else { - app.info.Println("Created Ombi user") - } - } - } - app.jf.CacheExpiry = time.Now() -} - -// @Summary Creates a new Jellyfin user via invite code -// @Produce json -// @Param newUserDTO body newUserDTO true "New user request object" -// @Success 200 {object} PasswordValidation -// @Failure 400 {object} PasswordValidation -// @Router /newUser [post] -// @tags Users -func (app *appContext) NewUser(gc *gin.Context) { - var req newUserDTO - gc.BindJSON(&req) - app.debug.Printf("%s: New user attempt", req.Code) - if !app.checkInvite(req.Code, false, "") { - app.info.Printf("%s New user failed: invalid code", req.Code) - respondBool(401, false, gc) - return - } - validation := app.validator.validate(req.Password) - valid := true - for _, val := range validation { - if !val { - valid = false - } - } - if !valid { - // 200 bcs idk what i did in js - app.info.Printf("%s New user failed: Invalid password", req.Code) - gc.JSON(200, validation) - gc.Abort() - return - } - existingUser, _, _ := app.jf.UserByName(req.Username, false) - if existingUser != nil { - msg := fmt.Sprintf("User already exists named %s", req.Username) - app.info.Printf("%s New user failed: %s", req.Code, msg) - respond(401, msg, gc) - return - } - user, status, err := app.jf.NewUser(req.Username, req.Password) - if !(status == 200 || status == 204) || err != nil { - app.err.Printf("%s New user failed: Jellyfin responded with %d", req.Code, status) - respond(401, "Unknown error", gc) - return - } - app.storage.loadProfiles() - invite := app.storage.invites[req.Code] - app.checkInvite(req.Code, true, req.Username) - if app.config.Section("notifications").Key("enabled").MustBool(false) { - for address, settings := range invite.Notify { - if settings["notify-creation"] { - go func() { - msg, err := app.email.constructCreated(req.Code, req.Username, req.Email, invite, app) - if err != nil { - app.err.Printf("%s: Failed to construct user creation notification", req.Code) - app.debug.Printf("%s: Error: %s", req.Code, err) - } else if err := app.email.send(address, msg); err != nil { - app.err.Printf("%s: Failed to send user creation notification", req.Code) - app.debug.Printf("%s: Error: %s", req.Code, err) - } else { - app.info.Printf("%s: Sent user creation notification to %s", req.Code, address) - } - }() - } - } - } - var id string - if user["Id"] != nil { - id = user["Id"].(string) - } - if invite.Profile != "" { - app.debug.Printf("Applying settings from profile \"%s\"", invite.Profile) - profile, ok := app.storage.profiles[invite.Profile] - if !ok { - profile = app.storage.profiles["Default"] - } - if len(profile.Policy) != 0 { - app.debug.Printf("Applying policy from profile \"%s\"", invite.Profile) - status, err = app.jf.SetPolicy(id, profile.Policy) - if !((status == 200 || status == 204) && err == nil) { - app.err.Printf("%s: Failed to set user policy: Code %d", req.Code, status) - app.debug.Printf("%s: Error: %s", req.Code, err) - } - } - if len(profile.Configuration) != 0 && len(profile.Displayprefs) != 0 { - app.debug.Printf("Applying homescreen from profile \"%s\"", invite.Profile) - status, err = app.jf.SetConfiguration(id, profile.Configuration) - if (status == 200 || status == 204) && err == nil { - status, err = app.jf.SetDisplayPreferences(id, profile.Displayprefs) - } - if !((status == 200 || status == 204) && err == nil) { - app.err.Printf("%s: Failed to set configuration template: Code %d", req.Code, status) - app.debug.Printf("%s: Error: %s", req.Code, err) - } - } - } - // if app.config.Section("password_resets").Key("enabled").MustBool(false) { - if req.Email != "" { - app.storage.emails[id] = req.Email - app.storage.storeEmails() - } - if app.config.Section("ombi").Key("enabled").MustBool(false) { - app.storage.loadOmbiTemplate() - if len(app.storage.ombi_template) != 0 { - errors, code, err := app.ombi.NewUser(req.Username, req.Password, req.Email, app.storage.ombi_template) - if err != nil || code != 200 { - app.info.Printf("Failed to create Ombi user (%d): %s", code, err) - app.debug.Printf("Errors reported by Ombi: %s", strings.Join(errors, ", ")) - } else { - app.info.Println("Created Ombi user") - } - } - } - code := 200 - for _, val := range validation { - if !val { - code = 400 - } - } - gc.JSON(code, validation) -} - -// @Summary Delete a list of users, optionally notifying them why. -// @Produce json -// @Param deleteUserDTO body deleteUserDTO true "User deletion request object" -// @Success 200 {object} boolResponse -// @Failure 400 {object} stringResponse -// @Failure 500 {object} errorListDTO "List of errors" -// @Router /users [delete] -// @Security Bearer -// @tags Users -func (app *appContext) DeleteUser(gc *gin.Context) { - var req deleteUserDTO - gc.BindJSON(&req) - errors := map[string]string{} - ombiEnabled := app.config.Section("ombi").Key("enabled").MustBool(false) - for _, userID := range req.Users { - if ombiEnabled { - ombiUser, code, err := app.getOmbiUser(userID) - if code == 200 && err == nil { - if id, ok := ombiUser["id"]; ok { - status, err := app.ombi.DeleteUser(id.(string)) - if err != nil || status != 200 { - app.err.Printf("Failed to delete ombi user: %d %s", status, err) - errors[userID] = fmt.Sprintf("Ombi: %d %s, ", status, err) - } - } - } - } - status, err := app.jf.DeleteUser(userID) - if !(status == 200 || status == 204) || err != nil { - msg := fmt.Sprintf("%d: %s", status, err) - if _, ok := errors[userID]; !ok { - errors[userID] = msg - } else { - errors[userID] += msg - } - } - if req.Notify { - addr, ok := app.storage.emails[userID] - if addr != nil && ok { - go func(userID, reason, address string) { - msg, err := app.email.constructDeleted(reason, app) - if err != nil { - app.err.Printf("%s: Failed to construct account deletion email", userID) - app.debug.Printf("%s: Error: %s", userID, err) - } else if err := app.email.send(address, msg); err != nil { - app.err.Printf("%s: Failed to send to %s", userID, address) - app.debug.Printf("%s: Error: %s", userID, err) - } else { - app.info.Printf("%s: Sent invite email to %s", userID, address) - } - }(userID, req.Reason, addr.(string)) - } - } - } - app.jf.CacheExpiry = time.Now() - if len(errors) == len(req.Users) { - respondBool(500, false, gc) - app.err.Printf("Account deletion failed: %s", errors[req.Users[0]]) - return - } else if len(errors) != 0 { - gc.JSON(500, errors) - return - } - respondBool(200, true, gc) -} - -// @Summary Create a new invite. -// @Produce json -// @Param generateInviteDTO body generateInviteDTO true "New invite request object" -// @Success 200 {object} boolResponse -// @Router /invites [post] -// @Security Bearer -// @tags Invites -func (app *appContext) GenerateInvite(gc *gin.Context) { - var req generateInviteDTO - app.debug.Println("Generating new invite") - app.storage.loadInvites() - gc.BindJSON(&req) - currentTime := time.Now() - validTill := currentTime.AddDate(0, 0, req.Days) - validTill = validTill.Add(time.Hour*time.Duration(req.Hours) + time.Minute*time.Duration(req.Minutes)) - // make sure code doesn't begin with number - inviteCode := shortuuid.New() - _, err := strconv.Atoi(string(inviteCode[0])) - for err == nil { - inviteCode = shortuuid.New() - _, err = strconv.Atoi(string(inviteCode[0])) - } - var invite Invite - invite.Created = currentTime - if req.MultipleUses { - if req.NoLimit { - invite.NoLimit = true - } else { - invite.RemainingUses = req.RemainingUses - } - } else { - invite.RemainingUses = 1 - } - invite.ValidTill = validTill - if req.Email != "" && app.config.Section("invite_emails").Key("enabled").MustBool(false) { - app.debug.Printf("%s: Sending invite email", inviteCode) - invite.Email = req.Email - msg, err := app.email.constructInvite(inviteCode, invite, app) - if err != nil { - invite.Email = fmt.Sprintf("Failed to send to %s", req.Email) - app.err.Printf("%s: Failed to construct invite email", inviteCode) - app.debug.Printf("%s: Error: %s", inviteCode, err) - } else if err := app.email.send(req.Email, msg); err != nil { - invite.Email = fmt.Sprintf("Failed to send to %s", req.Email) - app.err.Printf("%s: %s", inviteCode, invite.Email) - app.debug.Printf("%s: Error: %s", inviteCode, err) - } else { - app.info.Printf("%s: Sent invite email to %s", inviteCode, req.Email) - } - } - if req.Profile != "" { - if _, ok := app.storage.profiles[req.Profile]; ok { - invite.Profile = req.Profile - } else { - invite.Profile = "Default" - } - } - app.storage.invites[inviteCode] = invite - app.storage.storeInvites() - respondBool(200, true, gc) -} - -// @Summary Set profile for an invite -// @Produce json -// @Param inviteProfileDTO body inviteProfileDTO true "Invite profile object" -// @Success 200 {object} boolResponse -// @Failure 500 {object} stringResponse -// @Router /invites/profile [post] -// @Security Bearer -// @tags Profiles & Settings -func (app *appContext) SetProfile(gc *gin.Context) { - var req inviteProfileDTO - gc.BindJSON(&req) - app.debug.Printf("%s: Setting profile to \"%s\"", req.Invite, req.Profile) - // "" means "Don't apply profile" - if _, ok := app.storage.profiles[req.Profile]; !ok && req.Profile != "" { - app.err.Printf("%s: Profile \"%s\" not found", req.Invite, req.Profile) - respond(500, "Profile not found", gc) - return - } - inv := app.storage.invites[req.Invite] - inv.Profile = req.Profile - app.storage.invites[req.Invite] = inv - app.storage.storeInvites() - respondBool(200, true, gc) -} - -// @Summary Get a list of profiles -// @Produce json -// @Success 200 {object} getProfilesDTO -// @Router /profiles [get] -// @Security Bearer -// @tags Profiles & Settings -func (app *appContext) GetProfiles(gc *gin.Context) { - app.storage.loadProfiles() - app.debug.Println("Profiles requested") - out := getProfilesDTO{ - DefaultProfile: app.storage.defaultProfile, - Profiles: map[string]profileDTO{}, - } - for name, p := range app.storage.profiles { - out.Profiles[name] = profileDTO{ - Admin: p.Admin, - LibraryAccess: p.LibraryAccess, - FromUser: p.FromUser, - } - } - gc.JSON(200, out) -} - -// @Summary Set the default profile to use. -// @Produce json -// @Param profileChangeDTO body profileChangeDTO true "Default profile object" -// @Success 200 {object} boolResponse -// @Failure 500 {object} stringResponse -// @Router /profiles/default [post] -// @Security Bearer -// @tags Profiles & Settings -func (app *appContext) SetDefaultProfile(gc *gin.Context) { - req := profileChangeDTO{} - gc.BindJSON(&req) - app.info.Printf("Setting default profile to \"%s\"", req.Name) - if _, ok := app.storage.profiles[req.Name]; !ok { - app.err.Printf("Profile not found: \"%s\"", req.Name) - respond(500, "Profile not found", gc) - return - } - for name, profile := range app.storage.profiles { - if name == req.Name { - profile.Admin = true - app.storage.profiles[name] = profile - } else { - profile.Admin = false - } - } - app.storage.defaultProfile = req.Name - respondBool(200, true, gc) -} - -// @Summary Create a profile based on a Jellyfin user's settings. -// @Produce json -// @Param newProfileDTO body newProfileDTO true "New profile object" -// @Success 200 {object} boolResponse -// @Failure 500 {object} stringResponse -// @Router /profiles [post] -// @Security Bearer -// @tags Profiles & Settings -func (app *appContext) CreateProfile(gc *gin.Context) { - app.info.Println("Profile creation requested") - var req newProfileDTO - gc.BindJSON(&req) - user, status, err := app.jf.UserByID(req.ID, false) - if !(status == 200 || status == 204) || err != nil { - app.err.Printf("Failed to get user from Jellyfin: Code %d", status) - app.debug.Printf("Error: %s", err) - respond(500, "Couldn't get user", gc) - return - } - profile := Profile{ - FromUser: user["Name"].(string), - Policy: user["Policy"].(map[string]interface{}), - } - app.debug.Printf("Creating profile from user \"%s\"", user["Name"].(string)) - if req.Homescreen { - profile.Configuration = user["Configuration"].(map[string]interface{}) - profile.Displayprefs, status, err = app.jf.GetDisplayPreferences(req.ID) - if !(status == 200 || status == 204) || err != nil { - app.err.Printf("Failed to get DisplayPrefs: Code %d", status) - app.debug.Printf("Error: %s", err) - respond(500, "Couldn't get displayprefs", gc) - return - } - } - app.storage.loadProfiles() - app.storage.profiles[req.Name] = profile - app.storage.storeProfiles() - app.storage.loadProfiles() - respondBool(200, true, gc) -} - -// @Summary Delete an existing profile -// @Produce json -// @Param profileChangeDTO body profileChangeDTO true "Delete profile object" -// @Success 200 {object} boolResponse -// @Router /profiles [delete] -// @Security Bearer -// @tags Profiles & Settings -func (app *appContext) DeleteProfile(gc *gin.Context) { - req := profileChangeDTO{} - gc.BindJSON(&req) - name := req.Name - if _, ok := app.storage.profiles[name]; ok { - delete(app.storage.profiles, name) - } - app.storage.storeProfiles() - respondBool(200, true, gc) -} - -// @Summary Get invites. -// @Produce json -// @Success 200 {object} getInvitesDTO -// @Router /invites [get] -// @Security Bearer -// @tags Invites -func (app *appContext) GetInvites(gc *gin.Context) { - app.debug.Println("Invites requested") - currentTime := time.Now() - app.storage.loadInvites() - app.checkInvites() - var invites []inviteDTO - for code, inv := range app.storage.invites { - _, _, days, hours, minutes, _ := timeDiff(inv.ValidTill, currentTime) - invite := inviteDTO{ - Code: code, - Days: days, - Hours: hours, - Minutes: minutes, - Created: app.formatDatetime(inv.Created), - Profile: inv.Profile, - NoLimit: inv.NoLimit, - } - if len(inv.UsedBy) != 0 { - invite.UsedBy = inv.UsedBy - } - invite.RemainingUses = 1 - if inv.RemainingUses != 0 { - invite.RemainingUses = inv.RemainingUses - } - if inv.Email != "" { - invite.Email = inv.Email - } - if len(inv.Notify) != 0 { - var address string - if app.config.Section("ui").Key("jellyfin_login").MustBool(false) { - app.storage.loadEmails() - if addr := app.storage.emails[gc.GetString("jfId")]; addr != nil { - address = addr.(string) - } - } else { - address = app.config.Section("ui").Key("email").String() - } - if _, ok := inv.Notify[address]; ok { - if _, ok = inv.Notify[address]["notify-expiry"]; ok { - invite.NotifyExpiry = inv.Notify[address]["notify-expiry"] - } - if _, ok = inv.Notify[address]["notify-creation"]; ok { - invite.NotifyCreation = inv.Notify[address]["notify-creation"] - } - } - } - invites = append(invites, invite) - } - profiles := make([]string, len(app.storage.profiles)) - if len(app.storage.profiles) != 0 { - profiles[0] = app.storage.defaultProfile - i := 1 - if len(app.storage.profiles) > 1 { - for p := range app.storage.profiles { - if p != app.storage.defaultProfile { - profiles[i] = p - i++ - } - } - } - } - resp := getInvitesDTO{ - Profiles: profiles, - Invites: invites, - } - gc.JSON(200, resp) -} - -// @Summary Set notification preferences for an invite. -// @Produce json -// @Param setNotifyDTO body setNotifyDTO true "Map of invite codes to notification settings objects" -// @Success 200 -// @Failure 400 {object} stringResponse -// @Failure 500 {object} stringResponse -// @Router /invites/notify [post] -// @Security Bearer -// @tags Other -func (app *appContext) SetNotify(gc *gin.Context) { - var req map[string]map[string]bool - gc.BindJSON(&req) - changed := false - for code, settings := range req { - app.debug.Printf("%s: Notification settings change requested", code) - app.storage.loadInvites() - app.storage.loadEmails() - invite, ok := app.storage.invites[code] - if !ok { - app.err.Printf("%s Notification setting change failed: Invalid code", code) - respond(400, "Invalid invite code", gc) - return - } - var address string - if app.config.Section("ui").Key("jellyfin_login").MustBool(false) { - var ok bool - address, ok = app.storage.emails[gc.GetString("jfId")].(string) - if !ok { - app.err.Printf("%s: Couldn't find email address. Make sure it's set", code) - app.debug.Printf("%s: User ID \"%s\"", code, gc.GetString("jfId")) - respond(500, "Missing user email", gc) - return - } - } else { - address = app.config.Section("ui").Key("email").String() - } - if invite.Notify == nil { - invite.Notify = map[string]map[string]bool{} - } - if _, ok := invite.Notify[address]; !ok { - invite.Notify[address] = map[string]bool{} - } /*else { - if _, ok := invite.Notify[address]["notify-expiry"]; !ok { - */ - if _, ok := settings["notify-expiry"]; ok && invite.Notify[address]["notify-expiry"] != settings["notify-expiry"] { - invite.Notify[address]["notify-expiry"] = settings["notify-expiry"] - app.debug.Printf("%s: Set \"notify-expiry\" to %t for %s", code, settings["notify-expiry"], address) - changed = true - } - if _, ok := settings["notify-creation"]; ok && invite.Notify[address]["notify-creation"] != settings["notify-creation"] { - invite.Notify[address]["notify-creation"] = settings["notify-creation"] - app.debug.Printf("%s: Set \"notify-creation\" to %t for %s", code, settings["notify-creation"], address) - changed = true - } - if changed { - app.storage.invites[code] = invite - } - } - if changed { - app.storage.storeInvites() - } -} - -// @Summary Delete an invite. -// @Produce json -// @Param deleteInviteDTO body deleteInviteDTO true "Delete invite object" -// @Success 200 {object} boolResponse -// @Failure 400 {object} stringResponse -// @Router /invites [delete] -// @Security Bearer -// @tags Invites -func (app *appContext) DeleteInvite(gc *gin.Context) { - var req deleteInviteDTO - gc.BindJSON(&req) - app.debug.Printf("%s: Deletion requested", req.Code) - var ok bool - _, ok = app.storage.invites[req.Code] - if ok { - delete(app.storage.invites, req.Code) - app.storage.storeInvites() - app.info.Printf("%s: Invite deleted", req.Code) - respondBool(200, true, gc) - return - } - app.err.Printf("%s: Deletion failed: Invalid code", req.Code) - respond(400, "Code doesn't exist", gc) -} - -type dateToParse struct { - Parsed time.Time `json:"parseme"` -} - -func parseDT(date string) time.Time { - // decent method - dt, err := time.Parse("2006-01-02T15:04:05.000000", date) - if err == nil { - return dt - } - // magic method - // some stored dates from jellyfin have no timezone at the end, if not we assume UTC - if date[len(date)-1] != 'Z' { - date += "Z" - } - timeJSON := []byte("{ \"parseme\": \"" + date + "\" }") - var parsed dateToParse - // Magically turn it into a time.Time - json.Unmarshal(timeJSON, &parsed) - return parsed.Parsed -} - -// @Summary Get a list of Jellyfin users. -// @Produce json -// @Success 200 {object} getUsersDTO -// @Failure 500 {object} stringResponse -// @Router /users [get] -// @Security Bearer -// @tags Users -func (app *appContext) GetUsers(gc *gin.Context) { - app.debug.Println("Users requested") - var resp getUsersDTO - resp.UserList = []respUser{} - users, status, err := app.jf.GetUsers(false) - if !(status == 200 || status == 204) || err != nil { - app.err.Printf("Failed to get users from Jellyfin: Code %d", status) - app.debug.Printf("Error: %s", err) - respond(500, "Couldn't get users", gc) - return - } - for _, jfUser := range users { - var user respUser - user.LastActive = "n/a" - if jfUser["LastActivityDate"] != nil { - date := parseDT(jfUser["LastActivityDate"].(string)) - user.LastActive = app.formatDatetime(date) - // fmt.Printf("%s: %s, %s, %+v\n", jfUser["Name"].(string), jfUser["LastActivityDate"].(string), user.LastActive, date) - } - user.ID = jfUser["Id"].(string) - user.Name = jfUser["Name"].(string) - user.Admin = jfUser["Policy"].(map[string]interface{})["IsAdministrator"].(bool) - if email, ok := app.storage.emails[jfUser["Id"].(string)]; ok { - user.Email = email.(string) - } - - resp.UserList = append(resp.UserList, user) - } - gc.JSON(200, resp) -} - -// @Summary Get a list of Ombi users. -// @Produce json -// @Success 200 {object} ombiUsersDTO -// @Failure 500 {object} stringResponse -// @Router /ombi/users [get] -// @Security Bearer -// @tags Ombi -func (app *appContext) OmbiUsers(gc *gin.Context) { - app.debug.Println("Ombi users requested") - users, status, err := app.ombi.GetUsers() - if err != nil || status != 200 { - app.err.Printf("Failed to get users from Ombi: Code %d", status) - app.debug.Printf("Error: %s", err) - respond(500, "Couldn't get users", gc) - return - } - userlist := make([]ombiUser, len(users)) - for i, data := range users { - userlist[i] = ombiUser{ - Name: data["userName"].(string), - ID: data["id"].(string), - } - } - gc.JSON(200, ombiUsersDTO{Users: userlist}) -} - -// @Summary Set new user defaults for Ombi accounts. -// @Produce json -// @Param ombiUser body ombiUser true "User to source settings from" -// @Success 200 {object} boolResponse -// @Failure 500 {object} stringResponse -// @Router /ombi/defaults [post] -// @Security Bearer -// @tags Ombi -func (app *appContext) SetOmbiDefaults(gc *gin.Context) { - var req ombiUser - gc.BindJSON(&req) - template, code, err := app.ombi.TemplateByID(req.ID) - if err != nil || code != 200 || len(template) == 0 { - app.err.Printf("Couldn't get user from Ombi: %d %s", code, err) - respond(500, "Couldn't get user", gc) - return - } - app.storage.ombi_template = template - app.storage.storeOmbiTemplate() - respondBool(200, true, gc) -} - -// @Summary Modify user's email addresses. -// @Produce json -// @Param modifyEmailsDTO body modifyEmailsDTO true "Map of userIDs to email addresses" -// @Success 200 {object} boolResponse -// @Failure 500 {object} stringResponse -// @Router /users/emails [post] -// @Security Bearer -// @tags Users -func (app *appContext) ModifyEmails(gc *gin.Context) { - var req modifyEmailsDTO - gc.BindJSON(&req) - app.debug.Println("Email modification requested") - users, status, err := app.jf.GetUsers(false) - if !(status == 200 || status == 204) || err != nil { - app.err.Printf("Failed to get users from Jellyfin: Code %d", status) - app.debug.Printf("Error: %s", err) - respond(500, "Couldn't get users", gc) - return - } - ombiEnabled := app.config.Section("ombi").Key("enabled").MustBool(false) - for _, jfUser := range users { - id := jfUser["Id"].(string) - if address, ok := req[id]; ok { - app.storage.emails[jfUser["Id"].(string)] = address - if ombiEnabled { - ombiUser, code, err := app.getOmbiUser(id) - if code == 200 && err == nil { - ombiUser["emailAddress"] = address - code, err = app.ombi.ModifyUser(ombiUser) - if code != 200 || err != nil { - app.err.Printf("%s: Failed to change ombi email address: %d %s", ombiUser["userName"].(string), code, err) - } - } - } - } - } - app.storage.storeEmails() - app.info.Println("Email list modified") - respondBool(200, true, gc) -} - -// @Summary Apply settings to a list of users, either from a profile or from another user. -// @Produce json -// @Param userSettingsDTO body userSettingsDTO true "Parameters for applying settings" -// @Success 200 {object} errorListDTO -// @Failure 500 {object} errorListDTO "Lists of errors that occurred while applying settings" -// @Router /users/settings [post] -// @Security Bearer -// @tags Profiles & Settings -func (app *appContext) ApplySettings(gc *gin.Context) { - app.info.Println("User settings change requested") - var req userSettingsDTO - gc.BindJSON(&req) - applyingFrom := "profile" - var policy, configuration, displayprefs map[string]interface{} - if req.From == "profile" { - app.storage.loadProfiles() - if _, ok := app.storage.profiles[req.Profile]; !ok || len(app.storage.profiles[req.Profile].Policy) == 0 { - app.err.Printf("Couldn't find profile \"%s\" or profile was empty", req.Profile) - respond(500, "Couldn't find profile", gc) - return - } - if req.Homescreen { - if len(app.storage.profiles[req.Profile].Configuration) == 0 || len(app.storage.profiles[req.Profile].Displayprefs) == 0 { - app.err.Printf("No homescreen saved in profile \"%s\"", req.Profile) - respond(500, "No homescreen template available", gc) - return - } - configuration = app.storage.profiles[req.Profile].Configuration - displayprefs = app.storage.profiles[req.Profile].Displayprefs - } - policy = app.storage.profiles[req.Profile].Policy - } else if req.From == "user" { - applyingFrom = "user" - user, status, err := app.jf.UserByID(req.ID, false) - if !(status == 200 || status == 204) || err != nil { - app.err.Printf("Failed to get user from Jellyfin: Code %d", status) - app.debug.Printf("Error: %s", err) - respond(500, "Couldn't get user", gc) - return - } - applyingFrom = "\"" + user["Name"].(string) + "\"" - policy = user["Policy"].(map[string]interface{}) - if req.Homescreen { - displayprefs, status, err = app.jf.GetDisplayPreferences(req.ID) - if !(status == 200 || status == 204) || err != nil { - app.err.Printf("Failed to get DisplayPrefs: Code %d", status) - app.debug.Printf("Error: %s", err) - respond(500, "Couldn't get displayprefs", gc) - return - } - configuration = user["Configuration"].(map[string]interface{}) - } - } - app.info.Printf("Applying settings to %d user(s) from %s", len(req.ApplyTo), applyingFrom) - errors := errorListDTO{ - "policy": map[string]string{}, - "homescreen": map[string]string{}, - } - for _, id := range req.ApplyTo { - status, err := app.jf.SetPolicy(id, policy) - if !(status == 200 || status == 204) || err != nil { - errors["policy"][id] = fmt.Sprintf("%d: %s", status, err) - } - if req.Homescreen { - status, err = app.jf.SetConfiguration(id, configuration) - errorString := "" - if !(status == 200 || status == 204) || err != nil { - errorString += fmt.Sprintf("Configuration %d: %s ", status, err) - } else { - status, err = app.jf.SetDisplayPreferences(id, displayprefs) - if !(status == 200 || status == 204) || err != nil { - errorString += fmt.Sprintf("Displayprefs %d: %s ", status, err) - } - } - if errorString != "" { - errors["homescreen"][id] = errorString - } - } - } - code := 200 - if len(errors["policy"]) == len(req.ApplyTo) || len(errors["homescreen"]) == len(req.ApplyTo) { - code = 500 - } - gc.JSON(code, errors) -} - -// @Summary Get jfa-go configuration. -// @Produce json -// @Success 200 {object} configDTO "Uses the same format as config-base.json" -// @Router /config [get] -// @Security Bearer -// @tags Configuration -func (app *appContext) GetConfig(gc *gin.Context) { - app.info.Println("Config requested") - resp := map[string]interface{}{} - langPath := filepath.Join(app.localPath, "lang", "form") - app.lang.langFiles, _ = ioutil.ReadDir(langPath) - app.lang.langOptions = make([]string, len(app.lang.langFiles)) - chosenLang := app.config.Section("ui").Key("language").MustString("en-us") + ".json" - for i, f := range app.lang.langFiles { - if f.Name() == chosenLang { - app.lang.chosenIndex = i - } - var langFile map[string]interface{} - file, _ := ioutil.ReadFile(filepath.Join(langPath, f.Name())) - json.Unmarshal(file, &langFile) - - if meta, ok := langFile["meta"]; ok { - app.lang.langOptions[i] = meta.(map[string]interface{})["name"].(string) - } - } - for section, settings := range app.configBase { - if section == "order" { - resp[section] = settings.([]interface{}) - } else { - resp[section] = make(map[string]interface{}) - for key, values := range settings.(map[string]interface{}) { - if key == "order" { - resp[section].(map[string]interface{})[key] = values.([]interface{}) - } else { - resp[section].(map[string]interface{})[key] = values.(map[string]interface{}) - if key != "meta" { - dataType := resp[section].(map[string]interface{})[key].(map[string]interface{})["type"].(string) - configKey := app.config.Section(section).Key(key) - if dataType == "number" { - if val, err := configKey.Int(); err == nil { - resp[section].(map[string]interface{})[key].(map[string]interface{})["value"] = val - } - } else if dataType == "bool" { - resp[section].(map[string]interface{})[key].(map[string]interface{})["value"] = configKey.MustBool(false) - } else if dataType == "select" && key == "language" { - resp[section].(map[string]interface{})[key].(map[string]interface{})["options"] = app.lang.langOptions - resp[section].(map[string]interface{})[key].(map[string]interface{})["value"] = app.lang.langOptions[app.lang.chosenIndex] - } else { - resp[section].(map[string]interface{})[key].(map[string]interface{})["value"] = configKey.String() - } - } - } - } - } - } - // resp["jellyfin"].(map[string]interface{})["language"].(map[string]interface{})["options"].([]string) - gc.JSON(200, resp) -} - -// @Summary Modify app config. -// @Produce json -// @Param appConfig body configDTO true "Config split into sections as in config.ini, all values as strings." -// @Success 200 {object} boolResponse -// @Router /config [post] -// @Security Bearer -// @tags Configuration -func (app *appContext) ModifyConfig(gc *gin.Context) { - app.info.Println("Config modification requested") - var req configDTO - gc.BindJSON(&req) - tempConfig, _ := ini.Load(app.configPath) - for section, settings := range req { - if section != "restart-program" { - _, err := tempConfig.GetSection(section) - if err != nil { - tempConfig.NewSection(section) - } - for setting, value := range settings.(map[string]interface{}) { - if section == "ui" && setting == "language" { - for i, lang := range app.lang.langOptions { - if value.(string) == lang { - tempConfig.Section(section).Key(setting).SetValue(strings.Replace(app.lang.langFiles[i].Name(), ".json", "", 1)) - break - } - } - } else { - tempConfig.Section(section).Key(setting).SetValue(value.(string)) - } - } - } - } - tempConfig.SaveTo(app.configPath) - app.debug.Println("Config saved") - gc.JSON(200, map[string]bool{"success": true}) - if req["restart-program"] != nil && req["restart-program"].(bool) { - app.info.Println("Restarting...") - err := app.Restart() - if err != nil { - app.err.Printf("Couldn't restart, try restarting manually. (%s)", err) - } - } - app.loadConfig() - // Reinitialize password validator on config change, as opposed to every applicable request like in python. - if _, ok := req["password_validation"]; ok { - app.debug.Println("Reinitializing validator") - validatorConf := ValidatorConf{ - "characters": app.config.Section("password_validation").Key("min_length").MustInt(0), - "uppercase characters": app.config.Section("password_validation").Key("upper").MustInt(0), - "lowercase characters": app.config.Section("password_validation").Key("lower").MustInt(0), - "numbers": app.config.Section("password_validation").Key("number").MustInt(0), - "special characters": app.config.Section("password_validation").Key("special").MustInt(0), - } - if !app.config.Section("password_validation").Key("enabled").MustBool(false) { - for key := range validatorConf { - validatorConf[key] = 0 - } - } - app.validator.init(validatorConf) - } -} - -// @Summary Logout by deleting refresh token from cookies. -// @Produce json -// @Success 200 {object} boolResponse -// @Failure 500 {object} stringResponse -// @Router /logout [post] -// @tags Other -func (app *appContext) Logout(gc *gin.Context) { - cookie, err := gc.Cookie("refresh") - if err != nil { - app.debug.Printf("Couldn't get cookies: %s", err) - respond(500, "Couldn't fetch cookies", gc) - return - } - app.invalidTokens = append(app.invalidTokens, cookie) - gc.SetCookie("refresh", "invalid", -1, "/", gc.Request.URL.Hostname(), true, true) - respondBool(200, true, gc) -} - -// func Restart() error { -// defer func() { -// if r := recover(); r != nil { -// os.Exit(0) -// } -// }() -// cwd, err := os.Getwd() -// if err != nil { -// return err -// } -// args := os.Args -// // for _, key := range args { -// // fmt.Println(key) -// // } -// cmd := exec.Command(args[0], args[1:]...) -// cmd.Stdout = os.Stdout -// cmd.Stderr = os.Stderr -// cmd.Dir = cwd -// err = cmd.Start() -// if err != nil { -// return err -// } -// // cmd.Process.Release() -// panic(fmt.Errorf("restarting")) -// } - -// func (app *appContext) Restart() error { -// defer func() { -// if r := recover(); r != nil { -// signal.Notify(app.quit, os.Interrupt) -// <-app.quit -// } -// }() -// args := os.Args -// // After a single restart, args[0] gets messed up and isnt the real executable. -// // JFA_DEEP tells the new process its a child, and JFA_EXEC is the real executable -// if os.Getenv("JFA_DEEP") == "" { -// os.Setenv("JFA_DEEP", "1") -// os.Setenv("JFA_EXEC", args[0]) -// } -// env := os.Environ() -// err := syscall.Exec(os.Getenv("JFA_EXEC"), []string{""}, env) -// if err != nil { -// return err -// } -// panic(fmt.Errorf("restarting")) -// } - -// no need to syscall.exec anymore! -func (app *appContext) Restart() error { - RESTART <- true - return nil -} diff --git a/auth.go b/auth.go deleted file mode 100644 index fc927c4..0000000 --- a/auth.go +++ /dev/null @@ -1,228 +0,0 @@ -package main - -import ( - "encoding/base64" - "fmt" - "os" - "strconv" - "strings" - "time" - - "github.com/dgrijalva/jwt-go" - "github.com/gin-gonic/gin" - "github.com/lithammer/shortuuid/v3" -) - -func (app *appContext) webAuth() gin.HandlerFunc { - return app.authenticate -} - -// CreateToken returns a web token as well as a refresh token, which can be used to obtain new tokens. -func CreateToken(userId, jfId string) (string, string, error) { - var token, refresh string - claims := jwt.MapClaims{ - "valid": true, - "id": userId, - "exp": strconv.FormatInt(time.Now().Add(time.Minute*20).Unix(), 10), - "jfid": jfId, - "type": "bearer", - } - - tk := jwt.NewWithClaims(jwt.SigningMethodHS256, claims) - token, err := tk.SignedString([]byte(os.Getenv("JFA_SECRET"))) - if err != nil { - return "", "", err - } - claims["exp"] = strconv.FormatInt(time.Now().Add(time.Hour*24).Unix(), 10) - claims["type"] = "refresh" - tk = jwt.NewWithClaims(jwt.SigningMethodHS256, claims) - refresh, err = tk.SignedString([]byte(os.Getenv("JFA_SECRET"))) - if err != nil { - return "", "", err - } - return token, refresh, nil -} - -// Check header for token -func (app *appContext) authenticate(gc *gin.Context) { - header := strings.SplitN(gc.Request.Header.Get("Authorization"), " ", 2) - if header[0] != "Bearer" { - app.debug.Println("Invalid authorization header") - respond(401, "Unauthorized", gc) - return - } - token, err := jwt.Parse(string(header[1]), checkToken) - if err != nil { - app.debug.Printf("Auth denied: %s", err) - respond(401, "Unauthorized", gc) - return - } - claims, ok := token.Claims.(jwt.MapClaims) - expiryUnix, err := strconv.ParseInt(claims["exp"].(string), 10, 64) - if err != nil { - app.debug.Printf("Auth denied: %s", err) - respond(401, "Unauthorized", gc) - return - } - expiry := time.Unix(expiryUnix, 0) - if !(ok && token.Valid && claims["type"].(string) == "bearer" && expiry.After(time.Now())) { - app.debug.Printf("Auth denied: Invalid token") - respond(401, "Unauthorized", gc) - return - } - userID := claims["id"].(string) - jfID := claims["jfid"].(string) - match := false - for _, user := range app.users { - if user.UserID == userID { - match = true - break - } - } - if !match { - app.debug.Printf("Couldn't find user ID \"%s\"", userID) - respond(401, "Unauthorized", gc) - return - } - gc.Set("jfId", jfID) - gc.Set("userId", userID) - app.debug.Println("Auth succeeded") - gc.Next() -} - -func checkToken(token *jwt.Token) (interface{}, error) { - if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok { - return nil, fmt.Errorf("Unexpected signing method %v", token.Header["alg"]) - } - return []byte(os.Getenv("JFA_SECRET")), nil -} - -type getTokenDTO struct { - Token string `json:"token" example:"kjsdklsfdkljfsjsdfklsdfkldsfjdfskjsdfjklsdf"` // API token for use with everything else. -} - -// @Summary Grabs an API token using username & password. -// @description Click the lock icon next to this, login with your normal jfa-go credentials. Click 'try it out', then 'execute' and an API Key will be returned, copy it (not including quotes). On any of the other routes, click the lock icon and set the API key as "Bearer `your api key`". -// @Produce json -// @Success 200 {object} getTokenDTO -// @Failure 401 {object} stringResponse -// @Router /token/login [get] -// @tags Auth -// @Security getTokenAuth -func (app *appContext) getTokenLogin(gc *gin.Context) { - app.info.Println("Token requested (login attempt)") - header := strings.SplitN(gc.Request.Header.Get("Authorization"), " ", 2) - auth, _ := base64.StdEncoding.DecodeString(header[1]) - creds := strings.SplitN(string(auth), ":", 2) - var userID, jfID string - if creds[0] == "" || creds[1] == "" { - app.debug.Println("Auth denied: blank username/password") - respond(401, "Unauthorized", gc) - return - } - match := false - for _, user := range app.users { - if user.Username == creds[0] && user.Password == creds[1] { - match = true - app.debug.Println("Found existing user") - userID = user.UserID - break - } - } - if !app.jellyfinLogin && !match { - app.info.Println("Auth denied: Invalid username/password") - respond(401, "Unauthorized", gc) - return - } - if !match { - var status int - var err error - var user map[string]interface{} - user, status, err = app.authJf.Authenticate(creds[0], creds[1]) - if status != 200 || err != nil { - if status == 401 || status == 400 { - app.info.Println("Auth denied: Invalid username/password (Jellyfin)") - respond(401, "Unauthorized", gc) - return - } - app.err.Printf("Auth failed: Couldn't authenticate with Jellyfin (%d/%s)", status, err) - respond(500, "Jellyfin error", gc) - return - } - jfID = user["Id"].(string) - if app.config.Section("ui").Key("admin_only").MustBool(true) { - if !user["Policy"].(map[string]interface{})["IsAdministrator"].(bool) { - app.debug.Printf("Auth denied: Users \"%s\" isn't admin", creds[0]) - respond(401, "Unauthorized", gc) - return - } - } - // New users are only added when using jellyfinLogin. - userID = shortuuid.New() - newUser := User{ - UserID: userID, - } - app.debug.Printf("Token generated for user \"%s\"", creds[0]) - app.users = append(app.users, newUser) - } - token, refresh, err := CreateToken(userID, jfID) - if err != nil { - app.err.Printf("getToken failed: Couldn't generate token (%s)", err) - respond(500, "Couldn't generate token", gc) - return - } - gc.SetCookie("refresh", refresh, (3600 * 24), "/", gc.Request.URL.Hostname(), true, true) - gc.JSON(200, getTokenDTO{token}) -} - -// @Summary Grabs an API token using a refresh token from cookies. -// @Produce json -// @Success 200 {object} getTokenDTO -// @Failure 401 {object} stringResponse -// @Router /token/refresh [get] -// @tags Auth -func (app *appContext) getTokenRefresh(gc *gin.Context) { - app.debug.Println("Token requested (refresh token)") - cookie, err := gc.Cookie("refresh") - if err != nil || cookie == "" { - app.debug.Printf("getTokenRefresh denied: Couldn't get token: %s", err) - respond(400, "Couldn't get token", gc) - return - } - for _, token := range app.invalidTokens { - if cookie == token { - app.debug.Println("getTokenRefresh: Invalid token") - respond(401, "Invalid token", gc) - return - } - } - token, err := jwt.Parse(cookie, checkToken) - if err != nil { - app.debug.Println("getTokenRefresh: Invalid token") - respond(400, "Invalid token", gc) - return - } - claims, ok := token.Claims.(jwt.MapClaims) - expiryUnix, err := strconv.ParseInt(claims["exp"].(string), 10, 64) - if err != nil { - app.debug.Printf("getTokenRefresh: Invalid token expiry: %s", err) - respond(401, "Invalid token", gc) - return - } - expiry := time.Unix(expiryUnix, 0) - if !(ok && token.Valid && claims["type"].(string) == "refresh" && expiry.After(time.Now())) { - app.debug.Printf("getTokenRefresh: Invalid token: %s", err) - respond(401, "Invalid token", gc) - return - } - userID := claims["id"].(string) - jfID := claims["jfid"].(string) - jwt, refresh, err := CreateToken(userID, jfID) - if err != nil { - app.err.Printf("getTokenRefresh failed: Couldn't generate token (%s)", err) - respond(500, "Couldn't generate token", gc) - return - } - gc.SetCookie("refresh", refresh, (3600 * 24), "/", gc.Request.URL.Hostname(), true, true) - gc.JSON(200, getTokenDTO{jwt}) -} diff --git a/common/common.go b/common/common.go deleted file mode 100644 index ed94ad1..0000000 --- a/common/common.go +++ /dev/null @@ -1,23 +0,0 @@ -package common - -import ( - "fmt" - "log" -) - -// TimeoutHandler recovers from an http timeout. -type TimeoutHandler func() - -// NewTimeoutHandler returns a new Timeout handler. -func NewTimeoutHandler(name, addr string, noFail bool) TimeoutHandler { - return func() { - if r := recover(); r != nil { - out := fmt.Sprintf("Failed to authenticate with %s @ %s: Timed out", name, addr) - if noFail { - log.Print(out) - } else { - log.Fatalf(out) - } - } - } -} diff --git a/common/go.mod b/common/go.mod deleted file mode 100644 index ec0c50a..0000000 --- a/common/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/hrfee/jfa-go/common - -go 1.15 diff --git a/config.go b/config.go deleted file mode 100644 index 71e1724..0000000 --- a/config.go +++ /dev/null @@ -1,86 +0,0 @@ -package main - -import ( - "fmt" - "path/filepath" - "strconv" - "strings" - - "gopkg.in/ini.v1" -) - -/*var DeCamel ini.NameMapper = func(raw string) string { - out := make([]rune, 0, len(raw)) - upper := 0 - for _, c := range raw { - if unicode.IsUpper(c) { - upper++ - } - if upper == 2 { - out = append(out, '_') - upper = 0 - } - out = append(out, unicode.ToLower(c)) - } - return string(out) -} - -func (app *appContext) loadDefaults() (err error) { - var cfb []byte - cfb, err = ioutil.ReadFile(app.configBase_path) - if err != nil { - return - } - json.Unmarshal(cfb, app.defaults) - return -}*/ - -func (app *appContext) loadConfig() error { - var err error - app.config, err = ini.Load(app.configPath) - if err != nil { - return err - } - - app.config.Section("jellyfin").Key("public_server").SetValue(app.config.Section("jellyfin").Key("public_server").MustString(app.config.Section("jellyfin").Key("server").String())) - - for _, key := range app.config.Section("files").Keys() { - // if key.MustString("") == "" && key.Name() != "custom_css" { - // key.SetValue(filepath.Join(app.data_path, (key.Name() + ".json"))) - // } - if key.Name() != "html_templates" { - key.SetValue(key.MustString(filepath.Join(app.dataPath, (key.Name() + ".json")))) - } - } - for _, key := range []string{"user_configuration", "user_displayprefs", "user_profiles", "ombi_template"} { - // if app.config.Section("files").Key(key).MustString("") == "" { - // key.SetValue(filepath.Join(app.data_path, (key.Name() + ".json"))) - // } - app.config.Section("files").Key(key).SetValue(app.config.Section("files").Key(key).MustString(filepath.Join(app.dataPath, (key + ".json")))) - } - app.URLBase = strings.TrimSuffix(app.config.Section("ui").Key("url_base").MustString(""), "/") - app.config.Section("email").Key("no_username").SetValue(strconv.FormatBool(app.config.Section("email").Key("no_username").MustBool(false))) - - app.config.Section("password_resets").Key("email_html").SetValue(app.config.Section("password_resets").Key("email_html").MustString(filepath.Join(app.localPath, "email.html"))) - app.config.Section("password_resets").Key("email_text").SetValue(app.config.Section("password_resets").Key("email_text").MustString(filepath.Join(app.localPath, "email.txt"))) - - app.config.Section("invite_emails").Key("email_html").SetValue(app.config.Section("invite_emails").Key("email_html").MustString(filepath.Join(app.localPath, "invite-email.html"))) - app.config.Section("invite_emails").Key("email_text").SetValue(app.config.Section("invite_emails").Key("email_text").MustString(filepath.Join(app.localPath, "invite-email.txt"))) - - app.config.Section("notifications").Key("expiry_html").SetValue(app.config.Section("notifications").Key("expiry_html").MustString(filepath.Join(app.localPath, "expired.html"))) - app.config.Section("notifications").Key("expiry_text").SetValue(app.config.Section("notifications").Key("expiry_text").MustString(filepath.Join(app.localPath, "expired.txt"))) - - app.config.Section("notifications").Key("created_html").SetValue(app.config.Section("notifications").Key("created_html").MustString(filepath.Join(app.localPath, "created.html"))) - app.config.Section("notifications").Key("created_text").SetValue(app.config.Section("notifications").Key("created_text").MustString(filepath.Join(app.localPath, "created.txt"))) - - app.config.Section("deletion").Key("email_html").SetValue(app.config.Section("deletion").Key("email_html").MustString(filepath.Join(app.localPath, "deleted.html"))) - app.config.Section("deletion").Key("email_text").SetValue(app.config.Section("deletion").Key("email_text").MustString(filepath.Join(app.localPath, "deleted.txt"))) - - app.config.Section("jellyfin").Key("version").SetValue(VERSION) - app.config.Section("jellyfin").Key("device").SetValue("jfa-go") - app.config.Section("jellyfin").Key("device_id").SetValue(fmt.Sprintf("jfa-go-%s-%s", VERSION, COMMIT)) - - app.email = NewEmailer(app) - - return nil -} diff --git a/config/README.md b/config/README.md deleted file mode 100644 index db64f2b..0000000 --- a/config/README.md +++ /dev/null @@ -1,11 +0,0 @@ -### fixconfig - -Python's `json` library retains the order of data in a JSON file, which meant settings sent to the web page would be in the right order. Go's `encoding/json` and maps do not retain order, so this script opens the json file, and for each section, adds an "order" list which tells the web page in which order to display settings. - -Specify the input and output files with `-i` and `-o` respectively. - -### jsontostruct - -Generates a go struct from `config-base.json`. I wrote this because i was annoyed with the `ini` library, but i've since realised mapping the ini values onto it is painful. - - diff --git a/config/config-base.json b/config/config-base.json deleted file mode 100644 index 21e95a2..0000000 --- a/config/config-base.json +++ /dev/null @@ -1,668 +0,0 @@ -{ - "jellyfin": { - "meta": { - "name": "Jellyfin", - "description": "Settings for connecting to Jellyfin" - }, - "username": { - "name": "Jellyfin Username", - "required": true, - "requires_restart": true, - "type": "text", - "value": "username", - "description": "It is recommended to create a limited admin account for this program." - }, - "password": { - "name": "Jellyfin Password", - "required": true, - "requires_restart": true, - "type": "password", - "value": "password" - }, - "server": { - "name": "Server address", - "required": true, - "requires_restart": true, - "type": "text", - "value": "http://jellyfin.local:8096", - "description": "Jellyfin server address. Can be public, or local for security purposes." - }, - "public_server": { - "name": "Public address", - "required": false, - "requires_restart": false, - "type": "text", - "value": "https://jellyf.in:443", - "description": "Publicly accessible Jellyfin address for invite form. Leave blank to reuse the above address." - }, - "client": { - "name": "Client Name", - "required": true, - "requires_restart": true, - "type": "text", - "value": "jfa-go", - "description": "The name of the client that will show up in the Jellyfin dashboard." - }, - "cache_timeout": { - "name": "User cache timeout (minutes)", - "required": false, - "requires_restart": true, - "type": "number", - "value": 30, - "description": "Timeout of user cache in minutes. Set to 0 to disable." - } - }, - "ui": { - "meta": { - "name": "General", - "description": "Settings related to the UI and program functionality." - }, - "language": { - "name": "Language", - "required": false, - "requires_restart": true, - "type": "select", - "options": [ - "en-us" - ], - "value": "en-US", - "description": "UI Language. Currently only implemented for account creation form. Submit a PR on github if you'd like to translate." - }, - "theme": { - "name": "Default Look", - "required": false, - "requires_restart": true, - "type": "select", - "options": [ - "Bootstrap (Light)", - "Jellyfin (Dark)", - "Custom CSS" - ], - "value": "Jellyfin (Dark)", - "description": "Default appearance for all users." - }, - "host": { - "name": "Address", - "required": true, - "requires_restart": true, - "type": "text", - "value": "0.0.0.0", - "description": "Set 0.0.0.0 to run on localhost" - }, - "port": { - "name": "Port", - "required": true, - "requires_restart": true, - "type": "number", - "value": 8056 - }, - "jellyfin_login": { - "name": "Use Jellyfin for authentication", - "required": false, - "requires_restart": true, - "type": "bool", - "value": true, - "description": "Enable this to use Jellyfin users instead of the below username and pw." - }, - "admin_only": { - "name": "Allow admin users only", - "required": false, - "requires_restart": true, - "depends_true": "jellyfin_login", - "type": "bool", - "value": true, - "description": "Allows only admin users on Jellyfin to access the admin page." - }, - "username": { - "name": "Web Username", - "required": true, - "requires_restart": true, - "depends_false": "jellyfin_login", - "type": "text", - "value": "your username", - "description": "Username for admin page (Leave blank if using jellyfin_login)" - }, - "password": { - "name": "Web Password", - "required": true, - "requires_restart": true, - "depends_false": "jellyfin_login", - "type": "password", - "value": "your password", - "description": "Password for admin page (Leave blank if using jellyfin_login)" - }, - "email": { - "name": "Admin email address", - "required": false, - "requires_restart": false, - "depends_false": "jellyfin_login", - "type": "text", - "value": "example@example.com", - "description": "Address to send notifications to (Leave blank if using jellyfin_login)" - }, - "debug": { - "name": "Debug logging", - "required": false, - "requires_restart": true, - "type": "bool", - "value": false, - "description": "Enables debug logging and exposes pprof as a route (Don't use in production!)" - }, - "contact_message": { - "name": "Contact message", - "required": false, - "requires_restart": false, - "type": "text", - "value": "Need help? contact me.", - "description": "Displayed at bottom of all pages except admin" - }, - "help_message": { - "name": "Help message", - "required": false, - "requires_restart": false, - "type": "text", - "value": "Enter your details to create an account.", - "description": "Displayed at top of invite form." - }, - "success_message": { - "name": "Success message", - "required": false, - "requires_restart": false, - "type": "text", - "value": "Your account has been created. Click below to continue to Jellyfin.", - "description": "Displayed when a user creates an account" - }, - "bs5": { - "name": "Use Bootstrap 5", - "required": false, - "requires_restart": true, - "type": "bool", - "value": false, - "description": "Use the Bootstrap 5 Alpha. Looks better and removes the need for jQuery, so the page should load faster." - }, - "url_base": { - "name": "URL Base", - "required": false, - "requires_restart": true, - "type": "text", - "value": "", - "description": "URL base for when running jfa-go with a reverse proxy in a subfolder." - } - }, - "password_validation": { - "meta": { - "name": "Password Validation", - "description": "Password validation (minimum length, etc.)" - }, - "enabled": { - "name": "Enabled", - "required": false, - "requires_restart": false, - "type": "bool", - "value": true - }, - "min_length": { - "name": "Minimum Length", - "requires_restart": false, - "depends_true": "enabled", - "type": "text", - "value": "8" - }, - "upper": { - "name": "Minimum uppercase characters", - "requires_restart": false, - "depends_true": "enabled", - "type": "text", - "value": "1" - }, - "lower": { - "name": "Minimum lowercase characters", - "requires_restart": false, - "depends_true": "enabled", - "type": "text", - "value": "0" - }, - "number": { - "name": "Minimum number count", - "requires_restart": false, - "depends_true": "enabled", - "type": "text", - "value": "1" - }, - "special": { - "name": "Minimum number of special characters", - "requires_restart": false, - "depends_true": "enabled", - "type": "text", - "value": "0" - } - }, - "email": { - "meta": { - "name": "Email", - "description": "General email settings. Ignore if not using email features." - }, - "no_username": { - "name": "Use email addresses as username", - "required": false, - "requires_restart": false, - "depends_true": "method", - "type": "bool", - "value": false, - "description": "Use email address from invite form as username on Jellyfin." - }, - "use_24h": { - "name": "Use 24h time", - "required": false, - "requires_restart": false, - "depends_true": "method", - "type": "bool", - "value": true - }, - "date_format": { - "name": "Date format", - "required": false, - "requires_restart": false, - "depends_true": "method", - "type": "text", - "value": "%d/%m/%y", - "description": "Date format used in emails. Follows datetime.strftime format." - }, - "message": { - "name": "Help message", - "required": false, - "requires_restart": false, - "depends_true": "method", - "type": "text", - "value": "Need help? contact me.", - "description": "Message displayed at bottom of emails." - }, - "method": { - "name": "Email method", - "required": false, - "requires_restart": false, - "type": "select", - "options": [ - "smtp", - "mailgun" - ], - "value": "smtp", - "description": "Method of sending email to use." - }, - "address": { - "name": "Sent from (address)", - "required": false, - "requires_restart": false, - "depends_true": "method", - "type": "email", - "value": "jellyfin@jellyf.in", - "description": "Address to send emails from" - }, - "from": { - "name": "Sent from (name)", - "required": false, - "requires_restart": false, - "depends_true": "method", - "type": "text", - "value": "Jellyfin", - "description": "The name of the sender" - } - }, - "password_resets": { - "meta": { - "name": "Password Resets", - "description": "Settings for the password reset handler." - }, - "enabled": { - "name": "Enabled", - "required": false, - "requires_restart": true, - "type": "bool", - "value": true, - "description": "Enable to store provided email addresses, monitor Jellyfin directory for pw-resets, and send reset pins" - }, - "watch_directory": { - "name": "Jellyfin directory", - "required": false, - "requires_restart": true, - "depends_true": "enabled", - "type": "text", - "value": "/path/to/jellyfin", - "description": "Path to the folder Jellyfin puts password-reset files." - }, - "email_html": { - "name": "Custom email (HTML)", - "required": false, - "requires_restart": false, - "depends_true": "enabled", - "type": "text", - "value": "", - "description": "Path to custom email html" - }, - "email_text": { - "name": "Custom email (plaintext)", - "required": false, - "requires_restart": false, - "depends_true": "enabled", - "type": "text", - "value": "", - "description": "Path to custom email in plain text" - }, - "subject": { - "name": "Email subject", - "required": false, - "requires_restart": false, - "depends_true": "enabled", - "type": "text", - "value": "Password Reset - Jellyfin", - "description": "Subject of password reset emails." - } - }, - "invite_emails": { - "meta": { - "name": "Invite emails", - "description": "Settings for sending invites directly to users." - }, - "enabled": { - "name": "Enabled", - "required": false, - "requires_restart": false, - "type": "bool", - "value": true - }, - "email_html": { - "name": "Custom email (HTML)", - "required": false, - "requires_restart": false, - "depends_true": "enabled", - "type": "text", - "value": "", - "description": "Path to custom email HTML" - }, - "email_text": { - "name": "Custom email (plaintext)", - "required": false, - "requires_restart": false, - "depends_true": "enabled", - "type": "text", - "value": "", - "description": "Path to custom email in plain text" - }, - "subject": { - "name": "Email subject", - "required": true, - "requires_restart": false, - "depends_true": "enabled", - "type": "text", - "value": "Invite - Jellyfin", - "description": "Subject of invite emails." - }, - "url_base": { - "name": "URL Base", - "required": true, - "requires_restart": false, - "depends_true": "enabled", - "type": "text", - "value": "http://accounts.jellyf.in:8056/invite", - "description": "Base URL for jfa-go. This is necessary because using a reverse proxy means the program has no way of knowing the URL itself." - } - }, - "notifications": { - "meta": { - "name": "Notifications", - "description": "Notification related settings." - }, - "enabled": { - "name": "Enabled", - "required": "false", - "requires_restart": true, - "type": "bool", - "value": true, - "description": "Enabling adds optional toggles to invites to notify on expiry and user creation." - }, - "expiry_html": { - "name": "Expiry email (HTML)", - "required": false, - "requires_restart": false, - "depends_true": "enabled", - "type": "text", - "value": "", - "description": "Path to expiry notification email HTML." - }, - "expiry_text": { - "name": "Expiry email (Plaintext)", - "required": false, - "requires_restart": "false", - "depends_true": "enabled", - "type": "text", - "value": "", - "description": "Path to expiry notification email in plaintext." - }, - "created_html": { - "name": "User created email (HTML)", - "required": false, - "requires_restart": false, - "depends_true": "enabled", - "type": "text", - "value": "", - "description": "Path to user creation notification email HTML." - }, - "created_text": { - "name": "User created email (Plaintext)", - "required": false, - "requires_restart": false, - "depends_true": "enabled", - "type": "text", - "value": "", - "description": "Path to user creation notification email in plaintext." - } - }, - "mailgun": { - "meta": { - "name": "Mailgun (Email)", - "description": "Mailgun API connection settings" - }, - "api_url": { - "name": "API URL", - "required": false, - "requires_restart": false, - "type": "text", - "value": "https://api.mailgun.net..." - }, - "api_key": { - "name": "API Key", - "required": false, - "requires_restart": false, - "type": "text", - "value": "your api key" - } - }, - "smtp": { - "meta": { - "name": "SMTP (Email)", - "description": "SMTP Server connection settings." - }, - "username": { - "name": "Username", - "required": false, - "requires_restart": false, - "type": "text", - "value": "", - "description": "Username for SMTP. Leave blank to user send from address as username." - }, - "encryption": { - "name": "Encryption Method", - "required": false, - "requires_restart": false, - "type": "select", - "options": [ - "ssl_tls", - "starttls" - ], - "value": "starttls", - "description": "Your email provider should provide different ports for each encryption method. Generally 465 for ssl_tls, 587 for starttls." - }, - "server": { - "name": "Server address", - "required": false, - "requires_restart": false, - "type": "text", - "value": "smtp.jellyf.in", - "description": "SMTP Server address." - }, - "port": { - "name": "Port", - "required": false, - "requires_restart": false, - "type": "number", - "value": 465 - }, - "password": { - "name": "Password", - "required": false, - "requires_restart": false, - "type": "password", - "value": "smtp password" - } - }, - "ombi": { - "meta": { - "name": "Ombi Integration", - "description": "Connect to Ombi to automatically create both Ombi and Jellyfin accounts for new users. You'll need to create a user template for this to work. Once enabled, refresh to see an option in settings for this." - }, - "enabled": { - "name": "Enabled", - "required": false, - "requires_restart": true, - "type": "bool", - "value": false, - "description": "Enable to create an Ombi account for new Jellyfin users" - }, - "server": { - "name": "URL", - "required": false, - "requires_restart": true, - "type": "text", - "value": "localhost:5000", - "depends_true": "enabled", - "description": "Ombi server URL, including http(s)://." - }, - "api_key": { - "name": "API Key", - "required": false, - "requires_restart": true, - "type": "text", - "value": "", - "depends_true": "enabled", - "description": "API Key. Get this from the first tab in Ombi settings." - } - }, - "deletion": { - "meta": { - "name": "Account Deletion", - "description": "Subject/email files for account deletion emails." - }, - "subject": { - "name": "Email subject", - "required": false, - "requires_restart": false, - "type": "text", - "value": "Your account was deleted - Jellyfin", - "description": "Subject of account deletion emails." - }, - "email_html": { - "name": "Custom email (HTML)", - "required": false, - "requires_restart": false, - "type": "text", - "value": "", - "description": "Path to custom email html" - }, - "email_text": { - "name": "Custom email (plaintext)", - "required": false, - "requires_restart": false, - "type": "text", - "value": "", - "description": "Path to custom email in plain text" - } - }, - "files": { - "meta": { - "name": "File Storage", - "description": "Optional settings for changing storage locations." - }, - "invites": { - "name": "Invite Storage", - "required": false, - "requires_restart": true, - "type": "text", - "value": "", - "description": "Location of stored invites (json)." - }, - "emails": { - "name": "Email Addresses", - "required": false, - "requires_restart": true, - "type": "text", - "value": "", - "description": "Location of stored email addresses (json)." - }, - "ombi_template": { - "name": "Ombi user template", - "required": false, - "requires_restart": false, - "type": "text", - "value": "", - "description": "Location of stored Ombi user template." - }, - "user_template": { - "name": "User Template (Deprecated)", - "required": false, - "requires_restart": true, - "type": "text", - "value": "", - "description": "Deprecated in favor of User Profiles. Location of stored user policy template (json)." - }, - "user_configuration": { - "name": "userConfiguration (Deprecated)", - "required": false, - "requires_restart": true, - "type": "text", - "value": "", - "description": "Deprecated in favor of User Profiles. Location of stored user configuration template (used for setting homescreen layout) (json)" - }, - "user_displayprefs": { - "name": "displayPreferences (Deprecated)", - "required": false, - "requires_restart": true, - "type": "text", - "value": "", - "description": "Deprecated in favor of User Profiles. Location of stored displayPreferences template (also used for homescreen layout) (json)" - }, - "user_profiles": { - "name": "User Profiles", - "required": false, - "requires_restart": true, - "type": "text", - "value": "", - "description": "Location of stored user profiles (encompasses template and configuration and displayprefs) (json)" - }, - "custom_css": { - "name": "Custom CSS", - "required": false, - "requires_restart": true, - "type": "text", - "value": "", - "description": "Location of custom bootstrap CSS." - }, - "html_templates": { - "name": "Custom HTML Template Directory", - "required": false, - "requires_restart": true, - "type": "text", - "value": "", - "description": "Path to directory containing custom versions of web ui pages. See wiki for more info." - } - } -} diff --git a/config/configStruct.go b/config/configStruct.go deleted file mode 100644 index a58b2d9..0000000 --- a/config/configStruct.go +++ /dev/null @@ -1,541 +0,0 @@ -package main - -type Metadata struct{ - Name string `json:"name"` - Description string `json:"description"` -} - -type Config struct{ - Order []string `json:"order"` - Jellyfin struct{ - Order []string `json:"order"` - Meta Metadata `json:"meta"` - Username struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"username"` - } `json:"username" cfg:"username"` - Password struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"password"` - } `json:"password" cfg:"password"` - Server struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"server"` - } `json:"server" cfg:"server"` - PublicServer struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"public_server"` - } `json:"public_server" cfg:"public_server"` - Client struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"client"` - } `json:"client" cfg:"client"` - Version struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"version"` - } `json:"version" cfg:"version"` - Device struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"device"` - } `json:"device" cfg:"device"` - DeviceId struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"device_id"` - } `json:"device_id" cfg:"device_id"` - } `json:"jellyfin"` - Ui struct{ - Order []string `json:"order"` - Meta Metadata `json:"meta"` - Theme struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Options []string `json:"options"` - Value string `json:"value" cfg:"theme"` - } `json:"theme" cfg:"theme"` - Host struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"host"` - } `json:"host" cfg:"host"` - Port struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value int `json:"value" cfg:"port"` - } `json:"port" cfg:"port"` - JellyfinLogin struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value bool `json:"value" cfg:"jellyfin_login"` - } `json:"jellyfin_login" cfg:"jellyfin_login"` - AdminOnly struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value bool `json:"value" cfg:"admin_only"` - } `json:"admin_only" cfg:"admin_only"` - Username struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"username"` - } `json:"username" cfg:"username"` - Password struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"password"` - } `json:"password" cfg:"password"` - Email struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"email"` - } `json:"email" cfg:"email"` - Debug struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value bool `json:"value" cfg:"debug"` - } `json:"debug" cfg:"debug"` - ContactMessage struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"contact_message"` - } `json:"contact_message" cfg:"contact_message"` - HelpMessage struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"help_message"` - } `json:"help_message" cfg:"help_message"` - SuccessMessage struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"success_message"` - } `json:"success_message" cfg:"success_message"` - Bs5 struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value bool `json:"value" cfg:"bs5"` - } `json:"bs5" cfg:"bs5"` - } `json:"ui"` - PasswordValidation struct{ - Order []string `json:"order"` - Meta Metadata `json:"meta"` - Enabled struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value bool `json:"value" cfg:"enabled"` - } `json:"enabled" cfg:"enabled"` - MinLength struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"min_length"` - } `json:"min_length" cfg:"min_length"` - Upper struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"upper"` - } `json:"upper" cfg:"upper"` - Lower struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"lower"` - } `json:"lower" cfg:"lower"` - Number struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"number"` - } `json:"number" cfg:"number"` - Special struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"special"` - } `json:"special" cfg:"special"` - } `json:"password_validation"` - Email struct{ - Order []string `json:"order"` - Meta Metadata `json:"meta"` - NoUsername struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value bool `json:"value" cfg:"no_username"` - } `json:"no_username" cfg:"no_username"` - Use24H struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value bool `json:"value" cfg:"use_24h"` - } `json:"use_24h" cfg:"use_24h"` - DateFormat struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"date_format"` - } `json:"date_format" cfg:"date_format"` - Message struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"message"` - } `json:"message" cfg:"message"` - Method struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Options []string `json:"options"` - Value string `json:"value" cfg:"method"` - } `json:"method" cfg:"method"` - Address struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"address"` - } `json:"address" cfg:"address"` - From struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"from"` - } `json:"from" cfg:"from"` - } `json:"email"` - PasswordResets struct{ - Order []string `json:"order"` - Meta Metadata `json:"meta"` - Enabled struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value bool `json:"value" cfg:"enabled"` - } `json:"enabled" cfg:"enabled"` - WatchDirectory struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"watch_directory"` - } `json:"watch_directory" cfg:"watch_directory"` - EmailHtml struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"email_html"` - } `json:"email_html" cfg:"email_html"` - EmailText struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"email_text"` - } `json:"email_text" cfg:"email_text"` - Subject struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"subject"` - } `json:"subject" cfg:"subject"` - } `json:"password_resets"` - InviteEmails struct{ - Order []string `json:"order"` - Meta Metadata `json:"meta"` - Enabled struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value bool `json:"value" cfg:"enabled"` - } `json:"enabled" cfg:"enabled"` - EmailHtml struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"email_html"` - } `json:"email_html" cfg:"email_html"` - EmailText struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"email_text"` - } `json:"email_text" cfg:"email_text"` - Subject struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"subject"` - } `json:"subject" cfg:"subject"` - UrlBase struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"url_base"` - } `json:"url_base" cfg:"url_base"` - } `json:"invite_emails"` - Notifications struct{ - Order []string `json:"order"` - Meta Metadata `json:"meta"` - Enabled struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value bool `json:"value" cfg:"enabled"` - } `json:"enabled" cfg:"enabled"` - ExpiryHtml struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"expiry_html"` - } `json:"expiry_html" cfg:"expiry_html"` - ExpiryText struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"expiry_text"` - } `json:"expiry_text" cfg:"expiry_text"` - CreatedHtml struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"created_html"` - } `json:"created_html" cfg:"created_html"` - CreatedText struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"created_text"` - } `json:"created_text" cfg:"created_text"` - } `json:"notifications"` - Mailgun struct{ - Order []string `json:"order"` - Meta Metadata `json:"meta"` - ApiUrl struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"api_url"` - } `json:"api_url" cfg:"api_url"` - ApiKey struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"api_key"` - } `json:"api_key" cfg:"api_key"` - } `json:"mailgun"` - Smtp struct{ - Order []string `json:"order"` - Meta Metadata `json:"meta"` - Encryption struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Options []string `json:"options"` - Value string `json:"value" cfg:"encryption"` - } `json:"encryption" cfg:"encryption"` - Server struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"server"` - } `json:"server" cfg:"server"` - Port struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value int `json:"value" cfg:"port"` - } `json:"port" cfg:"port"` - Password struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"password"` - } `json:"password" cfg:"password"` - } `json:"smtp"` - Files struct{ - Order []string `json:"order"` - Meta Metadata `json:"meta"` - Invites struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"invites"` - } `json:"invites" cfg:"invites"` - Emails struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"emails"` - } `json:"emails" cfg:"emails"` - UserTemplate struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"user_template"` - } `json:"user_template" cfg:"user_template"` - UserConfiguration struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"user_configuration"` - } `json:"user_configuration" cfg:"user_configuration"` - UserDisplayprefs struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"user_displayprefs"` - } `json:"user_displayprefs" cfg:"user_displayprefs"` - CustomCss struct{ - Name string `json:"name"` - Required bool `json:"required"` - Restart bool `json:"requires_restart"` - Description string `json:"description"` - Type string `json:"type"` - Value string `json:"value" cfg:"custom_css"` - } `json:"custom_css" cfg:"custom_css"` - } `json:"files"` -} diff --git a/config/fixconfig.py b/config/fixconfig.py deleted file mode 100644 index 180f2e4..0000000 --- a/config/fixconfig.py +++ /dev/null @@ -1,27 +0,0 @@ -import json, argparse - -parser = argparse.ArgumentParser() -parser.add_argument("-i", "--input", help="input config base from jf-accounts") -parser.add_argument("-o", "--output", help="output config base for jfa-go") - -args = parser.parse_args() - -with open(args.input, 'r') as f: - config = json.load(f) - -newconfig = {"order": []} - -for sect in config: - newconfig["order"].append(sect) - newconfig[sect] = {} - newconfig[sect]["order"] = [] - newconfig[sect]["meta"] = config[sect]["meta"] - for setting in config[sect]: - if setting != "meta": - newconfig[sect]["order"].append(setting) - newconfig[sect][setting] = config[sect][setting] - -with open(args.output, 'w') as f: - f.write(json.dumps(newconfig, indent=4)) - - diff --git a/config/generate_ini.py b/config/generate_ini.py deleted file mode 100644 index efc8c0a..0000000 --- a/config/generate_ini.py +++ /dev/null @@ -1,42 +0,0 @@ -# Generates config file -import configparser -import json -import argparse -from pathlib import Path - - -def generate_ini(base_file, ini_file): - """ - Generates .ini file from config-base file. - """ - with open(Path(base_file), "r") as f: - config_base = json.load(f) - - ini = configparser.RawConfigParser(allow_no_value=True) - - for section in config_base: - ini.add_section(section) - for entry in config_base[section]: - if "description" in config_base[section][entry]: - ini.set(section, "; " + config_base[section][entry]["description"]) - if entry != "meta": - value = config_base[section][entry]["value"] - if isinstance(value, bool): - value = str(value).lower() - else: - value = str(value) - ini.set(section, entry, value) - - with open(Path(ini_file), "w") as config_file: - ini.write(config_file) - return True - - -if __name__ == "__main__": - parser = argparse.ArgumentParser() - parser.add_argument("-i", "--input", help="input config base from jf-accounts") - parser.add_argument("-o", "--output", help="output ini") - - args = parser.parse_args() - - print(generate_ini(base_file=args.input, ini_file=args.output)) diff --git a/config/jsontostruct.py b/config/jsontostruct.py deleted file mode 100644 index b99be2b..0000000 --- a/config/jsontostruct.py +++ /dev/null @@ -1,57 +0,0 @@ -import json - -with open("config-formatted.json", "r") as f: - config = json.load(f) - -indent = 0 - - -def writeln(ln): - global indent - if "}" in ln and "{" not in ln: - indent -= 1 - s.write(("\t" * indent) + ln + "\n") - if "{" in ln and "}" not in ln: - indent += 1 - - -with open("configStruct.go", "w") as s: - writeln("package main") - writeln("") - writeln("type Metadata struct{") - writeln('Name string `json:"name"`') - writeln('Description string `json:"description"`') - writeln("}") - writeln("") - writeln("type Config struct{") - if "order" in config: - writeln('Order []string `json:"order"`') - for section in [x for x in config.keys() if x != "order"]: - title = "".join([x.title() for x in section.split("_")]) - writeln(title + " struct{") - if "order" in config[section]: - writeln('Order []string `json:"order"`') - if "meta" in config[section]: - writeln('Meta Metadata `json:"meta"`') - for setting in [ - x for x in config[section].keys() if x != "order" and x != "meta" - ]: - name = "".join([x.title() for x in setting.split("_")]) - writeln(name + " struct{") - writeln('Name string `json:"name"`') - writeln('Required bool `json:"required"`') - writeln('Restart bool `json:"requires_restart"`') - writeln('Description string `json:"description"`') - writeln('Type string `json:"type"`') - dt = config[section][setting]["type"] - if dt == "select": - dt = "string" - writeln('Options []string `json:"options"`') - elif dt == "number": - dt = "int" - elif dt != "bool": - dt = "string" - writeln(f'Value {dt} `json:"value" cfg:"{setting}"`') - writeln("} " + f'`json:"{setting}" cfg:"{setting}"`') - writeln("} " + f'`json:"{section}"`') - writeln("}") diff --git a/daemon.go b/daemon.go deleted file mode 100644 index 51299dc..0000000 --- a/daemon.go +++ /dev/null @@ -1,50 +0,0 @@ -package main - -import "time" - -// https://bbengfort.github.io/snippets/2016/06/26/background-work-goroutines-timer.html THANKS - -type repeater struct { - Stopped bool - ShutdownChannel chan string - Interval time.Duration - period time.Duration - app *appContext -} - -func newRepeater(interval time.Duration, app *appContext) *repeater { - return &repeater{ - Stopped: false, - ShutdownChannel: make(chan string), - Interval: interval, - period: interval, - app: app, - } -} - -func (rt *repeater) run() { - rt.app.info.Println("Invite daemon started") - for { - select { - case <-rt.ShutdownChannel: - rt.ShutdownChannel <- "Down" - return - case <-time.After(rt.period): - break - } - started := time.Now() - rt.app.storage.loadInvites() - rt.app.debug.Println("Daemon: Checking invites") - rt.app.checkInvites() - finished := time.Now() - duration := finished.Sub(started) - rt.period = rt.Interval - duration - } -} - -func (rt *repeater) shutdown() { - rt.Stopped = true - rt.ShutdownChannel <- "Down" - <-rt.ShutdownChannel - close(rt.ShutdownChannel) -} diff --git a/data/lang/form/en-us.json b/data/lang/form/en-us.json deleted file mode 100644 index fe94b3f..0000000 --- a/data/lang/form/en-us.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "meta": { - "name": "English (US)" - }, - "strings": { - "pageTitle": "Create Jellyfin Account", - "createAccountHeader": "Create Account", - "accountDetails": "Details", - "emailAddress": "Email", - "username": "Username", - "password": "Password", - "reEnterPassword": "Re-enter Password", - "reEnterPasswordInvalid": "Passwords are not the same.", - "createAccountButton": "Create Account", - "passwordRequirementsHeader": "Password Requirements", - "successHeader": "Success!", - "successContinueButton": "Continue", - "validationStrings": { - "length": { - "singular": "Must have at least {n} character", - "plural": "Must have a least {n} characters" - }, - "uppercase": { - "singular": "Must have at least {n} uppercase character", - "plural": "Must have at least {n} uppercase characters" - }, - "lowercase": { - "singular": "Must have at least {n} lowercase character", - "plural": "Must have at least {n} lowercase characters" - }, - "number": { - "singular": "Must have at least {n} number", - "plural": "Must have at least {n} numbers" - }, - "special": { - "singular": "Must have at least {n} special character", - "plural": "Must have at least {n} special characters" - } - } - } -} diff --git a/data/lang/form/fr-fr.json b/data/lang/form/fr-fr.json deleted file mode 100644 index 102148e..0000000 --- a/data/lang/form/fr-fr.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "meta": { - "name": "Francais (FR)", - "author": "https://github.com/Killianbe" - }, - "strings": { - "pageTitle": "Créer un compte Jellyfin", - "createAccountHeader": "Création du compte", - "accountDetails": "Détails", - "emailAddress": "Email", - "username": "Pseudo", - "password": "Mot de passe", - "reEnterPassword": "Confirmez mot de passe", - "reEnterPasswordInvalid": "Les mots de passe ne correspondent pas.", - "createAccountButton": "Créer le compte", - "passwordRequirementsHeader": "Mot de passe requis", - "successHeader": "Succes!", - "successContinueButton": "Continuer", - "validationStrings": { - "length": { - "singular": "Doit avoir au moins {n} caractère", - "plural": "Doit avoir au moins {n} caractères" - }, - "uppercase": { - "singular": "Doit avoir au moins {n} caractère majuscule", - "plural": "Must have at least {n} caractères majuscules" - }, - "lowercase": { - "singular": "Doit avoir au moins {n} caractère minuscule", - "plural": "Doit avoir au moins {n} caractères minuscules" - }, - "number": { - "singular": "Doit avoir au moins {n} nombre", - "plural": "Doit avoir au moins {n} nombres" - }, - "special": { - "singular": "Doit avoir au moins {n} caractère spécial", - "plural": "Doit avoir au moins {n} caractères spéciaux" - } - } - } -} diff --git a/data/static/android-chrome-192x192.png b/data/static/android-chrome-192x192.png deleted file mode 100644 index 43660ed..0000000 Binary files a/data/static/android-chrome-192x192.png and /dev/null differ diff --git a/data/static/android-chrome-512x512.png b/data/static/android-chrome-512x512.png deleted file mode 100644 index 0eed6a0..0000000 Binary files a/data/static/android-chrome-512x512.png and /dev/null differ diff --git a/data/static/apple-touch-icon.png b/data/static/apple-touch-icon.png deleted file mode 100644 index 6f88cbf..0000000 Binary files a/data/static/apple-touch-icon.png and /dev/null differ diff --git a/data/static/banner.svg b/data/static/banner.svg deleted file mode 100644 index 627a830..0000000 --- a/data/static/banner.svg +++ /dev/null @@ -1,283 +0,0 @@ - -image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/static/browserconfig.xml b/data/static/browserconfig.xml deleted file mode 100644 index 5cd27e3..0000000 --- a/data/static/browserconfig.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - #603cba - - - diff --git a/data/static/favicon-16x16.png b/data/static/favicon-16x16.png deleted file mode 100644 index 1563306..0000000 Binary files a/data/static/favicon-16x16.png and /dev/null differ diff --git a/data/static/favicon-32x32.png b/data/static/favicon-32x32.png deleted file mode 100644 index 375ed01..0000000 Binary files a/data/static/favicon-32x32.png and /dev/null differ diff --git a/data/static/favicon.ico b/data/static/favicon.ico deleted file mode 100644 index c4fc3c3..0000000 Binary files a/data/static/favicon.ico and /dev/null differ diff --git a/data/static/mstile-150x150.png b/data/static/mstile-150x150.png deleted file mode 100644 index dc33f3c..0000000 Binary files a/data/static/mstile-150x150.png and /dev/null differ diff --git a/data/static/safari-pinned-tab.svg b/data/static/safari-pinned-tab.svg deleted file mode 100644 index f5161de..0000000 --- a/data/static/safari-pinned-tab.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/data/static/setup.js b/data/static/setup.js deleted file mode 100644 index e9f5fc6..0000000 --- a/data/static/setup.js +++ /dev/null @@ -1,275 +0,0 @@ -document.getElementById('page-1').scrollIntoView({ - behavior: 'auto', - block: 'center', - inline: 'center' }); - -function checkAuthRadio() { - if (document.getElementById('manualAuthRadio').checked) { - document.getElementById('adminOnlyArea').style.display = 'none'; - document.getElementById('manualAuthArea').style.display = ''; - } else { - document.getElementById('manualAuthArea').style.display = 'none'; - document.getElementById('adminOnlyArea').style.display = ''; - }; -}; -var authRadios = ['manualAuthRadio', 'jfAuthRadio']; -for (var i = 0; i < authRadios.length; i++) { - document.getElementById(authRadios[i]).addEventListener('change', function() { - checkAuthRadio(); - }); -}; - -function checkEmailRadio() { - document.getElementById('emailNextButton').href = '#page-5'; - document.getElementById('valBackButton').href = '#page-7'; - if (document.getElementById('emailSMTPRadio').checked) { - document.getElementById('emailCommonArea').style.display = ''; - document.getElementById('emailSMTPArea').style.display = ''; - document.getElementById('emailMailgunArea').style.display = 'none'; - document.getElementById('notificationsEnabled').checked = true; - } else if (document.getElementById('emailMailgunRadio').checked) { - document.getElementById('emailCommonArea').style.display = ''; - document.getElementById('emailSMTPArea').style.display = 'none'; - document.getElementById('emailMailgunArea').style.display = ''; - document.getElementById('notificationsEnabled').checked = true; - } else if (document.getElementById('emailDisabledRadio').checked) { - document.getElementById('emailCommonArea').style.display = 'none'; - document.getElementById('emailSMTPArea').style.display = 'none'; - document.getElementById('emailMailgunArea').style.display = 'none'; - document.getElementById('emailNextButton').href = '#page-8'; - document.getElementById('valBackButton').href = '#page-4'; - document.getElementById('notificationsEnabled').checked = false; - }; -}; -var emailRadios = ['emailDisabledRadio', 'emailSMTPRadio', 'emailMailgunRadio']; -for (var i = 0; i < emailRadios.length; i++) { - document.getElementById(emailRadios[i]).addEventListener('change', function() { - checkEmailRadio(); - }); -}; - -function checkSSL() { - var label = document.getElementById('emailSSL_TLSLabel'); - if (document.getElementById('emailSSL_TLS').checked) { - label.textContent = 'Use SSL/TLS'; - } else { - label.textContent = 'Use STARTTLS'; - }; -}; -document.getElementById('emailSSL_TLS').addEventListener('change', function() { - checkSSL(); -}); - -function checkPwrEnabled() { - if (document.getElementById('pwrEnabled').checked) { - document.getElementById('pwrArea').style.display = ''; - } else { - document.getElementById('pwrArea').style.display = 'none'; - }; -}; -var pwrEnabled = document.getElementById('pwrEnabled'); -pwrEnabled.addEventListener('change', function() { - checkPwrEnabled(); -}); - -function checkInvEnabled() { - if (document.getElementById('invEnabled').checked) { - document.getElementById('invArea').style.display = ''; - } else { - document.getElementById('invArea').style.display = 'none'; - }; -}; -document.getElementById('invEnabled').addEventListener('change', function() { - checkInvEnabled(); -}); - -function checkValEnabled() { - if (document.getElementById('valEnabled').checked) { - document.getElementById('valArea').style.display = ''; - } else { - document.getElementById('valArea').style.display = 'none'; - }; -}; -document.getElementById('valEnabled').addEventListener('change', function() { - checkValEnabled(); -}); -checkValEnabled(); -checkInvEnabled(); -checkSSL(); -checkAuthRadio(); -checkEmailRadio(); -checkPwrEnabled(); - -var jfValid = false -document.getElementById('jfTestButton').onclick = function() { - var testButton = document.getElementById('jfTestButton'); - var nextButton = document.getElementById('jfNextButton'); - var jfData = {}; - jfData['jfHost'] = document.getElementById('jfHost').value; - jfData['jfUser'] = document.getElementById('jfUser').value; - jfData['jfPassword'] = document.getElementById('jfPassword').value; - let valid = true; - for (val in jfData) { - if (jfData[val] == "") { - valid = false; - } - } - if (!valid) { - if (!testButton.classList.contains('btn-danger')) { - testButton.classList.add('btn-danger'); - testButton.textContent = 'Fill out fields above.'; - setTimeout(function() { - if (testButton.classList.contains('btn-danger')) { - testButton.classList.remove('btn-danger'); - testButton.textContent = 'Test'; - } - }, 2000); - } - } else { - testButton.disabled = true; - testButton.innerHTML = - '' + - 'Testing...'; - nextButton.classList.add('disabled'); - nextButton.setAttribute('aria-disabled', 'true'); - var req = new XMLHttpRequest(); - req.open("POST", "/jellyfin/test", true); - req.setRequestHeader('Content-Type', 'application/json; charset=UTF-8'); - req.responseType = 'json'; - req.onreadystatechange = function() { - if (this.readyState == 4) { - testButton.disabled = false; - testButton.className = ''; - if (this.response['success'] == true) { - testButton.classList.add('btn', 'btn-success'); - testButton.textContent = 'Success'; - nextButton.classList.remove('disabled'); - nextButton.setAttribute('aria-disabled', 'false'); - } else { - testButton.classList.add('btn', 'btn-danger'); - testButton.textContent = 'Failed'; - }; - }; - }; - req.send(JSON.stringify(jfData)); - } -}; - -document.getElementById('submitButton').onclick = function() { - var submitButton = document.getElementById('submitButton'); - submitButton.disabled = true; - submitButton.innerHTML = - '' + - 'Submitting...'; - var config = {}; - config['jellyfin'] = {}; - config['ui'] = {}; - config['password_validation'] = {}; - config['email'] = {}; - config['password_resets'] = {}; - config['invite_emails'] = {}; - config['mailgun'] = {}; - config['smtp'] = {}; - config['notifications'] = {}; - // Page 2: Auth - if (document.getElementById('jfAuthRadio').checked) { - config['ui']['jellyfin_login'] = 'true'; - if (document.getElementById('jfAuthAdminOnly').checked) { - config['ui']['admin_only'] = 'true'; - } else { - config['ui']['admin_only'] = 'false' - }; - } else { - config['ui']['username'] = document.getElementById('manualAuthUsername').value; - config['ui']['password'] = document.getElementById('manualAuthPassword').value; - config['ui']['email'] = document.getElementById('manualAuthEmail').value; - }; - // Page 3: Connect to jellyfin - config['jellyfin']['server'] = document.getElementById('jfHost').value; - let publicAddress = document.getElementById('jfPublicHost').value; - if (publicAddress != "") { - config['jellyfin']['public_server'] = publicAddress; - } - config['jellyfin']['username'] = document.getElementById('jfUser').value; - config['jellyfin']['password'] = document.getElementById('jfPassword').value; - // Page 4: Email (Page 5, 6, 7 are only used if this is enabled) - if (document.getElementById('emailDisabledRadio').checked) { - config['password_resets']['enabled'] = 'false'; - config['invite_emails']['enabled'] = 'false'; - config['notifications']['enabled'] = 'false'; - } else { - if (document.getElementById('emailSMTPRadio').checked) { - if (document.getElementById('emailSSL_TLS').checked) { - config['smtp']['encryption'] = 'ssl_tls'; - } else { - config['smtp']['encryption'] = 'starttls'; - }; - config['email']['method'] = 'smtp'; - config['smtp']['server'] = document.getElementById('emailSMTPServer').value; - config['smtp']['port'] = document.getElementById('emailSMTPPort').value; - config['smtp']['password'] = document.getElementById('emailSMTPPassword').value; - config['email']['address'] = document.getElementById('emailSMTPAddress').value; - } else { - config['email']['method'] = 'mailgun'; - config['mailgun']['api_url'] = document.getElementById('emailMailgunURL').value; - config['mailgun']['api_key'] = document.getElementById('emailMailgunKey').value; - config['email']['address'] = document.getElementById('emailMailgunAddress').value; - }; - config['notifications']['enabled'] = document.getElementById('notificationsEnabled').checked.toString(); - // Page 5: Email formatting - config['email']['from'] = document.getElementById('emailSender').value; - config['email']['date_format'] = document.getElementById('emailDateFormat').value; - if (document.getElementById('email24hTimeRadio').checked) { - config['email']['use_24h'] = 'true'; - } else { - config['email']['use_24h'] = 'false'; - }; - config['email']['message'] = document.getElementById('emailMessage').value; - // Page 6: Password Resets - if (document.getElementById('pwrEnabled').checked) { - config['password_resets']['enabled'] = 'true'; - config['password_resets']['watch_directory'] = document.getElementById('pwrJfPath').value; - config['password_resets']['subject'] = document.getElementById('pwrSubject').value; - } else { - config['password_resets']['enabled'] = 'false'; - }; - // Page 7: Invite Emails - if (document.getElementById('invEnabled').checked) { - config['invite_emails']['enabled'] = 'true'; - config['invite_emails']['url_base'] = document.getElementById('invURLBase').value; - config['invite_emails']['subject'] = document.getElementById('invSubject').value; - } else { - config['invite_emails']['enabled'] = 'false'; - }; - }; - // Page 8: Password Validation - if (document.getElementById('valEnabled').checked) { - config['password_validation']['enabled'] = 'true'; - config['password_validation']['min_length'] = document.getElementById('valLength').value; - config['password_validation']['upper'] = document.getElementById('valUpper').value; - config['password_validation']['lower'] = document.getElementById('valLower').value; - config['password_validation']['number'] = document.getElementById('valNumber').value; - config['password_validation']['special'] = document.getElementById('valSpecial').value; - } else { - config['password_validation']['enabled'] = 'false'; - }; - // Page 9: Messages - config['ui']['contact_message'] = document.getElementById('msgContact').value; - config['ui']['help_message'] = document.getElementById('msgHelp').value; - config['ui']['success_message'] = document.getElementById('msgSuccess').value; - // Send it - config["restart-program"] = true; - var req = new XMLHttpRequest(); - req.open("POST", "/config", true); - req.setRequestHeader('Content-Type', 'application/json; charset=UTF-8'); - req.responseType = 'json'; - req.onreadystatechange = function() { - if (this.readyState == 4) { - submitButton.disabled = false; - submitButton.className = ''; - submitButton.classList.add('btn', 'btn-success'); - submitButton.textContent = 'Success'; - }; - }; - req.send(JSON.stringify(config)); -}; diff --git a/data/static/site.webmanifest b/data/static/site.webmanifest deleted file mode 100644 index 42eeed3..0000000 --- a/data/static/site.webmanifest +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "jf-accounts", - "short_name": "jf-accounts", - "icons": [ - { - "src": "/android-chrome-192x192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "/android-chrome-512x512.png", - "sizes": "512x512", - "type": "image/png" - } - ], - "theme_color": "#ffffff", - "background_color": "#ffffff", - "display": "standalone" -} diff --git a/data/templates/404.html b/data/templates/404.html deleted file mode 100644 index 22593ad..0000000 --- a/data/templates/404.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - 404 - jfa-go - - {{ template "header.html" . }} - - - -
-

Page not found.

-

- {{ .contactMessage }} -

-
- - diff --git a/data/templates/admin.html b/data/templates/admin.html deleted file mode 100644 index c1d7885..0000000 --- a/data/templates/admin.html +++ /dev/null @@ -1,473 +0,0 @@ - - - - - {{ template "header.html" . }} - Admin - jfa-go - - - - - - {{ if .ombiEnabled }} - - {{ end }} - - - - - -
- -
- -
-
-
-
Current Invites
-
    -
-
-
-
-
Generate Invite
-
-
-
-
-
- - -
-
- - -
-
- - -
-
-
-
- -
-
- -
- -
-
-
- - - -
-
- - -
- {{ if .email_enabled }} -
- -
-
- -
- -
-
- {{ end }} -
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
Accounts
-
- - - -
-
-
- - - - {{ if .bs5 }} - - {{ else }} - - {{ end }} - - - - - - - -
UsernameEmail AddressLast Active
-
-
-
-
-
-
Settings
-
- -
-
-
-
-
-
-
    -

    Note: * Indicates required field, R Indicates changes require a restart.

    - - - {{ if .ombiEnabled }} - - {{ end }} -
-
-
-
-
-
-
-
-
-

Profiles are applied to users when they create an account. They include things like access rights and homescreen layout. You can create them here.

- - - - - - - - - - - - - -
NameDefaultFromAdmin?Libraries
-
-
-
-
-
-
-
-
-

{{ .contactMessage }}

-
-
- - - - {{ if .ombiEnabled }} - - {{ end }} - - diff --git a/data/templates/form-base.html b/data/templates/form-base.html deleted file mode 100644 index 35f3155..0000000 --- a/data/templates/form-base.html +++ /dev/null @@ -1,10 +0,0 @@ -{{ define "form-base" }} - - -{{ end }} diff --git a/data/templates/form-loader.html b/data/templates/form-loader.html deleted file mode 100644 index 6585322..0000000 --- a/data/templates/form-loader.html +++ /dev/null @@ -1 +0,0 @@ -{{ template "form.html" . }} diff --git a/data/templates/form.html b/data/templates/form.html deleted file mode 100644 index 80c9635..0000000 --- a/data/templates/form.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - {{ template "header.html" . }} - - {{ .lang.pageTitle }} - - - -
-

- {{ .lang.createAccountHeader }} -

-

{{ .helpMessage }}

-

{{ .contactMessage }}

-
-
-
-
-
{{ .lang.accountDetails }}
-
-
-
- - -
- {{ if .username }} -
- - -
- {{ end }} -
- - -
-
- - -
-
- -
-
-
-
-
- {{ if .validate }} -
-
-
{{ .lang.passwordRequirementsHeader }}
-
-
    - {{ range $key, $value := .requirements }} -
  • -
    -
  • - {{ end }} -
-
-
-
- {{ end }} -
-
-
- - {{ template "form-base" . }} - - - diff --git a/data/templates/header.html b/data/templates/header.html deleted file mode 100644 index 5f2975b..0000000 --- a/data/templates/header.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - -{{ if not .bs5 }} - -{{ end }} - -{{ if .bs5 }} - -{{ else }} - -{{ end }} - diff --git a/data/templates/invalidCode.html b/data/templates/invalidCode.html deleted file mode 100644 index 99ed9e0..0000000 --- a/data/templates/invalidCode.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - Invalid Code - jfa-go - - {{ template "header.html" . }} - - - -
-

Invalid Code.

-

The above code is either incorrect, or has expired.

-

{{ .contactMessage }}

-
- - diff --git a/data/templates/setup.html b/data/templates/setup.html deleted file mode 100644 index 526d11f..0000000 --- a/data/templates/setup.html +++ /dev/null @@ -1,374 +0,0 @@ - - - - - - - - - - - Setup - jfa-go - - -
-
-
-
-
-
-
-
Welcome!
-

- You'll need to do a few things to start using jfa-go. Click below to get started, or quit and edit the config file manually. -

- Get Started -
- -
-
-
-
Login
-

- To access the admin page, you'll need to login. Choose how below. -

    -
  • Authorize through Jellyfin: Checks credentials with Jellyfin, allowing you to share login details and grant multiple users access.
  • -
  • Username & Password: Set your own username and password manually.
  • -
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
- - -
-
- - - Your email address is only required if you want to recieve activity notifications. -
-
-

-
- Back - Next -
-
-
-
-
-
Jellyfin
-

- jfa-go needs admin access so that it can create users, as this is currently not permitted via API tokens. - You should create a separate account for it, checking 'Allow this user to manage the server'. You can disable everything else. Once done, enter the credentials here. -

- - -
-
- - -
-
- - -
-
- - -
-
- -
- Back - Next -
-
-
-
-
-
-
Email
-

jfa-go is capable of sending a PIN code when a user tries to reset their password on Jellyfin. One can also choose to send an invite code directly to an email address. This can be done through SMTP or through Mailgun's API. -

-
- - -
-
- - -
-
- - -
-
-
-
- - - Note: SSL/TLS usually uses port 465, whereas STARTTLS usually uses 587. -
-
-
- -
-
- -
-
-
-
- -
-
- -
-
-
-
-
- -
-
- -
-
- -
-
-
-
Notifications
-

Enabling notifications will allow you to choose (per-invite) to recieve emails when an invite expires, or when a new user is created. If you chose to use Manual auth instead of Jellyfin auth previously, make sure you provided an email address.

-
- - - -
-
-

-
- Back - Next -
-
-
-
-
-
Email
-

Just a few more things to get your emails looking great. -

- - -
-
- - -
-
- - -
-
- - -
-
- - -
-

-
- Back - Next -
-
-
-
-
-
Password Resets
-

- When a user tries to reset their password in jellyfin, it informs them that a file has been created, named "passwordreset*.json" where * is a number. jfa-go will then read this file, and send the PIN to the user's email. Try it now, and put the folder that it informs you it put the file in below. Also, if enter a custom email subject if you don't like the default one. -

-
- - -
-
-
- - -
-
- - -
-
-
- Back - Next -
-
-
-
-
-
Invite Emails
-

- Allows you to send an invite code directly to a specified email address. - Since you'll most likely being running this behind a reverse proxy, the program has no way of knowing the address it will be accessed from. This is needed for sending emails with links. Write your URL Base with the protocol and append '/invite', e.g: -

-

-
- - -
-
-
- - -
-
- - -
-
-
- Back - Next -
-
-
-
-
-
Password Validation
-

- Enabling this will display a set of password requirements on the create account page, such as minimum length, uppercase characters, special characters, etc. -

-
- - -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
- Back - Next -
-
-
-
-
-
Help Messages
-

- Just a few little messages that will display in various places. Leave these alone if you want. -

-
- - -
-
- - -
-
- - -
-
- Back - Next -
-
-
-
-
-
Finished!
-

- Press the button below to submit your settings. The program will restart. Once it's done, refresh this page. -

- -
-
-
-
-
-
-
- - - diff --git a/docs/go.mod b/docs/go.mod deleted file mode 100644 index fd8b7c6..0000000 --- a/docs/go.mod +++ /dev/null @@ -1,8 +0,0 @@ -module github.com/hrfee/jfa-go/docs - -go 1.15 - -require ( - github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 - github.com/swaggo/swag v1.6.7 -) diff --git a/email.go b/email.go deleted file mode 100644 index 10bd6c0..0000000 --- a/email.go +++ /dev/null @@ -1,317 +0,0 @@ -package main - -import ( - "bytes" - "context" - "crypto/tls" - "fmt" - "html/template" - "net/smtp" - "strings" - "time" - - jEmail "github.com/jordan-wright/email" - "github.com/knz/strtime" - "github.com/mailgun/mailgun-go/v4" -) - -// implements email sending, right now via smtp or mailgun. -type emailClient interface { - send(address, fromName, fromAddr string, email *Email) error -} - -// Mailgun client implements emailClient. -type Mailgun struct { - client *mailgun.MailgunImpl -} - -func (mg *Mailgun) send(address, fromName, fromAddr string, email *Email) error { - message := mg.client.NewMessage( - fmt.Sprintf("%s <%s>", fromName, fromAddr), - email.subject, - email.text, - address, - ) - message.SetHtml(email.html) - ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) - defer cancel() - _, _, err := mg.client.Send(ctx, message) - return err -} - -// SMTP supports SSL/TLS and STARTTLS; implements emailClient. -type SMTP struct { - sslTLS bool - server string - port int - auth smtp.Auth -} - -func (sm *SMTP) send(address, fromName, fromAddr string, email *Email) error { - e := jEmail.NewEmail() - e.Subject = email.subject - e.From = fmt.Sprintf("%s <%s>", fromName, fromAddr) - e.To = []string{address} - e.Text = []byte(email.text) - e.HTML = []byte(email.html) - server := fmt.Sprintf("%s:%d", sm.server, sm.port) - tlsConfig := &tls.Config{ - InsecureSkipVerify: false, - ServerName: sm.server, - } - var err error - fmt.Println(server) - // err = e.Send(server, sm.auth) - if sm.sslTLS { - err = e.SendWithTLS(server, sm.auth, tlsConfig) - } else { - err = e.SendWithStartTLS(server, sm.auth, tlsConfig) - } - return err -} - -// Emailer contains the email sender, email content, and methods to construct message content. -type Emailer struct { - fromAddr, fromName string - sender emailClient -} - -// Email stores content. -type Email struct { - subject string - html, text string -} - -func (emailer *Emailer) formatExpiry(expiry time.Time, tzaware bool, datePattern, timePattern string) (d, t, expiresIn string) { - d, _ = strtime.Strftime(expiry, datePattern) - t, _ = strtime.Strftime(expiry, timePattern) - currentTime := time.Now() - if tzaware { - currentTime = currentTime.UTC() - } - _, _, days, hours, minutes, _ := timeDiff(expiry, currentTime) - if days != 0 { - expiresIn += fmt.Sprintf("%dd ", days) - } - if hours != 0 { - expiresIn += fmt.Sprintf("%dh ", hours) - } - if minutes != 0 { - expiresIn += fmt.Sprintf("%dm ", minutes) - } - expiresIn = strings.TrimSuffix(expiresIn, " ") - return -} - -// NewEmailer configures and returns a new emailer. -func NewEmailer(app *appContext) *Emailer { - emailer := &Emailer{ - fromAddr: app.config.Section("email").Key("address").String(), - fromName: app.config.Section("email").Key("from").String(), - } - method := app.config.Section("email").Key("method").String() - if method == "smtp" { - sslTls := false - if app.config.Section("smtp").Key("encryption").String() == "ssl_tls" { - sslTls = true - } - username := "" - if u := app.config.Section("smtp").Key("username").MustString(""); u != "" { - username = u - } else { - username = emailer.fromAddr - } - emailer.NewSMTP(app.config.Section("smtp").Key("server").String(), app.config.Section("smtp").Key("port").MustInt(465), username, app.config.Section("smtp").Key("password").String(), sslTls) - } else if method == "mailgun" { - emailer.NewMailgun(app.config.Section("mailgun").Key("api_url").String(), app.config.Section("mailgun").Key("api_key").String()) - } - return emailer -} - -// NewMailgun returns a Mailgun emailClient. -func (emailer *Emailer) NewMailgun(url, key string) { - sender := &Mailgun{ - client: mailgun.NewMailgun(strings.Split(emailer.fromAddr, "@")[1], key), - } - // Mailgun client takes the base url, so we need to trim off the end (e.g 'v3/messages' - if strings.Contains(url, "messages") { - url = url[0:strings.LastIndex(url, "/")] - url = url[0:strings.LastIndex(url, "/")] - } - sender.client.SetAPIBase(url) - emailer.sender = sender -} - -// NewSMTP returns an SMTP emailClient. -func (emailer *Emailer) NewSMTP(server string, port int, username, password string, sslTLS bool) { - emailer.sender = &SMTP{ - auth: smtp.PlainAuth("", username, password, server), - server: server, - port: port, - sslTLS: sslTLS, - } -} - -func (emailer *Emailer) constructInvite(code string, invite Invite, app *appContext) (*Email, error) { - email := &Email{ - subject: app.config.Section("invite_emails").Key("subject").String(), - } - expiry := invite.ValidTill - d, t, expiresIn := emailer.formatExpiry(expiry, false, app.datePattern, app.timePattern) - message := app.config.Section("email").Key("message").String() - inviteLink := app.config.Section("invite_emails").Key("url_base").String() - inviteLink = fmt.Sprintf("%s/%s", inviteLink, code) - - for _, key := range []string{"html", "text"} { - fpath := app.config.Section("invite_emails").Key("email_" + key).String() - tpl, err := template.ParseFiles(fpath) - if err != nil { - return nil, err - } - var tplData bytes.Buffer - err = tpl.Execute(&tplData, map[string]string{ - "expiry_date": d, - "expiry_time": t, - "expires_in": expiresIn, - "invite_link": inviteLink, - "message": message, - }) - if err != nil { - return nil, err - } - if key == "html" { - email.html = tplData.String() - } else { - email.text = tplData.String() - } - } - return email, nil -} - -func (emailer *Emailer) constructExpiry(code string, invite Invite, app *appContext) (*Email, error) { - email := &Email{ - subject: "Notice: Invite expired", - } - expiry := app.formatDatetime(invite.ValidTill) - for _, key := range []string{"html", "text"} { - fpath := app.config.Section("notifications").Key("expiry_" + key).String() - tpl, err := template.ParseFiles(fpath) - if err != nil { - return nil, err - } - var tplData bytes.Buffer - err = tpl.Execute(&tplData, map[string]string{ - "code": code, - "expiry": expiry, - }) - if err != nil { - return nil, err - } - if key == "html" { - email.html = tplData.String() - } else { - email.text = tplData.String() - } - } - return email, nil -} - -func (emailer *Emailer) constructCreated(code, username, address string, invite Invite, app *appContext) (*Email, error) { - email := &Email{ - subject: "Notice: User created", - } - created := app.formatDatetime(invite.Created) - var tplAddress string - if app.config.Section("email").Key("no_username").MustBool(false) { - tplAddress = "n/a" - } else { - tplAddress = address - } - for _, key := range []string{"html", "text"} { - fpath := app.config.Section("notifications").Key("created_" + key).String() - tpl, err := template.ParseFiles(fpath) - if err != nil { - return nil, err - } - var tplData bytes.Buffer - err = tpl.Execute(&tplData, map[string]string{ - "code": code, - "username": username, - "address": tplAddress, - "time": created, - }) - if err != nil { - return nil, err - } - if key == "html" { - email.html = tplData.String() - } else { - email.text = tplData.String() - } - } - return email, nil -} - -func (emailer *Emailer) constructReset(pwr PasswordReset, app *appContext) (*Email, error) { - email := &Email{ - subject: app.config.Section("password_resets").Key("subject").MustString("Password reset - Jellyfin"), - } - d, t, expiresIn := emailer.formatExpiry(pwr.Expiry, true, app.datePattern, app.timePattern) - message := app.config.Section("email").Key("message").String() - for _, key := range []string{"html", "text"} { - fpath := app.config.Section("password_resets").Key("email_" + key).String() - tpl, err := template.ParseFiles(fpath) - if err != nil { - return nil, err - } - var tplData bytes.Buffer - err = tpl.Execute(&tplData, map[string]string{ - "username": pwr.Username, - "expiry_date": d, - "expiry_time": t, - "expires_in": expiresIn, - "pin": pwr.Pin, - "message": message, - }) - if err != nil { - return nil, err - } - if key == "html" { - email.html = tplData.String() - } else { - email.text = tplData.String() - } - } - return email, nil -} - -func (emailer *Emailer) constructDeleted(reason string, app *appContext) (*Email, error) { - email := &Email{ - subject: app.config.Section("deletion").Key("subject").MustString("Your account was deleted - Jellyfin"), - } - for _, key := range []string{"html", "text"} { - fpath := app.config.Section("deletion").Key("email_" + key).String() - tpl, err := template.ParseFiles(fpath) - if err != nil { - return nil, err - } - var tplData bytes.Buffer - err = tpl.Execute(&tplData, map[string]string{ - "reason": reason, - }) - if err != nil { - return nil, err - } - if key == "html" { - email.html = tplData.String() - } else { - email.text = tplData.String() - } - } - return email, nil -} - -// calls the send method in the underlying emailClient. -func (emailer *Emailer) send(address string, email *Email) error { - return emailer.sender.send(address, emailer.fromName, emailer.fromAddr, email) -} diff --git a/esbuild.sh b/esbuild.sh deleted file mode 100755 index a9cc078..0000000 --- a/esbuild.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/bash -# set +e -# npx tsc -p ts/ -# set -e -npx esbuild ts/* --outdir=data/static --minify diff --git a/go.mod b/go.mod deleted file mode 100644 index d9eae46..0000000 --- a/go.mod +++ /dev/null @@ -1,54 +0,0 @@ -module github.com/hrfee/jfa-go - -go 1.14 - -replace github.com/hrfee/jfa-go/docs => ./docs - -replace github.com/hrfee/jfa-go/jfapi => ./jfapi - -replace github.com/hrfee/jfa-go/common => ./common - -replace github.com/hrfee/jfa-go/ombi => ./ombi - -require ( - github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect - github.com/dgrijalva/jwt-go v3.2.0+incompatible - github.com/fsnotify/fsnotify v1.4.9 - github.com/gin-contrib/pprof v1.3.0 - github.com/gin-contrib/static v0.0.0-20200916080430-d45d9a37d28e - github.com/gin-gonic/gin v1.6.3 - github.com/go-chi/chi v4.1.2+incompatible // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-playground/validator/v10 v10.4.1 // indirect - github.com/gofrs/uuid v3.3.0+incompatible // indirect - github.com/golang/protobuf v1.4.3 - github.com/google/uuid v1.1.2 // indirect - github.com/hrfee/jfa-go/common v0.0.0-20201112212552-b6f3cd7c1f71 - github.com/hrfee/jfa-go/docs v0.0.0-20201112212552-b6f3cd7c1f71 - github.com/hrfee/jfa-go/jfapi v0.0.0-20201112212552-b6f3cd7c1f71 - github.com/hrfee/jfa-go/ombi v0.0.0-20201112212552-b6f3cd7c1f71 - github.com/jordan-wright/email v4.0.1-0.20200917010138-e1c00e156980+incompatible - github.com/json-iterator/go v1.1.10 // indirect - github.com/knz/strtime v0.0.0-20200924090105-187c67f2bf5e - github.com/lithammer/shortuuid/v3 v3.0.4 - github.com/logrusorgru/aurora/v3 v3.0.0 - github.com/mailgun/mailgun-go/v4 v4.3.0 - github.com/mailru/easyjson v0.7.6 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.1 // indirect - github.com/pdrum/swagger-automation v0.0.0-20190629163613-c8c7c80ba858 - github.com/pkg/errors v0.9.1 // indirect - github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/swaggo/files v0.0.0-20190704085106-630677cd5c14 - github.com/swaggo/gin-swagger v1.3.0 - github.com/swaggo/swag v1.7.0 // indirect - github.com/ugorji/go v1.2.0 // indirect - github.com/urfave/cli/v2 v2.3.0 // indirect - golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9 // indirect - golang.org/x/net v0.0.0-20201110031124-69a78807bb2b // indirect - golang.org/x/sys v0.0.0-20201113233024-12cec1faf1ba // indirect - golang.org/x/text v0.3.4 // indirect - google.golang.org/protobuf v1.25.0 // indirect - gopkg.in/ini.v1 v1.62.0 - gopkg.in/yaml.v2 v2.3.0 // indirect -) diff --git a/go.sum b/go.sum deleted file mode 100644 index 421c4c0..0000000 --- a/go.sum +++ /dev/null @@ -1,431 +0,0 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= -github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= -github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v1.0.2 h1:KPldsxuKGsS2FPWsNeg9ZO18aCrGKujPoWXn2yo+KQM= -github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= -github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gin-contrib/gzip v0.0.1/go.mod h1:fGBJBCdt6qCZuCAOwWuFhBB4OOq9EFqlo5dEaFhhu5w= -github.com/gin-contrib/pprof v1.3.0 h1:G9eK6HnbkSqDZBYbzG4wrjCsA4e+cvYAHUZw6W+W9K0= -github.com/gin-contrib/pprof v1.3.0/go.mod h1:waMjT1H9b179t3CxuG1cV3DHpga6ybizwfBaM5OXaB0= -github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= -github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= -github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= -github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-contrib/static v0.0.0-20191128031702-f81c604d8ac2 h1:xLG16iua01X7Gzms9045s2Y2niNpvSY/Zb1oBwgNYZY= -github.com/gin-contrib/static v0.0.0-20191128031702-f81c604d8ac2/go.mod h1:VhW/Ch/3FhimwZb8Oj+qJmdMmoB8r7lmJ5auRjm50oQ= -github.com/gin-contrib/static v0.0.0-20200815103939-31fb0c56a3d1 h1:plQYoJeO9lI8Ag0xZy7dDF8FMwIOHsQylKjcclknvIc= -github.com/gin-contrib/static v0.0.0-20200815103939-31fb0c56a3d1/go.mod h1:VhW/Ch/3FhimwZb8Oj+qJmdMmoB8r7lmJ5auRjm50oQ= -github.com/gin-contrib/static v0.0.0-20200916080430-d45d9a37d28e h1:8bZpGwoPxkaivQPrAbWl+7zjjUcbFUnYp7yQcx2r2N0= -github.com/gin-contrib/static v0.0.0-20200916080430-d45d9a37d28e/go.mod h1:VhW/Ch/3FhimwZb8Oj+qJmdMmoB8r7lmJ5auRjm50oQ= -github.com/gin-gonic/gin v1.3.0/go.mod h1:7cKuhb5qV2ggCFctp2fJQ+ErvciLZrIeoOSOm6mUr7Y= -github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= -github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do= -github.com/gin-gonic/gin v1.6.2/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= -github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= -github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= -github.com/go-chi/chi v4.0.0+incompatible h1:SiLLEDyAkqNnw+T/uDTf3aFB9T4FTrwMpuYrgaRcnW4= -github.com/go-chi/chi v4.0.0+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= -github.com/go-chi/chi v4.1.2+incompatible h1:fGFk2Gmi/YKXk0OmGfBh0WgmN3XB8lVnEyNz34tQRec= -github.com/go-chi/chi v4.1.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= -github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.19.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.19.4 h1:3Vw+rh13uq2JFNxgnMTGE1rnoieU9FmyE1gvnyylsYg= -github.com/go-openapi/jsonreference v0.19.4/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/spec v0.19.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.19.4 h1:ixzUSnHTd6hCemgtAJgluaTSGYpLNpJY4mA2DIkdOAo= -github.com/go-openapi/spec v0.19.4/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/spec v0.19.9 h1:9z9cbFuZJ7AcvOHKIY+f6Aevb4vObNDkTEyoMfO7rAc= -github.com/go-openapi/spec v0.19.9/go.mod h1:vqK/dIdLGCosfvYsQV3WfC7N3TiZSnGY2RZKoFK7X28= -github.com/go-openapi/spec v0.19.10 h1:pcNevfYytLaOQuTju0wm6OqcqU/E/pRwuSGigrLTI28= -github.com/go-openapi/spec v0.19.10/go.mod h1:vqK/dIdLGCosfvYsQV3WfC7N3TiZSnGY2RZKoFK7X28= -github.com/go-openapi/spec v0.19.12 h1:OO9WrvhDwtiMY/Opr1j1iFZzirI3JW4/bxNFRcntAr4= -github.com/go-openapi/spec v0.19.12/go.mod h1:gwrgJS15eCUgjLpMjBJmbZezCsw88LmgeEip0M63doA= -github.com/go-openapi/spec v0.19.13 h1:AcZVcWsrfW7LqyHKVbTZYpFF7jQcMxmAsWrw2p/b9ew= -github.com/go-openapi/spec v0.19.13/go.mod h1:gwrgJS15eCUgjLpMjBJmbZezCsw88LmgeEip0M63doA= -github.com/go-openapi/spec v0.19.14 h1:r4fbYFo6N4ZelmSX8G6p+cv/hZRXzcuqQIADGT1iNKM= -github.com/go-openapi/spec v0.19.14/go.mod h1:gwrgJS15eCUgjLpMjBJmbZezCsw88LmgeEip0M63doA= -github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.9 h1:1IxuqvBUU3S2Bi4YC7tlP9SJF1gVpCvqN0T2Qof4azE= -github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= -github.com/go-openapi/swag v0.19.10 h1:A1SWXruroGP15P1sOiegIPbaKio+G9N5TwWTFaVPmAU= -github.com/go-openapi/swag v0.19.10/go.mod h1:Uc0gKkdR+ojzsEpjh39QChyu92vPgIr72POcgHMAgSY= -github.com/go-openapi/swag v0.19.11 h1:RFTu/dlFySpyVvJDfp/7674JY4SDglYWKztbiIGFpmc= -github.com/go-openapi/swag v0.19.11/go.mod h1:Uc0gKkdR+ojzsEpjh39QChyu92vPgIr72POcgHMAgSY= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= -github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/go-playground/validator/v10 v10.3.0 h1:nZU+7q+yJoFmwvNgv/LnPUkwPal62+b2xXj0AU1Es7o= -github.com/go-playground/validator/v10 v10.3.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/go-playground/validator/v10 v10.4.0 h1:72qIR/m8ybvL8L5TIyfgrigqkrw7kVYAvjEvpT85l70= -github.com/go-playground/validator/v10 v10.4.0/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= -github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= -github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= -github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/jordan-wright/email v0.0.0-20200602115436-fd8a7622303e h1:OGunVjqY7y4U4laftpEHv+mvZBlr7UGimJXKEGQtg48= -github.com/jordan-wright/email v0.0.0-20200602115436-fd8a7622303e/go.mod h1:Fy2gCFfZhay8jplf/Csj6cyH/oshQTkLQYZbKkcV+SY= -github.com/jordan-wright/email v4.0.1-0.20200917010138-e1c00e156980+incompatible h1:CL0ooBNfbNyJTJATno+m0h+zM5bW6v7fKlboKUGP/dI= -github.com/jordan-wright/email v4.0.1-0.20200917010138-e1c00e156980+incompatible/go.mod h1:1c7szIrayyPPB/987hsnvNzLushdWf4o/79s3P08L8A= -github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/knz/strtime v0.0.0-20200318182718-be999391ffa9 h1:GQE1iatYDRrIidq4Zf/9ZzKWyrTk2sXOYc1JADbkAjQ= -github.com/knz/strtime v0.0.0-20200318182718-be999391ffa9/go.mod h1:4ZxfWkxwtc7dBeifERVVWRy9F9rTU9p0yCDgeCtlius= -github.com/knz/strtime v0.0.0-20200924090105-187c67f2bf5e h1:ViPE0JEOvtw5I0EGUiFSr2VNKGNU+3oBT+oHbDXHbxk= -github.com/knz/strtime v0.0.0-20200924090105-187c67f2bf5e/go.mod h1:4ZxfWkxwtc7dBeifERVVWRy9F9rTU9p0yCDgeCtlius= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/labstack/echo v3.3.10+incompatible h1:pGRcYk231ExFAyoAjAfD85kQzRJCRI8bbnE7CX5OEgg= -github.com/labstack/echo v3.3.10+incompatible/go.mod h1:0INS7j/VjnFxD4E2wkz67b8cVwCLbBmJyDaka6Cmk1s= -github.com/labstack/gommon v0.2.9 h1:heVeuAYtevIQVYkGj6A41dtfT91LrvFG220lavpWhrU= -github.com/labstack/gommon v0.2.9/go.mod h1:E8ZTmW9vw5az5/ZyHWCp0Lw4OH2ecsaBP1C/NKavGG4= -github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= -github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/lithammer/shortuuid v1.0.0 h1:kdcbvjGVEgqeVeDIRtnANOi/F6ftbKrtbxY+cjQmK1Q= -github.com/lithammer/shortuuid v3.0.0+incompatible h1:NcD0xWW/MZYXEHa6ITy6kaXN5nwm/V115vj2YXfhS0w= -github.com/lithammer/shortuuid/v3 v3.0.4 h1:uj4xhotfY92Y1Oa6n6HUiFn87CdoEHYUlTy0+IgbLrs= -github.com/lithammer/shortuuid/v3 v3.0.4/go.mod h1:RviRjexKqIzx/7r1peoAITm6m7gnif/h+0zmolKJjzw= -github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczGlG91VSDkswnjF5A8= -github.com/logrusorgru/aurora/v3 v3.0.0 h1:R6zcoZZbvVcGMvDCKo45A9U/lzYyzl5NfYIvznmDfE4= -github.com/logrusorgru/aurora/v3 v3.0.0/go.mod h1:vsR12bk5grlLvLXAYrBsb5Oc/N+LxAlxggSjiwMnCUc= -github.com/mailgun/mailgun-go v1.1.1 h1:mjMcm4qz+SbjAYbGJ6DKROViKtO5S0YjpuOUxQfdr2A= -github.com/mailgun/mailgun-go v2.0.0+incompatible h1:0FoRHWwMUctnd8KIR3vtZbqdfjpIMxOZgcSa51s8F8o= -github.com/mailgun/mailgun-go/v4 v4.1.3 h1:KLa5EZaOMMeyvY/lfAhWxv9ealB3mtUsMz0O9XmTtP0= -github.com/mailgun/mailgun-go/v4 v4.1.3/go.mod h1:R9kHUQBptF4iSEjhriCQizplCDwrnDShy8w/iPiOfaM= -github.com/mailgun/mailgun-go/v4 v4.2.0 h1:AAt7TwR98Pog7zAYK61SW7ikykFFmCovtix3vvS2cK4= -github.com/mailgun/mailgun-go/v4 v4.2.0/go.mod h1:R9kHUQBptF4iSEjhriCQizplCDwrnDShy8w/iPiOfaM= -github.com/mailgun/mailgun-go/v4 v4.3.0 h1:9nAF7LI3k6bfDPbMZQMMl63Q8/vs+dr1FUN8eR1XMhk= -github.com/mailgun/mailgun-go/v4 v4.3.0/go.mod h1:fWuBI2iaS/pSSyo6+EBpHjatQO3lV8onwqcRy7joSJI= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM= -github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/mailru/easyjson v0.7.2 h1:V9ecaZWDYm7v9uJ15RZD6DajMu5sE0hdep0aoDwT9g4= -github.com/mailru/easyjson v0.7.2/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mailru/easyjson v0.7.3 h1:M6wcO9gFHCIPynXGu4iA+NMs//FCgFUWR2jxqV3/+Xk= -github.com/mailru/easyjson v0.7.3/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/pdrum/swagger-automation v0.0.0-20190629163613-c8c7c80ba858 h1:lgbJiJQx8bXo+eM88AFdd0VxUvaTLzCBXpK+H9poJ+Y= -github.com/pdrum/swagger-automation v0.0.0-20190629163613-c8c7c80ba858/go.mod h1:y02HeaN0visd95W6cEX2NXDv5sCwyqfzucWTdDGEwYY= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/swaggo/files v0.0.0-20190704085106-630677cd5c14 h1:PyYN9JH5jY9j6av01SpfRMb+1DWg/i3MbGOKPxJ2wjM= -github.com/swaggo/files v0.0.0-20190704085106-630677cd5c14/go.mod h1:gxQT6pBGRuIGunNf/+tSOB5OHvguWi8Tbt82WOkf35E= -github.com/swaggo/gin-swagger v1.2.0 h1:YskZXEiv51fjOMTsXrOetAjrMDfFaXD79PEoQBOe2W0= -github.com/swaggo/gin-swagger v1.2.0/go.mod h1:qlH2+W7zXGZkczuL+r2nEBR2JTT+/lX05Nn6vPhc7OI= -github.com/swaggo/gin-swagger v1.3.0 h1:eOmp7r57oUgZPw2dJOjcGNMse9cvXcI4tTqBcnZtPsI= -github.com/swaggo/gin-swagger v1.3.0/go.mod h1:oy1BRA6WvgtCp848lhxce7BnWH4C8Bxa0m5SkWx+cS0= -github.com/swaggo/swag v1.5.1/go.mod h1:1Bl9F/ZBpVWh22nY0zmYyASPO1lI/zIwRDrpZU+tv8Y= -github.com/swaggo/swag v1.6.7 h1:e8GC2xDllJZr3omJkm9YfmK0Y56+rMO3cg0JBKNz09s= -github.com/swaggo/swag v1.6.7/go.mod h1:xDhTyuFIujYiN3DKWC/H/83xcfHp+UE/IzWWampG7Zc= -github.com/swaggo/swag v1.6.8 h1:z3ZNcpJs/NLMpZcKqXUsBELmmY2Ocy09JXKx5gu3L4M= -github.com/swaggo/swag v1.6.8/go.mod h1:a0IpNeMfGidNOcm2TsqODUh9JHdHu3kxDA0UlGbBKjI= -github.com/swaggo/swag v1.6.9 h1:BukKRwZjnEcUxQt7Xgfrt9fpav0hiWw9YimdNO9wssw= -github.com/swaggo/swag v1.6.9/go.mod h1:a0IpNeMfGidNOcm2TsqODUh9JHdHu3kxDA0UlGbBKjI= -github.com/swaggo/swag v1.7.0 h1:5bCA/MTLQoIqDXXyHfOpMeDvL9j68OY/udlK4pQoo4E= -github.com/swaggo/swag v1.7.0/go.mod h1:BdPIL73gvS9NBsdi7M1JOxLvlbfvNRaBP8m6WT6Aajo= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go v1.1.5-pre/go.mod h1:FwP/aQVg39TXzItUBMwnWp9T9gPQnXw4Poh4/oBQZ/0= -github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go v1.1.9 h1:SObrQTaSuP8WOv2WNCj8gECiNSJIUvk3Q7N26c96Gws= -github.com/ugorji/go v1.1.9/go.mod h1:chLrngdsg43geAaeId+nXO57YsDdl5OZqd/QtBiD19g= -github.com/ugorji/go v1.1.13/go.mod h1:jxau1n+/wyTGLQoCkjok9r5zFa/FxT6eI5HiHKQszjc= -github.com/ugorji/go v1.2.0 h1:6eXlzYLLwZwXroJx9NyqbYcbv/d93twiOzQLDewE6qM= -github.com/ugorji/go v1.2.0/go.mod h1:1ny++pKMXhLWrwWV5Nf+CbOuZJhMoaFD+0GMFfd8fEc= -github.com/ugorji/go/codec v0.0.0-20181022190402-e5e69e061d4f/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.5-pre/go.mod h1:tULtS6Gy1AE1yCENaw4Vb//HLH5njI2tfCQDUqRd8fI= -github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.1.9 h1:J/7hhpkQwgypRNvaeh/T5gzJ2gEI/l8S3qyRrdEa1fA= -github.com/ugorji/go/codec v1.1.9/go.mod h1:+SWgpdqOgdW5sBaiDfkHilQ1SxQ1hBkq/R+kHfL7Suo= -github.com/ugorji/go/codec v1.1.13/go.mod h1:oNVt3Dq+FO91WNQ/9JnHKQP2QJxTzoN7wCBFCq1OeuU= -github.com/ugorji/go/codec v1.2.0 h1:As6RccOIlbm9wHuWYMlB30dErcI+4WiKWsYsmPkyrUw= -github.com/ugorji/go/codec v1.2.0/go.mod h1:dXvG35r7zTX6QImXOSFhGMmKtX+wJ7VTWzGvYQGIjBs= -github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli/v2 v2.1.1 h1:Qt8FeAtxE/vfdrLmR3rxR6JRE0RoVmbXu8+6kZtYU4k= -github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= -github.com/urfave/cli/v2 v2.2.0 h1:JTTnM6wKzdA0Jqodd966MVj4vWbbquZykeX1sKbe2C4= -github.com/urfave/cli/v2 v2.2.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= -github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M= -github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= -github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v1.0.1 h1:tY9CJiPnMXf1ERmG2EyK7gNUd+c6RKGD0IfU8WdUSz8= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9 h1:umElSU9WZirRdgu2yFHY0ayQkEnKiOC1TtM3fWXFnoU= -golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190611141213-3f473d35a33a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200923182212-328152dc79b1 h1:Iu68XRPd67wN4aRGGWwwq6bZo/25jR6uu52l/j2KkUE= -golang.org/x/net v0.0.0-20200923182212-328152dc79b1/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200927032502-5d4f70055728 h1:5wtQIAulKU5AbLQOkjxl32UufnIOqgBX72pS0AV14H0= -golang.org/x/net v0.0.0-20200927032502-5d4f70055728/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0 h1:wBouT66WTYFXdxfVdz9sVWARVd/2vfGcmI45D2gj45M= -golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201016165138-7b1cca2348c0 h1:5kGOVHlq0euqwzgTC9Vu15p6fV1Wi0ArVi8da2urnVg= -golang.org/x/net v0.0.0-20201016165138-7b1cca2348c0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102 h1:42cLlJJdEh+ySyeUUbEQ5bsTiq8voBeTuweGVkY6Puw= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181228144115-9a3f9b0469bb/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190610200419-93c9922d18ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1 h1:sIky/MyNRSHTrdxfsiUSS4WIAMvInbeXljJz+jDjeYE= -golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed h1:J22ig1FUekjjkmZUM7pTKixYm8DvrYsvrBZdunYeIuQ= -golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200929083018-4d22bbb62b3c h1:/h0vtH0PyU0xAoZJVcRw1k0Ng+U0JAy3QDiFmppIlIE= -golang.org/x/sys v0.0.0-20200929083018-4d22bbb62b3c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201113233024-12cec1faf1ba h1:xmhUJGQGbxlod18iJGqVEp9cHIPLl7QiX2aA3to708s= -golang.org/x/sys v0.0.0-20201113233024-12cec1faf1ba/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606050223-4d9ae51c2468/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190611222205-d73e1c7e250b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59 h1:QjA/9ArTfVTLfEhClDCG7SGrZkZixxWpwNCDiwJfh88= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200820010801-b793a1359eac/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200923182640-463111b69878 h1:VUw1+Jf6KJPf82mbTQMia6HCnNMv2BbAipkEZ4KTcqQ= -golang.org/x/tools v0.0.0-20200923182640-463111b69878/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20200924182824-0f1c53950d78 h1:3JUoxVhcskhsIDEc7vg0MUUEpmPPN5TfG+E97z/Fn90= -golang.org/x/tools v0.0.0-20200924182824-0f1c53950d78/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20200929191002-f1e51e6b9437 h1:XSFqH8m531iIGazX5lrUC9j3slbwsZ1GFByqdUrLqmI= -golang.org/x/tools v0.0.0-20200929191002-f1e51e6b9437/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201008184944-d01b322e6f06 h1:w9ail9jFLaySAm61Zjhciu0LQ5i8YTy2pimlNLx4uuk= -golang.org/x/tools v0.0.0-20201008184944-d01b322e6f06/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201017001424-6003fad69a88 h1:ZB1XYzdDo7c/O48jzjMkvIjnC120Z9/CwgDWhePjQdQ= -golang.org/x/tools v0.0.0-20201017001424-6003fad69a88/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9 h1:sEvmEcJVKBNUvgCUClbUQeHOAa9U0I2Ce1BooMvVCY4= -golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201103235415-b653051172e4 h1:Qe0EMgvVYb6tmJhJHljCj3gS96hvSTkGNaIzp/ivq10= -golang.org/x/tools v0.0.0-20201103235415-b653051172e4/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201113202037-1643af1435f3 h1:7R7+wzd5VuLvCNyHZ/MG511kkoP/DBEzkbh8qUsFbY8= -golang.org/x/tools v0.0.0-20201113202037-1643af1435f3/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201114224030-61ea331ec02b h1:Ych5r0Z6MLML1fgf5hTg9p5bV56Xqx9xv9hLgMBATWs= -golang.org/x/tools v0.0.0-20201114224030-61ea331ec02b/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201120155355-20be4ac4bd6e h1:t96dS3DO8DGjawSLJL/HIdz8CycAd2v07XxqB3UPTi0= -golang.org/x/tools v0.0.0-20201120155355-20be4ac4bd6e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= -gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= -gopkg.in/ini.v1 v1.57.0 h1:9unxIsFcTt4I55uWluz+UmL95q4kdJ0buvQ1ZIqVQww= -gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.60.0 h1:P5ZzC7RJO04094NJYlEnBdFK2wwmnCAy/+7sAzvWs60= -gopkg.in/ini.v1 v1.60.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.61.0 h1:LBCdW4FmFYL4s/vDZD1RQYX7oAR6IjujCYgMdbHBR10= -gopkg.in/ini.v1 v1.61.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU= -gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/images/README.md b/images/README.md deleted file mode 100644 index 248eb80..0000000 --- a/images/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Images - -This holds any images on the main README, and the base files for the icons and banner. The font used, like Jellyfin, is [Quicksand](https://fonts.google.com/specimen/Quicksand) by Andrew Paglinawan. - -"Go" text logo and Gopher image: Copyright 2018 The Go Authors. All rights reserved. -https://creativecommons.org/licenses/by/3.0/legalcode diff --git a/images/accounts.png b/images/accounts.png deleted file mode 100644 index dc26621..0000000 Binary files a/images/accounts.png and /dev/null differ diff --git a/images/demo.gif b/images/demo.gif deleted file mode 100644 index 6793691..0000000 Binary files a/images/demo.gif and /dev/null differ diff --git a/images/invites.png b/images/invites.png index fef7590..db118da 100644 Binary files a/images/invites.png and b/images/invites.png differ diff --git a/images/jfa-go-banner-wide.svg b/images/jfa-go-banner-wide.svg deleted file mode 120000 index 7b6d367..0000000 --- a/images/jfa-go-banner-wide.svg +++ /dev/null @@ -1 +0,0 @@ -../data/static/banner.svg \ No newline at end of file diff --git a/images/jfa-go-icon.png b/images/jfa-go-icon.png deleted file mode 100755 index c87f4e4..0000000 Binary files a/images/jfa-go-icon.png and /dev/null differ diff --git a/images/jfa-go-icon.svg b/images/jfa-go-icon.svg deleted file mode 100755 index 45a5038..0000000 --- a/images/jfa-go-icon.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/images/jfa-go-social.png b/images/jfa-go-social.png deleted file mode 100644 index a1c8f56..0000000 Binary files a/images/jfa-go-social.png and /dev/null differ diff --git a/images/jfa-go-social.svg b/images/jfa-go-social.svg deleted file mode 100644 index c69d10d..0000000 --- a/images/jfa-go-social.svg +++ /dev/null @@ -1,337 +0,0 @@ - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ( ) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/index.html b/index.html new file mode 100644 index 0000000..f166eb5 --- /dev/null +++ b/index.html @@ -0,0 +1,371 @@ + + + + + + + {{ .lang.pageTitle }} + + +
+
+
+
+ Invites + Accounts + Settings +
+
+
+
+
+ Logout + Theme +
+
+
+ Invites +
+
+ +
+ Expires in 30m + Delete + +
+
+ +
+
+
+ Create +
+
+ +
+ +
+ +
+ +
+ +
+ +
+
+
+ +
+ + +
+ +
+ +
+ +
+ + +
+ Create +
+
+
+
+ + + + diff --git a/jfa-go.service b/jfa-go.service deleted file mode 100644 index 8d50f27..0000000 --- a/jfa-go.service +++ /dev/null @@ -1,11 +0,0 @@ -# Systemd service file for jfa-go. Install to ~/.config/systemd/user. - -[Unit] -Description=A web app for managing users on Jellyfin - -[Service] -# Modify this to the path to your executable, if necessary. -ExecStart=/opt/jfa-go/jfa-go - -[Install] -WantedBy=default.target diff --git a/jfapi/go.mod b/jfapi/go.mod deleted file mode 100644 index df09909..0000000 --- a/jfapi/go.mod +++ /dev/null @@ -1,7 +0,0 @@ -module github.com/hrfee/jfa-go/jfapi - -go 1.15 - -replace github.com/hrfee/jfa-go/common => ../common - -require github.com/hrfee/jfa-go/common v0.0.0-00010101000000-000000000000 diff --git a/jfapi/jfapi.go b/jfapi/jfapi.go deleted file mode 100644 index c75615d..0000000 --- a/jfapi/jfapi.go +++ /dev/null @@ -1,364 +0,0 @@ -package jfapi - -import ( - "bytes" - "compress/gzip" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "net/http" - "strings" - "time" - - "github.com/hrfee/jfa-go/common" -) - -type serverInfo struct { - LocalAddress string `json:"LocalAddress"` - Name string `json:"ServerName"` - Version string `json:"Version"` - OS string `json:"OperatingSystem"` - ID string `json:"Id"` -} - -// Jellyfin represents a running Jellyfin instance. -type Jellyfin struct { - Server string - client string - version string - device string - deviceID string - useragent string - auth string - header map[string]string - ServerInfo serverInfo - Username string - password string - Authenticated bool - AccessToken string - userID string - httpClient *http.Client - loginParams map[string]string - userCache []map[string]interface{} - CacheExpiry time.Time - cacheLength int - noFail bool - timeoutHandler common.TimeoutHandler -} - -// NewJellyfin returns a new Jellyfin object. -func NewJellyfin(server, client, version, device, deviceID string, timeoutHandler common.TimeoutHandler, cacheTimeout int) (*Jellyfin, error) { - jf := &Jellyfin{} - jf.Server = server - jf.client = client - jf.version = version - jf.device = device - jf.deviceID = deviceID - jf.useragent = fmt.Sprintf("%s/%s", client, version) - jf.timeoutHandler = timeoutHandler - jf.auth = fmt.Sprintf("MediaBrowser Client=\"%s\", Device=\"%s\", DeviceId=\"%s\", Version=\"%s\"", client, device, deviceID, version) - jf.header = map[string]string{ - "Accept": "application/json", - "Content-type": "application/json; charset=UTF-8", - "X-Application": jf.useragent, - "Accept-Charset": "UTF-8,*", - "Accept-Encoding": "gzip", - "User-Agent": jf.useragent, - "X-Emby-Authorization": jf.auth, - } - jf.httpClient = &http.Client{ - Timeout: 10 * time.Second, - } - infoURL := fmt.Sprintf("%s/System/Info/Public", server) - req, _ := http.NewRequest("GET", infoURL, nil) - resp, err := jf.httpClient.Do(req) - defer jf.timeoutHandler() - if err == nil { - data, _ := ioutil.ReadAll(resp.Body) - json.Unmarshal(data, &jf.ServerInfo) - } - jf.cacheLength = cacheTimeout - jf.CacheExpiry = time.Now() - return jf, nil -} - -// Authenticate attempts to authenticate using a username & password -func (jf *Jellyfin) Authenticate(username, password string) (map[string]interface{}, int, error) { - jf.Username = username - jf.password = password - jf.loginParams = map[string]string{ - "Username": username, - "Pw": password, - "Password": password, - } - buffer := &bytes.Buffer{} - encoder := json.NewEncoder(buffer) - encoder.SetEscapeHTML(false) - err := encoder.Encode(jf.loginParams) - if err != nil { - return nil, 0, err - } - // loginParams, _ := json.Marshal(jf.loginParams) - url := fmt.Sprintf("%s/Users/authenticatebyname", jf.Server) - req, err := http.NewRequest("POST", url, buffer) - defer jf.timeoutHandler() - if err != nil { - return nil, 0, err - } - for name, value := range jf.header { - req.Header.Add(name, value) - } - resp, err := jf.httpClient.Do(req) - if err != nil || resp.StatusCode != 200 { - return nil, resp.StatusCode, err - } - defer resp.Body.Close() - var data io.Reader - switch resp.Header.Get("Content-Encoding") { - case "gzip": - data, _ = gzip.NewReader(resp.Body) - default: - data = resp.Body - } - var respData map[string]interface{} - json.NewDecoder(data).Decode(&respData) - jf.AccessToken = respData["AccessToken"].(string) - user := respData["User"].(map[string]interface{}) - jf.userID = respData["User"].(map[string]interface{})["Id"].(string) - jf.auth = fmt.Sprintf("MediaBrowser Client=\"%s\", Device=\"%s\", DeviceId=\"%s\", Version=\"%s\", Token=\"%s\"", jf.client, jf.device, jf.deviceID, jf.version, jf.AccessToken) - jf.header["X-Emby-Authorization"] = jf.auth - jf.Authenticated = true - return user, resp.StatusCode, nil -} - -func (jf *Jellyfin) get(url string, params map[string]string) (string, int, error) { - var req *http.Request - if params != nil { - jsonParams, _ := json.Marshal(params) - req, _ = http.NewRequest("GET", url, bytes.NewBuffer(jsonParams)) - } else { - req, _ = http.NewRequest("GET", url, nil) - } - for name, value := range jf.header { - req.Header.Add(name, value) - } - resp, err := jf.httpClient.Do(req) - defer jf.timeoutHandler() - if err != nil || resp.StatusCode != 200 { - if resp.StatusCode == 401 && jf.Authenticated { - jf.Authenticated = false - _, _, authErr := jf.Authenticate(jf.Username, jf.password) - if authErr == nil { - v1, v2, v3 := jf.get(url, params) - return v1, v2, v3 - } - } - return "", resp.StatusCode, err - } - defer resp.Body.Close() - var data io.Reader - encoding := resp.Header.Get("Content-Encoding") - switch encoding { - case "gzip": - data, _ = gzip.NewReader(resp.Body) - default: - data = resp.Body - } - buf := new(strings.Builder) - io.Copy(buf, data) - //var respData map[string]interface{} - //json.NewDecoder(data).Decode(&respData) - return buf.String(), resp.StatusCode, nil -} - -func (jf *Jellyfin) post(url string, data map[string]interface{}, response bool) (string, int, error) { - params, _ := json.Marshal(data) - req, _ := http.NewRequest("POST", url, bytes.NewBuffer(params)) - for name, value := range jf.header { - req.Header.Add(name, value) - } - resp, err := jf.httpClient.Do(req) - defer jf.timeoutHandler() - if err != nil || resp.StatusCode != 200 { - if resp.StatusCode == 401 && jf.Authenticated { - jf.Authenticated = false - _, _, authErr := jf.Authenticate(jf.Username, jf.password) - if authErr == nil { - v1, v2, v3 := jf.post(url, data, response) - return v1, v2, v3 - } - } - return "", resp.StatusCode, err - } - if response { - defer resp.Body.Close() - var outData io.Reader - switch resp.Header.Get("Content-Encoding") { - case "gzip": - outData, _ = gzip.NewReader(resp.Body) - default: - outData = resp.Body - } - buf := new(strings.Builder) - io.Copy(buf, outData) - return buf.String(), resp.StatusCode, nil - } - return "", resp.StatusCode, nil -} - -// DeleteUser deletes the user corresponding to the provided ID. -func (jf *Jellyfin) DeleteUser(id string) (int, error) { - url := fmt.Sprintf("%s/Users/%s", jf.Server, id) - req, _ := http.NewRequest("DELETE", url, nil) - for name, value := range jf.header { - req.Header.Add(name, value) - } - resp, err := jf.httpClient.Do(req) - defer jf.timeoutHandler() - return resp.StatusCode, err -} - -// GetUsers returns all (visible) users on the Jellyfin instance. -func (jf *Jellyfin) GetUsers(public bool) ([]map[string]interface{}, int, error) { - var result []map[string]interface{} - var data string - var status int - var err error - if time.Now().After(jf.CacheExpiry) { - if public { - url := fmt.Sprintf("%s/users/public", jf.Server) - data, status, err = jf.get(url, nil) - } else { - url := fmt.Sprintf("%s/users", jf.Server) - data, status, err = jf.get(url, jf.loginParams) - } - if err != nil || status != 200 { - return nil, status, err - } - json.Unmarshal([]byte(data), &result) - jf.userCache = result - jf.CacheExpiry = time.Now().Add(time.Minute * time.Duration(jf.cacheLength)) - return result, status, nil - } - return jf.userCache, 200, nil -} - -// UserByName returns the user corresponding to the provided username. -func (jf *Jellyfin) UserByName(username string, public bool) (map[string]interface{}, int, error) { - var match map[string]interface{} - find := func() (map[string]interface{}, int, error) { - users, status, err := jf.GetUsers(public) - if err != nil || status != 200 { - return nil, status, err - } - for _, user := range users { - if user["Name"].(string) == username { - return user, status, err - } - } - return nil, status, err - } - match, status, err := find() - if match == nil { - jf.CacheExpiry = time.Now() - match, status, err = find() - } - return match, status, err -} - -// UserByID returns the user corresponding to the provided ID. -func (jf *Jellyfin) UserByID(userID string, public bool) (map[string]interface{}, int, error) { - if jf.CacheExpiry.After(time.Now()) { - for _, user := range jf.userCache { - if user["Id"].(string) == userID { - return user, 200, nil - } - } - } - if public { - users, status, err := jf.GetUsers(public) - if err != nil || status != 200 { - return nil, status, err - } - for _, user := range users { - if user["Id"].(string) == userID { - return user, status, nil - } - } - return nil, status, err - } - var result map[string]interface{} - var data string - var status int - var err error - url := fmt.Sprintf("%s/users/%s", jf.Server, userID) - data, status, err = jf.get(url, jf.loginParams) - if err != nil || status != 200 { - return nil, status, err - } - json.Unmarshal([]byte(data), &result) - return result, status, nil -} - -// NewUser creates a new user with the provided username and password. -func (jf *Jellyfin) NewUser(username, password string) (map[string]interface{}, int, error) { - url := fmt.Sprintf("%s/Users/New", jf.Server) - stringData := map[string]string{ - "Name": username, - "Password": password, - } - data := make(map[string]interface{}) - for key, value := range stringData { - data[key] = value - } - response, status, err := jf.post(url, data, true) - var recv map[string]interface{} - json.Unmarshal([]byte(response), &recv) - if err != nil || !(status == 200 || status == 204) { - return nil, status, err - } - return recv, status, nil -} - -// SetPolicy sets the access policy for the user corresponding to the provided ID. -func (jf *Jellyfin) SetPolicy(userID string, policy map[string]interface{}) (int, error) { - url := fmt.Sprintf("%s/Users/%s/Policy", jf.Server, userID) - _, status, err := jf.post(url, policy, false) - if err != nil || status != 200 { - return status, err - } - return status, nil -} - -// SetConfiguration sets the configuration (part of homescreen layout) for the user corresponding to the provided ID. -func (jf *Jellyfin) SetConfiguration(userID string, configuration map[string]interface{}) (int, error) { - url := fmt.Sprintf("%s/Users/%s/Configuration", jf.Server, userID) - _, status, err := jf.post(url, configuration, false) - return status, err -} - -// GetDisplayPreferences gets the displayPreferences (part of homescreen layout) for the user corresponding to the provided ID. -func (jf *Jellyfin) GetDisplayPreferences(userID string) (map[string]interface{}, int, error) { - url := fmt.Sprintf("%s/DisplayPreferences/usersettings?userId=%s&client=emby", jf.Server, userID) - data, status, err := jf.get(url, nil) - if err != nil || !(status == 204 || status == 200) { - return nil, status, err - } - var displayprefs map[string]interface{} - err = json.Unmarshal([]byte(data), &displayprefs) - if err != nil { - return nil, status, err - } - return displayprefs, status, nil -} - -// SetDisplayPreferences sets the displayPreferences (part of homescreen layout) for the user corresponding to the provided ID. -func (jf *Jellyfin) SetDisplayPreferences(userID string, displayprefs map[string]interface{}) (int, error) { - url := fmt.Sprintf("%s/DisplayPreferences/usersettings?userId=%s&client=emby", jf.Server, userID) - _, status, err := jf.post(url, displayprefs, false) - if err != nil || !(status == 204 || status == 200) { - return status, err - } - return status, nil -} diff --git a/mail/created.mjml b/mail/created.mjml deleted file mode 100644 index fe72fe6..0000000 --- a/mail/created.mjml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - jellyfin-accounts - - - - - -

User Created

-

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

-
- - - Name - Address - Time - - - {{ .username }} - {{ .address }} - {{ .time }} - -
-
- - - - Notification emails can be toggled on the admin dashboard. - - - - -
diff --git a/mail/created.txt b/mail/created.txt deleted file mode 100644 index 7e3d3df..0000000 --- a/mail/created.txt +++ /dev/null @@ -1,7 +0,0 @@ -A user was created using code {{ .code }}. - -Name: {{ .username }} -Address: {{ .address }} -Time: {{ .time }} - -Note: Notification emails can be toggled on the admin dashboard. diff --git a/mail/deleted.mjml b/mail/deleted.mjml deleted file mode 100644 index 78179e2..0000000 --- a/mail/deleted.mjml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - Jellyfin - - - - - -

Your account was deleted.

-

Reason: {{ .reason }}

-
-
-
- - - - {{ .message }} - - - - -
diff --git a/mail/deleted.txt b/mail/deleted.txt deleted file mode 100644 index 19c07fb..0000000 --- a/mail/deleted.txt +++ /dev/null @@ -1,4 +0,0 @@ -Your Jellyfin account was deleted. -Reason: {{ .reason }} - -{{ .message }} diff --git a/mail/email.mjml b/mail/email.mjml deleted file mode 100644 index fd1ea1e..0000000 --- a/mail/email.mjml +++ /dev/null @@ -1,40 +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/mail/email.txt b/mail/email.txt deleted file mode 100644 index 6bd59f8..0000000 --- a/mail/email.txt +++ /dev/null @@ -1,10 +0,0 @@ -Hi {{ .username }}, - -Someone has recently requests a password reset on Jellyfin. -If this was you, enter the below pin into the prompt. -This 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: {{ .pin }} - -{{ .message }} diff --git a/mail/expired.mjml b/mail/expired.mjml deleted file mode 100644 index 9f9c917..0000000 --- a/mail/expired.mjml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - jellyfin-accounts - - - - - -

Invite Expired.

-

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

-
-
-
- - - - Notification emails can be toggled on the admin dashboard. - - - - -
diff --git a/mail/expired.txt b/mail/expired.txt deleted file mode 100644 index b834152..0000000 --- a/mail/expired.txt +++ /dev/null @@ -1,5 +0,0 @@ -Invite expired. - -Code {{ .code }} expired at {{ .expiry }}. - -Note: Notification emails can be toggled on the admin dashboard. diff --git a/mail/generate.py b/mail/generate.py deleted file mode 100755 index b825c57..0000000 --- a/mail/generate.py +++ /dev/null @@ -1,37 +0,0 @@ -import subprocess -import shutil -import os -from pathlib import Path - - -def runcmd(cmd): - if os.name == "nt": - return subprocess.check_output(cmd, shell=True) - proc = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE) - return proc.communicate() - - -local_path = Path(__file__).resolve().parent - -for mjml in [f for f in local_path.iterdir() if f.is_file() and "mjml" in f.suffix]: - print(f"Compiling {mjml.name}") - fname = mjml.with_suffix(".html") - runcmd(f"npx mjml {str(mjml)} -o {str(fname)}") - if fname.is_file(): - print("Done.") - -html = [f for f in local_path.iterdir() if f.is_file() and "html" in f.suffix] - -output = local_path.parent / "data" - -for f in html: - shutil.copy(str(f), str(output / f.name)) - print(f"Copied {f.name} to {str(output / f.name)}") - txtfile = f.with_suffix(".txt") - if txtfile.is_file(): - shutil.copy(str(txtfile), str(output / txtfile.name)) - print(f"Copied {txtfile.name} to {str(output / txtfile.name)}") - else: - print( - f"Warning: {txtfile.name} does not exist. Text versions of emails should be supplied." - ) diff --git a/mail/invite-email.mjml b/mail/invite-email.mjml deleted file mode 100644 index f5d688d..0000000 --- a/mail/invite-email.mjml +++ /dev/null @@ -1,39 +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/mail/invite-email.txt b/mail/invite-email.txt deleted file mode 100644 index 10855f1..0000000 --- a/mail/invite-email.txt +++ /dev/null @@ -1,8 +0,0 @@ -Hi, -You've been invited to Jellyfin. -To join, follow the below link. -This invite will expire on {{ .expiry_date }}, at {{ .expiry_time }}, which is in {{ .expires_in }}, so act quick. - -{{ .invite_link }} - -{{ .message }} diff --git a/main.go b/main.go deleted file mode 100644 index 7c538ae..0000000 --- a/main.go +++ /dev/null @@ -1,732 +0,0 @@ -package main - -import ( - "context" - "crypto/rand" - "encoding/base64" - "encoding/json" - "flag" - "fmt" - "io" - "io/ioutil" - "log" - "net" - "net/http" - "os" - "os/exec" - "os/signal" - "path/filepath" - "runtime" - "strconv" - "strings" - "time" - - "github.com/gin-contrib/pprof" - "github.com/gin-contrib/static" - "github.com/gin-gonic/gin" - "github.com/hrfee/jfa-go/common" - _ "github.com/hrfee/jfa-go/docs" - "github.com/hrfee/jfa-go/jfapi" - "github.com/hrfee/jfa-go/ombi" - "github.com/lithammer/shortuuid/v3" - "github.com/logrusorgru/aurora/v3" - swaggerFiles "github.com/swaggo/files" - ginSwagger "github.com/swaggo/gin-swagger" - "gopkg.in/ini.v1" -) - -// User is used for auth purposes. -type User struct { - UserID string `json:"id"` - Username string `json:"username"` - Password string `json:"password"` -} - -type appContext struct { - // defaults *Config - config *ini.File - configPath string - configBasePath string - configBase map[string]interface{} - dataPath string - localPath string - cssFile string - bsVersion int - jellyfinLogin bool - users []User - invalidTokens []string - jf *jfapi.Jellyfin - authJf *jfapi.Jellyfin - ombi *ombi.Ombi - datePattern string - timePattern string - storage Storage - validator Validator - email *Emailer - info, debug, err *log.Logger - host string - port int - version string - quit chan os.Signal - lang Languages - URLBase string -} - -// Languages stores the names and filenames of language files, and the index of that which is currently selected. -type Languages struct { - langFiles []os.FileInfo // Language filenames - langOptions []string // Language names - chosenIndex int -} - -func (app *appContext) loadHTML(router *gin.Engine) { - customPath := app.config.Section("files").Key("html_templates").MustString("") - templatePath := filepath.Join(app.localPath, "templates") - htmlFiles, err := ioutil.ReadDir(templatePath) - if err != nil { - app.err.Fatalf("Couldn't access template directory: \"%s\"", filepath.Join(app.localPath, "templates")) - return - } - loadFiles := make([]string, len(htmlFiles)) - for i, f := range htmlFiles { - if _, err := os.Stat(filepath.Join(customPath, f.Name())); os.IsNotExist(err) { - app.debug.Printf("Using default \"%s\"", f.Name()) - loadFiles[i] = filepath.Join(templatePath, f.Name()) - } else { - app.info.Printf("Using custom \"%s\"", f.Name()) - loadFiles[i] = filepath.Join(filepath.Join(customPath, f.Name())) - } - } - router.LoadHTMLFiles(loadFiles...) -} - -func generateSecret(length int) (string, error) { - bytes := make([]byte, length) - _, err := rand.Read(bytes) - if err != nil { - return "", err - } - return base64.URLEncoding.EncodeToString(bytes), err -} - -func setGinLogger(router *gin.Engine, debugMode bool) { - if debugMode { - router.Use(gin.LoggerWithFormatter(func(param gin.LogFormatterParams) string { - return fmt.Sprintf("[GIN/DEBUG] %s: %s(%s) => %d in %s; %s\n", - param.TimeStamp.Format("15:04:05"), - param.Method, - param.Path, - param.StatusCode, - param.Latency, - func() string { - if param.ErrorMessage != "" { - return "Error: " + param.ErrorMessage - } - return "" - }(), - ) - })) - } else { - router.Use(gin.LoggerWithFormatter(func(param gin.LogFormatterParams) string { - return fmt.Sprintf("[GIN] %s(%s) => %d\n", - param.Method, - param.Path, - param.StatusCode, - ) - })) - } -} - -var ( - PLATFORM string = runtime.GOOS - SOCK string = "jfa-go.sock" - SRV *http.Server - RESTART chan bool - DATA, CONFIG, HOST *string - PORT *int - DEBUG *bool - TEST bool - SWAGGER *bool -) - -func test(app *appContext) { - fmt.Printf("\n\n----\n\n") - settings := map[string]interface{}{ - "server": app.jf.Server, - "server version": app.jf.ServerInfo.Version, - "server name": app.jf.ServerInfo.Name, - "authenticated?": app.jf.Authenticated, - "access token": app.jf.AccessToken, - "username": app.jf.Username, - } - for n, v := range settings { - fmt.Println(n, ":", v) - } - users, status, err := app.jf.GetUsers(false) - fmt.Printf("GetUsers: code %d err %s maplength %d\n", status, err, len(users)) - fmt.Printf("View output? [y/n]: ") - var choice string - fmt.Scanln(&choice) - if strings.Contains(choice, "y") { - out, err := json.MarshalIndent(users, "", " ") - fmt.Print(string(out), err) - } - fmt.Printf("Enter a user to grab: ") - var username string - fmt.Scanln(&username) - user, status, err := app.jf.UserByName(username, false) - fmt.Printf("UserByName (%s): code %d err %s", username, status, err) - out, _ := json.MarshalIndent(user, "", " ") - fmt.Print(string(out)) -} - -func start(asDaemon, firstCall bool) { - // app encompasses essentially all useful functions. - app := new(appContext) - - /* - set default config, data and local paths - also, confusing naming here. data_path is not the internal 'data' directory, rather the users .config/jfa-go folder. - local_path is the internal 'data' directory. - */ - userConfigDir, _ := os.UserConfigDir() - app.dataPath = filepath.Join(userConfigDir, "jfa-go") - app.configPath = filepath.Join(app.dataPath, "config.ini") - executable, _ := os.Executable() - app.localPath = filepath.Join(filepath.Dir(executable), "data") - - app.info = log.New(os.Stdout, "[INFO] ", log.Ltime) - app.err = log.New(os.Stdout, "[ERROR] ", log.Ltime|log.Lshortfile) - - if firstCall { - DATA = flag.String("data", app.dataPath, "alternate path to data directory.") - CONFIG = flag.String("config", app.configPath, "alternate path to config file.") - HOST = flag.String("host", "", "alternate address to host web ui on.") - PORT = flag.Int("port", 0, "alternate port to host web ui on.") - DEBUG = flag.Bool("debug", false, "Enables debug logging and exposes pprof.") - SWAGGER = flag.Bool("swagger", false, "Enable swagger at /swagger/index.html") - - flag.Parse() - if *SWAGGER { - os.Setenv("SWAGGER", "1") - } - if *DEBUG { - os.Setenv("DEBUG", "1") - } - } - - if os.Getenv("SWAGGER") == "1" { - *SWAGGER = true - } - if os.Getenv("DEBUG") == "1" { - *DEBUG = true - } - // attempt to apply command line flags correctly - if app.configPath == *CONFIG && app.dataPath != *DATA { - app.dataPath = *DATA - app.configPath = filepath.Join(app.dataPath, "config.ini") - } else if app.configPath != *CONFIG && app.dataPath == *DATA { - app.configPath = *CONFIG - } else { - app.configPath = *CONFIG - app.dataPath = *DATA - } - - // env variables are necessary because syscall.Exec for self-restarts doesn't doesn't work with arguments for some reason. - - if v := os.Getenv("JFA_CONFIGPATH"); v != "" { - app.configPath = v - } - if v := os.Getenv("JFA_DATAPATH"); v != "" { - app.dataPath = v - } - - os.Setenv("JFA_CONFIGPATH", app.configPath) - os.Setenv("JFA_DATAPATH", app.dataPath) - - var firstRun bool - if _, err := os.Stat(app.dataPath); os.IsNotExist(err) { - os.Mkdir(app.dataPath, 0700) - } - if _, err := os.Stat(app.configPath); os.IsNotExist(err) { - firstRun = true - dConfigPath := filepath.Join(app.localPath, "config-default.ini") - var dConfig *os.File - dConfig, err = os.Open(dConfigPath) - if err != nil { - app.err.Fatalf("Couldn't find default config file \"%s\"", dConfigPath) - } - defer dConfig.Close() - var nConfig *os.File - nConfig, err := os.Create(app.configPath) - if err != nil { - app.err.Printf("Couldn't open config file for writing: \"%s\"", app.configPath) - app.err.Fatalf("Error: %s", err) - } - defer nConfig.Close() - _, err = io.Copy(nConfig, dConfig) - if err != nil { - app.err.Fatalf("Couldn't copy default config. To do this manually, copy\n%s\nto\n%s", dConfigPath, app.configPath) - } - app.info.Printf("Copied default configuration to \"%s\"", app.configPath) - } - - var debugMode bool - var address string - if app.loadConfig() != nil { - app.err.Fatalf("Failed to load config file \"%s\"", app.configPath) - } - lang := app.config.Section("ui").Key("language").MustString("en-us") - app.storage.lang.FormPath = filepath.Join(app.localPath, "lang", "form", lang+".json") - if _, err := os.Stat(app.storage.lang.FormPath); os.IsNotExist(err) { - app.storage.lang.FormPath = filepath.Join(app.localPath, "lang", "form", "en-us.json") - } - app.storage.loadLang() - app.version = app.config.Section("jellyfin").Key("version").String() - // read from config... - debugMode = app.config.Section("ui").Key("debug").MustBool(false) - // then from flag - if *DEBUG { - debugMode = true - } - if debugMode { - app.info.Print(aurora.Magenta("\n\nWARNING: Don't use debug mode in production, as it exposes pprof on the network.\n\n")) - app.debug = log.New(os.Stdout, "[DEBUG] ", log.Ltime|log.Lshortfile) - } else { - app.debug = log.New(ioutil.Discard, "", 0) - } - - if asDaemon { - go func() { - socket := SOCK - os.Remove(socket) - listener, err := net.Listen("unix", socket) - if err != nil { - app.err.Fatalf("Couldn't establish socket connection at %s\n", SOCK) - } - c := make(chan os.Signal, 1) - signal.Notify(c, os.Interrupt) - go func() { - <-c - os.Remove(socket) - os.Exit(1) - }() - defer func() { - listener.Close() - os.Remove(SOCK) - }() - for { - con, err := listener.Accept() - if err != nil { - app.err.Printf("Couldn't read message on %s: %s", socket, err) - continue - } - buf := make([]byte, 512) - nr, err := con.Read(buf) - if err != nil { - app.err.Printf("Couldn't read message on %s: %s", socket, err) - continue - } - command := string(buf[0:nr]) - if command == "stop" { - app.shutdown() - } - } - }() - } - - if !firstRun { - app.host = app.config.Section("ui").Key("host").String() - app.port = app.config.Section("ui").Key("port").MustInt(8056) - - if *HOST != app.host && *HOST != "" { - app.host = *HOST - } - if *PORT != app.port && *PORT > 0 { - app.port = *PORT - } - - if h := os.Getenv("JFA_HOST"); h != "" { - app.host = h - if p := os.Getenv("JFA_PORT"); p != "" { - var port int - _, err := fmt.Sscan(p, &port) - if err == nil { - app.port = port - } - } - } - - address = fmt.Sprintf("%s:%d", app.host, app.port) - - app.debug.Printf("Loaded config file \"%s\"", app.configPath) - - if app.config.Section("ui").Key("bs5").MustBool(false) { - app.cssFile = "bs5-jf.css" - app.bsVersion = 5 - } else { - app.cssFile = "bs4-jf.css" - app.bsVersion = 4 - } - - app.debug.Println("Loading storage") - - app.storage.invite_path = app.config.Section("files").Key("invites").String() - app.storage.loadInvites() - app.storage.emails_path = app.config.Section("files").Key("emails").String() - app.storage.loadEmails() - app.storage.policy_path = app.config.Section("files").Key("user_template").String() - app.storage.loadPolicy() - app.storage.configuration_path = app.config.Section("files").Key("user_configuration").String() - app.storage.loadConfiguration() - app.storage.displayprefs_path = app.config.Section("files").Key("user_displayprefs").String() - app.storage.loadDisplayprefs() - - app.storage.profiles_path = app.config.Section("files").Key("user_profiles").String() - app.storage.loadProfiles() - - if !(len(app.storage.policy) == 0 && len(app.storage.configuration) == 0 && len(app.storage.displayprefs) == 0) { - app.info.Println("Migrating user template files to new profile format") - app.storage.migrateToProfile() - for _, path := range [3]string{app.storage.policy_path, app.storage.configuration_path, app.storage.displayprefs_path} { - if _, err := os.Stat(path); !os.IsNotExist(err) { - dir, fname := filepath.Split(path) - newFname := strings.Replace(fname, ".json", ".old.json", 1) - err := os.Rename(path, filepath.Join(dir, newFname)) - if err != nil { - app.err.Fatalf("Failed to rename %s: %s", fname, err) - } - } - } - app.info.Println("In case of a problem, your original files have been renamed to .old.json") - app.storage.storeProfiles() - } - - if app.config.Section("ombi").Key("enabled").MustBool(false) { - app.storage.ombi_path = app.config.Section("files").Key("ombi_template").String() - app.storage.loadOmbiTemplate() - ombiServer := app.config.Section("ombi").Key("server").String() - app.ombi = ombi.NewOmbi( - ombiServer, - app.config.Section("ombi").Key("api_key").String(), - common.NewTimeoutHandler("Ombi", ombiServer, true), - ) - - } - - app.configBasePath = filepath.Join(app.localPath, "config-base.json") - configBase, _ := ioutil.ReadFile(app.configBasePath) - json.Unmarshal(configBase, &app.configBase) - - themes := map[string]string{ - "Jellyfin (Dark)": fmt.Sprintf("bs%d-jf.css", app.bsVersion), - "Bootstrap (Light)": fmt.Sprintf("bs%d.css", app.bsVersion), - "Custom CSS": "", - } - if val, ok := themes[app.config.Section("ui").Key("theme").String()]; ok { - app.cssFile = val - } - app.debug.Printf("Using css file \"%s\"", app.cssFile) - secret, err := generateSecret(16) - if err != nil { - app.err.Fatal(err) - } - os.Setenv("JFA_SECRET", secret) - app.jellyfinLogin = true - if val, _ := app.config.Section("ui").Key("jellyfin_login").Bool(); !val { - app.jellyfinLogin = false - user := User{} - user.UserID = shortuuid.New() - user.Username = app.config.Section("ui").Key("username").String() - user.Password = app.config.Section("ui").Key("password").String() - app.users = append(app.users, user) - } else { - app.debug.Println("Using Jellyfin for authentication") - } - - server := app.config.Section("jellyfin").Key("server").String() - cacheTimeout := int(app.config.Section("jellyfin").Key("cache_timeout").MustUint(30)) - app.jf, _ = jfapi.NewJellyfin( - server, - app.config.Section("jellyfin").Key("client").String(), - app.config.Section("jellyfin").Key("version").String(), - app.config.Section("jellyfin").Key("device").String(), - app.config.Section("jellyfin").Key("device_id").String(), - common.NewTimeoutHandler("Jellyfin", server, true), - cacheTimeout, - ) - var status int - _, status, err = app.jf.Authenticate(app.config.Section("jellyfin").Key("username").String(), app.config.Section("jellyfin").Key("password").String()) - if status != 200 || err != nil { - app.err.Fatalf("Failed to authenticate with Jellyfin @ %s: Code %d", server, status) - } - app.info.Printf("Authenticated with %s", server) - // from 10.7.0, jellyfin hyphenates user IDs. This checks if the version is equal or higher. - checkVersion := func(version string) int { - numberStrings := strings.Split(version, ".") - n := 0 - for _, s := range numberStrings { - num, err := strconv.Atoi(s) - if err == nil { - n += num - } - } - return n - } - if checkVersion(app.jf.ServerInfo.Version) >= checkVersion("10.7.0") { - noHyphens := true - for id := range app.storage.emails { - if strings.Contains(id, "-") { - noHyphens = false - break - } - } - if noHyphens { - app.info.Println(aurora.Yellow("From Jellyfin 10.7.0 onwards, user IDs are hyphenated.\nYour emails.json file will be modified to match this new format.\nA backup will be placed next to the file.\n")) - time.Sleep(time.Second * time.Duration(3)) - newEmails, status, err := app.upgradeEmailStorage(app.storage.emails) - if status != 200 || err != nil { - app.err.Printf("Failed to get users from Jellyfin: Code %d", status) - app.debug.Printf("Error: %s", err) - app.err.Fatalf("Couldn't upgrade emails.json") - } - bakFile := app.storage.emails_path + ".bak" - err = storeJSON(bakFile, app.storage.emails) - if err != nil { - app.err.Fatalf("couldn't store emails.json backup: %s", err) - } - app.storage.emails = newEmails - err = app.storage.storeEmails() - if err != nil { - app.err.Fatalf("couldn't store emails.json: %s", err) - } - } - } - app.authJf, _ = jfapi.NewJellyfin(server, "jfa-go", app.version, "auth", "auth", common.NewTimeoutHandler("Jellyfin", server, true), cacheTimeout) - - app.loadStrftime() - - validatorConf := ValidatorConf{ - "length": app.config.Section("password_validation").Key("min_length").MustInt(0), - "uppercase": app.config.Section("password_validation").Key("upper").MustInt(0), - "lowercase": app.config.Section("password_validation").Key("lower").MustInt(0), - "number": app.config.Section("password_validation").Key("number").MustInt(0), - "special": app.config.Section("password_validation").Key("special").MustInt(0), - } - if !app.config.Section("password_validation").Key("enabled").MustBool(false) { - for key := range validatorConf { - validatorConf[key] = 0 - } - } - app.validator.init(validatorConf) - - if TEST { - test(app) - os.Exit(0) - } - - inviteDaemon := newRepeater(time.Duration(60*time.Second), app) - go inviteDaemon.run() - - if app.config.Section("password_resets").Key("enabled").MustBool(false) { - go app.StartPWR() - } - } else { - debugMode = false - address = "0.0.0.0:8056" - } - app.info.Println("Loading routes") - if debugMode { - gin.SetMode(gin.DebugMode) - } else { - gin.SetMode(gin.ReleaseMode) - } - router := gin.New() - - setGinLogger(router, debugMode) - - router.Use(gin.Recovery()) - router.Use(static.Serve("/", static.LocalFile(filepath.Join(app.localPath, "static"), false))) - app.loadHTML(router) - router.NoRoute(app.NoRouteHandler) - if debugMode { - app.debug.Println("Loading pprof") - pprof.Register(router) - } - if !firstRun { - router.GET("/", app.AdminPage) - router.GET("/token/login", app.getTokenLogin) - router.GET("/token/refresh", app.getTokenRefresh) - router.POST("/newUser", app.NewUser) - router.Use(static.Serve("/invite/", static.LocalFile(filepath.Join(app.localPath, "static"), false))) - router.GET("/invite/:invCode", app.InviteProxy) - if *SWAGGER { - app.info.Print(aurora.Magenta("\n\nWARNING: Swagger should not be used on a public instance.\n\n")) - router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler)) - } - api := router.Group("/", app.webAuth()) - router.POST("/logout", app.Logout) - api.DELETE("/users", app.DeleteUser) - api.GET("/users", app.GetUsers) - api.POST("/users", app.NewUserAdmin) - api.POST("/invites", app.GenerateInvite) - api.GET("/invites", app.GetInvites) - api.DELETE("/invites", app.DeleteInvite) - api.POST("/invites/profile", app.SetProfile) - api.GET("/profiles", app.GetProfiles) - api.POST("/profiles/default", app.SetDefaultProfile) - api.POST("/profiles", app.CreateProfile) - api.DELETE("/profiles", app.DeleteProfile) - api.POST("/invites/notify", app.SetNotify) - api.POST("/users/emails", app.ModifyEmails) - // api.POST("/setDefaults", app.SetDefaults) - api.POST("/users/settings", app.ApplySettings) - api.GET("/config", app.GetConfig) - api.POST("/config", app.ModifyConfig) - if app.config.Section("ombi").Key("enabled").MustBool(false) { - api.GET("/ombi/users", app.OmbiUsers) - api.POST("/ombi/defaults", app.SetOmbiDefaults) - } - app.info.Printf("Starting router @ %s", address) - } else { - router.GET("/", func(gc *gin.Context) { - gc.HTML(200, "setup.html", gin.H{}) - }) - router.POST("/jellyfin/test", app.TestJF) - router.POST("/config", app.ModifyConfig) - app.info.Printf("Loading setup @ %s", address) - } - - SRV = &http.Server{ - Addr: address, - Handler: router, - } - go func() { - if err := SRV.ListenAndServe(); err != nil { - app.err.Printf("Failure serving: %s", err) - } - }() - app.quit = make(chan os.Signal) - signal.Notify(app.quit, os.Interrupt) - go func() { - for range app.quit { - app.shutdown() - } - }() - for range RESTART { - cntx, cancel := context.WithTimeout(context.Background(), time.Second*5) - defer cancel() - if err := SRV.Shutdown(cntx); err != nil { - app.err.Fatalf("Server shutdown error: %s", err) - } - return - } -} - -func (app *appContext) shutdown() { - app.info.Println("Shutting down...") - - cntx, cancel := context.WithTimeout(context.Background(), time.Second*5) - defer cancel() - if err := SRV.Shutdown(cntx); err != nil { - app.err.Fatalf("Server shutdown error: %s", err) - } - os.Exit(1) -} - -func flagPassed(name string) (found bool) { - for _, f := range os.Args { - if f == name { - found = true - } - } - return -} - -// @title jfa-go internal API -// @version 0.2.0 -// @description API for the jfa-go frontend -// @contact.name Harvey Tindall -// @contact.email hrfee@protonmail.ch -// @license.name MIT -// @license.url https://raw.githubusercontent.com/hrfee/jfa-go/main/LICENSE -// @BasePath / - -// @securityDefinitions.apikey Bearer -// @in header -// @name Authorization - -// @securityDefinitions.basic getTokenAuth -// @name getTokenAuth - -// @tag.name Auth -// @tag.description --------Get a token here first!-------- - -// @tag.name Users -// @tag.description Jellyfin user related operations. - -// @tag.name Invites -// @tag.description Invite related operations. - -// @tag.name Profiles & Settings -// @tag.description Profile and settings related operations. - -// @tag.name Configuration -// @tag.description jfa-go settings. - -// @tag.name Ombi -// @tag.description Ombi related operations. - -// @tag.name Other -// @tag.description Things that dont fit elsewhere. - -func printVersion() { - fmt.Print(aurora.Sprintf(aurora.Magenta("jfa-go version: %s (%s)\n"), aurora.BrightWhite(VERSION), aurora.White(COMMIT))) -} - -func main() { - printVersion() - folder := "/tmp" - if PLATFORM == "windows" { - folder = os.Getenv("TEMP") - } - SOCK = filepath.Join(folder, SOCK) - fmt.Println("Socket:", SOCK) - if flagPassed("test") { - TEST = true - } - if flagPassed("start") { - args := []string{} - for i, f := range os.Args { - if f == "start" { - args = append(args, "daemon") - } else if i != 0 { - args = append(args, f) - } - } - cmd := exec.Command(os.Args[0], args...) - cmd.Start() - os.Exit(1) - } else if flagPassed("stop") { - con, err := net.Dial("unix", SOCK) - if err != nil { - fmt.Printf("Couldn't dial socket %s, are you sure jfa-go is running?\n", SOCK) - os.Exit(1) - } - _, err = con.Write([]byte("stop")) - if err != nil { - fmt.Printf("Couldn't send command to socket %s, are you sure jfa-go is running?\n", SOCK) - os.Exit(1) - } - fmt.Println("Sent.") - } else if flagPassed("daemon") { - start(true, true) - } else { - RESTART = make(chan bool, 1) - start(false, true) - for { - printVersion() - start(false, false) - } - } -} diff --git a/models.go b/models.go deleted file mode 100644 index 9235317..0000000 --- a/models.go +++ /dev/null @@ -1,129 +0,0 @@ -package main - -type stringResponse struct { - Response string `json:"response" example:"message"` - Error string `json:"error" example:"errorDescription"` -} - -type boolResponse struct { - Success bool `json:"success" example:"false"` - Error bool `json:"error" example:"true"` -} - -type newUserDTO struct { - Username string `json:"username" example:"jeff" binding:"required"` // User's username - Password string `json:"password" example:"guest" binding:"required"` // User's password - Email string `json:"email" example:"jeff@jellyf.in"` // User's email address - Code string `json:"code" example:"abc0933jncjkcjj"` // Invite code (required on /newUser) -} - -type deleteUserDTO struct { - Users []string `json:"users" binding:"required"` // List of usernames to delete - Notify bool `json:"notify"` // Whether to notify users of deletion - Reason string `json:"reason"` // Account deletion reason (for notification) -} - -type generateInviteDTO struct { - Days int `json:"days" example:"1"` // Number of days - Hours int `json:"hours" example:"2"` // Number of hours - Minutes int `json:"minutes" example:"3"` // Number of minutes - Email string `json:"email" example:"jeff@jellyf.in"` // Send invite to this address - MultipleUses bool `json:"multiple-uses" example:"true"` // Allow multiple uses - NoLimit bool `json:"no-limit" example:"false"` // No invite use limit - RemainingUses int `json:"remaining-uses" example:"5"` // Remaining invite uses - Profile string `json:"profile" example:"DefaultProfile"` // Name of profile to apply on this invite -} - -type inviteProfileDTO struct { - Invite string `json:"invite" example:"slakdaslkdl2342"` // Invite to apply to - Profile string `json:"profile" example:"DefaultProfile"` // Profile to use -} - -type profileDTO struct { - Admin bool `json:"admin" example:"false"` // Whether profile has admin rights or not - LibraryAccess string `json:"libraries" example:"all"` // Number of libraries profile has access to - FromUser string `json:"fromUser" example:"jeff"` // The user the profile is based on -} - -type getProfilesDTO struct { - Profiles map[string]profileDTO `json:"profiles"` - DefaultProfile string `json:"default_profile"` -} - -type profileChangeDTO struct { - Name string `json:"name" example:"DefaultProfile" binding:"required"` // Name of the profile -} - -type newProfileDTO struct { - Name string `json:"name" example:"DefaultProfile" binding:"required"` // Name of the profile - ID string `json:"id" example:"kasdjlaskjd342342" binding:"required"` // ID of user to source settings from - Homescreen bool `json:"homescreen" example:"true"` // Whether to store homescreen layout or not -} - -type inviteDTO struct { - Code string `json:"code" example:"sajdlj23423j23"` // Invite code - Days int `json:"days" example:"1"` // Number of days till expiry - Hours int `json:"hours" example:"2"` // Number of hours till expiry - Minutes int `json:"minutes" example:"3"` // Number of minutes till expiry - Created string `json:"created" example:"01/01/20 12:00"` // Date of creation - Profile string `json:"profile" example:"DefaultProfile"` // Profile used on this invite - UsedBy [][]string `json:"used-by,omitempty"` // Users who have used this invite - NoLimit bool `json:"no-limit,omitempty"` // If true, invite can be used any number of times - RemainingUses int `json:"remaining-uses,omitempty"` // Remaining number of uses (if applicable) - Email string `json:"email,omitempty"` // Email the invite was sent to (if applicable) - NotifyExpiry bool `json:"notify-expiry,omitempty"` // Whether to notify the requesting user of expiry or not - NotifyCreation bool `json:"notify-creation,omitempty"` // Whether to notify the requesting user of account creation or not -} - -type getInvitesDTO struct { - Profiles []string `json:"profiles"` // List of profiles (name only) - Invites []inviteDTO `json:"invites"` // List of invites -} - -// fake DTO, if i actually used this the code would be a lot longer -type setNotifyValues map[string]struct { - NotifyExpiry bool `json:"notify-expiry,omitempty"` // Whether to notify the requesting user of expiry or not - NotifyCreation bool `json:"notify-creation,omitempty"` // Whether to notify the requesting user of account creation or not -} - -type setNotifyDTO map[string]setNotifyValues - -type deleteInviteDTO struct { - Code string `json:"code" example:"skjadajd43234s"` // Code of invite to delete -} - -type respUser struct { - ID string `json:"id" example:"fdgsdfg45534fa"` // userID of user - Name string `json:"name" example:"jeff"` // Username of user - Email string `json:"email,omitempty" example:"jeff@jellyf.in"` // Email address of user (if available) - LastActive string `json:"last_active"` // Time of last activity on Jellyfin - Admin bool `json:"admin" example:"false"` // Whether or not the user is Administrator -} - -type getUsersDTO struct { - UserList []respUser `json:"users"` -} - -type ombiUser struct { - Name string `json:"name,omitempty" example:"jeff"` // Name of Ombi user - ID string `json:"id" example:"djgkjdg7dkjfsj8"` // userID of Ombi user -} - -type ombiUsersDTO struct { - Users []ombiUser `json:"users"` -} - -type modifyEmailsDTO map[string]string - -type userSettingsDTO struct { - From string `json:"from"` // Whether to apply from "user" or "profile" - Profile string `json:"profile"` // Name of profile (if from = "profile") - ApplyTo []string `json:"apply_to"` // Users to apply settings to - ID string `json:"id"` // ID of user (if from = "user") - Homescreen bool `json:"homescreen"` // Whether to apply homescreen layout or not -} - -type errorListDTO map[string]map[string]string - -type configDTO map[string]interface{} - diff --git a/ombi/go.mod b/ombi/go.mod deleted file mode 100644 index bdc5ffa..0000000 --- a/ombi/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module github.com/hrfee/jfa-go/ombi - -replace github.com/hrfee/jfa-go/common => ../common - -go 1.15 diff --git a/ombi/ombi.go b/ombi/ombi.go deleted file mode 100644 index b045d26..0000000 --- a/ombi/ombi.go +++ /dev/null @@ -1,221 +0,0 @@ -package ombi - -import ( - "bytes" - "compress/gzip" - "encoding/json" - "fmt" - "io" - "net/http" - "strings" - "time" - - "github.com/hrfee/jfa-go/common" -) - -// Ombi represents a running Ombi instance. -type Ombi struct { - server, key string - header map[string]string - httpClient *http.Client - userCache []map[string]interface{} - cacheExpiry time.Time - cacheLength int - timeoutHandler common.TimeoutHandler -} - -// NewOmbi returns an Ombi object. -func NewOmbi(server, key string, timeoutHandler common.TimeoutHandler) *Ombi { - return &Ombi{ - server: server, - key: key, - httpClient: &http.Client{ - Timeout: 10 * time.Second, - }, - header: map[string]string{ - "ApiKey": key, - }, - cacheLength: 30, - cacheExpiry: time.Now(), - timeoutHandler: timeoutHandler, - } -} - -// does a GET and returns the response as a string. -func (ombi *Ombi) getJSON(url string, params map[string]string) (string, int, error) { - if ombi.key == "" { - return "", 401, fmt.Errorf("No API key provided") - } - var req *http.Request - if params != nil { - jsonParams, _ := json.Marshal(params) - req, _ = http.NewRequest("GET", url, bytes.NewBuffer(jsonParams)) - } else { - req, _ = http.NewRequest("GET", url, nil) - } - for name, value := range ombi.header { - req.Header.Add(name, value) - } - resp, err := ombi.httpClient.Do(req) - defer ombi.timeoutHandler() - if err != nil || resp.StatusCode != 200 { - if resp.StatusCode == 401 { - return "", 401, fmt.Errorf("Invalid API Key") - } - return "", resp.StatusCode, err - } - defer resp.Body.Close() - var data io.Reader - switch resp.Header.Get("Content-Encoding") { - case "gzip": - data, _ = gzip.NewReader(resp.Body) - default: - data = resp.Body - } - buf := new(strings.Builder) - _, err = io.Copy(buf, data) - if err != nil { - return "", 500, err - } - return buf.String(), resp.StatusCode, nil -} - -// does a POST and optionally returns response as string. Returns a string instead of an io.reader bcs i couldn't get it working otherwise. -func (ombi *Ombi) send(mode string, url string, data map[string]interface{}, response bool) (string, int, error) { - responseText := "" - params, _ := json.Marshal(data) - req, _ := http.NewRequest(mode, url, bytes.NewBuffer(params)) - req.Header.Add("Content-Type", "application/json") - for name, value := range ombi.header { - req.Header.Add(name, value) - } - resp, err := ombi.httpClient.Do(req) - defer ombi.timeoutHandler() - if err != nil || !(resp.StatusCode == 200 || resp.StatusCode == 201) { - if resp.StatusCode == 401 { - return "", 401, fmt.Errorf("Invalid API Key") - } - return responseText, resp.StatusCode, err - } - if response { - defer resp.Body.Close() - var out io.Reader - switch resp.Header.Get("Content-Encoding") { - case "gzip": - out, _ = gzip.NewReader(resp.Body) - default: - out = resp.Body - } - buf := new(strings.Builder) - _, err = io.Copy(buf, out) - if err != nil { - return "", 500, err - } - responseText = buf.String() - } - return responseText, resp.StatusCode, nil -} - -func (ombi *Ombi) post(url string, data map[string]interface{}, response bool) (string, int, error) { - return ombi.send("POST", url, data, response) -} - -func (ombi *Ombi) put(url string, data map[string]interface{}, response bool) (string, int, error) { - return ombi.send("PUT", url, data, response) -} - -// ModifyUser applies the given modified user object to the corresponding user. -func (ombi *Ombi) ModifyUser(user map[string]interface{}) (status int, err error) { - if _, ok := user["id"]; !ok { - err = fmt.Errorf("No ID provided") - return - } - _, status, err = ombi.put(ombi.server+"/api/v1/Identity", user, false) - return -} - -// DeleteUser deletes the user corresponding to the given ID. -func (ombi *Ombi) DeleteUser(id string) (code int, err error) { - url := fmt.Sprintf("%s/api/v1/Identity/%s", ombi.server, id) - req, _ := http.NewRequest("DELETE", url, nil) - req.Header.Add("Content-Type", "application/json") - for name, value := range ombi.header { - req.Header.Add(name, value) - } - resp, err := ombi.httpClient.Do(req) - defer ombi.timeoutHandler() - return resp.StatusCode, err -} - -// UserByID returns the user corresponding to the provided ID. -func (ombi *Ombi) UserByID(id string) (result map[string]interface{}, code int, err error) { - resp, code, err := ombi.getJSON(fmt.Sprintf("%s/api/v1/Identity/User/%s", ombi.server, id), nil) - json.Unmarshal([]byte(resp), &result) - return -} - -// GetUsers returns all users on the Ombi instance. -func (ombi *Ombi) GetUsers() ([]map[string]interface{}, int, error) { - if time.Now().After(ombi.cacheExpiry) { - resp, code, err := ombi.getJSON(fmt.Sprintf("%s/api/v1/Identity/Users", ombi.server), nil) - var result []map[string]interface{} - json.Unmarshal([]byte(resp), &result) - ombi.userCache = result - if (code == 200 || code == 204) && err == nil { - ombi.cacheExpiry = time.Now().Add(time.Minute * time.Duration(ombi.cacheLength)) - } - return result, code, err - } - return ombi.userCache, 200, nil -} - -// Strip these from a user when saving as a template. -// We also need to strip userQualityProfiles{"id", "userId"} -var stripFromOmbi = []string{ - "alias", - "emailAddress", - "hasLoggedIn", - "id", - "lastLoggedIn", - "password", - "userName", -} - -// TemplateByID returns a template based on the user corresponding to the provided ID's settings. -func (ombi *Ombi) TemplateByID(id string) (result map[string]interface{}, code int, err error) { - result, code, err = ombi.UserByID(id) - if err != nil || code != 200 { - return - } - for _, key := range stripFromOmbi { - if _, ok := result[key]; ok { - delete(result, key) - } - } - if qp, ok := result["userQualityProfiles"].(map[string]interface{}); ok { - delete(qp, "id") - delete(qp, "userId") - result["userQualityProfiles"] = qp - } - return -} - -// NewUser creates a new user with the given username, password and email address. -func (ombi *Ombi) NewUser(username, password, email string, template map[string]interface{}) ([]string, int, error) { - url := fmt.Sprintf("%s/api/v1/Identity", ombi.server) - user := template - user["userName"] = username - user["password"] = password - user["emailAddress"] = email - resp, code, err := ombi.post(url, user, true) - var data map[string]interface{} - json.Unmarshal([]byte(resp), &data) - if err != nil || code != 200 { - var lst []string - if data["errors"] != nil { - lst = data["errors"].([]string) - } - return lst, code, err - } - return nil, code, err -} diff --git a/package-lock.json b/package-lock.json index f7a0e23..164f9cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,173 +1,127 @@ { - "name": "jellyfin-accounts", + "name": "jfa-go-ui", "version": "1.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { "@babel/runtime": { - "version": "7.10.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.5.tgz", - "integrity": "sha512-otddXKhdNn7d0ptoFRHtMLa8LqDxLYwTjB4nYgM1yy5N6gU/MUf8zqyyLltCH3yAVitBzmwK4us+DD0l/MauAg==", + "version": "7.3.4", + "resolved": "https://registry.npm.taobao.org/@babel/runtime/download/@babel/runtime-7.3.4.tgz?cache=0&sync_timestamp=1604441258461&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fruntime%2Fdownload%2F%40babel%2Fruntime-7.3.4.tgz", + "integrity": "sha1-c9ErqBnjZfz3/RUq7VbW35fSHIM=", "requires": { - "regenerator-runtime": "^0.13.4" + "regenerator-runtime": "^0.12.0" } }, - "@babel/runtime-corejs3": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.10.4.tgz", - "integrity": "sha512-BFlgP2SoLO9HJX9WBwN67gHWMBhDX/eDz64Jajd6mR/UAUzqrNMm99d4qHnVaKscAElZoFiPv+JpR/Siud5lXw==", + "a17t": { + "version": "0.3.0", + "resolved": "https://registry.npm.taobao.org/a17t/download/a17t-0.3.0.tgz", + "integrity": "sha1-w1RZpNL0Qyp2I0PNi/x6RKaSx2Y=", "requires": { - "core-js-pure": "^3.0.0", - "regenerator-runtime": "^0.13.4" + "autoprefixer": "^10.0.2" } }, - "@nodelib/fs.scandir": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", - "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npm.taobao.org/accepts/download/accepts-1.3.7.tgz", + "integrity": "sha1-UxvHJlF6OytB+FACHGzBXqq1B80=", "requires": { - "@nodelib/fs.stat": "2.0.3", - "run-parallel": "^1.1.9" + "mime-types": "~2.1.24", + "negotiator": "0.6.2" } }, - "@nodelib/fs.stat": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", - "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==" - }, - "@nodelib/fs.walk": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", - "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", - "requires": { - "@nodelib/fs.scandir": "2.1.3", - "fastq": "^1.6.0" - } - }, - "@types/color-name": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", - "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==" - }, - "@types/jquery": { - "version": "3.5.3", - "resolved": "https://registry.npm.taobao.org/@types/jquery/download/@types/jquery-3.5.3.tgz?cache=0&sync_timestamp=1602524936372&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fjquery%2Fdownload%2F%40types%2Fjquery-3.5.3.tgz", - "integrity": "sha1-rcxkfkxnW9nrrn+5gOnKddWO6Mc=", - "requires": { - "@types/sizzle": "*" - } - }, - "@types/sizzle": { - "version": "2.3.2", - "resolved": "https://registry.npm.taobao.org/@types/sizzle/download/@types/sizzle-2.3.2.tgz", - "integrity": "sha1-qBG4wY4rq6t9VCszZYh64uTZ3kc=" - }, - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" - }, "ajv": { - "version": "6.12.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.3.tgz", - "integrity": "sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==", + "version": "6.10.0", + "resolved": "https://registry.npm.taobao.org/ajv/download/ajv-6.10.0.tgz?cache=0&sync_timestamp=1607269179189&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2Fajv-6.10.0.tgz", + "integrity": "sha1-kNDVRDnaWHzX6EO/twRfUL0ivfE=", "requires": { - "fast-deep-equal": "^3.1.1", + "fast-deep-equal": "^2.0.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + "amqplib": { + "version": "0.5.2", + "resolved": "https://registry.npm.taobao.org/amqplib/download/amqplib-0.5.2.tgz", + "integrity": "sha1-0tcxPH/6pNELzx5iUt5FkbbMe2M=", + "requires": { + "bitsyntax": "~0.0.4", + "bluebird": "^3.4.6", + "buffer-more-ints": "0.0.2", + "readable-stream": "1.x >=1.1.9", + "safe-buffer": "^5.0.1" + }, + "dependencies": { + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npm.taobao.org/readable-stream/download/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npm.taobao.org/string_decoder/download/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } }, "ansi-styles": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-3.2.1.tgz?cache=0&sync_timestamp=1606792436886&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fansi-styles%2Fdownload%2Fansi-styles-3.2.1.tgz", + "integrity": "sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=", "requires": { "color-convert": "^1.9.0" } }, - "anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "array-union": { + "app-root-path": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" + "resolved": "https://registry.npm.taobao.org/app-root-path/download/app-root-path-2.1.0.tgz", + "integrity": "sha1-mL9lmTJ+zqGZMJhm6BQDaP0uZGo=" + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npm.taobao.org/array-flatten/download/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" }, "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "version": "0.2.3", + "resolved": "https://registry.npm.taobao.org/asn1/download/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" + }, + "async-limiter": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/async-limiter/download/async-limiter-1.0.1.tgz", + "integrity": "sha1-3TeelPDbgxCwgpH51kwyCXZmF/0=" + }, + "async-retry": { + "version": "1.2.3", + "resolved": "https://registry.npm.taobao.org/async-retry/download/async-retry-1.2.3.tgz", + "integrity": "sha1-plIfM4NY0yKxoAEreQMMb0EdHOA=", "requires": { - "safer-buffer": "~2.1.0" + "retry": "0.12.0" } }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" - }, - "async": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", - "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==" - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==" - }, "autoprefixer": { - "version": "9.8.5", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.8.5.tgz", - "integrity": "sha512-C2p5KkumJlsTHoNv9w31NrBRgXhf6eCMteJuHZi2xhkgC+5Vm40MEtCKPhc0qdgAOhox0YPy1SQHTAky05UoKg==", + "version": "10.1.0", + "resolved": "https://registry.npm.taobao.org/autoprefixer/download/autoprefixer-10.1.0.tgz?cache=0&sync_timestamp=1607411581276&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fautoprefixer%2Fdownload%2Fautoprefixer-10.1.0.tgz", + "integrity": "sha1-sZ/YUk7e+MhcnbO9sMmY3oThcvs=", "requires": { - "browserslist": "^4.12.0", - "caniuse-lite": "^1.0.30001097", - "colorette": "^1.2.0", + "browserslist": "^4.15.0", + "caniuse-lite": "^1.0.30001165", + "colorette": "^1.2.1", + "fraction.js": "^4.0.12", "normalize-range": "^0.1.2", - "num2fraction": "^1.2.2", - "postcss": "^7.0.32", "postcss-value-parser": "^4.1.0" } }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" - }, - "aws4": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.0.tgz", - "integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==" - }, "babel-runtime": { "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "resolved": "https://registry.npm.taobao.org/babel-runtime/download/babel-runtime-6.26.0.tgz", "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", "requires": { "core-js": "^2.4.0", @@ -176,2294 +130,1210 @@ "dependencies": { "regenerator-runtime": { "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + "resolved": "https://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.11.1.tgz?cache=0&sync_timestamp=1595456023687&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fregenerator-runtime%2Fdownload%2Fregenerator-runtime-0.11.1.tgz", + "integrity": "sha1-vgWtf5v30i4Fb5cmzuUBf78Z4uk=" } } }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "basic-auth": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/basic-auth/download/basic-auth-2.0.1.tgz", + "integrity": "sha1-uZgnm/R844NEtPPPkW1Gebv1Hjo=", "requires": { - "tweetnacl": "^0.14.3" + "safe-buffer": "5.1.2" } }, - "binary-extensions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", - "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==" - }, - "boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" - }, - "bootstrap": { - "version": "5.0.0-alpha3", - "resolved": "https://registry.npm.taobao.org/bootstrap/download/bootstrap-5.0.0-alpha3.tgz?cache=0&sync_timestamp=1605115180548&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbootstrap%2Fdownload%2Fbootstrap-5.0.0-alpha3.tgz", - "integrity": "sha1-9au9OHQDg9a44EEhKu9eoiDn2qo=" - }, - "bootstrap4": { - "version": "npm:bootstrap@4.5.0", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.5.0.tgz", - "integrity": "sha512-Z93QoXvodoVslA+PWNdk23Hze4RBYIkpb5h8I2HY2Tu2h7A0LpAgLcyrhrSUyo2/Oxm2l1fRZPs1e5hnxnliXA==" - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "bitsyntax": { + "version": "0.0.4", + "resolved": "https://registry.npm.taobao.org/bitsyntax/download/bitsyntax-0.0.4.tgz", + "integrity": "sha1-6xDMb4K4xJDj6FaY8H6D1G4MuoI=", "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "buffer-more-ints": "0.0.2" } }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npm.taobao.org/bluebird/download/bluebird-3.7.2.tgz", + "integrity": "sha1-nyKcFb4nJFT/qXOs4NvueaGww28=" + }, + "body-parser": { + "version": "1.18.3", + "resolved": "https://registry.npm.taobao.org/body-parser/download/body-parser-1.18.3.tgz", + "integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=", "requires": { - "fill-range": "^7.0.1" + "bytes": "3.0.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "~1.6.3", + "iconv-lite": "0.4.23", + "on-finished": "~2.3.0", + "qs": "6.5.2", + "raw-body": "2.3.3", + "type-is": "~1.6.16" } }, "browserslist": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.13.0.tgz", - "integrity": "sha512-MINatJ5ZNrLnQ6blGvePd/QOz9Xtu+Ne+x29iQSCHfkU5BugKVJwZKn/iiL8UbpIpa3JhviKjz+XxMo0m2caFQ==", + "version": "4.15.0", + "resolved": "https://registry.npm.taobao.org/browserslist/download/browserslist-4.15.0.tgz?cache=0&sync_timestamp=1606864358374&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbrowserslist%2Fdownload%2Fbrowserslist-4.15.0.tgz", + "integrity": "sha1-PUi7ymo/N46GEC/9AX2aA/EivbA=", "requires": { - "caniuse-lite": "^1.0.30001093", - "electron-to-chromium": "^1.3.488", - "escalade": "^3.0.1", - "node-releases": "^1.1.58" + "caniuse-lite": "^1.0.30001164", + "colorette": "^1.2.1", + "electron-to-chromium": "^1.3.612", + "escalade": "^3.1.1", + "node-releases": "^1.1.67" } }, - "caller-callsite": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", - "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", - "requires": { - "callsites": "^2.0.0" - } + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/buffer-equal-constant-time/download/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" }, - "caller-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", - "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", - "requires": { - "caller-callsite": "^2.0.0" - } + "buffer-more-ints": { + "version": "0.0.2", + "resolved": "https://registry.npm.taobao.org/buffer-more-ints/download/buffer-more-ints-0.0.2.tgz", + "integrity": "sha1-JrOIXRD6E9t/wBquOquHAZngEkw=" }, - "callsites": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", - "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=" - }, - "camel-case": { + "bytes": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", - "integrity": "sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=", - "requires": { - "no-case": "^2.2.0", - "upper-case": "^1.1.1" - } + "resolved": "https://registry.npm.taobao.org/bytes/download/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + "call-bind": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/call-bind/download/call-bind-1.0.0.tgz", + "integrity": "sha1-JBJwVLs/m9y0sfuCQYGGBy93uM4=", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.0" + } }, "caniuse-lite": { - "version": "1.0.30001100", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001100.tgz", - "integrity": "sha512-0eYdp1+wFCnMlCj2oudciuQn2B9xAFq3WpgpcBIZTxk/1HNA/O2YA7rpeYhnOqsqAJq1AHUgx6i1jtafg7m2zA==" - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + "version": "1.0.30001165", + "resolved": "https://registry.npm.taobao.org/caniuse-lite/download/caniuse-lite-1.0.30001165.tgz", + "integrity": "sha1-MpVUkNL2ApC7GGu3VPKYGRf6dE8=" }, "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "version": "2.4.1", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-2.4.1.tgz?cache=0&sync_timestamp=1591687018980&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fchalk%2Fdownload%2Fchalk-2.4.1.tgz", + "integrity": "sha1-GMSasWoDe26wFSzIPjRxM4IVtm4=", "requires": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" - }, - "dependencies": { - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "cheerio": { - "version": "0.22.0", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.22.0.tgz", - "integrity": "sha1-qbqoYKP5tZWmuBsahocxIe06Jp4=", - "requires": { - "css-select": "~1.2.0", - "dom-serializer": "~0.1.0", - "entities": "~1.1.1", - "htmlparser2": "^3.9.1", - "lodash.assignin": "^4.0.9", - "lodash.bind": "^4.1.4", - "lodash.defaults": "^4.0.1", - "lodash.filter": "^4.4.0", - "lodash.flatten": "^4.2.0", - "lodash.foreach": "^4.3.0", - "lodash.map": "^4.4.0", - "lodash.merge": "^4.4.0", - "lodash.pick": "^4.2.1", - "lodash.reduce": "^4.4.0", - "lodash.reject": "^4.4.0", - "lodash.some": "^4.4.0" - } - }, - "chokidar": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.0.tgz", - "integrity": "sha512-aXAaho2VJtisB/1fg1+3nlLJqGOuewTzQpd/Tz0yTg2R0e4IGtshYvtjowyEumcBv2z+y4+kc75Mz7j5xJskcQ==", - "requires": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "fsevents": "~2.1.2", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.4.0" - } - }, - "clean-css": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz", - "integrity": "sha512-VcMWDN54ZN/DS+g58HYL5/n4Zrqe8vHJpGA8KdgUXFU4fuP/aHNw8eld9SyEIyabIMJX/0RaY/fplOo5hYLSFA==", - "requires": { - "source-map": "~0.6.0" - } - }, - "clean-css-cli": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/clean-css-cli/-/clean-css-cli-4.3.0.tgz", - "integrity": "sha512-8GHZfr+mG3zB/Lgqrr27qHBFsPSn0fyEI3f2rIZpxPxUbn2J6A8xyyeBRVTW8duDuXigN0s80vsXiXJOEFIO5Q==", - "requires": { - "clean-css": "^4.2.1", - "commander": "2.x", - "glob": "7.x" - } - }, - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" } }, "color-convert": { "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-1.9.3.tgz", + "integrity": "sha1-u3GFBpDh8TZWfeYp0tVHHe2kweg=", "requires": { "color-name": "1.1.3" } }, "color-name": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.3.tgz", "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "colorette": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.1.tgz", - "integrity": "sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==" + "resolved": "https://registry.npm.taobao.org/colorette/download/colorette-1.2.1.tgz?cache=0&sync_timestamp=1593955937807&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcolorette%2Fdownload%2Fcolorette-1.2.1.tgz", + "integrity": "sha1-TQuSEyXBT6+SYzCGpTbbbolWSxs=" }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "commands-events": { + "version": "1.0.4", + "resolved": "https://registry.npm.taobao.org/commands-events/download/commands-events-1.0.4.tgz", + "integrity": "sha1-dyEj1/F1sphEdLzjenIvTC09KDA=", "requires": { - "delayed-stream": "~1.0.0" + "@babel/runtime": "7.2.0", + "formats": "1.0.0", + "uuidv4": "2.0.0" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.2.0", + "resolved": "https://registry.npm.taobao.org/@babel/runtime/download/@babel/runtime-7.2.0.tgz?cache=0&sync_timestamp=1604441258461&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fruntime%2Fdownload%2F%40babel%2Fruntime-7.2.0.tgz", + "integrity": "sha1-sD5C7t31iY4AZG5MhA+ge6jcrX8=", + "requires": { + "regenerator-runtime": "^0.12.0" + } + }, + "uuidv4": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/uuidv4/download/uuidv4-2.0.0.tgz", + "integrity": "sha1-PsdkKI+enE5A+AJ60wnCxSi+KXY=", + "requires": { + "sha-1": "0.1.1", + "uuid": "3.3.2" + } + } } }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + "comparejs": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/comparejs/download/comparejs-1.0.0.tgz", + "integrity": "sha1-H2GkwsGcWu0ImDlS6IvR/okk498=" }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "config-chain": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz", - "integrity": "sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==", + "compressible": { + "version": "2.0.18", + "resolved": "https://registry.npm.taobao.org/compressible/download/compressible-2.0.18.tgz", + "integrity": "sha1-r1PMprBw1MPAdQ+9dyhqbXzEb7o=", "requires": { - "ini": "^1.3.4", - "proto-list": "~1.2.1" + "mime-db": ">= 1.43.0 < 2" } }, + "compression": { + "version": "1.7.3", + "resolved": "https://registry.npm.taobao.org/compression/download/compression-1.7.3.tgz", + "integrity": "sha1-J+DhdqryYPfywoE8PkQK258Zk9s=", + "requires": { + "accepts": "~1.3.5", + "bytes": "3.0.0", + "compressible": "~2.0.14", + "debug": "2.6.9", + "on-headers": "~1.0.1", + "safe-buffer": "5.1.2", + "vary": "~1.1.2" + } + }, + "content-disposition": { + "version": "0.5.2", + "resolved": "https://registry.npm.taobao.org/content-disposition/download/content-disposition-0.5.2.tgz", + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npm.taobao.org/content-type/download/content-type-1.0.4.tgz", + "integrity": "sha1-4TjMdeBAxyexlm/l5fjJruJW/js=" + }, + "cookie": { + "version": "0.3.1", + "resolved": "https://registry.npm.taobao.org/cookie/download/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npm.taobao.org/cookie-signature/download/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + }, "core-js": { - "version": "2.6.11", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz", - "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==" - }, - "core-js-pure": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.5.tgz", - "integrity": "sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA==" + "version": "2.6.12", + "resolved": "https://registry.npm.taobao.org/core-js/download/core-js-2.6.12.tgz?cache=0&sync_timestamp=1607218318589&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcore-js%2Fdownload%2Fcore-js-2.6.12.tgz", + "integrity": "sha1-2TM9+nsGXjR8xWgiGdb2kIWcwuw=" }, "core-util-is": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "resolved": "https://registry.npm.taobao.org/core-util-is/download/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, - "cosmiconfig": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", - "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", + "cors": { + "version": "2.8.5", + "resolved": "https://registry.npm.taobao.org/cors/download/cors-2.8.5.tgz", + "integrity": "sha1-6sEdpRWS3Ya58G9uesKTs9+HXSk=", "requires": { - "import-fresh": "^2.0.0", - "is-directory": "^0.3.1", - "js-yaml": "^3.13.1", - "parse-json": "^4.0.0" + "object-assign": "^4", + "vary": "^1" } }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "css-select": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", - "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", - "requires": { - "boolbase": "~1.0.0", - "css-what": "2.1", - "domutils": "1.5.1", - "nth-check": "~1.0.1" - } - }, - "css-what": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz", - "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==" - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "requires": { - "assert-plus": "^1.0.0" - } - }, - "datauri": { + "crypto2": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/datauri/-/datauri-2.0.0.tgz", - "integrity": "sha512-zS2HSf9pI5XPlNZgIqJg/wCJpecgU/HA6E/uv2EfaWnW1EiTGLfy/EexTIsC9c99yoCOTXlqeeWk4FkCSuO3/g==", + "resolved": "https://registry.npm.taobao.org/crypto2/download/crypto2-2.0.0.tgz", + "integrity": "sha1-VTn0Wyg9jCvcoOpPr4s0AUpOos0=", "requires": { - "image-size": "^0.7.3", - "mimer": "^1.0.0" + "babel-runtime": "6.26.0", + "node-rsa": "0.4.2", + "util.promisify": "1.0.0" } }, - "decamelize": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-3.2.0.tgz", - "integrity": "sha512-4TgkVUsmmu7oCSyGBm5FvfMoACuoh9EOidm7V5/J2X2djAwwt57qb3F2KMP2ITqODTCSwb+YRV+0Zqrv18k/hw==", + "datasette": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/datasette/download/datasette-1.0.1.tgz", + "integrity": "sha1-yHhrvTa+ZgYXnnolJUMLnb2Tleg=", "requires": { - "xregexp": "^4.2.4" + "comparejs": "1.0.0", + "eventemitter2": "5.0.1", + "lodash": "4.17.5" + }, + "dependencies": { + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npm.taobao.org/lodash/download/lodash-4.17.5.tgz?cache=0&sync_timestamp=1597335994883&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flodash%2Fdownload%2Flodash-4.17.5.tgz", + "integrity": "sha1-maktZcAnLevoyWtgV7yPv6O+1RE=" + } } }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, - "dependency-graph": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/dependency-graph/-/dependency-graph-0.9.0.tgz", - "integrity": "sha512-9YLIBURXj4DJMFALxXw9K3Y3rwb5Fk0X5/8ipCzaN84+gKxoHK43tVKRNakCQbiEx07E8Uwhuq21BpUagFhZ8w==" - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npm.taobao.org/debug/download/debug-2.6.9.tgz?cache=0&sync_timestamp=1607566856339&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-2.6.9.tgz", + "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", "requires": { - "path-type": "^4.0.0" + "ms": "2.0.0" } }, - "dom-serializer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", - "integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==", + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npm.taobao.org/define-properties/download/define-properties-1.1.3.tgz", + "integrity": "sha1-z4jabL7ib+bbcJT2HYcMvYTO6fE=", "requires": { - "domelementtype": "^1.3.0", - "entities": "^1.1.1" + "object-keys": "^1.0.12" } }, - "domelementtype": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", - "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==" + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npm.taobao.org/depd/download/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" }, - "domhandler": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", - "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npm.taobao.org/destroy/download/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "draht": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/draht/download/draht-1.0.1.tgz", + "integrity": "sha1-xMiHmSPSEw36nFkw6VbIXWKx6XU=", "requires": { - "domelementtype": "1" + "eventemitter2": "5.0.1" } }, - "domutils": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", - "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npm.taobao.org/ecdsa-sig-formatter/download/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha1-rg8PothQRe8UqBfao86azQSJ5b8=", "requires": { - "dom-serializer": "0", - "domelementtype": "1" + "safe-buffer": "^5.0.1" } }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "editorconfig": { - "version": "0.15.3", - "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.15.3.tgz", - "integrity": "sha512-M9wIMFx96vq0R4F+gRpY3o2exzb8hEj/n9S8unZtHSvYjibBp/iMufSzvmOcV/laG0ZtuTVGtiJggPOSW2r93g==", - "requires": { - "commander": "^2.19.0", - "lru-cache": "^4.1.5", - "semver": "^5.6.0", - "sigmund": "^1.0.1" - } + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npm.taobao.org/ee-first/download/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "electron-to-chromium": { - "version": "1.3.498", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.498.tgz", - "integrity": "sha512-W1hGwaQEU8j9su2jeAr3aabkPuuXw+j8t73eajGAkEJWbfWiwbxBwQN/8Qmv2qCy3uCDm2rOAaZneYQM8VGC4w==" + "version": "1.3.621", + "resolved": "https://registry.npm.taobao.org/electron-to-chromium/download/electron-to-chromium-1.3.621.tgz?cache=0&sync_timestamp=1607538704273&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felectron-to-chromium%2Fdownload%2Felectron-to-chromium-1.3.621.tgz", + "integrity": "sha1-C74hAO8LKPiNCxEB+99DMxL2m+A=" }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npm.taobao.org/encodeurl/download/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" }, - "entities": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", - "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==" - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "es-abstract": { + "version": "1.18.0-next.1", + "resolved": "https://registry.npm.taobao.org/es-abstract/download/es-abstract-1.18.0-next.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fes-abstract%2Fdownload%2Fes-abstract-1.18.0-next.1.tgz", + "integrity": "sha1-bjoKS9pxflAjqzuOkL7DYQjSLGg=", "requires": { - "is-arrayish": "^0.2.1" + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.0", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" } }, - "esbuild": { - "version": "0.7.8", - "resolved": "https://registry.npm.taobao.org/esbuild/download/esbuild-0.7.8.tgz", - "integrity": "sha1-e6wXcYHv4MiTmnsVU2aCr+MtG3M=" + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npm.taobao.org/es-to-primitive/download/es-to-primitive-1.2.1.tgz", + "integrity": "sha1-5VzUyc3BiLzvsDs2bHNjI/xciYo=", + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } }, "escalade": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.0.2.tgz", - "integrity": "sha512-gPYAU37hYCUhW5euPeR+Y74F7BL+IBsV93j5cvGriSaD1aG6MGsqsV1yamRdrWrb2j3aiZvb0X+UBOWpx3JWtQ==" + "version": "3.1.1", + "resolved": "https://registry.npm.taobao.org/escalade/download/escalade-3.1.1.tgz?cache=0&sync_timestamp=1602567437752&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fescalade%2Fdownload%2Fescalade-3.1.1.tgz", + "integrity": "sha1-2M/ccACWXFoBdLSoLqpcBVJ0LkA=" + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npm.taobao.org/escape-html/download/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" }, "escape-string-regexp": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "resolved": "https://registry.npm.taobao.org/escape-string-regexp/download/escape-string-regexp-1.0.5.tgz?cache=0&sync_timestamp=1587627212242&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fescape-string-regexp%2Fdownload%2Fescape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npm.taobao.org/etag/download/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + "eventemitter2": { + "version": "5.0.1", + "resolved": "https://registry.npm.taobao.org/eventemitter2/download/eventemitter2-5.0.1.tgz", + "integrity": "sha1-YZegldX7a1folC9v1+qtY6CclFI=" }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + "express": { + "version": "4.16.4", + "resolved": "https://registry.npm.taobao.org/express/download/express-4.16.4.tgz?cache=0&sync_timestamp=1585184189864&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fexpress%2Fdownload%2Fexpress-4.16.4.tgz", + "integrity": "sha1-/d72GSYQniTFFeqX/S8b2/Yt8S4=", + "requires": { + "accepts": "~1.3.5", + "array-flatten": "1.1.1", + "body-parser": "1.18.3", + "content-disposition": "0.5.2", + "content-type": "~1.0.4", + "cookie": "0.3.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.1.1", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.4", + "qs": "6.5.2", + "range-parser": "~1.2.0", + "safe-buffer": "5.1.2", + "send": "0.16.2", + "serve-static": "1.13.2", + "setprototypeof": "1.1.0", + "statuses": "~1.4.0", + "type-is": "~1.6.16", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "dependencies": { + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npm.taobao.org/statuses/download/statuses-1.4.0.tgz", + "integrity": "sha1-u3PURtonlhBu/MG2AaJT1sRr0Ic=" + } + } }, "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "fast-glob": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz", - "integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==", - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", - "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" - } + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" }, "fast-json-stable-stringify": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + "resolved": "https://registry.npm.taobao.org/fast-json-stable-stringify/download/fast-json-stable-stringify-2.1.0.tgz?cache=0&sync_timestamp=1576340291001&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffast-json-stable-stringify%2Fdownload%2Ffast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha1-h0v2nG9ATCtdmcSBNBOZ/VWJJjM=" }, - "fastq": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.8.0.tgz", - "integrity": "sha512-SMIZoZdLh/fgofivvIkmknUXyPnvxRE3DhtZ5Me3Mrsk5gyPL42F0xr51TdRXskBxHfMp+07bcYzfsYEsSQA9Q==", + "finalhandler": { + "version": "1.1.1", + "resolved": "https://registry.npm.taobao.org/finalhandler/download/finalhandler-1.1.1.tgz", + "integrity": "sha1-7r9O2EAHnIP0JJA4ydcDAIMBsQU=", "requires": { - "reusify": "^1.0.4" + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "statuses": "~1.4.0", + "unpipe": "~1.0.0" + }, + "dependencies": { + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npm.taobao.org/statuses/download/statuses-1.4.0.tgz", + "integrity": "sha1-u3PURtonlhBu/MG2AaJT1sRr0Ic=" + } } }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "find-root": { + "version": "1.1.0", + "resolved": "https://registry.npm.taobao.org/find-root/download/find-root-1.1.0.tgz", + "integrity": "sha1-q8/Iunb3CMQql7PWhbfpRQv7nOQ=" + }, + "flaschenpost": { + "version": "1.1.3", + "resolved": "https://registry.npm.taobao.org/flaschenpost/download/flaschenpost-1.1.3.tgz", + "integrity": "sha1-LB579O7PnzAzPdZytCehdMLTdEk=", "requires": { - "to-regex-range": "^5.0.1" + "@babel/runtime": "7.2.0", + "app-root-path": "2.1.0", + "babel-runtime": "6.26.0", + "chalk": "2.4.1", + "find-root": "1.1.0", + "lodash": "4.17.11", + "moment": "2.22.2", + "processenv": "1.1.0", + "split2": "3.0.0", + "stack-trace": "0.0.10", + "stringify-object": "3.3.0", + "untildify": "3.0.3", + "util.promisify": "1.0.0", + "varname": "2.0.3" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.2.0", + "resolved": "https://registry.npm.taobao.org/@babel/runtime/download/@babel/runtime-7.2.0.tgz?cache=0&sync_timestamp=1604441258461&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fruntime%2Fdownload%2F%40babel%2Fruntime-7.2.0.tgz", + "integrity": "sha1-sD5C7t31iY4AZG5MhA+ge6jcrX8=", + "requires": { + "regenerator-runtime": "^0.12.0" + } + } } }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "fs-extra": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", - "integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==", - "requires": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^1.0.0" - } - }, - "fs.realpath": { + "formats": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "resolved": "https://registry.npm.taobao.org/formats/download/formats-1.0.0.tgz", + "integrity": "sha1-MnFUCEeG6sCdO4OcqyjRULmCsWM=" }, - "fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "optional": true + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npm.taobao.org/forwarded/download/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + "fraction.js": { + "version": "4.0.12", + "resolved": "https://registry.npm.taobao.org/fraction.js/download/fraction.js-4.0.12.tgz", + "integrity": "sha1-BSbUfGWl+0hU33i8d/e+xwjXuMM=" }, - "get-stdin": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz", - "integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==" + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npm.taobao.org/fresh/download/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npm.taobao.org/function-bind/download/function-bind-1.1.1.tgz", + "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=" + }, + "get-intrinsic": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/get-intrinsic/download/get-intrinsic-1.0.1.tgz?cache=0&sync_timestamp=1604120627697&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fget-intrinsic%2Fdownload%2Fget-intrinsic-1.0.1.tgz", + "integrity": "sha1-lKl2j8vdBZWhySc6rPTInQdWMb4=", "requires": { - "assert-plus": "^1.0.0" + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" } }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "get-own-enumerable-property-symbols": { + "version": "3.0.2", + "resolved": "https://registry.npm.taobao.org/get-own-enumerable-property-symbols/download/get-own-enumerable-property-symbols-3.0.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fget-own-enumerable-property-symbols%2Fdownload%2Fget-own-enumerable-property-symbols-3.0.2.tgz", + "integrity": "sha1-tf3nfyLL4185C04ImSLFC85u9mQ=" + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npm.taobao.org/has/download/has-1.0.3.tgz", + "integrity": "sha1-ci18v8H2qoJB8W3YFOAR4fQeh5Y=", "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", - "requires": { - "is-glob": "^4.0.1" - } - }, - "globby": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.1.tgz", - "integrity": "sha512-iH9RmgwCmUJHi2z5o2l3eTtGBtXek1OYlHrbcxOYugyHLmAsZrPj43OtHThd62Buh/Vv6VyCBD2bdyWcGNQqoQ==", - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", - "slash": "^3.0.0" - } - }, - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" - }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", - "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" + "function-bind": "^1.1.1" } }, "has-flag": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, - "he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/has-symbols/download/has-symbols-1.0.1.tgz", + "integrity": "sha1-n1IUdYpEGWxAbZvXbOv4HsLdMeg=" }, - "html-minifier": { - "version": "3.5.21", - "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-3.5.21.tgz", - "integrity": "sha512-LKUKwuJDhxNa3uf/LPR/KVjm/l3rBqtYeCOAekvG8F1vItxMUpueGd94i/asDDr8/1u7InxzFA5EeGjhhG5mMA==", + "hase": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/hase/download/hase-2.0.0.tgz", + "integrity": "sha1-NErtcdAIJsRdCjfN+U/n+vcVTGA=", "requires": { - "camel-case": "3.0.x", - "clean-css": "4.2.x", - "commander": "2.17.x", - "he": "1.2.x", - "param-case": "2.1.x", - "relateurl": "0.2.x", - "uglify-js": "3.4.x" + "@babel/runtime": "7.1.2", + "amqplib": "0.5.2" }, "dependencies": { - "commander": { - "version": "2.17.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", - "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==" + "@babel/runtime": { + "version": "7.1.2", + "resolved": "https://registry.npm.taobao.org/@babel/runtime/download/@babel/runtime-7.1.2.tgz?cache=0&sync_timestamp=1604441258461&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fruntime%2Fdownload%2F%40babel%2Fruntime-7.1.2.tgz", + "integrity": "sha1-gciZNfRkdwb8VFQRRea07P70uOM=", + "requires": { + "regenerator-runtime": "^0.12.0" + } } } }, - "htmlparser2": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", - "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==", + "http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npm.taobao.org/http-errors/download/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", "requires": { - "domelementtype": "^1.3.1", - "domhandler": "^2.3.0", - "domutils": "^1.5.1", - "entities": "^1.1.1", - "inherits": "^2.0.1", - "readable-stream": "^3.1.1" + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" } }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "icons.css": { + "version": "git+https://github.com/picturepan2/icons.css.git#80a5631a2348c47f9c4e1b307c206d074da4e95b", + "from": "git+https://github.com/picturepan2/icons.css.git" + }, + "iconv-lite": { + "version": "0.4.23", + "resolved": "https://registry.npm.taobao.org/iconv-lite/download/iconv-lite-0.4.23.tgz?cache=0&sync_timestamp=1594184266261&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ficonv-lite%2Fdownload%2Ficonv-lite-0.4.23.tgz", + "integrity": "sha1-KXhx9jvlB63Pv8pxXQzQ7thOmmM=", "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==" - }, - "image-size": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.7.5.tgz", - "integrity": "sha512-Hiyv+mXHfFEP7LzUL/llg9RwFxxY+o9N3JVLIeG5E7iFIFAalxvRU9UZthBdYDEVnzHMgjnKJPPpay5BWf1g9g==" - }, - "import-cwd": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-2.1.0.tgz", - "integrity": "sha1-qmzzbnInYShcs3HsZRn1PiQ1sKk=", - "requires": { - "import-from": "^2.1.0" - } - }, - "import-fresh": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", - "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", - "requires": { - "caller-path": "^2.0.0", - "resolve-from": "^3.0.0" - } - }, - "import-from": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/import-from/-/import-from-2.1.0.tgz", - "integrity": "sha1-M1238qev/VOqpHHUuAId7ja387E=", - "requires": { - "resolve-from": "^3.0.0" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "^1.3.0", - "wrappy": "1" + "safer-buffer": ">= 2.1.2 < 3" } }, "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "version": "2.0.3", + "resolved": "https://registry.npm.taobao.org/inherits/download/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + "ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npm.taobao.org/ipaddr.js/download/ipaddr.js-1.9.1.tgz", + "integrity": "sha1-v/OFQ+64mEglB5/zoqjmy9RngbM=" }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + "is-callable": { + "version": "1.2.2", + "resolved": "https://registry.npm.taobao.org/is-callable/download/is-callable-1.2.2.tgz?cache=0&sync_timestamp=1600719278998&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-callable%2Fdownload%2Fis-callable-1.2.2.tgz", + "integrity": "sha1-x8ZxXNItTdtI0+GZcCI6zquwgNk=" }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-directory": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", - "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=" - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" - }, - "js-beautify": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.11.0.tgz", - "integrity": "sha512-a26B+Cx7USQGSWnz9YxgJNMmML/QG2nqIaL7VVYPCXbqiKz8PN0waSNvroMtvAK6tY7g/wPdNWGEP+JTNIBr6A==", - "requires": { - "config-chain": "^1.1.12", - "editorconfig": "^0.15.3", - "glob": "^7.1.3", - "mkdirp": "~1.0.3", - "nopt": "^4.0.3" - } - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" - }, - "js-yaml": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", - "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" - }, - "json-parse-better-errors": { + "is-date-object": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" + "resolved": "https://registry.npm.taobao.org/is-date-object/download/is-date-object-1.0.2.tgz", + "integrity": "sha1-vac28s2P0G0yhE53Q7+nSUw7/X4=" }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + "is-negative-zero": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/is-negative-zero/download/is-negative-zero-2.0.1.tgz?cache=0&sync_timestamp=1607123132826&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-negative-zero%2Fdownload%2Fis-negative-zero-2.0.1.tgz", + "integrity": "sha1-PedGwY3aIxkkGlNnWQjY92bxHCQ=" + }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/is-obj/download/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=" + }, + "is-regex": { + "version": "1.1.1", + "resolved": "https://registry.npm.taobao.org/is-regex/download/is-regex-1.1.1.tgz?cache=0&sync_timestamp=1596555709354&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-regex%2Fdownload%2Fis-regex-1.1.1.tgz", + "integrity": "sha1-xvmKrMVG9s7FRooHt7FTq1ZKV7k=", + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/is-regexp/download/is-regexp-1.0.0.tgz", + "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=" + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npm.taobao.org/is-symbol/download/is-symbol-1.0.3.tgz", + "integrity": "sha1-OOEBS55jKb4N6dJKQU/XRB7GGTc=", + "requires": { + "has-symbols": "^1.0.1" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npm.taobao.org/isarray/download/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "json-lines": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/json-lines/download/json-lines-1.0.0.tgz", + "integrity": "sha1-SsbXUx3uw7koUWx/hol7VI+CcR0=", + "requires": { + "timer2": "1.0.0" + } }, "json-schema-traverse": { "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "resolved": "https://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-0.4.1.tgz?cache=0&sync_timestamp=1599333908796&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjson-schema-traverse%2Fdownload%2Fjson-schema-traverse-0.4.1.tgz", + "integrity": "sha1-afaofZUTq4u4/mO9sJecRI5oRmA=" }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" - }, - "jsonfile": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz", - "integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==", + "jsonwebtoken": { + "version": "8.5.0", + "resolved": "https://registry.npm.taobao.org/jsonwebtoken/download/jsonwebtoken-8.5.0.tgz", + "integrity": "sha1-69DKKml5eBbhxa9ltsdZeHJSlH4=", "requires": { - "graceful-fs": "^4.1.6", - "universalify": "^1.0.0" + "jws": "^3.2.1", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^5.6.0" + }, + "dependencies": { + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.3.tgz?cache=0&sync_timestamp=1607433843106&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.1.3.tgz", + "integrity": "sha1-V0yBOM4dK1hh8LRFedut1gxmFbI=" + } } }, - "jsprim": { + "jwa": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "resolved": "https://registry.npm.taobao.org/jwa/download/jwa-1.4.1.tgz", + "integrity": "sha1-dDwymFy56YZVUw1TZBtmyGRbA5o=", "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" } }, - "juice": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/juice/-/juice-5.2.0.tgz", - "integrity": "sha512-0l6GZmT3efexyaaay3SchKT5kG311N59TEFP5lfvEy0nz9SNqjx311plJ3b4jze7arsmDsiHQLh/xnAuk0HFTQ==", + "jws": { + "version": "3.2.2", + "resolved": "https://registry.npm.taobao.org/jws/download/jws-3.2.2.tgz", + "integrity": "sha1-ABCZ82OUaMlBQADpmZX6UvtHgwQ=", "requires": { - "cheerio": "^0.22.0", - "commander": "^2.15.1", - "cross-spawn": "^6.0.5", - "deep-extend": "^0.6.0", - "mensch": "^0.3.3", - "slick": "^1.12.2", - "web-resource-inliner": "^4.3.1" + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" } }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "limes": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/limes/download/limes-2.0.0.tgz", + "integrity": "sha1-Mrn6DGL+coJiyLIxbKNJbt5xU/4=", "requires": { - "p-locate": "^4.1.0" + "@babel/runtime": "7.3.4", + "jsonwebtoken": "8.5.0" } }, "lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" + "version": "4.17.11", + "resolved": "https://registry.npm.taobao.org/lodash/download/lodash-4.17.11.tgz?cache=0&sync_timestamp=1597335994883&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flodash%2Fdownload%2Flodash-4.17.11.tgz", + "integrity": "sha1-s56mIp72B+zYniyN8SU2iRysm40=" }, - "lodash.assignin": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assignin/-/lodash.assignin-4.2.0.tgz", - "integrity": "sha1-uo31+4QesKPoBEIysOJjqNxqKKI=" + "lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npm.taobao.org/lodash.includes/download/lodash.includes-4.3.0.tgz", + "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=" }, - "lodash.bind": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/lodash.bind/-/lodash.bind-4.2.1.tgz", - "integrity": "sha1-euMBfpOWIqwxt9fX3LGzTbFpDTU=" + "lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npm.taobao.org/lodash.isboolean/download/lodash.isboolean-3.0.3.tgz", + "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=" }, - "lodash.defaults": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", - "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=" + "lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npm.taobao.org/lodash.isinteger/download/lodash.isinteger-4.0.4.tgz", + "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=" }, - "lodash.filter": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.filter/-/lodash.filter-4.6.0.tgz", - "integrity": "sha1-ZosdSYFgOuHMWm+nYBQ+SAtMSs4=" + "lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npm.taobao.org/lodash.isnumber/download/lodash.isnumber-3.0.3.tgz", + "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=" }, - "lodash.flatten": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", - "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=" + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npm.taobao.org/lodash.isplainobject/download/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" }, - "lodash.foreach": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.foreach/-/lodash.foreach-4.5.0.tgz", - "integrity": "sha1-Gmo16s5AEoDH8G3d7DUWWrJ+PlM=" - }, - "lodash.map": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz", - "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=" - }, - "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" - }, - "lodash.pick": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", - "integrity": "sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM=" - }, - "lodash.reduce": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.reduce/-/lodash.reduce-4.6.0.tgz", - "integrity": "sha1-8atrg5KZrUj3hKu/R2WW8DuRTTs=" - }, - "lodash.reject": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.reject/-/lodash.reject-4.6.0.tgz", - "integrity": "sha1-gNZJLcFHCGS79YNTO2UfQqn1JBU=" - }, - "lodash.some": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz", - "integrity": "sha1-G7nzFO9ri63tE7VJFpsqlF62jk0=" - }, - "lodash.unescape": { + "lodash.isstring": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.unescape/-/lodash.unescape-4.0.1.tgz", - "integrity": "sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw=" + "resolved": "https://registry.npm.taobao.org/lodash.isstring/download/lodash.isstring-4.0.1.tgz", + "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" }, - "log-symbols": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npm.taobao.org/lodash.once/download/lodash.once-4.1.1.tgz", + "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" + }, + "lusca": { + "version": "1.6.1", + "resolved": "https://registry.npm.taobao.org/lusca/download/lusca-1.6.1.tgz", + "integrity": "sha1-90ReUMcgAw9e5T0TNunlPReGw08=", "requires": { - "chalk": "^2.0.1" + "tsscmp": "^1.0.5" } }, - "loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "requires": { - "js-tokens": "^3.0.0 || ^4.0.0" - } + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npm.taobao.org/media-typer/download/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" }, - "lower-case": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz", - "integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw=" + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/merge-descriptors/download/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npm.taobao.org/methods/download/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" }, - "mensch": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/mensch/-/mensch-0.3.4.tgz", - "integrity": "sha512-IAeFvcOnV9V0Yk+bFhYR07O3yNina9ANIN5MoXBKYJ/RLYPurd2d0yw14MDhpr9/momp0WofT1bPUh3hkzdi/g==" - }, - "merge2": { + "mime": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" - }, - "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" - } + "resolved": "https://registry.npm.taobao.org/mime/download/mime-1.4.1.tgz", + "integrity": "sha1-Eh+evEnjdm8xGnbh+hyAA8SwOqY=" }, "mime-db": { "version": "1.44.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", - "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==" + "resolved": "https://registry.npm.taobao.org/mime-db/download/mime-db-1.44.0.tgz?cache=0&sync_timestamp=1600831202365&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmime-db%2Fdownload%2Fmime-db-1.44.0.tgz", + "integrity": "sha1-+hHF6wrKEzS0Izy01S8QxaYnL5I=" }, "mime-types": { "version": "2.1.27", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", - "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "resolved": "https://registry.npm.taobao.org/mime-types/download/mime-types-2.1.27.tgz", + "integrity": "sha1-R5SfmOJ56lMRn1ci4PNOUpvsAJ8=", "requires": { "mime-db": "1.44.0" } }, - "mimer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mimer/-/mimer-1.1.0.tgz", - "integrity": "sha512-y9dVfy2uiycQvDNiAYW6zp49ZhFlXDMr5wfdOiMbdzGM/0N5LNR6HTUn3un+WUQcM0koaw8FMTG1bt5EnHJdvQ==" + "moment": { + "version": "2.22.2", + "resolved": "https://registry.npm.taobao.org/moment/download/moment-2.22.2.tgz", + "integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y=" }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "morgan": { + "version": "1.9.1", + "resolved": "https://registry.npm.taobao.org/morgan/download/morgan-1.9.1.tgz", + "integrity": "sha1-Co0Wc0odmvvIJLmd+H5zjlji2lk=", "requires": { - "brace-expansion": "^1.1.7" + "basic-auth": "~2.0.0", + "debug": "2.6.9", + "depd": "~1.1.2", + "on-finished": "~2.3.0", + "on-headers": "~1.0.1" } }, - "mjml": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml/-/mjml-4.6.3.tgz", - "integrity": "sha512-nkkdB5lqDi2qHDOnAWCHXk5RmQ2phK6XB2eokpCW5KzK1A5Cbu61/Zw37VJU5gDvoab/ZD3FHBUj8O6alu4c4g==", - "requires": { - "mjml-accordion": "4.6.3", - "mjml-body": "4.6.3", - "mjml-button": "4.6.3", - "mjml-carousel": "4.6.3", - "mjml-cli": "4.6.3", - "mjml-column": "4.6.3", - "mjml-core": "4.6.3", - "mjml-divider": "4.6.3", - "mjml-group": "4.6.3", - "mjml-head": "4.6.3", - "mjml-head-attributes": "4.6.3", - "mjml-head-breakpoint": "4.6.3", - "mjml-head-font": "4.6.3", - "mjml-head-preview": "4.6.3", - "mjml-head-style": "4.6.3", - "mjml-head-title": "4.6.3", - "mjml-hero": "4.6.3", - "mjml-image": "4.6.3", - "mjml-migrate": "4.6.3", - "mjml-navbar": "4.6.3", - "mjml-raw": "4.6.3", - "mjml-section": "4.6.3", - "mjml-social": "4.6.3", - "mjml-spacer": "4.6.3", - "mjml-table": "4.6.3", - "mjml-text": "4.6.3", - "mjml-validator": "4.6.3", - "mjml-wrapper": "4.6.3" - } + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz?cache=0&sync_timestamp=1607433843106&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, - "mjml-accordion": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-accordion/-/mjml-accordion-4.6.3.tgz", - "integrity": "sha512-fpX6Xc2xH++2xsixUv9EzIMz48wsxpEaRohh9IfUPo+q2OoA2eBwnIQFNmBLV3hvkQ5p/ESFP1kUDoC/Ey4diw==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "mjml-core": "4.6.3" - } + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npm.taobao.org/negotiator/download/negotiator-0.6.2.tgz", + "integrity": "sha1-/qz3zPUlp3rpY0Q2pkiD/+yjRvs=" }, - "mjml-body": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-body/-/mjml-body-4.6.3.tgz", - "integrity": "sha512-nnYc2e/vjCzHNQ9h8FFYMyxM6QoJJL27AHUMghiUS1Hi4Pje65Ehisy5hWn9BF7kHyTb2PWg8kDM0qtBUpOfAA==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "mjml-core": "4.6.3" - } - }, - "mjml-button": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-button/-/mjml-button-4.6.3.tgz", - "integrity": "sha512-P8C3xo1kkB96pP3ajsw/AHzorpN5xaA57CKm/A0mjyqGG43VZZS6NVW4cGEcOx7YNMT3DXTqsT6IlWBhNaFesQ==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "mjml-core": "4.6.3" - } - }, - "mjml-carousel": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-carousel/-/mjml-carousel-4.6.3.tgz", - "integrity": "sha512-ITWVOdWAcBpKuMKiv1fcHwIhM7AM2b96l5+fbV8+NU7CD5YQutwgiWLvP4N6NVqr+WeH6fTajWD8//zr73B0Ew==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "mjml-core": "4.6.3" - } - }, - "mjml-cli": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-cli/-/mjml-cli-4.6.3.tgz", - "integrity": "sha512-dmjkuPi3iK340gM6m1ruIrIB50R54MJbpZJ9JIJHrgQwzumSEJGqCVxQIqlChteBzYJ4vTnZFZiBR6ak8x8YSg==", - "requires": { - "@babel/runtime": "^7.8.7", - "chokidar": "^3.0.0", - "glob": "^7.1.1", - "lodash": "^4.17.15", - "mjml-core": "4.6.3", - "mjml-migrate": "4.6.3", - "mjml-parser-xml": "4.6.3", - "mjml-validator": "4.6.3", - "yargs": "^13.3.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" - }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "requires": { - "locate-path": "^3.0.0" - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "requires": { - "p-limit": "^2.0.0" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - } - }, - "yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", - "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - } - }, - "yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } - }, - "mjml-column": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-column/-/mjml-column-4.6.3.tgz", - "integrity": "sha512-LySMYdqMhEE49a6d7M0KOFmH6VYIQDLi8eReW7jozBU1v2mD1Leudm8VHXLc6wLJrUpHD5vNkjQ7ZTErUSwDWg==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "mjml-core": "4.6.3" - } - }, - "mjml-core": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-core/-/mjml-core-4.6.3.tgz", - "integrity": "sha512-DWKh3wwO6y3nPkX29LmHuIynamwb3iDGk/WPu03yfDLYJAeJdVPJ35YCNV2Ap0WFmbSEihXjsGjMmz/g8OTRIg==", - "requires": { - "@babel/runtime": "^7.8.7", - "html-minifier": "^3.5.3", - "js-beautify": "^1.6.14", - "juice": "^5.2.0", - "lodash": "^4.17.15", - "mjml-migrate": "4.6.3", - "mjml-parser-xml": "4.6.3", - "mjml-validator": "4.6.3" - } - }, - "mjml-divider": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-divider/-/mjml-divider-4.6.3.tgz", - "integrity": "sha512-yzErPHvnGRr+3Sc3i0AWBMfBLVXPGW6X6WjpntD8uFTDWzR70VHRV54CqnZv0pv7M4PUuMKT/AsJsFsXc1iw3A==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "mjml-core": "4.6.3" - } - }, - "mjml-group": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-group/-/mjml-group-4.6.3.tgz", - "integrity": "sha512-GI3SFDEY00xYXvYyjYHgTpmWnBKq2VKRxaOjybhZTmmHlIqWuJw/U5In2IhIJqjMEvbIaZBxcfUREIelogfRRQ==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "mjml-core": "4.6.3" - } - }, - "mjml-head": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-head/-/mjml-head-4.6.3.tgz", - "integrity": "sha512-db8d0/f8Li8JYIDvkrCzY23KH2lTQ5AqjTUwrOoG15eeSzlx8ugg5f/UaJvNkQsIXUDeVvGpwAz8gXG5x+1YNw==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "mjml-core": "4.6.3" - } - }, - "mjml-head-attributes": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-head-attributes/-/mjml-head-attributes-4.6.3.tgz", - "integrity": "sha512-7AS92bKSo664DQ26b0l8D/yAJ6yNsMbf2wX3rwH9S+hS3+Gyoi29LGtxjk+jlwWOjAsDo/VTZMhMHMquFEUn8w==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "mjml-core": "4.6.3" - } - }, - "mjml-head-breakpoint": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-head-breakpoint/-/mjml-head-breakpoint-4.6.3.tgz", - "integrity": "sha512-La/H4pVyfjwbnq4r/JEBK+3ZMkjJYJGiGuDvdLHBP/cOBRfrtxEGEfMHiJzWAxCayrAd+kw/WlJyI34iLnB0kg==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "mjml-core": "4.6.3" - } - }, - "mjml-head-font": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-head-font/-/mjml-head-font-4.6.3.tgz", - "integrity": "sha512-H0TlnHrN+erBCwHw7BO57BquxLjj+/YleCzRWZIOmwjmtlq0ZfnzCyrH0cAOfxdM/VHBQcRGchQsiZfuACbtPA==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "mjml-core": "4.6.3" - } - }, - "mjml-head-preview": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-head-preview/-/mjml-head-preview-4.6.3.tgz", - "integrity": "sha512-pdSYu7T5dSeAVSQlafN9939hza3C4vy617xIyNGqTJEByvFJGCbo7lPEG0okJIua8+zVRQTzuOOqG2nhWqmrSw==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "mjml-core": "4.6.3" - } - }, - "mjml-head-style": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-head-style/-/mjml-head-style-4.6.3.tgz", - "integrity": "sha512-hnEyVeoYGNyme5maqJaeIkhrcj5j5pzOhUB3p2Ul3ENZfwhdUKyQyvqNAlqo5pVjn7c9otE4NLMOM6uv5lozqg==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "mjml-core": "4.6.3" - } - }, - "mjml-head-title": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-head-title/-/mjml-head-title-4.6.3.tgz", - "integrity": "sha512-PU4lrT7Ci1O0CgKGE3nnQka0k3uuy8BR+O+qip1euHVev5C/UOr1RsMvOpwaVzVUwDfJkY07VafJIooN0/Ubpw==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "mjml-core": "4.6.3" - } - }, - "mjml-hero": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-hero/-/mjml-hero-4.6.3.tgz", - "integrity": "sha512-Q74Hnwb8OtoghIZWzR1jrsmN6SfrBGoNH0f865SccrXqzZFnWyBygoHi2Cszi7OiF9LXF1NvOb8Q2bUmUsyIIw==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "mjml-core": "4.6.3" - } - }, - "mjml-image": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-image/-/mjml-image-4.6.3.tgz", - "integrity": "sha512-/CXBAuqRQ+JJEcIp7SNxnjVSLOmqAnnVsIypMJbENV7hS8o9OnaBPIgjAGB7x+8OVadXfR3RAO5b/XWOrO0CMw==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "mjml-core": "4.6.3" - } - }, - "mjml-migrate": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-migrate/-/mjml-migrate-4.6.3.tgz", - "integrity": "sha512-5vbL2n6Dx9M3vRItgPXm4E0LZw89b4YB4HtoxMquueAIgOkVIMja0FY48wPpIwow2wdKh+b31B6ise3Vmduczg==", - "requires": { - "@babel/runtime": "^7.8.7", - "commander": "^2.11.0", - "js-beautify": "^1.6.14", - "lodash": "^4.17.15", - "mjml-core": "4.5.0", - "mjml-parser-xml": "4.5.0" - }, - "dependencies": { - "mjml-core": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/mjml-core/-/mjml-core-4.5.0.tgz", - "integrity": "sha512-/9M4Dt0f7zaVzP7OJZlqaVWS1ijkoEoF6dKKeiXqRQ3oTvyiTEATHGA5xeifsU4dOzDFhdfFbu54LJOmHdPlVw==", - "requires": { - "babel-runtime": "^6.26.0", - "html-minifier": "^3.5.3", - "js-beautify": "^1.6.14", - "juice": "^5.2.0", - "lodash": "^4.17.15", - "mjml-migrate": "4.5.0", - "mjml-parser-xml": "4.5.0", - "mjml-validator": "4.5.0" - }, - "dependencies": { - "mjml-migrate": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/mjml-migrate/-/mjml-migrate-4.5.0.tgz", - "integrity": "sha512-zzAKSrGpF+OVoa3GHVS7O2A4WZPLBV/Nrc80MGaLS4hhBbuj2WeUdaugVlIMXRRuhQ+nP+k0fZSM8tonDDjd2w==", - "requires": { - "babel-runtime": "^6.26.0", - "commander": "^2.11.0", - "js-beautify": "^1.6.14", - "lodash": "^4.17.15", - "mjml-core": "4.5.0", - "mjml-parser-xml": "4.5.0" - } - } - } - }, - "mjml-migrate": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/mjml-migrate/-/mjml-migrate-4.5.0.tgz", - "integrity": "sha512-zzAKSrGpF+OVoa3GHVS7O2A4WZPLBV/Nrc80MGaLS4hhBbuj2WeUdaugVlIMXRRuhQ+nP+k0fZSM8tonDDjd2w==", - "requires": { - "babel-runtime": "^6.26.0", - "commander": "^2.11.0", - "js-beautify": "^1.6.14", - "lodash": "^4.17.15", - "mjml-core": "4.5.0", - "mjml-parser-xml": "4.5.0" - } - }, - "mjml-parser-xml": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/mjml-parser-xml/-/mjml-parser-xml-4.5.0.tgz", - "integrity": "sha512-9NK9TnkDSJ0M7lMv1vuGjZumi1rqdv4Iwr9rBDpBPUvfv9ay7MoJrQjK28cu6PKcamOK6CHAFXihlV9Q6fbYaA==", - "requires": { - "babel-runtime": "^6.26.0", - "htmlparser2": "^3.9.2", - "lodash": "^4.17.15" - } - }, - "mjml-validator": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/mjml-validator/-/mjml-validator-4.5.0.tgz", - "integrity": "sha512-Qbyf/VCk3U8ViLCu+VCwGYZVQaJAw5brKW/aXeRRHb10LdhaCF1S0JNIiNyutfnqn92QWdzYt6W+cbcEZIKa9A==", - "requires": { - "babel-runtime": "^6.26.0", - "lodash": "^4.17.15", - "warning": "^3.0.0" - } - } - } - }, - "mjml-navbar": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-navbar/-/mjml-navbar-4.6.3.tgz", - "integrity": "sha512-Kqalb/YTicBuCwpUdMPQ+U/Sc6pOe35QWpixcEpIKK204+0+B/zx5vxo9EDDwOBaz4P9PbjSrH+8qHNKp7/i5w==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "mjml-core": "4.6.3" - } - }, - "mjml-parser-xml": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-parser-xml/-/mjml-parser-xml-4.6.3.tgz", - "integrity": "sha512-f4eptqzxAPM3YWvKg16QxiAlcR13jr5RX7x/JCSrV37Vx/Lr9tFe2utI2qEgsXvr2MQPud/fZ69XBCBgxPUvqQ==", - "requires": { - "@babel/runtime": "^7.8.7", - "htmlparser2": "^3.9.2", - "lodash": "^4.17.15" - } - }, - "mjml-raw": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-raw/-/mjml-raw-4.6.3.tgz", - "integrity": "sha512-Q3mU1VFg1iXM8088AAkmQa4I8yHBVjd3nd5ZyLq/s/Ye08NMlu1tgkxnbk8GH8lcVYOFha4BWAo+OhloLOQsYQ==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "mjml-core": "4.6.3" - } - }, - "mjml-section": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-section/-/mjml-section-4.6.3.tgz", - "integrity": "sha512-pZqj7ZmCrpEkAwfGPAF+z6LqWuK3L+3vbCQP7DCeHfvinDufY7M2LE3ususXh9EGJ/RSuFd9q8lxHAtoUZ6OSg==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "mjml-core": "4.6.3" - } - }, - "mjml-social": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-social/-/mjml-social-4.6.3.tgz", - "integrity": "sha512-9RHSmjbIc0F4ps4mcKinFu0T08ECx6o7yzxyG2t2mBiI4DyKEhdR/5iaudTYifAt4a49jv8s/RVXFqjWLPP7RQ==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "mjml-core": "4.6.3" - } - }, - "mjml-spacer": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-spacer/-/mjml-spacer-4.6.3.tgz", - "integrity": "sha512-UhrzNFrK5QJ3AuO3lDzDlf7pTU07PVbwL2qMN8aqS81+wvoWPG3EvFj9JT8KBtAP1FXk+JsqdEqvinOJEQ9Z9Q==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "mjml-core": "4.6.3" - } - }, - "mjml-table": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-table/-/mjml-table-4.6.3.tgz", - "integrity": "sha512-4Og9PJISmbNTU/lFXfWiCFm2bCbVCAEC+7EYyAt/S90KxJci8UikQOfFMupKUabR6DDooIT9X9NFLomOLGsJNQ==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "mjml-core": "4.6.3" - } - }, - "mjml-text": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-text/-/mjml-text-4.6.3.tgz", - "integrity": "sha512-G8P8KgY1rQeABc0+4EOJPo0riHQHFv4pWJnwxHZmK9eHFUMbnD7z5Qh/oSmvNXp5Vsf07l6QdGQN6NF7L0yU0Q==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "mjml-core": "4.6.3" - } - }, - "mjml-validator": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-validator/-/mjml-validator-4.6.3.tgz", - "integrity": "sha512-cLAP7UpI6pXNHjvFYkyDDEc01stNX8rhtDFXTkZ+WDAzE0xUiFrIkiKqiHmYNl9Z5/FCak9+1H65eDYejW2igQ==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "warning": "^3.0.0" - } - }, - "mjml-wrapper": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/mjml-wrapper/-/mjml-wrapper-4.6.3.tgz", - "integrity": "sha512-+TseKSGEzKXlx/E3T41WJg4YlL4qFp/kO/cZ6jau1cBYIxdxnR2f8RLh4wd8b39cnVGQJIYC2MO9H8S/uq+M1A==", - "requires": { - "@babel/runtime": "^7.8.7", - "lodash": "^4.17.15", - "mjml-core": "4.6.3", - "mjml-section": "4.6.3" - } - }, - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" - }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" - }, - "no-case": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", - "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==", - "requires": { - "lower-case": "^1.1.1" - } + "nocache": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/nocache/download/nocache-2.0.0.tgz", + "integrity": "sha1-ICtIAhoMTL3i34DeFaF0Q8i0OYA=" }, "node-releases": { - "version": "1.1.59", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.59.tgz", - "integrity": "sha512-H3JrdUczbdiwxN5FuJPyCHnGHIFqQ0wWxo+9j1kAXAzqNMAHlo+4I/sYYxpyK0irQ73HgdiyzD32oqQDcU2Osw==" + "version": "1.1.67", + "resolved": "https://registry.npm.taobao.org/node-releases/download/node-releases-1.1.67.tgz?cache=0&sync_timestamp=1605581679207&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnode-releases%2Fdownload%2Fnode-releases-1.1.67.tgz", + "integrity": "sha1-KOv8zNC6pqrY6NTY/ky8Sa4jnBI=" }, - "nopt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", - "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", + "node-rsa": { + "version": "0.4.2", + "resolved": "https://registry.npm.taobao.org/node-rsa/download/node-rsa-0.4.2.tgz", + "integrity": "sha1-1jkXKewWqDDtWjgEKzFX0tXXJTA=", "requires": { - "abbrev": "1", - "osenv": "^0.1.4" + "asn1": "0.2.3" } }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + "node-statsd": { + "version": "0.1.1", + "resolved": "https://registry.npm.taobao.org/node-statsd/download/node-statsd-0.1.1.tgz", + "integrity": "sha1-J6WTSHY9CvegN6wqAx/vPwUQE9M=" }, "normalize-range": { "version": "0.1.2", - "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", + "resolved": "https://registry.npm.taobao.org/normalize-range/download/normalize-range-0.1.2.tgz", "integrity": "sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=" }, - "nth-check": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", - "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==", + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npm.taobao.org/object-assign/download/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "object-inspect": { + "version": "1.9.0", + "resolved": "https://registry.npm.taobao.org/object-inspect/download/object-inspect-1.9.0.tgz?cache=0&sync_timestamp=1606804315827&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fobject-inspect%2Fdownload%2Fobject-inspect-1.9.0.tgz", + "integrity": "sha1-yQUh104RJ7ZyZt7TOUrWEWmGUzo=" + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npm.taobao.org/object-keys/download/object-keys-1.1.1.tgz", + "integrity": "sha1-HEfyct8nfzsdrwYWd9nILiMixg4=" + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npm.taobao.org/object.assign/download/object.assign-4.1.2.tgz?cache=0&sync_timestamp=1604117098938&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fobject.assign%2Fdownload%2Fobject.assign-4.1.2.tgz", + "integrity": "sha1-DtVKNC7Os3s4/3brgxoOeIy2OUA=", "requires": { - "boolbase": "~1.0.0" + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" } }, - "num2fraction": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", - "integrity": "sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4=" - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" - }, - "osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" - }, - "param-case": { + "object.getownpropertydescriptors": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz", - "integrity": "sha1-35T9jPZTHs915r75oIWPvHK+Ikc=", + "resolved": "https://registry.npm.taobao.org/object.getownpropertydescriptors/download/object.getownpropertydescriptors-2.1.1.tgz?cache=0&sync_timestamp=1606459922634&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fobject.getownpropertydescriptors%2Fdownload%2Fobject.getownpropertydescriptors-2.1.1.tgz", + "integrity": "sha1-Df2o0QgHTZxWPoBJDIg7ZmEJFUQ=", "requires": { - "no-case": "^2.2.0" + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1" } }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" - }, - "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==" - }, - "pify": { + "on-finished": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - }, - "postcss": { - "version": "7.0.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", - "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "resolved": "https://registry.npm.taobao.org/on-finished/download/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" + "ee-first": "1.1.1" } }, - "postcss-cli": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/postcss-cli/-/postcss-cli-7.1.1.tgz", - "integrity": "sha512-bYQy5ydAQJKCMSpvaMg0ThPBeGYqhQXumjbFOmWnL4u65CYXQ16RfS6afGQpit0dGv/fNzxbdDtx8dkqOhhIbg==", - "requires": { - "chalk": "^4.0.0", - "chokidar": "^3.3.0", - "dependency-graph": "^0.9.0", - "fs-extra": "^9.0.0", - "get-stdin": "^7.0.0", - "globby": "^11.0.0", - "postcss": "^7.0.0", - "postcss-load-config": "^2.0.0", - "postcss-reporter": "^6.0.0", - "pretty-hrtime": "^1.0.3", - "read-cache": "^1.0.0", - "yargs": "^15.0.2" - }, - "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", - "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "requires": { - "has-flag": "^4.0.0" - } - } - } + "on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npm.taobao.org/on-headers/download/on-headers-1.0.2.tgz", + "integrity": "sha1-dysK5qqlJcOZ5Imt+tkMQD6zwo8=" }, - "postcss-load-config": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-2.1.0.tgz", - "integrity": "sha512-4pV3JJVPLd5+RueiVVB+gFOAa7GWc25XQcMp86Zexzke69mKf6Nx9LRcQywdz7yZI9n1udOxmLuAwTBypypF8Q==", - "requires": { - "cosmiconfig": "^5.0.0", - "import-cwd": "^2.0.0" - } + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npm.taobao.org/parseurl/download/parseurl-1.3.3.tgz", + "integrity": "sha1-naGee+6NEt/wUT7Vt2lXeTvC6NQ=" }, - "postcss-reporter": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/postcss-reporter/-/postcss-reporter-6.0.1.tgz", - "integrity": "sha512-LpmQjfRWyabc+fRygxZjpRxfhRf9u/fdlKf4VHG4TSPbV2XNsuISzYW1KL+1aQzx53CAppa1bKG4APIB/DOXXw==", - "requires": { - "chalk": "^2.4.1", - "lodash": "^4.17.11", - "log-symbols": "^2.2.0", - "postcss": "^7.0.7" - } + "partof": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/partof/download/partof-1.0.0.tgz", + "integrity": "sha1-2deUahSn2dlzilnnyI9HjsXJZMo=" + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npm.taobao.org/path-to-regexp/download/path-to-regexp-0.1.7.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpath-to-regexp%2Fdownload%2Fpath-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" }, "postcss-value-parser": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", - "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==" + "resolved": "https://registry.npm.taobao.org/postcss-value-parser/download/postcss-value-parser-4.1.0.tgz?cache=0&sync_timestamp=1588083303810&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpostcss-value-parser%2Fdownload%2Fpostcss-value-parser-4.1.0.tgz", + "integrity": "sha1-RD9qIM7WSBor2k+oUypuVdeJoss=" }, - "pretty-hrtime": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", - "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=" + "processenv": { + "version": "1.1.0", + "resolved": "https://registry.npm.taobao.org/processenv/download/processenv-1.1.0.tgz", + "integrity": "sha1-OGdCJGiVTxr4LOe/uUTIra3Vzfc=", + "requires": { + "babel-runtime": "6.26.0" + } }, - "proto-list": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", - "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=" - }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" - }, - "psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" + "proxy-addr": { + "version": "2.0.6", + "resolved": "https://registry.npm.taobao.org/proxy-addr/download/proxy-addr-2.0.6.tgz", + "integrity": "sha1-/cIzZQVEfT8vLGOO0nLK9hS7sr8=", + "requires": { + "forwarded": "~0.1.2", + "ipaddr.js": "1.9.1" + } }, "punycode": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + "resolved": "https://registry.npm.taobao.org/punycode/download/punycode-2.1.1.tgz", + "integrity": "sha1-tYsBCsQMIsVldhbI0sLALHv0eew=" }, "qs": { "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + "resolved": "https://registry.npm.taobao.org/qs/download/qs-6.5.2.tgz", + "integrity": "sha1-yzroBuh0BERYTvFUzo7pjUA/PjY=" }, - "read-cache": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", - "integrity": "sha1-5mTvMRYRZsl1HNvo28+GtftY93Q=", + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npm.taobao.org/range-parser/download/range-parser-1.2.1.tgz", + "integrity": "sha1-PPNwI9GZ4cJNGlW4SADC8+ZGgDE=" + }, + "raw-body": { + "version": "2.3.3", + "resolved": "https://registry.npm.taobao.org/raw-body/download/raw-body-2.3.3.tgz", + "integrity": "sha1-GzJOzmtXBuFThVvBFIxlu39uoMM=", "requires": { - "pify": "^2.3.0" + "bytes": "3.0.0", + "http-errors": "1.6.3", + "iconv-lite": "0.4.23", + "unpipe": "1.0.0" } }, "readable-stream": { "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "resolved": "https://registry.npm.taobao.org/readable-stream/download/readable-stream-3.6.0.tgz", + "integrity": "sha1-M3u9o63AcGvT4CRCaihtS0sskZg=", "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, - "readdirp": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz", - "integrity": "sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==", - "requires": { - "picomatch": "^2.2.1" - } - }, "regenerator-runtime": { - "version": "0.13.5", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", - "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==" + "version": "0.12.1", + "resolved": "https://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.12.1.tgz?cache=0&sync_timestamp=1595456023687&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fregenerator-runtime%2Fdownload%2Fregenerator-runtime-0.12.1.tgz", + "integrity": "sha1-+hpxVEdkwDb4xJsToIsllMn4oN4=" }, - "relateurl": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", - "integrity": "sha1-VNvzd+UUQKypCkzSdGANP/LYiKk=" - }, - "request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" - }, - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=" - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" - }, - "run-parallel": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", - "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==" + "retry": { + "version": "0.12.0", + "resolved": "https://registry.npm.taobao.org/retry/download/retry-0.12.0.tgz", + "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=" }, "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + "version": "5.1.2", + "resolved": "https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.1.2.tgz", + "integrity": "sha1-mR7GnSluAxN0fVm9/St0XDX4go0=" }, "safer-buffer": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "resolved": "https://registry.npm.taobao.org/safer-buffer/download/safer-buffer-2.1.2.tgz", + "integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo=" }, "semver": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + "resolved": "https://registry.npm.taobao.org/semver/download/semver-5.7.1.tgz?cache=0&sync_timestamp=1606851857382&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsemver%2Fdownload%2Fsemver-5.7.1.tgz", + "integrity": "sha1-qVT5Ma66UI0we78Gnv8MAclhFvc=" }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "send": { + "version": "0.16.2", + "resolved": "https://registry.npm.taobao.org/send/download/send-0.16.2.tgz", + "integrity": "sha1-bsyh4PjBVtFBWXVZhI32RzCmu8E=", "requires": { - "shebang-regex": "^1.0.0" + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.6.2", + "mime": "1.4.1", + "ms": "2.0.0", + "on-finished": "~2.3.0", + "range-parser": "~1.2.0", + "statuses": "~1.4.0" + }, + "dependencies": { + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npm.taobao.org/statuses/download/statuses-1.4.0.tgz", + "integrity": "sha1-u3PURtonlhBu/MG2AaJT1sRr0Ic=" + } } }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + "serve-static": { + "version": "1.13.2", + "resolved": "https://registry.npm.taobao.org/serve-static/download/serve-static-1.13.2.tgz", + "integrity": "sha1-CV6Ecv1bRiN9tQzkhqQ/S4bGzsE=", + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.2", + "send": "0.16.2" + } }, - "sigmund": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", - "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=" + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npm.taobao.org/setprototypeof/download/setprototypeof-1.1.0.tgz", + "integrity": "sha1-0L2FU2iHtv58DYGMuWLZ2RxU5lY=" }, - "slash": { + "sha-1": { + "version": "0.1.1", + "resolved": "https://registry.npm.taobao.org/sha-1/download/sha-1-0.1.1.tgz", + "integrity": "sha1-KjkwS/QburEd2e+3R07CWxqSwlc=" + }, + "split2": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" - }, - "slick": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/slick/-/slick-1.12.2.tgz", - "integrity": "sha1-vQSN23TefRymkV+qSldXCzVQwtc=" - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" - }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "resolved": "https://registry.npm.taobao.org/split2/download/split2-3.0.0.tgz", + "integrity": "sha1-VQV81WBoen72RkRxWXQEV3/xc10=", "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" + "readable-stream": "^3.0.0" } }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npm.taobao.org/stack-trace/download/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=" + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npm.taobao.org/statuses/download/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" + }, + "stethoskop": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/stethoskop/download/stethoskop-1.0.0.tgz", + "integrity": "sha1-uDjo9vePjmb4YTlSToBY5KL3i2I=", "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "node-statsd": "0.1.1" + } + }, + "string.prototype.trimend": { + "version": "1.0.3", + "resolved": "https://registry.npm.taobao.org/string.prototype.trimend/download/string.prototype.trimend-1.0.3.tgz?cache=0&sync_timestamp=1606008280085&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstring.prototype.trimend%2Fdownload%2Fstring.prototype.trimend-1.0.3.tgz", + "integrity": "sha1-oivVPMpcfPRNfJ1ccyEYhz1s0Ys=", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + } + }, + "string.prototype.trimstart": { + "version": "1.0.3", + "resolved": "https://registry.npm.taobao.org/string.prototype.trimstart/download/string.prototype.trimstart-1.0.3.tgz?cache=0&sync_timestamp=1606008280265&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstring.prototype.trimstart%2Fdownload%2Fstring.prototype.trimstart-1.0.3.tgz", + "integrity": "sha1-m0y1kOEjuzZWRAHVmCQpjeUP1ao=", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" } }, "string_decoder": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "resolved": "https://registry.npm.taobao.org/string_decoder/download/string_decoder-1.3.0.tgz", + "integrity": "sha1-QvEUWUpGzxqOMLCoT1bHjD7awh4=", "requires": { "safe-buffer": "~5.2.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.2.1.tgz", + "integrity": "sha1-Hq+fqb2x/dTsdfWPnNtOa3gn7sY=" + } } }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "stringify-object": { + "version": "3.3.0", + "resolved": "https://registry.npm.taobao.org/stringify-object/download/stringify-object-3.3.0.tgz", + "integrity": "sha1-cDBlrvyhkwDTzoivT1s5VtdVZik=", "requires": { - "ansi-regex": "^5.0.0" + "get-own-enumerable-property-symbols": "^3.0.0", + "is-obj": "^1.0.1", + "is-regexp": "^1.0.0" } }, "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "version": "5.5.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-5.5.0.tgz?cache=0&sync_timestamp=1606205044904&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-5.5.0.tgz", + "integrity": "sha1-4uaaRKyHcveKHsCzW2id9lMO/I8=", "requires": { "has-flag": "^3.0.0" } }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "tailwind": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/tailwind/download/tailwind-4.0.0.tgz", + "integrity": "sha1-BwteXxwsGQ5MDRKApGs2xzaepG4=", "requires": { - "is-number": "^7.0.0" + "@babel/runtime": "7.3.4", + "ajv": "6.10.0", + "app-root-path": "2.1.0", + "async-retry": "1.2.3", + "body-parser": "1.18.3", + "commands-events": "1.0.4", + "compression": "1.7.3", + "content-type": "1.0.4", + "cors": "2.8.5", + "crypto2": "2.0.0", + "datasette": "1.0.1", + "draht": "1.0.1", + "express": "4.16.4 ", + "flaschenpost": "1.1.3", + "hase": "2.0.0", + "json-lines": "1.0.0", + "limes": "2.0.0", + "lodash": "4.17.11", + "lusca": "1.6.1", + "morgan": "1.9.1", + "nocache": "2.0.0", + "partof": "1.0.0", + "processenv": "1.1.0", + "stethoskop": "1.0.0", + "timer2": "1.0.0", + "uuidv4": "3.0.1", + "ws": "6.2.0" } }, - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" - }, - "typescript": { - "version": "4.0.3", - "resolved": "https://registry.npm.taobao.org/typescript/download/typescript-4.0.3.tgz?cache=0&sync_timestamp=1600584904815&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftypescript%2Fdownload%2Ftypescript-4.0.3.tgz", - "integrity": "sha1-FTu9Ro7wdyXB35x36LRT+NNqu6U=" - }, - "uglify-js": { - "version": "3.4.10", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.10.tgz", - "integrity": "sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw==", - "requires": { - "commander": "~2.19.0", - "source-map": "~0.6.1" - }, - "dependencies": { - "commander": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==" - } - } - }, - "universalify": { + "timer2": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", - "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==" + "resolved": "https://registry.npm.taobao.org/timer2/download/timer2-1.0.0.tgz", + "integrity": "sha1-eiRBVpxlZMuJH2BXiO7wN32J9d4=" }, - "upper-case": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz", - "integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=" + "tsscmp": { + "version": "1.0.6", + "resolved": "https://registry.npm.taobao.org/tsscmp/download/tsscmp-1.0.6.tgz", + "integrity": "sha1-hbmVg6w1iexL/vgltQAKqRHWBes=" + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npm.taobao.org/type-is/download/type-is-1.6.18.tgz", + "integrity": "sha1-TlUs0F3wlGfcvE73Od6J8s83wTE=", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/unpipe/download/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + }, + "untildify": { + "version": "3.0.3", + "resolved": "https://registry.npm.taobao.org/untildify/download/untildify-3.0.3.tgz", + "integrity": "sha1-HntCsUC8/ZIrIucMoSZb/jY0x8k=" }, "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "version": "4.4.0", + "resolved": "https://registry.npm.taobao.org/uri-js/download/uri-js-4.4.0.tgz?cache=0&sync_timestamp=1598814377097&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Furi-js%2Fdownload%2Furi-js-4.4.0.tgz", + "integrity": "sha1-qnFCYd55PoqCNHp7zJznTobyhgI=", "requires": { "punycode": "^2.1.0" } }, "util-deprecate": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "resolved": "https://registry.npm.taobao.org/util-deprecate/download/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, + "util.promisify": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/util.promisify/download/util.promisify-1.0.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Futil.promisify%2Fdownload%2Futil.promisify-1.0.0.tgz", + "integrity": "sha1-RA9xZaRZyaFtwUXrjnLzVocJcDA=", + "requires": { + "define-properties": "^1.1.2", + "object.getownpropertydescriptors": "^2.0.3" + } + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/utils-merge/download/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + }, "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + "version": "3.3.2", + "resolved": "https://registry.npm.taobao.org/uuid/download/uuid-3.3.2.tgz?cache=0&sync_timestamp=1607460081656&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fuuid%2Fdownload%2Fuuid-3.3.2.tgz", + "integrity": "sha1-G0r0lV6zB3xQHCOHL8ZROBFYcTE=" }, - "valid-data-url": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/valid-data-url/-/valid-data-url-2.0.0.tgz", - "integrity": "sha512-dyCZnv3aCey7yfTgIqdZanKl7xWAEEKCbgmR7SKqyK6QT/Z07ROactrgD1eA37C69ODRj7rNOjzKWVPh0EUjBA==" - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "uuidv4": { + "version": "3.0.1", + "resolved": "https://registry.npm.taobao.org/uuidv4/download/uuidv4-3.0.1.tgz", + "integrity": "sha1-MXUbCrePUMnkLb8jFpMhCzQ1tnM=", "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" + "uuid": "3.3.2" } }, - "warning": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/warning/-/warning-3.0.0.tgz", - "integrity": "sha1-MuU3fLVy3kqwR1O9+IIcAe1gW3w=", - "requires": { - "loose-envify": "^1.0.0" - } + "varname": { + "version": "2.0.3", + "resolved": "https://registry.npm.taobao.org/varname/download/varname-2.0.3.tgz", + "integrity": "sha1-BejcZPu25ZFw3kSq1N3quKuHto4=" }, - "web-resource-inliner": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/web-resource-inliner/-/web-resource-inliner-4.3.4.tgz", - "integrity": "sha512-agVAgRhOOi4GVlvKK34oM23tDgH8390HfLnZY2HZl8OFBwKNvUJkH7t89AT2iluQP8w9VHAAKX6Z8EN7/9tqKA==", - "requires": { - "async": "^3.1.0", - "chalk": "^2.4.2", - "datauri": "^2.0.0", - "htmlparser2": "^4.0.0", - "lodash.unescape": "^4.0.1", - "request": "^2.88.0", - "safer-buffer": "^2.1.2", - "valid-data-url": "^2.0.0", - "xtend": "^4.0.2" - }, - "dependencies": { - "dom-serializer": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", - "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", - "requires": { - "domelementtype": "^2.0.1", - "entities": "^2.0.0" - } - }, - "domelementtype": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.1.tgz", - "integrity": "sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ==" - }, - "domhandler": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-3.0.0.tgz", - "integrity": "sha512-eKLdI5v9m67kbXQbJSNn1zjh0SDzvzWVWtX+qEI3eMjZw8daH9k8rlj1FZY9memPwjiskQFbe7vHVVJIAqoEhw==", - "requires": { - "domelementtype": "^2.0.1" - } - }, - "domutils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.1.0.tgz", - "integrity": "sha512-CD9M0Dm1iaHfQ1R/TI+z3/JWp/pgub0j4jIQKH89ARR4ATAV2nbaOQS5XxU9maJP5jHaPdDDQSEHuE2UmpUTKg==", - "requires": { - "dom-serializer": "^0.2.1", - "domelementtype": "^2.0.1", - "domhandler": "^3.0.0" - } - }, - "entities": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz", - "integrity": "sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ==" - }, - "htmlparser2": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-4.1.0.tgz", - "integrity": "sha512-4zDq1a1zhE4gQso/c5LP1OtrhYTncXNSpvJYtWJBtXAETPlMfi3IFNjGuQbYLuVY4ZR0QMqRVvo4Pdy9KLyP8Q==", - "requires": { - "domelementtype": "^2.0.1", - "domhandler": "^3.0.0", - "domutils": "^2.0.0", - "entities": "^2.0.0" - } - } - } + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npm.taobao.org/vary/download/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" - }, - "wrap-ansi": { + "ws": { "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "resolved": "https://registry.npm.taobao.org/ws/download/ws-6.2.0.tgz?cache=0&sync_timestamp=1607113185603&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fws%2Fdownload%2Fws-6.2.0.tgz", + "integrity": "sha1-E4BtmROypfPLubpHtWPAAsvHxSY=", "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", - "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - } - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "xregexp": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.3.0.tgz", - "integrity": "sha512-7jXDIFXh5yJ/orPn4SXjuVrWWoi4Cr8jfV1eHv9CixKSbU+jY4mxfrBwAuDvupPNKpMUY+FeIqsVw/JLT9+B8g==", - "requires": { - "@babel/runtime-corejs3": "^7.8.3" - } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - }, - "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" - }, - "yargs": { - "version": "15.4.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.0.tgz", - "integrity": "sha512-D3fRFnZwLWp8jVAAhPZBsmeIHY8tTsb8ItV9KaAaopmC6wde2u6Yw29JBIZHXw14kgkRnYmDgmQU4FVMDlIsWw==", - "requires": { - "cliui": "^6.0.0", - "decamelize": "^3.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - } - }, - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, - "dependencies": { - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" - } + "async-limiter": "~1.0.0" } } } diff --git a/package.json b/package.json index 9eeda05..85c6d72 100644 --- a/package.json +++ b/package.json @@ -1,31 +1,15 @@ { - "name": "jellyfin-accounts", + "name": "jfa-go-a17t", "version": "1.0.0", - "description": "This is only used for grabbing scss build dependencies, and isn't a real package.", + "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, - "repository": { - "type": "git", - "url": "git+https://github.com/hrfee/jellyfin-accounts.git" - }, "author": "", "license": "ISC", - "bugs": { - "url": "https://github.com/hrfee/jellyfin-accounts/issues" - }, - "homepage": "https://github.com/hrfee/jellyfin-accounts#readme", "dependencies": { - "@types/jquery": "^3.5.3", - "autoprefixer": "^9.8.5", - "bootstrap": "^5.0.0-alpha3", - "bootstrap4": "npm:bootstrap@^4.5.0", - "clean-css-cli": "^4.3.0", - "esbuild": "^0.7.8", - "lodash": "^4.17.19", - "mjml": "^4.6.3", - "postcss-cli": "^7.1.1", - "typescript": "^4.0.3" + "a17t": "^0.3.0", + "icons.css": "git+https://github.com/picturepan2/icons.css.git" } } diff --git a/pwreset.go b/pwreset.go deleted file mode 100644 index 7e91a47..0000000 --- a/pwreset.go +++ /dev/null @@ -1,105 +0,0 @@ -package main - -import ( - "encoding/json" - "io/ioutil" - "os" - "strings" - "time" - - "github.com/fsnotify/fsnotify" -) - -func (app *appContext) StartPWR() { - app.info.Println("Starting password reset daemon") - path := app.config.Section("password_resets").Key("watch_directory").String() - if _, err := os.Stat(path); os.IsNotExist(err) { - app.err.Printf("Failed to start password reset daemon: Directory \"%s\" doesn't exist", path) - return - } - - watcher, err := fsnotify.NewWatcher() - if err != nil { - app.err.Printf("Couldn't initialise password reset daemon") - return - } - defer watcher.Close() - - done := make(chan bool) - go pwrMonitor(app, watcher) - err = watcher.Add(path) - if err != nil { - app.err.Printf("Failed to start password reset daemon: %s", err) - } - <-done -} - -// PasswordReset represents a passwordreset-xyz.json file generated by Jellyfin. -type PasswordReset struct { - Pin string `json:"Pin"` - Username string `json:"UserName"` - Expiry time.Time `json:"ExpirationDate"` -} - -func pwrMonitor(app *appContext, watcher *fsnotify.Watcher) { - for { - select { - case event, ok := <-watcher.Events: - if !ok { - return - } - if event.Op&fsnotify.Write == fsnotify.Write && strings.Contains(event.Name, "passwordreset") { - var pwr PasswordReset - data, err := ioutil.ReadFile(event.Name) - if err != nil { - return - } - err = json.Unmarshal(data, &pwr) - if len(pwr.Pin) == 0 || err != nil { - return - } - app.info.Printf("New password reset for user \"%s\"", pwr.Username) - if currentTime := time.Now(); pwr.Expiry.After(currentTime) { - user, status, err := app.jf.UserByName(pwr.Username, false) - if !(status == 200 || status == 204) || err != nil { - app.err.Printf("Failed to get users from Jellyfin: Code %d", status) - app.debug.Printf("Error: %s", err) - return - } - app.storage.loadEmails() - var address string - uid := user["Id"] - if uid == nil { - app.err.Printf("Couldn't get user ID for user \"%s\"", pwr.Username) - app.debug.Printf("user maplength: %d", len(user)) - return - } - addr, ok := app.storage.emails[user["Id"].(string)] - if !ok || addr == nil { - app.err.Printf("Couldn't find email for user \"%s\". Make sure it's set", pwr.Username) - return - } - address = addr.(string) - msg, err := app.email.constructReset(pwr, app) - if err != nil { - app.err.Printf("Failed to construct password reset email for %s", pwr.Username) - app.debug.Printf("%s: Error: %s", pwr.Username, err) - } else if err := app.email.send(address, msg); err != nil { - app.err.Printf("Failed to send password reset email to \"%s\"", address) - app.debug.Printf("%s: Error: %s", pwr.Username, err) - } else { - app.info.Printf("Sent password reset email to \"%s\"", address) - } - } else { - app.err.Printf("Password reset for user \"%s\" has already expired (%s). Check your time settings.", pwr.Username, pwr.Expiry) - } - - } - case err, ok := <-watcher.Errors: - if !ok { - return - } - app.err.Printf("Password reset daemon: %s", err) - } - } -} diff --git a/pwval.go b/pwval.go deleted file mode 100644 index 96dcbc3..0000000 --- a/pwval.go +++ /dev/null @@ -1,70 +0,0 @@ -package main - -import ( - "unicode" -) - -// Validator allows for validation of passwords. -type Validator struct { - minLength, upper, lower, number, special int - criteria ValidatorConf - specialChars []rune -} - -type ValidatorConf map[string]int - -func (vd *Validator) init(criteria ValidatorConf) { - vd.specialChars = []rune{'[', '@', '_', '!', '#', '$', '%', '^', '&', '*', '(', ')', '<', '>', '?', '/', '\\', '|', '}', '{', '~', ':', ']'} - vd.criteria = criteria -} - -// This isn't used, its for swagger -type PasswordValidation struct { - Characters bool `json:"length,omitempty"` // Number of characters - Lowercase bool `json:"lowercase,omitempty"` // Number of lowercase characters - Uppercase bool `json:"uppercase,omitempty"` // Number of uppercase characters - Numbers bool `json:"number,omitempty"` // Number of numbers - Specials bool `json:"special,omitempty"` // Number of special characters -} - -func (vd *Validator) validate(password string) map[string]bool { - count := map[string]int{} - for key := range vd.criteria { - count[key] = 0 - } - for _, c := range password { - count["length"] += 1 - if unicode.IsUpper(c) { - count["uppercase"] += 1 - } else if unicode.IsLower(c) { - count["lowercase"] += 1 - } else if unicode.IsNumber(c) { - count["number"] += 1 - } else { - for _, s := range vd.specialChars { - if c == s { - count["special"] += 1 - } - } - } - } - results := map[string]bool{} - for criterion, num := range count { - if num < vd.criteria[criterion] { - results[criterion] = false - } else { - results[criterion] = true - } - } - return results -} - -func (vd *Validator) getCriteria() ValidatorConf { - criteria := ValidatorConf{} - for key, num := range vd.criteria { - if num != 0 { - criteria[key] = num - } - } - return criteria -} diff --git a/scss/README.md b/scss/README.md deleted file mode 100644 index 6928dc7..0000000 --- a/scss/README.md +++ /dev/null @@ -1,10 +0,0 @@ -## SCSS - -* `bs<4/5>-jf.scss` contains the source for the customizations to bootstrap. To customize the UI, you can make modifications to this file and then compile it. - -**Note**: It is assumed that Bootstrap 5 is installed in `../../node_modules/bootstrap` relative to itself, and Bootstrap 4 in `../../node_modules/bootstrap4`. - -* Compilation requires dev dependencies (`poetry update`), bootstrap and some extra npm packages. -* If you're buildings from source, you can simply run `poetry run task compile-css` before building to automatically get deps and compile CSS. -* If you are creating custom css, run `poetry run task get-npm-deps` to only install the necessary dependencies. Follow along with the commands `scss/compile.py` runs to build your css and then set `custom_css` in your config as the path to your minified css and change the `theme` option to `Custom CSS`. - diff --git a/scss/base.scss b/scss/base.scss deleted file mode 100644 index 23edce9..0000000 --- a/scss/base.scss +++ /dev/null @@ -1,126 +0,0 @@ -.pageContainer { - margin: 5% 30% 5% 30%; -} -@media (max-width: 1900px) { - .pageContainer { - margin: 5% 20% 5% 20%; - } -} -@media (max-width: 1100px) { - .pageContainer { - margin: 2%; - } -} -h1 { - /*margin: 20%;*/ - margin-bottom: 5%; -} -.tabGroup { - /*margin: 20%;*/ - margin-bottom: 5%; - margin-top: 5%; -} -.linkForm { - /*margin: 20%;*/ - margin-top: 5%; - margin-bottom: 5%; -} -.contactBox { - /*margin: 20%;*/ - margin-top: 5%; - color: grey; -} -.circle { - /*margin-left: 1rem; - width: 1rem; - height: 1rem; - border-radius: 50%; - z-index: 5000;*/ --webkit-transition: all 300ms cubic-bezier(0.550, 0.055, 0.675, 0.190); --moz-transition: all 300ms cubic-bezier(0.550, 0.055, 0.675, 0.190); - -o-transition: all 300ms cubic-bezier(0.550, 0.055, 0.675, 0.190); - transition: all 300ms cubic-bezier(0.550, 0.055, 0.675, 0.190); /* easeInCubic */ -} -.smooth-transition { --webkit-transition: all 300ms cubic-bezier(0.550, 0.055, 0.675, 0.190); --moz-transition: all 300ms cubic-bezier(0.550, 0.055, 0.675, 0.190); - -o-transition: all 300ms cubic-bezier(0.550, 0.055, 0.675, 0.190); - transition: all 300ms cubic-bezier(0.550, 0.055, 0.675, 0.190); /* easeincubic */ -} -.rotated { - transform: rotate(180deg); --webkit-transition: all 150ms cubic-bezier(0.770, 0.000, 0.175, 1.000); --moz-transition: all 150ms cubic-bezier(0.770, 0.000, 0.175, 1.000); - -o-transition: all 150ms cubic-bezier(0.770, 0.000, 0.175, 1.000); - transition: all 150ms cubic-bezier(0.770, 0.000, 0.175, 1.000); /* easeInOutQuart */ -} - -.not-rotated { - transform: rotate(0deg); --webkit-transition: all 150ms cubic-bezier(0.770, 0.000, 0.175, 1.000); --moz-transition: all 150ms cubic-bezier(0.770, 0.000, 0.175, 1.000); - -o-transition: all 150ms cubic-bezier(0.770, 0.000, 0.175, 1.000); - transition: all 150ms cubic-bezier(0.770, 0.000, 0.175, 1.000); /* easeInOutQuart */ -} - -.invite-link { - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; - width: auto; -} - -.settingIcon { - margin-left: 0.2rem; -} - -body.modal-open { - overflow: hidden; -} - -@mixin white-text { - &, &:visited, &:hover, &:active { - font-style: inherit; - color: inherit; - font-size: inherit; - text-decoration: none; - font-variant: inherit; - font-weight: inherit; - line-height: inherit; - font-family: inherit; - } -} - -%white-text { - @include white-text; -} - -%link-unstyled { - @include white-text; - background-color: transparent; - margin-right: 0.5rem; -} - -.text-button { - @extend %link-unstyled; -} - -.text-button:hover { - @extend %link-unstyled; -} - -.nl { - @extend %link-unstyled; -} - -.nl:hover { - @extend %white-text; -} - -.unfocused { - display: none; -} - -.text-monospace { - font-family: monospace; -} diff --git a/scss/bs4/bs4-jf.scss b/scss/bs4/bs4-jf.scss deleted file mode 100644 index a9d470c..0000000 --- a/scss/bs4/bs4-jf.scss +++ /dev/null @@ -1,4 +0,0 @@ -@import "../jf-pre.scss"; -@import "../../node_modules/bootstrap4/scss/bootstrap"; -@import "../jf-post.scss"; -@import "../base.scss"; diff --git a/scss/bs4/bs4.scss b/scss/bs4/bs4.scss deleted file mode 100644 index bee395c..0000000 --- a/scss/bs4/bs4.scss +++ /dev/null @@ -1,19 +0,0 @@ -@import "../../node_modules/bootstrap4/scss/bootstrap"; - -.icon-button { - color: $text-muted; -} - -.icon-button:hover { - color: inherit; -} - -.icon-button:active { - color: $text-muted; -} - -.nav-link:hover { - background-color: $list-group-hover-bg; -} - -@import "../base.scss"; diff --git a/scss/bs5/bs5-jf.scss b/scss/bs5/bs5-jf.scss deleted file mode 100644 index 6b4a353..0000000 --- a/scss/bs5/bs5-jf.scss +++ /dev/null @@ -1,7 +0,0 @@ -.btn-close { - filter: invert(80%); -} -@import "../jf-pre.scss"; -@import "../../node_modules/bootstrap/scss/bootstrap"; -@import "../jf-post.scss"; -@import "../base.scss"; diff --git a/scss/bs5/bs5.scss b/scss/bs5/bs5.scss deleted file mode 100644 index 0784b32..0000000 --- a/scss/bs5/bs5.scss +++ /dev/null @@ -1,19 +0,0 @@ -@import "../../node_modules/bootstrap/scss/bootstrap"; - -.icon-button { - color: $text-muted; -} - -.icon-button:hover { - color: inherit; -} - -.icon-button:active { - color: $text-muted; -} - -.nav-link:hover { - background-color: $list-group-hover-bg; -} - -@import "../base.scss"; diff --git a/scss/compile.py b/scss/compile.py deleted file mode 100755 index 9d26a2f..0000000 --- a/scss/compile.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env python3 -import sass -import subprocess -import shutil -import os -from pathlib import Path - - -def runcmd(cmd): - if os.name == "nt": - return subprocess.check_output(cmd, shell=True) - proc = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE) - return proc.communicate() - - -local_path = Path(__file__).resolve().parent - -for bsv in [d for d in local_path.iterdir() if "bs" in d.name]: - scss = [(bsv / f"{bsv.name}-jf.scss"), (bsv / f"{bsv.name}.scss")] - css = [(bsv / f"{bsv.name}-jf.css"), (bsv / f"{bsv.name}.css")] - min_css = [ - (bsv.parents[1] / "data" / "static" / f"{bsv.name}-jf.css"), - (bsv.parents[1] / "data" / "static" / f"{bsv.name}.css"), - ] - for i in range(2): - with open(css[i], "w") as f: - f.write( - sass.compile( - filename=str(scss[i].resolve()), - output_style="expanded", - precision=6, - omit_source_map_url=True, - ) - ) - if css[i].exists(): - print(f"{scss[i].name}: Compiled.") - # postcss only excepts forwards slashes? weird. - cssPath = str(css[i].resolve()) - if os.name == "nt": - cssPath = cssPath.replace("\\", "/") - runcmd(f"npx postcss {cssPath} --replace --use autoprefixer") - print(f"{scss[i].name}: Prefixed.") - runcmd( - f"npx cleancss --level 1 --format breakWith=lf --output {str(min_css[i].resolve())} {str(css[i].resolve())}" - ) - if min_css[i].exists(): - print( - f"{scss[i].name}: Minified and copied to {str(min_css[i].resolve())}." - ) diff --git a/scss/jf-post.scss b/scss/jf-post.scss deleted file mode 100644 index 5a82ff1..0000000 --- a/scss/jf-post.scss +++ /dev/null @@ -1,41 +0,0 @@ -.btn-primary, .btn-outline-primary:hover, .btn-outline-primary:active { - color: $jf-text-bold; -} - -.close { - color: $jf-text-secondary; -} - -.close:hover, .close:active { - color: $jf-text-primary; -} - -.icon-button { - color: $text-muted; -} - -.icon-button:hover { - color: $jf-text-bold; -} - -.icon-button:active { - color: $text-muted; -} - -.text-bright { - color: $jf-text-bold; -} - -.list-group-item-danger { - color: $jf-text-bold; - background-color: $danger; -} - -.list-group-item-success { - color: $jf-text-bold; - background-color: $success; -} - -.nav-link:hover { - background-color: $jf-blue-hover; -} diff --git a/scss/jf-pre.scss b/scss/jf-pre.scss deleted file mode 100644 index 205e77d..0000000 --- a/scss/jf-pre.scss +++ /dev/null @@ -1,101 +0,0 @@ -$jf-blue: rgb(0, 164, 220); -$jf-blue-hover: rgba(0, 164, 220, 0.2); -$jf-blue-focus: rgb(12, 176, 232); -$jf-blue-light: #4bb3dd; - -$jf-red: rgb(204, 0, 0); -$jf-red-light: #e12026; -$jf-yellower: #ffc107; -$jf-yellow: #e1b222; -$jf-orange: #ff870f; -$jf-green: #6fbd45; -$jf-green-dark: #008040; - - -$jf-black: #101010; // 16 16 16 -$jf-gray-90: #202020; // 32 32 32 -$jf-gray-80: #242424; // jf-card 36 36 36 -$jf-gray-70: #292929; // jf-input 41 41 41 -$jf-gray-60: #303030; // jf-button 48 48 48 -$jf-gray-50: #383838; // jf-button-focus 56 56 56 -$jf-text-bold: rgba(255, 255, 255, 0.87); -$jf-text-primary: rgba(255, 255, 255, 0.8); -$jf-text-secondary: rgb(153, 153, 153); - -$primary: $jf-blue; -$secondary: $jf-gray-50; -$success: $jf-green-dark; -$danger: $jf-red-light; -$light: $jf-text-primary; -$dark: $jf-gray-90; -$info: $jf-yellow; -$warning: $jf-yellower; - - - -$enable-gradients: false; -$enable-shadows: false; - -$enable-rounded: false; -$body-bg: $jf-black; -$body-color: $jf-text-primary; -$border-color: $jf-gray-60; -$component-active-color: $jf-text-bold; -$component-active-bg: $jf-blue-focus; -$text-muted: $jf-text-secondary; -$link-color: $jf-blue-focus; -$btn-link-disabled-color: $jf-text-secondary; -$input-bg: $jf-gray-90; -$input-color: $jf-text-primary; -$input-focus-bg: $jf-gray-60; -$input-focus-border-color: $jf-blue-focus; -$input-disabled-bg: $jf-gray-70; -input:disabled { - color: $text-muted; -} -$input-border-color: $jf-gray-60; -$input-placeholder-color: $text-muted; - -$form-check-input-bg: $jf-gray-60; -$form-check-input-border: $jf-gray-50; -$form-check-input-checked-color: $jf-blue-focus; -$form-check-input-checked-bg-color: $jf-blue-hover; - -$input-group-addon-bg: $input-bg; - -$form-select-disabled-color: $jf-text-secondary; -$form-select-disabled-bg: $input-disabled-bg; -$form-select-indicator-color: $jf-gray-50; - -$card-bg: $jf-gray-80; -$card-border-color: null; - -$tooltip-color: $jf-text-bold; -$tooltip-bg: $jf-gray-50; - -$modal-content-bg: $jf-gray-80; -$modal-content-border-color: $jf-gray-50; -$modal-header-border-color: null; -$modal-footer-border-color: null; - -$list-group-bg: $card-bg; -$list-group-border-color: $jf-gray-50; -$list-group-hover-bg: $jf-blue-hover; -$list-group-active-bg: $jf-blue-focus; -$list-group-action-color: $jf-text-primary; -$list-group-action-hover-color: $jf-text-bold; -$list-group-action-active-color: $jf-text-bold; -$list-group-action-active-bg: $jf-blue-focus; - -// idk why but i had to put these above and below the import -.list-group-item-danger { - color: $jf-text-bold; - background-color: $danger; -} - -.list-group-item-success { - color: $jf-text-bold; - background-color: $success; -} - -// @import "../../node_modules/bootstrap/scss/bootstrap"; diff --git a/setup.go b/setup.go deleted file mode 100644 index b6f4502..0000000 --- a/setup.go +++ /dev/null @@ -1,26 +0,0 @@ -package main - -import ( - "github.com/gin-gonic/gin" - "github.com/hrfee/jfa-go/common" - "github.com/hrfee/jfa-go/jfapi" -) - -type testReq struct { - Host string `json:"jfHost"` - Username string `json:"jfUser"` - Password string `json:"jfPassword"` -} - -func (app *appContext) TestJF(gc *gin.Context) { - var req testReq - gc.BindJSON(&req) - tempjf, _ := jfapi.NewJellyfin(req.Host, "jfa-go-setup", app.version, "auth", "auth", common.NewTimeoutHandler("authJF", req.Host, true), 30) - _, status, err := tempjf.Authenticate(req.Username, req.Password) - if !(status == 200 || status == 204) || err != nil { - app.info.Printf("Auth failed with code %d (%s)", status, err) - gc.JSON(401, map[string]bool{"success": false}) - return - } - gc.JSON(200, map[string]bool{"success": true}) -} diff --git a/storage.go b/storage.go deleted file mode 100644 index b21e705..0000000 --- a/storage.go +++ /dev/null @@ -1,213 +0,0 @@ -package main - -import ( - "encoding/json" - "io/ioutil" - "log" - "strconv" - "strings" - "time" -) - -type Storage struct { - timePattern string - invite_path, emails_path, policy_path, configuration_path, displayprefs_path, ombi_path, profiles_path string - invites Invites - profiles map[string]Profile - defaultProfile string - emails, policy, configuration, displayprefs, ombi_template map[string]interface{} - lang Lang -} - -type Lang struct { - FormPath string - Form map[string]interface{} -} - -// timePattern: %Y-%m-%dT%H:%M:%S.%f - -type Profile struct { - Admin bool `json:"admin,omitempty"` - LibraryAccess string `json:"libraries,omitempty"` - FromUser string `json:"fromUser,omitempty"` - Policy map[string]interface{} `json:"policy,omitempty"` - Configuration map[string]interface{} `json:"configuration,omitempty"` - Displayprefs map[string]interface{} `json:"displayprefs,omitempty"` - Default bool `json:"default,omitempty"` -} - -type Invite struct { - Created time.Time `json:"created"` - NoLimit bool `json:"no-limit"` - RemainingUses int `json:"remaining-uses"` - ValidTill time.Time `json:"valid_till"` - Email string `json:"email"` - UsedBy [][]string `json:"used-by"` - Notify map[string]map[string]bool `json:"notify"` - Profile string `json:"profile"` -} - -type Invites map[string]Invite - -func (st *Storage) loadInvites() error { - return loadJSON(st.invite_path, &st.invites) -} - -func (st *Storage) storeInvites() error { - return storeJSON(st.invite_path, st.invites) -} - -func (st *Storage) loadLang() error { - err := loadJSON(st.lang.FormPath, &st.lang.Form) - if err != nil { - return err - } - strings := st.lang.Form["strings"].(map[string]interface{}) - validationStrings := strings["validationStrings"].(map[string]interface{}) - vS, err := json.Marshal(validationStrings) - if err != nil { - return err - } - strings["validationStrings"] = string(vS) - st.lang.Form["strings"] = strings - return nil -} - -func (st *Storage) loadEmails() error { - return loadJSON(st.emails_path, &st.emails) -} - -func (st *Storage) storeEmails() error { - return storeJSON(st.emails_path, st.emails) -} - -func (st *Storage) loadPolicy() error { - return loadJSON(st.policy_path, &st.policy) -} - -func (st *Storage) storePolicy() error { - return storeJSON(st.policy_path, st.policy) -} - -func (st *Storage) loadConfiguration() error { - return loadJSON(st.configuration_path, &st.configuration) -} - -func (st *Storage) storeConfiguration() error { - return storeJSON(st.configuration_path, st.configuration) -} - -func (st *Storage) loadDisplayprefs() error { - return loadJSON(st.displayprefs_path, &st.displayprefs) -} - -func (st *Storage) storeDisplayprefs() error { - return storeJSON(st.displayprefs_path, st.displayprefs) -} - -func (st *Storage) loadOmbiTemplate() error { - return loadJSON(st.ombi_path, &st.ombi_template) -} - -func (st *Storage) storeOmbiTemplate() error { - return storeJSON(st.ombi_path, st.ombi_template) -} - -func (st *Storage) loadProfiles() error { - err := loadJSON(st.profiles_path, &st.profiles) - for name, profile := range st.profiles { - if profile.Default { - st.defaultProfile = name - } - change := false - if profile.Policy["IsAdministrator"] != nil { - profile.Admin = profile.Policy["IsAdministrator"].(bool) - change = true - } - if profile.Policy["EnabledFolders"] != nil { - length := len(profile.Policy["EnabledFolders"].([]interface{})) - if length == 0 { - profile.LibraryAccess = "All" - } else { - profile.LibraryAccess = strconv.Itoa(length) - } - change = true - } - if profile.FromUser == "" { - profile.FromUser = "Unknown" - change = true - } - if change { - st.profiles[name] = profile - } - } - if st.defaultProfile == "" { - for n := range st.profiles { - st.defaultProfile = n - } - } - return err -} - -func (st *Storage) storeProfiles() error { - return storeJSON(st.profiles_path, st.profiles) -} - -func (st *Storage) migrateToProfile() error { - st.loadPolicy() - st.loadConfiguration() - st.loadDisplayprefs() - st.loadProfiles() - st.profiles["Default"] = Profile{ - Policy: st.policy, - Configuration: st.configuration, - Displayprefs: st.displayprefs, - } - return st.storeProfiles() -} - -func loadJSON(path string, obj interface{}) error { - var file []byte - var err error - file, err = ioutil.ReadFile(path) - if err != nil { - file = []byte("{}") - } - err = json.Unmarshal(file, &obj) - if err != nil { - log.Printf("ERROR: Failed to read \"%s\": %s", path, err) - } - return err -} - -func storeJSON(path string, obj interface{}) error { - data, err := json.Marshal(obj) - if err != nil { - return err - } - err = ioutil.WriteFile(path, data, 0644) - if err != nil { - log.Printf("ERROR: Failed to write to \"%s\": %s", path, err) - } - return err -} - -// JF 10.7.0 added hyphens to user IDs like this and we need to upgrade email storage to match it: -// [8 chars]-[4]-[4]-[4]-[12] -// This seems consistent, but we'll grab IDs from jellyfin just in case theres some variation. -func (app *appContext) upgradeEmailStorage(old map[string]interface{}) (map[string]interface{}, int, error) { - jfUsers, status, err := app.jf.GetUsers(false) - if status != 200 || err != nil { - return nil, status, err - } - newEmails := map[string]interface{}{} - for _, user := range jfUsers { - unstripped := user["Id"].(string) - stripped := strings.ReplaceAll(unstripped, "-", "") - email, ok := old[stripped] - if ok { - newEmails[unstripped] = email - } - } - return newEmails, status, err -} diff --git a/ts/accounts.ts b/ts/accounts.ts deleted file mode 100644 index 5955537..0000000 --- a/ts/accounts.ts +++ /dev/null @@ -1,196 +0,0 @@ -import { checkCheckboxes, populateUsers, populateRadios, changeEmail, validateEmail } from "./modules/accounts.js"; -import { _post, _get, _delete, rmAttr, addAttr, createEl } from "./modules/common.js"; -import { populateProfiles } from "./modules/settings.js"; -import { Focus, Unfocus, storeDefaults } from "./modules/admin.js"; - -interface aWindow extends Window { - changeEmail(icon: HTMLElement, id: string): void; -} - -declare var window: aWindow; - -window.changeEmail = changeEmail; - -(document.getElementById('selectAll')).onclick = function (): void { - const checkboxes: NodeListOf = document.getElementById('accountsList').querySelectorAll('input[type=checkbox]'); - for (let i = 0; i < checkboxes.length; i++) { - checkboxes[i].checked = (this).checked; - } - checkCheckboxes(); -}; - -(document.getElementById('deleteModalNotify')).onclick = function (): void { - const textbox: HTMLElement = document.getElementById('deleteModalReasonBox'); - if ((this).checked) { - Focus(textbox); - } else { - Unfocus(textbox); - } -}; - -(document.getElementById('accountsTabDelete')).onclick = function (): void { - const deleteButton = this as HTMLButtonElement; - const checkboxes: NodeListOf = document.getElementById('accountsList').querySelectorAll('input[type=checkbox]:checked'); - let selected: Array = new Array(checkboxes.length); - for (let i = 0; i < checkboxes.length; i++) { - selected[i] = checkboxes[i].id.replace("select_", ""); - } - let title = " user"; - let msg = "Notify user"; - if (selected.length > 1) { - title += "s"; - msg += "s"; - } - title = `Delete ${selected.length} ${title}`; - msg += " of account deletion"; - - document.getElementById('deleteModalTitle').textContent = title; - const dmNotify = document.getElementById('deleteModalNotify') as HTMLInputElement; - dmNotify.checked = false; - document.getElementById('deleteModalNotifyLabel').textContent = msg; - const dmReason = document.getElementById('deleteModalReason') as HTMLTextAreaElement; - dmReason.value = ''; - Unfocus(document.getElementById('deleteModalReasonBox')); - const dmSend = document.getElementById('deleteModalSend') as HTMLButtonElement; - dmSend.textContent = 'Delete'; - dmSend.onclick = function (): void { - const button = this as HTMLButtonElement; - const send = { - 'users': selected, - 'notify': dmNotify.checked, - 'reason': dmReason.value - }; - _delete("/users", send, function (): void { - if (this.readyState == 4) { - if (this.status == 500) { - if ("error" in this.reponse) { - button.textContent = 'Failed'; - } else { - button.textContent = 'Partial fail (check console)'; - console.log(this.response); - } - setTimeout((): void => { - Unfocus(deleteButton); - window.Modals.delete.hide(); - }, 4000); - } else { - Unfocus(deleteButton); - window.Modals.delete.hide() - } - populateUsers(); - checkCheckboxes(); - } - }); - }; - window.Modals.delete.show(); -}; - -(document.getElementById('selectAll')).checked = false; - -(document.getElementById('accountsTabSetDefaults')).onclick = function (): void { - const checkboxes: NodeListOf = document.getElementById('accountsList').querySelectorAll('input[type=checkbox]:checked'); - let userIDs: Array = new Array(checkboxes.length); - for (let i = 0; i < checkboxes.length; i++){ - userIDs[i] = checkboxes[i].id.replace("select_", ""); - } - if (userIDs.length == 0) { - return; - } - populateRadios(); - let userString = 'user'; - if (userIDs.length > 1) { - userString += "s"; - } - populateProfiles(true); - const profileSelect = document.getElementById('profileSelect') as HTMLSelectElement; - profileSelect.textContent = ''; - for (let i = 0; i < window.availableProfiles.length; i++) { - profileSelect.innerHTML += ` - - `; - } - document.getElementById('defaultsTitle').textContent = `Apply settings to ${userIDs.length} ${userString}`; - document.getElementById('userDefaultsDescription').textContent = ` - Apply settings from an existing profile or source settings from a user. - `; - document.getElementById('storeHomescreenLabel').textContent = `Apply homescreen layout`; - Focus(document.getElementById('defaultsSourceSection')); - (document.getElementById('defaultsSource')).value = 'profile'; - Focus(document.getElementById('profileSelectBox')); - Unfocus(document.getElementById('defaultUserRadiosBox')); - Unfocus(document.getElementById('newProfileBox')); - document.getElementById('storeDefaults').onclick = (): void => storeDefaults(userIDs); - window.Modals.userDefaults.show(); -}; - -(document.getElementById('defaultsSource')).addEventListener('change', function (): void { - const radios = document.getElementById('defaultUserRadiosBox'); - const profileBox = document.getElementById('profileSelectBox'); - if (this.value == 'profile') { - Unfocus(radios); - Focus(profileBox); - } else { - Unfocus(profileBox); - Focus(radios); - } -}); - -(document.getElementById('newUserCreate')).onclick = function (): void { - const button = this as HTMLButtonElement; - const ogText = button.textContent; - button.innerHTML = ` - Creating... - `; - const email: string = (document.getElementById('newUserEmail')).value; - var username: string = email; - if (document.getElementById('newUserName') != null) { - username = (document.getElementById('newUserName')).value; - } - const password: string = (document.getElementById('newUserPassword')).value; - if (!validateEmail(email) && email != "") { - return; - } - const send = { - 'username': username, - 'password': password, - 'email': email - }; - _post("/users", send, function (): void { - if (this.readyState == 4) { - rmAttr(button, 'btn-primary'); - if (this.status == 200) { - addAttr(button, 'btn-success'); - button.textContent = 'Success'; - setTimeout((): void => { - rmAttr(button, 'btn-success'); - addAttr(button, 'btn-primary'); - button.textContent = ogText; - window.Modals.newUser.hide(); - }, 1000); - populateUsers(); - } else { - addAttr(button, 'btn-danger'); - if ("error" in this.response) { - button.textContent = this.response["error"]; - } else { - button.textContent = 'Failed'; - } - setTimeout((): void => { - rmAttr(button, 'btn-danger'); - addAttr(button, 'btn-primary'); - button.textContent = ogText; - }, 2000); - populateUsers(); - } - } - }); -}; - -(document.getElementById('accountsTabAddUser')).onclick = function (): void { - (document.getElementById('newUserEmail')).value = ''; - (document.getElementById('newUserPassword')).value = ''; - if (document.getElementById('newUserName') != null) { - (document.getElementById('newUserName')).value = ''; - } - window.Modals.newUser.show(); -}; diff --git a/ts/admin.ts b/ts/admin.ts deleted file mode 100644 index 33eb546..0000000 --- a/ts/admin.ts +++ /dev/null @@ -1,211 +0,0 @@ -import { serializeForm, rmAttr, addAttr, _get, _post, _delete } from "./modules/common.js"; -import { Focus, Unfocus } from "./modules/admin.js"; -import { toggleCSS } from "./modules/animation.js"; -import { populateUsers, checkCheckboxes } from "./modules/accounts.js"; -import { generateInvites, addOptions, checkDuration } from "./modules/invites.js"; -import { showSetting, openSettings } from "./modules/settings.js"; -import { BS4 } from "./modules/bs4.js"; -import { BS5 } from "./modules/bs5.js"; -import "./accounts.js"; -import "./settings.js"; - -interface aWindow extends Window { - toClipboard(str: string): void; -} - -declare var window: aWindow; - -interface TabSwitcher { - els: Array; - tabButtons: Array; - focus: (el: number) => void; - invites: () => void; - accounts: () => void; - settings: () => void; -} - -const tabs: TabSwitcher = { - els: [document.getElementById('invitesTab') as HTMLDivElement, document.getElementById('accountsTab') as HTMLDivElement, document.getElementById('settingsTab') as HTMLDivElement], - tabButtons: [document.getElementById('invitesTabButton') as HTMLAnchorElement, document.getElementById('accountsTabButton') as HTMLAnchorElement, document.getElementById('settingsTabButton') as HTMLAnchorElement], - focus: (el: number): void => { - for (let i = 0; i < tabs.els.length; i++) { - if (i == el) { - Focus(tabs.els[i]); - addAttr(tabs.tabButtons[i], "active"); - } else { - Unfocus(tabs.els[i]); - rmAttr(tabs.tabButtons[i], "active"); - } - } - }, - invites: (): void => tabs.focus(0), - accounts: (): void => { - populateUsers(); - (document.getElementById('selectAll') as HTMLInputElement).checked = false; - checkCheckboxes(); - tabs.focus(1); - }, - settings: (): void => openSettings(document.getElementById('settingsSections'), document.getElementById('settingsContent'), (): void => { - window.BS.triggerTooltips(); - showSetting("ui"); - tabs.focus(2); - }) -}; - -window.bsVersion = window.bs5 ? 5 : 4 - -if (window.bs5) { - window.BS = new BS5; -} else { - window.BS = new BS4; - window.BS.Compat(); -} - -window.Modals = {} as BSModals; - -window.Modals.login = window.BS.newModal('login'); -window.Modals.userDefaults = window.BS.newModal('userDefaults'); -window.Modals.users = window.BS.newModal('users'); -window.Modals.restart = window.BS.newModal('restartModal'); -window.Modals.refresh = window.BS.newModal('refreshModal'); -window.Modals.about = window.BS.newModal('aboutModal'); -window.Modals.delete = window.BS.newModal('deleteModal'); -window.Modals.newUser = window.BS.newModal('newUserModal'); - -tabs.tabButtons[0].onclick = tabs.invites; -tabs.tabButtons[1].onclick = tabs.accounts; -tabs.tabButtons[2].onclick = tabs.settings; - -tabs.invites(); - -// Predefined colors for the theme button. -var buttonColor: string = "custom"; -if (window.cssFile.includes("jf")) { - buttonColor = "rgb(255,255,255)"; -} else if (window.cssFile == ("bs" + window.bsVersion + ".css")) { - buttonColor = "rgb(16,16,16)"; -} - -if (buttonColor != "custom") { - const switchButton = document.createElement('button') as HTMLButtonElement; - switchButton.classList.add('btn', 'btn-secondary'); - switchButton.innerHTML = ` - Theme - - `; - switchButton.onclick = (): void => toggleCSS(document.getElementById('fakeButton')); - document.getElementById('headerButtons').appendChild(switchButton); -} - -var availableProfiles: Array; - -window["token"] = ""; - -window.toClipboard = (str: string): void => { - const el = document.createElement('textarea') as HTMLTextAreaElement; - el.value = str; - el.readOnly = true; - el.style.position = "absolute"; - el.style.left = "-9999px"; - document.body.appendChild(el); - const selected = document.getSelection().rangeCount > 0 ? document.getSelection().getRangeAt(0) : false; - el.select(); - document.execCommand("copy"); - document.body.removeChild(el); - if (selected) { - document.getSelection().removeAllRanges(); - document.getSelection().addRange(selected); - } -} - -function login(username: string, password: string, modal: boolean, button?: HTMLButtonElement, run?: (arg0: number) => void): void { - const req = new XMLHttpRequest(); - req.responseType = 'json'; - let url = window.URLBase; - const refresh = (username == "" && password == ""); - if (refresh) { - url += "/token/refresh"; - } else { - url += "/token/login"; - } - req.open("GET", url, true); - if (!refresh) { - req.setRequestHeader("Authorization", "Basic " + btoa(username + ":" + password)); - } - req.onreadystatechange = function (): void { - if (this.readyState == 4) { - if (this.status != 200) { - let errorMsg = this.response["error"]; - if (!errorMsg) { - errorMsg = "Unknown error"; - } - if (modal) { - button.disabled = false; - button.textContent = errorMsg; - addAttr(button, "btn-danger"); - rmAttr(button, "btn-primary"); - setTimeout((): void => { - addAttr(button, "btn-primary"); - rmAttr(button, "btn-danger"); - button.textContent = "Login"; - }, 4000); - } else { - window.Modals.login.show(); - } - } else { - const data = this.response; - window.token = data["token"]; - generateInvites(); - setInterval((): void => generateInvites(), 60 * 1000); - addOptions(30, document.getElementById('days') as HTMLSelectElement); - addOptions(24, document.getElementById('hours') as HTMLSelectElement); - const minutes = document.getElementById('minutes') as HTMLSelectElement; - addOptions(59, minutes); - minutes.value = "30"; - checkDuration(); - if (modal) { - window.Modals.login.hide(); - } - Focus(document.getElementById('logoutButton')); - } - if (run) { - run(+this.status); - } - } - }; - req.send(); -} - -(document.getElementById('loginForm') as HTMLFormElement).onsubmit = function (): boolean { - window.token = ""; - const details = serializeForm('loginForm'); - const button = document.getElementById('loginSubmit') as HTMLButtonElement; - addAttr(button, "btn-primary"); - rmAttr(button, "btn-danger"); - button.disabled = true; - button.innerHTML = ` - - Loading...`; - login(details["username"], details["password"], true, button); - return false; -}; - -generateInvites(true); - -login("", "", false, null, (status: number): void => { - if (!(status == 200 || status == 204)) { - window.Modals.login.show(); - } -}); - -(document.getElementById('logoutButton') as HTMLButtonElement).onclick = function (): void { - _post("/logout", null, function (): boolean { - if (this.readyState == 4 && this.status == 200) { - window.token = ""; - location.reload(); - return false; - } - }); -}; - - diff --git a/ts/form.ts b/ts/form.ts deleted file mode 100644 index 973e153..0000000 --- a/ts/form.ts +++ /dev/null @@ -1,153 +0,0 @@ -import { serializeForm, _post, _get, _delete, addAttr, rmAttr } from "./modules/common.js"; -import { BS5 } from "./modules/bs5.js"; -import { BS4 } from "./modules/bs4.js"; - -interface formWindow extends Window { - usernameEnabled: boolean; - validationStrings: pwValStrings; - checkPassword(): void; - invalidPassword: string; -} - -declare var window: formWindow; - -interface pwValString { - singular: string; - plural: string; -} - -interface pwValStrings { - length, uppercase, lowercase, number, special: pwValString; -} - -var defaultPwValStrings: pwValStrings = { - length: { - singular: "Must have at least {n} character", - plural: "Must have a least {n} characters" - }, - uppercase: { - singular: "Must have at least {n} uppercase character", - plural: "Must have at least {n} uppercase characters" - }, - lowercase: { - singular: "Must have at least {n} lowercase character", - plural: "Must have at least {n} lowercase characters" - }, - number: { - singular: "Must have at least {n} number", - plural: "Must have at least {n} numbers" - }, - special: { - singular: "Must have at least {n} special character", - plural: "Must have at least {n} special characters" - } -} - -const toggleSpinner = (ogText?: string): string => { - const submitButton = document.getElementById('submitButton') as HTMLButtonElement; - if (document.getElementById('createAccountSpinner')) { - submitButton.innerHTML = ogText ? ogText : `Create Account`; - submitButton.disabled = false; - return ""; - } else { - let ogText = submitButton.innerHTML; - submitButton.innerHTML = ` - Creating... - `; - return ogText; - } -}; - -for (let key in window.validationStrings) { - if (window.validationStrings[key].singular == "" || !(window.validationStrings[key].plural.includes("{n}"))) { - window.validationStrings[key].singular = defaultPwValStrings[key].singular; - } - if (window.validationStrings[key].plural == "" || !(window.validationStrings[key].plural.includes("{n}"))) { - window.validationStrings[key].plural = defaultPwValStrings[key].plural; - } - let el = document.getElementById(key) as HTMLUListElement; - if (el) { - const min: number = +el.getAttribute("min"); - let text = ""; - if (min == 1) { - text = window.validationStrings[key].singular.replace("{n}", "1"); - } else { - text = window.validationStrings[key].plural.replace("{n}", min.toString()); - } - (document.getElementById(key).children[0] as HTMLDivElement).textContent = text; - } -} - -window.BS = window.bs5 ? new BS5 : new BS4; -var successBox: BSModal = window.BS.newModal('successBox');; - -var code = window.location.href.split('/').pop(); - -(document.getElementById('accountForm') as HTMLFormElement).addEventListener('submit', (event: any): boolean => { - event.preventDefault(); - const el = document.getElementById('errorMessage'); - if (el) { - el.remove(); - } - const ogText = toggleSpinner(); - let send: Object = serializeForm('accountForm'); - send["code"] = code; - if (!window.usernameEnabled) { - send["email"] = send["username"]; - } - _post("/newUser", send, function (): void { - if (this.readyState == 4) { - toggleSpinner(ogText); - let data: Object = this.response; - const errorGiven = ("error" in data) - if (errorGiven || data["success"] === false) { - let errorMessage = "Unknown Error"; - if (errorGiven && errorGiven != true) { - errorMessage = data["error"]; - } - document.getElementById('errorBox').innerHTML += ` - - `; - } else { - let valid = true; - for (let key in data) { - if (data.hasOwnProperty(key)) { - const criterion = document.getElementById(key); - if (criterion) { - if (data[key] === false) { - valid = false; - addAttr(criterion, "list-group-item-danger"); - rmAttr(criterion, "list-group-item-success"); - } else { - addAttr(criterion, "list-group-item-success"); - rmAttr(criterion, "list-group-item-danger"); - } - } - } - } - if (valid) { - successBox.show(); - } - } - } - }, true); - return false; -}); - -window.checkPassword = (): void => { - const entry = document.getElementById('inputPassword') as HTMLInputElement; - if (entry.value != "") { - const reentry = document.getElementById('reInputPassword') as HTMLInputElement; - const identical = (entry.value == reentry.value); - const submitButton = document.getElementById('submitButton') as HTMLButtonElement; - if (identical) { - reentry.setCustomValidity(''); - rmAttr(submitButton, "btn-outline-danger"); - addAttr(submitButton, "btn-outline-primary"); - } else { - reentry.setCustomValidity(window.invalidPassword); - addAttr(submitButton, "btn-outline-danger"); - rmAttr(submitButton, "btn-outline-primary"); - } - } -} diff --git a/ts/invites.ts b/ts/invites.ts deleted file mode 100644 index 0b2efd7..0000000 --- a/ts/invites.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { serializeForm, rmAttr, addAttr, _get, _post, _delete } from "./modules/common.js"; -import { generateInvites, checkDuration } from "./modules/invites.js"; - -interface aWindow extends Window { - setProfile(el: HTMLElement): void; -} - -declare var window: aWindow; - -function fixCheckboxes(): void { - const send_to_address: Array = [document.getElementById('send_to_address') as HTMLInputElement, document.getElementById('send_to_address_enabled') as HTMLInputElement]; - if (send_to_address[0] != null) { - send_to_address[0].disabled = !send_to_address[1].checked; - } - const multiUseEnabled = document.getElementById('multiUseEnabled') as HTMLInputElement; - const multiUseCount = document.getElementById('multiUseCount') as HTMLInputElement; - const noUseLimit = document.getElementById('noUseLimit') as HTMLInputElement; - multiUseCount.disabled = !multiUseEnabled.checked; - noUseLimit.checked = false; - noUseLimit.disabled = !multiUseEnabled.checked; -} - -fixCheckboxes(); - -(document.getElementById('inviteForm') as HTMLFormElement).onsubmit = function (): boolean { - const button = document.getElementById('generateSubmit') as HTMLButtonElement; - button.disabled = true; - button.innerHTML = ` - - Loading...`; - let send = serializeForm('inviteForm'); - send["remaining-uses"] = +send["remaining-uses"]; - if (!send['multiple-uses'] || send['no-limit']) { - delete send['remaining-uses']; - } - if (send["profile"] == "NoProfile") { - send["profile"] = ""; - } - const sendToAddress: any = document.getElementById('send_to_address'); - const sendToAddressEnabled: any = document.getElementById('send_to_address_enabled'); - if (sendToAddress && sendToAddressEnabled) { - send['email'] = send['send_to_address']; - delete send['send_to_address']; - delete send['send_to_address_enabled']; - } - _post("/invites", send, function (): void { - if (this.readyState == 4) { - button.textContent = 'Generate'; - button.disabled = false; - generateInvites(); - } - }); - return false; -}; - -window.BS.triggerTooltips(); - -window.setProfile= (select: HTMLSelectElement): void => { - if (!select.value) { - return; - } - let val = select.value; - if (select.value == "NoProfile") { - val = "" - } - const invite = select.id.replace("profile_", ""); - const send = { - "invite": invite, - "profile": val - }; - _post("/invites/profile", send, function (): void { - if (this.readyState == 4 && this.status != 200) { - generateInvites(); - } - }); -} - -const nE: Array = ["days", "hours", "minutes"]; -for (const i in nE) { - document.getElementById(nE[i]).addEventListener("change", checkDuration); -} diff --git a/ts/modules/accounts.ts b/ts/modules/accounts.ts deleted file mode 100644 index 1d5e661..0000000 --- a/ts/modules/accounts.ts +++ /dev/null @@ -1,163 +0,0 @@ -import { _get, _post, _delete, createEl } from "../modules/common.js"; -import { Focus, Unfocus } from "../modules/admin.js"; - -interface aWindow extends Window { - checkCheckboxes: () => void; -} - -declare var window: aWindow; - -export const validateEmail = (email: string): boolean => /\S+@\S+\.\S+/.test(email); - -export const checkCheckboxes = (): void => { - const defaultsButton = document.getElementById('accountsTabSetDefaults'); - const deleteButton = document.getElementById('accountsTabDelete'); - const checkboxes: NodeListOf = document.getElementById('accountsList').querySelectorAll('input[type=checkbox]:checked'); - let checked = checkboxes.length; - if (checked == 0) { - Unfocus(defaultsButton); - Unfocus(deleteButton); - } else { - Focus(defaultsButton); - Focus(deleteButton); - if (checked == 1) { - deleteButton.textContent = 'Delete User'; - } else { - deleteButton.textContent = 'Delete Users'; - } - } -} - -window.checkCheckboxes = checkCheckboxes; - -export function changeEmail(icon: HTMLElement, id: string): void { - const iconContent = icon.outerHTML; - icon.setAttribute('class', ''); - const entry = icon.nextElementSibling as HTMLInputElement; - const ogEmail = entry.value; - entry.readOnly = false; - entry.classList.remove('form-control-plaintext'); - entry.classList.add('form-control'); - if (ogEmail == "") { - entry.placeholder = 'Address'; - } - const tick = createEl(` - - `); - tick.onclick = (): void => { - const newEmail = entry.value; - if (!validateEmail(newEmail) || newEmail == ogEmail) { - return; - } - cross.remove(); - const spinner = createEl(` -
- Saving... -
- `); - tick.replaceWith(spinner); - let send = {}; - send[id] = newEmail; - _post("/users/emails", send, function (): void { - if (this.readyState == 4) { - if (this.status == 200 || this.status == 204) { - entry.nextElementSibling.remove(); - } else { - entry.value = ogEmail; - } - } - }); - icon.outerHTML = iconContent; - entry.readOnly = true; - entry.classList.remove('form-control'); - entry.classList.add('form-control-plaintext'); - entry.placeholder = ''; - }; - const cross = createEl(` - - `); - cross.onclick = (): void => { - tick.remove(); - cross.remove(); - icon.outerHTML = iconContent; - entry.readOnly = true; - entry.classList.remove('form-control'); - entry.classList.add('form-control-plaintext'); - entry.placeholder = ''; - entry.value = ogEmail; - }; - icon.parentNode.appendChild(tick); - icon.parentNode.appendChild(cross); -}; - -export function populateUsers(): void { - const acList = document.getElementById('accountsList'); - acList.innerHTML = ` -
- Getting Users... - -
- `; - Unfocus(acList.parentNode.querySelector('thead')); - const accountsList = document.createElement('tbody'); - accountsList.id = 'accountsList'; - const generateEmail = (id: string, name: string, email: string): string => { - let entry: HTMLDivElement = document.createElement('div'); - entry.id = 'email_' + id; - let emailValue: string = email; - if (emailValue == undefined) { - emailValue = ""; - } - entry.innerHTML = ` - - - `; - return entry.outerHTML; - }; - const template = (id: string, username: string, email: string, lastActive: string, admin: boolean): string => { - let fci = "form-check-input"; - if (window.bsVersion != 5) { - fci = ""; - } - return ` - - ${username}${admin ? 'Admin' : ''} - ${generateEmail(id, name, email)} - ${lastActive} - `; - }; - - _get("/users", null, function (): void { - if (this.readyState == 4 && this.status == 200) { - window.jfUsers = this.response['users']; - for (const user of window.jfUsers) { - let tr = document.createElement('tr'); - tr.innerHTML = template(user['id'], user['name'], user['email'], user['last_active'], user['admin']); - accountsList.appendChild(tr); - } - Focus(acList.parentNode.querySelector('thead')); - acList.replaceWith(accountsList); - } - }); -} - -export function populateRadios(): void { - const radioList = document.getElementById('defaultUserRadios'); - radioList.textContent = ''; - let first = true; - for (const i in window.jfUsers) { - const user = window.jfUsers[i]; - const radio = document.createElement('div'); - radio.classList.add('form-check'); - let checked = ''; - if (first) { - checked = 'checked'; - first = false; - } - radio.innerHTML = ` - - `; - radioList.appendChild(radio); - } -} - diff --git a/ts/modules/admin.ts b/ts/modules/admin.ts deleted file mode 100644 index ade7cb8..0000000 --- a/ts/modules/admin.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { rmAttr, addAttr, _post, _get, _delete, createEl } from "../modules/common.js"; - -export const Focus = (el: HTMLElement): void => rmAttr(el, 'unfocused'); -export const Unfocus = (el: HTMLElement): void => addAttr(el, 'unfocused'); - -export function storeDefaults(users: string | Array): void { - const button = document.getElementById('storeDefaults') as HTMLButtonElement; - button.disabled = true; - button.innerHTML = - '' + - 'Loading...'; - let data = { "homescreen": false }; - if ((document.getElementById('defaultsSource') as HTMLSelectElement).value == 'profile') { - data["from"] = "profile"; - data["profile"] = (document.getElementById('profileSelect') as HTMLSelectElement).value; - } else { - const radio = document.querySelector('input[name=defaultRadios]:checked') as HTMLInputElement - let id = radio.id.replace("default_", ""); - data["from"] = "user"; - data["id"] = id; - } - if (users != "all") { - data["apply_to"] = users; - } - if ((document.getElementById('storeDefaultHomescreen') as HTMLInputElement).checked) { - data["homescreen"] = true; - } - _post("/users/settings", data, function (): void { - if (this.readyState == 4) { - if (this.status == 200 || this.status == 204) { - button.textContent = "Success"; - addAttr(button, "btn-success"); - rmAttr(button, "btn-danger"); - rmAttr(button, "btn-primary"); - button.disabled = false; - setTimeout((): void => { - button.textContent = "Submit"; - addAttr(button, "btn-primary"); - rmAttr(button, "btn-success"); - button.disabled = false; - window.Modals.userDefaults.hide(); - }, 1000); - } else { - if ("error" in this.response) { - button.textContent = this.response["error"]; - } else if (("policy" in this.response) || ("homescreen" in this.response)) { - button.textContent = "Failed (check console)"; - } else { - button.textContent = "Failed"; - } - addAttr(button, "btn-danger"); - rmAttr(button, "btn-primary"); - setTimeout((): void => { - button.textContent = "Submit"; - addAttr(button, "btn-primary"); - rmAttr(button, "btn-danger"); - button.disabled = false; - }, 1000); - } - } - }); -} diff --git a/ts/modules/animation.ts b/ts/modules/animation.ts deleted file mode 100644 index 248d753..0000000 --- a/ts/modules/animation.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { rmAttr, addAttr } from "../modules/common.js"; - -interface aWindow extends Window { - rotateButton(el: HTMLElement): void; -} - -declare var window: aWindow; - -// Used for animation on theme change -const whichTransitionEvent = (): string => { - const el = document.createElement('fakeElement'); - const transitions = { - 'transition': 'transitionend', - 'OTransition': 'oTransitionEnd', - 'MozTransition': 'transitionend', - 'WebkitTransition': 'webkitTransitionEnd' - }; - for (const t in transitions) { - if (el.style[t] !== undefined) { - return transitions[t]; - } - } - return ''; -}; - -var transitionEndEvent = whichTransitionEvent(); - -// Toggles between light and dark themes -const _toggleCSS = (): void => { - const els: NodeListOf = document.querySelectorAll('link[rel="stylesheet"][type="text/css"]'); - let cssEl = 0; - let remove = false; - if (els.length != 1) { - cssEl = 1; - remove = true - } - let href: string = "bs" + window.bsVersion; - if (!els[cssEl].href.includes(href + "-jf")) { - href += "-jf"; - } - href += ".css"; - let newEl = els[cssEl].cloneNode(true) as HTMLLinkElement; - newEl.href = href; - els[cssEl].parentNode.insertBefore(newEl, els[cssEl].nextSibling); - if (remove) { - els[0].remove(); - } - document.cookie = "css=" + href; -} - -// Toggles between light and dark themes, but runs animation if window small enough. -window.buttonWidth = 0; -export const toggleCSS = (el: HTMLElement): void => { - const switchToColor = window.getComputedStyle(document.body, null).backgroundColor; - // Max page width for animation to take place - let maxWidth = 1500; - if (window.innerWidth < maxWidth) { - // Calculate minimum radius to cover screen - const radius = Math.sqrt(Math.pow(window.innerWidth, 2) + Math.pow(window.innerHeight, 2)); - const currentRadius = el.getBoundingClientRect().width / 2; - const scale = radius / currentRadius; - window.buttonWidth = +window.getComputedStyle(el, null).width; - document.body.classList.remove('smooth-transition'); - el.style.transform = `scale(${scale})`; - el.style.color = switchToColor; - el.addEventListener(transitionEndEvent, function (): void { - if (this.style.transform.length != 0) { - _toggleCSS(); - this.style.removeProperty('transform'); - document.body.classList.add('smooth-transition'); - } - }, false); - } else { - _toggleCSS(); - el.style.color = switchToColor; - } -}; - -window.rotateButton = (el: HTMLElement): void => { - if (el.classList.contains("rotated")) { - rmAttr(el, "rotated") - addAttr(el, "not-rotated"); - } else { - rmAttr(el, "not-rotated"); - addAttr(el, "rotated"); - } -}; diff --git a/ts/modules/bs4.ts b/ts/modules/bs4.ts deleted file mode 100644 index 58c7023..0000000 --- a/ts/modules/bs4.ts +++ /dev/null @@ -1,45 +0,0 @@ -declare var $: any; - -class Modal implements BSModal { - el: HTMLDivElement; - modal: any; - - constructor(id: string, find?: boolean) { - this.el = document.getElementById(id) as HTMLDivElement; - this.modal = $(this.el) as any; - this.modal.on("shown.b.modal", (): void => document.body.classList.add('modal-open')); - }; - - show(): void { this.modal.modal("show"); }; - hide(): void { this.modal.modal("hide"); }; -} - -export class BS4 implements Bootstrap { - triggerTooltips: tooltipTrigger = function (): void { - const checkboxes = [].slice.call(document.getElementById('settingsContent').querySelectorAll('input[type="checkbox"]')); - for (const i in checkboxes) { - checkboxes[i].click(); - checkboxes[i].click(); - } - const tooltips = [].slice.call(document.querySelectorAll('a[data-toggle="tooltip"]')); - tooltips.map((el: HTMLAnchorElement): any => { - return ($(el) as any).tooltip(); - }); - }; - - Compat(): void { - console.log('Fixing BS4 Compatability'); - const send_to_address_enabled = document.getElementById('send_to_address_enabled'); - if (send_to_address_enabled) { - send_to_address_enabled.classList.remove("form-check-input"); - } - const multiUseEnabled = document.getElementById('multiUseEnabled'); - if (multiUseEnabled) { - multiUseEnabled.classList.remove("form-check-input"); - } - } - - newModal: ModalConstructor = function (id: string, find?: boolean): BSModal { - return new Modal(id, find); - }; -} diff --git a/ts/modules/bs5.ts b/ts/modules/bs5.ts deleted file mode 100644 index 2c2e166..0000000 --- a/ts/modules/bs5.ts +++ /dev/null @@ -1,37 +0,0 @@ -declare var bootstrap: any; - -class Modal implements BSModal { - el: HTMLDivElement; - modal: any; - - constructor(id: string, find?: boolean) { - this.el = document.getElementById(id) as HTMLDivElement; - if (find) { - this.modal = bootstrap.Modal.getInstance(this.el); - } else { - this.modal = new bootstrap.Modal(this.el); - } - this.el.addEventListener('shown.bs.modal', (): void => document.body.classList.add("modal-open")); - }; - - show(): void { this.modal.show(); }; - hide(): void { this.modal.hide(); }; -} - -export class BS5 implements Bootstrap { - triggerTooltips: tooltipTrigger = function (): void { - const checkboxes = [].slice.call(document.getElementById('settingsContent').querySelectorAll('input[type="checkbox"]')); - for (const i in checkboxes) { - checkboxes[i].click(); - checkboxes[i].click(); - } - const tooltips = [].slice.call(document.querySelectorAll('a[data-toggle="tooltip"]')); - tooltips.map((el: HTMLAnchorElement): any => { - return new bootstrap.Tooltip(el); - }); - }; - - newModal: ModalConstructor = function (id: string, find?: boolean): BSModal { - return new Modal(id, find); - }; -}; diff --git a/ts/modules/common.ts b/ts/modules/common.ts deleted file mode 100644 index 39ba0d2..0000000 --- a/ts/modules/common.ts +++ /dev/null @@ -1,83 +0,0 @@ -declare var window: Window; - -export function createEl(html: string): HTMLElement { - let div = document.createElement('div') as HTMLDivElement; - div.innerHTML = html; - return div.firstElementChild as HTMLElement; -} - -export function serializeForm(id: string): Object { - const form = document.getElementById(id) as HTMLFormElement; - let formData = {}; - for (let i = 0; i < form.elements.length; i++) { - const el = form.elements[i]; - if ((el as HTMLInputElement).type == "submit") { - continue; - } - let name = (el as HTMLInputElement).name; - if (!name) { - name = el.id; - } - switch ((el as HTMLInputElement).type) { - case "checkbox": - formData[name] = (el as HTMLInputElement).checked; - break; - case "text": - case "password": - case "email": - case "number": - formData[name] = (el as HTMLInputElement).value; - break; - case "select-one": - case "select": - let val: string = (el as HTMLSelectElement).value.toString(); - if (!isNaN(val as any)) { - formData[name] = +val; - } else { - formData[name] = val; - } - break; - } - } - return formData; -} - -export const rmAttr = (el: HTMLElement, attr: string): void => { - if (el.classList.contains(attr)) { - el.classList.remove(attr); - } -}; - -export const addAttr = (el: HTMLElement, attr: string): void => el.classList.add(attr); - -export const _get = (url: string, data: Object, onreadystatechange: () => void): void => { - let req = new XMLHttpRequest(); - req.open("GET", window.URLBase + url, true); - req.responseType = 'json'; - req.setRequestHeader("Authorization", "Bearer " + window.token); - req.setRequestHeader('Content-Type', 'application/json; charset=UTF-8'); - req.onreadystatechange = onreadystatechange; - req.send(JSON.stringify(data)); -}; - -export const _post = (url: string, data: Object, onreadystatechange: () => void, response?: boolean): void => { - let req = new XMLHttpRequest(); - req.open("POST", window.URLBase + url, true); - if (response) { - req.responseType = 'json'; - } - req.setRequestHeader("Authorization", "Bearer " + window.token); - req.setRequestHeader('Content-Type', 'application/json; charset=UTF-8'); - req.onreadystatechange = onreadystatechange; - req.send(JSON.stringify(data)); -}; - -export function _delete(url: string, data: Object, onreadystatechange: () => void): void { - let req = new XMLHttpRequest(); - req.open("DELETE", window.URLBase + url, true); - req.setRequestHeader("Authorization", "Bearer " + window.token); - req.setRequestHeader('Content-Type', 'application/json; charset=UTF-8'); - req.onreadystatechange = onreadystatechange; - req.send(JSON.stringify(data)); -} - diff --git a/ts/modules/invites.ts b/ts/modules/invites.ts deleted file mode 100644 index 8e1e2b1..0000000 --- a/ts/modules/invites.ts +++ /dev/null @@ -1,297 +0,0 @@ -import { _get, _post, _delete } from "../modules/common.js"; - -interface aWindow extends Window { - setNotify(el: HTMLElement): void; - deleteInvite(code: string): void; -} - -declare var window: aWindow; - -const emptyInvite = (): Invite => { return { code: "None", empty: true } as Invite; } - -function genUsedBy(usedBy: Array>): string { - let uB = ""; - if (usedBy && usedBy.length != 0) { - uB = ` -
    -
  • Users created:
  • - `; - for (const i in usedBy) { - uB += ` -
  • -
    ${usedBy[i][0]}
    -
    ${usedBy[i][1]}
    -
  • - `; - } - uB += `
` - } - return uB; -} - -function addItem(invite: Invite): void { - const links = document.getElementById('invites'); - const container = document.createElement('div') as HTMLDivElement; - container.id = invite.code; - const item = document.createElement('div') as HTMLDivElement; - item.classList.add('list-group-item', 'd-flex', 'justify-content-between', 'd-inline-block'); - let link = ""; - let innerHTML = `None`; - if (invite.empty) { - item.innerHTML = ` -
- ${innerHTML} -
- `; - container.appendChild(item); - links.appendChild(container); - return; - } - link = window.location.href.split('#')[0] + "invite/" + invite.code; - innerHTML = ` -
- ${invite.code.replace(/-/g, '-')} - - `; - if (invite.email) { - let email = invite.email; - if (!invite.email.includes("Failed to send to")) { - email = `Sent to ${email}`; - } - innerHTML += ` - ${email} - `; - } - innerHTML += ` -
-
- ${invite.expiresIn} -
- - -
-
- `; - - item.innerHTML = innerHTML; - container.appendChild(item); - - let profiles = ` - - `; - - let dateCreated: string; - if (invite.created) { - dateCreated = `
  • Created: ${invite.created}
  • `; - } - - let middle: string; - if (window.notifications_enabled) { - middle = ` -
    -
      - Notify on: -
    • - - -
    • -
    • - - -
    • -
    -
    - `; - } - - let right: string = genUsedBy(invite.usedBy) - - const dropdown = document.createElement('div') as HTMLDivElement; - dropdown.id = `${CSS.escape(invite.code)}_collapse`; - dropdown.classList.add("collapse"); - dropdown.innerHTML = ` -
    -
    -
      -
    • - ${profiles} -
    • - ${dateCreated} -
    • Remaining uses: ${invite.remainingUses}
    • -
    -
    - ${middle} -
    - ${right} -
    -
    - `; - - container.appendChild(dropdown); - links.appendChild(container); -} - -function parseInvite(invite: Object): Invite { - let inv: Invite = { code: invite["code"], empty: false, }; - if (invite["email"]) { - inv.email = invite["email"]; - } - let time = "" - const f = ["days", "hours", "minutes"]; - for (const i in f) { - if (invite[f[i]] != 0) { - time += `${invite[f[i]]}${f[i][0]} `; - } - } - inv.expiresIn = `Expires in ${time.slice(0, -1)}`; - if (invite["no-limit"]) { - inv.remainingUses = "∞"; - } else if ("remaining-uses" in invite) { - inv.remainingUses = invite["remaining-uses"]; - } - if ("used-by" in invite) { - inv.usedBy = invite["used-by"]; - } - if ("created" in invite) { - inv.created = invite["created"]; - } - if ("notify-expiry" in invite) { - inv.notifyExpiry = invite["notify-expiry"]; - } - if ("notify-creation" in invite) { - inv.notifyCreation = invite["notify-creation"]; - } - if ("profile" in invite) { - inv.profile = invite["profile"]; - } - return inv; -} - -window.setNotify = (el: HTMLElement): void => { - let send = {}; - let code: string; - let notifyType: string; - if (el.id.includes("Expiry")) { - code = el.id.replace("_notifyExpiry", ""); - notifyType = "notify-expiry"; - } else if (el.id.includes("Creation")) { - code = el.id.replace("_notifyCreation", ""); - notifyType = "notify-creation"; - } - send[code] = {}; - send[code][notifyType] = (el as HTMLInputElement).checked; - _post("/invites/notify", send, function (): void { - if (this.readyState == 4 && this.status != 200) { - (el as HTMLInputElement).checked = !(el as HTMLInputElement).checked; - } - }); -} - -function updateInvite(invite: Invite): void { - document.getElementById(invite.code + "_expiry").textContent = invite.expiresIn; - const remainingUses: any = document.getElementById(CSS.escape(invite.code) + "_remainingUses"); - if (remainingUses) { - remainingUses.textContent = `Remaining uses: ${invite.remainingUses}`; - } - document.getElementById(CSS.escape(invite.code) + "_usersCreated").innerHTML = genUsedBy(invite.usedBy); -} - -// delete invite from DOM -const hideInvite = (code: string): void => document.getElementById(CSS.escape(code)).remove(); - -// delete invite from jfa-go -window.deleteInvite = (code: string): void => _delete("/invites", { "code": code }, function (): void { - if (this.readyState == 4) { - generateInvites(); - } -}); - -export function generateInvites(empty?: boolean): void { - if (empty) { - document.getElementById('invites').textContent = ''; - addItem(emptyInvite()); - return; - } - _get("/invites", null, function (): void { - if (this.readyState == 4) { - let data = this.response; - window.availableProfiles = data['profiles']; - const Profiles = document.getElementById('inviteProfile') as HTMLSelectElement; - let innerHTML = ""; - for (let i = 0; i < window.availableProfiles.length; i++) { - const profile = window.availableProfiles[i]; - innerHTML += ` - - `; - } - innerHTML += ` - - `; - Profiles.innerHTML = innerHTML; - if (data['invites'] == null || data['invites'].length == 0) { - document.getElementById('invites').textContent = ''; - addItem(emptyInvite()); - return; - } - let items = document.getElementById('invites').children; - for (const i in data['invites']) { - let match = false; - const inv = parseInvite(data['invites'][i]); - for (const x in items) { - if (items[x].id == inv.code) { - match = true; - updateInvite(inv); - break; - } - } - if (!match) { - addItem(inv); - } - } - // second pass to check for expired invites - items = document.getElementById('invites').children; - for (let i = 0; i < items.length; i++) { - let exists = false; - for (const x in data['invites']) { - if (items[i].id == data['invites'][x]['code']) { - exists = true; - break; - } - } - if (!exists) { - hideInvite(items[i].id); - } - } - } - }); -} - -export const addOptions = (length: number, el: HTMLSelectElement): void => { - for (let v = 0; v <= length; v++) { - const opt = document.createElement('option'); - opt.textContent = ""+v; - opt.value = ""+v; - el.appendChild(opt); - } - el.value = "0"; -}; - -export function checkDuration(): void { - const boxVals: Array = [+(document.getElementById("days") as HTMLSelectElement).value, +(document.getElementById("hours") as HTMLSelectElement).value, +(document.getElementById("minutes") as HTMLSelectElement).value]; - const submit = document.getElementById('generateSubmit') as HTMLButtonElement; - if (boxVals.reduce((a: number, b: number): number => a + b) == 0) { - submit.disabled = true; - } else { - submit.disabled = false; - } -} diff --git a/ts/modules/settings.ts b/ts/modules/settings.ts deleted file mode 100644 index 642b148..0000000 --- a/ts/modules/settings.ts +++ /dev/null @@ -1,164 +0,0 @@ -import { _get, _post, _delete, rmAttr, addAttr } from "../modules/common.js"; -import { Focus, Unfocus } from "../modules/admin.js"; - -interface Profile { - Admin: boolean; - LibraryAccess: string; - FromUser: string; -} - -export const populateProfiles = (noTable?: boolean): void => _get("/profiles", null, function (): void { - if (this.readyState == 4 && this.status == 200) { - const profileList = document.getElementById('profileList'); - profileList.textContent = ''; - window.availableProfiles = [this.response["default_profile"]]; - for (let name in this.response["profiles"]) { - if (name != window.availableProfiles[0]) { - window.availableProfiles.push(name); - } - const reqProfile = this.response["profiles"][name]; - if (!noTable && name != "default_profile") { - const profile: Profile = { - Admin: reqProfile["admin"], - LibraryAccess: reqProfile["libraries"], - FromUser: reqProfile["fromUser"] - }; - profileList.innerHTML += ` - ${name} - - ${profile.FromUser} - ${profile.Admin ? "Yes" : "No"} - ${profile.LibraryAccess} - - `; - } - } - } -}); - -export const openSettings = (settingsList: HTMLElement, settingsContent: HTMLElement, callback?: () => void): void => _get("/config", null, function (): void { - if (this.readyState == 4 && this.status == 200) { - settingsList.textContent = ''; - window.config = this.response; - for (const i in window.config["order"]) { - const section: string = window.config["order"][i] - const sectionCollapse = document.createElement('div') as HTMLDivElement; - Unfocus(sectionCollapse); - sectionCollapse.id = section; - - const title: string = window.config[section]["meta"]["name"]; - const description: string = window.config[section]["meta"]["description"]; - const entryListID: string = `${section}_entryList`; - // const footerID: string = `${section}_footer`; - - sectionCollapse.innerHTML = ` -
    - ${description} -
    -
    -
    - `; - - for (const x in config[section]["order"]) { - const entry: string = config[section]["order"][x]; - if (entry == "meta") { - continue; - } - let entryName: string = window.config[section][entry]["name"]; - let required = false; - if (window.config[section][entry]["required"]) { - entryName += ` *`; - required = true; - } - if (window.config[section][entry]["requires_restart"]) { - entryName += ` R`; - } - if ("description" in window.config[section][entry]) { - entryName +=` - - `; - } - const entryValue: boolean | string = window.config[section][entry]["value"]; - const entryType: string = window.config[section][entry]["type"]; - const entryGroup = document.createElement('div'); - if (entryType == "bool") { - entryGroup.classList.add("form-check"); - entryGroup.innerHTML = ` - - - `; - (entryGroup.querySelector('input[type=checkbox]') as HTMLInputElement).onclick = function (): void { - const me = this as HTMLInputElement; - for (const y in window.config["order"]) { - const sect: string = window.config["order"][y]; - for (const z in window.config[sect]["order"]) { - const ent: string = window.config[sect]["order"][z]; - if (`${sect}_${window.config[sect][ent]['depends_true']}` == me.id) { - (document.getElementById(`${sect}_${ent}`) as HTMLInputElement).disabled = !(me.checked); - } else if (`${sect}_${window.config[sect][ent]['depends_false']}` == me.id) { - (document.getElementById(`${sect}_${ent}`) as HTMLInputElement).disabled = me.checked; - } - } - } - }; - } else if ((entryType == 'text') || (entryType == 'email') || (entryType == 'password') || (entryType == 'number')) { - entryGroup.classList.add("form-group"); - entryGroup.innerHTML = ` - - - `; - } else if (entryType == 'select') { - entryGroup.classList.add("form-group"); - const entryOptions: Array = window.config[section][entry]["options"]; - let innerGroup = ` - - `; - entryGroup.innerHTML = innerGroup; - } - sectionCollapse.getElementsByClassName(entryListID)[0].appendChild(entryGroup); - } - - settingsList.innerHTML += ` - - `; - settingsContent.appendChild(sectionCollapse); - } - if (callback) { - callback(); - } - } -}); - -export function showSetting(id: string, runBefore?: () => void): void { - const els = document.getElementById('settingsLeft').querySelectorAll("button[type=button]:not(.static)") as NodeListOf; - for (let i = 0; i < els.length; i++) { - const el = els[i]; - if (el.id != `${id}_button`) { - rmAttr(el, "active"); - } - const sectEl = document.getElementById(el.id.replace("_button", "")); - if (sectEl.id != id) { - Unfocus(sectEl); - } - } - addAttr(document.getElementById(`${id}_button`), "active"); - const section = document.getElementById(id); - if (runBefore) { - runBefore(); - } - Focus(section); - if (screen.width <= 1100) { - // ugly - setTimeout((): void => section.scrollIntoView({ block: "center", behavior: "smooth" }), 200); - } -} - diff --git a/ts/ombi.ts b/ts/ombi.ts deleted file mode 100644 index b3ac076..0000000 --- a/ts/ombi.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { _get, _post, _delete, rmAttr, addAttr } from "./modules/common.js"; - -const ombiDefaultsModal = window.BS.newModal('ombiDefaults'); - -(document.getElementById('openOmbiDefaults') as HTMLButtonElement).onclick = function (): void { - let button = this as HTMLButtonElement; - button.disabled = true; - const ogHTML = button.innerHTML; - button.innerHTML = - '' + - 'Loading...'; - _get("/ombi/users", null, function (): void { - if (this.readyState == 4) { - if (this.status == 200) { - const users = this.response['users']; - const radioList = document.getElementById('ombiUserRadios'); - radioList.textContent = ''; - let first = true; - for (const i in users) { - const user = users[i]; - const radio = document.createElement('div') as HTMLDivElement; - radio.classList.add('form-check'); - let checked = ''; - if (first) { - checked = 'checked'; - first = false; - } - radio.innerHTML = ` - - - `; - radioList.appendChild(radio); - } - button.disabled = false; - button.innerHTML = ogHTML; - const submitButton = document.getElementById('storeOmbiDefaults') as HTMLButtonElement; - submitButton.disabled = false; - submitButton.textContent = 'Submit'; - addAttr(submitButton, "btn-primary"); - rmAttr(submitButton, "btn-success"); - rmAttr(submitButton, "btn-danger"); - ombiDefaultsModal.show(); - } - } - }); -}; - -(document.getElementById('storeOmbiDefaults') as HTMLButtonElement).onclick = function (): void { - let button = this as HTMLButtonElement; - button.disabled = true; - button.innerHTML = - '' + - 'Loading...'; - const radio = document.querySelector('input[name=ombiRadios]:checked') as HTMLInputElement; - const data = { - "id": radio.id.replace("ombiDefault_", "") - }; - _post("/ombi/defaults", data, function (): void { - if (this.readyState == 4) { - if (this.status == 200 || this.status == 204) { - button.textContent = "Success"; - addAttr(button, "btn-success"); - rmAttr(button, "btn-danger"); - rmAttr(button, "btn-primary"); - button.disabled = false; - setTimeout((): void => ombiDefaultsModal.hide(), 1000); - } else { - button.textContent = "Failed"; - rmAttr(button, "btn-primary"); - addAttr(button, "btn-danger"); - setTimeout((): void => { - button.textContent = "Submit"; - addAttr(button, "btn-primary"); - rmAttr(button, "btn-danger"); - button.disabled = false; - }, 1000); - } - } - }); -}; - - - - diff --git a/ts/settings.ts b/ts/settings.ts deleted file mode 100644 index e5da911..0000000 --- a/ts/settings.ts +++ /dev/null @@ -1,205 +0,0 @@ -import { _post, _get, _delete, rmAttr, addAttr } from "./modules/common.js"; -import { generateInvites } from "./modules/invites.js"; -import { populateRadios } from "./modules/accounts.js"; -import { Focus, Unfocus } from "./modules/admin.js"; -import { showSetting, populateProfiles } from "./modules/settings.js"; - -interface aWindow extends Window { - setDefaultProfile(name: string): void; - deleteProfile(name: string): void; - createProfile(): void; - showSetting(id: string, runBefore?: () => void): void; - config: Object; - modifiedConfig: Object; -} - -declare var window: aWindow; - -window.config = {}; -window.modifiedConfig = {}; - -window.showSetting = showSetting; - -function sendConfig(restart?: boolean): void { - window.modifiedConfig["restart-program"] = restart; - _post("/config", window.modifiedConfig, function (): void { - if (this.readyState == 4) { - const save = document.getElementById("settingsSave") as HTMLButtonElement - if (this.status == 200 || this.status == 204) { - save.textContent = "Success"; - addAttr(save, "btn-success"); - rmAttr(save, "btn-primary"); - setTimeout((): void => { - save.textContent = "Save"; - addAttr(save, "btn-primary"); - rmAttr(save, "btn-success"); - }, 1000); - } else { - save.textContent = "Save"; - } - if (restart) { - window.Modals.refresh.show(); - } - } - }); -} - -(document.getElementById('openAbout') as HTMLButtonElement).onclick = (): void => { - window.Modals.about.show(); -}; - -(document.getElementById('profiles_button') as HTMLButtonElement).onclick = (): void => showSetting("profiles", populateProfiles); - -window.setDefaultProfile = (name: string): void => _post("/profiles/default", { "name": name }, function (): void { - if (this.readyState == 4) { - if (this.status != 200) { - (document.getElementById(`defaultProfile_${window.availableProfiles[0]}`) as HTMLInputElement).checked = true; - (document.getElementById(`defaultProfile_${name}`) as HTMLInputElement).checked = false; - } else { - generateInvites(); - } - } -}); - -window.deleteProfile = (name: string): void => _delete("/profiles", { "name": name }, function (): void { - if (this.readyState == 4 && this.status == 200) { - populateProfiles(); - } -}); - -const createProfile = (): void => _get("/users", null, function (): void { - if (this.readyState == 4 && this.status == 200) { - window.jfUsers = this.response["users"]; - populateRadios(); - const submitButton = document.getElementById('storeDefaults') as HTMLButtonElement; - submitButton.disabled = false; - submitButton.textContent = 'Create'; - addAttr(submitButton, "btn-primary"); - rmAttr(submitButton, "btn-danger"); - rmAttr(submitButton, "btn-success"); - document.getElementById('defaultsTitle').textContent = `Create Profile`; - document.getElementById('userDefaultsDescription').textContent = ` - Create an account and configure it to your liking, then choose it from below to store the settings as a profile. Profiles can be specified per invite, so that any new user on that invite will have the settings applied.`; - document.getElementById('storeHomescreenLabel').textContent = `Store homescreen layout`; - (document.getElementById('defaultsSource') as HTMLSelectElement).value = 'fromUser'; - document.getElementById('defaultsSourceSection').classList.add('unfocused'); - (document.getElementById('storeDefaults') as HTMLButtonElement).onclick = storeProfile; - Focus(document.getElementById('newProfileBox')); - (document.getElementById('newProfileName') as HTMLInputElement).value = ''; - Focus(document.getElementById('defaultUserRadiosBox')); - window.Modals.userDefaults.show(); - } -}); - -window.createProfile = createProfile; - -function storeProfile(): void { - this.disabled = true; - this.innerHTML = - '' + - 'Loading...'; - const button = document.getElementById('storeDefaults') as HTMLButtonElement; - const radio = document.querySelector('input[name=defaultRadios]:checked') as HTMLInputElement - const name = (document.getElementById('newProfileName') as HTMLInputElement).value; - let id = radio.id.replace("default_", ""); - let data = { - "name": name, - "id": id, - "homescreen": false - } - if ((document.getElementById('storeDefaultHomescreen') as HTMLInputElement).checked) { - data["homescreen"] = true; - } - _post("/profiles", data, function (): void { - if (this.readyState == 4) { - if (this.status == 200 || this.status == 204) { - button.textContent = "Success"; - addAttr(button, "btn-success"); - rmAttr(button, "btn-danger"); - rmAttr(button, "btn-primary"); - button.disabled = false; - setTimeout((): void => { - button.textContent = "Create"; - addAttr(button, "btn-primary"); - rmAttr(button, "btn-success"); - button.disabled = false; - window.Modals.userDefaults.hide(); - - }, 1000); - populateProfiles(); - generateInvites(); - } else { - if ("error" in this.response) { - button.textContent = this.response["error"]; - } else if (("policy" in this.response) || ("homescreen" in this.response)) { - button.textContent = "Failed (check console)"; - } else { - button.textContent = "Failed"; - } - addAttr(button, "btn-danger"); - rmAttr(button, "btn-primary"); - setTimeout((): void => { - button.textContent = "Create"; - addAttr(button, "btn-primary"); - rmAttr(button, "btn-danger"); - button.disabled = false; - }, 1000); - } - } - }); -} - -// (document.getElementById('openSettings') as HTMLButtonElement).onclick = (): void => openSettings(document.getElementById('settingsList'), document.getElementById('settingsList'), (): void => settingsModal.show()); - -(document.getElementById('settingsSave') as HTMLButtonElement).onclick = function (): void { - window.modifiedConfig = {}; - const save = this as HTMLButtonElement; - let restartSettingsChanged = false; - let settingsChanged = false; - for (const i in window.config["order"]) { - const section = window.config["order"][i]; - for (const x in window.config[section]["order"]) { - const entry = window.config[section]["order"][x]; - if (entry == "meta") { - continue; - } - let val: string; - const entryID = `${section}_${entry}`; - const el = document.getElementById(entryID) as HTMLInputElement; - if (el.type == "checkbox") { - val = el.checked.toString(); - } else { - val = el.value.toString(); - } - if (val != window.config[section][entry]["value"].toString()) { - if (!(section in window.modifiedConfig)) { - window.modifiedConfig[section] = {}; - } - window.modifiedConfig[section][entry] = val; - settingsChanged = true; - if (window.config[section][entry]["requires_restart"]) { - restartSettingsChanged = true; - } - } - } - } - const spinnerHTML = ` - - Loading...`; - if (restartSettingsChanged) { - save.innerHTML = spinnerHTML; - (document.getElementById('applyRestarts') as HTMLButtonElement).onclick = (): void => sendConfig(); - const restartButton = document.getElementById('applyAndRestart') as HTMLButtonElement; - if (restartButton) { - restartButton.onclick = (): void => sendConfig(true); - } - window.Modals.restart.show(); - } else if (settingsChanged) { - save.innerHTML = spinnerHTML; - sendConfig(); - } -}; - -(document.getElementById('restartModalCancel') as HTMLButtonElement).onclick = (): void => { - document.getElementById('settingsSave').textContent = "Save"; -}; diff --git a/ts/tsconfig.json b/ts/tsconfig.json deleted file mode 100644 index 0905779..0000000 --- a/ts/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "outDir": "../data/static", - "target": "es6", - "lib": ["dom", "es2017"], - "typeRoots": ["./node_modules/@types", "./typings"] - } -} diff --git a/ts/typings/d.ts b/ts/typings/d.ts deleted file mode 100644 index 5be1863..0000000 --- a/ts/typings/d.ts +++ /dev/null @@ -1,62 +0,0 @@ -declare interface ModalConstructor { - (id: string, find?: boolean): BSModal; -} - -declare interface BSModal { - el: HTMLDivElement; - modal: any; - show: () => void; - hide: () => void; -} - -declare interface Window { - getComputedStyle(element: HTMLElement, pseudoElt: HTMLElement): any; - bsVersion: number; - bs5: boolean; - BS: Bootstrap; - URLBase: string; - Modals: BSModals; - cssFile: string; - availableProfiles: Array; - jfUsers: Array; - notifications_enabled: boolean; - token: string; - buttonWidth: number; -} - -declare interface tooltipTrigger { - (): void; -} - -declare interface Bootstrap { - newModal: ModalConstructor; - triggerTooltips: tooltipTrigger; - Compat?(): void; -} - -declare interface BSModals { - login: BSModal; - userDefaults: BSModal; - users: BSModal; - restart: BSModal; - refresh: BSModal; - about: BSModal; - delete: BSModal; - newUser: BSModal; -} - -interface Invite { - code?: string; - expiresIn?: string; - empty: boolean; - remainingUses?: string; - email?: string; - usedBy?: Array>; - created?: string; - notifyExpiry?: boolean; - notifyCreation?: boolean; - profile?: string; -} - -declare var config: Object; -declare var modifiedConfig: Object; diff --git a/version.py b/version.py deleted file mode 100644 index 387e23e..0000000 --- a/version.py +++ /dev/null @@ -1,27 +0,0 @@ -import subprocess -import sys -import os -try: - version = sys.argv[1].replace('v', '') -except IndexError: - version = "git" - -if version == "auto": - try: - version = subprocess.check_output("git describe --exact-match HEAD".split()).decode("utf-8").rstrip().replace('v', '') - except subprocess.CalledProcessError as e: - if e.returncode == 128: - version = "git" - -commit = subprocess.check_output("git rev-parse --short HEAD".split()).decode("utf-8").rstrip() - -file = f'package main; const VERSION = "{version}"; const COMMIT = "{commit}";' - -try: - writeto = sys.argv[2] -except IndexError: - writeto = "version.go" - -with open(writeto, 'w') as f: - f.write(file) - diff --git a/views.go b/views.go deleted file mode 100644 index 86e455b..0000000 --- a/views.go +++ /dev/null @@ -1,72 +0,0 @@ -package main - -import ( - "net/http" - "strings" - - "github.com/gin-gonic/gin" -) - -func gcHTML(gc *gin.Context, code int, file string, templ gin.H) { - gc.Header("Cache-Control", "no-cache") - gc.HTML(code, file, templ) -} - -func (app *appContext) AdminPage(gc *gin.Context) { - bs5 := app.config.Section("ui").Key("bs5").MustBool(false) - emailEnabled, _ := app.config.Section("invite_emails").Key("enabled").Bool() - notificationsEnabled, _ := app.config.Section("notifications").Key("enabled").Bool() - ombiEnabled := app.config.Section("ombi").Key("enabled").MustBool(false) - gcHTML(gc, http.StatusOK, "admin.html", gin.H{ - "urlBase": app.URLBase, - "bs5": bs5, - "cssFile": app.cssFile, - "contactMessage": "", - "email_enabled": emailEnabled, - "notifications": notificationsEnabled, - "version": VERSION, - "commit": COMMIT, - "ombiEnabled": ombiEnabled, - "username": !app.config.Section("email").Key("no_username").MustBool(false), - }) -} - -func (app *appContext) InviteProxy(gc *gin.Context) { - code := gc.Param("invCode") - /* Don't actually check if the invite is valid, just if it exists, just so the page loads quicker. Invite is actually checked on submit anyway. */ - // if app.checkInvite(code, false, "") { - if _, ok := app.storage.invites[code]; ok { - email := app.storage.invites[code].Email - if strings.Contains(email, "Failed") { - email = "" - } - gcHTML(gc, http.StatusOK, "form-loader.html", gin.H{ - "urlBase": app.URLBase, - "cssFile": app.cssFile, - "contactMessage": app.config.Section("ui").Key("contact_message").String(), - "helpMessage": app.config.Section("ui").Key("help_message").String(), - "successMessage": app.config.Section("ui").Key("success_message").String(), - "jfLink": app.config.Section("jellyfin").Key("public_server").String(), - "validate": app.config.Section("password_validation").Key("enabled").MustBool(false), - "requirements": app.validator.getCriteria(), - "email": email, - "bs5": app.config.Section("ui").Key("bs5").MustBool(false), - "username": !app.config.Section("email").Key("no_username").MustBool(false), - "lang": app.storage.lang.Form["strings"], - }) - } else { - gcHTML(gc, 404, "invalidCode.html", gin.H{ - "bs5": app.config.Section("ui").Key("bs5").MustBool(false), - "cssFile": app.cssFile, - "contactMessage": app.config.Section("ui").Key("contact_message").String(), - }) - } -} - -func (app *appContext) NoRouteHandler(gc *gin.Context) { - gcHTML(gc, 404, "404.html", gin.H{ - "bs5": app.config.Section("ui").Key("bs5").MustBool(false), - "cssFile": app.cssFile, - "contactMessage": app.config.Section("ui").Key("contact_message").String(), - }) -}