From 8c1e5d1e8f905c4249888eec4b9314dc61c78fc2 Mon Sep 17 00:00:00 2001 From: Fabian Wilkens Date: Fri, 8 Jan 2021 19:44:37 +0100 Subject: [PATCH 01/41] Preperation for extentions --- conf/env.sample | 3 +++ conf/nginx.conf | 4 +--- scripts/install | 28 ++++++++++++++++++++++++---- scripts/upgrade | 12 ++++++++++++ 4 files changed, 40 insertions(+), 7 deletions(-) diff --git a/conf/env.sample b/conf/env.sample index f443916..338fc54 100644 --- a/conf/env.sample +++ b/conf/env.sample @@ -61,3 +61,6 @@ REVISIONS_FREQUENCY=300 # Sub-URI RAILS_RELATIVE_URL_ROOT=/ + +# Enable public file server +RAILS_SERVE_STATIC_FILES=false diff --git a/conf/nginx.conf b/conf/nginx.conf index 7f58986..04d98b7 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -13,7 +13,5 @@ location __PATH__/ { proxy_set_header X-Forwarded-Proto $scheme; proxy_buffering off; - # Include SSOWAT user panel. - include conf.d/yunohost_panel.conf.inc; - more_clear_input_headers 'Accept-Encoding'; + more_set_headers "X-Frame-Options" : "allow-from __ACCESS_DOMAIN__" } diff --git a/scripts/install b/scripts/install index a65509f..308e6dd 100755 --- a/scripts/install +++ b/scripts/install @@ -28,6 +28,13 @@ domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC app=$YNH_APP_INSTANCE_NAME +install_extensions=$YNH_APP_ARG_INSTALL_EXTENSIONS +if [ $install_extensions -eq 0 ] +then + access_domain=$domain +else + access_domain=$YNH_APP_ARG_ACCESS_DOMAIN +fi #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS @@ -46,6 +53,8 @@ ynh_script_progression --message="Storing installation settings..." --weight=3 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=is_public --value=$is_public +ynh_app_setting_set --app=$app --key=install_extensions --value=$install_extensions +ynh_app_setting_set --app=$app --key=access_domain --value=$access_domain #================================================= # STANDARD MODIFICATIONS @@ -92,7 +101,7 @@ ynh_setup_source --dest_dir="$final_path/live" ynh_script_progression --message="Configuring nginx web server..." --weight=3 # Create a dedicated nginx config -ynh_add_nginx_config "port" +ynh_add_nginx_config "port access_domain" #================================================= # CREATE DEDICATED USER @@ -145,8 +154,19 @@ pushd "$final_path/live" exec_as "$app" env PATH=$PATH /opt/rbenv/versions/$RUBY_VERSION/bin/bundle config set with 'development' exec_as "$app" env PATH=$PATH /opt/rbenv/versions/$RUBY_VERSION/bin/bundle install exec_as "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails db:create db:migrate --quiet + exec_as "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails assets:precompile --quiet popd +#================================================= +# INSTALLING Standard Notes - Extensions +#================================================= +if [ $install_extensions ] +then + ynh_script_progression --message="Installing Standard Notes - Extensions..." --weight=1 + + ynh_replace_string --match_string="RAILS_SERVE_STATIC_FILES=false" --replace_string="RAILS_SERVE_STATIC_FILES=$install_extensions" --target_file="$config_file" +fi + #================================================= # SETUP SYSTEMD #================================================= @@ -210,9 +230,9 @@ ynh_script_progression --message="Configuring fail2ban..." --weight=1 # Create a dedicated fail2ban config touch "/var/log/$app/$app.log" ynh_add_fail2ban_config --use_template --others_var="\ - domain \ - path_url \ - " + domain \ + path_url \ + " #================================================= # SETUP SSOWAT diff --git a/scripts/upgrade b/scripts/upgrade index 549cb13..3c303fb 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,6 +25,7 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) port=$(ynh_app_setting_get --app=$app --key=port) +access_domain=(ynh_app_setting_get --app=$app --key=access_domain) #================================================= # CHECK VERSION @@ -179,9 +180,20 @@ then exec_as "$app" env PATH=$PATH /opt/rbenv/versions/$RUBY_VERSION/bin/bundle config set with 'development' exec_as "$app" env PATH=$PATH /opt/rbenv/versions/$RUBY_VERSION/bin/bundle install exec_as "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails db:create db:migrate --quiet + exec_as "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails assets:precompile --quiet popd fi +#================================================= +# INSTALLING Standard Notes - Extensions +#================================================= +if [ $install_extensions ] +then + ynh_script_progression --message="Installing Standard Notes - Extensions..." --weight=1 + + ynh_replace_string --match_string="RAILS_SERVE_STATIC_FILES=false" --replace_string="RAILS_SERVE_STATIC_FILES=true" --target_file="$config_file" +fi + #================================================= # SETUP SYSTEMD #================================================= From 77182ed4f997100e0376028aaa6915101f88f649 Mon Sep 17 00:00:00 2001 From: Fabian Wilkens Date: Mon, 11 Jan 2021 22:23:08 +0100 Subject: [PATCH 02/41] Add install extensions --- conf/env.sample | 2 +- conf/ext_action-bar.src | 5 + conf/ext_autobiography-theme.src | 5 + conf/ext_bold-editor.src | 5 + conf/ext_code-editor.src | 5 + conf/ext_dynamic-theme.src | 5 + conf/ext_filesafe-bar.src | 5 + conf/ext_focus-theme.src | 5 + conf/ext_folders-component.src | 5 + conf/ext_futura-theme.src | 5 + conf/ext_github-push.src | 5 + conf/ext_markdown-basic.src | 5 + conf/ext_markdown-pro.src | 5 + conf/ext_math-editor.src | 5 + conf/ext_mfa-link.src | 5 + conf/ext_midnight-theme.src | 5 + conf/ext_minimal-markdown-editor.src | 5 + conf/ext_no-distraction-theme.src | 5 + conf/ext_plus-editor.src | 5 + conf/ext_quick-tags.src | 5 + conf/ext_secure-spreadsheet.src | 5 + conf/ext_simple-task-editor.src | 5 + conf/ext_solarized-theme.src | 5 + conf/ext_titanium-theme.src | 5 + conf/ext_token-vault.src | 5 + conf/ext_vim-editor.src | 5 + conf/nginx.conf | 7 +- manifest.json | 22 +++ scripts/install | 22 ++- .../extra_files/app/public/extensions/css.css | 16 +++ .../app/public/extensions/index.html | 36 +++++ .../app/public/extensions/index.json | 127 ++++++++++++++++++ .../extra_files/app/public/extensions/js.js | 23 ++++ .../app/public/extensions/src/action-bar.json | 11 ++ .../extensions/src/autobiography-theme.json | 17 +++ .../public/extensions/src/bold-editor.json | 11 ++ .../public/extensions/src/code-editor.json | 11 ++ .../public/extensions/src/dynamic-theme.json | 13 ++ .../public/extensions/src/filesafe-bar.json | 11 ++ .../public/extensions/src/focus-theme.json | 17 +++ .../extensions/src/folders-component.json | 11 ++ .../public/extensions/src/futura-theme.json | 17 +++ .../public/extensions/src/github-push.json | 11 ++ .../public/extensions/src/markdown-basic.json | 11 ++ .../public/extensions/src/markdown-pro.json | 11 ++ .../public/extensions/src/math-editor.json | 11 ++ .../app/public/extensions/src/mfa-link.json | 11 ++ .../public/extensions/src/midnight-theme.json | 17 +++ .../src/minimal-markdown-editor.json | 11 ++ .../extensions/src/no-distraction-theme.json | 17 +++ .../public/extensions/src/plus-editor.json | 11 ++ .../app/public/extensions/src/quick-tags.json | 11 ++ .../extensions/src/secure-spreadsheets.json | 11 ++ .../extensions/src/simple-task-editor.json | 11 ++ .../extensions/src/solarized-dark-theme.json | 17 +++ .../public/extensions/src/titanium-theme.json | 17 +++ .../public/extensions/src/token-vault.json | 11 ++ .../app/public/extensions/src/vim-editor.json | 11 ++ 58 files changed, 695 insertions(+), 4 deletions(-) create mode 100644 conf/ext_action-bar.src create mode 100644 conf/ext_autobiography-theme.src create mode 100644 conf/ext_bold-editor.src create mode 100644 conf/ext_code-editor.src create mode 100644 conf/ext_dynamic-theme.src create mode 100644 conf/ext_filesafe-bar.src create mode 100644 conf/ext_focus-theme.src create mode 100644 conf/ext_folders-component.src create mode 100644 conf/ext_futura-theme.src create mode 100644 conf/ext_github-push.src create mode 100644 conf/ext_markdown-basic.src create mode 100644 conf/ext_markdown-pro.src create mode 100644 conf/ext_math-editor.src create mode 100644 conf/ext_mfa-link.src create mode 100644 conf/ext_midnight-theme.src create mode 100644 conf/ext_minimal-markdown-editor.src create mode 100644 conf/ext_no-distraction-theme.src create mode 100644 conf/ext_plus-editor.src create mode 100644 conf/ext_quick-tags.src create mode 100644 conf/ext_secure-spreadsheet.src create mode 100644 conf/ext_simple-task-editor.src create mode 100644 conf/ext_solarized-theme.src create mode 100644 conf/ext_titanium-theme.src create mode 100644 conf/ext_token-vault.src create mode 100644 conf/ext_vim-editor.src create mode 100644 sources/extra_files/app/public/extensions/css.css create mode 100644 sources/extra_files/app/public/extensions/index.html create mode 100644 sources/extra_files/app/public/extensions/index.json create mode 100644 sources/extra_files/app/public/extensions/js.js create mode 100644 sources/extra_files/app/public/extensions/src/action-bar.json create mode 100644 sources/extra_files/app/public/extensions/src/autobiography-theme.json create mode 100644 sources/extra_files/app/public/extensions/src/bold-editor.json create mode 100644 sources/extra_files/app/public/extensions/src/code-editor.json create mode 100644 sources/extra_files/app/public/extensions/src/dynamic-theme.json create mode 100644 sources/extra_files/app/public/extensions/src/filesafe-bar.json create mode 100644 sources/extra_files/app/public/extensions/src/focus-theme.json create mode 100644 sources/extra_files/app/public/extensions/src/folders-component.json create mode 100644 sources/extra_files/app/public/extensions/src/futura-theme.json create mode 100644 sources/extra_files/app/public/extensions/src/github-push.json create mode 100644 sources/extra_files/app/public/extensions/src/markdown-basic.json create mode 100644 sources/extra_files/app/public/extensions/src/markdown-pro.json create mode 100644 sources/extra_files/app/public/extensions/src/math-editor.json create mode 100644 sources/extra_files/app/public/extensions/src/mfa-link.json create mode 100644 sources/extra_files/app/public/extensions/src/midnight-theme.json create mode 100644 sources/extra_files/app/public/extensions/src/minimal-markdown-editor.json create mode 100644 sources/extra_files/app/public/extensions/src/no-distraction-theme.json create mode 100644 sources/extra_files/app/public/extensions/src/plus-editor.json create mode 100644 sources/extra_files/app/public/extensions/src/quick-tags.json create mode 100644 sources/extra_files/app/public/extensions/src/secure-spreadsheets.json create mode 100644 sources/extra_files/app/public/extensions/src/simple-task-editor.json create mode 100644 sources/extra_files/app/public/extensions/src/solarized-dark-theme.json create mode 100644 sources/extra_files/app/public/extensions/src/titanium-theme.json create mode 100644 sources/extra_files/app/public/extensions/src/token-vault.json create mode 100644 sources/extra_files/app/public/extensions/src/vim-editor.json diff --git a/conf/env.sample b/conf/env.sample index 338fc54..593faf8 100644 --- a/conf/env.sample +++ b/conf/env.sample @@ -63,4 +63,4 @@ REVISIONS_FREQUENCY=300 RAILS_RELATIVE_URL_ROOT=/ # Enable public file server -RAILS_SERVE_STATIC_FILES=false +RAILS_SERVE_STATIC_FILES= diff --git a/conf/ext_action-bar.src b/conf/ext_action-bar.src new file mode 100644 index 0000000..a22d22e --- /dev/null +++ b/conf/ext_action-bar.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/standardnotes/action-bar/archive/1.3.1.zip +SOURCE_SUM=413F74598DA5C5B401D95620B330E23A094BEEF9DD9C2EBC653199E7FDBB7F7F +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/ext_autobiography-theme.src b/conf/ext_autobiography-theme.src new file mode 100644 index 0000000..45f25d2 --- /dev/null +++ b/conf/ext_autobiography-theme.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/sn-extensions/autobiography-theme/archive/1.0.0.zip +SOURCE_SUM=cbc8e07fa7703bdf8b7c9c3ef30a6d87d4ade7e5eb58ce7a983a34f1199a819d +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/ext_bold-editor.src b/conf/ext_bold-editor.src new file mode 100644 index 0000000..9ca9c28 --- /dev/null +++ b/conf/ext_bold-editor.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/standardnotes/bold-editor/archive/1.1.0.zip +SOURCE_SUM=a842181f1e2e0cc93a29ff1c532c4650cbcc3327742267bb3471f1018406df0f +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/ext_code-editor.src b/conf/ext_code-editor.src new file mode 100644 index 0000000..b35b2c8 --- /dev/null +++ b/conf/ext_code-editor.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/standardnotes/code-editor/archive/1.3.5.zip +SOURCE_SUM=e928b1e474e5c391d5ac2654982177238081e3cd11a6e318d7805c36030bd879 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/ext_dynamic-theme.src b/conf/ext_dynamic-theme.src new file mode 100644 index 0000000..be7d2a0 --- /dev/null +++ b/conf/ext_dynamic-theme.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/sn-extensions/dynamic-theme/archive/1.0.0.zip +SOURCE_SUM=2be90456a6d8e90b4c6c666c797b96c72935b41fde8aa2b29a219368ce100c99 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/ext_filesafe-bar.src b/conf/ext_filesafe-bar.src new file mode 100644 index 0000000..66a346c --- /dev/null +++ b/conf/ext_filesafe-bar.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/standardnotes/filesafe-bar/archive/2.0.10.zip +SOURCE_SUM=17764DF475CC7EAE160F6D85BE469872444FB986355F9B270667E6E876ACAC3A +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/ext_focus-theme.src b/conf/ext_focus-theme.src new file mode 100644 index 0000000..9c4169c --- /dev/null +++ b/conf/ext_focus-theme.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/sn-extensions/focus-theme/archive/1.2.3.zip +SOURCE_SUM=371a48128bc0e95f2298053dc39c333454a2c11962a28e9a7749435da0e85340 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/ext_folders-component.src b/conf/ext_folders-component.src new file mode 100644 index 0000000..350dbc4 --- /dev/null +++ b/conf/ext_folders-component.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/standardnotes/folders-component/archive/1.3.5.zip +SOURCE_SUM=190CE79BAD28C772955960A16D6027BE8B7B7A9B8850BD65D79F5FAB4FF64E90 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/ext_futura-theme.src b/conf/ext_futura-theme.src new file mode 100644 index 0000000..6bea15a --- /dev/null +++ b/conf/ext_futura-theme.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/sn-extensions/futura-theme/archive/1.2.2.zip +SOURCE_SUM=900cebb84e2a794ca5cd6d62d28705e18181ae6cac76c2d8fa6d109a24386e94 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/ext_github-push.src b/conf/ext_github-push.src new file mode 100644 index 0000000..07c9135 --- /dev/null +++ b/conf/ext_github-push.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/sn-extensions/github-push/archive/1.2.2.zip +SOURCE_SUM=9b64cd9797254120b82b9e43bee7bb0d65b950d8cfeab1b16311a96eedd93527 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/ext_markdown-basic.src b/conf/ext_markdown-basic.src new file mode 100644 index 0000000..c2ac13c --- /dev/null +++ b/conf/ext_markdown-basic.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/standardnotes/markdown-basic/archive/1.3.6.zip +SOURCE_SUM=b0e77cc3713a2c7ddf330af37b164a1fee356c65d1ff5352d31f0d8a2bf5d8f9 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/ext_markdown-pro.src b/conf/ext_markdown-pro.src new file mode 100644 index 0000000..fbc9628 --- /dev/null +++ b/conf/ext_markdown-pro.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/standardnotes/markdown-pro/archive/1.3.9.zip +SOURCE_SUM=70a21fa13554d4a7a6d3ac5ae06acf4b97a88b6ea5af804e958774273aaf1c40 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/ext_math-editor.src b/conf/ext_math-editor.src new file mode 100644 index 0000000..43ba63b --- /dev/null +++ b/conf/ext_math-editor.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/sn-extensions/math-editor/archive/1.3.4.zip +SOURCE_SUM=e8e69f082231f3052185c1f74c7bacdbc26b75fe1047045da2cf22f4459d97bf +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/ext_mfa-link.src b/conf/ext_mfa-link.src new file mode 100644 index 0000000..34adef2 --- /dev/null +++ b/conf/ext_mfa-link.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/sn-extensions/mfa-link/archive/1.2.2.zip +SOURCE_SUM=6B41F549FCB8721D429FA216D261C8221C2FC8304EF5C2BF9F98A58C1D7D7388 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/ext_midnight-theme.src b/conf/ext_midnight-theme.src new file mode 100644 index 0000000..850a929 --- /dev/null +++ b/conf/ext_midnight-theme.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/sn-extensions/midnight-theme/archive/1.2.1.zip +SOURCE_SUM=f219de3cf26494a73d506139082463a06782a5fc1717290d96da9c8a54102342 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/ext_minimal-markdown-editor.src b/conf/ext_minimal-markdown-editor.src new file mode 100644 index 0000000..f8ecdde --- /dev/null +++ b/conf/ext_minimal-markdown-editor.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/sn-extensions/minimal-markdown-editor/archive/1.3.5.zip +SOURCE_SUM=c062db588a500e227524bc0e28335dcfebbd913badd19784e00ab607bec7abbf +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/ext_no-distraction-theme.src b/conf/ext_no-distraction-theme.src new file mode 100644 index 0000000..ef63679 --- /dev/null +++ b/conf/ext_no-distraction-theme.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/sn-extensions/no-distraction-theme/archive/1.2.2.zip +SOURCE_SUM=c6b3116aab0e87bdba25632f6e0820c98a47c10248c4760853fb69facc860088 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/ext_plus-editor.src b/conf/ext_plus-editor.src new file mode 100644 index 0000000..6746d17 --- /dev/null +++ b/conf/ext_plus-editor.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/standardnotes/plus-editor/archive/1.4.3.zip +SOURCE_SUM=c1e023b8b78304773a4b447ed5da601bcf799587c44e07f9f793488b933bbd0a +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/ext_quick-tags.src b/conf/ext_quick-tags.src new file mode 100644 index 0000000..872cbd3 --- /dev/null +++ b/conf/ext_quick-tags.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/standardnotes/quick-tags/archive/1.3.2.zip +SOURCE_SUM=62B815B436F519412B16A58622D356219F391B11A6FBB88F5E018FF3520214CF +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/ext_secure-spreadsheet.src b/conf/ext_secure-spreadsheet.src new file mode 100644 index 0000000..10ab8c7 --- /dev/null +++ b/conf/ext_secure-spreadsheet.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/standardnotes/secure-spreadsheets/archive/1.3.6.zip +SOURCE_SUM=09176C65CA1635E37D15DE33FFB8B44195601E5D71E514EF9D8C4105DE8A2BF9 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/ext_simple-task-editor.src b/conf/ext_simple-task-editor.src new file mode 100644 index 0000000..e0c102d --- /dev/null +++ b/conf/ext_simple-task-editor.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/sn-extensions/simple-task-editor/archive/1.3.5.zip +SOURCE_SUM=2cb836e9932a8e39b41397fc6f9ef721c894e422a3f898db66cb340d9cbf931b +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/ext_solarized-theme.src b/conf/ext_solarized-theme.src new file mode 100644 index 0000000..422d0d3 --- /dev/null +++ b/conf/ext_solarized-theme.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/sn-extensions/solarized-dark-theme/archive/1.2.1.zip +SOURCE_SUM=4f05dfb4edc9ce81fd22c01d101cc453509791e24475cfefd235dab15b4abfc6 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/ext_titanium-theme.src b/conf/ext_titanium-theme.src new file mode 100644 index 0000000..77bae1d --- /dev/null +++ b/conf/ext_titanium-theme.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/sn-extensions/titanium-theme/archive/1.2.2.zip +SOURCE_SUM=aa42d8911a514d454af045dc65433aef6361ecfd67ad27f1d8093b9da01bf2b3 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/ext_token-vault.src b/conf/ext_token-vault.src new file mode 100644 index 0000000..8961969 --- /dev/null +++ b/conf/ext_token-vault.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/sn-extensions/token-vault/archive/1.0.5.zip +SOURCE_SUM=a9f4e1bafec6194499dd163fd53bdb9876689c99e7218b36a8e26dbe0c096f21 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/ext_vim-editor.src b/conf/ext_vim-editor.src new file mode 100644 index 0000000..a7b47a8 --- /dev/null +++ b/conf/ext_vim-editor.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/sn-extensions//vim-editor/archive/1.3.2.zip +SOURCE_SUM=a32fb89d63dea190302b966f0adb2e0ce3a1ef07248277b7d5abf52646585c74 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true diff --git a/conf/nginx.conf b/conf/nginx.conf index 04d98b7..52ec158 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,3 +1,8 @@ +location = /favicon.ico { + alias /opt/yunohost/snserver/live/public/favicon/favicon.ico; + expires 30d; +} + location __PATH__/ { alias __FINALPATH__/live/public ; @@ -13,5 +18,5 @@ location __PATH__/ { proxy_set_header X-Forwarded-Proto $scheme; proxy_buffering off; - more_set_headers "X-Frame-Options" : "allow-from __ACCESS_DOMAIN__" + more_set_headers "X-Frame-Options" : "allow-from __ACCESS_DOMAIN__"; } diff --git a/manifest.json b/manifest.json index dde9a15..ef4c8c5 100644 --- a/manifest.json +++ b/manifest.json @@ -55,6 +55,28 @@ "de": "Ist die Application Öffendlich?" }, "default": true + }, + { + "name": "install_extensions", + "type": "boolean", + "help": { + "en": "Once you've installed the extensions, you cannot change the domain without the users having to reinstall the extensions" + }, + "ask": { + "en": "Do you want to install the Standard Notes Extensions?", + "de": "Willst du die Standard Notes Extensions installieren?" + }, + "default": true + }, + { + "name": "access_domain", + "type": "string", + "ask": { + "en": "Choose a domain which has access to the extensions. E.g. the Standard-Notes web app." + }, + "optional": true, + "example": "example.tld", + "default": "" } ] } diff --git a/scripts/install b/scripts/install index 308e6dd..04e204a 100755 --- a/scripts/install +++ b/scripts/install @@ -154,7 +154,7 @@ pushd "$final_path/live" exec_as "$app" env PATH=$PATH /opt/rbenv/versions/$RUBY_VERSION/bin/bundle config set with 'development' exec_as "$app" env PATH=$PATH /opt/rbenv/versions/$RUBY_VERSION/bin/bundle install exec_as "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails db:create db:migrate --quiet - exec_as "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails assets:precompile --quiet +# exec_as "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails assets:precompile --quiet popd #================================================= @@ -164,7 +164,25 @@ if [ $install_extensions ] then ynh_script_progression --message="Installing Standard Notes - Extensions..." --weight=1 - ynh_replace_string --match_string="RAILS_SERVE_STATIC_FILES=false" --replace_string="RAILS_SERVE_STATIC_FILES=$install_extensions" --target_file="$config_file" + ynh_replace_string --match_string="RAILS_SERVE_STATIC_FILES=" --replace_string="RAILS_SERVE_STATIC_FILES=true" --target_file="$config_file" + + if [ $path_url = "/" ] + then + path="" + else + path=$path_url + fi + + find "$final_path/live/public/extensions/src/" -name "*.json" -print0 | while read -d $'\0' file + do + ynh_replace_string --match_string="__DOMAIN__PATH__" --replace_string="$domain$path" --target_file="$file" + done + + find "../conf/" -name "ext_*.src" -print0 | while read -d $'\0' file + do + basename=$(basename -as .src $file) + ynh_setup_source --dest_dir="$final_path/live/public/extensions/src/${basename#'ext_'}" --source_id="$basename" + done fi #================================================= diff --git a/sources/extra_files/app/public/extensions/css.css b/sources/extra_files/app/public/extensions/css.css new file mode 100644 index 0000000..0fbb992 --- /dev/null +++ b/sources/extra_files/app/public/extensions/css.css @@ -0,0 +1,16 @@ +body { + padding-left: 50px; +} +td { + border: 1px solid #999; + padding: 0.25rem; +} +td#id { + width: 20px; +} +td#name { + width: 200px; +} +td#url { + width: 300px; +} diff --git a/sources/extra_files/app/public/extensions/index.html b/sources/extra_files/app/public/extensions/index.html new file mode 100644 index 0000000..867b07d --- /dev/null +++ b/sources/extra_files/app/public/extensions/index.html @@ -0,0 +1,36 @@ + + + + StandardNotes Extensions + + + + + +
+

Themes

+
+
+

Editors

+
+
+

Components

+
+ + + diff --git a/sources/extra_files/app/public/extensions/index.json b/sources/extra_files/app/public/extensions/index.json new file mode 100644 index 0000000..2bf45e7 --- /dev/null +++ b/sources/extra_files/app/public/extensions/index.json @@ -0,0 +1,127 @@ +[ + { + "name": "Autobiography Theme", + "url": "extensions/src/autobiography-theme.json", + "extension": "theme" + }, + { + "name": "Focus Theme", + "url": "extensions/src/focus-theme.json", + "extension": "theme" + }, + { + "name": "Futura Theme", + "url": "extensions/src/futura-theme.json", + "extension": "theme" + }, + { + "name": "Midnight Theme", + "url": "extensions/src/midnight-theme.json", + "extension": "theme" + }, + { + "name": "Solarized Dark Theme", + "url": "extensions/src/solarized-dark-theme.json", + "extension": "theme" + }, + { + "name": "Titanium Theme", + "url": "extensions/src/titanium-theme.json", + "extension": "theme" + }, + { + "name": "Dynamic Theme", + "url": "extensions/src/dynamic-theme.json", + "extension": "theme" + }, + { + "name": "No Distraction Theme", + "url": "extensions/src/no-distraction-theme.json", + "extension": "theme" + }, + { + "name": "Bold Editor", + "url": "extensions/src/bold-editor.json", + "extension": "editor" + }, + { + "name": "Code Editor", + "url": "extensions/src/code-editor.json", + "extension": "editor" + }, + { + "name": "Markdown Basic", + "url": "extensions/src/markdown-basic.json", + "extension": "editor" + }, + { + "name": "Markdown Pro", + "url": "extensions/src/markdown-pro.json", + "extension": "editor" + }, + { + "name": "Math Editor", + "url": "extensions/src/math-editor.json", + "extension": "editor" + }, + { + "name": "Minimal Markdown Editor", + "url": "extensions/src/minimal-markdown-editor.json", + "extension": "editor" + }, + { + "name": "Plus Editor", + "url": "extensions/src/plus-editor.json", + "extension": "editor" + }, + { + "name": "Secure Spreadsheet", + "url": "extensions/src/secure-spreadsheets.json", + "extension": "editor" + }, + { + "name": "Simple Task Editor", + "url": "extensions/src/simple-task-editor.json", + "extension": "editor" + }, + { + "name": "Token Vault", + "url": "extensions/src/token-vault.json", + "extension": "editor" + }, + { + "name": "Vim Editor", + "url": "extensions/src/vim-editor.json", + "extension": "editor" + }, + { + "name": "Action Bar", + "url": "extensions/src/action-bar.json", + "extension": "component" + }, + { + "name": "FileSafe Bar", + "url": "extensions/src/filesafe-bar.json", + "extension": "component" + }, + { + "name": "Folders Component", + "url": "extensions/src/folders-component.json", + "extension": "component" + }, + { + "name": "Github Push", + "url": "extensions/src/github-push.json", + "extension": "component" + }, + { + "name": "MFA Link", + "url": "extensions/src/mfa-link.json", + "extension": "component" + }, + { + "name": "Quick Tags", + "url": "extensions/src/quick-tags.json", + "extension": "component" + } +] diff --git a/sources/extra_files/app/public/extensions/js.js b/sources/extra_files/app/public/extensions/js.js new file mode 100644 index 0000000..1c0c15d --- /dev/null +++ b/sources/extra_files/app/public/extensions/js.js @@ -0,0 +1,23 @@ +loadJSON("extensions/index.json"); +function loadJSON(file){ + fetch(file) + .then(function (response) { + return response.json(); + }) + .then(function (data) { + appendData(data); + }) + .catch(function (err) { + console.log('error: ' + err); + }); +} +function appendData(data) { + for (var i = 0; i < data.length; i++) { + var mainContainer = document.getElementById(data[i].extension + "sData"); + var tr = document.createElement("tr"); + tr.innerHTML = + "" + data[i].name + "" + + "" + data[i].url + "" + mainContainer.appendChild(tr); + } +} diff --git a/sources/extra_files/app/public/extensions/src/action-bar.json b/sources/extra_files/app/public/extensions/src/action-bar.json new file mode 100644 index 0000000..e5e546b --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/action-bar.json @@ -0,0 +1,11 @@ +{ + "identifier": "org.stndardnotes.action-bar", + "name": "Action Bar", + "content_type": "SN|Component", + "area": "editor-stack", + "version": "1.3.1", + "description": "Useful utility bar with information about the current note as well as actions like duplicate, copy, and save.", + "url": "https://__DOMAIN__PATH__/extensions/src/action-bar/index.html", + "download_url": "https://github.com/standardnotes/action-bar/archive/1.3.1.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/comonents/action-bar.json" +} diff --git a/sources/extra_files/app/public/extensions/src/autobiography-theme.json b/sources/extra_files/app/public/extensions/src/autobiography-theme.json new file mode 100644 index 0000000..3a354a0 --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/autobiography-theme.json @@ -0,0 +1,17 @@ +{ + "identifier": "org.stndardnotes.autobiography-theme", + "name": "Autobiography Theme", + "content_type": "SN|Theme", + "area": "theme", + "version": "1.0.0", + "description": "Autobiography", + "url": "https://__DOMAIN__PATH__/extensions/src/autobiography-theme/dist/dist.css", + "download_url": "https://github.com/sn-extensions/autobiography-theme/archive/1.0.0.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/autobiography-theme.json", + "dock_icon":{ + "type":"circle", + "background_color":"#9D7441", + "foreground_color":"#ECE4DB", + "border_color":"#9D7441" + } +} diff --git a/sources/extra_files/app/public/extensions/src/bold-editor.json b/sources/extra_files/app/public/extensions/src/bold-editor.json new file mode 100644 index 0000000..f01d550 --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/bold-editor.json @@ -0,0 +1,11 @@ +{ + "identifier": "org.standardnotes.bold-editor", + "name": "Bold Editor", + "content_type": "SN|Component", + "area": "editor-editor", + "version": "1.1.0", + "description": "A simple and peaceful rich editor that helps you write and think clearly. Features FileSafe integration, so you can embed your images, videos, and audio recordings directly inline.", + "url": "https://__DOMAIN__PATH__/extensions/src/bold-editor/dist/index.html", + "download_url": "https://github.com/standardnotes/bold-editor/archive/1.1.0.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/bold-editor.json" +} diff --git a/sources/extra_files/app/public/extensions/src/code-editor.json b/sources/extra_files/app/public/extensions/src/code-editor.json new file mode 100644 index 0000000..e83473a --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/code-editor.json @@ -0,0 +1,11 @@ +{ + "identifier": "org.standardnotes.code-editor", + "name": "Code Editor", + "content_type": "SN|Component", + "area": "editor-editor", + "version": "1.3.5", + "description": "Syntax highlighting and convenient keyboard shortcuts for over 120 programming languages. Ideal for code snippets and procedures.", + "url": "https://__DOMAIN__PATH__/extensions/src/code-editor/index.html", + "download_url": "https://github.com/standardnotes/code-editor/archive/1.3.5.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/code-editor.json" +} diff --git a/sources/extra_files/app/public/extensions/src/dynamic-theme.json b/sources/extra_files/app/public/extensions/src/dynamic-theme.json new file mode 100644 index 0000000..df2ded1 --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/dynamic-theme.json @@ -0,0 +1,13 @@ +{ + "identifier": "org.standardnotes.dynamic-theme", + "name": "Dynamic Theme", + "content_type": "SN|Theme", + "area": "theme", + "version": "1.0.0", + "description": "A smart theme that minimizes the tags and notes panels when they are not in use..", + "url": "https://__DOMAIN__PATH__/extensions/src/dynamic-theme/dist/dist.css", + "download_url": "https://github.com/sn-extensions/dynamic-theme/archive/1.0.0.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/dynamic-theme.json", + "layerable":true, + "no_mobile":true +} diff --git a/sources/extra_files/app/public/extensions/src/filesafe-bar.json b/sources/extra_files/app/public/extensions/src/filesafe-bar.json new file mode 100644 index 0000000..de13d49 --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/filesafe-bar.json @@ -0,0 +1,11 @@ +{ + "identifier": "org.stndardnotes.filesafe-bar", + "name": "FileSafe Bar", + "content_type": "SN|Component", + "area": "editor-stack", + "version": "2.0.10", + "description": "FileSafe Bar", + "url": "https://__DOMAIN__PATH__/extensions/src/filesafe-bar/app/index.html", + "download_url": "https://github.com/standardnotes/filesafe-bar/archive/2.0.10.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/comonents/filesafe-bar.json" +} diff --git a/sources/extra_files/app/public/extensions/src/focus-theme.json b/sources/extra_files/app/public/extensions/src/focus-theme.json new file mode 100644 index 0000000..02fc461 --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/focus-theme.json @@ -0,0 +1,17 @@ +{ + "identifier": "org.stndardnotes.focus-theme", + "name": "Focus Theme", + "content_type": "SN|Theme", + "area": "theme", + "version": "1.2.3", + "description": "Light on the eyes, heavy on the spirit.", + "url": "https://__DOMAIN__PATH__/extensions/src/focus-theme/dist/dist.css", + "download_url": "https://github.com/sn-extensions/focus-theme/archive/1.2.3.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/focus-theme.json", + "dock_icon":{ + "type":"circle", + "background_color":"#a464c2", + "foreground_color":"#ffffff", + "border_color":"#a464c2" + } +} diff --git a/sources/extra_files/app/public/extensions/src/folders-component.json b/sources/extra_files/app/public/extensions/src/folders-component.json new file mode 100644 index 0000000..f1794d6 --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/folders-component.json @@ -0,0 +1,11 @@ +{ + "identifier": "org.stndardnotes.folders-component", + "name": "Folders", + "content_type": "SN|Component", + "area": "tags-list", + "version": "1.3.5", + "description": "Create nested folders from your tags with easy drag and drop. Folders also supports Smart Tags, which allow you to build custom filters for viewing your notes.", + "url": "https://__DOMAIN__PATH__/extensions/src/folders-component/index.html", + "download_url": "https://github.com/standardnotes/folders-component/archive/1.3.5.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/comonents/folders-component.json" +} diff --git a/sources/extra_files/app/public/extensions/src/futura-theme.json b/sources/extra_files/app/public/extensions/src/futura-theme.json new file mode 100644 index 0000000..b869315 --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/futura-theme.json @@ -0,0 +1,17 @@ +{ + "identifier": "org.standardnotes.futura-theme", + "name": "Futura Theme", + "content_type": "SN|Theme", + "area": "theme", + "version": "1.2.2", + "description": "Calm and relaxed. Take some time off.", + "url": "https://__DOMAIN__PATH__/extensions/src/futura-theme/dist/dist.css", + "download_url": "https://github.com/sn-extensions/futura-theme/archive/1.2.2.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/futura-theme.json", + "dock_icon":{ + "type":"circle", + "background_color":"#fca429", + "foreground_color":"#ffffff", + "border_color":"#fca429" + } +} diff --git a/sources/extra_files/app/public/extensions/src/github-push.json b/sources/extra_files/app/public/extensions/src/github-push.json new file mode 100644 index 0000000..aad5503 --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/github-push.json @@ -0,0 +1,11 @@ +{ + "identifier": "org.stndardnotes.github-push", + "name": "Github Push", + "content_type": "SN|Component", + "area": "editor-stack", + "version": "1.2.2", + "description": "Push note changes to a public or private GitHub repository, with options for file extension and commit message.", + "url": "https://__DOMAIN__PATH__/extensions/src/github-push/index.html", + "download_url": "https://github.com/sn-extensions/github-push/archive/1.2.2.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/comonents/github-push.json" +} diff --git a/sources/extra_files/app/public/extensions/src/markdown-basic.json b/sources/extra_files/app/public/extensions/src/markdown-basic.json new file mode 100644 index 0000000..caf9d95 --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/markdown-basic.json @@ -0,0 +1,11 @@ +{ + "identifier": "org.standardnotes.markdown-basic-editor", + "name": "Markdown Basic", + "content_type": "SN|Component", + "area": "editor-editor", + "version": "1.3.6", + "description": "A Markdown editor with dynamic split-pane preview.", + "url": "https://__DOMAIN__PATH__/extensions/src/markdown-basic/dist/index.html", + "download_url": "https://github.com/standardnotes/markdown-basic/archive/1.3.6.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/markdown-basic.json" +} diff --git a/sources/extra_files/app/public/extensions/src/markdown-pro.json b/sources/extra_files/app/public/extensions/src/markdown-pro.json new file mode 100644 index 0000000..494ba84 --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/markdown-pro.json @@ -0,0 +1,11 @@ +{ + "identifier": "org.standardnotes.markdown-pro", + "name": "Markdown Pro", + "content_type": "SN|Component", + "area": "editor-editor", + "version": "1.3.9", + "description": "A fully featured Markdown editor that supports live preview, a styling toolbar, and split pane support.", + "url": "https://__DOMAIN__PATH__/extensions/src/markdown-pro/index.html", + "download_url": "https://github.com/standardnotes/markdown-pro/archive/1.3.9.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/markdown-pro.json" +} diff --git a/sources/extra_files/app/public/extensions/src/math-editor.json b/sources/extra_files/app/public/extensions/src/math-editor.json new file mode 100644 index 0000000..cbc9884 --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/math-editor.json @@ -0,0 +1,11 @@ +{ + "identifier": "org.standardnotes.math-editor", + "name": "Math Editor", + "content_type": "SN|Component", + "area": "editor-editor", + "version": "1.3.4", + "description": "A beautiful split-pane Markdown editor with synced-scroll, LaTeX support, and colorful syntax.", + "url": "https://__DOMAIN__PATH__/extensions/src/math-editor/index.html", + "download_url": "https://github.com/sn-extensions/math-editor/archive/1.3.4.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/math-editor.json" +} diff --git a/sources/extra_files/app/public/extensions/src/mfa-link.json b/sources/extra_files/app/public/extensions/src/mfa-link.json new file mode 100644 index 0000000..ce62530 --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/mfa-link.json @@ -0,0 +1,11 @@ +{ + "identifier": "org.stndardnotes.mfa-link", + "name": "MFA-Link", + "content_type": "SN|Component", + "area": "editor-stack", + "version": "1.2.2", + "description": "Set up 2FA to enable an extra layer of security on your private notes account.", + "url": "https://__DOMAIN__PATH__/extensions/src/mfa-link/dist/index.html", + "download_url": "https://github.com/sn-extensions/mfa-link/archive/1.2.2.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/comonents/mfa-link.json" +} diff --git a/sources/extra_files/app/public/extensions/src/midnight-theme.json b/sources/extra_files/app/public/extensions/src/midnight-theme.json new file mode 100644 index 0000000..15dcac1 --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/midnight-theme.json @@ -0,0 +1,17 @@ +{ + "identifier": "org.standardnotes.midnight-theme", + "name": "Midnight Theme", + "content_type": "SN|Theme", + "area": "theme", + "version": "1.2.1", + "description": "Elegant utilitarianism.", + "url": "https://__DOMAIN__PATH__/extensions/src/midnight-theme/dist/dist.css", + "download_url": "https://github.com/sn-extensions/midnight-theme/archive/1.2.1.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/midnight-theme.json", + "dock_icon":{ + "type":"circle", + "background_color":"#086DD6", + "foreground_color":"#ffffff", + "border_color":"#086DD6" + } +} diff --git a/sources/extra_files/app/public/extensions/src/minimal-markdown-editor.json b/sources/extra_files/app/public/extensions/src/minimal-markdown-editor.json new file mode 100644 index 0000000..9f6be92 --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/minimal-markdown-editor.json @@ -0,0 +1,11 @@ +{ + "identifier": "org.stndardnotes.minimal-markdown-editor", + "name": "Minimal Markdown Editor", + "content_type": "SN|Component", + "area": "editor-editor", + "version": "1.3.5", + "description": "A minimal Markdown editor with inline style support.", + "url": "https://__DOMAIN__PATH__/extensions/src/minimal-markdown-editor/index.html", + "download_url": "https://github.com/sn-extensions/minimal-markdown-editor/archive/1.3.5.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/minimal-markdown-editor.json" +} diff --git a/sources/extra_files/app/public/extensions/src/no-distraction-theme.json b/sources/extra_files/app/public/extensions/src/no-distraction-theme.json new file mode 100644 index 0000000..3955ba4 --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/no-distraction-theme.json @@ -0,0 +1,17 @@ +{ + "identifier": "org.standardnotes.no-distraction", + "name": "No Distraction Theme", + "content_type": "SN|Theme", + "area": "theme", + "version": "1.2.2", + "description": "A distraction-free writing environment for high levels of clarity and focus.", + "url": "https://__DOMAIN__PATH__/extensions/src/no-distraction-theme/dist/dist.css", + "download_url": "https://github.com/sn-extensions/no-distraction-theme/archive/1.2.2.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/no-distraction-theme.json", + "layerable":true, + "no_mobile":true, + "dock_icon":{ + "type":"svg", + "source":"" + } +} diff --git a/sources/extra_files/app/public/extensions/src/plus-editor.json b/sources/extra_files/app/public/extensions/src/plus-editor.json new file mode 100644 index 0000000..d1f387c --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/plus-editor.json @@ -0,0 +1,11 @@ +{ + "identifier": "org.standardnotes.plus-editor", + "name": "Plus Editor", + "content_type": "SN|Component", + "area": "editor-editor", + "version": "1.4.3", + "description": "From highlighting to custom font sizes and colors, to tables and lists, this editor is perfect for crafting any document. (Converts your note to an HTML format.)", + "url": "https://__DOMAIN__PATH__/extensions/src/plus-editor/index.html", + "download_url": "https://github.com/standardnotes/plus-editor/archive/1.4.3.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/plus-editor.json" +} diff --git a/sources/extra_files/app/public/extensions/src/quick-tags.json b/sources/extra_files/app/public/extensions/src/quick-tags.json new file mode 100644 index 0000000..9b4b71d --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/quick-tags.json @@ -0,0 +1,11 @@ +{ + "identifier": "org.stndardnotes.quick-tags", + "name": "Quick Tags", + "content_type": "SN|Component", + "area": "note-tags", + "version": "1.3.2", + "description": "Work more efficiently by quickly selecting from a live list of tags while you type. Supports keyboard shortcuts and folders.", + "url": "https://__DOMAIN__PATH__/extensions/src/quick-tags/index.html", + "download_url": "https://github.com/standardnotes/quick-tags/archive/1.3.2.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/comonents/quick-tags.json", + diff --git a/sources/extra_files/app/public/extensions/src/secure-spreadsheets.json b/sources/extra_files/app/public/extensions/src/secure-spreadsheets.json new file mode 100644 index 0000000..2f3b70f --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/secure-spreadsheets.json @@ -0,0 +1,11 @@ +{ + "identifier": "org.standardnotes.secure-spreadsheets", + "name": "Secure Spreadsheets", + "content_type": "SN|Component", + "area": "editor-editor", + "version": "1.3.6", + "description": "A powerful spreadsheet editor with formatting and formula support. Ideal for personal budgeting and finance worksheets.", + "url": "https://__DOMAIN__PATH__/extensions/src/secure-spreadsheets/dist/index.html", + "download_url": "https://github.com/standardnotes/secure-spreadsheets/archive/1.3.6.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/secure-spreadsheets.json" +} diff --git a/sources/extra_files/app/public/extensions/src/simple-task-editor.json b/sources/extra_files/app/public/extensions/src/simple-task-editor.json new file mode 100644 index 0000000..5bd31b6 --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/simple-task-editor.json @@ -0,0 +1,11 @@ +{ + "identifier": "org.standardnotes.simple-task-editor", + "name": "Task Editor", + "content_type": "SN|Component", + "area": "editor-editor", + "version": "1.3.5", + "description": "A great way to manage short-term and long-term to-do's. You can mark simple-tasks as completed, change their order, and edit the text naturally in place.", + "url": "https://__DOMAIN__PATH__/extensions/src/simple-task-editor/dist/index.html", + "download_url": "https://github.com/sn-extensions/simple-task-editor/archive/1.3.5.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/simple-task-editor.json" +} diff --git a/sources/extra_files/app/public/extensions/src/solarized-dark-theme.json b/sources/extra_files/app/public/extensions/src/solarized-dark-theme.json new file mode 100644 index 0000000..9ba6f55 --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/solarized-dark-theme.json @@ -0,0 +1,17 @@ +{ + "identifier": "org.stndardnotes.solarized-dark-theme", + "name": "Solarized Dark Theme", + "content_type": "SN|Theme", + "area": "theme", + "version": "1.2.1", + "description": "The perfect theme for any time.", + "url": "https://__DOMAIN__PATH__/extensions/src/solarized-dark-theme/dist/dist.css", + "download_url": "https://github.com/sn-extensions/solarized-dark-theme/archive/1.2.1.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/solarized-dark-theme.json", + "dock_icon":{ + "type":"circle", + "background_color":"#2AA198", + "foreground_color":"#ffffff", + "border_color":"#2AA198" + } +} diff --git a/sources/extra_files/app/public/extensions/src/titanium-theme.json b/sources/extra_files/app/public/extensions/src/titanium-theme.json new file mode 100644 index 0000000..0b20079 --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/titanium-theme.json @@ -0,0 +1,17 @@ +{ + "identifier": "org.stndardnotes.titanium-theme", + "name": "Titanium Theme", + "content_type": "SN|Theme", + "area": "theme", + "version": "1.2.2", + "description": "Light on the eyes, heavy on the spirit.", + "url": "https://__DOMAIN__PATH__/extensions/src/titanium-theme/dist/dist.css", + "download_url": "https://github.com/sn-extensions/titanium-theme/archive/1.2.2.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/titanium-theme.json", + "dock_icon":{ + "type":"circle", + "background_color":"#6e2b9e", + "foreground_color":"#ffffff", + "border_color":"#6e2b9e" + } +} diff --git a/sources/extra_files/app/public/extensions/src/token-vault.json b/sources/extra_files/app/public/extensions/src/token-vault.json new file mode 100644 index 0000000..b119f61 --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/token-vault.json @@ -0,0 +1,11 @@ +{ + "identifier": "org.stndardnotes.token-vault", + "name": "Token Vault", + "content_type": "SN|Component", + "area": "editor-editor", + "version": "1.0.5", + "description": "Use Standard Notes on both desktop and mobile as your authenticator app. TokenVault handles your 2FA secrets so that you never lose them again, or have to start over when you get a new device.", + "url": "https://__DOMAIN__PATH__/extensions/src/token-vault/dist/index.html", + "download_url": "https://github.com/sn-extensions/token-vault/archive/1.0.5.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/token-vault.json" +} diff --git a/sources/extra_files/app/public/extensions/src/vim-editor.json b/sources/extra_files/app/public/extensions/src/vim-editor.json new file mode 100644 index 0000000..0c1db7a --- /dev/null +++ b/sources/extra_files/app/public/extensions/src/vim-editor.json @@ -0,0 +1,11 @@ +{ + "identifier": "org.stndardnotes.vim-editor", + "name": "Vim Editor", + "content_type": "SN|Component", + "area": "editor-editor", + "version": "1.3.2", + "description": "A code editor with Vim key bindings.", + "url": "https://__DOMAIN__PATH__/extensions/src/vim-editor/index.html", + "download_url": "https://github.com/sn-extensions/vim-editor/archive/1.3.2.zip", + "latest_url": "https://__DOMAIN__PATH__/extensions/src/vim-editor.json" +} From 872e7574afb268c5165d090440dd7a4160da8c78 Mon Sep 17 00:00:00 2001 From: Fabian Wilkens Date: Mon, 11 Jan 2021 22:33:16 +0100 Subject: [PATCH 03/41] Cleanup --- conf/nginx.conf | 4 +- scripts/install | 2 +- .../extra_files/app/public/extensions/css.css | 2 +- .../app/public/extensions/index.html | 60 ++++++++++--------- .../extra_files/app/public/extensions/js.js | 36 +++++------ 5 files changed, 53 insertions(+), 51 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 52ec158..6f55e7c 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,6 +1,6 @@ location = /favicon.ico { - alias /opt/yunohost/snserver/live/public/favicon/favicon.ico; - expires 30d; + alias /opt/yunohost/snserver/live/public/favicon/favicon.ico; + expires 30d; } location __PATH__/ { diff --git a/scripts/install b/scripts/install index 04e204a..61cb3d3 100755 --- a/scripts/install +++ b/scripts/install @@ -180,7 +180,7 @@ then find "../conf/" -name "ext_*.src" -print0 | while read -d $'\0' file do - basename=$(basename -as .src $file) + basename=$(basename -as .src $file) ynh_setup_source --dest_dir="$final_path/live/public/extensions/src/${basename#'ext_'}" --source_id="$basename" done fi diff --git a/sources/extra_files/app/public/extensions/css.css b/sources/extra_files/app/public/extensions/css.css index 0fbb992..83fa02f 100644 --- a/sources/extra_files/app/public/extensions/css.css +++ b/sources/extra_files/app/public/extensions/css.css @@ -1,5 +1,5 @@ body { - padding-left: 50px; + padding-left: 50px; } td { border: 1px solid #999; diff --git a/sources/extra_files/app/public/extensions/index.html b/sources/extra_files/app/public/extensions/index.html index 867b07d..3347a3e 100644 --- a/sources/extra_files/app/public/extensions/index.html +++ b/sources/extra_files/app/public/extensions/index.html @@ -1,36 +1,38 @@ - StandardNotes Extensions - - + StandardNotes Extensions + + - -
-

Themes

-
-
-

Editors

-
-
-

Components

-
- + +
+

Themes

+
+
+

Editors

+
+
+

Components

+
diff --git a/sources/extra_files/app/public/extensions/js.js b/sources/extra_files/app/public/extensions/js.js index 1c0c15d..be68e46 100644 --- a/sources/extra_files/app/public/extensions/js.js +++ b/sources/extra_files/app/public/extensions/js.js @@ -1,23 +1,23 @@ loadJSON("extensions/index.json"); function loadJSON(file){ - fetch(file) - .then(function (response) { - return response.json(); - }) - .then(function (data) { - appendData(data); - }) - .catch(function (err) { - console.log('error: ' + err); - }); + fetch(file) + .then(function (response) { + return response.json(); + }) + .then(function (data) { + appendData(data); + }) + .catch(function (err) { + console.log('error: ' + err); + }); } function appendData(data) { - for (var i = 0; i < data.length; i++) { - var mainContainer = document.getElementById(data[i].extension + "sData"); - var tr = document.createElement("tr"); - tr.innerHTML = - "" + data[i].name + "" + - "" + data[i].url + "" - mainContainer.appendChild(tr); - } + for (var i = 0; i < data.length; i++) { + var mainContainer = document.getElementById(data[i].extension + "sData"); + var tr = document.createElement("tr"); + tr.innerHTML = + "" + data[i].name + "" + + "" + data[i].url + "" + mainContainer.appendChild(tr); + } } From dc7dfe69a94074daca3e0d54e01de3330767daad Mon Sep 17 00:00:00 2001 From: Fabian Wilkens Date: Thu, 14 Jan 2021 20:32:33 +0100 Subject: [PATCH 04/41] Update scripts - Install extensions --- conf/env.sample | 4 +++- scripts/change_url | 24 +++++++++++++++++++++++- scripts/install | 6 +++--- scripts/upgrade | 24 +++++++++++++++++++++--- 4 files changed, 50 insertions(+), 8 deletions(-) diff --git a/conf/env.sample b/conf/env.sample index 593faf8..c1fb654 100644 --- a/conf/env.sample +++ b/conf/env.sample @@ -62,5 +62,7 @@ REVISIONS_FREQUENCY=300 # Sub-URI RAILS_RELATIVE_URL_ROOT=/ -# Enable public file server +# Public file server +# Empty is disabled +# Any value is enabled RAILS_SERVE_STATIC_FILES= diff --git a/scripts/change_url b/scripts/change_url index 515f083..29023a0 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -29,6 +29,8 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) port=$(ynh_app_setting_get --app=$app --key=port) +install_extensions=$(ynh_app_setting_get --app=$app --key=install_extensions) +access_domain=$(ynh_app_setting_get --app=$app --key=access_domain) # Add settings here as needed by your application #db_name=$(ynh_app_setting_get --app=$app --key=db_name) @@ -93,7 +95,7 @@ then domain="$old_domain" path_url="$new_path" # Create a dedicated nginx config - ynh_add_nginx_config "port" + ynh_add_nginx_config "port access_domain" fi # Change the domain for nginx @@ -114,6 +116,26 @@ ynh_script_progression --message="Modifying a config file..." --weight=1 config_file="$final_path/live/.env" ynh_replace_string --match_string="RAILS_RELATIVE_URL_ROOT=$old_path" --replace_string="RAILS_RELATIVE_URL_ROOT=$new_path" --target_file="$config_file" +#================================================= +# Modify Standard Notes - Extensions +#================================================= +if [ $install_extensions ] +then + ynh_script_progression --message="Modify Standard Notes - Extensions..." --weight=1 + + if [ $new_path = "/" ] + then + path="" + else + path=$new_path + fi + + find "$final_path/live/public/extensions/src/" -name "*.json" -print0 | while read -d $'\0' file + do + ynh_replace_string --match_string='"url": "https://.*/extensions/src/' --replace_string='"url": "https://$domain$path/extensions/src/' --target_file="$file" + done +fi + #================================================= # SETUP FAIL2BAN #================================================= diff --git a/scripts/install b/scripts/install index 61cb3d3..f5c91a9 100755 --- a/scripts/install +++ b/scripts/install @@ -164,15 +164,15 @@ if [ $install_extensions ] then ynh_script_progression --message="Installing Standard Notes - Extensions..." --weight=1 - ynh_replace_string --match_string="RAILS_SERVE_STATIC_FILES=" --replace_string="RAILS_SERVE_STATIC_FILES=true" --target_file="$config_file" - + ynh_replace_string --match_string="^RAILS_SERVE_STATIC_FILES=.*$" --replace_string="RAILS_SERVE_STATIC_FILES=true" --target_file="$config_file" + if [ $path_url = "/" ] then path="" else path=$path_url fi - + find "$final_path/live/public/extensions/src/" -name "*.json" -print0 | while read -d $'\0' file do ynh_replace_string --match_string="__DOMAIN__PATH__" --replace_string="$domain$path" --target_file="$file" diff --git a/scripts/upgrade b/scripts/upgrade index 3c303fb..7a7cdc3 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -180,7 +180,7 @@ then exec_as "$app" env PATH=$PATH /opt/rbenv/versions/$RUBY_VERSION/bin/bundle config set with 'development' exec_as "$app" env PATH=$PATH /opt/rbenv/versions/$RUBY_VERSION/bin/bundle install exec_as "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails db:create db:migrate --quiet - exec_as "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails assets:precompile --quiet +# exec_as "$app" env PATH=$PATH RAILS_ENV=production /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails assets:precompile --quiet popd fi @@ -189,9 +189,27 @@ fi #================================================= if [ $install_extensions ] then - ynh_script_progression --message="Installing Standard Notes - Extensions..." --weight=1 + ynh_script_progression --message="Reinstalling Standard Notes - Extensions..." --weight=1 - ynh_replace_string --match_string="RAILS_SERVE_STATIC_FILES=false" --replace_string="RAILS_SERVE_STATIC_FILES=true" --target_file="$config_file" + ynh_replace_string --match_string="^RAILS_SERVE_STATIC_FILES=.*$" --replace_string="RAILS_SERVE_STATIC_FILES=true" --target_file="$config_file" + + if [ $path_url = "/" ] + then + path="" + else + path=$path_url + fi + + find "$final_path/live/public/extensions/src/" -name "*.json" -print0 | while read -d $'\0' file + do + ynh_replace_string --match_string="__DOMAIN__PATH__" --replace_string="$domain$path" --target_file="$file" + done + + find "../conf/" -name "ext_*.src" -print0 | while read -d $'\0' file + do + basename=$(basename -as .src $file) + ynh_setup_source --dest_dir="$final_path/live/public/extensions/src/${basename#'ext_'}" --source_id="$basename" + done fi #================================================= From 661a6df2129ae3d9c730872ef290148e651ec878 Mon Sep 17 00:00:00 2001 From: Fabian Wilkens Date: Fri, 15 Jan 2021 19:58:23 +0100 Subject: [PATCH 05/41] Update scripts - Install extensions --- check_process | 2 + conf/message | 4 ++ conf/nginx.conf | 7 +-- scripts/_common.sh | 139 +++++++++++++++++++++++++++++++++++++++++++++ scripts/change_url | 25 ++++++++ scripts/install | 28 +++++++++ scripts/restore | 1 + scripts/upgrade | 28 +++++++++ 8 files changed, 228 insertions(+), 6 deletions(-) create mode 100644 conf/message diff --git a/check_process b/check_process index dbcb8a3..c8dd4a8 100644 --- a/check_process +++ b/check_process @@ -8,6 +8,8 @@ domain="domain.tld" (DOMAIN) path="/path" (PATH) is_public=1 (PUBLIC|public=1|private=0) + install_extensions=1 + access_domain="/" ; Checks pkg_linter=1 setup_sub_dir=1 diff --git a/conf/message b/conf/message new file mode 100644 index 0000000..8b5460d --- /dev/null +++ b/conf/message @@ -0,0 +1,4 @@ +Standard Notes - syncing server was successfully __TYPE__. +Please configure the Standard Notes web app or mobile app to use this syninc server: https://__DOMAIN____PATH_URL__/ +__CONFIG_PANEL__ +__EXTENSIONS__ diff --git a/conf/nginx.conf b/conf/nginx.conf index 6f55e7c..6419998 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,8 +1,3 @@ -location = /favicon.ico { - alias /opt/yunohost/snserver/live/public/favicon/favicon.ico; - expires 30d; -} - location __PATH__/ { alias __FINALPATH__/live/public ; @@ -18,5 +13,5 @@ location __PATH__/ { proxy_set_header X-Forwarded-Proto $scheme; proxy_buffering off; - more_set_headers "X-Frame-Options" : "allow-from __ACCESS_DOMAIN__"; + more_set_headers "X-Frame-Options: allow-from __ACCESS_DOMAIN__"; } diff --git a/scripts/_common.sh b/scripts/_common.sh index 02ec33c..dc6d9da 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -43,6 +43,145 @@ exec_as() { # EXPERIMENTAL HELPERS #================================================= +# Send an email to inform the administrator +# +# usage: ynh_send_readme_to_admin --app_message=app_message [--recipients=recipients] [--type=type] +# | arg: -m --app_message= - The file with the content to send to the administrator. +# | arg: -r, --recipients= - The recipients of this email. Use spaces to separate multiples recipients. - default: root +# example: "root admin@domain" +# If you give the name of a YunoHost user, ynh_send_readme_to_admin will find its email adress for you +# example: "root admin@domain user1 user2" +# | arg: -t, --type= - Type of mail, could be 'backup', 'change_url', 'install', 'remove', 'restore', 'upgrade' +ynh_send_readme_to_admin() { + # Declare an array to define the options of this helper. + declare -Ar args_array=( [m]=app_message= [r]=recipients= [t]=type= ) + local app_message + local recipients + local type + # Manage arguments with getopts + + ynh_handle_getopts_args "$@" + app_message="${app_message:-}" + recipients="${recipients:-root}" + type="${type:-install}" + + # Get the value of admin_mail_html + admin_mail_html=$(ynh_app_setting_get $app admin_mail_html) + admin_mail_html="${admin_mail_html:-0}" + + # Retrieve the email of users + find_mails () { + local list_mails="$1" + local mail + local recipients=" " + # Read each mail in argument + for mail in $list_mails + do + # Keep root or a real email address as it is + if [ "$mail" = "root" ] || echo "$mail" | grep --quiet "@" + then + recipients="$recipients $mail" + else + # But replace an user name without a domain after by its email + if mail=$(ynh_user_get_info "$mail" "mail" 2> /dev/null) + then + recipients="$recipients $mail" + fi + fi + done + echo "$recipients" + } + recipients=$(find_mails "$recipients") + + # Subject base + local mail_subject="☁️🆈🅽🅷☁️: \`$app\`" + + # Adapt the subject according to the type of mail required. + if [ "$type" = "backup" ]; then + mail_subject="$mail_subject has just been backup." + elif [ "$type" = "change_url" ]; then + mail_subject="$mail_subject has just been moved to a new URL!" + elif [ "$type" = "remove" ]; then + mail_subject="$mail_subject has just been removed!" + elif [ "$type" = "restore" ]; then + mail_subject="$mail_subject has just been restored!" + elif [ "$type" = "upgrade" ]; then + mail_subject="$mail_subject has just been upgraded!" + else # install + mail_subject="$mail_subject has just been installed!" + fi + + local mail_message="This is an automated message from your beloved YunoHost server. + +Specific information for the application $app. + +$(if [ -n "$app_message" ] +then + cat "$app_message" +else + echo "...No specific information..." +fi) + +--- +Automatic diagnosis data from YunoHost + +__PRE_TAG1__$(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')__PRE_TAG2__" + + # Store the message into a file for further modifications. + echo "$mail_message" > mail_to_send + + # If a html email is required. Apply html tags to the message. + if [ "$admin_mail_html" -eq 1 ] + then + # Insert 'br' tags at each ending of lines. + ynh_replace_string "$" "
" mail_to_send + + # Insert starting HTML tags + sed --in-place '1s@^@\n\n\n\n@' mail_to_send + + # Keep tabulations + ynh_replace_string " " "\ \ " mail_to_send + ynh_replace_string "\t" "\ \ " mail_to_send + + # Insert url links tags + ynh_replace_string "__URL_TAG1__\(.*\)__URL_TAG2__\(.*\)__URL_TAG3__" "\1" mail_to_send + + # Insert pre tags + ynh_replace_string "__PRE_TAG1__" "
" mail_to_send
+		ynh_replace_string "__PRE_TAG2__" "<\pre>" mail_to_send
+
+		# Insert finishing HTML tags
+		echo -e "\n\n" >> mail_to_send
+
+	# Otherwise, remove tags to keep a plain text.
+	else
+		# Remove URL tags
+		ynh_replace_string "__URL_TAG[1,3]__" "" mail_to_send
+		ynh_replace_string "__URL_TAG2__" ": " mail_to_send
+
+		# Remove PRE tags
+		ynh_replace_string "__PRE_TAG[1-2]__" "" mail_to_send
+	fi
+
+	# Define binary to use for mail command
+	if [ -e /usr/bin/bsd-mailx ]
+	then
+		local mail_bin=/usr/bin/bsd-mailx
+	else
+		local mail_bin=/usr/bin/mail.mailutils
+	fi
+
+	if [ "$admin_mail_html" -eq 1 ]
+	then
+		content_type="text/html"
+	else
+		content_type="text/plain"
+	fi
+
+	# Send the email to the recipients
+	cat mail_to_send | $mail_bin -a "Content-Type: $content_type; charset=UTF-8" -s "$mail_subject" "$recipients"
+}
+
 #=================================================
 # FUTURE OFFICIAL HELPERS
 #=================================================
diff --git a/scripts/change_url b/scripts/change_url
index 29023a0..8aefeb4 100644
--- a/scripts/change_url
+++ b/scripts/change_url
@@ -167,6 +167,31 @@ ynh_script_progression --message="Reloading nginx web server..." --weight=1
 
 ynh_systemd_action --service_name=nginx --action=reload
 
+#=================================================
+# SEND A README FOR THE ADMIN
+#=================================================
+ynh_script_progression --message="Sending a readme for the admin..."
+
+admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app"
+
+message_extensions="To install extensions open this page: https://$domain$path_url/extensions/\
+You changed the url of the syncing server. All extensions installed from here must be reinstalled by the users."
+config_panel="You can configure this app by using the experimental __URL_TAG1__config-panel feature__URL_TAG2__$admin_panel/config-panel__URL_TAG3__"
+
+ynh_replace_string --match_string="__TYPE__" --replace_string="changed the url" --target_file="../conf/message"
+ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/message"
+ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="../conf/message"
+
+if [ $install_extensions ]
+then
+    ynh_replace_string --match_string="__EXTENSIONS__" --replace_string="$message_extensions" --target_file="../conf/message"
+else
+    ynh_replace_string --match_string="__EXTENSIONS__" --replace_string="" --target_file="../conf/message"
+fi
+ynh_replace_string --match_string="__CONFIG_PANEL__" --replace_string="$config_panel" --target_file="../conf/message"
+
+ynh_send_readme_to_admin --app_message="../conf/message" --type='upgrade'
+
 #=================================================
 # END OF SCRIPT
 #=================================================
diff --git a/scripts/install b/scripts/install
index f5c91a9..1060cb2 100755
--- a/scripts/install
+++ b/scripts/install
@@ -279,6 +279,34 @@ ynh_script_progression --message="Reloading nginx web server..."  --weight=1
 
 ynh_systemd_action --service_name=nginx --action=reload
 
+#=================================================
+# SEND A README FOR THE ADMIN
+#=================================================
+ynh_script_progression --message="Sending a readme for the admin..."
+
+message_extensions="To install extensions open this page: https://$domain$path_url/extensions/\
+If you want to change the url of the syncing server all extensions from here have to be reinstalled be the users."
+message_no_extensions="You have no extensions installed.\
+You can configure this app by using the config-panel"
+
+admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app"
+config_panel="You can configure this app by using the experimental __URL_TAG1__config-panel feature__URL_TAG2__$admin_panel/config-panel__URL_TAG3__"
+
+ynh_replace_string --match_string="__TYPE__" --replace_string="installed" --target_file="../conf/message"
+ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/message"
+ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="../conf/message"
+
+if [ $install_extensions ]
+then
+    ynh_replace_string --match_string="__EXTENSIONS__" --replace_string="$message_extensions" --target_file="../conf/message"
+else
+    ynh_replace_string --match_string="__EXTENSIONS__" --replace_string="$message_no_extensions" --target_file="../conf/message"
+fi
+ynh_replace_string --match_string="__CONFIG_PANEL__" --replace_string="$config_panel" --target_file="../conf/message"
+
+ynh_send_readme_to_admin --app_message="../conf/message" --type='install'
+
+echo ../conf/message
 #=================================================
 # END OF SCRIPT
 #=================================================
diff --git a/scripts/restore b/scripts/restore
index 62997c3..b5fe754 100755
--- a/scripts/restore
+++ b/scripts/restore
@@ -35,6 +35,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
 db_name=$(ynh_app_setting_get --app=$app --key=db_name)
 db_user=$db_name
 db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
+install_extensions=$(ynh_app_setting_get --app=$app --key=install_extensions)
 
 #=================================================
 # CHECK IF THE APP CAN BE RESTORED
diff --git a/scripts/upgrade b/scripts/upgrade
index 7a7cdc3..1ba1cf7 100755
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -25,6 +25,7 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
 db_user=$db_name
 db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
 port=$(ynh_app_setting_get --app=$app --key=port)
+install_extensions=(ynh_app_setting_get --app=$app --key=install_extensions)
 access_domain=(ynh_app_setting_get --app=$app --key=access_domain)
 
 #=================================================
@@ -305,6 +306,33 @@ ynh_script_progression --message="Reloading nginx web server..." --weight=1
 
 ynh_systemd_action --service_name=nginx --action=reload
 
+#=================================================
+# SEND A README FOR THE ADMIN
+#=================================================
+ynh_script_progression --message="Sending a readme for the admin..."
+
+message_extensions="To install extensions open this page: https://$domain$path_url/extensions/\
+If you want to change the url of the syncing server all extensions from here have to be reinstalled be the users."
+message_no_extensions="You have no extensions installed.\
+You can configure this app by using the config-panel"
+
+admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app"
+config_panel="You can configure this app by using the experimental __URL_TAG1__config-panel feature__URL_TAG2__$admin_panel/config-panel__URL_TAG3__"
+
+ynh_replace_string --match_string="__TYPE__" --replace_string="installed" --target_file="../conf/message"
+ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/message"
+ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="../conf/message"
+
+if [ $install_extensions ]
+then
+    ynh_replace_string --match_string="__EXTENSIONS__" --replace_string="$message_extensions" --target_file="../conf/message"
+else
+    ynh_replace_string --match_string="__EXTENSIONS__" --replace_string="$message_no_extensions" --target_file="../conf/message"
+fi
+ynh_replace_string --match_string="__CONFIG_PANEL__" --replace_string="$config_panel" --target_file="../conf/message"
+
+ynh_send_readme_to_admin --app_message="../conf/message" --type='upgrade'
+
 #=================================================
 # END OF SCRIPT
 #=================================================

From d7857aa4125c96cc7f0f8bf5d99ba18c86be523b Mon Sep 17 00:00:00 2001
From: Fabian Wilkens 
Date: Sat, 16 Jan 2021 23:04:32 +0100
Subject: [PATCH 06/41] Add app actions

---
 actions.toml                       | 10 ++++
 check_process                      |  8 +--
 conf/message                       |  4 +-
 manifest.json                      |  2 +-
 scripts/actions/install_extensions | 94 ++++++++++++++++++++++++++++++
 scripts/actions/remove_extensions  | 90 ++++++++++++++++++++++++++++
 scripts/change_url                 | 16 ++---
 scripts/install                    | 13 ++---
 scripts/upgrade                    | 18 +++---
 9 files changed, 224 insertions(+), 31 deletions(-)
 create mode 100644 actions.toml
 create mode 100644 scripts/actions/install_extensions
 create mode 100644 scripts/actions/remove_extensions

diff --git a/actions.toml b/actions.toml
new file mode 100644
index 0000000..0cc4fec
--- /dev/null
+++ b/actions.toml
@@ -0,0 +1,10 @@
+[install_extensions]
+name = "Install Extensions"
+description = "Intall Standard Notes - Extensions"
+command = "/bin/bash actions/install_extensions"
+cwd = "/etc/yunohost/apps/$app/scripts"
+
+[remove_extensions]
+name = "Remove Extensions"
+description = "Remove Standard Notes - Extensions"
+command = "/bin/bash scripts/actions/remove_extensions"
diff --git a/check_process b/check_process
index c8dd4a8..12e1e89 100644
--- a/check_process
+++ b/check_process
@@ -5,9 +5,9 @@
 
 ;; Test complet
     ; Manifest
-        domain="domain.tld"	(DOMAIN)
-        path="/path"	(PATH)
-        is_public=1	(PUBLIC|public=1|private=0)
+        domain="domain.tld"    (DOMAIN)
+        path="/path"    (PATH)
+        is_public=1    (PUBLIC|public=1|private=0)
         install_extensions=1
         access_domain="/"
     ; Checks
@@ -19,7 +19,7 @@
         setup_public=1
         upgrade=1
         # 3.13.6~ynh1
-        upgrade=1	from_commit=7474baadc1705ffe5981a52bdced16bdd1edf979
+        upgrade=1    from_commit=7474baadc1705ffe5981a52bdced16bdd1edf979
         backup_restore=1
         multi_instance=1
         # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version.
diff --git a/conf/message b/conf/message
index 8b5460d..d8a5625 100644
--- a/conf/message
+++ b/conf/message
@@ -1,4 +1,4 @@
-Standard Notes - syncing server was successfully __TYPE__.
+Standard Notes - Syncing Server was successfully __TYPE__.
 Please configure the Standard Notes web app or mobile app to use this syninc server: https://__DOMAIN____PATH_URL__/
-__CONFIG_PANEL__
+__ACTION__
 __EXTENSIONS__
diff --git a/manifest.json b/manifest.json
index ef4c8c5..0317793 100644
--- a/manifest.json
+++ b/manifest.json
@@ -74,7 +74,7 @@
                 "ask": {
                     "en": "Choose a domain which has access to the extensions. E.g. the Standard-Notes web app."
                 },
-				"optional": true,
+                "optional": true,
                 "example": "example.tld",
                 "default": ""
             }
diff --git a/scripts/actions/install_extensions b/scripts/actions/install_extensions
new file mode 100644
index 0000000..b512451
--- /dev/null
+++ b/scripts/actions/install_extensions
@@ -0,0 +1,94 @@
+#!/bin/bash
+
+#=================================================
+# GENERIC STARTING
+#=================================================
+# IMPORT GENERIC HELPERS
+#=================================================
+
+source /usr/share/yunohost/helpers
+
+#=================================================
+# MANAGE SCRIPT FAILURE
+#=================================================
+
+# Exit if an error occurs during the execution of the script
+ynh_abort_if_errors
+
+#=================================================
+# RETRIEVE ARGUMENTS
+#=================================================
+
+app=$YNH_APP_INSTANCE_NAME
+path_url=$(ynh_app_setting_get --app=$app --key=path)
+domain=$(ynh_app_setting_get --app=$app --key=domain)
+
+#=================================================
+# CHECK IF ARGUMENTS ARE CORRECT
+#=================================================
+
+final_path=/opt/yunohost/$app
+config_file="$final_path/live/.env"
+
+if [[ ! -f $config_file || \
+      ! -d "$final_path/live/public/extensions/" || \
+      ! -d "$final_path/live/public/extensions/src/" ]]
+then
+    ynh_die --message="Standard Notes - Extensions can not be installed." --ret_code=1
+fi
+
+#=================================================
+# CHECK IF AN ACTION HAS TO BE DONE
+#=================================================
+
+install_extensions_old=$(ynh_app_setting_get --app=$app --key=install_extensions)
+
+if [ $install_extensions_old -eq 1 ]
+then
+    ynh_die --message="Standard Notes - Extensions should alredy be installed." --ret_code=0
+fi
+
+#=================================================
+# SPECIFIC ACTION
+#=================================================
+# MOVE TO PUBLIC OR PRIVATE
+#=================================================
+
+ynh_script_progression --message="Installing Standard Notes - Extensions ..." --weight=5
+
+ynh_replace_string --match_string="^RAILS_SERVE_STATIC_FILES=.*$" --replace_string="RAILS_SERVE_STATIC_FILES=true" --target_file="$config_file"
+
+if [ "$path_url" = "/" ]
+then
+    path=""
+else
+    path=$path_url
+fi
+
+find "$final_path/live/public/extensions/src/" -name "*.json" -print0 | while read -d $'\0' file
+do
+    ynh_replace_string --match_string="__DOMAIN__PATH__" --replace_string="$domain$path" --target_file="$file"
+done
+
+find "../conf/" -name "ext_*.src" -print0 | while read -d $'\0' file
+do
+    basename=$(basename -as .src $file)
+    ynh_setup_source  --dest_dir="$final_path/live/public/extensions/src/${basename#'ext_'}" --source_id="$basename"
+    ynh_secure_remove --file="$basename.zip"
+done
+
+# Update the config of the app
+ynh_app_setting_set --app=$app --key=install_extensions --value="1"
+
+#=================================================
+# RESTART Systemd
+#=================================================
+ynh_script_progression --message="Restarting $app ..."
+
+ynh_systemd_action --service_name=$app --action=restart
+
+#=================================================
+# END OF SCRIPT
+#=================================================
+
+ynh_script_progression --message="Execution completed" --last
diff --git a/scripts/actions/remove_extensions b/scripts/actions/remove_extensions
new file mode 100644
index 0000000..afd7833
--- /dev/null
+++ b/scripts/actions/remove_extensions
@@ -0,0 +1,90 @@
+#!/bin/bash
+
+#=================================================
+# GENERIC STARTING
+#=================================================
+# IMPORT GENERIC HELPERS
+#=================================================
+
+source /usr/share/yunohost/helpers
+
+#=================================================
+# MANAGE SCRIPT FAILURE
+#=================================================
+
+# Exit if an error occurs during the execution of the script
+ynh_abort_if_errors
+
+#=================================================
+# RETRIEVE ARGUMENTS
+#=================================================
+
+app=$YNH_APP_INSTANCE_NAME
+path_url=$(ynh_app_setting_get --app=$app --key=path)
+domain=$(ynh_app_setting_get --app=$app --key=domain)
+
+#=================================================
+# CHECK IF ARGUMENTS ARE CORRECT
+#=================================================
+
+final_path=/opt/yunohost/$app
+config_file="$final_path/live/.env"
+
+if [ ! -f $config_file ]
+then
+    ynh_die --message="Standard Notes - Extensions can not be removed." --ret_code=1
+fi
+
+#=================================================
+# CHECK IF AN ACTION HAS TO BE DONE
+#=================================================
+
+install_extensions_old=$(ynh_app_setting_get --app=$app --key=install_extensions)
+
+if [ $install_extensions_old -eq 0 ]
+then
+    ynh_die --message="Standard Notes - Extensions should not be installed." --ret_code=0
+fi
+
+#=================================================
+# SPECIFIC ACTION
+#=================================================
+# MOVE TO PUBLIC OR PRIVATE
+#=================================================
+
+ynh_script_progression --message="Remove Standard Notes - Extensions ..." --weight=5
+
+ynh_replace_string --match_string="^RAILS_SERVE_STATIC_FILES=.*$" --replace_string="RAILS_SERVE_STATIC_FILES=" --target_file="$config_file"
+
+if [ "$path_url" = "/" ]
+then
+    path=""
+else
+    path=$path_url
+fi
+
+find "$final_path/live/public/extensions/src/" -name "*.json" -print0 | while read -d $'\0' file
+do
+    ynh_replace_string --match_string="$domain$path" --replace_string="__DOMAIN__PATH__" --target_file="$file"
+done
+
+find "$final_path/live/public/extensions/src/" -mindepth 1 -maxdepth 1 -type d -print0 | while read -d $'\0' dir
+do
+    ynh_secure_remove --file="$dir"
+done
+
+# Update the config of the app
+ynh_app_setting_set --app=$app --key=install_extensions --value="0"
+
+#=================================================
+# RESTART Systemd
+#=================================================
+ynh_script_progression --message="Restarting $app ..."
+
+ynh_systemd_action --service_name=$app --action=restart
+
+#=================================================
+# END OF SCRIPT
+#=================================================
+
+ynh_script_progression --message="Execution completed" --last
diff --git a/scripts/change_url b/scripts/change_url
index 8aefeb4..1a6097f 100644
--- a/scripts/change_url
+++ b/scripts/change_url
@@ -119,7 +119,7 @@ ynh_replace_string --match_string="RAILS_RELATIVE_URL_ROOT=$old_path" --replace_
 #=================================================
 # Modify Standard Notes - Extensions
 #=================================================
-if [ $install_extensions ]
+if [ $install_extensions -eq 1 ]
 then
     ynh_script_progression --message="Modify Standard Notes - Extensions..."  --weight=1
 
@@ -146,9 +146,9 @@ path_url=$new_path
 # Create a dedicated fail2ban config
 touch "/var/log/$app/$app.log"
 ynh_add_fail2ban_config --use_template --others_var="\
-	domain \
-	path_url \
-	"
+    domain \
+    path_url \
+    "
 
 #=================================================
 # GENERIC FINALISATION
@@ -174,21 +174,21 @@ ynh_script_progression --message="Sending a readme for the admin..."
 
 admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app"
 
-message_extensions="To install extensions open this page: https://$domain$path_url/extensions/\
+message_extensions="To install extensions open this page: https://$domain$path_url/extensions/\n\
 You changed the url of the syncing server. All extensions installed from here must be reinstalled by the users."
-config_panel="You can configure this app by using the experimental __URL_TAG1__config-panel feature__URL_TAG2__$admin_panel/config-panel__URL_TAG3__"
+action="You can find some specific actions for this app by using the experimental __URL_TAG1__action feature__URL_TAG2__$admin_panel/actions__URL_TAG3__"
 
 ynh_replace_string --match_string="__TYPE__" --replace_string="changed the url" --target_file="../conf/message"
 ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/message"
 ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="../conf/message"
 
-if [ $install_extensions ]
+if [ $install_extensions -eq 1 ]
 then
     ynh_replace_string --match_string="__EXTENSIONS__" --replace_string="$message_extensions" --target_file="../conf/message"
 else
     ynh_replace_string --match_string="__EXTENSIONS__" --replace_string="" --target_file="../conf/message"
 fi
-ynh_replace_string --match_string="__CONFIG_PANEL__" --replace_string="$config_panel" --target_file="../conf/message"
+ynh_replace_string --match_string="__ACTION__" --replace_string="$action" --target_file="../conf/message"
 
 ynh_send_readme_to_admin --app_message="../conf/message" --type='upgrade'
 
diff --git a/scripts/install b/scripts/install
index 1060cb2..84e7f66 100755
--- a/scripts/install
+++ b/scripts/install
@@ -160,7 +160,7 @@ popd
 #=================================================
 # INSTALLING Standard Notes - Extensions
 #=================================================
-if [ $install_extensions ]
+if [ $install_extensions -eq 1 ]
 then
     ynh_script_progression --message="Installing Standard Notes - Extensions..."  --weight=1
 
@@ -284,29 +284,28 @@ ynh_systemd_action --service_name=nginx --action=reload
 #=================================================
 ynh_script_progression --message="Sending a readme for the admin..."
 
-message_extensions="To install extensions open this page: https://$domain$path_url/extensions/\
+message_extensions="To install extensions open this page: https://$domain$path_url/extensions/\n\
 If you want to change the url of the syncing server all extensions from here have to be reinstalled be the users."
-message_no_extensions="You have no extensions installed.\
+message_no_extensions="You have no extensions installed.\n\
 You can configure this app by using the config-panel"
 
 admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app"
-config_panel="You can configure this app by using the experimental __URL_TAG1__config-panel feature__URL_TAG2__$admin_panel/config-panel__URL_TAG3__"
+action="You can find some specific actions for this app by using the experimental __URL_TAG1__action feature__URL_TAG2__$admin_panel/actions__URL_TAG3__"
 
 ynh_replace_string --match_string="__TYPE__" --replace_string="installed" --target_file="../conf/message"
 ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/message"
 ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="../conf/message"
 
-if [ $install_extensions ]
+if [ $install_extensions -eq 1 ]
 then
     ynh_replace_string --match_string="__EXTENSIONS__" --replace_string="$message_extensions" --target_file="../conf/message"
 else
     ynh_replace_string --match_string="__EXTENSIONS__" --replace_string="$message_no_extensions" --target_file="../conf/message"
 fi
-ynh_replace_string --match_string="__CONFIG_PANEL__" --replace_string="$config_panel" --target_file="../conf/message"
+ynh_replace_string --match_string="__ACTION__" --replace_string="$action" --target_file="../conf/message"
 
 ynh_send_readme_to_admin --app_message="../conf/message" --type='install'
 
-echo ../conf/message
 #=================================================
 # END OF SCRIPT
 #=================================================
diff --git a/scripts/upgrade b/scripts/upgrade
index 1ba1cf7..a224e23 100755
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -188,7 +188,7 @@ fi
 #=================================================
 # INSTALLING Standard Notes - Extensions
 #=================================================
-if [ $install_extensions ]
+if [ $install_extensions -eq 1 ]
 then
     ynh_script_progression --message="Reinstalling Standard Notes - Extensions..."  --weight=1
 
@@ -273,9 +273,9 @@ ynh_script_progression --message="Reconfiguring fail2ban..." --weight=1
 # Create a dedicated fail2ban config
 touch "/var/log/$app/$app.log"
 ynh_add_fail2ban_config --use_template --others_var="\
-	domain \
-	path_url \
-	"
+    domain \
+    path_url \
+    "
 
 #=================================================
 # SETUP SSOWAT
@@ -311,25 +311,25 @@ ynh_systemd_action --service_name=nginx --action=reload
 #=================================================
 ynh_script_progression --message="Sending a readme for the admin..."
 
-message_extensions="To install extensions open this page: https://$domain$path_url/extensions/\
+message_extensions="To install extensions open this page: https://$domain$path_url/extensions/\n\
 If you want to change the url of the syncing server all extensions from here have to be reinstalled be the users."
-message_no_extensions="You have no extensions installed.\
+message_no_extensions="You have no extensions installed.\n\
 You can configure this app by using the config-panel"
 
 admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app"
-config_panel="You can configure this app by using the experimental __URL_TAG1__config-panel feature__URL_TAG2__$admin_panel/config-panel__URL_TAG3__"
+action="You can find some specific actions for this app by using the experimental __URL_TAG1__action feature__URL_TAG2__$admin_panel/actions__URL_TAG3__"
 
 ynh_replace_string --match_string="__TYPE__" --replace_string="installed" --target_file="../conf/message"
 ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/message"
 ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="../conf/message"
 
-if [ $install_extensions ]
+if [ $install_extensions -eq 1 ]
 then
     ynh_replace_string --match_string="__EXTENSIONS__" --replace_string="$message_extensions" --target_file="../conf/message"
 else
     ynh_replace_string --match_string="__EXTENSIONS__" --replace_string="$message_no_extensions" --target_file="../conf/message"
 fi
-ynh_replace_string --match_string="__CONFIG_PANEL__" --replace_string="$config_panel" --target_file="../conf/message"
+ynh_replace_string --match_string="__ACTION__" --replace_string="$action" --target_file="../conf/message"
 
 ynh_send_readme_to_admin --app_message="../conf/message" --type='upgrade'
 

From 8164943495e0cc22a24d8f1268f42aff02d85cae Mon Sep 17 00:00:00 2001
From: Fabian Wilkens 
Date: Sat, 16 Jan 2021 23:39:56 +0100
Subject: [PATCH 07/41] Manifest - Change requirements

---
 manifest.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/manifest.json b/manifest.json
index 0317793..7afd93e 100644
--- a/manifest.json
+++ b/manifest.json
@@ -14,7 +14,7 @@
         "url": "https://github.com/FabianWilkens/snserver_ynh"
     },
     "requirements": {
-        "yunohost": ">= 4.0"
+        "yunohost": ">= 4.1.0"
     },
     "multi_instance": true,
     "services": [

From 4ad8116a0bb172e0b63b945d483048f148fd24b2 Mon Sep 17 00:00:00 2001
From: Fabian Wilkens 
Date: Fri, 22 Jan 2021 20:41:41 +0100
Subject: [PATCH 08/41] Fix Upgrade compatibility

---
 scripts/actions/install_extensions |  2 +-
 scripts/change_url                 |  5 ++++-
 scripts/install                    |  5 ++++-
 scripts/upgrade                    | 31 ++++++++++++++++++++++++++----
 4 files changed, 36 insertions(+), 7 deletions(-)

diff --git a/scripts/actions/install_extensions b/scripts/actions/install_extensions
index b512451..c786274 100644
--- a/scripts/actions/install_extensions
+++ b/scripts/actions/install_extensions
@@ -34,7 +34,7 @@ if [[ ! -f $config_file || \
       ! -d "$final_path/live/public/extensions/" || \
       ! -d "$final_path/live/public/extensions/src/" ]]
 then
-    ynh_die --message="Standard Notes - Extensions can not be installed." --ret_code=1
+    ynh_die --message="Standard Notes - Extensions can not be installed. Please upgrade snserver" --ret_code=1
 fi
 
 #=================================================
diff --git a/scripts/change_url b/scripts/change_url
index 1a6097f..1b88348 100644
--- a/scripts/change_url
+++ b/scripts/change_url
@@ -95,7 +95,10 @@ then
     domain="$old_domain"
     path_url="$new_path"
     # Create a dedicated nginx config
-    ynh_add_nginx_config "port access_domain"
+    ynh_add_nginx_config "\
+        port \
+        access_domain\
+        "
 fi
 
 # Change the domain for nginx
diff --git a/scripts/install b/scripts/install
index 84e7f66..e4baa18 100755
--- a/scripts/install
+++ b/scripts/install
@@ -101,7 +101,10 @@ ynh_setup_source  --dest_dir="$final_path/live"
 ynh_script_progression --message="Configuring nginx web server..."  --weight=3
 
 # Create a dedicated nginx config
-ynh_add_nginx_config "port access_domain"
+ynh_add_nginx_config "\
+    port \
+    access_domain \
+    "
 
 #=================================================
 # CREATE DEDICATED USER
diff --git a/scripts/upgrade b/scripts/upgrade
index a224e23..bbe0b40 100755
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -25,8 +25,8 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
 db_user=$db_name
 db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
 port=$(ynh_app_setting_get --app=$app --key=port)
-install_extensions=(ynh_app_setting_get --app=$app --key=install_extensions)
-access_domain=(ynh_app_setting_get --app=$app --key=access_domain)
+install_extensions=$(ynh_app_setting_get --app=$app --key=install_extensions)
+access_domain=$(ynh_app_setting_get --app=$app --key=access_domain)
 
 #=================================================
 # CHECK VERSION
@@ -66,6 +66,27 @@ if [ -z "$final_path" ]; then
     ynh_app_setting_set --app=$app --key=final_path --value=$final_path
 fi
 
+# If install_extensions doesn't exist, create it
+if [ -z "$install_extensions" ]; then
+    install_extensions=0
+    ynh_app_setting_set --app=$app --key=install_extensions --value=$install_extensions
+fi
+
+# If access_domain doesn't exist, create it
+if [ -z "$access_domain" ]; then
+    access_domain=$domain
+    ynh_app_setting_set --app=$app --key=access_domain --value=$access_domain
+fi
+
+if [[ ! -d "$final_path/live/public/extensions/" || \
+      ! -d "$final_path/live/public/extensions/src/" ]]
+then
+    if test -e "$../sources/extra_files/app"
+    then
+        cp -a $../sources/extra_files/app/. "$final_path/"
+    fi
+fi
+
 #=================================================
 # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
 #=================================================
@@ -118,8 +139,10 @@ fi
 ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=1
 
 # Create a dedicated nginx config
-ynh_add_nginx_config "port"
-
+ynh_add_nginx_config "\
+    port \
+    acess_domain
+    "
 
 #=================================================
 # UPGRADE DEPENDENCIES

From dcc52cea2d2636333c3831a5127605bc90952555 Mon Sep 17 00:00:00 2001
From: Fabian Wilkens 
Date: Fri, 22 Jan 2021 23:47:08 +0100
Subject: [PATCH 09/41] Add config-panel feature

---
 conf/message       |  1 +
 config_panel.toml  | 14 ++++++++++
 scripts/change_url |  2 ++
 scripts/config     | 67 ++++++++++++++++++++++++++++++++++++++++++++++
 scripts/install    |  6 +++++
 scripts/upgrade    |  2 ++
 6 files changed, 92 insertions(+)
 create mode 100644 config_panel.toml
 create mode 100755 scripts/config

diff --git a/conf/message b/conf/message
index d8a5625..09b8a8a 100644
--- a/conf/message
+++ b/conf/message
@@ -1,4 +1,5 @@
 Standard Notes - Syncing Server was successfully __TYPE__.
 Please configure the Standard Notes web app or mobile app to use this syninc server: https://__DOMAIN____PATH_URL__/
 __ACTION__
+__CONFIG_PANEL__
 __EXTENSIONS__
diff --git a/config_panel.toml b/config_panel.toml
new file mode 100644
index 0000000..0fb6cdb
--- /dev/null
+++ b/config_panel.toml
@@ -0,0 +1,14 @@
+version = "1.0"
+name = "SNServer configuration panel"
+
+[main]
+name = "SNserver configuration"
+
+    [main.access_domain]
+    name = "Access Domain"
+
+        [main.access_domain.access_domain]
+        ask = "Which web app can access the Standart Notes Extensions?"
+        type = "string"
+        default = ""
+        help = "Please enter the domain without the path of a Standart Notes Web App, which should have access to the Standard Notes Extensions.
Example: domain.tld, notes.domain.tld" diff --git a/scripts/change_url b/scripts/change_url index 1b88348..82d2976 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -180,6 +180,7 @@ admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4) message_extensions="To install extensions open this page: https://$domain$path_url/extensions/\n\ You changed the url of the syncing server. All extensions installed from here must be reinstalled by the users." action="You can find some specific actions for this app by using the experimental __URL_TAG1__action feature__URL_TAG2__$admin_panel/actions__URL_TAG3__" +config_panel="You can find some specific configurations for this app by using the experimental __URL_TAG1__config-panel feature__URL_TAG2__$admin_panel/config-panel__URL_TAG3__" ynh_replace_string --match_string="__TYPE__" --replace_string="changed the url" --target_file="../conf/message" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/message" @@ -192,6 +193,7 @@ else ynh_replace_string --match_string="__EXTENSIONS__" --replace_string="" --target_file="../conf/message" fi ynh_replace_string --match_string="__ACTION__" --replace_string="$action" --target_file="../conf/message" +ynh_replace_string --match_string="__CONFIG_PANEL__" --replace_string="$config_panel" --target_file="../conf/message" ynh_send_readme_to_admin --app_message="../conf/message" --type='upgrade' diff --git a/scripts/config b/scripts/config new file mode 100755 index 0000000..c696738 --- /dev/null +++ b/scripts/config @@ -0,0 +1,67 @@ +#!/bin/bash + +#================================================= +# GENERIC START +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source ./_common.sh +source /usr/share/yunohost/helpers + +# Stop script if errors +ynh_abort_if_errors + +#================================================= +# RETRIEVE ARGUMENTS +#================================================= + +app=$YNH_APP_INSTANCE_NAME +access_domain=$(ynh_app_setting_get --app=$app --key=access_domain) +domain=$(ynh_app_setting_get --app=$app --key=domain) + +#================================================= +# SHOW_CONFIG FUNCTION FOR 'SHOW' COMMAND +#================================================= + +show_config() { + if [ ! -z $access_domain ] + then + ynh_return "YNH_CONFIG_MAIN_ACCESS_DOMAIN_ACCESS_DOMAIN=$access_domain" + else + ynh_return "YNH_CONFIG_MAIN_ACCESS_DOMAIN_ACCESS_DOMAIN=$domain" + fi +} + +#================================================= +# MODIFY THE CONFIGURATION +#================================================= + +apply_config() { + access_domain=${YNH_CONFIG_MAIN_ACCESS_DOMAIN_ACCESS_DOMAIN:-$access_domain} + ynh_print_info "1: $access_domain" + ynh_app_setting_set --app=$app --key=access_domain --value=$access_domain + + access_domain=$(ynh_app_setting_get --app=$app --key=access_domain) + ynh_print_info "2: $access_domain" + + nginx_conf_path=/etc/nginx/conf.d/$domain.d/$app.conf + ynh_delete_file_checksum --file=$nginx_conf_path + ynh_replace_string \ + --match_string='more_set_headers "X-Frame-Options: allow-from .*";' \ + --replace_string='more_set_headers "X-Frame-Options: allow-from '$access_domain'";' \ + --target_file=$nginx_conf_path + ynh_store_file_checksum --file=$nginx_conf_path + + systemctl reload nginx +} + +#================================================= +# GENERIC FINALIZATION +#================================================= +# SELECT THE ACTION FOLLOWING THE GIVEN ARGUMENT +#================================================= +case $1 in + show) show_config;; + apply) apply_config;; +esac diff --git a/scripts/install b/scripts/install index e4baa18..a73f02e 100755 --- a/scripts/install +++ b/scripts/install @@ -34,6 +34,10 @@ then access_domain=$domain else access_domain=$YNH_APP_ARG_ACCESS_DOMAIN + if [ -z $access_domain ] + then + access_domain=$domain + fi fi #================================================= @@ -294,6 +298,7 @@ You can configure this app by using the config-panel" admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app" action="You can find some specific actions for this app by using the experimental __URL_TAG1__action feature__URL_TAG2__$admin_panel/actions__URL_TAG3__" +config_panel="You can find some specific configurations for this app by using the experimental __URL_TAG1__config-panel feature__URL_TAG2__$admin_panel/config-panel__URL_TAG3__" ynh_replace_string --match_string="__TYPE__" --replace_string="installed" --target_file="../conf/message" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/message" @@ -306,6 +311,7 @@ else ynh_replace_string --match_string="__EXTENSIONS__" --replace_string="$message_no_extensions" --target_file="../conf/message" fi ynh_replace_string --match_string="__ACTION__" --replace_string="$action" --target_file="../conf/message" +ynh_replace_string --match_string="__CONFIG_PANEL__" --replace_string="$config_panel" --target_file="../conf/message" ynh_send_readme_to_admin --app_message="../conf/message" --type='install' diff --git a/scripts/upgrade b/scripts/upgrade index bbe0b40..c051379 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -341,6 +341,7 @@ You can configure this app by using the config-panel" admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app" action="You can find some specific actions for this app by using the experimental __URL_TAG1__action feature__URL_TAG2__$admin_panel/actions__URL_TAG3__" +config_panel="You can find some specific configurations for this app by using the experimental __URL_TAG1__config-panel feature__URL_TAG2__$admin_panel/config-panel__URL_TAG3__" ynh_replace_string --match_string="__TYPE__" --replace_string="installed" --target_file="../conf/message" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/message" @@ -353,6 +354,7 @@ else ynh_replace_string --match_string="__EXTENSIONS__" --replace_string="$message_no_extensions" --target_file="../conf/message" fi ynh_replace_string --match_string="__ACTION__" --replace_string="$action" --target_file="../conf/message" +ynh_replace_string --match_string="__CONFIG_PANEL__" --replace_string="$config_panel" --target_file="../conf/message" ynh_send_readme_to_admin --app_message="../conf/message" --type='upgrade' From 4e41bac910179943dbef35082b9afd2d96330c10 Mon Sep 17 00:00:00 2001 From: Fabian Wilkens Date: Sat, 23 Jan 2021 00:04:27 +0100 Subject: [PATCH 10/41] Fix typo --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index c051379..f02b268 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -141,7 +141,7 @@ ynh_script_progression --message="Upgrading nginx web server configuration..." - # Create a dedicated nginx config ynh_add_nginx_config "\ port \ - acess_domain + access_domain " #================================================= From 02eadbeb76e1eecb78b1ff73fae68d15b1c226da Mon Sep 17 00:00:00 2001 From: Fabian Wilkens Date: Sat, 23 Jan 2021 21:26:00 +0100 Subject: [PATCH 11/41] Fix typo --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index f02b268..e3256a0 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -141,7 +141,7 @@ ynh_script_progression --message="Upgrading nginx web server configuration..." - # Create a dedicated nginx config ynh_add_nginx_config "\ port \ - access_domain + access_domain \ " #================================================= From cfea07c39a33d3a19bb477f4224e2399f866b736 Mon Sep 17 00:00:00 2001 From: Fabian Wilkens Date: Sun, 24 Jan 2021 11:36:36 +0100 Subject: [PATCH 12/41] Fix some upgrade script issues --- conf/message | 2 +- scripts/upgrade | 32 +++++++++++++++----------------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/conf/message b/conf/message index 09b8a8a..f26ef93 100644 --- a/conf/message +++ b/conf/message @@ -1,5 +1,5 @@ Standard Notes - Syncing Server was successfully __TYPE__. -Please configure the Standard Notes web app or mobile app to use this syninc server: https://__DOMAIN____PATH_URL__/ +Please configure the Standard Notes web app or mobile app to use this syning server: https://__DOMAIN____PATH_URL__/ __ACTION__ __CONFIG_PANEL__ __EXTENSIONS__ diff --git a/scripts/upgrade b/scripts/upgrade index e3256a0..9cac568 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -81,9 +81,9 @@ fi if [[ ! -d "$final_path/live/public/extensions/" || \ ! -d "$final_path/live/public/extensions/src/" ]] then - if test -e "$../sources/extra_files/app" + if test -e "../sources/extra_files/app" then - cp -a $../sources/extra_files/app/. "$final_path/" + cp -a "../sources/extra_files/app/." "$final_path/live" fi fi @@ -174,22 +174,20 @@ ynh_system_user_create --username=$app --home_dir=$final_path # MODIFY A CONFIG FILE #================================================= config_file="$final_path/live/.env" -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Modifying a config file..." --weight=2 +ynh_script_progression --message="Modifying a config file..." --weight=2 + +cp -f ../conf/env.sample $config_file +ynh_replace_string --match_string="EXPOSED_PORT=3000" --replace_string="EXPOSED_PORT=$port" --target_file="$config_file" +secret_key=$(ynh_string_random --length=48 | base64) +ynh_replace_string --match_string="SECRET_KEY_BASE=changeme123" --replace_string="SECRET_KEY_BASE=$secret_key" --target_file="$config_file" +pseudo_key=$(ynh_string_random --length=48 | base64) +ynh_replace_string --match_string="PSEUDO_KEY_PARAMS_KEY=changeme456" --replace_string="PSEUDO_KEY_PARAMS_KEY=$pseudo_key" --target_file="$config_file" +ynh_replace_string --match_string="RAILS_ENV=development" --replace_string="RAILS_ENV=production" --target_file="$config_file" +ynh_replace_string --match_string="DB_DATABASE=standard_notes_db" --replace_string="DB_DATABASE=$db_name" --target_file="$config_file" +ynh_replace_string --match_string="DB_USERNAME=std_notes_user" --replace_string="DB_USERNAME=$db_user" --target_file="$config_file" +ynh_replace_string --match_string="DB_PASSWORD=changeme123" --replace_string="DB_PASSWORD=$db_pwd" --target_file="$config_file" +ynh_replace_string --match_string="RAILS_RELATIVE_URL_ROOT=/" --replace_string="RAILS_RELATIVE_URL_ROOT=$path_url" --target_file="$config_file" - cp -f ../conf/env.sample $config_file - ynh_replace_string --match_string="EXPOSED_PORT=3000" --replace_string="EXPOSED_PORT=$port" --target_file="$config_file" - secret_key=$(ynh_string_random --length=48 | base64) - ynh_replace_string --match_string="SECRET_KEY_BASE=changeme123" --replace_string="SECRET_KEY_BASE=$secret_key" --target_file="$config_file" - pseudo_key=$(ynh_string_random --length=48 | base64) - ynh_replace_string --match_string="PSEUDO_KEY_PARAMS_KEY=changeme456" --replace_string="PSEUDO_KEY_PARAMS_KEY=$pseudo_key" --target_file="$config_file" - ynh_replace_string --match_string="RAILS_ENV=development" --replace_string="RAILS_ENV=production" --target_file="$config_file" - ynh_replace_string --match_string="DB_DATABASE=standard_notes_db" --replace_string="DB_DATABASE=$db_name" --target_file="$config_file" - ynh_replace_string --match_string="DB_USERNAME=std_notes_user" --replace_string="DB_USERNAME=$db_user" --target_file="$config_file" - ynh_replace_string --match_string="DB_PASSWORD=changeme123" --replace_string="DB_PASSWORD=$db_pwd" --target_file="$config_file" - ynh_replace_string --match_string="RAILS_RELATIVE_URL_ROOT=/" --replace_string="RAILS_RELATIVE_URL_ROOT=$path_url" --target_file="$config_file" -fi #================================================= # INSTALLING Standard Notes - Synicing Server #================================================= From 2ccdd833779e379f54bf981322eaa11ef579ec7c Mon Sep 17 00:00:00 2001 From: Fabian Wilkens Date: Sun, 24 Jan 2021 11:48:59 +0100 Subject: [PATCH 13/41] Update manifest.json and check_process --- check_process | 12 +++++++----- manifest.json | 5 ++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/check_process b/check_process index 12e1e89..fb88e4b 100644 --- a/check_process +++ b/check_process @@ -18,8 +18,10 @@ setup_private=1 setup_public=1 upgrade=1 + # 3.13.6~ynh2 + upgrade=1 from_commit=e755357f8306805084317c81e85807ed87fdbd47 # 3.13.6~ynh1 - upgrade=1 from_commit=7474baadc1705ffe5981a52bdced16bdd1edf979 + #upgrade=1 from_commit=7474baadc1705ffe5981a52bdced16bdd1edf979 backup_restore=1 multi_instance=1 # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version. @@ -30,10 +32,10 @@ # If the level 5 (Package linter) is forced to 1. Please add justifications here. Level 5=auto ;;; Options -Email=wilkens.fabian+github@gmail.com -Notification=all +Email= +Notification= ;;; Upgrade options - ; commit=7474baadc1705ffe5981a52bdced16bdd1edf979 - name=3.13.6~ynh1 + ; commit=e755357f8306805084317c81e85807ed87fdbd47 + name=3.13.6~ynh2 manifest_arg=domain=DOMAIN&path=PATH&is_public=1 diff --git a/manifest.json b/manifest.json index 7afd93e..c3ca34b 100644 --- a/manifest.json +++ b/manifest.json @@ -5,13 +5,12 @@ "description": { "en": "The Standard Notes syncing server. An end-to-end encrypted note-taking app." }, - "version": "3.13.6~ynh2", + "version": "3.13.6~ynh3", "url": "https://github.com/standardnotes/syncing-server", "license": "AGPL-3.0-or-later", "maintainer": { "name": "Fabian Wilkens", - "email": "wilkens.fabian+github@gmail.com", - "url": "https://github.com/FabianWilkens/snserver_ynh" + "email": "46000361+FabianWilkens@users.noreply.github.com", }, "requirements": { "yunohost": ">= 4.1.0" From 08cca78338cb343816b2e0eb9b34c3c22e76c47f Mon Sep 17 00:00:00 2001 From: Fabian Wilkens Date: Sun, 24 Jan 2021 13:00:03 +0100 Subject: [PATCH 14/41] Fix Extension urls --- sources/extra_files/app/public/extensions/src/action-bar.json | 2 +- .../extra_files/app/public/extensions/src/filesafe-bar.json | 2 +- .../app/public/extensions/src/folders-component.json | 2 +- .../extra_files/app/public/extensions/src/github-push.json | 2 +- sources/extra_files/app/public/extensions/src/mfa-link.json | 2 +- sources/extra_files/app/public/extensions/src/quick-tags.json | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sources/extra_files/app/public/extensions/src/action-bar.json b/sources/extra_files/app/public/extensions/src/action-bar.json index e5e546b..531031d 100644 --- a/sources/extra_files/app/public/extensions/src/action-bar.json +++ b/sources/extra_files/app/public/extensions/src/action-bar.json @@ -7,5 +7,5 @@ "description": "Useful utility bar with information about the current note as well as actions like duplicate, copy, and save.", "url": "https://__DOMAIN__PATH__/extensions/src/action-bar/index.html", "download_url": "https://github.com/standardnotes/action-bar/archive/1.3.1.zip", - "latest_url": "https://__DOMAIN__PATH__/extensions/src/comonents/action-bar.json" + "latest_url": "https://__DOMAIN__PATH__/extensions/src/action-bar.json" } diff --git a/sources/extra_files/app/public/extensions/src/filesafe-bar.json b/sources/extra_files/app/public/extensions/src/filesafe-bar.json index de13d49..18d01a8 100644 --- a/sources/extra_files/app/public/extensions/src/filesafe-bar.json +++ b/sources/extra_files/app/public/extensions/src/filesafe-bar.json @@ -7,5 +7,5 @@ "description": "FileSafe Bar", "url": "https://__DOMAIN__PATH__/extensions/src/filesafe-bar/app/index.html", "download_url": "https://github.com/standardnotes/filesafe-bar/archive/2.0.10.zip", - "latest_url": "https://__DOMAIN__PATH__/extensions/src/comonents/filesafe-bar.json" + "latest_url": "https://__DOMAIN__PATH__/extensions/src/filesafe-bar.json" } diff --git a/sources/extra_files/app/public/extensions/src/folders-component.json b/sources/extra_files/app/public/extensions/src/folders-component.json index f1794d6..909f771 100644 --- a/sources/extra_files/app/public/extensions/src/folders-component.json +++ b/sources/extra_files/app/public/extensions/src/folders-component.json @@ -7,5 +7,5 @@ "description": "Create nested folders from your tags with easy drag and drop. Folders also supports Smart Tags, which allow you to build custom filters for viewing your notes.", "url": "https://__DOMAIN__PATH__/extensions/src/folders-component/index.html", "download_url": "https://github.com/standardnotes/folders-component/archive/1.3.5.zip", - "latest_url": "https://__DOMAIN__PATH__/extensions/src/comonents/folders-component.json" + "latest_url": "https://__DOMAIN__PATH__/extensions/src/folders-component.json" } diff --git a/sources/extra_files/app/public/extensions/src/github-push.json b/sources/extra_files/app/public/extensions/src/github-push.json index aad5503..c5a3458 100644 --- a/sources/extra_files/app/public/extensions/src/github-push.json +++ b/sources/extra_files/app/public/extensions/src/github-push.json @@ -7,5 +7,5 @@ "description": "Push note changes to a public or private GitHub repository, with options for file extension and commit message.", "url": "https://__DOMAIN__PATH__/extensions/src/github-push/index.html", "download_url": "https://github.com/sn-extensions/github-push/archive/1.2.2.zip", - "latest_url": "https://__DOMAIN__PATH__/extensions/src/comonents/github-push.json" + "latest_url": "https://__DOMAIN__PATH__/extensions/src/github-push.json" } diff --git a/sources/extra_files/app/public/extensions/src/mfa-link.json b/sources/extra_files/app/public/extensions/src/mfa-link.json index ce62530..189b32d 100644 --- a/sources/extra_files/app/public/extensions/src/mfa-link.json +++ b/sources/extra_files/app/public/extensions/src/mfa-link.json @@ -7,5 +7,5 @@ "description": "Set up 2FA to enable an extra layer of security on your private notes account.", "url": "https://__DOMAIN__PATH__/extensions/src/mfa-link/dist/index.html", "download_url": "https://github.com/sn-extensions/mfa-link/archive/1.2.2.zip", - "latest_url": "https://__DOMAIN__PATH__/extensions/src/comonents/mfa-link.json" + "latest_url": "https://__DOMAIN__PATH__/extensions/src/mfa-link.json" } diff --git a/sources/extra_files/app/public/extensions/src/quick-tags.json b/sources/extra_files/app/public/extensions/src/quick-tags.json index 9b4b71d..bc2e1e5 100644 --- a/sources/extra_files/app/public/extensions/src/quick-tags.json +++ b/sources/extra_files/app/public/extensions/src/quick-tags.json @@ -7,5 +7,5 @@ "description": "Work more efficiently by quickly selecting from a live list of tags while you type. Supports keyboard shortcuts and folders.", "url": "https://__DOMAIN__PATH__/extensions/src/quick-tags/index.html", "download_url": "https://github.com/standardnotes/quick-tags/archive/1.3.2.zip", - "latest_url": "https://__DOMAIN__PATH__/extensions/src/comonents/quick-tags.json", - + "latest_url": "https://__DOMAIN__PATH__/extensions/src/quick-tags.json" +} From 0cdc7ec0af1bb237683dadde84c9a16801a0b634 Mon Sep 17 00:00:00 2001 From: Fabian Wilkens Date: Sun, 24 Jan 2021 13:30:35 +0100 Subject: [PATCH 15/41] Fix Extensions urls --- .../app/public/extensions/index.html | 4 +- .../app/public/extensions/index.json | 50 +++++++++---------- .../extra_files/app/public/extensions/js.js | 2 +- .../extensions/src/secure-spreadsheets.json | 2 +- .../extensions/src/solarized-dark-theme.json | 2 +- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/sources/extra_files/app/public/extensions/index.html b/sources/extra_files/app/public/extensions/index.html index 3347a3e..60d7d40 100644 --- a/sources/extra_files/app/public/extensions/index.html +++ b/sources/extra_files/app/public/extensions/index.html @@ -2,8 +2,8 @@ StandardNotes Extensions - - + +