mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-30 10:47:33 +02:00
Setup logs into tempfs too for volatile storage
This commit is contained in:
@ -44,6 +44,8 @@ public class LoginIT {
|
|||||||
private static final String API_IMAGE_NAME = "mockserver/mockserver";
|
private static final String API_IMAGE_NAME = "mockserver/mockserver";
|
||||||
private static final String API_IMAGE = API_IMAGE_NAME + ':' + API_TAG;
|
private static final String API_IMAGE = API_IMAGE_NAME + ':' + API_TAG;
|
||||||
|
|
||||||
|
private static final String HOME_FOLDER = "/home/nonroot/";
|
||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
public MockServerContainer mockServer = new MockServerContainer(DockerImageName.parse(API_IMAGE))
|
public MockServerContainer mockServer = new MockServerContainer(DockerImageName.parse(API_IMAGE))
|
||||||
.withReuse(true);
|
.withReuse(true);
|
||||||
@ -57,16 +59,24 @@ public class LoginIT {
|
|||||||
.withEnv("JDK_JAVA_OPTIONS", buildJVMFlags())
|
.withEnv("JDK_JAVA_OPTIONS", buildJVMFlags())
|
||||||
.withExposedPorts(25565)
|
.withExposedPorts(25565)
|
||||||
// use server settings that use minimal minecraft log to quickly ramp up the server
|
// use server settings that use minimal minecraft log to quickly ramp up the server
|
||||||
.withCopyFileToContainer(MountableFile.forClasspathResource("server.properties"), "/home/nonroot/server.properties")
|
.withCopyFileToContainer(MountableFile.forClasspathResource("server.properties"), HOME_FOLDER + "server.properties")
|
||||||
.withCopyFileToContainer(MountableFile.forClasspathResource("bukkit.yml"), "/home/nonroot/bukkit.yml")
|
.withCopyFileToContainer(MountableFile.forClasspathResource("bukkit.yml"), HOME_FOLDER + "bukkit.yml")
|
||||||
.withCopyFileToContainer(MountableFile.forClasspathResource("spigot.yml"), "/home/nonroot/spigot.yml")
|
.withCopyFileToContainer(MountableFile.forClasspathResource("spigot.yml"), HOME_FOLDER + "spigot.yml")
|
||||||
.withTmpFs(Collections.singletonMap("/home/nonroot/world", "rw,noexec,nosuid,nodev"))
|
// create folders that are volatile
|
||||||
|
.withTmpFs(getTempFS())
|
||||||
// Done (XXXXs)! For help, type "help"
|
// Done (XXXXs)! For help, type "help"
|
||||||
.waitingFor(
|
.waitingFor(
|
||||||
Wait.forLogMessage(".*For help, type \"help\"*\\n", 1)
|
Wait.forLogMessage(".*For help, type \"help\"*\\n", 1)
|
||||||
)
|
)
|
||||||
.withReuse(true);
|
.withReuse(true);
|
||||||
|
|
||||||
|
private Map<String, String> getTempFS() {
|
||||||
|
Map<String, String> tmpfs = new HashMap<>();
|
||||||
|
tmpfs.put(HOME_FOLDER + "world", "rw,noexec,nosuid,nodev");
|
||||||
|
tmpfs.put(HOME_FOLDER + "logs", "rw,noexec,nosuid,nodev");
|
||||||
|
return tmpfs;
|
||||||
|
}
|
||||||
|
|
||||||
private String buildJVMFlags() {
|
private String buildJVMFlags() {
|
||||||
Map<String, String> systemProperties = new HashMap<>();
|
Map<String, String> systemProperties = new HashMap<>();
|
||||||
systemProperties.put("com.mojang.eula.agree", Boolean.toString(true));
|
systemProperties.put("com.mojang.eula.agree", Boolean.toString(true));
|
||||||
|
Reference in New Issue
Block a user