1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hubzilla_ynh.git synced 2024-09-03 19:26:21 +02:00

Merge pull request #172 from YunoHost-Apps/testing

Testing
This commit is contained in:
eric_G 2024-04-09 19:42:36 +02:00 committed by GitHub
commit 139290e07e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 81 additions and 107 deletions

View file

@ -1,6 +1,6 @@
# All available README files by language # All available README files by language
- [Read the README in English](README.md) - [Read the README in English](README.md)
- [Irakurri README euskaraz](README_eu.md)
- [Lire le README en français](README_fr.md) - [Lire le README en français](README_fr.md)
- [Le o README en galego](README_gl.md) - [Le o README en galego](README_gl.md)
- [Leggi il “README” in italiano](README_it.md)

View file

@ -9,7 +9,7 @@ It shall NOT be edited by hand.
[![Install Hubzilla with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hubzilla) [![Install Hubzilla with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hubzilla)
*[Read this README is other languages.](./ALL_README.md)* *[Read this README in other languages.](./ALL_README.md)*
> *This package allows you to install Hubzilla quickly and simply on a YunoHost server.* > *This package allows you to install Hubzilla quickly and simply on a YunoHost server.*
> *If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.* > *If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.*
@ -19,7 +19,7 @@ It shall NOT be edited by hand.
Hubzilla is a social networking platform built with control of your privacy at center stage. Your online communications can be as public as you wish or as private as you require. Private conversations, private photos, private videos. Your media isn't hidden behind an obscure URL which can be guessed, it is protected by state-of-the-art cross-domain authentication. Hubzilla is a social networking platform built with control of your privacy at center stage. Your online communications can be as public as you wish or as private as you require. Private conversations, private photos, private videos. Your media isn't hidden behind an obscure URL which can be guessed, it is protected by state-of-the-art cross-domain authentication.
**Shipped version:** 8.8.6~ynh1 **Shipped version:** 9.0.1~ynh1
## Screenshots ## Screenshots

47
README_eu.md Normal file
View file

@ -0,0 +1,47 @@
<!--
Ohart ongi: README hau automatikoki sortu da <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>ri esker
EZ editatu eskuz.
-->
# Hubzilla YunoHost-erako
[![Integrazio maila](https://dash.yunohost.org/integration/hubzilla.svg)](https://dash.yunohost.org/appci/app/hubzilla) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/hubzilla.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/hubzilla.maintain.svg)
[![Instalatu Hubzilla YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hubzilla)
*[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)*
> *Pakete honek Hubzilla YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.*
> *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.*
## Aurreikuspena
Hubzilla is a social networking platform built with control of your privacy at center stage. Your online communications can be as public as you wish or as private as you require. Private conversations, private photos, private videos. Your media isn't hidden behind an obscure URL which can be guessed, it is protected by state-of-the-art cross-domain authentication.
**Paketatutako bertsioa:** 9.0.1~ynh1
## Pantaila-argazkiak
![Hubzilla(r)en pantaila-argazkia](./doc/screenshots/hubzilla-1.png)
## Dokumentazioa eta baliabideak
- Aplikazioaren webgune ofiziala: <https://hubzilla.org>
- Jatorrizko aplikazioaren kode-gordailua: <https://framagit.org/hubzilla/core>
- YunoHost Denda: <https://apps.yunohost.org/app/hubzilla>
- Eman errore baten berri: <https://github.com/YunoHost-Apps/hubzilla_ynh/issues>
## Garatzaileentzako informazioa
Bidali `pull request`a [`testing` abarrera](https://github.com/YunoHost-Apps/hubzilla_ynh/tree/testing).
`testing` abarra probatzeko, ondorengoa egin:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/hubzilla_ynh/tree/testing --debug
edo
sudo yunohost app upgrade hubzilla -u https://github.com/YunoHost-Apps/hubzilla_ynh/tree/testing --debug
```
**Informazio gehiago aplikazioaren paketatzeari buruz:** <https://yunohost.org/packaging_apps>

View file

@ -19,7 +19,7 @@ Il NE doit PAS être modifié à la main.
Hubzilla est une plate-forme de réseau social conçue avec le contrôle de votre vie privée au centre de la scène. Vos communications en ligne peuvent être aussi publiques que vous le souhaitez ou aussi privées que vous le souhaitez. Conversations privées, photos privées, vidéos privées. Votre média n'est pas caché derrière une URL obscure qui peut être devinée, il est protégé par une authentification interdomaine de pointe. Hubzilla est une plate-forme de réseau social conçue avec le contrôle de votre vie privée au centre de la scène. Vos communications en ligne peuvent être aussi publiques que vous le souhaitez ou aussi privées que vous le souhaitez. Conversations privées, photos privées, vidéos privées. Votre média n'est pas caché derrière une URL obscure qui peut être devinée, il est protégé par une authentification interdomaine de pointe.
**Version incluse:** 8.8.6~ynh1 **Version incluse:** 9.0.1~ynh1
## Captures décran ## Captures décran

View file

@ -19,7 +19,7 @@ NON debe editarse manualmente.
Hubzilla is a social networking platform built with control of your privacy at center stage. Your online communications can be as public as you wish or as private as you require. Private conversations, private photos, private videos. Your media isn't hidden behind an obscure URL which can be guessed, it is protected by state-of-the-art cross-domain authentication. Hubzilla is a social networking platform built with control of your privacy at center stage. Your online communications can be as public as you wish or as private as you require. Private conversations, private photos, private videos. Your media isn't hidden behind an obscure URL which can be guessed, it is protected by state-of-the-art cross-domain authentication.
**Versión proporcionada:** 8.8.6~ynh1 **Versión proporcionada:** 9.0.1~ynh1
## Capturas de pantalla ## Capturas de pantalla

View file

@ -17,7 +17,7 @@ $db_port = 0; // leave 0 for default or set your port
$db_user = '__DB_USER__'; $db_user = '__DB_USER__';
$db_pass = '__DB_PWD__'; $db_pass = '__DB_PWD__';
$db_data = '__DB_NAME__'; $db_data = '__DB_NAME__';
$db_type = __DB_TYPE__; // use 1 for postgres, 0 for mysql $db_type = 1; // use 1 for postgres, 0 for mysql
/* /*
* Notice: Many of the following settings will be available in the admin panel * Notice: Many of the following settings will be available in the admin panel

View file

@ -5,7 +5,7 @@ name = "Hubzilla"
description.en = "Decentralized publication platform and social network" description.en = "Decentralized publication platform and social network"
description.fr = "Plateforme de publication décentralisée et un réseau social" description.fr = "Plateforme de publication décentralisée et un réseau social"
version = "8.8.6~ynh1" version = "9.0.1~ynh1"
maintainers = [""] maintainers = [""]
@ -38,23 +38,16 @@ ram.runtime = "50M"
[install.admin] [install.admin]
type = "user" type = "user"
[install.database]
ask.en = "Choose Hubzilla database"
ask.fr = "Choisissez la database de Hubzilla"
type = "select"
choices = ["mysql", "postgresql"]
default = "mysql"
[resources] [resources]
[resources.sources] [resources.sources]
[resources.sources.main] [resources.sources.main]
url = "https://framagit.org/hubzilla/core/-/archive/8.8.6/core-8.8.6.tar.gz" url = "https://framagit.org/hubzilla/core/-/archive/9.0.1/core-9.0.1.tar.bz2"
sha256 = "02482d6a1a1a0e90c977afa6336309e282f8cb9a4c271a358f8e442af6adfcb3" sha256 = "e0d3ef4f942058bf6a0784bac70b0a072e95275514953ba5984e4b1be25a2974"
autoupdate.strategy = "latest_gitlab_release" autoupdate.strategy = "latest_gitlab_release"
[resources.sources.addons] [resources.sources.addons]
url = "https://framagit.org/hubzilla/addons/-/archive/8.8.6/addons-8.8.6.tar.gz" url = "https://framagit.org/hubzilla/addons/-/archive/9.0.1/addons-9.0.1.tar.bz2"
sha256 = "b559cd6a5d18a1ce038d948a1fd76e1e85580c30a6350a01e942b1271118552a" sha256 = "095770188e637ac4faf38fdca8dca786acf59e0bc1a3f7c09f0d5320dbff1a9f"
autoupdate.strategy = "latest_gitlab_tag" autoupdate.strategy = "latest_gitlab_tag"
autoupdate.upstream = "https://framagit.org/hubzilla/addons" autoupdate.upstream = "https://framagit.org/hubzilla/addons"
@ -66,12 +59,7 @@ ram.runtime = "50M"
main.url = "/" main.url = "/"
[resources.apt] [resources.apt]
packages = "php8.2-curl, php8.2-gd, php8.2-mysql, php8.2-pgsql, php8.2-mbstring, php8.2-xml, php8.2-zip, php8.2-cli, php8.2-imagick, php8.2-gmp" packages = "postgresql, php8.2-curl, php8.2-gd, php8.2-pgsql, php8.2-mbstring, php8.2-xml, php8.2-zip, php8.2-cli, php8.2-imagick, php8.2-gmp, php8.2-intl"
packages_from_raw_bash = """ [resources.database]
if [[ "$database" == "mysql" ]]; then type = "postgresql"
echo "mariadb-server"
elif [[ "$database" == "postgresql" ]]; then
echo "postgresql postgresql-contrib"
fi
"""

View file

@ -5,11 +5,19 @@
#================================================= #=================================================
# PHP APP SPECIFIC # PHP APP SPECIFIC
#================================================= #=================================================
YNH_PHP_VERSION="8.2"
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS
#================================================= #=================================================
mysql_remove() {
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
}
mysql_restore() {
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
}
#================================================= #=================================================
# EXPERIMENTAL HELPERS # EXPERIMENTAL HELPERS
#================================================= #=================================================

View file

@ -58,11 +58,11 @@ ynh_backup --src_path="/etc/cron.d/$app"
# BACKUP THE DATABASE # BACKUP THE DATABASE
#================================================= #=================================================
if [ $database = "mysql" ]; then if mysqlshow | grep -q "^| $db_name "; then
# Backup MySQL database # Backup MySQL database
ynh_print_info --message="Backup of the MySQL database..." ynh_print_info --message="Backup of the MySQL database..."
ynh_mysql_dump_db --database="$db_name" > db.sql ynh_mysql_dump_db --database="$db_name" > mydb.sql
elif [ $database = "postgresql" ]; then else
# Backup PostgreSQL database # Backup PostgreSQL database
ynh_print_info --message="Backup of the PostgreSQL database..." ynh_print_info --message="Backup of the PostgreSQL database..."
ynh_psql_dump_db --database="$db_name" > db.sql ynh_psql_dump_db --database="$db_name" > db.sql

View file

@ -15,7 +15,7 @@ ynh_abort_if_errors
# RETRIEVE ARGUMENTS # RETRIEVE ARGUMENTS
#================================================= #=================================================
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) phpversion="$YNH_PHP_VERSION"
current_fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) current_fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint)
#================================================= #=================================================

View file

@ -25,7 +25,6 @@ fpm_usage="low"
#================================================= #=================================================
ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_script_progression --message="Storing installation settings..." --weight=1
ynh_app_setting_set --app=$app --key=database --value=$database
ynh_app_setting_set --app=$app --key=email --value=$email ynh_app_setting_set --app=$app --key=email --value=$email
ynh_app_setting_set --app=$app --key=upload --value=$upload ynh_app_setting_set --app=$app --key=upload --value=$upload
ynh_app_setting_set --app=$app --key=random_string --value=$random_string ynh_app_setting_set --app=$app --key=random_string --value=$random_string
@ -33,29 +32,6 @@ ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
#=================================================
# CREATE A DATABASE
#=================================================
ynh_script_progression --message="Creating a database..." --weight=2
db_name=$(ynh_sanitize_dbid --db_name=$app)
db_user=$db_name
db_pwd=$(ynh_string_random --length=30)
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
ynh_app_setting_set --app=$app --key=db_user --value=$db_user
ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd
if [ $database == "mysql" ]; then
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name
ynh_mysql_connect_as --user=$db_user --password="$db_pwd" --database=$db_name \
<<< "ALTER DATABASE $db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;"
db_type=0
elif [ $database == "postgresql" ]; then
ynh_psql_test_if_first_run
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name
db_type=1
fi
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
@ -101,11 +77,7 @@ chmod 644 "/etc/cron.d/$app"
#================================================= #=================================================
ynh_script_progression --message="Provisionning database..." --weight=1 ynh_script_progression --message="Provisionning database..." --weight=1
if [ $database = "mysql" ]; then ynh_psql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" < $install_dir/install/schema_postgres.sql
ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" < $install_dir/install/schema_mysql.sql
elif [ $database = "postgresql" ]; then
ynh_psql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" < $install_dir/install/schema_postgres.sql
fi
#================================================= #=================================================
# ADD A CONFIGURATION # ADD A CONFIGURATION

View file

@ -12,13 +12,9 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# REMOVE THE DATABASE # REMOVE THE DATABASE
#================================================= #=================================================
if mysqlshow | grep -q "^| $db_name "; then
if [ $database = "mysql" ]; then
ynh_script_progression --message="Removing MySQL database..." --weight=1 ynh_script_progression --message="Removing MySQL database..." --weight=1
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name mysql_remove
elif [ $database = "postgresql" ]; then
ynh_script_progression --message="Removing PostgreSQL database..." --weight=1
ynh_psql_remove_db --db_user=$db_user --db_name=$db_name
fi fi
#================================================= #=================================================

View file

@ -23,16 +23,11 @@ chown -R $app:www-data "$install_dir"
# RESTORE THE DATABASE # RESTORE THE DATABASE
#================================================= #=================================================
if [ $database = "mysql" ]; then if [ -f mydb.sql ]; then
ynh_script_progression --message="Restoring MySQL database..." --weight=1 ynh_script_progression --message="Restoring MySQL database..." --weight=1
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./mydb.sql
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd else
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
elif [ $database = "postgresql" ]; then
ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1 ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
ynh_psql_test_if_first_run
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name" ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name"
fi fi

View file

@ -53,15 +53,6 @@ if [ -z "${fpm_usage:-}" ]; then
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
fi fi
# Switch $database to "mysql" or "postgresql"
if [[ $database == "1" ]] 2>/dev/null; then
database="mysql"
ynh_app_setting_set --app=$app --key=database --value=$database
elif [[ $database == "2" ]] 2>/dev/null; then
database="postgresql"
ynh_app_setting_set --app=$app --key=database --value=$database
fi
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
@ -97,29 +88,6 @@ ynh_add_nginx_config
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
#================================================= #=================================================
# UPDATE A CONFIG FILE # UPDATE A CONFIG FILE
#=================================================
# ynh_script_progression --message="Updating a configuration file..." --weight=1
# if [ $database = "mysql" ]; then
# db_type=0
# db_name=$(ynh_sanitize_dbid --db_name=$app)
# db_user=$db_name
# db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
# # Change your databases character set and collation
# ynh_mysql_connect_as --user=$db_user --password="$db_pwd" --database=$db_name \
# <<< "ALTER DATABASE $db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;"
# elif [ $database = "postgresql" ]; then
# db_type=1
# db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
# fi
# ynh_add_config --template="../conf/htconfig.sample.php" --destination="$install_dir/.htconfig.php"
# ynh_store_file_checksum --file=$install_dir/.htconfig.php
# chmod 600 "$install_dir/.htconfig.php"
# chown $app:$app "$install_dir/.htconfig.php"
#================================================= #=================================================
# UPGRADE CRON JOB # UPGRADE CRON JOB
#================================================= #=================================================

View file

@ -19,7 +19,7 @@ test_format = 1.0
# Commits to test upgrade from # Commits to test upgrade from
# ------------------------------- # -------------------------------
test_upgrade_from.3e89436957f5a6f9b426836d671ffbb133d7db62.name = "Upgrade from 8.6.3~ynh1" test_upgrade_from.702a58b0a02bd1aba620222eb2c111067506e3fa.name = "Upgrade from 8.6.6~ynh1"
[with_postgresql] [with_postgresql]