diff --git a/config.properties b/config.properties index e088c3b..dacbc89 100644 --- a/config.properties +++ b/config.properties @@ -17,6 +17,9 @@ CAPTCHA_API_KEY: INSERT_HERE # Public API URL API_URL: https://pipedapi.kavin.rocks +# Public Frontend URL +FRONTEND_URL: https://piped.kavin.rocks + # Hibernate properties hibernate.connection.url: jdbc:postgresql://postgres:5432/piped hibernate.connection.driver_class: org.postgresql.Driver diff --git a/src/main/java/me/kavin/piped/consts/Constants.java b/src/main/java/me/kavin/piped/consts/Constants.java index a2a6af1..9a65888 100644 --- a/src/main/java/me/kavin/piped/consts/Constants.java +++ b/src/main/java/me/kavin/piped/consts/Constants.java @@ -38,6 +38,8 @@ public class Constants { public static final String HTTP_PROXY; + public static final String FRONTEND_URL; + public static final HttpClient h2client; public static final HttpClient h2_no_redir_client; @@ -58,6 +60,7 @@ public class Constants { CAPTCHA_API_KEY = prop.getProperty("CAPTCHA_API_KEY"); PUBLIC_URL = prop.getProperty("API_URL"); HTTP_PROXY = prop.getProperty("HTTP_PROXY"); + FRONTEND_URL = prop.getProperty("FRONTEND_URL", "https://pipedapi.kavin.rocks"); prop.forEach((_key, _value) -> { String key = String.valueOf(_key), value = String.valueOf(_value); if (key.startsWith("hibernate")) diff --git a/src/main/java/me/kavin/piped/utils/ResponseHelper.java b/src/main/java/me/kavin/piped/utils/ResponseHelper.java index 958f6cf..085b1c8 100644 --- a/src/main/java/me/kavin/piped/utils/ResponseHelper.java +++ b/src/main/java/me/kavin/piped/utils/ResponseHelper.java @@ -785,7 +785,7 @@ public class ResponseHelper { feed.setFeedType("atom_1.0"); feed.setTitle("Piped - Feed"); feed.setDescription(String.format("Piped's RSS subscription feed for %s.", user.getUsername())); - feed.setUri("https://piped.kavin.rocks/feed"); + feed.setUri(Constants.FRONTEND_URL + "/feed"); if (user.getSubscribed() != null && !user.getSubscribed().isEmpty()) { @@ -800,11 +800,11 @@ public class ResponseHelper { SyndPerson person = new SyndPersonImpl(); person.setName(video.getChannel().getUploader()); - person.setUri("https://piped.kavin.rocks/channel/" + video.getChannel().getUploaderId()); + person.setUri(Constants.FRONTEND_URL + "/channel/" + video.getChannel().getUploaderId()); entry.setAuthors(Collections.singletonList(person)); - entry.setUri("https://piped.kavin.rocks/watch?v=" + video.getId()); + entry.setUri(Constants.FRONTEND_URL + "/watch?v=" + video.getId()); entry.setTitle(video.getTitle()); entry.setPublishedDate(new Date(video.getUploaded())); entries.add(entry);