-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat(start.sh): add strong password generation for .env and config.json #722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Implemented a utility function to generate a strong 64-character password using OpenSSL or /dev/urandom as a fallback. - Automatically generate and replace NOFX_ADMIN_PASSWORD in .env and jwt_secret in config.json when these files are created from templates. - Enhanced user experience by providing feedback on password generation during setup.
🔒 PR #722 代码审查报告📊 审查结果:
|
代码审查报告 - PR #722审查结果:
|
Pull Request | PR 提交
📝 Description | 描述
English:
Enhanced the
start.shscript to automatically generate strong passwords forNOFX_ADMIN_PASSWORDandjwt_secretwhen creating configuration files from templates. This improves security by ensuring that default credentials are never used in production environments.中文:
增强了
start.sh脚本,在从模板创建配置文件时自动为NOFX_ADMIN_PASSWORD和jwt_secret生成强密码。这通过确保生产环境中永远不使用默认凭据来提高安全性。🎯 Type of Change | 变更类型
🔗 Related Issues | 相关 Issue
📋 Changes Made | 具体变更
English:
generate_strong_password()utility function that generates 64-character passwords using OpenSSL (with/dev/urandomfallback)check_env()to automatically generate and replaceNOFX_ADMIN_PASSWORDin.envfile when created from templatecheck_config()to automatically generate and replacejwt_secretinconfig.jsonfile when created from templatesedcommandsjqsupport for safer JSON manipulation with fallback tosed中文:
generate_strong_password()工具函数,使用 OpenSSL(带/dev/urandom回退方案)生成 64 字符强密码check_env()函数,在从模板创建.env文件时自动生成并替换NOFX_ADMIN_PASSWORDcheck_config()函数,在从模板创建config.json文件时自动生成并替换jwt_secretsed命令处理jq支持以更安全地操作 JSON,并提供sed回退方案🧪 Testing | 测试
测试步骤 | Testing Steps:
.env和config.json文件./start.sh start命令.env文件中的NOFX_ADMIN_PASSWORD已被自动生成的强密码替换config.json文件中的jwt_secret已被自动生成的强密码替换✅ Checklist | 检查清单
Code Quality | 代码质量
Documentation | 文档
Git
devbranch | 已 rebase 到最新dev分支📚 Additional Notes | 补充说明
English:
rand -base64command as the primary method, which generates cryptographically secure random passwords/dev/urandomif OpenSSL is not availablejqfor safety but falls back tosedifjqis not installed中文:
rand -base64命令作为主要方法,生成加密安全的随机密码/dev/urandomjq以确保安全,但如果未安装jq则回退到sedBy submitting this PR, I confirm | 提交此 PR,我确认:
🌟 Thank you for your contribution! | 感谢你的贡献!