From 7c13cfbe107f8c41fbdba6995b2e1170cd003684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 1 Mar 2023 15:06:53 +0100 Subject: [PATCH] v2 --- conf/{php-fpm.conf => extra_php-fpm.conf} | 0 conf/nginx.conf | 2 +- doc/{DISCLAIMER.md => ADMIN.md} | 4 - doc/POST_INSTALL.md | 1 + manifest.toml | 22 ++--- scripts/install | 110 +--------------------- tests.toml | 0 7 files changed, 17 insertions(+), 122 deletions(-) rename conf/{php-fpm.conf => extra_php-fpm.conf} (100%) rename doc/{DISCLAIMER.md => ADMIN.md} (83%) create mode 100644 doc/POST_INSTALL.md create mode 100644 tests.toml diff --git a/conf/php-fpm.conf b/conf/extra_php-fpm.conf similarity index 100% rename from conf/php-fpm.conf rename to conf/extra_php-fpm.conf diff --git a/conf/nginx.conf b/conf/nginx.conf index 9a96ccd..c5d0284 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -7,7 +7,7 @@ location __PATH__/ { index index.php; # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file - #client_max_body_size 50M; + client_max_body_size 50M; try_files $uri $uri/ index.php; location ~ [^/]\.php(/|$) { diff --git a/doc/DISCLAIMER.md b/doc/ADMIN.md similarity index 83% rename from doc/DISCLAIMER.md rename to doc/ADMIN.md index a3b2d3a..4794cdc 100644 --- a/doc/DISCLAIMER.md +++ b/doc/ADMIN.md @@ -1,7 +1,3 @@ -### Postinstall - -You can log in using the special `admin` username and the `admin` password. You will be asked to change the password immediately after login. - ### Storing your uploaded files To ease the install process and first access, Tiki saves your uploaded files (office documents, images, pdf, etc. attached to wiki pages, forum posts, tracker items, file galleries, ...) by default in its database. This works perfectly in most cases but it is not the recommended setup if you need to save many thousands of files or more. diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md new file mode 100644 index 0000000..ed921ea --- /dev/null +++ b/doc/POST_INSTALL.md @@ -0,0 +1 @@ +You can log in using the special `admin` username and the `admin` password. You will be asked to change the password immediately after login. diff --git a/manifest.toml b/manifest.toml index 83c7c1a..f0d37a9 100644 --- a/manifest.toml +++ b/manifest.toml @@ -15,26 +15,21 @@ website = "https://tiki.org/" demo = "https://tiki.org/Try-Tiki" admindoc = "https://doc.tiki.org" code = "https://gitlab.com/tikiwiki/tiki/" -cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) -fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. [integration] -yunohost = ">= 11.0.9" -architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +yunohost = ">= 11.1.12" +architectures = "all" multi_instance = true -ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. -sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. -disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... -ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... -ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... - +ldap = "?" +sso = "?" +disk = "50M" +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 = "/tiki" @@ -52,5 +47,8 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen [resources.permissions] main.url = "/" + [resources.apt] + packages = "php7.4-bz2 php7.4-curl php7.4-gd php7.4-zip php7.4-mysql php7.4-xml php7.4-mbstring" + [resources.database] type = "mysql" diff --git a/scripts/install b/scripts/install index 6846b4d..38d8a60 100755 --- a/scripts/install +++ b/scripts/install @@ -9,82 +9,14 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST -#================================================= - -#REMOVEME? domain=$YNH_APP_ARG_DOMAIN -#REMOVEME? path=$YNH_APP_ARG_PATH -#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC -phpversion=$YNH_PHP_VERSION - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 - -#REMOVEME? install_dir=/var/www/$app -#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" - -# Register (book) web path -#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path - -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= -#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=1 - -#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain -#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path - -#================================================= -# INSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=1 - -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=1 - -# Create a system user -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - -#================================================= -# CREATE A MYSQL DATABASE -#================================================= -#REMOVEME? ynh_script_progression --message="Creating a MySQL database..." --weight=3 - -#REMOVEME? db_name=$(ynh_sanitize_dbid --db_name=$app) -#REMOVEME? db_user=$db_name -#REMOVEME? ynh_app_setting_set --app=$app --key=db_name --value=$db_name -#REMOVEME? ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=15 -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -104,20 +36,6 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config -#================================================= -# CREATE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Creating a data directory..." --weight=1 - -#REMOVEME? data_dir=/home/yunohost.app/$app -#REMOVEME? ynh_app_setting_set --app=$app --key=data_dir --value=$data_dir - -mkdir -p $data_dir - -chmod 750 "$data_dir" -chmod -R o-rwx "$data_dir" -chown -R $app:www-data "$data_dir" - #================================================= # ADD INITIAL CONFIGURATION #================================================= @@ -128,39 +46,21 @@ exec_as_app() { php${phpversion} --define apc.enable_cli=1 "$@") } -ynh_script_progression --message="Create database configuration file..." --time --weight=1 +ynh_script_progression --message="Create database configuration file..." --weight=1 exec_as_app console.php database:configure "$app" "$db_pwd" "$app" -ynh_script_progression --message="Create database contents..." --time --weight=1 +ynh_script_progression --message="Create database contents..." --weight=1 exec_as_app console.php database:install -ynh_script_progression --message="Lock installer..." --time --weight=1 +ynh_script_progression --message="Lock installer..." --weight=1 exec_as_app console.php installer:lock -ynh_script_progression --message="Create data index..." --time --weight=1 +ynh_script_progression --message="Create data index..." --weight=1 exec_as_app console.php index:rebuild -ynh_script_progression --message="Set on Long Term Support versions..." --time --weight=1 +ynh_script_progression --message="Set on Long Term Support versions..." --weight=1 exec_as_app console.php preferences:set tiki_release_cycle longterm -#================================================= -# SETUP SSOWAT -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1 - -# Make app public if necessary -#REMOVEME? if [ $is_public -eq 1 ] -then -#REMOVEME? ynh_permission_update --permission="main" --add="visitors" -fi - -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..e69de29