Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • caosdb/src/caosdb-server
1 result
Show changes
Commits on Source (4)
...@@ -29,6 +29,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -29,6 +29,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
* #130 - Error during `FIND ENTITY` when
`QUERY_FILTER_ENTITIES_WITHOUT_RETRIEVE_PERMISSIONS=False`.
* #125 - `bend_symlinks` script did not allow whitespace in filename. * #125 - `bend_symlinks` script did not allow whitespace in filename.
* #122 - Dead-lock due to error in the DatabaseAccessManager. * #122 - Dead-lock due to error in the DatabaseAccessManager.
* #120 - Editing entities that were created with a no longer existing user * #120 - Editing entities that were created with a no longer existing user
...@@ -56,6 +58,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -56,6 +58,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
* Server can be started without TLS even when not in debug mode.
* Select queries would originally only select the returned properties by their * Select queries would originally only select the returned properties by their
names and would not check if a property is a subtype of a selected property. This names and would not check if a property is a subtype of a selected property. This
has changed now and select queries will also return subtypes of selected has changed now and select queries will also return subtypes of selected
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
# #
CAOSDB_SERVER_VERSION ?= $(shell mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout) CAOSDB_SERVER_VERSION ?= $(shell mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout)
CAOSDB_COMMAND_LINE_OPTIONS ?=
SHELL:=/bin/bash SHELL:=/bin/bash
JPDA_PORT ?= 9000 JPDA_PORT ?= 9000
JMX_PORT ?= 9090 JMX_PORT ?= 9090
...@@ -41,13 +42,14 @@ run: compile ...@@ -41,13 +42,14 @@ run: compile
mvn exec:java@run mvn exec:java@run
run-debug: jar run-debug: jar
java -Xrunjdwp:transport=dt_socket,address=0.0.0.0:$(JPDA_PORT),server=y,suspend=n -Dcaosdb.debug=true -jar target/caosdb-server.jar java -Xrunjdwp:transport=dt_socket,address=0.0.0.0:$(JPDA_PORT),server=y,suspend=n -Dcaosdb.debug=true -jar target/caosdb-server.jar $(CAOSDB_COMMAND_LINE_OPTIONS)
run-debug-single: run-debug-single:
java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=$(JMX_PORT) -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Xrunjdwp:transport=dt_socket,address=0.0.0.0:$(JPDA_PORT),server=y,suspend=n -Dcaosdb.debug=true -jar target/caosdb-server.jar java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=$(JMX_PORT) -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Xrunjdwp:transport=dt_socket,address=0.0.0.0:$(JPDA_PORT),server=y,suspend=n -Dcaosdb.debug=true -jar target/caosdb-server.jar $(CAOSDB_COMMAND_LINE_OPTIONS)
run-single: run-single:
java -jar target/caosdb-server.jar java -jar target/caosdb-server.jar $(CAOSDB_COMMAND_LINE_OPTIONS)
formatting: formatting:
mvn fmt:format mvn fmt:format
...@@ -64,7 +66,7 @@ antlr: ...@@ -64,7 +66,7 @@ antlr:
mvn antlr4:antlr4 mvn antlr4:antlr4
test: print-version easy-units test: print-version easy-units
MAVEN_DEBUG_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Dcaosdb.debug=true -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=0.0.0.0:9000" MAVEN_DEBUG_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Dcaosdb.debug=true -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=0.0.0.0:$(JPDA_PORT)"
mvn test -X mvn test -X
test_misc: test_misc:
......
...@@ -117,7 +117,7 @@ public class CaosDBServer extends Application { ...@@ -117,7 +117,7 @@ public class CaosDBServer extends Application {
private static ArrayList<Runnable> postShutdownHooks = new ArrayList<Runnable>(); private static ArrayList<Runnable> postShutdownHooks = new ArrayList<Runnable>();
private static ArrayList<Runnable> preShutdownHooks = new ArrayList<Runnable>(); private static ArrayList<Runnable> preShutdownHooks = new ArrayList<Runnable>();
private static boolean START_BACKEND = true; private static boolean START_BACKEND = true;
private static boolean INSECURE = false; private static boolean NO_TLS = false;
public static final String REQUEST_TIME_LOGGER = "REQUEST_TIME_LOGGER"; public static final String REQUEST_TIME_LOGGER = "REQUEST_TIME_LOGGER";
public static final String REQUEST_ERRORS_LOGGER = "REQUEST_ERRORS_LOGGER"; public static final String REQUEST_ERRORS_LOGGER = "REQUEST_ERRORS_LOGGER";
private static Scheduler SCHEDULER; private static Scheduler SCHEDULER;
...@@ -160,24 +160,23 @@ public class CaosDBServer extends Application { ...@@ -160,24 +160,23 @@ public class CaosDBServer extends Application {
* Parse the command line arguments. * Parse the command line arguments.
* *
* <ul> * <ul>
* <li>"nobackend": flag to run caosdb without any backend (for testing purposes) * <li>"--no-backend": flag to run caosdb without any backend (for testing purposes)
* <li>"insecure": flag to start only a http server (no https server) * <li>"--no-tls": flag to start only a http server (no https server)
* </ul> * </ul>
* *
* <p>Both flags are only available in the debug mode which is controlled by the `caosdb.debug` * <p>The --no-backend flag is only available in the debug mode which is controlled by the
* JVM Property. * `caosdb.debug` JVM Property.
* *
* @param args * @param args
*/ */
private static void parseArguments(final String[] args) { private static void parseArguments(final String[] args) {
for (final String s : args) { for (final String s : args) {
if (s.equals("nobackend")) { if (s.equals("--no-backend")) {
START_BACKEND = false; START_BACKEND = false;
} else if (s.equals("insecure")) { } else if (s.equals("--no-tls")) {
INSECURE = true; NO_TLS = true;
} }
} }
INSECURE = INSECURE && isDebugMode(); // only allow insecure in debug mode
START_BACKEND = START_BACKEND || !isDebugMode(); // always start backend if not in debug mode START_BACKEND = START_BACKEND || !isDebugMode(); // always start backend if not in debug mode
} }
...@@ -347,7 +346,7 @@ public class CaosDBServer extends Application { ...@@ -347,7 +346,7 @@ public class CaosDBServer extends Application {
final int maxTotalConnections = final int maxTotalConnections =
Integer.parseInt(getServerProperty(ServerProperties.KEY_MAX_CONNECTIONS)); Integer.parseInt(getServerProperty(ServerProperties.KEY_MAX_CONNECTIONS));
if (INSECURE) { if (NO_TLS) {
runHTTPServer(port_http, initialConnections, maxTotalConnections); runHTTPServer(port_http, initialConnections, maxTotalConnections);
} else { } else {
runHTTPSServer( runHTTPSServer(
......
...@@ -206,7 +206,7 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac ...@@ -206,7 +206,7 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac
} }
} }
private static boolean filterEntitiesWithoutRetrievePermisions = private boolean filterEntitiesWithoutRetrievePermisions =
!CaosDBServer.getServerProperty( !CaosDBServer.getServerProperty(
ServerProperties.KEY_QUERY_FILTER_ENTITIES_WITHOUT_RETRIEVE_PERMISSIONS) ServerProperties.KEY_QUERY_FILTER_ENTITIES_WITHOUT_RETRIEVE_PERMISSIONS)
.equalsIgnoreCase("FALSE"); .equalsIgnoreCase("FALSE");
...@@ -663,13 +663,15 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac ...@@ -663,13 +663,15 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac
if (this.container != null && this.type == Type.FIND) { if (this.container != null && this.type == Type.FIND) {
for (final IdVersionPair p : this.resultSet) { for (final IdVersionPair p : this.resultSet) {
final Entity e = new RetrieveEntity(p.id, p.version); if (p.id > 99) {
final Entity e = new RetrieveEntity(p.id, p.version);
// if query has select-clause: // if query has select-clause:
if (this.selections != null && !this.selections.isEmpty()) { if (this.selections != null && !this.selections.isEmpty()) {
e.addSelections(this.selections); e.addSelections(this.selections);
}
this.container.add(e);
} }
this.container.add(e);
} }
} }
return this; return this;
......