multidomain config
This commit is contained in:
@@ -49,7 +49,22 @@ public class FediServlet extends HttpServlet {
|
|||||||
if (!contextUrl.endsWith("/")) {
|
if (!contextUrl.endsWith("/")) {
|
||||||
contextUrl += "/";
|
contextUrl += "/";
|
||||||
}
|
}
|
||||||
final JSONLoader loader = new JSONLoader(instance, account, contextUrl);
|
|
||||||
|
JSONLoader loader = null;
|
||||||
|
final ServletConfig servletConfig = getServletConfig();
|
||||||
|
String domainConfig = servletConfig.getInitParameter(serverName);
|
||||||
|
if (domainConfig != null && !domainConfig.isBlank()) {
|
||||||
|
if (domainConfig.startsWith("@")) {
|
||||||
|
domainConfig = domainConfig.substring(1);
|
||||||
|
}
|
||||||
|
if (domainConfig.contains("@")) {
|
||||||
|
final String[] parts = domainConfig.split("@");
|
||||||
|
loader = new JSONLoader(parts[1], parts[0], contextUrl);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
loader = new JSONLoader(instance, account, contextUrl);
|
||||||
|
}
|
||||||
|
|
||||||
final VelocityContext context = new VelocityContext();
|
final VelocityContext context = new VelocityContext();
|
||||||
context.put("dateformatter", new PostDateFormatter());
|
context.put("dateformatter", new PostDateFormatter());
|
||||||
context.put("page", loader.loadPage());
|
context.put("page", loader.loadPage());
|
||||||
|
|||||||
Reference in New Issue
Block a user