From 77693112700106651eb0443f121af759aff8141e Mon Sep 17 00:00:00 2001 From: orhtej2 <2871798+orhtej2@users.noreply.github.com> Date: Sat, 10 Feb 2024 20:33:39 +0100 Subject: [PATCH] Finalizing.... --- conf/exporter.service | 5 ----- conf/nginx.conf | 23 +++++++++++++++++++++++ doc/POST_INSTALL.md | 2 +- manifest.toml | 7 +++---- scripts/_common.sh | 2 +- scripts/install | 15 +++++++++++++++ sources/extra_files/app/.gitignore | 2 -- sources/patches/.gitignore | 2 -- sources/patches/main-001.patch | 25 +++++++++++++++++++++++++ 9 files changed, 68 insertions(+), 15 deletions(-) delete mode 100644 sources/extra_files/app/.gitignore delete mode 100644 sources/patches/.gitignore create mode 100644 sources/patches/main-001.patch diff --git a/conf/exporter.service b/conf/exporter.service index a06fa8a..89079e1 100644 --- a/conf/exporter.service +++ b/conf/exporter.service @@ -12,11 +12,6 @@ WorkingDirectory=__INSTALL_DIR__/exporter ExecStart=__YNH_NODE__ --env-file=.env app.js Restart=always Environment=__YNH_NODE_LOAD_PATH__ -Environment=NODE_ENV=production -Environment=PENPOT_HTTP_SERVER_PORT=__PORT_EXPORTER__ -Environment=PENPOT_HTTP_SERVER_host="127.0.0.1" -Environment=PENPOT_PUBLIC_URI="https://__DOMAIN__" -Environment=PENPOT_REDIS_URI="redis://127.0.0.1:6379/__REDIS_DB__" StandardOutput=append:/var/log/__APP__/__APP__-exporter.log StandardError=inherit Restart=on-failure diff --git a/conf/nginx.conf b/conf/nginx.conf index c80b578..ce405b9 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,25 @@ #sub_path_only rewrite ^$ / permanent; + +location @handle_redirect { + set $redirect_uri "$upstream_http_location"; + set $redirect_host "$upstream_http_x_host"; + set $redirect_cache_control "$upstream_http_cache_control"; + + proxy_buffering off; + + proxy_set_header Host "$redirect_host"; + proxy_hide_header etag; + proxy_hide_header x-amz-id-2; + proxy_hide_header x-amz-request-id; + proxy_hide_header x-amz-meta-server-side-encryption; + proxy_hide_header x-amz-server-side-encryption; + proxy_pass $redirect_uri; + + add_header x-internal-redirect "$redirect_uri"; + add_header x-cache-control "$redirect_cache_control"; + add_header cache-control "$redirect_cache_control"; +} + location /assets { proxy_pass http://127.0.0.1:__PORT__/assets; recursive_error_pages on; @@ -37,10 +58,12 @@ location /api/export { } location /api { + client_max_body_size 100M; proxy_pass http://127.0.0.1:__PORT__/api; } location /ws/notifications { + proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_pass http://127.0.0.1:__PORT__/ws/notifications; diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md index d704a06..278c4d3 100644 --- a/doc/POST_INSTALL.md +++ b/doc/POST_INSTALL.md @@ -1,3 +1,3 @@ The app url is -You can log in by using `@__DOMAIN__` e-mail and your Yunohost password. \ No newline at end of file +You can log in by using `@__MAIN_DOMAIN__` e-mail as your username and your Yunohost password. \ No newline at end of file diff --git a/manifest.toml b/manifest.toml index c080a00..0f7283e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -42,10 +42,9 @@ ram.runtime = "50M" [resources.sources] [resources.sources.main] - url = "https://github.com/penpot/penpot/archive/refs/tags/1.19.2.tar.gz" - sha256 = "14de5b71f13f0fd542234f16fa5a307fbee7088bdfa343a53ff923b3f95f4edb" - autoupdate.strategy = "latest_github_release" - + url = "https://github.com/penpot/penpot/archive/refs/tags/1.19.3.tar.gz" + sha256 = "2649db3bd8742540f76f33547095b227e86c5bda74908a900011b8516d4bb3ce" + [resources.sources.jdk] amd64.url = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.2%2B13/OpenJDK21U-jdk_x64_linux_hotspot_21.0.2_13.tar.gz" amd64.sha256 = "454bebb2c9fe48d981341461ffb6bf1017c7b7c6e15c6b0c29b959194ba3aaa5" diff --git a/scripts/_common.sh b/scripts/_common.sh index bb05d95..bbd5be1 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -nodejs_version=18 +nodejs_version=20 current_hash="1eaf7b2b44a9e8928a70d9a882f4372602700695" #================================================= diff --git a/scripts/install b/scripts/install index 6486a4f..d1cc995 100644 --- a/scripts/install +++ b/scripts/install @@ -10,9 +10,11 @@ source /usr/share/yunohost/helpers redis_db=$(ynh_redis_get_free_db) secret_key=$(ynh_string_random --length=40) +main_domain=$(yunohost domain list --output-as plain | grep -A1 -e '#main' | tail -n 1) ynh_app_setting_set --app=$app --key=redis_db --value=$redis_db ynh_app_setting_set --app=$app --key=secret_key --value=$secret_key +ynh_app_setting_set --app=$app --key=main_domain --value=$main_domain #================================================= # INSTALL DEPENDENCIES @@ -116,11 +118,24 @@ mkdir -p $install_dir/exporter mv $install_dir/build/exporter/target/* $install_dir/exporter chown -R $app:$app $install_dir/exporter chmod -R 700 $install_dir/exporter + +ynh_secure_remove --file=$install_dir/.cache + pushd $install_dir/exporter ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production yarn install --pure-lockfile ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production yarn --network-timeout 1000000 run playwright install chromium popd +ynh_script_progression --message="Cleaning up..." --weight=1 + +ynh_secure_remove --file=$install_dir/.npm +ynh_secure_remove --file=$install_dir/.yarn +ynh_secure_remove --file=$install_dir/build +ynh_secure_remove --file=$install_dir/.m2 +ynh_secure_remove --file=$install_dir/.clojure +ynh_secure_remove --file=$install_dir/clojure +ynh_secure_remove --file=$install_dir/babashka + #================================================= # SYSTEM CONFIGURATION #================================================= diff --git a/sources/extra_files/app/.gitignore b/sources/extra_files/app/.gitignore deleted file mode 100644 index 3da51e8..0000000 --- a/sources/extra_files/app/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*~ -*.sw[op] diff --git a/sources/patches/.gitignore b/sources/patches/.gitignore deleted file mode 100644 index 3da51e8..0000000 --- a/sources/patches/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*~ -*.sw[op] diff --git a/sources/patches/main-001.patch b/sources/patches/main-001.patch new file mode 100644 index 0000000..8718519 --- /dev/null +++ b/sources/patches/main-001.patch @@ -0,0 +1,25 @@ +From 43585e806da2002b4b070489e2f6db6aafb3ca2f Mon Sep 17 00:00:00 2001 +From: orhtej2 <2871798+orhtej2@users.noreply.github.com> +Date: Sat, 10 Feb 2024 20:01:35 +0100 +Subject: [PATCH] Don't use zygote and GPU for export. + +--- + exporter/src/app/browser.cljs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/exporter/src/app/browser.cljs b/exporter/src/app/browser.cljs +index 3cbcf2b98..c2c44e774 100644 +--- a/exporter/src/app/browser.cljs ++++ b/exporter/src/app/browser.cljs +@@ -100,7 +100,7 @@ + + (def browser-pool-factory + (letfn [(create [] +- (p/let [opts #js {:args #js ["--font-render-hinting=none"]} ++ (p/let [opts #js {:args #js ["--font-render-hinting=none", "--disable-gpu", "--no-zygote"]} + browser (.launch pw/chromium opts) + id (swap! pool-browser-id inc)] + (l/info :origin "factory" :action "create" :browser-id id) +-- +2.42.0.windows.2 +