diff --git a/scripts/install b/scripts/install index 56f9085..0dcc37c 100755 --- a/scripts/install +++ b/scripts/install @@ -26,8 +26,6 @@ ynh_script_progression --message="Configuring a PostgreSQL database..." ynh_psql_execute_as_root --sql="CREATE DATABASE ${db_name}olap WITH OWNER ${db_user} TEMPLATE template0 ENCODING 'UTF8';" ynh_psql_execute_as_root --sql="CREATE DATABASE ${db_name}tenant WITH OWNER ${db_user} TEMPLATE template0 ENCODING 'UTF8';" -#================================================= -# SPECIFIC SETUP #================================================= # BUILD APP #================================================= @@ -45,12 +43,13 @@ ynh_replace_string --target_file="$install_dir/framework/entity/config/entityeng ynh_replace_string --target_file="$install_dir/framework/entity/config/entityengine.xml" --match_string="jdbc-username=\"ofbiz\"" --replace_string="jdbc-username=\"$db_user\"" ynh_replace_string --target_file="$install_dir/framework/entity/config/entityengine.xml" --match_string="jdbc-password=\"ofbiz\"" --replace_string="jdbc-password=\"$db_pwd\"" ynh_replace_string --target_file="$install_dir/framework/entity/config/entityengine.xml" \ - --match_string="group-map group-name=\"org.apache.ofbiz\" datasource-name=\"localderby\"" --replace_string="group-map group-name=\"org.apache.ofbiz\" datasource-name=\"localpostgres\"" + --match_string="group-map group-name=\"org.apache.ofbiz\" datasource-name=\"localderby\"" --replace_string="group-map group-name=\"org.apache.ofbiz\" datasource-name=\"localpostgres\"" ynh_replace_string --target_file="$install_dir/framework/entity/config/entityengine.xml" \ - --match_string="group-map group-name=\"org.apache.ofbiz.olap\" datasource-name=\"localderbyolap\"" --replace_string="group-map group-name=\"org.apache.ofbiz.olap\" datasource-name=\"localpostgresolap\"" + --match_string="group-map group-name=\"org.apache.ofbiz.olap\" datasource-name=\"localderbyolap\"" --replace_string="group-map group-name=\"org.apache.ofbiz.olap\" datasource-name=\"localpostgresolap\"" ynh_replace_string --target_file="$install_dir/framework/entity/config/entityengine.xml" \ - --match_string="group-map group-name=\"org.apache.ofbiz.tenant\" datasource-name=\"localderbytenant\"" --replace_string="group-map group-name=\"org.apache.ofbiz.tenant\" datasource-name=\"localpostgrestenant\"" + --match_string="group-map group-name=\"org.apache.ofbiz.tenant\" datasource-name=\"localderbytenant\"" --replace_string="group-map group-name=\"org.apache.ofbiz.tenant\" datasource-name=\"localpostgrestenant\"" +ynh_replace_string --target_file="$install_dir/framework/security/config/security.properties" --match_string="host-headers-allowed=.*" --replace_string="host-headers-allowed=$domain" ynh_replace_string --target_file="$install_dir/framework/security/config/security.properties" --match_string="security.ldap.enable=false" --replace_string="security.ldap.enable=true" ynh_replace_string --target_file="$install_dir/framework/security/config/jndiLdap.properties" --match_string="ldap.dn.template=cn=%u,ou=system" --replace_string="ldap.dn.template=uid=%u,ou=users,dc=yunohost,dc=org" diff --git a/scripts/upgrade b/scripts/upgrade index d068f28..a2e2c1c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -40,10 +40,14 @@ chown -R "$app:www-data" "$install_dir" #================================================= ynh_script_progression --message="Building app..." -ynh_replace_string --target_file="$install_dir/framework/webapp/config/url.properties" --match_string="port.https=" --replace_string="port.https=443" -ynh_replace_string --target_file="$install_dir/framework/webapp/config/url.properties" --match_string="force.https.host=" --replace_string="force.https.host=$domain" -ynh_replace_string --target_file="$install_dir/framework/webapp/config/url.properties" --match_string="port.http=8080" --replace_string="port.http=80" -ynh_replace_string --target_file="$install_dir/framework/webapp/config/url.properties" --match_string="force.http.host=" --replace_string="force.http.host=$domain" +# ynh_replace_string --target_file="$install_dir/framework/webapp/config/url.properties" --match_string="port.https=" --replace_string="port.https=443" +# ynh_replace_string --target_file="$install_dir/framework/webapp/config/url.properties" --match_string="force.https.host=" --replace_string="force.https.host=$domain" +# ynh_replace_string --target_file="$install_dir/framework/webapp/config/url.properties" --match_string="port.http=8080" --replace_string="port.http=80" +# ynh_replace_string --target_file="$install_dir/framework/webapp/config/url.properties" --match_string="force.http.host=" --replace_string="force.http.host=$domain" + +ynh_add_config --template="url.properties" --destination="$install_dir/framework/webapp/config/url.properties" + +ynh_add_config --template="security.properties" --destination="$install_dir/framework/security/config/security.properties" ynh_replace_string --target_file="$install_dir/framework/catalina/ofbiz-component.xml" --match_string="8443" --replace_string="$port" @@ -52,9 +56,12 @@ ynh_replace_string --target_file="$install_dir/framework/entity/config/entityeng ynh_replace_string --target_file="$install_dir/framework/entity/config/entityengine.xml" --match_string="jdbc:postgresql://127.0.0.1/ofbiztenant" --replace_string="jdbc:postgresql://127.0.0.1:5432/${db_name}tenant" ynh_replace_string --target_file="$install_dir/framework/entity/config/entityengine.xml" --match_string="jdbc-username=\"ofbiz\"" --replace_string="jdbc-username=\"$db_user\"" ynh_replace_string --target_file="$install_dir/framework/entity/config/entityengine.xml" --match_string="jdbc-password=\"ofbiz\"" --replace_string="jdbc-password=\"$db_pwd\"" -ynh_replace_string --target_file="$install_dir/framework/entity/config/entityengine.xml" --match_string="group-map group-name=\"org.apache.ofbiz\" datasource-name=\"localderby\"" --replace_string="group-map group-name=\"org.apache.ofbiz\" datasource-name=\"localpostgres\"" -ynh_replace_string --target_file="$install_dir/framework/entity/config/entityengine.xml" --match_string="group-map group-name=\"org.apache.ofbiz.olap\" datasource-name=\"localderbyolap\"" --replace_string="group-map group-name=\"org.apache.ofbiz.olap\" datasource-name=\"localpostgresolap\"" -ynh_replace_string --target_file="$install_dir/framework/entity/config/entityengine.xml" --match_string="group-map group-name=\"org.apache.ofbiz.tenant\" datasource-name=\"localderbytenant\"" --replace_string="group-map group-name=\"org.apache.ofbiz.tenant\" datasource-name=\"localpostgrestenant\"" +ynh_replace_string --target_file="$install_dir/framework/entity/config/entityengine.xml" \ + --match_string="group-map group-name=\"org.apache.ofbiz\" datasource-name=\"localderby\"" --replace_string="group-map group-name=\"org.apache.ofbiz\" datasource-name=\"localpostgres\"" +ynh_replace_string --target_file="$install_dir/framework/entity/config/entityengine.xml" \ + --match_string="group-map group-name=\"org.apache.ofbiz.olap\" datasource-name=\"localderbyolap\"" --replace_string="group-map group-name=\"org.apache.ofbiz.olap\" datasource-name=\"localpostgresolap\"" +ynh_replace_string --target_file="$install_dir/framework/entity/config/entityengine.xml" \ + --match_string="group-map group-name=\"org.apache.ofbiz.tenant\" datasource-name=\"localderbytenant\"" --replace_string="group-map group-name=\"org.apache.ofbiz.tenant\" datasource-name=\"localpostgrestenant\"" ynh_replace_string --target_file="$install_dir/framework/security/config/security.properties" --match_string="host-headers-allowed=.*" --replace_string="host-headers-allowed=$domain" ynh_replace_string --target_file="$install_dir/framework/security/config/security.properties" --match_string="security.ldap.enable=false" --replace_string="security.ldap.enable=true" @@ -62,6 +69,11 @@ ynh_replace_string --target_file="$install_dir/framework/security/config/jndiLda ynh_add_config --template="build.gradle" --destination="$install_dir/build.gradle" +pushd "$install_dir" + ynh_exec_as "$app" ./gradle/init-gradle-wrapper.sh + ynh_exec_as "$app" ./gradlew cleanAll loadAll 2>&1 +popd + #================================================= # REAPPLY SYSTEM CONFIGURATIONS #=================================================