diff --git a/README.md b/README.md index 7cfbac4..7eb2559 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ This Yunohost app installs the server part (services + mongo database) needed to - As well any documents or images uploaded by users will be backed up -**Shipped version:** 0.3.1~ynh1 +**Shipped version:** 0.3.1~ynh2 **Demo:** diff --git a/README_eu.md b/README_eu.md index 33374c3..430ea44 100644 --- a/README_eu.md +++ b/README_eu.md @@ -32,7 +32,7 @@ This Yunohost app installs the server part (services + mongo database) needed to - As well any documents or images uploaded by users will be backed up -**Paketatutako bertsioa:** 0.3.1~ynh1 +**Paketatutako bertsioa:** 0.3.1~ynh2 **Demoa:** diff --git a/README_fr.md b/README_fr.md index 174e646..6d9e3c9 100644 --- a/README_fr.md +++ b/README_fr.md @@ -32,7 +32,7 @@ This Yunohost app installs the server part (services + mongo database) needed to - As well any documents or images uploaded by users will be backed up -**Version incluse :** 0.3.1~ynh1 +**Version incluse :** 0.3.1~ynh2 **Démo :** diff --git a/README_gl.md b/README_gl.md index 54bb600..75d5626 100644 --- a/README_gl.md +++ b/README_gl.md @@ -32,7 +32,7 @@ This Yunohost app installs the server part (services + mongo database) needed to - As well any documents or images uploaded by users will be backed up -**Versión proporcionada:** 0.3.1~ynh1 +**Versión proporcionada:** 0.3.1~ynh2 **Demo:** diff --git a/conf/nginx.conf b/conf/nginx.conf index 08fe1a6..4f762ac 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,6 +2,15 @@ location __PATH__/ { + # CORS support + add_header Access-Control-Allow-Origin *; + + # Handling preflight requests + if ($request_method = OPTIONS) { + add_header Access-Control-Allow-Methods *; + add_header Access-Control-Allow-Headers *; + } + # Path to source alias __DATA_DIR__/; diff --git a/conf/repository-next.json b/conf/repository-next.json new file mode 100644 index 0000000..f63627d --- /dev/null +++ b/conf/repository-next.json @@ -0,0 +1,56 @@ + { + "$schema": "https://dont-code.net/schemas/v1/repository-schema.json", + "name": "Next Repository __TENANT__", + "description": "Repository provided by Dont-code offering next versions of all plugins", + "webSocketUrl": "ws://__DOMAIN____PATH__/preview", + "storeApiUrl": "https://__DOMAIN____PATH__/data", + "projectApiUrl": "https://__DOMAIN____PATH__/project", + "documentApiUrl": "https://__DOMAIN____PATH__/documents", + "plugins": [ + { + "id": "Basic", + "display-name": "Basic plugin for editing entities", + "version": "1.0.0", + "info": { + "remote-entry":"https://dont-code.net/plugins/next/remoteEntry.mjs" + }, + "config": {} + }, + { + "id": "Fields", + "display-name": "Additional editors for entity properties", + "version": "1.0.0", + "info": { + "remote-entry":"https://dont-code.net/plugins/next/remoteEntry.mjs" + }, + "config": {} + }, + { + "id": "Rest", + "display-name": "Plugins to support datasources from Rest API", + "version": "1.0.0", + "info": { + "remote-entry":"https://dont-code.net/plugin-rest/next/remoteEntry.mjs" + }, + "config": {} + }, + { + "id": "Report", + "display-name": "Plugins to generate and display reports", + "version": "1.0.0", + "info": { + "remote-entry":"https://dont-code.net/plugin-report/next/remoteEntry.mjs" + }, + "config": {} + }, + { + "id": "Commerce", + "display-name": "Plugins to get prices from shops", + "version": "1.0.0", + "info": { + "remote-entry":"https://dont-code.net/plugin-commerce/next/remoteEntry.mjs" + }, + "config": {} + } + ] +} diff --git a/conf/repository-stable.json b/conf/repository-stable.json new file mode 100644 index 0000000..a2d0c2a --- /dev/null +++ b/conf/repository-stable.json @@ -0,0 +1,56 @@ + { + "$schema": "https://dont-code.net/schemas/v1/repository-schema.json", + "name": "Stable Repository __TENANT__", + "description": "Repository provided by Dont-code using stable versions of plugins", + "webSocketUrl": "ws://__DOMAIN____PATH__/preview", + "storeApiUrl": "https://__DOMAIN____PATH__/data", + "projectApiUrl": "https://__DOMAIN____PATH__/project", + "documentApiUrl": "https://__DOMAIN____PATH__/documents", + "plugins": [ + { + "id": "Basic", + "display-name": "Basic plugin for editing entities", + "version": "1.0.0", + "info": { + "remote-entry":"https://dont-code.net/plugins/latest/remoteEntry.mjs" + }, + "config": {} + }, + { + "id": "Fields", + "display-name": "Additional editors for entity properties", + "version": "1.0.0", + "info": { + "remote-entry":"https://dont-code.net/plugins/latest/remoteEntry.mjs" + }, + "config": {} + }, + { + "id": "Rest", + "display-name": "Plugins to support datasources from Rest API", + "version": "1.0.0", + "info": { + "remote-entry":"https://dont-code.net/plugin-rest/latest/remoteEntry.mjs" + }, + "config": {} + }, + { + "id": "Report", + "display-name": "Plugins to generate and display reports", + "version": "1.0.0", + "info": { + "remote-entry":"https://dont-code.net/plugin-report/latest/remoteEntry.mjs" + }, + "config": {} + }, + { + "id": "Commerce", + "display-name": "Plugins to get prices from shops", + "version": "1.0.0", + "info": { + "remote-entry":"https://dont-code.net/plugin-commerce/latest/remoteEntry.mjs" + }, + "config": {} + } + ] +} diff --git a/manifest.toml b/manifest.toml index 6173aeb..270a846 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "Dont-code Services" description.en = "Install services and databases needed to support Dont-code platform" description.fr = "Installe les services et base de données nécessaires pour utiliser la plateforme Dont-code" -version = "0.3.1~ynh1" +version = "0.3.1~ynh2" maintainers = ["Dont-code Team"] diff --git a/scripts/change_url b/scripts/change_url index 9aec754..139052a 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -41,6 +41,10 @@ ynh_backup_if_checksum_is_different --file="$install_dir/.env" ynh_replace_string --match_string="$document_url" --replace_string="$new_document_url" --target_file="$install_dir/.env" ynh_store_file_checksum --file="$install_dir/.env" +# Update the repository pages +ynh_add_config --template="repository-next.json" --destination="$data_dir/repository-next.json" +ynh_add_config --template="repository-stable.json" --destination="$data_dir/repository-stable.json" + #================================================= # GENERIC FINALISATION #================================================= diff --git a/scripts/install b/scripts/install index b6a9c5a..3ba89bb 100755 --- a/scripts/install +++ b/scripts/install @@ -35,9 +35,14 @@ ynh_app_setting_set --app="$app" --key=document_dir --value="$document_dir" document_url=$(append_uri "https://${domain}${path}" "docs") ynh_app_setting_set --app="$app" --key=document_url --value="$document_url" -# Add the status page +# Add the status pageindex ynh_add_config --template="index.html" --destination="$data_dir/index.html" +# Add the repository pages +ynh_add_config --template="repository-next.json" --destination="$data_dir/repository-next.json" +ynh_add_config --template="repository-stable.json" --destination="$data_dir/repository-stable.json" + + chmod -R o-rwx "$data_dir" chown -R $app:www-data "$data_dir" diff --git a/scripts/upgrade b/scripts/upgrade index 29459ed..0a3e921 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -117,6 +117,10 @@ ynh_script_progression --message="Configuring document storage..." --weight=1 ynh_add_config --template="index.html" --destination="$data_dir/index.html" +# Add the repository pages +ynh_add_config --template="repository-next.json" --destination="$data_dir/repository-next.json" +ynh_add_config --template="repository-stable.json" --destination="$data_dir/repository-stable.json" + chmod -R o-rwx "$data_dir" chown -R "$app:www-data" "$data_dir"