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

Merge pull request #24 from YunoHost-Apps/testing

Testing
This commit is contained in:
Alexandre Aubin 2024-05-01 23:30:52 +02:00 committed by GitHub
commit 0b41b38196
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 17 additions and 49 deletions

View file

@ -1,4 +0,0 @@
# MySQL Database
name: __DB_NAME__
user: __DB_USER__
pass: __DB_PWD__

View file

@ -1,8 +1,12 @@
* Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access.** The password is one you chosen during the installation. Under the Web directory, you will see a `www` folder which contains the public files served by this app. You can put all the files of your custom Web application inside. * Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access.** The password is one you chosen during the installation. Under the Web directory, you will see a `www` folder which contains the public files served by this app. You can put all the files of your custom Web application inside.
* providing files access with [SFTP](https://yunohost.org/en/filezilla). * providing files access with [SFTP](https://yunohost.org/en/filezilla).
* It can also create a MySQL database which will be backed up and restored with your application. The connection details will be stored in the file `db_accesss.txt` located in the root directory.
* MySQL database information:
* name: __DB_NAME__
* user: __DB_USER__
* pass: __DB_PWD__
* SFTP port * SFTP port
You may have change the SSH port as described in this section: You may have change the SSH port as described in this section:
[Modify the SSH port](https://yunohost.org/en/security#modify-the-ssh-port); [Modify the SSH port](https://yunohost.org/en/security#modify-the-ssh-port);
then you should use this port to update your website with SFTP. then you should use this port to update your website with SFTP.

View file

@ -1,6 +1,10 @@
* Une fois installé, allez à l'URL choisie pour connaître l'utilisateur, le domaine et le port que vous devrez utiliser pour l'accès SFTP ** Le mot de passe est celui que vous avez choisi lors de l'installation. Sous le répertoire Web, vous verrez un dossier `www` qui contient les fichiers publics servis par cette application. Vous pouvez y mettre tous les fichiers de votre application Web personnalisée. * Une fois installé, allez à l'URL choisie pour connaître l'utilisateur, le domaine et le port que vous devrez utiliser pour l'accès SFTP ** Le mot de passe est celui que vous avez choisi lors de l'installation. Sous le répertoire Web, vous verrez un dossier `www` qui contient les fichiers publics servis par cette application. Vous pouvez y mettre tous les fichiers de votre application Web personnalisée.
* L'application peut aussi créer une base de données MySQL, permettant l'accès aux fichiers par [SFTP] (https://yunohost.org/en/filezilla). * L'application peut aussi créer une base de données MySQL, permettant l'accès aux fichiers par [SFTP] (https://yunohost.org/en/filezilla).
* Il peut également créer une base de données MySQL qui sera sauvegardée et restaurée avec votre application. Les détails de connexion seront stockés dans le fichier `db_accesss.txt` situé dans le répertoire racine.
* Informations de connexion à la base de données MySQL:
* name: __DB_NAME__
* user: __DB_USER__
* pass: __DB_PWD__
* Port SFTP * Port SFTP
Vous pouvez modifier le port SSH comme décrit dans cette section : Vous pouvez modifier le port SSH comme décrit dans cette section :

View file

@ -58,12 +58,6 @@ ram.runtime = "50M"
type = "boolean" type = "boolean"
default = true default = true
[install.with_mysql]
ask.en = "Do you need a MySQL database?"
ask.fr = "Avez-vous besoin d'une base de données MySQL ?"
type = "boolean"
default = false
[resources] [resources]
[resources.sources.main] [resources.sources.main]
url = "https://tildegit.org/sbgodin/HtmGem/archive/v1.4.1.tar.gz" url = "https://tildegit.org/sbgodin/HtmGem/archive/v1.4.1.tar.gz"
@ -81,13 +75,9 @@ ram.runtime = "50M"
packages = [ packages = [
"php8.2-fpm", "php8.2-fpm",
"php8.2-mbstring", "php8.2-mbstring",
"mariadb-server",
"php8.2-mysql"
] ]
packages_from_raw_bash = """
if [[ "$database" == true ]]; then
echo "mariadb-server, php8.2-mysql"
fi
"""
[resources.database] [resources.database]
# Might not be used, but it's easier to handle it here
type = "mysql" type = "mysql"

View file

@ -44,11 +44,9 @@ ynh_backup --src_path="/etc/gemserv/config.d/$domain.toml"
#================================================= #=================================================
# BACKUP THE MYSQL DATABASE # BACKUP THE MYSQL DATABASE
#================================================= #=================================================
ynh_print_info --message="Backing up the MySQL database..."
if [ "$with_mysql" -eq 1 ]; then ynh_mysql_dump_db --database="$db_name" > db.sql
ynh_print_info --message="Backing up the MySQL database..."
ynh_mysql_dump_db --database="$db_name" > db.sql
fi
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -50,17 +50,6 @@ setfacl -m g:"$app":r-x "$install_dir"
setfacl -m g:"www-data":r-x "$install_dir" setfacl -m g:"www-data":r-x "$install_dir"
setfacl -m g:"gemserv":r-x "$install_dir" setfacl -m g:"gemserv":r-x "$install_dir"
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1
if [ "$with_mysql" -eq 1 ]; then
ynh_add_config --template="db_access.txt" --destination="$install_dir/db_access.txt"
chown "$app:www-data" "$install_dir/db_access.txt"
chmod 440 "$install_dir/db_access.txt"
fi
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#================================================= #=================================================

View file

@ -44,11 +44,9 @@ setfacl -m g:"gemserv":r-x "$install_dir"
#================================================= #=================================================
# RESTORE THE MYSQL DATABASE # RESTORE THE MYSQL DATABASE
#================================================= #=================================================
if [ "$with_mysql" -eq 1 ]; then ynh_script_progression --message="Restoring the MySQL database..." --weight=1
ynh_script_progression --message="Restoring the MySQL database..." --weight=1
ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < ./db.sql ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < ./db.sql
fi
#================================================= #=================================================
# RESTORE SYSTEM CONFIGURATIONS # RESTORE SYSTEM CONFIGURATIONS

View file

@ -45,17 +45,6 @@ setfacl -m g:"$app":r-x "$install_dir"
setfacl -m g:"www-data":r-x "$install_dir" setfacl -m g:"www-data":r-x "$install_dir"
setfacl -m g:"gemserv":r-x "$install_dir" setfacl -m g:"gemserv":r-x "$install_dir"
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1
if [ "$with_mysql" -eq 1 ]; then
ynh_add_config --template="db_access.txt" --destination="$install_dir/db_access.txt"
chown "$app:www-data" "$install_dir/db_access.txt"
chmod 440 "$install_dir/db_access.txt"
fi
#================================================= #=================================================
# REAPPLY SYSTEM CONFIGURATIONS # REAPPLY SYSTEM CONFIGURATIONS
#================================================= #=================================================