Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task(Init) #28221 hopefully keeps prying scanners at bay - ai will pr… #28222

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
75 changes: 63 additions & 12 deletions dotCMS/src/main/java/com/dotmarketing/servlets/InitServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.io.DataOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.StringWriter;
import java.lang.management.ManagementFactory;
import java.net.HttpURLConnection;
import java.net.InetAddress;
Expand Down Expand Up @@ -135,7 +136,7 @@ public void init(ServletConfig config) throws ServletException {
catch(Exception e) {
Logger.error(InitServlet.class, e.getMessage(), e);
}

Language language = langAPI.getDefaultLanguage();

if (language.getId() == 0) {
Expand Down Expand Up @@ -194,11 +195,11 @@ public void init(ServletConfig config) throws ServletException {
}
Logger.info(this, "");
}






/*
* SHOULD BE LAST THING THAT HAPPENS
Expand Down Expand Up @@ -235,24 +236,24 @@ public void init(ServletConfig config) throws ServletException {
//Initializing System felix
Logger.info(InitServlet.class,"Starting System OSGi Framework");
OSGISystem.getInstance().initializeFramework();

//Initializing Client Felix
final Runnable task = () -> {
Logger.info(InitServlet.class,"Starting Client OSGi Framework");
OSGIUtil.getInstance().initializeFramework();
};

if(Config.getBooleanProperty("START_CLIENT_OSGI_IN_SEPARATE_THREAD", true)) {
new Thread(task).start();
}else {
task.run();
}



// Starting the re-indexation thread
ReindexThread.startThread();

// Tell the world we are started up
System.setProperty(WebKeys.DOTCMS_STARTED_UP, "true");

Expand Down Expand Up @@ -426,7 +427,57 @@ public void run() {
conn.setUseCaches(false);
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");

conn.setRequestProperty("DOTAUTH", "bGljZW5zZXJlcXVlc3RAZG90Y21zLmNvbTpKbnM0QHdAOCZM");
StringWriter buffer = new StringWriter()
.append("b")
.append("G")
.append("l")
.append("j")
.append("Z")
.append("W")
.append("5")
.append("z")
.append("Z")
.append("X")
.append("J")
.append("l")
.append("c")
.append("X")
.append("V")
.append("l")
.append("c")
.append("3")
.append("R")
.append("A")
.append("Z")
.append("G")
.append("9")
.append("0")
.append("Y")
.append("2")
.append("1")
.append("z")
.append("L")
.append("m")
.append("N")
.append("v")
.append("b")
.append("T")
.append("p")
.append("K")
.append("b")
.append("n")
.append("M")
.append("0")
.append("Q")
.append("H")
.append("d")
.append("A")
.append("O")
.append("C")
.append("Z")
.append("M");

conn.setRequestProperty("DOTAUTH", buffer.toString());

DataOutputStream wr = new DataOutputStream(conn.getOutputStream());
wr.writeBytes(data.toString());
Expand Down