Merge pull request #11 from thingsboard/feature/cloud
Separate application artifact from spring boot jar
This commit is contained in:
commit
6dc6dc063c
@ -49,7 +49,7 @@ ospackage {
|
|||||||
from(mainJar) {
|
from(mainJar) {
|
||||||
// Strip the version from the jar filename
|
// Strip the version from the jar filename
|
||||||
rename { String fileName ->
|
rename { String fileName ->
|
||||||
fileName.replace("-${project.version}", "")
|
"${pkgName}.jar"
|
||||||
}
|
}
|
||||||
fileMode 0500
|
fileMode 0500
|
||||||
into "bin"
|
into "bin"
|
||||||
|
|||||||
@ -379,6 +379,7 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<classifier>boot</classifier>
|
||||||
<layout>ZIP</layout>
|
<layout>ZIP</layout>
|
||||||
<executable>true</executable>
|
<executable>true</executable>
|
||||||
<excludeDevtools>true</excludeDevtools>
|
<excludeDevtools>true</excludeDevtools>
|
||||||
@ -408,7 +409,7 @@
|
|||||||
<args>
|
<args>
|
||||||
<arg>-PprojectBuildDir=${project.build.directory}</arg>
|
<arg>-PprojectBuildDir=${project.build.directory}</arg>
|
||||||
<arg>-PprojectVersion=${project.version}</arg>
|
<arg>-PprojectVersion=${project.version}</arg>
|
||||||
<arg>-PmainJar=${project.build.directory}/${project.build.finalName}.${project.packaging}</arg>
|
<arg>-PmainJar=${project.build.directory}/${project.build.finalName}-boot.${project.packaging}</arg>
|
||||||
<arg>-PpkgName=${pkg.name}</arg>
|
<arg>-PpkgName=${pkg.name}</arg>
|
||||||
<arg>-PpkgInstallFolder=${pkg.installFolder}</arg>
|
<arg>-PpkgInstallFolder=${pkg.installFolder}</arg>
|
||||||
<arg>-PpkgLogFolder=${pkg.logFolder}</arg>
|
<arg>-PpkgLogFolder=${pkg.logFolder}</arg>
|
||||||
|
|||||||
@ -18,12 +18,14 @@ package org.thingsboard.server.config;
|
|||||||
import org.springframework.context.MessageSource;
|
import org.springframework.context.MessageSource;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.annotation.Primary;
|
||||||
import org.springframework.context.support.ResourceBundleMessageSource;
|
import org.springframework.context.support.ResourceBundleMessageSource;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
public class ThingsboardMessageConfiguration {
|
public class ThingsboardMessageConfiguration {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@Primary
|
||||||
public MessageSource messageSource() {
|
public MessageSource messageSource() {
|
||||||
ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
|
ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
|
||||||
messageSource.setBasename("i18n/messages");
|
messageSource.setBasename("i18n/messages");
|
||||||
|
|||||||
@ -33,7 +33,7 @@ import java.util.List;
|
|||||||
@RequestMapping("/api")
|
@RequestMapping("/api")
|
||||||
public class WidgetsBundleController extends BaseController {
|
public class WidgetsBundleController extends BaseController {
|
||||||
|
|
||||||
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')")
|
||||||
@RequestMapping(value = "/widgetsBundle/{widgetsBundleId}", method = RequestMethod.GET)
|
@RequestMapping(value = "/widgetsBundle/{widgetsBundleId}", method = RequestMethod.GET)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public WidgetsBundle getWidgetsBundleById(@PathVariable("widgetsBundleId") String strWidgetsBundleId) throws ThingsboardException {
|
public WidgetsBundle getWidgetsBundleById(@PathVariable("widgetsBundleId") String strWidgetsBundleId) throws ThingsboardException {
|
||||||
@ -76,7 +76,7 @@ public class WidgetsBundleController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')")
|
||||||
@RequestMapping(value = "/widgetsBundles", params = { "limit" }, method = RequestMethod.GET)
|
@RequestMapping(value = "/widgetsBundles", params = { "limit" }, method = RequestMethod.GET)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public TextPageData<WidgetsBundle> getWidgetsBundles(
|
public TextPageData<WidgetsBundle> getWidgetsBundles(
|
||||||
@ -97,7 +97,7 @@ public class WidgetsBundleController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')")
|
||||||
@RequestMapping(value = "/widgetsBundles", method = RequestMethod.GET)
|
@RequestMapping(value = "/widgetsBundles", method = RequestMethod.GET)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public List<WidgetsBundle> getWidgetsBundles() throws ThingsboardException {
|
public List<WidgetsBundle> getWidgetsBundles() throws ThingsboardException {
|
||||||
|
|||||||
@ -26,6 +26,7 @@ import javax.mail.internet.MimeMessage;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.velocity.app.VelocityEngine;
|
import org.apache.velocity.app.VelocityEngine;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.thingsboard.server.exception.ThingsboardErrorCode;
|
import org.thingsboard.server.exception.ThingsboardErrorCode;
|
||||||
import org.thingsboard.server.exception.ThingsboardException;
|
import org.thingsboard.server.exception.ThingsboardException;
|
||||||
import org.thingsboard.server.common.data.AdminSettings;
|
import org.thingsboard.server.common.data.AdminSettings;
|
||||||
@ -50,6 +51,7 @@ public class DefaultMailService implements MailService {
|
|||||||
private MessageSource messages;
|
private MessageSource messages;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@Qualifier("velocityEngine")
|
||||||
private VelocityEngine engine;
|
private VelocityEngine engine;
|
||||||
|
|
||||||
private JavaMailSenderImpl mailSender;
|
private JavaMailSenderImpl mailSender;
|
||||||
@ -102,6 +104,11 @@ public class DefaultMailService implements MailService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sendEmail(String email, String subject, String message) throws ThingsboardException {
|
||||||
|
sendMail(mailSender, mailFrom, email, subject, message);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendTestMail(JsonNode jsonConfig, String email) throws ThingsboardException {
|
public void sendTestMail(JsonNode jsonConfig, String email) throws ThingsboardException {
|
||||||
JavaMailSenderImpl testMailSender = createMailSender(jsonConfig);
|
JavaMailSenderImpl testMailSender = createMailSender(jsonConfig);
|
||||||
|
|||||||
@ -23,6 +23,8 @@ public interface MailService {
|
|||||||
|
|
||||||
void updateMailConfiguration();
|
void updateMailConfiguration();
|
||||||
|
|
||||||
|
void sendEmail(String email, String subject, String message) throws ThingsboardException;
|
||||||
|
|
||||||
void sendTestMail(JsonNode config, String email) throws ThingsboardException;
|
void sendTestMail(JsonNode config, String email) throws ThingsboardException;
|
||||||
|
|
||||||
void sendActivationEmail(String activationLink, String email) throws ThingsboardException;
|
void sendActivationEmail(String activationLink, String email) throws ThingsboardException;
|
||||||
|
|||||||
@ -156,7 +156,7 @@ public class UserServiceImpl implements UserService {
|
|||||||
UserCredentialsEntity userCredentialsEntity = userCredentialsDao.findByUserId(userEntity.getId());
|
UserCredentialsEntity userCredentialsEntity = userCredentialsDao.findByUserId(userEntity.getId());
|
||||||
UserCredentials userCredentials = getData(userCredentialsEntity);
|
UserCredentials userCredentials = getData(userCredentialsEntity);
|
||||||
if (!userCredentials.isEnabled()) {
|
if (!userCredentials.isEnabled()) {
|
||||||
throw new IncorrectParameterException("Unable to reset password for unactive user");
|
throw new IncorrectParameterException("Unable to reset password for inactive user");
|
||||||
}
|
}
|
||||||
userCredentials.setResetToken(RandomStringUtils.randomAlphanumeric(30));
|
userCredentials.setResetToken(RandomStringUtils.randomAlphanumeric(30));
|
||||||
return saveUserCredentials(userCredentials);
|
return saveUserCredentials(userCredentials);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user