From 91bee9fae6b349e6550ee5908c17349c725ba7fc Mon Sep 17 00:00:00 2001 From: orhtej2 <2871798+orhtej2@users.noreply.github.com> Date: Sat, 27 Jan 2024 23:31:13 +0100 Subject: [PATCH] Use proper config --- conf/config.properties | 91 ++++++++++++++++++++++++++++++++++++++++++ scripts/install | 8 ++-- 2 files changed, 96 insertions(+), 3 deletions(-) create mode 100644 conf/config.properties diff --git a/conf/config.properties b/conf/config.properties new file mode 100644 index 0000000..7594887 --- /dev/null +++ b/conf/config.properties @@ -0,0 +1,91 @@ +# The port to Listen on. +PORT:8080 +# The number of workers to use for the server +HTTP_WORKERS:2 + +# Proxy +PROXY_PART:https://__HOST__/__PATH__/proxy + +# Proxy Hash Secret +#PROXY_HASH_SECRET:INSERT_HERE + +# Outgoing proxy to be used by reqwest4j - eg: socks5://127.0.0.1:1080 +#REQWEST_PROXY: socks5://127.0.0.1:1080 +# Optional proxy username and password +#REQWEST_PROXY_USER: username +#REQWEST_PROXY_PASS: password + +# Captcha Parameters +CAPTCHA_BASE_URL:https://api.capmonster.cloud/ +CAPTCHA_API_KEY:INSERT_HERE + +# Public API URL +API_URL:https://__HOST__/__PATH__/api + +# Public Frontend URL +FRONTEND_URL:https://__HOST__/__PATH__ + +# Enable haveibeenpwned compromised password API +COMPROMISED_PASSWORD_CHECK:true + +# Disable Registration +DISABLE_REGISTRATION:false + +# Feed Retention Time in Days +FEED_RETENTION:30 + +# Disable CPU expensive timers (for nodes with low CPU, at least one node should have this disabled) +DISABLE_TIMERS:false + +# RYD Proxy URL (see https://github.com/TeamPiped/RYD-Proxy) +RYD_PROXY_URL:https://ryd-proxy.kavin.rocks + +# SponsorBlock Servers(s) +# Comma separated list of SponsorBlock Servers to use +SPONSORBLOCK_SERVERS:https://sponsor.ajay.app,https://sponsorblock.kavin.rocks + +# Disable the usage of RYD +DISABLE_RYD:true + +# Disable API server (node just runs timers if enabled) +DISABLE_SERVER:false + +# Disable the inclusion of LBRY streams +DISABLE_LBRY:false + +# How long should unauthenticated subscriptions last for +SUBSCRIPTIONS_EXPIRY:30 + +# Send consent accepted cookie +# This is required for certain features to work in some countries +CONSENT_COOKIE:true + +# Sentry DSN +# Use Sentry to log errors and trace performance +#SENTRY_DSN:INSERT_HERE + +# Matrix Client Server URL +MATRIX_SERVER:https://matrix-client.matrix.org +# Matrix Access Token +# If not present, will work in anon mode +#MATRIX_TOKEN:INSERT_HERE + +# Geo Restriction Checker for federated bypassing of Geo Restrictions +#GEO_RESTRICTION_CHECKER_URL:INSERT_HERE + +# S3 Configuration Data (compatible with any provider that offers an S3 compatible API) +#S3_ENDPOINT:INSERT_HERE +#S3_ACCESS_KEY:INSERT_HERE +#S3_SECRET_KEY:INSERT_HERE +#S3_BUCKET:INSERT_HERE + +# Hibernate properties +hibernate.connection.url:jdbc:postgresql://postgres:5432/__DB_NAME__ +hibernate.connection.driver_class:org.postgresql.Driver +hibernate.dialect:org.hibernate.dialect.PostgreSQLDialect +hibernate.connection.username:__DB_USER__ +hibernate.connection.password:__DB_PASS__ + +# Frontend configuration +#frontend.statusPageUrl:https://kavin.rocks +#frontend.donationUrl:https://kavin.rocks diff --git a/scripts/install b/scripts/install index f6409cc..70266d9 100644 --- a/scripts/install +++ b/scripts/install @@ -18,8 +18,6 @@ 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" @@ -58,11 +56,15 @@ chmod -R 755 "$install_dir/dist" ynh_script_progression --message="Building API..." --weight=5 pushd $install_dir/build_api - ynh_exec_warn_less ynh_exec_as $app ./gradlew shadowJar + ynh_secure_remove --file="$install_dir/build_api/config.properties" + ynh_add_config --template="config.properties" --destination="$install_dir/build_api/config.properties" + ynh_exec_warn_less ynh_exec_as $app JAVA_HOME=$install_dir/jdk ./gradlew shadowJar popd mv $install_dir/build_api/build/libs/piped-1.0-all.jar $install_dir/piped.jar +ynh_script_progression --message="Building Proxy..." --weight=5 + pushd $install_dir/build_proxy ynh_exec_warn_less ynh_exec_as $app cargo build --release popd