diff --git a/conf/.env b/conf/.env index 3f4397d..8a55343 100644 --- a/conf/.env +++ b/conf/.env @@ -23,3 +23,5 @@ MAILER_AUTH_USER=__APP__ MAILER_AUTH_PASSWORD=__MAIL_PWD__ MAILER_NOREPLY_NAME=__APP__ MAILER_NOREPLY_EMAIL=reply@__DOMAIN__ + +STORAGE_DRIVER=Type=Filesystem; Path=__DATA_DIR__ diff --git a/manifest.toml b/manifest.toml index 50d5ea3..7456fa2 100644 --- a/manifest.toml +++ b/manifest.toml @@ -55,6 +55,8 @@ ram.runtime = "280M" [resources.install_dir] + [resources.data_dir] + [resources.permissions] main.url = "/" api.url = "/api" diff --git a/scripts/backup b/scripts/backup index 031dabc..15bda74 100755 --- a/scripts/backup +++ b/scripts/backup @@ -21,6 +21,12 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$install_dir" +#================================================= +# BACKUP THE DATA DIR +#================================================= + +ynh_backup --src_path="$data_dir" --is_big + #================================================= # SYSTEM CONFIGURATION #================================================= diff --git a/scripts/install b/scripts/install index aea699d..b13ebad 100755 --- a/scripts/install +++ b/scripts/install @@ -69,9 +69,9 @@ ynh_script_progression --message="Building $app..." --weight=10 pushd $install_dir/packages/server ynh_use_nodejs - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH BUILD_SEQUENCIAL=1 yarn install --inline-builds - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn build - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn cache clean + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production BUILD_SEQUENCIAL=1 yarn install --inline-builds + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production yarn build + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production yarn cache clean ynh_secure_remove .yarn/berry popd diff --git a/scripts/restore b/scripts/restore index c9b4674..49c4964 100755 --- a/scripts/restore +++ b/scripts/restore @@ -19,6 +19,15 @@ ynh_restore_file --origin_path="$install_dir" chown -R $app:www-data "$install_dir" +#================================================= +# RESTORE THE DATA DIRECTORY +#================================================= +ynh_script_progression --message="Restoring the data directory..." --weight=1 + +ynh_restore_file --origin_path="$data_dir" --not_mandatory + +chown -R "$app:www-data" "$data_dir" + #================================================= # RESTORE THE PostgreSQL DATABASE #=================================================