mirror of
https://github.com/YunoHost-Apps/piped_ynh.git
synced 2024-09-03 20:05:54 +02:00
Added other services...
This commit is contained in:
parent
f1a8752891
commit
ba45c5756b
3 changed files with 70 additions and 7 deletions
|
@ -1,4 +1,21 @@
|
||||||
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
||||||
|
|
||||||
|
location __PATH__/api/ {
|
||||||
|
|
||||||
|
# Path to source
|
||||||
|
proxy_cache pipedapi;
|
||||||
|
proxy_pass http://127.0.0.1:__PORT__;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Connection "keep-alive";
|
||||||
|
}
|
||||||
|
|
||||||
|
location __PATH__/proxy/ {
|
||||||
|
|
||||||
|
# Path to source
|
||||||
|
alias __INSTALL_DIR__/dist/;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
location __PATH__/ {
|
location __PATH__/ {
|
||||||
|
|
||||||
# Path to source
|
# Path to source
|
||||||
|
|
|
@ -31,6 +31,10 @@ ram.runtime = "50M"
|
||||||
[install.domain]
|
[install.domain]
|
||||||
type = "domain"
|
type = "domain"
|
||||||
|
|
||||||
|
[install.path]
|
||||||
|
type = "path"
|
||||||
|
default = "piped"
|
||||||
|
|
||||||
[install.init_main_permission]
|
[install.init_main_permission]
|
||||||
type = "group"
|
type = "group"
|
||||||
default = "visitors"
|
default = "visitors"
|
||||||
|
@ -43,9 +47,26 @@ ram.runtime = "50M"
|
||||||
sha256 = "64f56b0d0f02035ef42b561b617a793da2db96e02cb7a8131e2ac9e0c619101b"
|
sha256 = "64f56b0d0f02035ef42b561b617a793da2db96e02cb7a8131e2ac9e0c619101b"
|
||||||
autoupdate.strategy = "latest_github_commit"
|
autoupdate.strategy = "latest_github_commit"
|
||||||
|
|
||||||
|
[resources.sources.api]
|
||||||
|
url = "https://github.com/TeamPiped/Piped-Backend/archive/c746794d7434d0cda99f8b586a431ef69e1fb7b5.tar.gz"
|
||||||
|
sha256 = "fdb53fbe599e7e91c0663f1b40f0ba49a967cdcd6048769d8ab840df73a80e0f"
|
||||||
|
autoupdate.strategy = "latest_github_commit"
|
||||||
|
|
||||||
|
[resources.sources.proxy]
|
||||||
|
url = "https://github.com/TeamPiped/piped-proxy/archive/0098582abeda2512790ca9d10cf016377cc71855.tar.gz"
|
||||||
|
sha256 = "436c0189e744bcd2ebe0b926dc58f2d740b4531ca43e620f0e8ff697c5d816c3"
|
||||||
|
autoupdate.strategy = "latest_github_commit"
|
||||||
|
|
||||||
|
[resources.sources.jdk]
|
||||||
|
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"
|
||||||
|
sha256 = "454bebb2c9fe48d981341461ffb6bf1017c7b7c6e15c6b0c29b959194ba3aaa5"
|
||||||
|
|
||||||
[resources.system_user]
|
[resources.system_user]
|
||||||
|
|
||||||
[resources.install_dir]
|
[resources.install_dir]
|
||||||
|
|
||||||
[resources.permissions]
|
[resources.permissions]
|
||||||
main.url = "/"
|
main.url = "/"
|
||||||
|
|
||||||
|
[resources.database]
|
||||||
|
type = "postgresql"
|
|
@ -11,11 +11,18 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL DEPENDENCIES
|
# INSTALL DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installing dependencies..." --weight=1
|
ynh_script_progression --message="Installing dependencies..." --weight=3
|
||||||
|
|
||||||
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
|
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
|
||||||
ynh_use_nodejs
|
ynh_use_nodejs
|
||||||
|
|
||||||
|
ynh_setup_source --dest_dir="$install_dir/jdk" --source_id="jdk"
|
||||||
|
|
||||||
|
export JAVA_HOME="$install_dir/jdk"
|
||||||
|
|
||||||
|
ynh_exec_warn_less ynh_exec_as $app RUSTUP_HOME="$install_dir"/.rustup CARGO_HOME="$install_dir"/.cargo bash -c 'curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -q -y'
|
||||||
|
export PATH="$install_dir/jdk/bin:$install_dir/.cargo/bin:$PATH"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC)
|
# APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC)
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -25,24 +32,42 @@ ynh_script_progression --message="Setting up source files..."
|
||||||
|
|
||||||
ynh_setup_source --dest_dir="$install_dir/build"
|
ynh_setup_source --dest_dir="$install_dir/build"
|
||||||
|
|
||||||
|
ynh_setup_source --dest_dir="$install_dir/build_api" --source_id="api"
|
||||||
|
|
||||||
|
ynh_setup_source --dest_dir="$install_dir/build_proxy" --source_id="proxy"
|
||||||
|
|
||||||
chown -R $app:www-data "$install_dir"
|
chown -R $app:www-data "$install_dir"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL APP
|
# INSTALL APP
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Building app..." --weight=5
|
ynh_script_progression --message="Building UI..." --weight=5
|
||||||
|
|
||||||
pushd $install_dir/build
|
pushd $install_dir/build
|
||||||
ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install pnpm
|
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH corepack enable
|
||||||
ynh_exec_as $app $ynh_node_load_PATH $ynh_npm exec -- pnpm install
|
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH corepack prepare pnpm@latest --activate
|
||||||
ynh_exec_as $app $ynh_node_load_PATH $ynh_npm exec -- pnpm build
|
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm install
|
||||||
./localizefonts.sh
|
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production pnpm build
|
||||||
|
ynh_exec_warn_less ynh_exec_as $app ./localizefonts.sh
|
||||||
popd
|
popd
|
||||||
|
|
||||||
mv $install_dir/build/dist $install_dir
|
mv $install_dir/build/dist $install_dir
|
||||||
chown -R $app:www-data "$install_dir/dist"
|
chown -R $app:www-data "$install_dir/dist"
|
||||||
chmod -R 755 "$install_dir/dist"
|
chmod -R 755 "$install_dir/dist"
|
||||||
#ynh_secure_remove --file="$install_dir/build"
|
|
||||||
|
ynh_script_progression --message="Building API..." --weight=5
|
||||||
|
|
||||||
|
pushd $install_dir/build_api
|
||||||
|
ynh_exec_warn_less ynh_exec_as $app ./gradlew shadowJar
|
||||||
|
popd
|
||||||
|
|
||||||
|
mv $install_dir/build_api/build/libs/piped-1.0-all.jar $install_dir/piped.jar
|
||||||
|
|
||||||
|
pushd $install_dir/build_proxy
|
||||||
|
ynh_exec_warn_less ynh_exec_as $app cargo build --release
|
||||||
|
popd
|
||||||
|
|
||||||
|
mv $install_dir/build_proxy/target/release/piped-proxy $install_dir
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
Loading…
Add table
Reference in a new issue