From f058033ef8c80aeb6fae386a91a26e1d271d81ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 13 Jun 2024 12:57:40 +0200 Subject: [PATCH 1/6] fix --- conf/local.config.php | 47 +++++++++++++++++++++++++++++++++++++++++++ manifest.toml | 6 ++++++ scripts/install | 1 + scripts/upgrade | 3 ++- 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 conf/local.config.php diff --git a/conf/local.config.php b/conf/local.config.php new file mode 100644 index 0000000..5dbd44f --- /dev/null +++ b/conf/local.config.php @@ -0,0 +1,47 @@ + [ + 'log' => false, + 'priority' => \Laminas\Log\Logger::NOTICE, + ], + 'http_client' => [ + 'sslcapath' => null, + 'sslcafile' => null, + ], + 'cli' => [ + 'phpcli_path' => null, + ], + 'thumbnails' => [ + 'types' => [ + 'large' => ['constraint' => 800], + 'medium' => ['constraint' => 200], + 'square' => ['constraint' => 200], + ], + 'thumbnailer_options' => [ + 'imagemagick_dir' => null, + ], + ], + 'translator' => [ + 'locale' => 'en_US', + ], + 'service_manager' => [ + 'aliases' => [ + 'Omeka\File\Store' => 'Omeka\File\Store\Local', + 'Omeka\File\Thumbnailer' => 'Omeka\File\Thumbnailer\ImageMagick', + ], + ], + 'ldap' => [ + 'adapter_options' => [ + 'server1' => [ + 'host' => 'localhost', + 'username' => 'ou=users,dc=yunohost,dc=org', + 'password' => null, + 'bindRequiresDn' => true, + 'baseDn' => 'ou=users,dc=yunohost,dc=org', + 'accountFilterFormat' => "(&(|(objectclass=posixAccount))(uid={{username}})(permission=cn=__APP__.main,ou=permission,dc=yunohost,dc=org))", + 'accountCanonicalForm' => 4, + 'accountDomainName' => 'example.com', + ], + ], + ], +]; diff --git a/manifest.toml b/manifest.toml index a6919ef..7254442 100644 --- a/manifest.toml +++ b/manifest.toml @@ -58,6 +58,12 @@ ram.runtime = "50M" sha256 = "95aa91802ef497f6fb33e7bf1d129b041dc11ce1dc2eca4a6790a29becd592ad" autoupdate.strategy = "latest_github_tag" + [resources.sources.ldap] + in_subdir = false + url = "https://github.com/biblibre/omeka-s-module-Ldap/releases/download/v0.5.0/Ldap-0.5.0.zip" + sha256 = "5f0e36c7438f045cec3b7427fd8ebb5f8722b26043cc2028d9577400862becd9" + autoupdate.strategy = "latest_github_tag" + [resources.system_user] [resources.install_dir] diff --git a/scripts/install b/scripts/install index e91476b..cbfedf7 100755 --- a/scripts/install +++ b/scripts/install @@ -32,6 +32,7 @@ ynh_script_progression --message="Setting up source files..." --weight=1 ynh_setup_source --dest_dir="$install_dir" ynh_setup_source --dest_dir="$install_dir/modules/" --source_id="csvimport" +ynh_setup_source --dest_dir="$install_dir/modules/" --source_id="ldap" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" diff --git a/scripts/upgrade b/scripts/upgrade index 28c9c3d..50dac4e 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -39,7 +39,8 @@ ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" --keep="config/local.config.php config/database.ini modules themes files" -ynh_setup_source --dest_dir="$install_dir/modules/" --source_id="csvimport" --full_replace=1 +ynh_setup_source --dest_dir="$install_dir/modules/" --source_id="csvimport" +ynh_setup_source --dest_dir="$install_dir/modules/" --source_id="ldap" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" From f996c370b5794c2595185ce07481c3957cab7c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 13 Jun 2024 13:00:09 +0200 Subject: [PATCH 2/6] fix --- conf/local.config.php | 2 +- scripts/install | 3 +++ scripts/upgrade | 13 +++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/conf/local.config.php b/conf/local.config.php index 5dbd44f..12b082a 100644 --- a/conf/local.config.php +++ b/conf/local.config.php @@ -40,7 +40,7 @@ return [ 'baseDn' => 'ou=users,dc=yunohost,dc=org', 'accountFilterFormat' => "(&(|(objectclass=posixAccount))(uid={{username}})(permission=cn=__APP__.main,ou=permission,dc=yunohost,dc=org))", 'accountCanonicalForm' => 4, - 'accountDomainName' => 'example.com', + #'accountDomainName' => 'example.com', ], ], ], diff --git a/scripts/install b/scripts/install index cbfedf7..dfd5ad2 100755 --- a/scripts/install +++ b/scripts/install @@ -54,9 +54,12 @@ ynh_add_nginx_config ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_add_config --template="database.ini.default" --destination="$install_dir/config/database.ini" +ynh_add_config --template="local.config.php" --destination="$install_dir/config/local.config.php" chmod 400 "$install_dir/config/database.ini" chown $app "$install_dir/config/database.ini" +chmod 400 "$install_dir/config/local.config.php" +chown $app "$install_dir/config/local.config.php" #================================================= # TWEAK IMAGICK CONFIGURATION TO ALLOW PDF THUMBNAILS GENERATION diff --git a/scripts/upgrade b/scripts/upgrade index 50dac4e..f8840f9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -45,6 +45,19 @@ ynh_setup_source --dest_dir="$install_dir/modules/" --source_id="ldap" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" +#================================================= +# ADD A CONFIGURATION +#================================================= +ynh_script_progression --message="Adding a configuration file..." --weight=1 + +ynh_add_config --template="database.ini.default" --destination="$install_dir/config/database.ini" +ynh_add_config --template="local.config.php" --destination="$install_dir/config/local.config.php" + +chmod 400 "$install_dir/config/database.ini" +chown $app "$install_dir/config/database.ini" +chmod 400 "$install_dir/config/local.config.php" +chown $app "$install_dir/config/local.config.php" + #================================================= # PHP-FPM CONFIGURATION #================================================= From 26a6fc129806b21c74b869b902040320b2b24dde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 13 Jun 2024 13:04:20 +0200 Subject: [PATCH 3/6] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 7254442..aeb7787 100644 --- a/manifest.toml +++ b/manifest.toml @@ -76,7 +76,7 @@ ram.runtime = "50M" api.show_tile = false [resources.apt] - packages = "mariadb-server, imagemagick, php8.3-mysql, php8.3-gd, php8.3-mbstring, php8.3-xml, php8.3-imagick" + packages = "mariadb-server, imagemagick, php8.3-mysql, php8.3-gd, php8.3-mbstring, php8.3-xml, php8.3-ldap, php8.3-imagick" [resources.database] type = "mysql" From 189463d604d914d089c085c69ca4290c929e7af2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 13 Jun 2024 15:19:42 +0200 Subject: [PATCH 4/6] Update local.config.php --- conf/local.config.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/conf/local.config.php b/conf/local.config.php index 12b082a..6956136 100644 --- a/conf/local.config.php +++ b/conf/local.config.php @@ -44,4 +44,22 @@ return [ ], ], ], + 'mail' => [ + 'transport' => [ + 'type' => 'smtp', + 'options' => [ + 'name' => 'localhost', + 'host' => '127.0.0.1', + 'port' => 25, // 465 for 'ssl', and 587 for 'tls' + 'connection_class' => 'smtp', // 'plain', 'login', or 'crammd5' + 'connection_config' => [ + 'username' => null, + 'password' => null, + 'ssl' => null, // 'ssl' or 'tls' + 'use_complete_quit' => true, + ], + ], + ], + ], + ]; From 641a7b6a592cc6df3732b1419ffbe127220971d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 13 Jun 2024 15:22:25 +0200 Subject: [PATCH 5/6] add mail --- conf/local.config.php | 18 ++---------------- manifest.toml | 3 ++- scripts/install | 1 - scripts/upgrade | 1 - 4 files changed, 4 insertions(+), 19 deletions(-) diff --git a/conf/local.config.php b/conf/local.config.php index 6956136..131d5d1 100644 --- a/conf/local.config.php +++ b/conf/local.config.php @@ -30,20 +30,6 @@ return [ 'Omeka\File\Thumbnailer' => 'Omeka\File\Thumbnailer\ImageMagick', ], ], - 'ldap' => [ - 'adapter_options' => [ - 'server1' => [ - 'host' => 'localhost', - 'username' => 'ou=users,dc=yunohost,dc=org', - 'password' => null, - 'bindRequiresDn' => true, - 'baseDn' => 'ou=users,dc=yunohost,dc=org', - 'accountFilterFormat' => "(&(|(objectclass=posixAccount))(uid={{username}})(permission=cn=__APP__.main,ou=permission,dc=yunohost,dc=org))", - 'accountCanonicalForm' => 4, - #'accountDomainName' => 'example.com', - ], - ], - ], 'mail' => [ 'transport' => [ 'type' => 'smtp', @@ -53,8 +39,8 @@ return [ 'port' => 25, // 465 for 'ssl', and 587 for 'tls' 'connection_class' => 'smtp', // 'plain', 'login', or 'crammd5' 'connection_config' => [ - 'username' => null, - 'password' => null, + 'username' => '__APP__', + 'password' => '__MAIL_PWD__', 'ssl' => null, // 'ssl' or 'tls' 'use_complete_quit' => true, ], diff --git a/manifest.toml b/manifest.toml index aeb7787..bc99c1c 100644 --- a/manifest.toml +++ b/manifest.toml @@ -67,6 +67,7 @@ ram.runtime = "50M" [resources.system_user] [resources.install_dir] + allow_email = true [resources.permissions] main.url = "/" @@ -76,7 +77,7 @@ ram.runtime = "50M" api.show_tile = false [resources.apt] - packages = "mariadb-server, imagemagick, php8.3-mysql, php8.3-gd, php8.3-mbstring, php8.3-xml, php8.3-ldap, php8.3-imagick" + packages = "mariadb-server, imagemagick, php8.3-mysql, php8.3-gd, php8.3-mbstring, php8.3-xml, php8.3-imagick" [resources.database] type = "mysql" diff --git a/scripts/install b/scripts/install index dfd5ad2..92b9603 100755 --- a/scripts/install +++ b/scripts/install @@ -32,7 +32,6 @@ ynh_script_progression --message="Setting up source files..." --weight=1 ynh_setup_source --dest_dir="$install_dir" ynh_setup_source --dest_dir="$install_dir/modules/" --source_id="csvimport" -ynh_setup_source --dest_dir="$install_dir/modules/" --source_id="ldap" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" diff --git a/scripts/upgrade b/scripts/upgrade index f8840f9..77adcef 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -40,7 +40,6 @@ ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" --keep="config/local.config.php config/database.ini modules themes files" ynh_setup_source --dest_dir="$install_dir/modules/" --source_id="csvimport" -ynh_setup_source --dest_dir="$install_dir/modules/" --source_id="ldap" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" From 1a00d5270dddd15f2e47ee36ceb3b99fa584c207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 13 Jun 2024 16:01:08 +0200 Subject: [PATCH 6/6] Update manifest.toml --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index bc99c1c..ed09363 100644 --- a/manifest.toml +++ b/manifest.toml @@ -65,10 +65,10 @@ ram.runtime = "50M" autoupdate.strategy = "latest_github_tag" [resources.system_user] - - [resources.install_dir] allow_email = true + [resources.install_dir] + [resources.permissions] main.url = "/" api.url = "/api"