diff --git a/.gitignore b/.gitignore index af5f56533fa51f59bd52b39a413b9b11a88bf4f9..72f026c0f1468e4400a9a91994ed5e40abd46aa7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # configuration files -/conf/* -!/conf/*.template +/conf/ext/* +!/conf/core/*.template # dot files but not .gitignore .* diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fa6f59e5281bfcb9b4fbc2ad1e558afbcdf00071..e078dfd48deecb7bd2f0cb4ac60fa707b6025e6d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -81,7 +81,7 @@ test:server: dependencies: - build:server script: - - echo "defaultRealm = CaosDB" > conf/usersources.ini + - echo "defaultRealm = CaosDB" > conf/ext/usersources.ini - mvn test ########### diff --git a/README_SETUP.md b/README_SETUP.md index 426867f6e9c51f74104ac1c769ace12a20f9d50c..8f8329cc76ef5508444707c830ee6747b9154f9a 100644 --- a/README_SETUP.md +++ b/README_SETUP.md @@ -27,7 +27,7 @@ On Debian, the required packages can be installed with: After a fresh clone of the repository, this is what you need to setup the server: 1. It is recommended to run the unit tests with `make test` -2. Copy `conf/server.conf.template` to `conf/server.conf` and change it +2. Copy `conf/core/server.conf.template` to `conf/ext/server.conf` and change it appropriately: * Setup for MySQL back-end: Assuming that the mysql back-end is installed, specify the fields `MYSQL_USER_NAME`, `MYSQL_USER_PASSWORD`, @@ -38,7 +38,7 @@ After a fresh clone of the repository, this is what you need to setup the server * Select a path for the file system and set the fields `FILE_SYSTEM_ROOT`, `DROP_OFF_BOX`, and `TMP_FILES`. * Maybe set another `SESSION_TIMEOUT_MS`. -3. Copy `conf/usersources.ini.template` to `conf/usersources.ini`. +3. Copy `conf/core/usersources.ini.template` to `conf/ext/usersources.ini`. * Define the users/groups who you want to include/exclude. * Assign at least one user the `administration` role. * It is important, that the file complies with the ini file specification. diff --git a/caosdb-webui b/caosdb-webui index 7a0afa2ed82197d11c0787e749371381ff119df8..4952d4b1b2645341d5e225857484a260304e0ee5 160000 --- a/caosdb-webui +++ b/caosdb-webui @@ -1 +1 @@ -Subproject commit 7a0afa2ed82197d11c0787e749371381ff119df8 +Subproject commit 4952d4b1b2645341d5e225857484a260304e0ee5 diff --git a/conf/cache.ccf b/conf/core/cache.ccf similarity index 100% rename from conf/cache.ccf rename to conf/core/cache.ccf diff --git a/conf/logging.conf b/conf/core/logging.conf similarity index 100% rename from conf/logging.conf rename to conf/core/logging.conf diff --git a/conf/server.conf.template b/conf/core/server.conf.template similarity index 100% rename from conf/server.conf.template rename to conf/core/server.conf.template diff --git a/conf/usersources.ini.template b/conf/core/usersources.ini.template similarity index 100% rename from conf/usersources.ini.template rename to conf/core/usersources.ini.template diff --git a/makefile b/makefile index 5bd2706408718620a446a99d0af5daac89d25227..c3382cff866b10b72826fad7c1d75efece3cfa15 100644 --- a/makefile +++ b/makefile @@ -30,20 +30,20 @@ run: compile mvn exec:exec run-debug: compile - mvn exec:exec -Dexec.args="-classpath %classpath -Djava.util.logging.config.file=./conf/logging.conf caosdb.server.CaosDBServer silent debug" + mvn exec:exec -Dexec.args="-classpath %classpath -Djava.util.logging.config.file=./conf/core/logging.conf caosdb.server.CaosDBServer silent debug" compile: easy-units mvn compile run-nobackend: - mvn exec:exec -Dexec.args="-classpath %classpath -Djava.util.logging.config.file=./conf/logging.conf caosdb.server.CaosDBServer silent debug nobackend insecure" + mvn exec:exec -Dexec.args="-classpath %classpath -Djava.util.logging.config.file=./conf/core/logging.conf caosdb.server.CaosDBServer silent debug nobackend insecure" start-portforwarding: sudo iptables -t nat -N CAOSDB sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -g CAOSDB sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -g CAOSDB - sudo iptables -t nat -A CAOSDB -p tcp --dport 80 -j REDIRECT --to-port $$(grep "SERVER_PORT_HTTP[^S]" conf/server.conf | grep -o -e "[0-9]*") - sudo iptables -t nat -A CAOSDB -p tcp --dport 443 -j REDIRECT --to-port $$(grep "SERVER_PORT_HTTPS" conf/server.conf | grep -o -e "[0-9]*") + sudo iptables -t nat -A CAOSDB -p tcp --dport 80 -j REDIRECT --to-port $$(grep "SERVER_PORT_HTTP[^S]" conf/ext/server.conf | grep -o -e "[0-9]*") + sudo iptables -t nat -A CAOSDB -p tcp --dport 443 -j REDIRECT --to-port $$(grep "SERVER_PORT_HTTPS" conf/ext/server.conf | grep -o -e "[0-9]*") stop-portforwarding: sudo iptables -t nat -D PREROUTING -p tcp --dport 80 -g CAOSDB diff --git a/misc/chown_script/chown_script_template b/misc/chown_script/chown_script_template index 78714af55207fcaae1a57d8c63f1c0af0a65ce94..bd006f7ec22826e67937c347a50de75dea03685c 100755 --- a/misc/chown_script/chown_script_template +++ b/misc/chown_script/chown_script_template @@ -22,7 +22,7 @@ # ** end header # -LOC_DROPOFFBOX=$(awk < ./conf/server.conf '{ if ($1 == "DROP_OFF_BOX") print $3 }') +LOC_DROPOFFBOX=$(awk < ./conf/ext/server.conf '{ if ($1 == "DROP_OFF_BOX") print $3 }') DB_USER=__DB_USER__ DB_GROUP=__DB_GROUP__ CMD_CHOWN=__CMD_CHOWN__ diff --git a/pom.xml b/pom.xml index fc3b25d2d72438cca4b8a4b9096a08e8e9adf36c..e78e1b0d3a4b418065272fec8b46f32a9ce2541d 100644 --- a/pom.xml +++ b/pom.xml @@ -224,7 +224,7 @@ <arguments> <argument>-classpath</argument> <classpath/> - <argument>-Djava.util.logging.config.file=./conf/logging.conf</argument> + <argument>-Djava.util.logging.config.file=./conf/core/logging.conf</argument> <argument>caosdb.server.CaosDBServer</argument> <argument>silent</argument> </arguments> diff --git a/src/main/java/caosdb/server/ServerProperties.java b/src/main/java/caosdb/server/ServerProperties.java index 761dc4a3f78898b259547a60975d9eeca9915e43..32d7fa32c3fa5fc9c5d36e2c01cf3bef063acb20 100644 --- a/src/main/java/caosdb/server/ServerProperties.java +++ b/src/main/java/caosdb/server/ServerProperties.java @@ -138,7 +138,7 @@ public class ServerProperties extends Properties { serverProperties.setProperty(KEY_DROP_OFF_BOX, "CaosDBFileSystem/DropOffBox/"); serverProperties.setProperty(KEY_TMP_FILES, "CaosDBFileSystem/TMP/"); serverProperties.setProperty(KEY_CHOWN_SCRIPT, "misc/chown_script/caosdb_chown_dropoffbox"); - serverProperties.setProperty(KEY_USER_SOURCES_INI_FILE, basepath + "/conf/usersources.ini"); + serverProperties.setProperty(KEY_USER_SOURCES_INI_FILE, basepath + "/conf/ext/usersources.ini"); serverProperties.setProperty(KEY_USER_FOLDERS, "FALSE"); serverProperties.setProperty(KEY_NEW_USER_DEFAULT_ACTIVITY, "INACTIVE"); serverProperties.setProperty(KEY_AUTH_OPTIONAL, "FALSE"); @@ -186,7 +186,7 @@ public class ServerProperties extends Properties { serverProperties.setProperty(KEY_UNITS_FILE, basepath + "/src/main/java/caosdb/unit/si.units"); serverProperties.setProperty(KEY_TRANSACTION_BENCHMARK_ENABLED, "true"); - serverProperties.setProperty(KEY_CACHE_CONF_LOC, "conf/cache.ccf"); + serverProperties.setProperty(KEY_CACHE_CONF_LOC, "conf/core/cache.ccf"); serverProperties.setProperty(KEY_RULES_CACHE_CAPACITY, "100"); serverProperties.setProperty(KEY_SPARSE_ENTITY_CACHE_CAPACITY, "1000"); @@ -201,7 +201,7 @@ public class ServerProperties extends Properties { serverProperties.setProperty(KEY_QUERY_FILTER_ENTITIES_WITHOUT_RETRIEVE_PERMISSIONS, "TRUE"); try { - final File confFile = new File(basepath + "/conf/server.conf"); + final File confFile = new File(basepath + "/conf/ext/server.conf"); if (confFile.exists()) { final BufferedInputStream sp_in = new BufferedInputStream(new FileInputStream(confFile)); serverProperties.load(sp_in); diff --git a/src/test/java/caosdb/server/resource/FileSystemResourceTest.java b/src/test/java/caosdb/server/resource/FileSystemResourceTest.java index 189e7802f8ac21f8a73c639a6acdfe1d92fb2116..31d6c6a6c4c7caf4d388a6df1404430e93a01d0f 100644 --- a/src/test/java/caosdb/server/resource/FileSystemResourceTest.java +++ b/src/test/java/caosdb/server/resource/FileSystemResourceTest.java @@ -29,7 +29,7 @@ public class FileSystemResourceTest { @Test(expected = NullPointerException.class) public void testGetFileElementNullDir() throws Exception { - new FileSystemResource().getFileElement(null, new File("conf/server.conf")); + new FileSystemResource().getFileElement(null, new File("conf/ext/server.conf")); } @Test(expected = NullPointerException.class)