summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2024-06-06 12:29:35 +0200
committerSimon Rettberg2024-06-06 12:29:35 +0200
commitb6167fc868661c4959b29c3305aaaed0b541bbc0 (patch)
treec351dab3bb94307266cd820bc48d2c6912ac75d4
parentImplemente read-only mode for secondary server(s) (diff)
downloadmasterserver-b6167fc868661c4959b29c3305aaaed0b541bbc0.tar.gz
masterserver-b6167fc868661c4959b29c3305aaaed0b541bbc0.tar.xz
masterserver-b6167fc868661c4959b29c3305aaaed0b541bbc0.zip
Also deny listing public images in R/O mode
-rw-r--r--src/main/java/org/openslx/imagemaster/serverconnection/IncomingTransfer.java2
-rw-r--r--src/main/java/org/openslx/imagemaster/thrift/server/MasterServerHandler.java4
2 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/org/openslx/imagemaster/serverconnection/IncomingTransfer.java b/src/main/java/org/openslx/imagemaster/serverconnection/IncomingTransfer.java
index 0950d52..d0bb386 100644
--- a/src/main/java/org/openslx/imagemaster/serverconnection/IncomingTransfer.java
+++ b/src/main/java/org/openslx/imagemaster/serverconnection/IncomingTransfer.java
@@ -51,6 +51,7 @@ public class IncomingTransfer extends IncomingTransferBase
} catch ( SQLException e ) {
}
}
+ LOGGER.info( "Incoming transfer started" );
}
@Override
@@ -84,6 +85,7 @@ public class IncomingTransfer extends IncomingTransferBase
} catch ( SQLException e ) {
// Nothing to do
}
+ LOGGER.info( "Incoming transfer ended" );
return true;
}
diff --git a/src/main/java/org/openslx/imagemaster/thrift/server/MasterServerHandler.java b/src/main/java/org/openslx/imagemaster/thrift/server/MasterServerHandler.java
index 19ad7e6..7138111 100644
--- a/src/main/java/org/openslx/imagemaster/thrift/server/MasterServerHandler.java
+++ b/src/main/java/org/openslx/imagemaster/thrift/server/MasterServerHandler.java
@@ -140,6 +140,10 @@ public class MasterServerHandler implements MasterServer.Iface
public List<ImageSummaryRead> getPublicImages( String sessionId, int page )
throws TAuthorizationException, TInvocationException
{
+ if ( Globals.isReadOnlyMode() ) {
+ throw new TInvocationException( InvocationError.INTERNAL_SERVER_ERROR,
+ "This is a read-only failover master-server. Image up-/downloads are not available." );
+ }
Session session = SessionManager.getSessionFromSessionId( sessionId );
if ( session == null )
throw new TAuthorizationException( AuthorizationError.NOT_AUTHENTICATED, "Session ID not valid" );