From 1468363974e12aff6b42b29c2bac27be81a8cc3d Mon Sep 17 00:00:00 2001 From: TheOtherP Date: Mon, 18 Mar 2024 15:43:35 +0100 Subject: [PATCH] 5.3.9 didn't start properly. Sorry... Closes #926 Closes #927 --- core/src/main/java/org/nzbhydra/DevEndpoint.java | 14 ++++++++------ core/src/main/resources/changelog.yaml | 6 ++++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/org/nzbhydra/DevEndpoint.java b/core/src/main/java/org/nzbhydra/DevEndpoint.java index 045f4f2d5..36efe4171 100644 --- a/core/src/main/java/org/nzbhydra/DevEndpoint.java +++ b/core/src/main/java/org/nzbhydra/DevEndpoint.java @@ -42,7 +42,6 @@ import java.util.List; @SuppressWarnings("unchecked") -@Secured({"ROLE_ADMIN"}) @RestController public class DevEndpoint { @@ -54,37 +53,39 @@ public class DevEndpoint { private ConfigProvider configProvider; @Autowired private ApplicationEventPublisher applicationEventPublisher; - @Value("${nzbhydra.devMode}") + @Value("${nzbhydra.devMode:false}") private boolean devMode; private static final Logger logger = LoggerFactory.getLogger(DevEndpoint.class); - + @Secured({"ROLE_ADMIN"}) @RequestMapping(value = "/dev/countDanglingIndexersearches", method = RequestMethod.GET) public BigInteger countDanglingIndexersearches() throws Exception { final List resultList = entityManager.createNativeQuery("select count(*) from SEARCHRESULT x where x.INDEXERSEARCHENTITY not in (select y.id from INDEXERSEARCH y)").getResultList(); return resultList.get(0); } - + @Secured({"ROLE_ADMIN"}) @RequestMapping(value = "/dev/throwException", method = RequestMethod.GET) public BigInteger throwException() throws Exception { throw new RuntimeException("test"); } - + @Secured({"ROLE_ADMIN"}) @RequestMapping(value = "/dev/throwAccessDeniedException", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) public BigInteger throwAccessDeniedException() throws Exception { throw new AccessDeniedException("test"); } + @Secured({"ROLE_ADMIN"}) @Transactional @RequestMapping(value = "/dev/deleteDanglingIndexersearches", method = RequestMethod.GET) public String deleteDanglingIndexersearches() throws Exception { return "Deleted " + entityManager.createNativeQuery("delete from SEARCHRESULT where INDEXERSEARCHENTITY not in (select y.id from INDEXERSEARCH y)").executeUpdate() + " entries"; } + @Secured({"ROLE_ADMIN"}) @RequestMapping(value = "/dev/testAddToSonarr", method = RequestMethod.GET) public String testAddToSonarr() throws Exception { if (!devMode) { @@ -102,7 +103,7 @@ public String testAddToSonarr() throws Exception { return "OK"; } - + @Secured({"ROLE_ADMIN"}) @RequestMapping(value = "/dev/sendIndexerDisabledNotification", method = RequestMethod.GET) public void sendIndexerDisabledNotification() { applicationEventPublisher.publishEvent(new IndexerDisabledNotificationEvent(configProvider.getBaseConfig().getIndexers().get(0).getName(), IndexerConfig.State.DISABLED_SYSTEM_TEMPORARY, "Some message generated by hydra")); @@ -115,6 +116,7 @@ public void sendIndexerDisabledNotification() { applicationEventPublisher.publishEvent(new IndexerDisabledNotificationEvent(configProvider.getBaseConfig().getIndexers().get(0).getName(), IndexerConfig.State.DISABLED_SYSTEM_TEMPORARY, "Some message generated by hydra8")); } + @Secured({"ROLE_ADMIN"}) @RequestMapping(value = "/dev/crash", method = RequestMethod.GET) public void crashHard() throws Exception { if (!devMode) { diff --git a/core/src/main/resources/changelog.yaml b/core/src/main/resources/changelog.yaml index 2c82af9b7..97aafc8eb 100644 --- a/core/src/main/resources/changelog.yaml +++ b/core/src/main/resources/changelog.yaml @@ -1,4 +1,10 @@ #@formatter:off +- version: "v5.3.10" + date: "2024-03-18" + changes: + - type: "fix" + text: "5.3.9 didn't start properly. Sorry..." + final: true - version: "v5.3.9" date: "2024-03-18" changes: