Add FRONTEND_URL configuration property.

This commit is contained in:
FireMasterK 2021-09-09 13:35:19 +05:30
parent 24139b7157
commit e38d989a5e
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD
3 changed files with 9 additions and 3 deletions

View File

@ -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

View File

@ -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"))

View File

@ -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);