- Updated the permission settings for the environment file to 640, ensuring it is readable only by the owner and the deploy group.
- Modified the sequelize configuration to safely handle missing environment variables, converting them to strings or setting them to undefined to prevent runtime errors.
[force-deploy]
- Moved permission setting commands to the end of the script for better clarity and execution flow.
- Changed the log message from "Running database synchronization..." to "Running database migrations..." to accurately reflect the operation being performed.
- Ensured that permission settings for backend and data directories are consistently applied after the migration process.
[force-deploy]
- Updated the npm install command to remove the production flag, allowing for the installation of all dependencies.
- Added a step to prune development dependencies after running database migrations, optimizing the deployment environment.
- Introduced a new npm script for database migrations in package.json.
- Updated update-backend.sh to execute migrations and conditionally run legacy sync-db based on environment variable.
- Enhanced syncDatabase.js to skip initialization routines if APP_INIT_ON_START is not set, promoting best practices for schema changes during deployment.
- Eliminated the removal of the temporary environment directory in the update-backend.sh script to retain the environment for potential debugging or further use.
- Replaced the previous method of copying .env files with a direct installation from a specified source path.
- Improved permissions and ownership settings for the .env file to enhance security.
- Added user feedback for successful file transfer and verification steps.
- Implemented functionality to copy the .env file from the live system to the backend directory if it exists.
- Added ownership change for the copied .env file to ensure proper permissions.
- Included user feedback for successful or failed .env file transfer.
- Added new admin functionalities to force pregnancy, clear pregnancy, and trigger birth for characters.
- Introduced corresponding routes and controller methods in adminRouter and adminController.
- Enhanced the FalukantCharacter model to include pregnancy-related fields.
- Created database migration for adding pregnancy columns to the character table.
- Updated frontend views and internationalization files to support new pregnancy and birth management features.
- Improved user feedback and error handling for these new actions.
- Updated update-backend.sh and update-frontend.sh to accept a target directory as a parameter, improving flexibility.
- Refactored paths to use the target directory for all operations, ensuring consistency and reducing hardcoded values.
- Added error handling with 'set -euo pipefail' for better script reliability.
- Improved user feedback by displaying the target directory during updates.
- Enhanced deploy-backend.sh and update-backend.sh to create the adult verification directory under /opt/yourpart-data.
- Updated permissions for the new directory to ensure proper access control.
- Refactored file path handling in AdminService and SettingsService to utilize the new directory structure for adult verification files.
- Updated the script to securely back up .env files before deleting the old backend, ensuring no loss of environment configurations.
- Enhanced the restoration process of .env files with clearer logging for success and warnings when no files are found.
- Simplified the logic for copying the new backend while excluding .env files, improving clarity and maintainability of the script.