diff --git a/install/main.go b/install/main.go index a8cb13e1..e1994fc2 100644 --- a/install/main.go +++ b/install/main.go @@ -54,8 +54,8 @@ type Config struct { type SupportedContainer string const ( - Docker SupportedContainer = "docker" - Podman SupportedContainer = "podman" + Docker SupportedContainer = "docker" + Podman SupportedContainer = "podman" Undefined SupportedContainer = "undefined" ) @@ -160,7 +160,7 @@ func main() { } else { alreadyInstalled = true fmt.Println("Looks like you already installed Pangolin!") - + // Check if MaxMind database exists and offer to update it fmt.Println("\n=== MaxMind Database Update ===") if _, err := os.Stat("config/GeoLite2-Country.mmdb"); err == nil { @@ -209,8 +209,8 @@ func main() { parsedURL, err := url.Parse(appConfig.DashboardURL) if err != nil { - fmt.Printf("Error parsing URL: %v\n", err) - return + fmt.Printf("Error parsing URL: %v\n", err) + return } config.DashboardDomain = parsedURL.Hostname() @@ -242,7 +242,7 @@ func main() { } } - if !alreadyInstalled { + if !alreadyInstalled || config.DoCrowdsecInstall { // Setup Token Section fmt.Println("\n=== Setup Token ===") @@ -359,7 +359,7 @@ func collectUserInput(reader *bufio.Reader) Config { config.EmailSMTPPort = readInt(reader, "Enter SMTP port (default 587)", 587) config.EmailSMTPUser = readString(reader, "Enter SMTP username", "") config.EmailSMTPPass = readString(reader, "Enter SMTP password", "") // Should this be readPassword? - config.EmailNoReply = readString(reader, "Enter no-reply email address", "") + config.EmailNoReply = readString(reader, "Enter no-reply email address (often the same as SMTP username)", "") } // Validate required fields @@ -371,6 +371,10 @@ func collectUserInput(reader *bufio.Reader) Config { fmt.Println("Error: Let's Encrypt email is required") os.Exit(1) } + if config.EnableEmail && config.EmailNoReply == "" { + fmt.Println("Error: No-reply email address is required when email is enabled") + os.Exit(1) + } // Advanced configuration @@ -643,28 +647,28 @@ func checkPortsAvailable(port int) error { func downloadMaxMindDatabase() error { fmt.Println("Downloading MaxMind GeoLite2 Country database...") - + // Download the GeoLite2 Country database - if err := run("curl", "-L", "-o", "GeoLite2-Country.tar.gz", + if err := run("curl", "-L", "-o", "GeoLite2-Country.tar.gz", "https://github.com/GitSquared/node-geolite2-redist/raw/refs/heads/master/redist/GeoLite2-Country.tar.gz"); err != nil { return fmt.Errorf("failed to download GeoLite2 database: %v", err) } - + // Extract the database if err := run("tar", "-xzf", "GeoLite2-Country.tar.gz"); err != nil { return fmt.Errorf("failed to extract GeoLite2 database: %v", err) } - + // Find the .mmdb file and move it to the config directory if err := run("bash", "-c", "mv GeoLite2-Country_*/GeoLite2-Country.mmdb config/"); err != nil { return fmt.Errorf("failed to move GeoLite2 database to config directory: %v", err) } - + // Clean up the downloaded files if err := run("rm", "-rf", "GeoLite2-Country.tar.gz", "GeoLite2-Country_*"); err != nil { fmt.Printf("Warning: failed to clean up temporary files: %v\n", err) } - + fmt.Println("MaxMind GeoLite2 Country database downloaded successfully!") return nil } diff --git a/package-lock.json b/package-lock.json index 69171ab3..de277ff9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,12 +60,12 @@ "date-fns": "4.1.0", "drizzle-orm": "0.45.0", "eslint": "9.39.1", - "eslint-config-next": "16.0.3", + "eslint-config-next": "16.0.7", "express": "5.2.1", "express-rate-limit": "8.2.1", "glob": "11.1.0", "helmet": "8.1.0", - "http-errors": "2.0.0", + "http-errors": "2.0.1", "i": "^0.3.7", "input-otp": "1.4.2", "ioredis": "5.8.2", @@ -89,7 +89,7 @@ "posthog-node": "^5.11.2", "qrcode.react": "4.2.0", "react": "19.2.1", - "react-day-picker": "9.11.1", + "react-day-picker": "9.11.3", "react-dom": "19.2.1", "react-easy-sort": "^1.8.0", "react-hook-form": "7.68.0", @@ -135,8 +135,8 @@ "@types/nodemailer": "7.0.4", "@types/nprogress": "^0.2.3", "@types/pg": "8.15.6", - "@types/react": "19.2.2", - "@types/react-dom": "19.2.2", + "@types/react": "19.2.7", + "@types/react-dom": "19.2.3", "@types/semver": "^7.7.1", "@types/swagger-ui-express": "^4.1.8", "@types/topojson-client": "^3.1.5", @@ -1555,6 +1555,7 @@ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.10.tgz", "integrity": "sha512-vMqyb7XCDMPvJFFOaT9kxtiRh42GwlZEg1/uIgtZshS5a/8OaduUfCi7kynKgc3Tw/6Uo2D+db9qBttghhmxwQ==", "license": "MIT", + "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.26.2", @@ -3851,9 +3852,9 @@ "license": "MIT" }, "node_modules/@next/eslint-plugin-next": { - "version": "16.0.3", - "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-16.0.3.tgz", - "integrity": "sha512-6sPWmZetzFWMsz7Dhuxsdmbu3fK+/AxKRtj7OB0/3OZAI2MHB/v2FeYh271LZ9abvnM1WIwWc/5umYjx0jo5sQ==", + "version": "16.0.7", + "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-16.0.7.tgz", + "integrity": "sha512-hFrTNZcMEG+k7qxVxZJq3F32Kms130FAhG8lvw2zkKBgAcNOJIxlljNiCjGygvBshvaGBdf88q2CqWtnqezDHA==", "license": "MIT", "dependencies": { "fast-glob": "3.3.1" @@ -10550,20 +10551,20 @@ "license": "MIT" }, "node_modules/@types/react": { - "version": "19.2.2", - "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.2.tgz", - "integrity": "sha512-6mDvHUFSjyT2B2yeNx2nUgMxh9LtOWvkhIU3uePn2I2oyNymUAX1NIsdgviM4CH+JSrp2D2hsMvJOkxY+0wNRA==", + "version": "19.2.7", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.7.tgz", + "integrity": "sha512-MWtvHrGZLFttgeEj28VXHxpmwYbor/ATPYbBfSFZEIRK0ecCFLl2Qo55z52Hss+UV9CRN7trSeq1zbgx7YDWWg==", "devOptional": true, "license": "MIT", "peer": true, "dependencies": { - "csstype": "^3.0.2" + "csstype": "^3.2.2" } }, "node_modules/@types/react-dom": { - "version": "19.2.2", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.2.tgz", - "integrity": "sha512-9KQPoO6mZCi7jcIStSnlOWn2nEF3mNmyr3rIAsGnAbQKYbRLyqmeSc39EVgtxXVia+LMT8j3knZLAZAh+xLmrw==", + "version": "19.2.3", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz", + "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==", "devOptional": true, "license": "MIT", "peer": true, @@ -14788,12 +14789,12 @@ } }, "node_modules/eslint-config-next": { - "version": "16.0.3", - "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-16.0.3.tgz", - "integrity": "sha512-5F6qDjcZldf0Y0ZbqvWvap9xzYUxyDf7/of37aeyhvkrQokj/4bT1JYWZdlWUr283aeVa+s52mPq9ogmGg+5dw==", + "version": "16.0.7", + "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-16.0.7.tgz", + "integrity": "sha512-WubFGLFHfk2KivkdRGfx6cGSFhaQqhERRfyO8BRx+qiGPGp7WLKcPvYC4mdx1z3VhVRcrfFzczjjTrbJZOpnEQ==", "license": "MIT", "dependencies": { - "@next/eslint-plugin-next": "16.0.3", + "@next/eslint-plugin-next": "16.0.7", "eslint-import-resolver-node": "^0.3.6", "eslint-import-resolver-typescript": "^3.5.2", "eslint-plugin-import": "^2.32.0", @@ -14910,6 +14911,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.32.0.tgz", "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", "license": "MIT", + "peer": true, "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.9", @@ -16048,6 +16050,7 @@ "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, "license": "ISC" }, "node_modules/graphemer": { @@ -16213,28 +16216,23 @@ } }, "node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", "license": "MIT", "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" }, "engines": { "node": ">= 0.8" - } - }, - "node_modules/http-errors/node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/human-signals": { @@ -16869,6 +16867,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "dev": true, "license": "ISC", "engines": { "node": ">=16" @@ -16996,6 +16995,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true, "license": "MIT" }, "node_modules/json-schema-traverse": { @@ -21678,9 +21678,9 @@ } }, "node_modules/react-day-picker": { - "version": "9.11.1", - "resolved": "https://registry.npmjs.org/react-day-picker/-/react-day-picker-9.11.1.tgz", - "integrity": "sha512-l3ub6o8NlchqIjPKrRFUCkTUEq6KwemQlfv3XZzzwpUeGwmDJ+0u0Upmt38hJyd7D/vn2dQoOoLV/qAp0o3uUw==", + "version": "9.11.3", + "resolved": "https://registry.npmjs.org/react-day-picker/-/react-day-picker-9.11.3.tgz", + "integrity": "sha512-7lD12UvGbkyXqgzbYIGQTbl+x29B9bAf+k0pP5Dcs1evfpKk6zv4EdH/edNc8NxcmCiTNXr2HIYPrSZ3XvmVBg==", "license": "MIT", "dependencies": { "@date-fns/tz": "^1.4.1", @@ -25178,6 +25178,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", + "dev": true, "license": "ISC", "dependencies": { "isexe": "^3.1.1" diff --git a/package.json b/package.json index aa78f2f1..44a0b7e9 100644 --- a/package.json +++ b/package.json @@ -83,12 +83,12 @@ "date-fns": "4.1.0", "drizzle-orm": "0.45.0", "eslint": "9.39.1", - "eslint-config-next": "16.0.3", + "eslint-config-next": "16.0.7", "express": "5.2.1", "express-rate-limit": "8.2.1", "glob": "11.1.0", "helmet": "8.1.0", - "http-errors": "2.0.0", + "http-errors": "2.0.1", "i": "^0.3.7", "input-otp": "1.4.2", "ioredis": "5.8.2", @@ -112,7 +112,7 @@ "posthog-node": "^5.11.2", "qrcode.react": "4.2.0", "react": "19.2.1", - "react-day-picker": "9.11.1", + "react-day-picker": "9.11.3", "react-dom": "19.2.1", "react-easy-sort": "^1.8.0", "react-hook-form": "7.68.0", @@ -158,8 +158,8 @@ "@types/nprogress": "^0.2.3", "@types/nodemailer": "7.0.4", "@types/pg": "8.15.6", - "@types/react": "19.2.2", - "@types/react-dom": "19.2.2", + "@types/react": "19.2.7", + "@types/react-dom": "19.2.3", "@types/semver": "^7.7.1", "@types/swagger-ui-express": "^4.1.8", "@types/topojson-client": "^3.1.5",