1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/snweb_ynh.git synced 2024-09-03 20:26:22 +02:00

Fix: modify ynh package for new upstream app source

This commit is contained in:
Fabian Wilkens 2022-07-11 20:17:12 +02:00
parent 40d878069f
commit b5e262762e
No known key found for this signature in database
GPG key ID: 23DFA025BB4E9FAB
10 changed files with 28 additions and 79 deletions

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/standardnotes/app/archive/refs/tags/3.20.2.tar.gz
SOURCE_SUM=6EE98FA8CEDCC7743419ED528E0A5B5AF5253373895AEC3E87EFFCA7D150122B
SOURCE_URL=https://github.com/standardnotes/app/archive/refs/tags/@standardnotes/web@3.39.1.tar.gz
SOURCE_SUM=1dc84e151c20f5a31cf8b6f9c1248b14d2f72800f58557ddb8fe8ee54d360c58
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true

View file

@ -1,33 +1,15 @@
RAILS_ENV=production
PORT=__PORT__
WEB_CONCURRENCY=0
RAILS_LOG_TO_STDOUT=true
# Log Level options: "INFO" | "DEBUG" | "INFO" | "WARN" | "ERROR" | "FATAL"
RAILS_LOG_LEVEL=INFO
RAILS_SERVE_STATIC_FILES=true
SECRET_KEY_BASE=__SECRET_KEY_BASE__
APP_HOST=http://__DOMAIN____PATH__/
PURCHASE_URL=https://standardnotes.com/purchase
PLANS_URL=https://standardnotes.com/plans
DASHBOARD_URL=http://standardnotes.com/dashboard
DEFAULT_SYNC_SERVER=https://__SNSERVER_DOMAIN__/
WEBSOCKET_URL=wss://sockets-dev.standardnotes.com
ENABLE_UNFINISHED_FEATURES=false
# Subscription related endpoints
DASHBOARD_URL=http://standardnotes.com/dashboard
PLANS_URL=https://standardnotes.com/plans
PURCHASE_URL=https://standardnotes.com/purchase
# NewRelic (Optional)
NEW_RELIC_ENABLED=false
NEW_RELIC_THREAD_PROFILER_ENABLED=false
NEW_RELIC_LICENSE_KEY=
NEW_RELIC_APP_NAME=Web
NEW_RELIC_BROWSER_MONITORING_AUTO_INSTRUMENT=false
DEV_ACCOUNT_EMAIL=
DEV_ACCOUNT_PASSWORD=
DEV_ACCOUNT_SERVER=
# Used by Rails internals and not Standard Notes related
SECRET_KEY_BASE=__SECRET_KEY_BASE__
# Sub-URI
RAILS_RELATIVE_URL_ROOT=__PATH__/

View file

@ -1,10 +1,10 @@
location __PATH__/ {
# Path to source
alias __FINALPATH__/live/public ;
alias __FINALPATH__/live/packages/web-server/public ;
# Common parameter to increase upload size limit in conjunction with dedicated php-fpm file
client_max_body_size 25M;
client_max_body_size 50M;
proxy_pass http://127.0.0.1:__PORT____PATH__/;
proxy_http_version 1.1;

View file

@ -7,8 +7,8 @@ Type=simple
User=__APP__
Group=__APP__
EnvironmentFile=__FINALPATH__/live/.env
WorkingDirectory=__FINALPATH__/live/
ExecStart=__RBENV_INSTALL_DIR__/versions/__APP__/bin/bundle exec puma -C config/puma.rb -p __PORT__ -e production
WorkingDirectory=__FINALPATH__/live/packages/web-server/
ExecStart=__RBENV_INSTALL_DIR__/versions/__APP__/bin/bundle exec rails s -b 0.0.0.0 -p __PORT__ -e production
StandardOutput=append:/var/log/__APP__/snweb.log
StandardError=inherit
Restart=always

View file

@ -1,10 +1,10 @@
* No single-sign on or LDAP integration
* The app requires up 1500MB of RAM to install
* The app requires at least 80MB of RAM to work properly.
* The app requires around 1000MB of disk.
* The app requires at least 100MB of RAM to work properly.
* The app requires around 3500MB of disk.
* A dedicated domain is requierd if you want to use extensions.
* notes.your-domain.tld/ -> Extension Manager is working
* your-domain.tld/notes/ -> Extension Manager is not working
* notes.your-domain.tld/ -> Extensions are working
* your-domain.tld/notes/ -> Extensions are not working
* The config-file is stored under "/opt/yunohost/$app/live/.env"

View file

@ -6,7 +6,7 @@
"en": "End-to-end encrypted note-taking app",
"fr": "Application de prise de notes chiffrées"
},
"version": "3.20.2~ynh1",
"version": "3.39.1~ynh1",
"url": "https://github.com/standardnotes/web",
"upstream": {
"license": "AGPL-3.0-or-later",
@ -58,7 +58,7 @@
"en": "Choose the default Standard Notes Syncing Server",
"de": "Wähle den Standard Notes Syncing Server"
},
"default": "sync.standardnotes.org"
"default": "api.standardnotes.org"
}
]
}

View file

@ -6,19 +6,11 @@
# dependencies used by the app
pkg_dependencies="\
zlib1g-dev \
libssl-dev \
libjemalloc-dev \
python2-minimal \
git \
"
RUBY_VERSION="2.7.3"
RUBY_VERSION="2.7.4"
NODEJS_VERSION="16"
SOURCE="https://github.com/standardnotes/web"
COMMIT="4d581feb0ac862e5face27be3fd52ac39f565d23"
node_max_old_space_size=2048
#=================================================

