mirror of
https://github.com/YunoHost-Apps/snserver_ynh.git
synced 2024-09-03 20:26:22 +02:00
commit
5c85dcb47e
62 changed files with 1578 additions and 90 deletions
21
README.md
21
README.md
|
@ -1,9 +1,12 @@
|
|||
# Standard Notes Syncing Server for YunoHost
|
||||
|
||||
[](https://dash.yunohost.org/appci/app/snserver)
|
||||
[](https://dash.yunohost.org/appci/app/snserver)
|
||||

|
||||

|
||||
|
||||
[](https://install-app.yunohost.org/?app=snserver)
|
||||
|
||||
> *This package allow you to install snserver quickly and simply on a YunoHost server.
|
||||
> *This package allow you to install snserver quickly and simply on a YunoHost server.
|
||||
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.*
|
||||
|
||||
## Overview
|
||||
|
@ -13,7 +16,7 @@ Standard Notes syncing server
|
|||
You can run your own Standard Notes server and use it with any Standard Notes app. This allows you to have 100% control of your data.
|
||||
|
||||
**Shipped version:** 3.13.6
|
||||
* Apps available for free. https://standardnotes.org/
|
||||
* Apps available for free. https://standardnotes.org/
|
||||
* Desktop (Windows, Mac, Linux)
|
||||
* Mobile (Android and iOS)
|
||||
* Web https://app.standardnotes.org/
|
||||
|
@ -32,8 +35,9 @@ Extensions, Editors, Themes: https://standardnotes.org/extensions
|
|||
|
||||
## Configuration
|
||||
|
||||
How to configure this app:
|
||||
How to configure this app:
|
||||
* The config-file is stored under "/opt/yunohost/$app/live/.env"
|
||||
* You can find additional config features under https://your-domain.tld/yunohost/admin/#/apps/$app/config-panel
|
||||
|
||||
## Documentation
|
||||
|
||||
|
@ -53,14 +57,7 @@ How to configure this app:
|
|||
|
||||
## Limitations
|
||||
|
||||
* Any known limitations.
|
||||
|
||||
## Additional information
|
||||
|
||||
* Other information you would add about this application
|
||||
|
||||
**More information on the documentation page:**
|
||||
https://yunohost.org/packaging_apps
|
||||
* If users have installed the extensions included in this package. The URL of the server should not be changed anymore. Otherwise the users will have to reinstall the extensions.
|
||||
|
||||
## Links
|
||||
|
||||
|
|
|
@ -5,9 +5,10 @@
|
|||
|
||||
;; 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)
|
||||
access_domain="/"
|
||||
; Checks
|
||||
pkg_linter=1
|
||||
setup_sub_dir=1
|
||||
|
@ -16,8 +17,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.
|
||||
|
@ -28,10 +31,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
|
||||
|
||||
|
|
|
@ -45,9 +45,13 @@ DATADOG_ENABLED=false
|
|||
# Mailer settings
|
||||
SMTP_HOST=
|
||||
SMTP_PORT=
|
||||
SMTP_USERNAME=
|
||||
SMTP_PASSWORD=
|
||||
#SMTP_USERNAME=
|
||||
#SMTP_PASSWORD=
|
||||
SMTP_DOMAIN=
|
||||
# Enalbe STARTTLS
|
||||
# Empty is disabled
|
||||
# Any value is enabled
|
||||
SMTP_STARTTLS=
|
||||
EMAIL_ATTACHMENT_MAX_SIZE=10485760
|
||||
|
||||
# SNS EVENTS
|
||||
|
@ -61,3 +65,8 @@ REVISIONS_FREQUENCY=300
|
|||
|
||||
# Sub-URI
|
||||
RAILS_RELATIVE_URL_ROOT=/
|
||||
|
||||
# Public file server
|
||||
# Empty is disabled
|
||||
# Any value is enabled
|
||||
RAILS_SERVE_STATIC_FILES=
|
||||
|
|
5
conf/ext_action-bar.src
Normal file
5
conf/ext_action-bar.src
Normal file
|
@ -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
|
5
conf/ext_autobiography-theme.src
Normal file
5
conf/ext_autobiography-theme.src
Normal file
|
@ -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
|
5
conf/ext_bold-editor.src
Normal file
5
conf/ext_bold-editor.src
Normal file
|
@ -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
|
5
conf/ext_code-editor.src
Normal file
5
conf/ext_code-editor.src
Normal file
|
@ -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
|
5
conf/ext_dynamic-theme.src
Normal file
5
conf/ext_dynamic-theme.src
Normal file
|
@ -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
|
5
conf/ext_focus-theme.src
Normal file
5
conf/ext_focus-theme.src
Normal file
|
@ -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
|
5
conf/ext_folders-component.src
Normal file
5
conf/ext_folders-component.src
Normal file
|
@ -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
|
5
conf/ext_futura-theme.src
Normal file
5
conf/ext_futura-theme.src
Normal file
|
@ -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
|
5
conf/ext_github-push.src
Normal file
5
conf/ext_github-push.src
Normal file
|
@ -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
|
5
conf/ext_markdown-basic.src
Normal file
5
conf/ext_markdown-basic.src
Normal file
|
@ -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
|
5
conf/ext_markdown-pro.src
Normal file
5
conf/ext_markdown-pro.src
Normal file
|
@ -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
|
5
conf/ext_math-editor.src
Normal file
5
conf/ext_math-editor.src
Normal file
|
@ -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
|
5
conf/ext_mfa-link.src
Normal file
5
conf/ext_mfa-link.src
Normal file
|
@ -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
|
5
conf/ext_midnight-theme.src
Normal file
5
conf/ext_midnight-theme.src
Normal file
|
@ -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
|
5
conf/ext_minimal-markdown-editor.src
Normal file
5
conf/ext_minimal-markdown-editor.src
Normal file
|
@ -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
|
5
conf/ext_no-distraction-theme.src
Normal file
5
conf/ext_no-distraction-theme.src
Normal file
|
@ -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
|
5
conf/ext_plus-editor.src
Normal file
5
conf/ext_plus-editor.src
Normal file
|
@ -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
|
5
conf/ext_quick-tags.src
Normal file
5
conf/ext_quick-tags.src
Normal file
|
@ -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
|
5
conf/ext_simple-task-editor.src
Normal file
5
conf/ext_simple-task-editor.src
Normal file
|
@ -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
|
5
conf/ext_solarized-theme.src
Normal file
5
conf/ext_solarized-theme.src
Normal file
|
@ -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
|
5
conf/ext_titanium-theme.src
Normal file
5
conf/ext_titanium-theme.src
Normal file
|
@ -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
|
5
conf/ext_token-vault.src
Normal file
5
conf/ext_token-vault.src
Normal file
|
@ -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
|
5
conf/ext_vim-editor.src
Normal file
5
conf/ext_vim-editor.src
Normal file
|
@ -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
|
|
@ -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 "Content-Security-Policy: frame-ancestors 'self' __ACCESS_DOMAIN__";
|
||||
}
|
||||
|
|
14
config_panel.toml
Normal file
14
config_panel.toml
Normal file
|
@ -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(s) without the path of a Standart Notes Web App, which should have access to the Standard Notes Extensions.<br>Example: domain.tld<br>Example: https://domain.tld<br>Example: domain.tld notes.domain.tld<br>Example: domain.tld https://notes.domain.tld"
|
|
@ -5,16 +5,15 @@
|
|||
"description": {
|
||||
"en": "The Standard Notes syncing server. An end-to-end encrypted note-taking app."
|
||||
},
|
||||
"version": "3.13.6~ynh2",
|
||||
"version": "3.13.6~ynh4",
|
||||
"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.0"
|
||||
"yunohost": ">= 4.1.0"
|
||||
},
|
||||
"multi_instance": true,
|
||||
"services": [
|
||||
|
@ -55,6 +54,16 @@
|
|||
"de": "Ist die Application Öffendlich?"
|
||||
},
|
||||
"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": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -39,10 +39,162 @@ exec_as() {
|
|||
fi
|
||||
}
|
||||
|
||||
# Check if service is ready
|
||||
is_service_ready() {
|
||||
for ((i = 0 ; i < 15 ; i++))
|
||||
do
|
||||
if [ "200" -eq $(curl --silent --insecure --resolve $domain:443:127.0.0.1 https://$domain$path_url/ -o /dev/null --write-out "%{http_code}") ]
|
||||
then
|
||||
break
|
||||
else
|
||||
sleep 2
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
#================================================
|
||||
# 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 "$" "<br>" mail_to_send
|
||||
|
||||
# Insert starting HTML tags
|
||||
sed --in-place '1s@^@<!DOCTYPE html>\n<html>\n<head></head>\n<body>\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__" "<a href=\"\2\">\1</a>" mail_to_send
|
||||
|
||||
# Insert pre tags
|
||||
ynh_replace_string "__PRE_TAG1__" "<pre>" mail_to_send
|
||||
ynh_replace_string "__PRE_TAG2__" "<\pre>" mail_to_send
|
||||
|
||||
# Insert finishing HTML tags
|
||||
echo -e "\n</body>\n</html>" >> 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
|
||||
#=================================================
|
||||
|
|
|
@ -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)
|
||||
access_domain=$(ynh_app_setting_get --app=$app --key=access_domain)
|
||||
mail=$(ynh_app_setting_get --app=$app --key=mail)
|
||||
|
||||
# Add settings here as needed by your application
|
||||
#db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
|
@ -93,7 +95,10 @@ 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 +119,34 @@ 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"
|
||||
|
||||
if [ $change_domain -eq 1 ]
|
||||
then
|
||||
new_mail="$app@$new_domain"
|
||||
ynh_replace_string --match_string="$mail" --replace_string="$new_mail" --target_file="$final_path/live/app/mailers/application_mailer.rb"
|
||||
ynh_replace_string --match_string="$domain" --replace_string="$new_domain" --target_file="$final_path/live/app/views/user_mailer/welcome.html.erb"
|
||||
fi
|
||||
if [ $change_path -eq 1 ]
|
||||
then
|
||||
ynh_replace_string --match_string="$path_url" --replace_string="$new_path" --target_file="$final_path/live/app/views/user_mailer/welcome.html.erb"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# Modify Standard Notes - Extensions
|
||||
#=================================================
|
||||
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
|
||||
|
||||
#=================================================
|
||||
# SETUP FAIL2BAN
|
||||
#=================================================
|
||||
|
@ -124,9 +157,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
|
||||
|
@ -136,7 +169,6 @@ ynh_add_fail2ban_config --use_template --others_var="\
|
|||
ynh_script_progression --message="Starting a systemd service..." --weight=2
|
||||
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
||||
sleep 15
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
|
@ -145,6 +177,32 @@ ynh_script_progression --message="Reloading nginx web server..." --weight=1
|
|||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
#=================================================
|
||||
# WAITING FOR SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Waiting for service..." --weight=1
|
||||
|
||||
is_service_ready
|
||||
|
||||
#=================================================
|
||||
# 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"
|
||||
|
||||
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__"
|
||||
admin_mail_info="You changed the url of the server. All Extensions have to be reinstalled by the users. Or you can change the url back."
|
||||
|
||||
echo -e "\
|
||||
Standard Notes - Syncing Server's url was successfully changed.\n\
|
||||
Please configure the Standard Notes web app or mobile app to use this syning server: https://$domain$path_url/\n\
|
||||
$config_panel\n\n\
|
||||
$admin_mail_info\
|
||||
" > message
|
||||
|
||||
ynh_send_readme_to_admin --app_message="message" --type='change_url'
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
66
scripts/config
Executable file
66
scripts/config
Executable file
|
@ -0,0 +1,66 @@
|
|||
#!/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=$(echo $access_domain | sed "s@;@ @g")"
|
||||
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_app_setting_set --app=$app --key=access_domain --value=$access_domain
|
||||
|
||||
access_domain=$(ynh_app_setting_get --app=$app --key=access_domain)
|
||||
access_domains=$(echo $access_domain | sed "s@;@ @g")
|
||||
|
||||
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 "Content-Security-Policy: frame-ancestors '"'self'"'.*";' \
|
||||
--replace_string='more_set_headers "Content-Security-Policy: frame-ancestors '"'self' $access_domains"'";' \
|
||||
--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
|
104
scripts/install
104
scripts/install
|
@ -28,6 +28,12 @@ domain=$YNH_APP_ARG_DOMAIN
|
|||
path_url=$YNH_APP_ARG_PATH
|
||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
access_domain=$YNH_APP_ARG_ACCESS_DOMAIN
|
||||
if [ -z "$access_domain" ]
|
||||
then
|
||||
access_domain=$domain
|
||||
fi
|
||||
mail="$app@$domain"
|
||||
|
||||
#=================================================
|
||||
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
||||
|
@ -46,6 +52,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=access_domain --value=$access_domain
|
||||
ynh_app_setting_set --app=$app --key=mail --value=$mail
|
||||
|
||||
#=================================================
|
||||
# STANDARD MODIFICATIONS
|
||||
|
@ -92,7 +100,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"
|
||||
ynh_add_nginx_config "\
|
||||
port \
|
||||
access_domain \
|
||||
"
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
|
@ -122,16 +133,25 @@ ynh_script_progression --message="Modifying a config file..." --weight=2
|
|||
|
||||
config_file="$final_path/live/.env"
|
||||
cp -f ../conf/env.sample $config_file
|
||||
ynh_replace_string --match_string="EXPOSED_PORT=3000" --replace_string="EXPOSED_PORT=$port" --target_file="$config_file"
|
||||
ynh_replace_string --match_string="EXPOSED_PORT=.*$" --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"
|
||||
ynh_replace_string --match_string="SECRET_KEY_BASE=.*$" --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"
|
||||
ynh_replace_string --match_string="PSEUDO_KEY_PARAMS_KEY=.*$" --replace_string="PSEUDO_KEY_PARAMS_KEY=$pseudo_key" --target_file="$config_file"
|
||||
ynh_replace_string --match_string="RAILS_ENV=.*$" --replace_string="RAILS_ENV=production" --target_file="$config_file"
|
||||
ynh_replace_string --match_string="DB_DATABASE=.*$" --replace_string="DB_DATABASE=$db_name" --target_file="$config_file"
|
||||
ynh_replace_string --match_string="DB_USERNAME=.*$" --replace_string="DB_USERNAME=$db_user" --target_file="$config_file"
|
||||
ynh_replace_string --match_string="DB_PASSWORD=.*$" --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"
|
||||
ynh_replace_string --match_string="SMTP_HOST=.*$" --replace_string="SMTP_HOST=localhost" --target_file="$config_file"
|
||||
ynh_replace_string --match_string="SMTP_PORT=.*$" --replace_string="SMTP_PORT=25" --target_file="$config_file"
|
||||
ynh_replace_string --match_string="SMTP_DOMAIN=.*$" --replace_string="SMTP_DOMAIN=localhost" --target_file="$config_file"
|
||||
ynh_replace_string --match_string="SMTP_STARTTLS=.*$" --replace_string="SMTP_STARTTLS=" --target_file="$config_file"
|
||||
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="__MAIL__" --replace_string="$mail" --target_file="$final_path/live/app/mailers/application_mailer.rb"
|
||||
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/live/app/views/user_mailer/welcome.html.erb"
|
||||
ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$final_path/live/app/views/user_mailer/welcome.html.erb"
|
||||
|
||||
#=================================================
|
||||
# INSTALLING Standard Notes - Synicing Server
|
||||
|
@ -145,8 +165,35 @@ 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
|
||||
#=================================================
|
||||
ynh_script_progression --message="Installing Standard Notes - Extensions..." --weight=1
|
||||
|
||||
|
||||
if [ $path_url = "/" ]
|
||||
then
|
||||
path=""
|
||||
else
|
||||
path=$path_url
|
||||
fi
|
||||
|
||||
ynh_replace_string --match_string="__DOMAIN__PATH__" --replace_string="$domain$path" --target_file="$final_path/live/public/extensions/repo.json"
|
||||
|
||||
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
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
|
@ -210,9 +257,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
|
||||
|
@ -232,7 +279,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1
|
|||
|
||||
# Start a systemd service
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
||||
sleep 15
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
|
@ -241,6 +287,38 @@ ynh_script_progression --message="Reloading nginx web server..." --weight=1
|
|||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
#=================================================
|
||||
# WAITING FOR SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Waiting for service..." --weight=1
|
||||
|
||||
is_service_ready
|
||||
|
||||
#=================================================
|
||||
# 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"
|
||||
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__"
|
||||
|
||||
admin_mail_info="\
|
||||
Standard Notes extensions are hosted with this package.\n\
|
||||
New users will get an e-mail with install instructions.\n\
|
||||
With the current SMTP settings you can not send e-mails to all e-mail providers. For example GMail will probably not recive this e-mails.\n\
|
||||
Please setup the SMTP account in this file: \"$final_path/live/.env\" under \"#Mailer settings\" if you want to fix this.\n\
|
||||
Please setup the Access-Domain for the extensions in the __URL_TAG1__config-panel__URL_TAG2__$admin_panel/config-panel__URL_TAG3__ if not already done during the installation settings.\
|
||||
"
|
||||
|
||||
echo -e "\
|
||||
Standard Notes - Syncing Server was successfully installed.\n\
|
||||
Please configure the Standard Notes web app or mobile app to use this syning server: https://$domain$path_url/\n\
|
||||
$config_panel\n\n\
|
||||
$admin_mail_info\
|
||||
" > message
|
||||
|
||||
ynh_send_readme_to_admin --app_message="message" --type='install'
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
|
@ -130,7 +130,6 @@ yunohost service add $app --description "Standard Notes - Syncing Server" --log
|
|||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
||||
sleep 15
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE LOGROTATE CONFIGURATION
|
||||
|
@ -158,6 +157,13 @@ ynh_script_progression --message="Reloading nginx web server..." --weight=2
|
|||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
#=================================================
|
||||
# WAITING FOR SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Waiting for service..." --weight=1
|
||||
|
||||
is_service_ready
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
192
scripts/upgrade
192
scripts/upgrade
|
@ -25,6 +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)
|
||||
access_domain=$(ynh_app_setting_get --app=$app --key=access_domain)
|
||||
mail=$(ynh_app_setting_get --app=$app --key=mail)
|
||||
|
||||
#=================================================
|
||||
# CHECK VERSION
|
||||
|
@ -38,6 +40,20 @@ port=$(ynh_app_setting_get --app=$app --key=port)
|
|||
### UPGRADE_APP should be used to upgrade the core app only if there's an upgrade to do.
|
||||
upgrade_type=$(ynh_check_app_version_changed)
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1
|
||||
|
||||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
ynh_clean_setup () {
|
||||
# restore it if the upgrade fails
|
||||
ynh_restore_upgradebackup
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
|
@ -64,19 +80,36 @@ if [ -z "$final_path" ]; then
|
|||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1
|
||||
# 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
|
||||
|
||||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
ynh_clean_setup () {
|
||||
# restore it if the upgrade fails
|
||||
ynh_restore_upgradebackup
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
# If mail doesn't exist, create it
|
||||
if [ -z "$mail" ]; then
|
||||
mail="$app@$domain"
|
||||
ynh_app_setting_set --app=$app --key=mail --value=$mail
|
||||
fi
|
||||
|
||||
if ynh_compare_current_package_version --comparison lt --version "3.13.6~ynh4"
|
||||
then
|
||||
# Add Variables to .env config file
|
||||
echo -e "\
|
||||
\n# Public file server\
|
||||
\n# Empty is disabled\
|
||||
\n# Any value is enabled\
|
||||
\nRAILS_SERVE_STATIC_FILES=\
|
||||
" >> "$final_path/live/.env"
|
||||
|
||||
# Apply Patch
|
||||
if [ -f "$YNH_CWD/../sources/patches/app-01-add-mail.patch" ]
|
||||
then
|
||||
pushd "$final_path/live"
|
||||
patch --strip=1 < "$YNH_CWD/../sources/patches/app-01-add-mail.patch"
|
||||
popd
|
||||
fi
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# STANDARD UPGRADE STEPS
|
||||
|
@ -91,22 +124,41 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app
|
|||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Upgrading source files..." --weight=1
|
||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||
then
|
||||
ynh_script_progression --message="Upgrading source files..." --weight=1
|
||||
|
||||
# Backup files to keep
|
||||
tmpdir=$(mktemp -d)
|
||||
if [ -d $final_path/live/log ] ; then
|
||||
cp -Rp $final_path/live/log $tmpdir
|
||||
if [ -f "$final_path/live/.env" ] ; then
|
||||
cp -Rp "$final_path/live/.env" "$tmpdir"
|
||||
fi
|
||||
if [ -d "$final_path/live/log" ] ; then
|
||||
cp -Rp "$final_path/live/log" "$tmpdir"
|
||||
fi
|
||||
# Remove destination directory
|
||||
ynh_secure_remove --file=$final_path
|
||||
ynh_secure_remove --file="$final_path/live"
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
mkdir -p $final_path
|
||||
mkdir -p "$final_path"
|
||||
ynh_setup_source --dest_dir="$final_path/live"
|
||||
if [ -d $tmpdir/log ] ; then
|
||||
cp -Rp $tmpdir/log $final_path/live
|
||||
if [ -f "$tmpdir/.env" ] ; then
|
||||
cp -Rp "$tmpdir/.env" "$final_path/live"
|
||||
fi
|
||||
if [ -d "$tmpdir/log" ] ; then
|
||||
cp -Rp "$tmpdir/log" "$final_path/live"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$upgrade_type" == "UPGRADE_PACKAGE" ]
|
||||
then
|
||||
ynh_secure_remove --file="$final_path/live/public/extensions"
|
||||
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/live"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -116,8 +168,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 \
|
||||
access_domain \
|
||||
"
|
||||
|
||||
#=================================================
|
||||
# UPGRADE DEPENDENCIES
|
||||
|
@ -149,22 +203,23 @@ 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"
|
||||
if ynh_compare_current_package_version --comparison lt --version "3.13.6~ynh4"
|
||||
then
|
||||
ynh_replace_string --match_string="SMTP_HOST=.*$" --replace_string="SMTP_HOST=localhost" --target_file="$config_file"
|
||||
ynh_replace_string --match_string="SMTP_PORT=.*$" --replace_string="SMTP_PORT=25" --target_file="$config_file"
|
||||
ynh_replace_string --match_string="SMTP_USERNAME=.*$" --replace_string="#&" --target_file="$config_file"
|
||||
ynh_replace_string --match_string="SMTP_PASSWORD=.*$" --replace_string="#&" --target_file="$config_file"
|
||||
ynh_replace_string --match_string="SMTP_DOMAIN=.*$" --replace_string="SMTP_DOMAIN=localhost" --target_file="$config_file"
|
||||
ynh_replace_string --match_string="SMTP_DOMAIN=.*$" --replace_string="&\n# Enable STARTTLS\n# Empty is disabled\n# Any value is enabled\nSMTP_STARTTLS=" --target_file="$config_file"
|
||||
ynh_replace_string --match_string="RAILS_SERVE_STATIC_FILES=.*$" --replace_string="RAILS_SERVE_STATIC_FILES=true" --target_file="$config_file"
|
||||
fi
|
||||
|
||||
ynh_replace_string --match_string="__MAIL__" --replace_string="$mail" --target_file="$final_path/live/app/mailers/application_mailer.rb"
|
||||
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/live/app/views/user_mailer/welcome.html.erb"
|
||||
ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$final_path/live/app/views/user_mailer/welcome.html.erb"
|
||||
|
||||
#=================================================
|
||||
# INSTALLING Standard Notes - Synicing Server
|
||||
#=================================================
|
||||
|
@ -179,9 +234,35 @@ 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
|
||||
#=================================================
|
||||
ynh_script_progression --message="Installing Standard Notes - Extensions..." --weight=1
|
||||
|
||||
if [ $path_url = "/" ]
|
||||
then
|
||||
path=""
|
||||
else
|
||||
path=$path_url
|
||||
fi
|
||||
|
||||
ynh_replace_string --match_string="__DOMAIN__PATH__" --replace_string="$domain$path" --target_file="$final_path/live/public/extensions/repo.json"
|
||||
|
||||
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
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
|
@ -242,9 +323,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
|
||||
|
@ -266,7 +347,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1
|
|||
|
||||
# Start a systemd service
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
||||
sleep 15
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
|
@ -275,6 +355,38 @@ ynh_script_progression --message="Reloading nginx web server..." --weight=1
|
|||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
#=================================================
|
||||
# WAITING FOR SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Waiting for service..." --weight=1
|
||||
|
||||
is_service_ready
|
||||
|
||||
#=================================================
|
||||
# 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"
|
||||
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__"
|
||||
admin_mail_info="\
|
||||
New Feature ( 3.13.6~ynh4 ):\n\
|
||||
Now Standard Notes extensions are hosted with this package.\n\
|
||||
Only new users will get an e-mail with install instructions.\n\
|
||||
With the current SMTP settings you can not send e-mails to all e-mail providers. For example GMail will probably not recive this e-mails.\n\
|
||||
Please setup the SMTP account in this file: \"$final_path/live/.env\" under \"#Mailer settings\" if you want to fix this.\n\
|
||||
Please setup the Access-Domain for the extensions in the __URL_TAG1__config-panel__URL_TAG2__$admin_panel/config-panel__URL_TAG3__\
|
||||
"
|
||||
|
||||
echo -e "\
|
||||
Standard Notes - Syncing Server was successfully upgraded.\n\
|
||||
Please configure the Standard Notes web app or mobile app to use this syning server: https://$domain$path_url/\n\
|
||||
$config_panel\n\n\
|
||||
$admin_mail_info\
|
||||
" > message
|
||||
|
||||
ynh_send_readme_to_admin --app_message="message" --type='upgrade'
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
|
@ -97,7 +97,7 @@ ynh_install_ruby () {
|
|||
CONFIGURE_OPTS="--disable-install-doc --with-jemalloc" MAKE_OPTS="-j2" rbenv install --skip-existing $ruby_version
|
||||
|
||||
# Store the ID of this app and the version of ruby requested for it
|
||||
echo "$YNH_APP_ID:$ruby_version" | tee --append "$rbenv_install_dir/ynh_app_version"
|
||||
echo "$YNH_APP_INSTANCE_NAME:$ruby_version" | tee --append "$rbenv_install_dir/ynh_app_version"
|
||||
|
||||
# Store ruby_version into the config of this app
|
||||
ynh_app_setting_set $app ruby_version $ruby_version
|
||||
|
@ -127,7 +127,7 @@ ynh_remove_ruby () {
|
|||
ruby_version=$(ynh_app_setting_get $app ruby_version)
|
||||
|
||||
# Remove the line for this app
|
||||
sed --in-place "/$YNH_APP_ID:$ruby_version/d" "$rbenv_install_dir/ynh_app_version"
|
||||
sed --in-place "/$YNH_APP_INSTANCE_NAME:$ruby_version/d" "$rbenv_install_dir/ynh_app_version"
|
||||
|
||||
# If no other app uses this version of ruby, remove it.
|
||||
if ! grep --quiet "$ruby_version" "$rbenv_install_dir/ynh_app_version"
|
||||
|
|
223
sources/extra_files/app/app/views/user_mailer/welcome.html.erb
Normal file
223
sources/extra_files/app/app/views/user_mailer/welcome.html.erb
Normal file
|
@ -0,0 +1,223 @@
|
|||
<!DOCTYPE html>
|
||||
<html style="font-family: sans-serif; line-height: 1.3 !important; font-size: 18px; color: black !important; box-sizing: border-box; margin: 0; padding: 0;">
|
||||
<head>
|
||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
||||
<style>
|
||||
.sn-component .sk-panel a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.sn-component .sk-menu-panel .row:hover {
|
||||
background-color: #efefef;
|
||||
}
|
||||
.sn-component .sk-menu-panel .row .column .row:hover,
|
||||
.sn-component .sk-menu-panel .row .column .subrow:hover {
|
||||
background-color: #f7f7f7;
|
||||
}
|
||||
.sn-component .sk-button.default:hover,
|
||||
.sn-component .default.sk-box:hover,
|
||||
.sn-component .default.sk-circle:hover,
|
||||
.sn-component .sk-box.default:hover,
|
||||
.sn-component .sk-circle.default:hover {
|
||||
background-color: white; color: #939393;
|
||||
}
|
||||
.sn-component .sk-button.default.featured:hover,
|
||||
.sn-component .default.featured.sk-box:hover,
|
||||
.sn-component .default.featured.sk-circle:hover,
|
||||
.sn-component .sk-box.default.featured:hover,
|
||||
.sn-component .sk-circle.default.featured:hover {
|
||||
background-color: #9f9f9f;
|
||||
}
|
||||
.sn-component .sk-button.info:hover,
|
||||
.sn-component .info.sk-box:hover,
|
||||
.sn-component .info.sk-circle:hover,
|
||||
.sn-component .sk-box.info:hover,
|
||||
.sn-component .sk-circle.info:hover {
|
||||
background-color: #d5e9fd; color: #0975e5;
|
||||
}
|
||||
.sn-component .sk-button.info.featured:hover,
|
||||
.sn-component .info.featured.sk-box:hover,
|
||||
.sn-component .info.featured.sk-circle:hover,
|
||||
.sn-component .sk-box.info.featured:hover,
|
||||
.sn-component .sk-circle.info.featured:hover {
|
||||
background-color: #1181f6;
|
||||
}
|
||||
.sn-component .sk-button.warning:hover,
|
||||
.sn-component .warning.sk-box:hover,
|
||||
.sn-component .warning.sk-circle:hover,
|
||||
.sn-component .sk-box.warning:hover,
|
||||
.sn-component .sk-circle.warning:hover {
|
||||
background-color: #fff8ec; color: #ffaa06;
|
||||
}
|
||||
.sn-component .sk-button.warning.featured:hover,
|
||||
.sn-component .warning.featured.sk-box:hover,
|
||||
.sn-component .warning.featured.sk-circle:hover,
|
||||
.sn-component .sk-box.warning.featured:hover,
|
||||
.sn-component .sk-circle.warning.featured:hover {
|
||||
background-color: #ffb320;
|
||||
}
|
||||
.sn-component .sk-button.danger:hover,
|
||||
.sn-component .danger.sk-box:hover
|
||||
.sn-component .danger.sk-circle:hover,
|
||||
.sn-component .sk-box.danger:hover,
|
||||
.sn-component .sk-circle.danger:hover {
|
||||
background-color: #fff1f3; color: #fc0e2e;
|
||||
}
|
||||
.sn-component .sk-button.danger.featured:hover,
|
||||
.sn-component .danger.featured.sk-box:hover,
|
||||
.sn-component .danger.featured.sk-circle:hover,
|
||||
.sn-component .sk-box.danger.featured:hover,
|
||||
.sn-component .sk-circle.danger.featured:hover {
|
||||
background-color: #fc2744;
|
||||
}
|
||||
.sn-component .sk-button.success:hover,
|
||||
.sn-component .success.sk-box:hover,
|
||||
.sn-component .success.sk-circle:hover,
|
||||
.sn-component .sk-box.success:hover,
|
||||
.sn-component .sk-circle.success:hover {
|
||||
background-color: #b7f5a8; color: #2fa414;
|
||||
}
|
||||
.sn-component .sk-button.success.featured:hover,
|
||||
.sn-component .success.featured.sk-box:hover,
|
||||
.sn-component .success.featured.sk-circle:hover,
|
||||
.sn-component .sk-box.success.featured:hover,
|
||||
.sn-component .sk-circle.success.featured:hover {
|
||||
background-color: #35ba16;
|
||||
}
|
||||
.sn-component .sk-notification.info.featured:hover {
|
||||
background-color: #1181f6;
|
||||
}
|
||||
.sn-component .sk-notification.warning.featured:hover {
|
||||
background-color: #ffb320;
|
||||
}
|
||||
body {
|
||||
font-family: sans-serif; line-height: 1.3 !important; font-size: 18px; color: black !important; margin: 0; padding: 0;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
html {
|
||||
font-size: 17px !important;
|
||||
}
|
||||
body {
|
||||
font-size: 17px !important;
|
||||
}
|
||||
.sn-component .sk-panel .sk-panel-content {
|
||||
padding: 0.5rem 1.1rem !important;
|
||||
}
|
||||
.sn-component .sk-panel .sk-panel-footer {
|
||||
padding: 0.5rem 1.1rem !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body style="font-family: sans-serif; line-height: 1.3 !important; font-size: 18px; color: black !important; box-sizing: border-box; margin: 0; padding: 0;">
|
||||
<div class="sn-component" style='font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; box-sizing: border-box;'>
|
||||
<div class="sk-panel static" style="border-radius: 0; overflow: visible; box-shadow: none; box-sizing: border-box; border: none;">
|
||||
<div class="sk-panel-content" style="overflow: visible; overflow-y: visible !important; overflow-x: visible !important; box-sizing: border-box; padding: 1.6rem 2rem 0;">
|
||||
<div class="sk-panel-section" style="padding-bottom: 1.6rem; margin-bottom: 1.5rem; border-bottom-color: #DDDDDD; border-bottom-width: 1px; border-bottom-style: solid; box-sizing: border-box;">
|
||||
<div class="h1 title sk-panel-row" style="justify-content: space-between; align-items: center; padding-top: 0.4rem; padding-bottom: 0.4rem; font-size: 1.5rem !important; box-sizing: border-box;">
|
||||
<div class="sk-panel-column" style="box-sizing: border-box;">
|
||||
Welcome to
|
||||
<strong style="box-sizing: border-box;">Standard Notes.</strong>
|
||||
</div>
|
||||
</div>
|
||||
<div class="faded sk-panel-row small" style="justify-content: space-between; align-items: center; padding-top: 0.4rem; font-size: 14px !important; opacity: 0.5; box-sizing: border-box;">
|
||||
Registered as <%= @email %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sk-panel-section" style="padding-bottom: 1.6rem; box-sizing: border-box;">
|
||||
<p style="line-height: 1.3 !important; color: black !important; box-sizing: border-box; margin: 0.5rem 0 20px;">
|
||||
<i style="box-sizing: border-box;">Hi there,</i>
|
||||
</p>
|
||||
<p style="line-height: 1.3 !important; color: black !important; box-sizing: border-box; margin: 0.5rem 0 20px;">
|
||||
Welcome to your new private notes account.
|
||||
We created Standard Notes to be a safe, private, and lasting place for your most important work.
|
||||
</p>
|
||||
<p style="line-height: 1.3 !important; color: black !important; box-sizing: border-box; margin: 0.5rem 0 20px;">
|
||||
<strong style="box-sizing: border-box;">You should know:</strong>
|
||||
</p>
|
||||
<ol style="box-sizing: border-box;">
|
||||
<li style="line-height: 1.3; margin-bottom: 10px; box-sizing: border-box;">
|
||||
Your notes are fully encrypted on your device before they're ever sent to our servers.
|
||||
This means even we can't read the contents of your notes.
|
||||
</li>
|
||||
<li style="line-height: 1.3; margin-bottom: 10px; box-sizing: border-box;">
|
||||
Standard Notes is available on all your devices. Download the
|
||||
<a href="https://itunes.apple.com/us/app/standard-notes/id1285392450?mt=8" style="cursor: pointer; color: #086dd6; box-sizing: border-box; text-decoration: none;">iOS</a>
|
||||
and
|
||||
<a href="https://play.google.com/store/apps/details?id=com.standardnotes" style="cursor: pointer; color: #086dd6; box-sizing: border-box; text-decoration: none;">Android</a>
|
||||
app to go mobile. Use the
|
||||
<a href="https://app.standardnotes.org" style="cursor: pointer; color: #086dd6; box-sizing: border-box; text-decoration: none;">web app</a> on the go. Or download the desktop app on
|
||||
<a href="https://standardnotes.org/download/mac" style="cursor: pointer; color: #086dd6; box-sizing: border-box; text-decoration: none;">Mac</a>, <a href="https://standardnotes.org/download/windows" style="cursor: pointer; color: #086dd6; box-sizing: border-box; text-decoration: none;">Windows</a>, and <a href="https://standardnotes.org/download/linux" style="cursor: pointer; color: #086dd6; box-sizing: border-box; text-decoration: none;">Linux</a>.
|
||||
</li>
|
||||
</ol>
|
||||
<p style="line-height: 1.3 !important; color: black !important; box-sizing: border-box; margin: 0.5rem 0 20px;">
|
||||
<strong style="box-sizing: border-box;">Install instructions for Extensions:</strong>
|
||||
</p>
|
||||
<ol style="box-sizing: border-box;">
|
||||
<li style="line-height: 1.3; margin-bottom: 10px; box-sizing: border-box;">
|
||||
Open the Standard Notes web or Desktop app
|
||||
</li>
|
||||
<li style="line-height: 1.3; margin-bottom: 10px; box-sizing: border-box;">
|
||||
Press <strong>Extensions</strong> in the button left corner
|
||||
</li>
|
||||
<li style="line-height: 1.3; margin-bottom: 10px; box-sizing: border-box;">
|
||||
Press on <strong>Import Extensions</strong> in the button right corner of the new window.
|
||||
</li>
|
||||
<li style="line-height: 1.3; margin-bottom: 10px; box-sizing: border-box;">
|
||||
Enter <strong>https://__DOMAIN____PATH__/extensions/repo.json</strong> in the field.
|
||||
</li>
|
||||
<li style="line-height: 1.3; margin-bottom: 10px; box-sizing: border-box;">
|
||||
Press <strong>Enter</strong> on your keyboard.
|
||||
</li>
|
||||
<li style="line-height: 1.3; margin-bottom: 10px; box-sizing: border-box;">
|
||||
Now you can see Editors, Themes and Components which you can install
|
||||
</li>
|
||||
</ol>
|
||||
<h4 class="sk-panel-row" style="justify-content: space-between; align-items: center; font-weight: bold; font-size: 0.95rem; line-height: 1.4rem; box-sizing: border-box; margin: 0; padding: 0.4rem 0;">To have all Standard Notes extensions use <strong>Standard Notes Extened</strong>:</h4>
|
||||
<div class="sk-panel-row" style="justify-content: space-between; align-items: center; padding-top: 0.4rem; padding-bottom: 0.4rem; box-sizing: border-box;"></div>
|
||||
<div class="horizontal-blocks center extended boxed gray" style="box-sizing: border-box;">
|
||||
<div class="h-block blue-stroke purchase-box" style="width: 100%; box-sizing: border-box; background-color: #f8f8f8; color: black !important; border-radius: 3px !important; margin-right: 40px; margin-bottom: 40px; padding: 15px 30px 30px; border: 1px solid #086dd6;">
|
||||
<p class="box-title" style="line-height: 1.3 !important; color: black !important; box-sizing: border-box; font-size: 26px; margin: 0.5rem 0 20px;">Standard Notes <strong class="extended-text" style="box-sizing: border-box; border-left-style: solid; border-left-color: #086dd6; border-left-width: 3px; padding-left: 10px; margin-left: 5px;">Extended</strong></p>
|
||||
<p style="line-height: 1.3 !important; color: black !important; box-sizing: border-box; margin: 0.5rem 0 20px;">
|
||||
Unlock entirely new workflows with powerful editors and cloud backup options
|
||||
with
|
||||
<a href="https://standardnotes.org/extensions" style="cursor: pointer; color: #086dd6; box-sizing: border-box; text-decoration: none;">Extended.</a>
|
||||
Extended is our paid extensions program, and how we support continued development on Standard Notes.
|
||||
</p>
|
||||
<p style="line-height: 1.3 !important; color: black !important; box-sizing: border-box; margin: 0.5rem 0 20px;">
|
||||
<strong style="box-sizing: border-box;">Benefits:</strong>
|
||||
</p>
|
||||
<ul class="no-bullet" style="list-style-type: none !important; padding-left: 0; margin-left: 0; box-sizing: border-box;">
|
||||
<li style="line-height: 1.3; margin-bottom: 10px; box-sizing: border-box;">
|
||||
<p style="line-height: 1.3 !important; color: black !important; box-sizing: border-box; margin: 0.5rem 0 20px;"><span class="checkmark" style="box-sizing: border-box; color: #086dd6; margin-right: 5px;">✓</span> Encrypted attachments for your notes stored directly in your Dropbox, Google Drive, or WebDAV.</p>
|
||||
</li>
|
||||
<li style="line-height: 1.3; margin-bottom: 10px; box-sizing: border-box;">
|
||||
<p style="line-height: 1.3 !important; color: black !important; box-sizing: border-box; margin: 0.5rem 0 20px;"><span class="checkmark" style="box-sizing: border-box; color: #086dd6; margin-right: 5px;">✓</span> Unlimited access to powerful extensions, editors, and beautiful themes.</p>
|
||||
</li>
|
||||
<li style="line-height: 1.3; margin-bottom: 10px; box-sizing: border-box;">
|
||||
<p style="line-height: 1.3 !important; color: black !important; box-sizing: border-box; margin: 0.5rem 0 20px;"><span class="checkmark" style="box-sizing: border-box; color: #086dd6; margin-right: 5px;">✓</span> Note version history (up to 100 years)</p>
|
||||
</li>
|
||||
<li style="line-height: 1.3; margin-bottom: 10px; box-sizing: border-box;">
|
||||
<p style="line-height: 1.3 !important; color: black !important; box-sizing: border-box; margin: 0.5rem 0 20px;"><span class="checkmark" style="box-sizing: border-box; color: #086dd6; margin-right: 5px;">✓</span> Automatic daily backups of your data to your email inbox, Dropbox, OneDrive, and Google Drive</p>
|
||||
</li>
|
||||
<li style="line-height: 1.3; margin-bottom: 10px; box-sizing: border-box;">
|
||||
<p style="line-height: 1.3 !important; color: black !important; box-sizing: border-box; margin: 0.5rem 0 20px;"><span class="checkmark" style="box-sizing: border-box; color: #086dd6; margin-right: 5px;">✓</span> Two-factor authentication</p>
|
||||
</li>
|
||||
<li style="line-height: 1.3; margin-bottom: 10px; box-sizing: border-box;">
|
||||
<p style="line-height: 1.3 !important; color: black !important; box-sizing: border-box; margin: 0.5rem 0 20px;"><span class="checkmark" style="box-sizing: border-box; color: #086dd6; margin-right: 5px;">✓</span> Support our mission for privacy and longevity in software</p>
|
||||
</li>
|
||||
</ul>
|
||||
<a class="price-box blue" href="https://standardnotes.org/extensions" style="cursor: pointer; color: #086dd6; box-sizing: border-box; text-decoration: none;">
|
||||
<p style="line-height: 1.3 !important; color: black !important; box-sizing: border-box; margin: 0.5rem 0 20px;">As low as</p>
|
||||
<h1 class="amount" style="font-weight: 500; font-size: 1.5rem !important; line-height: 1.9rem; box-sizing: border-box; margin: 0; padding: 0;">$2.48/month</h1>
|
||||
</a>
|
||||
<a class="sk-button info right featured" style="margin-top: 20px; cursor: pointer; color: white; text-decoration: none; display: block; font-size: 1.1rem; text-align: center; background-color: #086DD6; box-sizing: border-box; padding: 0.75rem 1.25rem; border: 1px none #086dd6;" href="https://standardnotes.org/extensions">
|
||||
<div class="sk-label" style="font-weight: bold; box-sizing: border-box;">Learn More</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
302
sources/extra_files/app/public/extensions/repo.json
Normal file
302
sources/extra_files/app/public/extensions/repo.json
Normal file
|
@ -0,0 +1,302 @@
|
|||
{
|
||||
"content_type": "SN|Repo",
|
||||
"packages": [
|
||||
{
|
||||
"area": "theme",
|
||||
"content_type": "SN|Theme",
|
||||
"description": "Autobiography",
|
||||
"dock_icon": {
|
||||
"background_color": "#9D7441",
|
||||
"border_color": "#9D7441",
|
||||
"foreground_color": "#ECE4DB",
|
||||
"type": "circle"
|
||||
},
|
||||
"download_url": "https://github.com/sn-extensions/autobiography-theme/archive/1.0.0.zip",
|
||||
"identifier": "org.stndardnotes.autobiography-theme",
|
||||
"latest_url": "https://__DOMAIN__PATH__/extensions/src/autobiography-theme.json",
|
||||
"name": "Autobiography Theme",
|
||||
"url": "https://__DOMAIN__PATH__/extensions/src/autobiography-theme/dist/dist.css",
|
||||
"version": "1.0.0"
|
||||
},
|
||||
{
|
||||
"area": "theme",
|
||||
"content_type": "SN|Theme",
|
||||
"description": "Light on the eyes, heavy on the spirit.",
|
||||
"dock_icon": {
|
||||
"background_color": "#a464c2",
|
||||
"border_color": "#a464c2",
|
||||
"foreground_color": "#ffffff",
|
||||
"type": "circle"
|
||||
},
|
||||
"download_url": "https://github.com/sn-extensions/focus-theme/archive/1.2.3.zip",
|
||||
"identifier": "org.stndardnotes.focus-theme",
|
||||
"latest_url": "https://__DOMAIN__PATH__/extensions/src/focus-theme.json",
|
||||
"name": "Focus Theme",
|
||||
"url": "https://__DOMAIN__PATH__/extensions/src/focus-theme/dist/dist.css",
|
||||
"version": "1.2.3"
|
||||
},
|
||||
{
|
||||
"area": "theme",
|
||||
"content_type": "SN|Theme",
|
||||
"description": "Calm and relaxed. Take some time off.",
|
||||
"dock_icon": {
|
||||
"background_color": "#fca429",
|
||||
"border_color": "#fca429",
|
||||
"foreground_color": "#ffffff",
|
||||
"type": "circle"
|
||||
},
|
||||
"download_url": "https://github.com/sn-extensions/futura-theme/archive/1.2.2.zip",
|
||||
"identifier": "org.standardnotes.futura-theme",
|
||||
"latest_url": "https://__DOMAIN__PATH__/extensions/src/futura-theme.json",
|
||||
"name": "Futura Theme",
|
||||
"url": "https://__DOMAIN__PATH__/extensions/src/futura-theme/dist/dist.css",
|
||||
"version": "1.2.2"
|
||||
},
|
||||
{
|
||||
"area": "theme",
|
||||
"content_type": "SN|Theme",
|
||||
"description": "Elegant utilitarianism.",
|
||||
"dock_icon": {
|
||||
"background_color": "#086DD6",
|
||||
"border_color": "#086DD6",
|
||||
"foreground_color": "#ffffff",
|
||||
"type": "circle"
|
||||
},
|
||||
"download_url": "https://github.com/sn-extensions/midnight-theme/archive/1.2.1.zip",
|
||||
"identifier": "org.standardnotes.midnight-theme",
|
||||
"latest_url": "https://__DOMAIN__PATH__/extensions/src/midnight-theme.json",
|
||||
"name": "Midnight Theme",
|
||||
"url": "https://__DOMAIN__PATH__/extensions/src/midnight-theme/dist/dist.css",
|
||||
"version": "1.2.1"
|
||||
},
|
||||
{
|
||||
"area": "theme",
|
||||
"content_type": "SN|Theme",
|
||||
"description": "The perfect theme for any time.",
|
||||
"dock_icon": {
|
||||
"background_color": "#2AA198",
|
||||
"border_color": "#2AA198",
|
||||
"foreground_color": "#ffffff",
|
||||
"type": "circle"
|
||||
},
|
||||
"download_url": "https://github.com/sn-extensions/solarized-dark-theme/archive/1.2.1.zip",
|
||||
"identifier": "org.stndardnotes.solarized-dark-theme",
|
||||
"latest_url": "https://__DOMAIN__PATH__/extensions/src/solarized-dark-theme.json",
|
||||
"name": "Solarized Dark Theme",
|
||||
"url": "https://__DOMAIN__PATH__/extensions/src/solarized-theme/dist/dist.css",
|
||||
"version": "1.2.1"
|
||||
},
|
||||
{
|
||||
"area": "theme",
|
||||
"content_type": "SN|Theme",
|
||||
"description": "Light on the eyes, heavy on the spirit.",
|
||||
"dock_icon": {
|
||||
"background_color": "#6e2b9e",
|
||||
"border_color": "#6e2b9e",
|
||||
"foreground_color": "#ffffff",
|
||||
"type": "circle"
|
||||
},
|
||||
"download_url": "https://github.com/sn-extensions/titanium-theme/archive/1.2.2.zip",
|
||||
"identifier": "org.stndardnotes.titanium-theme",
|
||||
"latest_url": "https://__DOMAIN__PATH__/extensions/src/titanium-theme.json",
|
||||
"name": "Titanium Theme",
|
||||
"url": "https://__DOMAIN__PATH__/extensions/src/titanium-theme/dist/dist.css",
|
||||
"version": "1.2.2"
|
||||
},
|
||||
{
|
||||
"area": "theme",
|
||||
"content_type": "SN|Theme",
|
||||
"description": "A smart theme that minimizes the tags and notes panels when they are not in use..",
|
||||
"download_url": "https://github.com/sn-extensions/dynamic-theme/archive/1.0.0.zip",
|
||||
"identifier": "org.standardnotes.dynamic-theme",
|
||||
"latest_url": "https://__DOMAIN__PATH__/extensions/src/dynamic-theme.json",
|
||||
"layerable": true,
|
||||
"name": "Dynamic Theme",
|
||||
"no_mobile": true,
|
||||
"url": "https://__DOMAIN__PATH__/extensions/src/dynamic-theme/dist/dist.css",
|
||||
"version": "1.0.0"
|
||||
},
|
||||
{
|
||||
"area": "theme",
|
||||
"content_type": "SN|Theme",
|
||||
"description": "A distraction-free writing environment for high levels of clarity and focus.",
|
||||
"dock_icon": {
|
||||
"source": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path d=\"M424 64H88c-26.6 0-48 21.6-48 48v288c0 26.4 21.4 48 48 48h336c26.4 0 48-21.6 48-48V112c0-26.4-21.4-48-48-48zm0 336H88V176h336v224z\"/></svg>",
|
||||
"type": "svg"
|
||||
},
|
||||
"download_url": "https://github.com/sn-extensions/no-distraction-theme/archive/1.2.2.zip",
|
||||
"identifier": "org.standardnotes.no-distraction",
|
||||
"latest_url": "https://__DOMAIN__PATH__/extensions/src/no-distraction-theme.json",
|
||||
"layerable": true,
|
||||
"name": "No Distraction Theme",
|
||||
"no_mobile": true,
|
||||
"url": "https://__DOMAIN__PATH__/extensions/src/no-distraction-theme/dist/dist.css",
|
||||
"version": "1.2.2"
|
||||
},
|
||||
{
|
||||
"area": "editor-editor",
|
||||
"content_type": "SN|Component",
|
||||
"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.",
|
||||
"download_url": "https://github.com/standardnotes/bold-editor/archive/1.1.0.zip",
|
||||
"identifier": "org.standardnotes.bold-editor",
|
||||
"latest_url": "https://__DOMAIN__PATH__/extensions/src/bold-editor.json",
|
||||
"name": "Bold Editor",
|
||||
"url": "https://__DOMAIN__PATH__/extensions/src/bold-editor/dist/index.html",
|
||||
"version": "1.1.0"
|
||||
},
|
||||
{
|
||||
"area": "editor-editor",
|
||||
"content_type": "SN|Component",
|
||||
"description": "Syntax highlighting and convenient keyboard shortcuts for over 120 programming languages. Ideal for code snippets and procedures.",
|
||||
"download_url": "https://github.com/standardnotes/code-editor/archive/1.3.5.zip",
|
||||
"identifier": "org.standardnotes.code-editor",
|
||||
"latest_url": "https://__DOMAIN__PATH__/extensions/src/code-editor.json",
|
||||
"name": "Code Editor",
|
||||
"url": "https://__DOMAIN__PATH__/extensions/src/code-editor/index.html",
|
||||
"version": "1.3.5"
|
||||
},
|
||||
{
|
||||
"area": "editor-editor",
|
||||
"content_type": "SN|Component",
|
||||
"description": "A Markdown editor with dynamic split-pane preview.",
|
||||
"download_url": "https://github.com/standardnotes/markdown-basic/archive/1.3.6.zip",
|
||||
"identifier": "org.standardnotes.markdown-basic-editor",
|
||||
"latest_url": "https://__DOMAIN__PATH__/extensions/src/markdown-basic.json",
|
||||
"name": "Markdown Basic",
|
||||
"url": "https://__DOMAIN__PATH__/extensions/src/markdown-basic/dist/index.html",
|
||||
"version": "1.3.6"
|
||||
},
|
||||
{
|
||||
"area": "editor-editor",
|
||||
"content_type": "SN|Component",
|
||||
"description": "A fully featured Markdown editor that supports live preview, a styling toolbar, and split pane support.",
|
||||
"download_url": "https://github.com/standardnotes/markdown-pro/archive/1.3.9.zip",
|
||||
"identifier": "org.standardnotes.markdown-pro",
|
||||
"latest_url": "https://__DOMAIN__PATH__/extensions/src/markdown-pro.json",
|
||||
"name": "Markdown Pro",
|
||||
"url": "https://__DOMAIN__PATH__/extensions/src/markdown-pro/index.html",
|
||||
"version": "1.3.9"
|
||||
},
|
||||
{
|
||||
"area": "editor-editor",
|
||||
"content_type": "SN|Component",
|
||||
"description": "A beautiful split-pane Markdown editor with synced-scroll, LaTeX support, and colorful syntax.",
|
||||
"download_url": "https://github.com/sn-extensions/math-editor/archive/1.3.4.zip",
|
||||
"identifier": "org.standardnotes.math-editor",
|
||||
"latest_url": "https://__DOMAIN__PATH__/extensions/src/math-editor.json",
|
||||
"name": "Math Editor",
|
||||
"url": "https://__DOMAIN__PATH__/extensions/src/math-editor/index.html",
|
||||
"version": "1.3.4"
|
||||
},
|
||||
{
|
||||
"area": "editor-editor",
|
||||
"content_type": "SN|Component",
|
||||
"description": "A minimal Markdown editor with inline style support.",
|
||||
"download_url": "https://github.com/sn-extensions/minimal-markdown-editor/archive/1.3.5.zip",
|
||||
"identifier": "org.stndardnotes.minimal-markdown-editor",
|
||||
"latest_url": "https://__DOMAIN__PATH__/extensions/src/minimal-markdown-editor.json",
|
||||
"name": "Minimal Markdown Editor",
|
||||
"url": "https://__DOMAIN__PATH__/extensions/src/minimal-markdown-editor/index.html",
|
||||
"version": "1.3.5"
|
||||
},
|
||||
{
|
||||
"area": "editor-editor",
|
||||
"content_type": "SN|Component",
|
||||
"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.)",
|
||||
"download_url": "https://github.com/standardnotes/plus-editor/archive/1.4.3.zip",
|
||||
"identifier": "org.standardnotes.plus-editor",
|
||||
"latest_url": "https://__DOMAIN__PATH__/extensions/src/plus-editor.json",
|
||||
"name": "Plus Editor",
|
||||
"url": "https://__DOMAIN__PATH__/extensions/src/plus-editor/index.html",
|
||||
"version": "1.4.3"
|
||||
},
|
||||
{
|
||||
"area": "editor-editor",
|
||||
"content_type": "SN|Component",
|
||||
"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.",
|
||||
"download_url": "https://github.com/sn-extensions/simple-task-editor/archive/1.3.5.zip",
|
||||
"identifier": "org.standardnotes.simple-task-editor",
|
||||
"latest_url": "https://__DOMAIN__PATH__/extensions/src/simple-task-editor.json",
|
||||
"name": "Task Editor",
|
||||
"url": "https://__DOMAIN__PATH__/extensions/src/simple-task-editor/dist/index.html",
|
||||
"version": "1.3.5"
|
||||
},
|
||||
{
|
||||
"area": "editor-editor",
|
||||
"content_type": "SN|Component",
|
||||
"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.",
|
||||
"download_url": "https://github.com/sn-extensions/token-vault/archive/1.0.5.zip",
|
||||
"identifier": "org.stndardnotes.token-vault",
|
||||
"latest_url": "https://__DOMAIN__PATH__/extensions/src/token-vault.json",
|
||||
"name": "Token Vault",
|
||||
"url": "https://__DOMAIN__PATH__/extensions/src/token-vault/dist/index.html",
|
||||
"version": "1.0.5"
|
||||
},
|
||||
{
|
||||
"area": "editor-editor",
|
||||
"content_type": "SN|Component",
|
||||
"description": "A code editor with Vim key bindings.",
|
||||
"download_url": "https://github.com/sn-extensions/vim-editor/archive/1.3.2.zip",
|
||||
"identifier": "org.stndardnotes.vim-editor",
|
||||
"latest_url": "https://__DOMAIN__PATH__/extensions/src/vim-editor.json",
|
||||
"name": "Vim Editor",
|
||||
"url": "https://__DOMAIN__PATH__/extensions/src/vim-editor/index.html",
|
||||
"version": "1.3.2"
|
||||
},
|
||||
{
|
||||
"area": "editor-stack",
|
||||
"content_type": "SN|Component",
|
||||
"description": "Useful utility bar with information about the current note as well as actions like duplicate, copy, and save.",
|
||||
"download_url": "https://github.com/standardnotes/action-bar/archive/1.3.1.zip",
|
||||
"identifier": "org.stndardnotes.action-bar",
|
||||
"latest_url": "https://__DOMAIN__PATH__/extensions/src/action-bar.json",
|
||||
"name": "Action Bar",
|
||||
"url": "https://__DOMAIN__PATH__/extensions/src/action-bar/index.html",
|
||||
"version": "1.3.1"
|
||||
},
|
||||
{
|
||||
"area": "tags-list",
|
||||
"content_type": "SN|Component",
|
||||
"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.",
|
||||
"download_url": "https://github.com/standardnotes/folders-component/archive/1.3.5.zip",
|
||||
"identifier": "org.stndardnotes.folders-component",
|
||||
"latest_url": "https://__DOMAIN__PATH__/extensions/src/folders-component.json",
|
||||
"name": "Folders",
|
||||
"url": "https://__DOMAIN__PATH__/extensions/src/folders-component/index.html",
|
||||
"version": "1.3.5"
|
||||
},
|
||||
{
|
||||
"area": "editor-stack",
|
||||
"content_type": "SN|Component",
|
||||
"description": "Push note changes to a public or private GitHub repository, with options for file extension and commit message.",
|
||||
"download_url": "https://github.com/sn-extensions/github-push/archive/1.2.2.zip",
|
||||
"identifier": "org.stndardnotes.github-push",
|
||||
"latest_url": "https://__DOMAIN__PATH__/extensions/src/github-push.json",
|
||||
"name": "Github Push",
|
||||
"url": "https://__DOMAIN__PATH__/extensions/src/github-push/index.html",
|
||||
"version": "1.2.2"
|
||||
},
|
||||
{
|
||||
"area": "modal",
|
||||
"content_type": "SN|Component",
|
||||
"description": "Set up 2FA to enable an extra layer of security on your private notes account.",
|
||||
"download_url": "https://github.com/sn-extensions/mfa-link/archive/1.2.2.zip",
|
||||
"identifier": "org.stndardnotes.mfa-link",
|
||||
"latest_url": "https://__DOMAIN__PATH__/extensions/src/mfa-link.json",
|
||||
"name": "MFA-Link",
|
||||
"url": "https://__DOMAIN__PATH__/extensions/src/mfa-link/dist/index.html",
|
||||
"version": "1.2.2"
|
||||
},
|
||||
{
|
||||
"area": "note-tags",
|
||||
"content_type": "SN|Component",
|
||||
"description": "Work more efficiently by quickly selecting from a live list of tags while you type. Supports keyboard shortcuts and folders.",
|
||||
"download_url": "https://github.com/standardnotes/quick-tags/archive/1.3.2.zip",
|
||||
"identifier": "org.stndardnotes.quick-tags",
|
||||
"latest_url": "https://__DOMAIN__PATH__/extensions/src/quick-tags.json",
|
||||
"name": "Quick Tags",
|
||||
"url": "https://__DOMAIN__PATH__/extensions/src/quick-tags/index.html",
|
||||
"version": "1.3.2"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -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/action-bar.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"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
|
@ -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"
|
||||
}
|
|
@ -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
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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/folders-component.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"
|
||||
}
|
||||
}
|
|
@ -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/github-push.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"
|
||||
}
|
|
@ -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"
|
||||
}
|
|
@ -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"
|
||||
}
|
11
sources/extra_files/app/public/extensions/src/mfa-link.json
Normal file
11
sources/extra_files/app/public/extensions/src/mfa-link.json
Normal file
|
@ -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/mfa-link.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"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
|
@ -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":"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path d=\"M424 64H88c-26.6 0-48 21.6-48 48v288c0 26.4 21.4 48 48 48h336c26.4 0 48-21.6 48-48V112c0-26.4-21.4-48-48-48zm0 336H88V176h336v224z\"/></svg>"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
|
@ -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/quick-tags.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"
|
||||
}
|
|
@ -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-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"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
|
@ -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"
|
||||
}
|
49
sources/patches/app-01-add-mail.patch
Normal file
49
sources/patches/app-01-add-mail.patch
Normal file
|
@ -0,0 +1,49 @@
|
|||
diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb
|
||||
index a813bad..b7f2e2f 100644
|
||||
--- a/app/mailers/application_mailer.rb
|
||||
+++ b/app/mailers/application_mailer.rb
|
||||
@@ -1,4 +1,4 @@
|
||||
class ApplicationMailer < ActionMailer::Base
|
||||
- default from: 'Standard Notes <help@standardnotes.org>'
|
||||
+ default from: 'Standard Notes <__MAIL__>'
|
||||
layout 'mailer'
|
||||
end
|
||||
diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb
|
||||
index 6bbbb11..ac7f55e 100644
|
||||
--- a/app/mailers/user_mailer.rb
|
||||
+++ b/app/mailers/user_mailer.rb
|
||||
@@ -25,4 +25,9 @@ class UserMailer < ApplicationMailer
|
||||
user = User.find(user_id)
|
||||
mail(to: user.email, subject: 'Two-factor authentication has been disabled for your account.')
|
||||
end
|
||||
+
|
||||
+ def welcome(user)
|
||||
+ @email = user.email
|
||||
+ mail(to: @email, subject: 'Welcome to your private notes account')
|
||||
+ end
|
||||
end
|
||||
diff --git a/config/application.rb b/config/application.rb
|
||||
index 3c749e2..feff27c 100644
|
||||
--- a/config/application.rb
|
||||
+++ b/config/application.rb
|
||||
@@ -79,7 +79,7 @@ module SyncingServer
|
||||
:user_name => ENV['SMTP_USERNAME'],
|
||||
:password => ENV['SMTP_PASSWORD'],
|
||||
:authentication => 'login',
|
||||
- :enable_starttls_auto => true # detects and uses STARTTLS
|
||||
+ :enable_starttls_auto => ENV['SMTP_STARTTLS'].present? # detects and uses STARTTLS
|
||||
}
|
||||
|
||||
# Custom configuration
|
||||
diff --git a/lib/sync_engine/abstract/user_manager.rb b/lib/sync_engine/abstract/user_manager.rb
|
||||
index 26a549a..af92835 100644
|
||||
--- a/lib/sync_engine/abstract/user_manager.rb
|
||||
+++ b/lib/sync_engine/abstract/user_manager.rb
|
||||
@@ -29,6 +29,7 @@ module SyncEngine
|
||||
else
|
||||
user = @user_class.new(email: email, encrypted_password: hash_password(password))
|
||||
user.update!(registration_params(params))
|
||||
+ UserMailer.welcome(user).deliver_later
|
||||
return success_auth_response(user, params)
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue