mirror of
https://github.com/YunoHost-Apps/framaforms_ynh.git
synced 2024-09-03 18:36:12 +02:00
cleaning
This commit is contained in:
parent
a10c6681ec
commit
74c4ed27df
7 changed files with 20 additions and 78 deletions
|
@ -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
|
|
|
@ -15,22 +15,23 @@ website = "https://yakforms.org"
|
||||||
code = "https://framagit.org/yakforms/yakforms"
|
code = "https://framagit.org/yakforms/yakforms"
|
||||||
|
|
||||||
[integration]
|
[integration]
|
||||||
yunohost = ">= 4.3.0"
|
yunohost = ">= 11.2"
|
||||||
architectures = "all"
|
architectures = "all"
|
||||||
multi_instance = true
|
multi_instance = true
|
||||||
|
|
||||||
ldap = true
|
ldap = true
|
||||||
|
|
||||||
sso = false
|
sso = false
|
||||||
|
|
||||||
disk = "500M"
|
disk = "500M"
|
||||||
ram.build = "50M"
|
ram.build = "50M"
|
||||||
ram.runtime = "50M"
|
ram.runtime = "50M"
|
||||||
|
|
||||||
[install]
|
[install]
|
||||||
[install.domain]
|
[install.domain]
|
||||||
# this is a generic question - ask strings are automatically handled by Yunohost's core
|
|
||||||
type = "domain"
|
type = "domain"
|
||||||
|
|
||||||
[install.path]
|
[install.path]
|
||||||
# this is a generic question - ask strings are automatically handled by Yunohost's core
|
|
||||||
type = "path"
|
type = "path"
|
||||||
default = "/poll"
|
default = "/poll"
|
||||||
|
|
||||||
|
@ -48,11 +49,9 @@ ram.runtime = "50M"
|
||||||
default = "en"
|
default = "en"
|
||||||
|
|
||||||
[install.admin]
|
[install.admin]
|
||||||
# this is a generic question - ask strings are automatically handled by Yunohost's core
|
|
||||||
type = "user"
|
type = "user"
|
||||||
|
|
||||||
[install.password]
|
[install.password]
|
||||||
# this is a generic question - ask strings are automatically handled by Yunohost's core
|
|
||||||
type = "password"
|
type = "password"
|
||||||
|
|
||||||
[install.expiration]
|
[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"
|
url = "https://framagit.org/yakforms/yakforms/-/archive/1.0.3/yakforms-1.0.3.tar.gz"
|
||||||
sha256 = "f8a8ac8789c36f07f2d1a03d13f9f6d947e499967b79ea626f7f87271a357703"
|
sha256 = "f8a8ac8789c36f07f2d1a03d13f9f6d947e499967b79ea626f7f87271a357703"
|
||||||
|
|
||||||
|
|
||||||
[resources.system_user]
|
[resources.system_user]
|
||||||
|
|
||||||
[resources.install_dir]
|
[resources.install_dir]
|
||||||
|
|
|
@ -28,7 +28,7 @@ ynh_script_progression --message="Updating Drush alias..." --weight=1
|
||||||
domain="$new_domain"
|
domain="$new_domain"
|
||||||
path="$new_path"
|
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"
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -50,7 +50,7 @@ ynh_script_progression --message="Creating Drush alias..." --weight=2
|
||||||
mkdir -p "$install_dir/.drush"
|
mkdir -p "$install_dir/.drush"
|
||||||
drush_aliasconfig="$install_dir/.drush/$app.aliases.drushrc.php"
|
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"
|
chmod 400 "$drush_aliasconfig"
|
||||||
chown $app:$app "$drush_aliasconfig"
|
chown $app:$app "$drush_aliasconfig"
|
||||||
|
@ -62,7 +62,7 @@ ynh_script_progression --message="Installing Composer..." --weight=31
|
||||||
|
|
||||||
mkdir -p "$install_dir/.composer"
|
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"
|
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"
|
chown -R $app:www-data "$install_dir"
|
||||||
chmod 2775 "$install_dir/app/sites/default/files"
|
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
|
# ADD A CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -162,9 +151,9 @@ update-alternatives --set php /usr/bin/php${YNH_DEFAULT_PHP_VERSION}
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP THE CRON FILE
|
# 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
|
# END OF SCRIPT
|
||||||
|
|
|
@ -17,7 +17,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
|
||||||
|
|
||||||
ynh_restore_file --origin_path="$install_dir"
|
ynh_restore_file --origin_path="$install_dir"
|
||||||
|
|
||||||
chmod 750 "$install_dir"
|
|
||||||
chmod -R o-rwx "$install_dir"
|
chmod -R o-rwx "$install_dir"
|
||||||
chown -R $app:www-data "$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
|
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"
|
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
|
# RESTORE THE PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1
|
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"
|
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"
|
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"
|
ynh_restore_file --origin_path="/etc/cron.d/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -22,8 +22,6 @@ if [ -z "$db_name" ]; then
|
||||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# If data_dir doesn't exist, create it
|
# If data_dir doesn't exist, create it
|
||||||
if [ -z "$data_dir" ]; then
|
if [ -z "$data_dir" ]; then
|
||||||
data_dir=/home/yunohost.app/$app
|
data_dir=/home/yunohost.app/$app
|
||||||
|
@ -34,29 +32,10 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1
|
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1
|
||||||
|
|
||||||
# Create a dedicated PHP-FPM config
|
ynh_add_fpm_config
|
||||||
ynh_add_fpm_config --usage=low --footprint=low
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# NGINX CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
|
|
||||||
|
|
||||||
# Create a dedicated NGINX config
|
|
||||||
ynh_add_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
|
# Framaforms 2 Yakforms Backup
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -92,7 +71,6 @@ then
|
||||||
ynh_setup_source --dest_dir="$install_dir/app"
|
ynh_setup_source --dest_dir="$install_dir/app"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chmod 750 "$install_dir"
|
|
||||||
chmod -R o-rwx "$install_dir"
|
chmod -R o-rwx "$install_dir"
|
||||||
chown -R $app:www-data "$install_dir"
|
chown -R $app:www-data "$install_dir"
|
||||||
|
|
||||||
|
@ -126,6 +104,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPGRADE DRUPAL
|
# UPGRADE DRUPAL
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Upgrading Drupal..." --weight=30
|
ynh_script_progression --message="Upgrading Drupal..." --weight=30
|
||||||
|
|
Loading…
Add table
Reference in a new issue