View file

@ -96,14 +96,6 @@ chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app: "$final_path"
# Set permissions to app files
mkdir -p "$final_path/live/log"
chown -R $app: "$final_path/live/log"
mkdir -p "$final_path/live/public"
chown -R $app: "$final_path/live/public"
mkdir -p "$final_path/live/tmp"
chown -R $app: "$final_path/live/tmp"
#=================================================
# NGINX CONFIGURATION
#=================================================
@ -146,13 +138,9 @@ chown -R $app: "$final_path"
pushd "$final_path/live"
ynh_use_nodejs
ynh_exec_as $app $ynh_ruby_load_path bin/bundle config set --local path 'vendor/bundle'
ynh_exec_as $app $ynh_ruby_load_path bin/bundle config set with 'development'
ynh_exec_warn_less ynh_exec_as $app $ynh_ruby_load_path bin/bundle update -j$(getconf _NPROCESSORS_ONLN) --quiet
ynh_exec_warn_less ynh_exec_as $app $ynh_ruby_load_path bin/bundle install -j$(getconf _NPROCESSORS_ONLN) --quiet
ynh_exec_warn_less ynh_exec_as $app env NODE_OPTIONS="--max-old-space-size=$node_max_old_space_size" PATH=$ynh_node_load_PATH yarn install --pure-lockfile
ynh_exec_warn_less ynh_exec_as $app env NODE_OPTIONS="--max-old-space-size=$node_max_old_space_size" PATH=$ynh_node_load_PATH yarn bundle
ynh_exec_warn_less ynh_exec_as $app $ynh_ruby_load_path bin/bundle exec rails assets:precompile --quiet
ynh_exec_warn_less ynh_exec_as $app env NODE_OPTIONS="--max-old-space-size=$node_max_old_space_size" PATH=$ynh_node_load_PATH yarn install
ynh_exec_warn_less ynh_exec_as $app env NODE_OPTIONS="--max-old-space-size=$node_max_old_space_size" PATH=$ynh_node_load_PATH yarn build:web-server
ynh_exec_warn_less ynh_exec_as $app env NODE_OPTIONS="--max-old-space-size=$node_max_old_space_size" PATH=$ynh_node_load_PATH yarn build:web
popd
#=================================================
@ -174,7 +162,6 @@ mkdir -p "/var/log/$app"
chown -R $app: "/var/log/$app"
# Use logrotate to manage application logfile(s)
ynh_use_logrotate --logfile="$final_path/live/log/production.log"
ynh_use_logrotate --logfile="/var/log/$app/$app.log"
#=================================================

View file

@ -107,13 +107,6 @@ chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app: "$final_path"
mkdir -p "$final_path/live/log"
chown -R $app: "$final_path/live/log"
mkdir -p "$final_path/live/public"
chown -R $app: "$final_path/live/public"
mkdir -p "$final_path/live/tmp"
chown -R $app: "$final_path/live/tmp"
#=================================================
# NGINX CONFIGURATION
#=================================================
@ -165,13 +158,9 @@ then
pushd "$final_path/live"
ynh_use_nodejs
ynh_exec_as $app $ynh_ruby_load_path bin/bundle config set --local path 'vendor/bundle'
ynh_exec_as $app $ynh_ruby_load_path bin/bundle config set with 'development'
ynh_exec_warn_less ynh_exec_as $app $ynh_ruby_load_path bin/bundle update -j$(getconf _NPROCESSORS_ONLN) --quiet
ynh_exec_warn_less ynh_exec_as $app $ynh_ruby_load_path bin/bundle install -j$(getconf _NPROCESSORS_ONLN) --quiet
ynh_exec_warn_less ynh_exec_as $app env NODE_OPTIONS="--max-old-space-size=$node_max_old_space_size" PATH=$ynh_node_load_PATH yarn install --pure-lockfile
ynh_exec_warn_less ynh_exec_as $app env NODE_OPTIONS="--max-old-space-size=$node_max_old_space_size" PATH=$ynh_node_load_PATH yarn bundle
ynh_exec_warn_less ynh_exec_as $app $ynh_ruby_load_path bin/bundle exec rails assets:precompile --quiet
ynh_exec_warn_less ynh_exec_as $app env NODE_OPTIONS="--max-old-space-size=$node_max_old_space_size" PATH=$ynh_node_load_PATH yarn install
ynh_exec_warn_less ynh_exec_as $app env NODE_OPTIONS="--max-old-space-size=$node_max_old_space_size" PATH=$ynh_node_load_PATH yarn build:web-server
ynh_exec_warn_less ynh_exec_as $app env NODE_OPTIONS="--max-old-space-size=$node_max_old_space_size" PATH=$ynh_node_load_PATH yarn build:web
popd
fi
@ -194,7 +183,6 @@ mkdir -p "/var/log/$app"
chown -R $app: "/var/log/$app"
# Use logrotate to manage application logfile(s)
ynh_use_logrotate --logfile="$final_path/live/log/production.log"
ynh_use_logrotate --logfile="/var/log/$app/$app.log"
#=================================================

View file

@ -1,7 +1,7 @@
diff --git a/config.ru b/config.ru
diff --git a/packages/web-server/config.ru b/packages/web-server/config.ru
index bd83b25..6b1bb50 100644
--- a/config.ru
+++ b/config.ru
--- a/packages/web-server/config.ru
+++ b/packages/web-server/config.ru
@@ -1,4 +1,6 @@
# This file is used by Rack-based servers to start the application.