1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/framaforms_ynh.git synced 2024-09-03 18:36:12 +02:00
This commit is contained in:
Éric Gaspar 2023-12-19 14:37:33 +01:00
parent a10c6681ec
commit 74c4ed27df
7 changed files with 20 additions and 78 deletions

View file

@ -1,6 +0,0 @@
SOURCE_URL=https://framagit.org/yakforms/yakforms/-/archive/1.0.3/yakforms-1.0.3.tar.gz
SOURCE_SUM=f8a8ac8789c36f07f2d1a03d13f9f6d947e499967b79ea626f7f87271a357703
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=framaforms

View file

@ -15,22 +15,23 @@ website = "https://yakforms.org"
code = "https://framagit.org/yakforms/yakforms"
[integration]
yunohost = ">= 4.3.0"
yunohost = ">= 11.2"
architectures = "all"
multi_instance = true
ldap = true
sso = false
disk = "500M"
ram.build = "50M"
ram.runtime = "50M"
[install]
[install.domain]
# this is a generic question - ask strings are automatically handled by Yunohost's core
type = "domain"
[install.path]
# this is a generic question - ask strings are automatically handled by Yunohost's core
type = "path"
default = "/poll"
@ -48,11 +49,9 @@ ram.runtime = "50M"
default = "en"
[install.admin]
# this is a generic question - ask strings are automatically handled by Yunohost's core
type = "user"
[install.password]
# this is a generic question - ask strings are automatically handled by Yunohost's core
type = "password"
[install.expiration]
@ -76,7 +75,6 @@ ram.runtime = "50M"
url = "https://framagit.org/yakforms/yakforms/-/archive/1.0.3/yakforms-1.0.3.tar.gz"
sha256 = "f8a8ac8789c36f07f2d1a03d13f9f6d947e499967b79ea626f7f87271a357703"
[resources.system_user]
[resources.install_dir]

View file

@ -28,7 +28,7 @@ ynh_script_progression --message="Updating Drush alias..." --weight=1
domain="$new_domain"
path="$new_path"
ynh_add_config --template="../conf/yoursite.aliases.drushrc.php" --destination="$install_dir/.drush/$app.aliases.drushrc.php"
ynh_add_config --template="yoursite.aliases.drushrc.php" --destination="$install_dir/.drush/$app.aliases.drushrc.php"
#=================================================

View file

@ -50,7 +50,7 @@ ynh_script_progression --message="Creating Drush alias..." --weight=2
mkdir -p "$install_dir/.drush"
drush_aliasconfig="$install_dir/.drush/$app.aliases.drushrc.php"
ynh_add_config --template="../conf/yoursite.aliases.drushrc.php" --destination="$drush_aliasconfig"
ynh_add_config --template="yoursite.aliases.drushrc.php" --destination="$drush_aliasconfig"
chmod 400 "$drush_aliasconfig"
chown $app:$app "$drush_aliasconfig"
@ -62,7 +62,7 @@ ynh_script_progression --message="Installing Composer..." --weight=31
mkdir -p "$install_dir/.composer"
ynh_add_config --template="../conf/composer.json" --destination="$install_dir/.composer/composer.json"
ynh_add_config --template="composer.json" --destination="$install_dir/.composer/composer.json"
ynh_install_composer --phpversion="$phpversion" --workdir="$install_dir/.composer"
@ -81,17 +81,6 @@ chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
chmod 2775 "$install_dir/app/sites/default/files"
#=================================================
# CREATE DATA DIRECTORY
#=================================================
ynh_script_progression --message="Creating a data directory..."
mkdir -p $data_dir
chmod 750 "$data_dir"
chmod -R o-rwx "$data_dir"
chown -R $app:www-data "$data_dir"
#=================================================
# ADD A CONFIGURATION
#=================================================
@ -162,9 +151,9 @@ update-alternatives --set php /usr/bin/php${YNH_DEFAULT_PHP_VERSION}
#=================================================
# SETUP THE CRON FILE
#=================================================
ynh_script_progression --message="Setuping the cron file..."
ynh_script_progression --message="Setuping the cron file..." --weight=1
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
ynh_add_config --template="cron" --destination="/etc/cron.d/$app"
#=================================================
# END OF SCRIPT

View file

@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Removing system configurations for $app ..."
ynh_script_progression --message="Removing system configurations for $app..."
ynh_remove_nginx_config

View file

@ -17,7 +17,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
ynh_restore_file --origin_path="$install_dir"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
@ -30,41 +29,24 @@ ynh_script_progression --message="Restoring the data directory..."
ynh_restore_file --origin_path="$data_dir" --not_mandatory
mkdir -p $data_dir
chmod 750 "$data_dir"
chmod -R o-rwx "$data_dir"
chown -R $app:www-data "$data_dir"
#=================================================
# RESTORE THE POSTGRESQL DATABASE
#=================================================
ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1
ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1
# Restore the file first, so it can have a backup if different
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
# Recreate a dedicated php-fpm config
ynh_add_fpm_config --usage=low --footprint=low
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RESTORE THE POSTGRESQL DATABASE
#=================================================
ynh_psql_execute_file_as_root --database=$db_name --file="./db.sql"
#=================================================
# RESTORE VARIOUS FILES
#=================================================
ynh_script_progression --message="Restoring various files..." --weight=1
ynh_restore_file --origin_path="/etc/cron.d/$app"
#=================================================

View file

@ -22,8 +22,6 @@ if [ -z "$db_name" ]; then
db_name=$(ynh_sanitize_dbid --db_name=$app)
fi
# If data_dir doesn't exist, create it
if [ -z "$data_dir" ]; then
data_dir=/home/yunohost.app/$app
@ -34,29 +32,10 @@ fi
#=================================================
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1
# Create a dedicated PHP-FPM config
ynh_add_fpm_config --usage=low --footprint=low
ynh_add_fpm_config
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# SPECIFIC UPGRADE
#=================================================
# CREATE DATA DIRECTORY
#=================================================
ynh_script_progression --message="Creating a data directory..."
mkdir -p $data_dir
chmod 750 "$data_dir"
chmod -R o-rwx "$data_dir"
chown -R $app:www-data "$data_dir"
#=================================================
# Framaforms 2 Yakforms Backup
#=================================================
@ -92,7 +71,6 @@ then
ynh_setup_source --dest_dir="$install_dir/app"
fi
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
@ -126,6 +104,7 @@ fi
#=================================================
# UPGRADE DRUPAL
#=================================================
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading Drupal..." --weight=30