diff --git a/bubble-server/src/main/java/bubble/dao/device/DeviceDAO.java b/bubble-server/src/main/java/bubble/dao/device/DeviceDAO.java index 3686a00c..38e1cac1 100644 --- a/bubble-server/src/main/java/bubble/dao/device/DeviceDAO.java +++ b/bubble-server/src/main/java/bubble/dao/device/DeviceDAO.java @@ -67,7 +67,7 @@ public class DeviceDAO extends AccountOwnedEntityDAO { @Transactional @Override public Device create(@NonNull final Device device) { - if (isRawMode() || device.uninitialized() || device.getDeviceType().isNonVpnDevice()) { + if (isRawMode() || device.uninitialized() || device.getDeviceType().isNonVpnDevice() || configuration.isSage()) { return super.create(device); } diff --git a/bubble-server/src/main/java/bubble/server/BubbleConfiguration.java b/bubble-server/src/main/java/bubble/server/BubbleConfiguration.java index 9aa8355f..616191fa 100644 --- a/bubble-server/src/main/java/bubble/server/BubbleConfiguration.java +++ b/bubble-server/src/main/java/bubble/server/BubbleConfiguration.java @@ -140,6 +140,11 @@ public class BubbleConfiguration extends PgRestServerConfiguration return isSelfSage() || !hasSageNode(); } + @JsonIgnore @Transient public boolean isSage() { + final BubbleNetwork thisNetwork = getThisNetwork(); + return thisNetwork != null && thisNetwork.getInstallType() == AnsibleInstallType.sage; + } + @JsonIgnore @Transient public synchronized BubbleNetwork getThisNetwork () { return getBean(StandardSelfNodeService.class).getThisNetwork(); }