Some small changes.

This commit is contained in:
Kavin 2022-09-25 22:33:29 +01:00
parent 52370036e3
commit 51185f2558
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD
3 changed files with 5 additions and 6 deletions

View file

@ -38,5 +38,5 @@ hibernate.dialect:org.hibernate.dialect.PostgreSQLDialect
hibernate.connection.username:piped
hibernate.connection.password:changeme
# Frontend configuration
frontend.statusPageUrl:https://kavin.rocks
frontend.donationUrl:https://kavin.rocks
#frontend.statusPageUrl:https://kavin.rocks
#frontend.donationUrl:https://kavin.rocks

View file

@ -54,7 +54,7 @@ public class ServerLauncher extends MultithreadedHttpServerLauncher {
}
})).map(GET, "/config", AsyncServlet.ofBlocking(executor, request -> {
try {
return getJsonResponse(ResponseHelper.configResponse(), "no-store");
return getJsonResponse(ResponseHelper.configResponse(), "public, max-age=86400");
} catch (Exception e) {
return getErrorResponse(e, request.getPath());
}

View file

@ -2,7 +2,6 @@ package me.kavin.piped.consts;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import me.kavin.piped.utils.PageMixin;
import okhttp3.OkHttpClient;
@ -105,8 +104,8 @@ public class Constants {
String key = String.valueOf(_key), value = String.valueOf(_value);
if (key.startsWith("hibernate"))
hibernateProperties.put(key, value);
else if (key.startsWith("frontend"))
frontendProperties.put(key.replace("frontend.", ""), value);
else if (key.startsWith("frontend."))
frontendProperties.put(StringUtils.substringAfter(key, "frontend."), value);
});
// transform hibernate properties for legacy configurations