mirror of
https://github.com/YunoHost-Apps/pagure_ynh.git
synced 2024-09-03 19:56:19 +02:00
Fix
This commit is contained in:
parent
470f88b5aa
commit
b79b4f5f24
9 changed files with 66 additions and 26 deletions
|
@ -2,8 +2,8 @@
|
|||
; Manifest
|
||||
domain="domain.tld"
|
||||
path="/path"
|
||||
admin="john"
|
||||
is_public=1
|
||||
admin="john"
|
||||
; Checks
|
||||
pkg_linter=1
|
||||
setup_sub_dir=1
|
||||
|
@ -18,5 +18,5 @@
|
|||
port_already_use=0
|
||||
change_url=1
|
||||
;;; Options
|
||||
Email=jean-baptiste@holcroft.fr
|
||||
Notification=all
|
||||
Email=
|
||||
Notification=none
|
||||
|
|
|
@ -75,24 +75,12 @@ GIT_URL_SSH = 'ssh://git@__DOMAIN____PATH__'
|
|||
GIT_URL_GIT = 'git://__DOMAIN____PATH__'
|
||||
|
||||
### Folder containing to the git repos
|
||||
GIT_FOLDER = os.path.join(
|
||||
os.path.abspath(os.path.dirname(__file__)),
|
||||
'..',
|
||||
'repos'
|
||||
)
|
||||
GIT_FOLDER = '__DATADIR__/repos'
|
||||
|
||||
REPOSPANNER_PSEUDO_FOLDER = os.path.join(
|
||||
os.path.abspath(os.path.dirname(__file__)),
|
||||
'..',
|
||||
'pseudo'
|
||||
)
|
||||
REPOSPANNER_PSEUDO_FOLDER = '__DATADIR__/pseudo'
|
||||
|
||||
### Folder containing the clones for the remote pull-requests
|
||||
REMOTE_GIT_FOLDER = os.path.join(
|
||||
os.path.abspath(os.path.dirname(__file__)),
|
||||
'..',
|
||||
'remotes'
|
||||
)
|
||||
REMOTE_GIT_FOLDER = '__DATADIR__/remotes'
|
||||
|
||||
### Whether to enable scanning for viruses in attachments
|
||||
VIRUS_SCAN_ATTACHMENTS = False
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"description": {
|
||||
"en": "A git-centered forge, python based using pygit2."
|
||||
},
|
||||
"version": "5.13.3~ynh1",
|
||||
"version": "5.13.3~ynh2",
|
||||
"url": "https://pagure.io/pagure",
|
||||
"upstream": {
|
||||
"license": "AGPL-3.0",
|
||||
|
@ -38,14 +38,14 @@
|
|||
"example": "/pagure",
|
||||
"default": "/pagure"
|
||||
},
|
||||
{
|
||||
"name": "admin",
|
||||
"type": "user"
|
||||
},
|
||||
{
|
||||
"name": "is_public",
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"name": "admin",
|
||||
"type": "user"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
||||
|
||||
#=================================================
|
||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||
|
@ -42,6 +43,12 @@ ynh_print_info --message="Declaring files to be backed up..."
|
|||
|
||||
ynh_backup --src_path="$final_path"
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE DATA DIR
|
||||
#=================================================
|
||||
|
||||
ynh_backup --src_path="$datadir" --is_big
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
|
|
@ -39,6 +39,7 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
|||
redis_db=$(ynh_app_setting_get --app=$app --key=redis_db)
|
||||
secret_key=$(ynh_app_setting_get --app=$app --key=secret_key)
|
||||
salt_email=$(ynh_app_setting_get --app=$app --key=salt_email)
|
||||
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
|
||||
|
|
|
@ -27,8 +27,8 @@ ynh_abort_if_errors
|
|||
|
||||
domain=$YNH_APP_ARG_DOMAIN
|
||||
path_url=$YNH_APP_ARG_PATH
|
||||
admin=$YNH_APP_ARG_ADMIN
|
||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||
admin=$YNH_APP_ARG_ADMIN
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
|
@ -110,6 +110,21 @@ ynh_add_nginx_config
|
|||
|
||||
#=================================================
|
||||
# SPECIFIC SETUP
|
||||
#=================================================
|
||||
# CREATE DATA DIRECTORY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Creating a data directory..."
|
||||
|
||||
datadir=/home/yunohost.app/$app
|
||||
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
|
||||
|
||||
mkdir -p $datadir
|
||||
mkdir -p "${datadir}"/{repos,remotes,attachments,releases}
|
||||
|
||||
chmod 750 "$datadir"
|
||||
chmod -R o-rwx "$datadir"
|
||||
chown -R $app:www-data "$datadir"
|
||||
|
||||
#=================================================
|
||||
# ADD A CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -157,8 +172,9 @@ pushd "$final_path"
|
|||
pip install psycopg2
|
||||
pip install pyyaml
|
||||
pip install pygit2
|
||||
pip install "jinja2<3.1.0"
|
||||
pip install -r requirements.txt
|
||||
mkdir -p "${final_path}"/lcl/{repos,remotes,attachments,releases}
|
||||
read -p "ppp"
|
||||
ynh_add_config --template="../conf/alembic.ini" --destination="$final_path/alembic.ini"
|
||||
PAGURE_CONFIG=${final_path}/pagure.cfg python createdb.py --initial alembic.ini 2>&1
|
||||
popd
|
||||
|
|
|
@ -22,6 +22,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
|
|||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
db_user=$db_name
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
||||
redis_db=$(ynh_app_setting_get --app=$app --key=redis_db)
|
||||
|
||||
#=================================================
|
||||
|
@ -135,6 +136,17 @@ ynh_script_progression --message="Removing app main directory..."
|
|||
# Remove the app directory securely
|
||||
ynh_secure_remove --file="$final_path"
|
||||
|
||||
#=================================================
|
||||
# REMOVE DATA DIR
|
||||
#=================================================
|
||||
|
||||
# Remove the data directory if --purge option is used
|
||||
if [ "${YNH_APP_PURGE:-0}" -eq 1 ]
|
||||
then
|
||||
ynh_script_progression --message="Removing app data directory..."
|
||||
ynh_secure_remove --file="$datadir"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# REMOVE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
|
|
@ -34,6 +34,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
|
|||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
db_user=$db_name
|
||||
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
||||
|
||||
#=================================================
|
||||
# CHECK IF THE APP CAN BE RESTORED
|
||||
|
@ -71,6 +72,20 @@ chmod 750 "$final_path"
|
|||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE DATA DIRECTORY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the data directory..."
|
||||
|
||||
ynh_restore_file --origin_path="$datadir" --not_mandatory
|
||||
|
||||
mkdir -p $datadir
|
||||
mkdir -p "${datadir}"/{repos,remotes,attachments,releases}
|
||||
|
||||
chmod 750 "$datadir"
|
||||
chmod -R o-rwx "$datadir"
|
||||
chown -R $app:www-data "$datadir"
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC RESTORATION
|
||||
#=================================================
|
||||
|
|
|
@ -25,6 +25,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
db_user=$db_name
|
||||
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
||||
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
||||
redis_db=$(ynh_app_setting_get --app=$app --key=redis_db)
|
||||
secret_key=$(ynh_app_setting_get --app=$app --key=secret_key)
|
||||
salt_email=$(ynh_app_setting_get --app=$app --key=salt_email)
|
||||
|
@ -168,8 +169,8 @@ pushd "$final_path"
|
|||
pip install psycopg2
|
||||
pip install pyyaml
|
||||
pip install pygit2
|
||||
pip install "jinja2<3.1.0"
|
||||
pip install -r requirements.txt
|
||||
mkdir -p "${final_path}"/lcl/{repos,remotes,attachments,releases}
|
||||
ynh_add_config --template="../conf/alembic.ini" --destination="$final_path/alembic.ini"
|
||||
PAGURE_CONFIG=${final_path}/pagure.cfg alembic upgrade head 2>&1
|
||||
popd
|
||||
|
|
Loading…
Reference in a new issue