Showing
100 changed files
with
865 additions
and
1898 deletions
Too many changes to show.
To preserve performance only 100 of 135 files are displayed.
@@ -34,10 +34,15 @@ | @@ -34,10 +34,15 @@ | ||
34 | <properties> | 34 | <properties> |
35 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | 35 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
36 | <main.dir>${basedir}/..</main.dir> | 36 | <main.dir>${basedir}/..</main.dir> |
37 | + <pkg.type>java</pkg.type> | ||
38 | + <pkg.disabled>false</pkg.disabled> | ||
39 | + <pkg.process-resources.phase>process-resources</pkg.process-resources.phase> | ||
40 | + <pkg.package.phase>package</pkg.package.phase> | ||
37 | <pkg.name>thingsboard</pkg.name> | 41 | <pkg.name>thingsboard</pkg.name> |
38 | - <pkg.unixLogFolder>/var/log/${pkg.name}</pkg.unixLogFolder> | ||
39 | - <pkg.installFolder>/usr/share/${pkg.name}</pkg.installFolder> | ||
40 | <pkg.win.dist>${project.build.directory}/windows</pkg.win.dist> | 42 | <pkg.win.dist>${project.build.directory}/windows</pkg.win.dist> |
43 | + <pkg.copyInstallScripts>true</pkg.copyInstallScripts> | ||
44 | + <pkg.implementationTitle>ThingsBoard</pkg.implementationTitle> | ||
45 | + <pkg.mainClass>org.thingsboard.server.ThingsboardServerApplication</pkg.mainClass> | ||
41 | </properties> | 46 | </properties> |
42 | 47 | ||
43 | <dependencies> | 48 | <dependencies> |
@@ -315,6 +320,10 @@ | @@ -315,6 +320,10 @@ | ||
315 | <plugins> | 320 | <plugins> |
316 | <plugin> | 321 | <plugin> |
317 | <groupId>org.apache.maven.plugins</groupId> | 322 | <groupId>org.apache.maven.plugins</groupId> |
323 | + <artifactId>maven-compiler-plugin</artifactId> | ||
324 | + </plugin> | ||
325 | + <plugin> | ||
326 | + <groupId>org.apache.maven.plugins</groupId> | ||
318 | <artifactId>maven-surefire-plugin</artifactId> | 327 | <artifactId>maven-surefire-plugin</artifactId> |
319 | <version>${surfire.version}</version> | 328 | <version>${surfire.version}</version> |
320 | <configuration> | 329 | <configuration> |
@@ -329,313 +338,30 @@ | @@ -329,313 +338,30 @@ | ||
329 | <plugin> | 338 | <plugin> |
330 | <groupId>org.apache.maven.plugins</groupId> | 339 | <groupId>org.apache.maven.plugins</groupId> |
331 | <artifactId>maven-resources-plugin</artifactId> | 340 | <artifactId>maven-resources-plugin</artifactId> |
332 | - <executions> | ||
333 | - <execution> | ||
334 | - <id>copy-conf</id> | ||
335 | - <phase>process-resources</phase> | ||
336 | - <goals> | ||
337 | - <goal>copy-resources</goal> | ||
338 | - </goals> | ||
339 | - <configuration> | ||
340 | - <outputDirectory>${project.build.directory}/conf</outputDirectory> | ||
341 | - <resources> | ||
342 | - <resource> | ||
343 | - <directory>src/main/resources</directory> | ||
344 | - <excludes> | ||
345 | - <exclude>logback.xml</exclude> | ||
346 | - </excludes> | ||
347 | - <filtering>false</filtering> | ||
348 | - </resource> | ||
349 | - </resources> | ||
350 | - </configuration> | ||
351 | - </execution> | ||
352 | - <execution> | ||
353 | - <id>copy-service-conf</id> | ||
354 | - <phase>process-resources</phase> | ||
355 | - <goals> | ||
356 | - <goal>copy-resources</goal> | ||
357 | - </goals> | ||
358 | - <configuration> | ||
359 | - <outputDirectory>${project.build.directory}/conf</outputDirectory> | ||
360 | - <resources> | ||
361 | - <resource> | ||
362 | - <directory>src/main/conf</directory> | ||
363 | - <filtering>true</filtering> | ||
364 | - </resource> | ||
365 | - </resources> | ||
366 | - <filters> | ||
367 | - <filter>src/main/filters/unix.properties</filter> | ||
368 | - </filters> | ||
369 | - </configuration> | ||
370 | - </execution> | ||
371 | - <execution> | ||
372 | - <id>copy-win-conf</id> | ||
373 | - <phase>process-resources</phase> | ||
374 | - <goals> | ||
375 | - <goal>copy-resources</goal> | ||
376 | - </goals> | ||
377 | - <configuration> | ||
378 | - <outputDirectory>${pkg.win.dist}/conf</outputDirectory> | ||
379 | - <resources> | ||
380 | - <resource> | ||
381 | - <directory>src/main/resources</directory> | ||
382 | - <excludes> | ||
383 | - <exclude>logback.xml</exclude> | ||
384 | - </excludes> | ||
385 | - <filtering>false</filtering> | ||
386 | - </resource> | ||
387 | - <resource> | ||
388 | - <directory>src/main/conf</directory> | ||
389 | - <excludes> | ||
390 | - <exclude>thingsboard.conf</exclude> | ||
391 | - </excludes> | ||
392 | - <filtering>true</filtering> | ||
393 | - </resource> | ||
394 | - </resources> | ||
395 | - <filters> | ||
396 | - <filter>src/main/filters/windows.properties</filter> | ||
397 | - </filters> | ||
398 | - </configuration> | ||
399 | - </execution> | ||
400 | - <execution> | ||
401 | - <id>copy-control</id> | ||
402 | - <phase>process-resources</phase> | ||
403 | - <goals> | ||
404 | - <goal>copy-resources</goal> | ||
405 | - </goals> | ||
406 | - <configuration> | ||
407 | - <outputDirectory>${project.build.directory}/control</outputDirectory> | ||
408 | - <resources> | ||
409 | - <resource> | ||
410 | - <directory>src/main/scripts/control</directory> | ||
411 | - <filtering>true</filtering> | ||
412 | - </resource> | ||
413 | - </resources> | ||
414 | - <filters> | ||
415 | - <filter>src/main/filters/unix.properties</filter> | ||
416 | - </filters> | ||
417 | - </configuration> | ||
418 | - </execution> | ||
419 | - <execution> | ||
420 | - <id>copy-install</id> | ||
421 | - <phase>process-resources</phase> | ||
422 | - <goals> | ||
423 | - <goal>copy-resources</goal> | ||
424 | - </goals> | ||
425 | - <configuration> | ||
426 | - <outputDirectory>${project.build.directory}/bin/install</outputDirectory> | ||
427 | - <resources> | ||
428 | - <resource> | ||
429 | - <directory>src/main/scripts/install</directory> | ||
430 | - <includes> | ||
431 | - <include>**/*.sh</include> | ||
432 | - <include>**/*.xml</include> | ||
433 | - </includes> | ||
434 | - <filtering>true</filtering> | ||
435 | - </resource> | ||
436 | - </resources> | ||
437 | - <filters> | ||
438 | - <filter>src/main/filters/unix.properties</filter> | ||
439 | - </filters> | ||
440 | - </configuration> | ||
441 | - </execution> | ||
442 | - <execution> | ||
443 | - <id>copy-windows-control</id> | ||
444 | - <phase>process-resources</phase> | ||
445 | - <goals> | ||
446 | - <goal>copy-resources</goal> | ||
447 | - </goals> | ||
448 | - <configuration> | ||
449 | - <outputDirectory>${pkg.win.dist}</outputDirectory> | ||
450 | - <resources> | ||
451 | - <resource> | ||
452 | - <directory>src/main/scripts/windows</directory> | ||
453 | - <filtering>true</filtering> | ||
454 | - </resource> | ||
455 | - </resources> | ||
456 | - <filters> | ||
457 | - <filter>src/main/filters/windows.properties</filter> | ||
458 | - </filters> | ||
459 | - </configuration> | ||
460 | - </execution> | ||
461 | - <execution> | ||
462 | - <id>copy-windows-install</id> | ||
463 | - <phase>process-resources</phase> | ||
464 | - <goals> | ||
465 | - <goal>copy-resources</goal> | ||
466 | - </goals> | ||
467 | - <configuration> | ||
468 | - <outputDirectory>${pkg.win.dist}/install</outputDirectory> | ||
469 | - <resources> | ||
470 | - <resource> | ||
471 | - <directory>src/main/scripts/install</directory> | ||
472 | - <includes> | ||
473 | - <include>logback.xml</include> | ||
474 | - </includes> | ||
475 | - <filtering>true</filtering> | ||
476 | - </resource> | ||
477 | - </resources> | ||
478 | - <filters> | ||
479 | - <filter>src/main/filters/windows.properties</filter> | ||
480 | - </filters> | ||
481 | - </configuration> | ||
482 | - </execution> | ||
483 | - <execution> | ||
484 | - <id>copy-data</id> | ||
485 | - <phase>process-resources</phase> | ||
486 | - <goals> | ||
487 | - <goal>copy-resources</goal> | ||
488 | - </goals> | ||
489 | - <configuration> | ||
490 | - <outputDirectory>${project.build.directory}/data</outputDirectory> | ||
491 | - <resources> | ||
492 | - <resource> | ||
493 | - <directory>src/main/data</directory> | ||
494 | - </resource> | ||
495 | - <resource> | ||
496 | - <directory>../dao/src/main/resources</directory> | ||
497 | - <includes> | ||
498 | - <include>**/*.cql</include> | ||
499 | - <include>**/*.sql</include> | ||
500 | - </includes> | ||
501 | - <filtering>false</filtering> | ||
502 | - </resource> | ||
503 | - </resources> | ||
504 | - </configuration> | ||
505 | - </execution> | ||
506 | - </executions> | ||
507 | </plugin> | 341 | </plugin> |
508 | <plugin> | 342 | <plugin> |
509 | <groupId>org.apache.maven.plugins</groupId> | 343 | <groupId>org.apache.maven.plugins</groupId> |
510 | <artifactId>maven-dependency-plugin</artifactId> | 344 | <artifactId>maven-dependency-plugin</artifactId> |
511 | - <executions> | ||
512 | - <execution> | ||
513 | - <id>copy-winsw-service</id> | ||
514 | - <phase>package</phase> | ||
515 | - <goals> | ||
516 | - <goal>copy</goal> | ||
517 | - </goals> | ||
518 | - <configuration> | ||
519 | - <artifactItems> | ||
520 | - <artifactItem> | ||
521 | - <groupId>com.sun.winsw</groupId> | ||
522 | - <artifactId>winsw</artifactId> | ||
523 | - <classifier>bin</classifier> | ||
524 | - <type>exe</type> | ||
525 | - <destFileName>service.exe</destFileName> | ||
526 | - </artifactItem> | ||
527 | - </artifactItems> | ||
528 | - <outputDirectory>${pkg.win.dist}</outputDirectory> | ||
529 | - </configuration> | ||
530 | - </execution> | ||
531 | - </executions> | ||
532 | </plugin> | 345 | </plugin> |
533 | <plugin> | 346 | <plugin> |
534 | <groupId>org.apache.maven.plugins</groupId> | 347 | <groupId>org.apache.maven.plugins</groupId> |
535 | <artifactId>maven-jar-plugin</artifactId> | 348 | <artifactId>maven-jar-plugin</artifactId> |
536 | - <configuration> | ||
537 | - <excludes> | ||
538 | - <exclude>**/logback.xml</exclude> | ||
539 | - </excludes> | ||
540 | - <archive> | ||
541 | - <manifestEntries> | ||
542 | - <Implementation-Title>ThingsBoard</Implementation-Title> | ||
543 | - <Implementation-Version>${project.version}</Implementation-Version> | ||
544 | - </manifestEntries> | ||
545 | - </archive> | ||
546 | - </configuration> | ||
547 | </plugin> | 349 | </plugin> |
548 | <plugin> | 350 | <plugin> |
549 | <groupId>org.springframework.boot</groupId> | 351 | <groupId>org.springframework.boot</groupId> |
550 | <artifactId>spring-boot-maven-plugin</artifactId> | 352 | <artifactId>spring-boot-maven-plugin</artifactId> |
551 | - <configuration> | ||
552 | - <mainClass>org.thingsboard.server.ThingsboardServerApplication</mainClass> | ||
553 | - <classifier>boot</classifier> | ||
554 | - <layout>ZIP</layout> | ||
555 | - <executable>true</executable> | ||
556 | - <excludeDevtools>true</excludeDevtools> | ||
557 | - <embeddedLaunchScriptProperties> | ||
558 | - <confFolder>${pkg.installFolder}/conf</confFolder> | ||
559 | - <logFolder>${pkg.unixLogFolder}</logFolder> | ||
560 | - <logFilename>${pkg.name}.out</logFilename> | ||
561 | - <initInfoProvides>${pkg.name}</initInfoProvides> | ||
562 | - </embeddedLaunchScriptProperties> | ||
563 | - </configuration> | ||
564 | - <executions> | ||
565 | - <execution> | ||
566 | - <goals> | ||
567 | - <goal>repackage</goal> | ||
568 | - </goals> | ||
569 | - </execution> | ||
570 | - </executions> | ||
571 | </plugin> | 353 | </plugin> |
572 | <plugin> | 354 | <plugin> |
573 | <groupId>org.thingsboard</groupId> | 355 | <groupId>org.thingsboard</groupId> |
574 | <artifactId>gradle-maven-plugin</artifactId> | 356 | <artifactId>gradle-maven-plugin</artifactId> |
575 | - <configuration> | ||
576 | - <tasks> | ||
577 | - <task>build</task> | ||
578 | - <task>buildDeb</task> | ||
579 | - <task>buildRpm</task> | ||
580 | - </tasks> | ||
581 | - <args> | ||
582 | - <arg>-PprojectBuildDir=${project.build.directory}</arg> | ||
583 | - <arg>-PprojectVersion=${project.version}</arg> | ||
584 | - <arg>-PmainJar=${project.build.directory}/${project.build.finalName}-boot.${project.packaging} | ||
585 | - </arg> | ||
586 | - <arg>-PpkgName=${pkg.name}</arg> | ||
587 | - <arg>-PpkgInstallFolder=${pkg.installFolder}</arg> | ||
588 | - <arg>-PpkgLogFolder=${pkg.unixLogFolder}</arg> | ||
589 | - </args> | ||
590 | - </configuration> | ||
591 | - <executions> | ||
592 | - <execution> | ||
593 | - <phase>package</phase> | ||
594 | - <goals> | ||
595 | - <goal>invoke</goal> | ||
596 | - </goals> | ||
597 | - </execution> | ||
598 | - </executions> | ||
599 | </plugin> | 357 | </plugin> |
600 | <plugin> | 358 | <plugin> |
601 | <groupId>org.apache.maven.plugins</groupId> | 359 | <groupId>org.apache.maven.plugins</groupId> |
602 | <artifactId>maven-assembly-plugin</artifactId> | 360 | <artifactId>maven-assembly-plugin</artifactId> |
603 | - <configuration> | ||
604 | - <finalName>${pkg.name}</finalName> | ||
605 | - <descriptors> | ||
606 | - <descriptor>src/main/assembly/windows.xml</descriptor> | ||
607 | - </descriptors> | ||
608 | - </configuration> | ||
609 | - <executions> | ||
610 | - <execution> | ||
611 | - <id>assembly</id> | ||
612 | - <phase>package</phase> | ||
613 | - <goals> | ||
614 | - <goal>single</goal> | ||
615 | - </goals> | ||
616 | - </execution> | ||
617 | - </executions> | ||
618 | </plugin> | 361 | </plugin> |
619 | <plugin> | 362 | <plugin> |
620 | <groupId>org.apache.maven.plugins</groupId> | 363 | <groupId>org.apache.maven.plugins</groupId> |
621 | <artifactId>maven-install-plugin</artifactId> | 364 | <artifactId>maven-install-plugin</artifactId> |
622 | - <configuration> | ||
623 | - <file>${project.build.directory}/${pkg.name}.deb</file> | ||
624 | - <artifactId>${project.artifactId}</artifactId> | ||
625 | - <groupId>${project.groupId}</groupId> | ||
626 | - <version>${project.version}</version> | ||
627 | - <classifier>deb</classifier> | ||
628 | - <packaging>deb</packaging> | ||
629 | - </configuration> | ||
630 | - <executions> | ||
631 | - <execution> | ||
632 | - <id>install-deb</id> | ||
633 | - <phase>package</phase> | ||
634 | - <goals> | ||
635 | - <goal>install-file</goal> | ||
636 | - </goals> | ||
637 | - </execution> | ||
638 | - </executions> | ||
639 | </plugin> | 365 | </plugin> |
640 | <plugin> | 366 | <plugin> |
641 | <groupId>org.xolstice.maven.plugins</groupId> | 367 | <groupId>org.xolstice.maven.plugins</groupId> |
@@ -15,6 +15,9 @@ | @@ -15,6 +15,9 @@ | ||
15 | */ | 15 | */ |
16 | package org.thingsboard.server.service.security.auth.oauth2; | 16 | package org.thingsboard.server.service.security.auth.oauth2; |
17 | 17 | ||
18 | +import com.fasterxml.jackson.databind.ObjectMapper; | ||
19 | +import com.fasterxml.jackson.databind.node.ObjectNode; | ||
20 | +import com.google.common.base.Strings; | ||
18 | import lombok.extern.slf4j.Slf4j; | 21 | import lombok.extern.slf4j.Slf4j; |
19 | import org.springframework.beans.factory.annotation.Autowired; | 22 | import org.springframework.beans.factory.annotation.Autowired; |
20 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; | 23 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; |
@@ -22,14 +25,20 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException; | @@ -22,14 +25,20 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException; | ||
22 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; | 25 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
23 | import org.springframework.util.StringUtils; | 26 | import org.springframework.util.StringUtils; |
24 | import org.thingsboard.server.common.data.Customer; | 27 | import org.thingsboard.server.common.data.Customer; |
28 | +import org.thingsboard.server.common.data.DashboardInfo; | ||
25 | import org.thingsboard.server.common.data.Tenant; | 29 | import org.thingsboard.server.common.data.Tenant; |
26 | import org.thingsboard.server.common.data.User; | 30 | import org.thingsboard.server.common.data.User; |
27 | import org.thingsboard.server.common.data.id.CustomerId; | 31 | import org.thingsboard.server.common.data.id.CustomerId; |
32 | +import org.thingsboard.server.common.data.id.DashboardId; | ||
33 | +import org.thingsboard.server.common.data.id.IdBased; | ||
28 | import org.thingsboard.server.common.data.id.TenantId; | 34 | import org.thingsboard.server.common.data.id.TenantId; |
35 | +import org.thingsboard.server.common.data.page.PageData; | ||
29 | import org.thingsboard.server.common.data.page.PageLink; | 36 | import org.thingsboard.server.common.data.page.PageLink; |
37 | +import org.thingsboard.server.common.data.page.TimePageLink; | ||
30 | import org.thingsboard.server.common.data.security.Authority; | 38 | import org.thingsboard.server.common.data.security.Authority; |
31 | import org.thingsboard.server.common.data.security.UserCredentials; | 39 | import org.thingsboard.server.common.data.security.UserCredentials; |
32 | import org.thingsboard.server.dao.customer.CustomerService; | 40 | import org.thingsboard.server.dao.customer.CustomerService; |
41 | +import org.thingsboard.server.dao.dashboard.DashboardService; | ||
33 | import org.thingsboard.server.dao.oauth2.OAuth2User; | 42 | import org.thingsboard.server.dao.oauth2.OAuth2User; |
34 | import org.thingsboard.server.dao.tenant.TenantService; | 43 | import org.thingsboard.server.dao.tenant.TenantService; |
35 | import org.thingsboard.server.dao.user.UserService; | 44 | import org.thingsboard.server.dao.user.UserService; |
@@ -40,11 +49,15 @@ import org.thingsboard.server.service.security.model.UserPrincipal; | @@ -40,11 +49,15 @@ import org.thingsboard.server.service.security.model.UserPrincipal; | ||
40 | import java.io.IOException; | 49 | import java.io.IOException; |
41 | import java.util.List; | 50 | import java.util.List; |
42 | import java.util.Optional; | 51 | import java.util.Optional; |
52 | +import java.util.concurrent.ExecutionException; | ||
43 | import java.util.concurrent.locks.Lock; | 53 | import java.util.concurrent.locks.Lock; |
44 | import java.util.concurrent.locks.ReentrantLock; | 54 | import java.util.concurrent.locks.ReentrantLock; |
45 | 55 | ||
46 | @Slf4j | 56 | @Slf4j |
47 | public abstract class AbstractOAuth2ClientMapper { | 57 | public abstract class AbstractOAuth2ClientMapper { |
58 | + private static final int DASHBOARDS_REQUEST_LIMIT = 10; | ||
59 | + | ||
60 | + private static final ObjectMapper objectMapper = new ObjectMapper(); | ||
48 | 61 | ||
49 | @Autowired | 62 | @Autowired |
50 | private UserService userService; | 63 | private UserService userService; |
@@ -59,6 +72,9 @@ public abstract class AbstractOAuth2ClientMapper { | @@ -59,6 +72,9 @@ public abstract class AbstractOAuth2ClientMapper { | ||
59 | private CustomerService customerService; | 72 | private CustomerService customerService; |
60 | 73 | ||
61 | @Autowired | 74 | @Autowired |
75 | + private DashboardService dashboardService; | ||
76 | + | ||
77 | + @Autowired | ||
62 | private InstallScripts installScripts; | 78 | private InstallScripts installScripts; |
63 | 79 | ||
64 | private final Lock userCreationLock = new ReentrantLock(); | 80 | private final Lock userCreationLock = new ReentrantLock(); |
@@ -92,6 +108,20 @@ public abstract class AbstractOAuth2ClientMapper { | @@ -92,6 +108,20 @@ public abstract class AbstractOAuth2ClientMapper { | ||
92 | user.setEmail(oauth2User.getEmail()); | 108 | user.setEmail(oauth2User.getEmail()); |
93 | user.setFirstName(oauth2User.getFirstName()); | 109 | user.setFirstName(oauth2User.getFirstName()); |
94 | user.setLastName(oauth2User.getLastName()); | 110 | user.setLastName(oauth2User.getLastName()); |
111 | + | ||
112 | + if (!StringUtils.isEmpty(oauth2User.getDefaultDashboardName())) { | ||
113 | + Optional<DashboardId> dashboardIdOpt = | ||
114 | + user.getAuthority() == Authority.TENANT_ADMIN ? | ||
115 | + getDashboardId(tenantId, oauth2User.getDefaultDashboardName()) | ||
116 | + : getDashboardId(tenantId, customerId, oauth2User.getDefaultDashboardName()); | ||
117 | + if (dashboardIdOpt.isPresent()) { | ||
118 | + ObjectNode additionalInfo = objectMapper.createObjectNode(); | ||
119 | + additionalInfo.put("defaultDashboardFullscreen", oauth2User.isAlwaysFullScreen()); | ||
120 | + additionalInfo.put("defaultDashboardId", dashboardIdOpt.get().getId().toString()); | ||
121 | + user.setAdditionalInfo(additionalInfo); | ||
122 | + } | ||
123 | + } | ||
124 | + | ||
95 | user = userService.saveUser(user); | 125 | user = userService.saveUser(user); |
96 | if (activateUser) { | 126 | if (activateUser) { |
97 | UserCredentials userCredentials = userService.findUserCredentialsByUserId(user.getTenantId(), user.getId()); | 127 | UserCredentials userCredentials = userService.findUserCredentialsByUserId(user.getTenantId(), user.getId()); |
@@ -143,4 +173,28 @@ public abstract class AbstractOAuth2ClientMapper { | @@ -143,4 +173,28 @@ public abstract class AbstractOAuth2ClientMapper { | ||
143 | return customerService.saveCustomer(customer).getId(); | 173 | return customerService.saveCustomer(customer).getId(); |
144 | } | 174 | } |
145 | } | 175 | } |
176 | + | ||
177 | + private Optional<DashboardId> getDashboardId(TenantId tenantId, String dashboardName) { | ||
178 | + PageLink searchTextLink = new PageLink(1, 0, dashboardName); | ||
179 | + PageData<DashboardInfo> dashboardsPage = dashboardService.findDashboardsByTenantId(tenantId, searchTextLink); | ||
180 | + return dashboardsPage.getData().stream() | ||
181 | + .findAny() | ||
182 | + .map(IdBased::getId); | ||
183 | + } | ||
184 | + | ||
185 | + private Optional<DashboardId> getDashboardId(TenantId tenantId, CustomerId customerId, String dashboardName) { | ||
186 | + PageData<DashboardInfo> dashboardsPage; | ||
187 | + PageLink pageLink = null; | ||
188 | + do { | ||
189 | + pageLink = pageLink == null ? new PageLink(DASHBOARDS_REQUEST_LIMIT) : pageLink.nextPageLink(); | ||
190 | + dashboardsPage = dashboardService.findDashboardsByTenantIdAndCustomerId(tenantId, customerId, pageLink); | ||
191 | + Optional<DashboardInfo> dashboardInfoOpt = dashboardsPage.getData().stream() | ||
192 | + .filter(dashboardInfo -> dashboardName.equals(dashboardInfo.getName())) | ||
193 | + .findAny(); | ||
194 | + if (dashboardInfoOpt.isPresent()) { | ||
195 | + return dashboardInfoOpt.map(DashboardInfo::getId); | ||
196 | + } | ||
197 | + } while (dashboardsPage.hasNext()); | ||
198 | + return Optional.empty(); | ||
199 | + } | ||
146 | } | 200 | } |
@@ -56,6 +56,10 @@ public class BasicOAuth2ClientMapper extends AbstractOAuth2ClientMapper implemen | @@ -56,6 +56,10 @@ public class BasicOAuth2ClientMapper extends AbstractOAuth2ClientMapper implemen | ||
56 | String customerName = sub.replace(config.getBasic().getCustomerNamePattern()); | 56 | String customerName = sub.replace(config.getBasic().getCustomerNamePattern()); |
57 | oauth2User.setCustomerName(customerName); | 57 | oauth2User.setCustomerName(customerName); |
58 | } | 58 | } |
59 | + oauth2User.setAlwaysFullScreen(config.getBasic().isAlwaysFullScreen()); | ||
60 | + if (!StringUtils.isEmpty(config.getBasic().getDefaultDashboardName())) { | ||
61 | + oauth2User.setDefaultDashboardName(config.getBasic().getDefaultDashboardName()); | ||
62 | + } | ||
59 | 63 | ||
60 | return getOrCreateSecurityUserFromOAuth2User(oauth2User, config.isAllowUserCreation(), config.isActivateUser()); | 64 | return getOrCreateSecurityUserFromOAuth2User(oauth2User, config.isAllowUserCreation(), config.isActivateUser()); |
61 | } | 65 | } |
@@ -17,6 +17,7 @@ package org.thingsboard.server.service.transport; | @@ -17,6 +17,7 @@ package org.thingsboard.server.service.transport; | ||
17 | 17 | ||
18 | import com.fasterxml.jackson.core.JsonProcessingException; | 18 | import com.fasterxml.jackson.core.JsonProcessingException; |
19 | import com.fasterxml.jackson.databind.ObjectMapper; | 19 | import com.fasterxml.jackson.databind.ObjectMapper; |
20 | +import com.fasterxml.jackson.databind.node.ObjectNode; | ||
20 | import com.google.common.util.concurrent.Futures; | 21 | import com.google.common.util.concurrent.Futures; |
21 | import com.google.common.util.concurrent.ListenableFuture; | 22 | import com.google.common.util.concurrent.ListenableFuture; |
22 | import com.google.common.util.concurrent.MoreExecutors; | 23 | import com.google.common.util.concurrent.MoreExecutors; |
@@ -24,13 +25,18 @@ import lombok.extern.slf4j.Slf4j; | @@ -24,13 +25,18 @@ import lombok.extern.slf4j.Slf4j; | ||
24 | import org.springframework.beans.factory.annotation.Autowired; | 25 | import org.springframework.beans.factory.annotation.Autowired; |
25 | import org.springframework.stereotype.Service; | 26 | import org.springframework.stereotype.Service; |
26 | import org.springframework.util.StringUtils; | 27 | import org.springframework.util.StringUtils; |
28 | +import org.thingsboard.server.common.data.DataConstants; | ||
27 | import org.thingsboard.server.common.data.Device; | 29 | import org.thingsboard.server.common.data.Device; |
28 | import org.thingsboard.server.common.data.Tenant; | 30 | import org.thingsboard.server.common.data.Tenant; |
31 | +import org.thingsboard.server.common.data.id.CustomerId; | ||
29 | import org.thingsboard.server.common.data.id.DeviceId; | 32 | import org.thingsboard.server.common.data.id.DeviceId; |
30 | import org.thingsboard.server.common.data.id.TenantId; | 33 | import org.thingsboard.server.common.data.id.TenantId; |
31 | import org.thingsboard.server.common.data.relation.EntityRelation; | 34 | import org.thingsboard.server.common.data.relation.EntityRelation; |
32 | import org.thingsboard.server.common.data.security.DeviceCredentials; | 35 | import org.thingsboard.server.common.data.security.DeviceCredentials; |
33 | import org.thingsboard.server.common.data.security.DeviceCredentialsType; | 36 | import org.thingsboard.server.common.data.security.DeviceCredentialsType; |
37 | +import org.thingsboard.server.common.msg.TbMsg; | ||
38 | +import org.thingsboard.server.common.msg.TbMsgDataType; | ||
39 | +import org.thingsboard.server.common.msg.TbMsgMetaData; | ||
34 | import org.thingsboard.server.dao.device.DeviceCredentialsService; | 40 | import org.thingsboard.server.dao.device.DeviceCredentialsService; |
35 | import org.thingsboard.server.dao.device.DeviceService; | 41 | import org.thingsboard.server.dao.device.DeviceService; |
36 | import org.thingsboard.server.dao.relation.RelationService; | 42 | import org.thingsboard.server.dao.relation.RelationService; |
@@ -48,6 +54,7 @@ import org.thingsboard.server.gen.transport.TransportProtos.ValidateDeviceX509Ce | @@ -48,6 +54,7 @@ import org.thingsboard.server.gen.transport.TransportProtos.ValidateDeviceX509Ce | ||
48 | import org.thingsboard.server.queue.common.TbProtoQueueMsg; | 54 | import org.thingsboard.server.queue.common.TbProtoQueueMsg; |
49 | import org.thingsboard.server.queue.util.TbCoreComponent; | 55 | import org.thingsboard.server.queue.util.TbCoreComponent; |
50 | import org.thingsboard.server.service.executors.DbCallbackExecutorService; | 56 | import org.thingsboard.server.service.executors.DbCallbackExecutorService; |
57 | +import org.thingsboard.server.service.queue.TbClusterService; | ||
51 | import org.thingsboard.server.service.state.DeviceStateService; | 58 | import org.thingsboard.server.service.state.DeviceStateService; |
52 | 59 | ||
53 | import java.util.UUID; | 60 | import java.util.UUID; |
@@ -82,6 +89,9 @@ public class DefaultTransportApiService implements TransportApiService { | @@ -82,6 +89,9 @@ public class DefaultTransportApiService implements TransportApiService { | ||
82 | @Autowired | 89 | @Autowired |
83 | private DbCallbackExecutorService dbCallbackExecutorService; | 90 | private DbCallbackExecutorService dbCallbackExecutorService; |
84 | 91 | ||
92 | + @Autowired | ||
93 | + protected TbClusterService tbClusterService; | ||
94 | + | ||
85 | private ReentrantLock deviceCreationLock = new ReentrantLock(); | 95 | private ReentrantLock deviceCreationLock = new ReentrantLock(); |
86 | 96 | ||
87 | @Override | 97 | @Override |
@@ -119,14 +129,27 @@ public class DefaultTransportApiService implements TransportApiService { | @@ -119,14 +129,27 @@ public class DefaultTransportApiService implements TransportApiService { | ||
119 | try { | 129 | try { |
120 | Device device = deviceService.findDeviceByTenantIdAndName(gateway.getTenantId(), requestMsg.getDeviceName()); | 130 | Device device = deviceService.findDeviceByTenantIdAndName(gateway.getTenantId(), requestMsg.getDeviceName()); |
121 | if (device == null) { | 131 | if (device == null) { |
132 | + TenantId tenantId = gateway.getTenantId(); | ||
122 | device = new Device(); | 133 | device = new Device(); |
123 | - device.setTenantId(gateway.getTenantId()); | 134 | + device.setTenantId(tenantId); |
124 | device.setName(requestMsg.getDeviceName()); | 135 | device.setName(requestMsg.getDeviceName()); |
125 | device.setType(requestMsg.getDeviceType()); | 136 | device.setType(requestMsg.getDeviceType()); |
126 | device.setCustomerId(gateway.getCustomerId()); | 137 | device.setCustomerId(gateway.getCustomerId()); |
127 | device = deviceService.saveDevice(device); | 138 | device = deviceService.saveDevice(device); |
128 | relationService.saveRelationAsync(TenantId.SYS_TENANT_ID, new EntityRelation(gateway.getId(), device.getId(), "Created")); | 139 | relationService.saveRelationAsync(TenantId.SYS_TENANT_ID, new EntityRelation(gateway.getId(), device.getId(), "Created")); |
129 | deviceStateService.onDeviceAdded(device); | 140 | deviceStateService.onDeviceAdded(device); |
141 | + | ||
142 | + TbMsgMetaData metaData = new TbMsgMetaData(); | ||
143 | + CustomerId customerId = gateway.getCustomerId(); | ||
144 | + if (customerId != null && !customerId.isNullUid()) { | ||
145 | + metaData.putValue("customerId", customerId.toString()); | ||
146 | + } | ||
147 | + metaData.putValue("gatewayId", gatewayId.toString()); | ||
148 | + | ||
149 | + DeviceId deviceId = device.getId(); | ||
150 | + ObjectNode entityNode = mapper.valueToTree(device); | ||
151 | + TbMsg tbMsg = TbMsg.newMsg(DataConstants.ENTITY_CREATED, deviceId, metaData, TbMsgDataType.JSON, mapper.writeValueAsString(entityNode)); | ||
152 | + tbClusterService.pushMsgToRuleEngine(tenantId, deviceId, tbMsg, null); | ||
130 | } | 153 | } |
131 | return TransportApiResponseMsg.newBuilder() | 154 | return TransportApiResponseMsg.newBuilder() |
132 | .setGetOrCreateDeviceResponseMsg(GetOrCreateDeviceFromGatewayResponseMsg.newBuilder().setDeviceInfo(getDeviceInfoProto(device)).build()).build(); | 155 | .setGetOrCreateDeviceResponseMsg(GetOrCreateDeviceFromGatewayResponseMsg.newBuilder().setDeviceInfo(getDeviceInfoProto(device)).build()).build(); |
@@ -148,6 +148,10 @@ security: | @@ -148,6 +148,10 @@ security: | ||
148 | # If this field is not empty, user will be created as a user under defined Customer | 148 | # If this field is not empty, user will be created as a user under defined Customer |
149 | # %{attribute_key} as placeholder for attribute value of attributes of external user object | 149 | # %{attribute_key} as placeholder for attribute value of attributes of external user object |
150 | customerNamePattern: "${SECURITY_OAUTH2_DEFAULT_MAPPER_BASIC_CUSTOMER_NAME_PATTERN:}" | 150 | customerNamePattern: "${SECURITY_OAUTH2_DEFAULT_MAPPER_BASIC_CUSTOMER_NAME_PATTERN:}" |
151 | + # If this field is not empty, user will be created with default defined Dashboard | ||
152 | + defaultDashboardName: "${SECURITY_OAUTH2_DEFAULT_MAPPER_BASIC_DEFAULT_DASHBOARD_NAME:}" | ||
153 | + # If this field is set 'true' along with non-empty 'defaultDashboardName', user will start from the defined Dashboard in fullscreen mode | ||
154 | + alwaysFullScreen: "${SECURITY_OAUTH2_DEFAULT_MAPPER_BASIC_ALWAYS_FULL_SCREEN:false}" | ||
151 | custom: | 155 | custom: |
152 | url: "${SECURITY_OAUTH2_DEFAULT_MAPPER_CUSTOM_URL:}" | 156 | url: "${SECURITY_OAUTH2_DEFAULT_MAPPER_CUSTOM_URL:}" |
153 | username: "${SECURITY_OAUTH2_DEFAULT_MAPPER_CUSTOM_USERNAME:}" | 157 | username: "${SECURITY_OAUTH2_DEFAULT_MAPPER_CUSTOM_USERNAME:}" |
@@ -687,7 +691,7 @@ queue: | @@ -687,7 +691,7 @@ queue: | ||
687 | topic: "${TB_QUEUE_RE_MAIN_TOPIC:tb_rule_engine.main}" | 691 | topic: "${TB_QUEUE_RE_MAIN_TOPIC:tb_rule_engine.main}" |
688 | poll-interval: "${TB_QUEUE_RE_MAIN_POLL_INTERVAL_MS:25}" | 692 | poll-interval: "${TB_QUEUE_RE_MAIN_POLL_INTERVAL_MS:25}" |
689 | partitions: "${TB_QUEUE_RE_MAIN_PARTITIONS:10}" | 693 | partitions: "${TB_QUEUE_RE_MAIN_PARTITIONS:10}" |
690 | - pack-processing-timeout: "${TB_QUEUE_RE_MAIN_PACK_PROCESSING_TIMEOUT_MS:60000}" | 694 | + pack-processing-timeout: "${TB_QUEUE_RE_MAIN_PACK_PROCESSING_TIMEOUT_MS:5000}" |
691 | submit-strategy: | 695 | submit-strategy: |
692 | type: "${TB_QUEUE_RE_MAIN_SUBMIT_STRATEGY_TYPE:BURST}" # BURST, BATCH, SEQUENTIAL_BY_ORIGINATOR, SEQUENTIAL_BY_TENANT, SEQUENTIAL | 696 | type: "${TB_QUEUE_RE_MAIN_SUBMIT_STRATEGY_TYPE:BURST}" # BURST, BATCH, SEQUENTIAL_BY_ORIGINATOR, SEQUENTIAL_BY_TENANT, SEQUENTIAL |
693 | # For BATCH only | 697 | # For BATCH only |
@@ -28,4 +28,6 @@ public class OAuth2User { | @@ -28,4 +28,6 @@ public class OAuth2User { | ||
28 | private String email; | 28 | private String email; |
29 | private String firstName; | 29 | private String firstName; |
30 | private String lastName; | 30 | private String lastName; |
31 | + private boolean alwaysFullScreen; | ||
32 | + private String defaultDashboardName; | ||
31 | } | 33 | } |
@@ -40,6 +40,7 @@ import java.util.UUID; | @@ -40,6 +40,7 @@ import java.util.UUID; | ||
40 | public final class TbMsg implements Serializable { | 40 | public final class TbMsg implements Serializable { |
41 | 41 | ||
42 | private final UUID id; | 42 | private final UUID id; |
43 | + private final long ts; | ||
43 | private final String type; | 44 | private final String type; |
44 | private final EntityId originator; | 45 | private final EntityId originator; |
45 | private final TbMsgMetaData metaData; | 46 | private final TbMsgMetaData metaData; |
@@ -51,38 +52,43 @@ public final class TbMsg implements Serializable { | @@ -51,38 +52,43 @@ public final class TbMsg implements Serializable { | ||
51 | transient private final TbMsgCallback callback; | 52 | transient private final TbMsgCallback callback; |
52 | 53 | ||
53 | public static TbMsg newMsg(String type, EntityId originator, TbMsgMetaData metaData, String data) { | 54 | public static TbMsg newMsg(String type, EntityId originator, TbMsgMetaData metaData, String data) { |
54 | - return new TbMsg(UUID.randomUUID(), type, originator, metaData.copy(), TbMsgDataType.JSON, data, null, null, TbMsgCallback.EMPTY); | 55 | + return new TbMsg(UUID.randomUUID(), System.currentTimeMillis(), type, originator, metaData.copy(), TbMsgDataType.JSON, data, null, null, TbMsgCallback.EMPTY); |
55 | } | 56 | } |
56 | 57 | ||
57 | public static TbMsg newMsg(String type, EntityId originator, TbMsgMetaData metaData, String data, RuleChainId ruleChainId, RuleNodeId ruleNodeId) { | 58 | public static TbMsg newMsg(String type, EntityId originator, TbMsgMetaData metaData, String data, RuleChainId ruleChainId, RuleNodeId ruleNodeId) { |
58 | - return new TbMsg(UUID.randomUUID(), type, originator, metaData.copy(), TbMsgDataType.JSON, data, ruleChainId, ruleNodeId, TbMsgCallback.EMPTY); | 59 | + return new TbMsg(UUID.randomUUID(), System.currentTimeMillis(), type, originator, metaData.copy(), TbMsgDataType.JSON, data, ruleChainId, ruleNodeId, TbMsgCallback.EMPTY); |
59 | } | 60 | } |
60 | 61 | ||
61 | public static TbMsg newMsg(String type, EntityId originator, TbMsgMetaData metaData, TbMsgDataType dataType, String data) { | 62 | public static TbMsg newMsg(String type, EntityId originator, TbMsgMetaData metaData, TbMsgDataType dataType, String data) { |
62 | - return new TbMsg(UUID.randomUUID(), type, originator, metaData.copy(), dataType, data, null, null, TbMsgCallback.EMPTY); | 63 | + return new TbMsg(UUID.randomUUID(), System.currentTimeMillis(), type, originator, metaData.copy(), dataType, data, null, null, TbMsgCallback.EMPTY); |
63 | } | 64 | } |
64 | 65 | ||
65 | public static TbMsg newMsg(String type, EntityId originator, TbMsgMetaData metaData, TbMsgDataType dataType, String data, RuleChainId ruleChainId, RuleNodeId ruleNodeId) { | 66 | public static TbMsg newMsg(String type, EntityId originator, TbMsgMetaData metaData, TbMsgDataType dataType, String data, RuleChainId ruleChainId, RuleNodeId ruleNodeId) { |
66 | - return new TbMsg(UUID.randomUUID(), type, originator, metaData.copy(), dataType, data, ruleChainId, ruleNodeId, TbMsgCallback.EMPTY); | 67 | + return new TbMsg(UUID.randomUUID(), System.currentTimeMillis(), type, originator, metaData.copy(), dataType, data, ruleChainId, ruleNodeId, TbMsgCallback.EMPTY); |
67 | } | 68 | } |
68 | 69 | ||
69 | public static TbMsg newMsg(String type, EntityId originator, TbMsgMetaData metaData, String data, TbMsgCallback callback) { | 70 | public static TbMsg newMsg(String type, EntityId originator, TbMsgMetaData metaData, String data, TbMsgCallback callback) { |
70 | - return new TbMsg(UUID.randomUUID(), type, originator, metaData.copy(), TbMsgDataType.JSON, data, null, null, callback); | 71 | + return new TbMsg(UUID.randomUUID(), System.currentTimeMillis(), type, originator, metaData.copy(), TbMsgDataType.JSON, data, null, null, callback); |
71 | } | 72 | } |
72 | 73 | ||
73 | public static TbMsg transformMsg(TbMsg origMsg, String type, EntityId originator, TbMsgMetaData metaData, String data) { | 74 | public static TbMsg transformMsg(TbMsg origMsg, String type, EntityId originator, TbMsgMetaData metaData, String data) { |
74 | - return new TbMsg(origMsg.getId(), type, originator, metaData.copy(), origMsg.getDataType(), | 75 | + return new TbMsg(origMsg.getId(), origMsg.getTs(), type, originator, metaData.copy(), origMsg.getDataType(), |
75 | data, origMsg.getRuleChainId(), origMsg.getRuleNodeId(), origMsg.getCallback()); | 76 | data, origMsg.getRuleChainId(), origMsg.getRuleNodeId(), origMsg.getCallback()); |
76 | } | 77 | } |
77 | 78 | ||
78 | public static TbMsg newMsg(TbMsg tbMsg, RuleChainId ruleChainId, RuleNodeId ruleNodeId) { | 79 | public static TbMsg newMsg(TbMsg tbMsg, RuleChainId ruleChainId, RuleNodeId ruleNodeId) { |
79 | - return new TbMsg(UUID.randomUUID(), tbMsg.getType(), tbMsg.getOriginator(), tbMsg.getMetaData().copy(), | 80 | + return new TbMsg(UUID.randomUUID(), tbMsg.getTs(), tbMsg.getType(), tbMsg.getOriginator(), tbMsg.getMetaData().copy(), |
80 | tbMsg.getDataType(), tbMsg.getData(), ruleChainId, ruleNodeId, TbMsgCallback.EMPTY); | 81 | tbMsg.getDataType(), tbMsg.getData(), ruleChainId, ruleNodeId, TbMsgCallback.EMPTY); |
81 | } | 82 | } |
82 | 83 | ||
83 | - private TbMsg(UUID id, String type, EntityId originator, TbMsgMetaData metaData, TbMsgDataType dataType, String data, | 84 | + private TbMsg(UUID id, long ts, String type, EntityId originator, TbMsgMetaData metaData, TbMsgDataType dataType, String data, |
84 | RuleChainId ruleChainId, RuleNodeId ruleNodeId, TbMsgCallback callback) { | 85 | RuleChainId ruleChainId, RuleNodeId ruleNodeId, TbMsgCallback callback) { |
85 | this.id = id; | 86 | this.id = id; |
87 | + if (ts > 0) { | ||
88 | + this.ts = ts; | ||
89 | + } else { | ||
90 | + this.ts = System.currentTimeMillis(); | ||
91 | + } | ||
86 | this.type = type; | 92 | this.type = type; |
87 | this.originator = originator; | 93 | this.originator = originator; |
88 | this.metaData = metaData; | 94 | this.metaData = metaData; |
@@ -105,6 +111,7 @@ public final class TbMsg implements Serializable { | @@ -105,6 +111,7 @@ public final class TbMsg implements Serializable { | ||
105 | public static byte[] toByteArray(TbMsg msg) { | 111 | public static byte[] toByteArray(TbMsg msg) { |
106 | MsgProtos.TbMsgProto.Builder builder = MsgProtos.TbMsgProto.newBuilder(); | 112 | MsgProtos.TbMsgProto.Builder builder = MsgProtos.TbMsgProto.newBuilder(); |
107 | builder.setId(msg.getId().toString()); | 113 | builder.setId(msg.getId().toString()); |
114 | + builder.setTs(msg.getTs()); | ||
108 | builder.setType(msg.getType()); | 115 | builder.setType(msg.getType()); |
109 | builder.setEntityType(msg.getOriginator().getEntityType().name()); | 116 | builder.setEntityType(msg.getOriginator().getEntityType().name()); |
110 | builder.setEntityIdMSB(msg.getOriginator().getId().getMostSignificantBits()); | 117 | builder.setEntityIdMSB(msg.getOriginator().getId().getMostSignificantBits()); |
@@ -124,7 +131,6 @@ public final class TbMsg implements Serializable { | @@ -124,7 +131,6 @@ public final class TbMsg implements Serializable { | ||
124 | builder.setMetaData(MsgProtos.TbMsgMetaDataProto.newBuilder().putAllData(msg.getMetaData().getData()).build()); | 131 | builder.setMetaData(MsgProtos.TbMsgMetaDataProto.newBuilder().putAllData(msg.getMetaData().getData()).build()); |
125 | } | 132 | } |
126 | 133 | ||
127 | - | ||
128 | builder.setDataType(msg.getDataType().ordinal()); | 134 | builder.setDataType(msg.getDataType().ordinal()); |
129 | builder.setData(msg.getData()); | 135 | builder.setData(msg.getData()); |
130 | return builder.build().toByteArray(); | 136 | return builder.build().toByteArray(); |
@@ -144,18 +150,18 @@ public final class TbMsg implements Serializable { | @@ -144,18 +150,18 @@ public final class TbMsg implements Serializable { | ||
144 | ruleNodeId = new RuleNodeId(new UUID(proto.getRuleNodeIdMSB(), proto.getRuleNodeIdLSB())); | 150 | ruleNodeId = new RuleNodeId(new UUID(proto.getRuleNodeIdMSB(), proto.getRuleNodeIdLSB())); |
145 | } | 151 | } |
146 | TbMsgDataType dataType = TbMsgDataType.values()[proto.getDataType()]; | 152 | TbMsgDataType dataType = TbMsgDataType.values()[proto.getDataType()]; |
147 | - return new TbMsg(UUID.fromString(proto.getId()), proto.getType(), entityId, metaData, dataType, proto.getData(), ruleChainId, ruleNodeId, callback); | 153 | + return new TbMsg(UUID.fromString(proto.getId()), proto.getTs(), proto.getType(), entityId, metaData, dataType, proto.getData(), ruleChainId, ruleNodeId, callback); |
148 | } catch (InvalidProtocolBufferException e) { | 154 | } catch (InvalidProtocolBufferException e) { |
149 | throw new IllegalStateException("Could not parse protobuf for TbMsg", e); | 155 | throw new IllegalStateException("Could not parse protobuf for TbMsg", e); |
150 | } | 156 | } |
151 | } | 157 | } |
152 | 158 | ||
153 | public TbMsg copyWithRuleChainId(RuleChainId ruleChainId) { | 159 | public TbMsg copyWithRuleChainId(RuleChainId ruleChainId) { |
154 | - return new TbMsg(this.id, this.type, this.originator, this.metaData, this.dataType, this.data, ruleChainId, null, callback); | 160 | + return new TbMsg(this.id, this.ts, this.type, this.originator, this.metaData, this.dataType, this.data, ruleChainId, null, callback); |
155 | } | 161 | } |
156 | 162 | ||
157 | public TbMsg copyWithRuleNodeId(RuleChainId ruleChainId, RuleNodeId ruleNodeId) { | 163 | public TbMsg copyWithRuleNodeId(RuleChainId ruleChainId, RuleNodeId ruleNodeId) { |
158 | - return new TbMsg(this.id, this.type, this.originator, this.metaData, this.dataType, this.data, ruleChainId, ruleNodeId, callback); | 164 | + return new TbMsg(this.id, this.ts, this.type, this.originator, this.metaData, this.dataType, this.data, ruleChainId, ruleNodeId, callback); |
159 | } | 165 | } |
160 | 166 | ||
161 | public TbMsgCallback getCallback() { | 167 | public TbMsgCallback getCallback() { |
@@ -200,7 +200,7 @@ public class KafkaMonolithQueueFactory implements TbCoreQueueFactory, TbRuleEngi | @@ -200,7 +200,7 @@ public class KafkaMonolithQueueFactory implements TbCoreQueueFactory, TbRuleEngi | ||
200 | consumerBuilder.settings(kafkaSettings); | 200 | consumerBuilder.settings(kafkaSettings); |
201 | consumerBuilder.topic(transportApiSettings.getRequestsTopic()); | 201 | consumerBuilder.topic(transportApiSettings.getRequestsTopic()); |
202 | consumerBuilder.clientId("monolith-transport-api-consumer-" + serviceInfoProvider.getServiceId()); | 202 | consumerBuilder.clientId("monolith-transport-api-consumer-" + serviceInfoProvider.getServiceId()); |
203 | - consumerBuilder.groupId("monolith-transport-api-consumer-" + serviceInfoProvider.getServiceId()); | 203 | + consumerBuilder.groupId("monolith-transport-api-consumer"); |
204 | consumerBuilder.decoder(msg -> new TbProtoQueueMsg<>(msg.getKey(), TransportApiRequestMsg.parseFrom(msg.getData()), msg.getHeaders())); | 204 | consumerBuilder.decoder(msg -> new TbProtoQueueMsg<>(msg.getKey(), TransportApiRequestMsg.parseFrom(msg.getData()), msg.getHeaders())); |
205 | consumerBuilder.admin(transportApiAdmin); | 205 | consumerBuilder.admin(transportApiAdmin); |
206 | return consumerBuilder.build(); | 206 | return consumerBuilder.build(); |
@@ -170,7 +170,7 @@ public class KafkaTbCoreQueueFactory implements TbCoreQueueFactory { | @@ -170,7 +170,7 @@ public class KafkaTbCoreQueueFactory implements TbCoreQueueFactory { | ||
170 | consumerBuilder.settings(kafkaSettings); | 170 | consumerBuilder.settings(kafkaSettings); |
171 | consumerBuilder.topic(transportApiSettings.getRequestsTopic()); | 171 | consumerBuilder.topic(transportApiSettings.getRequestsTopic()); |
172 | consumerBuilder.clientId("tb-core-transport-api-consumer-" + serviceInfoProvider.getServiceId()); | 172 | consumerBuilder.clientId("tb-core-transport-api-consumer-" + serviceInfoProvider.getServiceId()); |
173 | - consumerBuilder.groupId("tb-core-transport-api-consumer-" + serviceInfoProvider.getServiceId()); | 173 | + consumerBuilder.groupId("tb-core-transport-api-consumer"); |
174 | consumerBuilder.decoder(msg -> new TbProtoQueueMsg<>(msg.getKey(), TransportApiRequestMsg.parseFrom(msg.getData()), msg.getHeaders())); | 174 | consumerBuilder.decoder(msg -> new TbProtoQueueMsg<>(msg.getKey(), TransportApiRequestMsg.parseFrom(msg.getData()), msg.getHeaders())); |
175 | consumerBuilder.admin(transportApiAdmin); | 175 | consumerBuilder.admin(transportApiAdmin); |
176 | return consumerBuilder.build(); | 176 | return consumerBuilder.build(); |
@@ -53,10 +53,6 @@ | @@ -53,10 +53,6 @@ | ||
53 | <artifactId>util</artifactId> | 53 | <artifactId>util</artifactId> |
54 | </dependency> | 54 | </dependency> |
55 | <dependency> | 55 | <dependency> |
56 | - <groupId>org.thingsboard.common</groupId> | ||
57 | - <artifactId>queue</artifactId> | ||
58 | - </dependency> | ||
59 | - <dependency> | ||
60 | <groupId>com.google.code.gson</groupId> | 56 | <groupId>com.google.code.gson</groupId> |
61 | <artifactId>gson</artifactId> | 57 | <artifactId>gson</artifactId> |
62 | </dependency> | 58 | </dependency> |
@@ -112,7 +112,7 @@ public class EventEntity extends BaseSqlEntity<Event> implements BaseEntity<Eve | @@ -112,7 +112,7 @@ public class EventEntity extends BaseSqlEntity<Event> implements BaseEntity<Eve | ||
112 | return event; | 112 | return event; |
113 | } | 113 | } |
114 | 114 | ||
115 | - private long getTs(UUID uuid) { | 115 | + private static long getTs(UUID uuid) { |
116 | return (uuid.timestamp() - EPOCH_DIFF) / 10000; | 116 | return (uuid.timestamp() - EPOCH_DIFF) / 10000; |
117 | } | 117 | } |
118 | } | 118 | } |
@@ -34,6 +34,8 @@ public class OAuth2ClientMapperConfig { | @@ -34,6 +34,8 @@ public class OAuth2ClientMapperConfig { | ||
34 | private String tenantNameStrategy; | 34 | private String tenantNameStrategy; |
35 | private String tenantNamePattern; | 35 | private String tenantNamePattern; |
36 | private String customerNamePattern; | 36 | private String customerNamePattern; |
37 | + private boolean alwaysFullScreen; | ||
38 | + private String defaultDashboardName; | ||
37 | } | 39 | } |
38 | 40 | ||
39 | @Data | 41 | @Data |
msa/js-executor/build.gradle
deleted
100644 → 0
1 | -/** | ||
2 | - * Copyright © 2016-2020 The Thingsboard Authors | ||
3 | - * | ||
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | - * you may not use this file except in compliance with the License. | ||
6 | - * You may obtain a copy of the License at | ||
7 | - * | ||
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | - * | ||
10 | - * Unless required by applicable law or agreed to in writing, software | ||
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | - * See the License for the specific language governing permissions and | ||
14 | - * limitations under the License. | ||
15 | - */ | ||
16 | -import org.apache.tools.ant.filters.ReplaceTokens | ||
17 | - | ||
18 | -buildscript { | ||
19 | - ext { | ||
20 | - osPackageVersion = "3.8.0" | ||
21 | - } | ||
22 | - repositories { | ||
23 | - jcenter() | ||
24 | - } | ||
25 | - dependencies { | ||
26 | - classpath("com.netflix.nebula:gradle-ospackage-plugin:${osPackageVersion}") | ||
27 | - } | ||
28 | -} | ||
29 | - | ||
30 | -apply plugin: "nebula.ospackage" | ||
31 | - | ||
32 | -buildDir = projectBuildDir | ||
33 | -version = projectVersion | ||
34 | -distsDirName = "./" | ||
35 | - | ||
36 | -// OS Package plugin configuration | ||
37 | -ospackage { | ||
38 | - packageName = pkgName | ||
39 | - version = "${project.version}" | ||
40 | - release = 1 | ||
41 | - os = LINUX | ||
42 | - type = BINARY | ||
43 | - | ||
44 | - into pkgInstallFolder | ||
45 | - | ||
46 | - user pkgUser | ||
47 | - permissionGroup pkgUser | ||
48 | - | ||
49 | - // Copy the executable file | ||
50 | - from("target/package/linux/bin/${pkgName}") { | ||
51 | - fileMode 0500 | ||
52 | - into "bin" | ||
53 | - } | ||
54 | - | ||
55 | - // Copy the init file | ||
56 | - from("target/package/linux/init/${pkgName}") { | ||
57 | - fileMode 0500 | ||
58 | - into "init" | ||
59 | - } | ||
60 | - | ||
61 | - // Copy the config files | ||
62 | - from("target/package/linux/conf") { | ||
63 | - fileType CONFIG | NOREPLACE | ||
64 | - fileMode 0754 | ||
65 | - into "conf" | ||
66 | - } | ||
67 | - | ||
68 | -} | ||
69 | - | ||
70 | -// Configure our RPM build task | ||
71 | -buildRpm { | ||
72 | - | ||
73 | - arch = X86_64 | ||
74 | - | ||
75 | - version = projectVersion.replace('-', '') | ||
76 | - archiveName = "${pkgName}.rpm" | ||
77 | - | ||
78 | - preInstall file("${buildDir}/control/rpm/preinst") | ||
79 | - postInstall file("${buildDir}/control/rpm/postinst") | ||
80 | - preUninstall file("${buildDir}/control/rpm/prerm") | ||
81 | - postUninstall file("${buildDir}/control/rpm/postrm") | ||
82 | - | ||
83 | - user pkgUser | ||
84 | - permissionGroup pkgUser | ||
85 | - | ||
86 | - // Copy the system unit files | ||
87 | - from("${buildDir}/control/${pkgName}.service") { | ||
88 | - addParentDirs = false | ||
89 | - fileMode 0644 | ||
90 | - into "/usr/lib/systemd/system" | ||
91 | - } | ||
92 | - | ||
93 | - directory(pkgLogFolder, 0755) | ||
94 | - link("/etc/${pkgName}/conf", "${pkgInstallFolder}/conf") | ||
95 | -} | ||
96 | - | ||
97 | -// Same as the buildRpm task | ||
98 | -buildDeb { | ||
99 | - | ||
100 | - arch = "amd64" | ||
101 | - | ||
102 | - archiveName = "${pkgName}.deb" | ||
103 | - | ||
104 | - configurationFile("${pkgInstallFolder}/conf/${pkgName}.conf") | ||
105 | - configurationFile("${pkgInstallFolder}/conf/custom-environment-variables.yml") | ||
106 | - configurationFile("${pkgInstallFolder}/conf/default.yml") | ||
107 | - configurationFile("${pkgInstallFolder}/conf/logger.js") | ||
108 | - | ||
109 | - preInstall file("${buildDir}/control/deb/preinst") | ||
110 | - postInstall file("${buildDir}/control/deb/postinst") | ||
111 | - preUninstall file("${buildDir}/control/deb/prerm") | ||
112 | - postUninstall file("${buildDir}/control/deb/postrm") | ||
113 | - | ||
114 | - user pkgUser | ||
115 | - permissionGroup pkgUser | ||
116 | - | ||
117 | - directory(pkgLogFolder, 0755) | ||
118 | - link("/etc/init.d/${pkgName}", "${pkgInstallFolder}/init/${pkgName}") | ||
119 | - link("/etc/${pkgName}/conf", "${pkgInstallFolder}/conf") | ||
120 | -} |
@@ -23,7 +23,7 @@ RUN chmod a+x /tmp/*.sh \ | @@ -23,7 +23,7 @@ RUN chmod a+x /tmp/*.sh \ | ||
23 | 23 | ||
24 | RUN yes | dpkg -i /tmp/${pkg.name}.deb | 24 | RUN yes | dpkg -i /tmp/${pkg.name}.deb |
25 | 25 | ||
26 | -RUN update-rc.d ${pkg.name} disable | 26 | +RUN systemctl --no-reload disable --now ${pkg.name}.service > /dev/null 2>&1 || : |
27 | 27 | ||
28 | RUN chmod 555 ${pkg.installFolder}/bin/${pkg.name} | 28 | RUN chmod 555 ${pkg.installFolder}/bin/${pkg.name} |
29 | 29 |
@@ -1428,7 +1428,7 @@ | @@ -1428,7 +1428,7 @@ | ||
1428 | }, | 1428 | }, |
1429 | "enabled": { | 1429 | "enabled": { |
1430 | "version": "1.0.2", | 1430 | "version": "1.0.2", |
1431 | - "resolved": "https://registry.npmjs.org/enabled/-/enabled-1.0.2.tgz", | 1431 | + "resolved": "http://registry.npmjs.org/enabled/-/enabled-1.0.2.tgz", |
1432 | "integrity": "sha1-ll9lE9LC0cX0ZStkouM5ZGf8L5M=", | 1432 | "integrity": "sha1-ll9lE9LC0cX0ZStkouM5ZGf8L5M=", |
1433 | "requires": { | 1433 | "requires": { |
1434 | "env-variable": "0.0.x" | 1434 | "env-variable": "0.0.x" |
@@ -1779,7 +1779,7 @@ | @@ -1779,7 +1779,7 @@ | ||
1779 | }, | 1779 | }, |
1780 | "fecha": { | 1780 | "fecha": { |
1781 | "version": "2.3.3", | 1781 | "version": "2.3.3", |
1782 | - "resolved": "https://registry.npmjs.org/fecha/-/fecha-2.3.3.tgz", | 1782 | + "resolved": "http://registry.npmjs.org/fecha/-/fecha-2.3.3.tgz", |
1783 | "integrity": "sha512-lUGBnIamTAwk4znq5BcqsDaxSmZ9nDVJaij6NvRt/Tg4R69gERA+otPKbS86ROw9nxVMw2/mp1fnaiWqbs6Sdg==" | 1783 | "integrity": "sha512-lUGBnIamTAwk4znq5BcqsDaxSmZ9nDVJaij6NvRt/Tg4R69gERA+otPKbS86ROw9nxVMw2/mp1fnaiWqbs6Sdg==" |
1784 | }, | 1784 | }, |
1785 | "file-stream-rotator": { | 1785 | "file-stream-rotator": { |
@@ -1945,12 +1945,14 @@ | @@ -1945,12 +1945,14 @@ | ||
1945 | "balanced-match": { | 1945 | "balanced-match": { |
1946 | "version": "1.0.0", | 1946 | "version": "1.0.0", |
1947 | "bundled": true, | 1947 | "bundled": true, |
1948 | - "dev": true | 1948 | + "dev": true, |
1949 | + "optional": true | ||
1949 | }, | 1950 | }, |
1950 | "brace-expansion": { | 1951 | "brace-expansion": { |
1951 | "version": "1.1.11", | 1952 | "version": "1.1.11", |
1952 | "bundled": true, | 1953 | "bundled": true, |
1953 | "dev": true, | 1954 | "dev": true, |
1955 | + "optional": true, | ||
1954 | "requires": { | 1956 | "requires": { |
1955 | "balanced-match": "^1.0.0", | 1957 | "balanced-match": "^1.0.0", |
1956 | "concat-map": "0.0.1" | 1958 | "concat-map": "0.0.1" |
@@ -1965,17 +1967,20 @@ | @@ -1965,17 +1967,20 @@ | ||
1965 | "code-point-at": { | 1967 | "code-point-at": { |
1966 | "version": "1.1.0", | 1968 | "version": "1.1.0", |
1967 | "bundled": true, | 1969 | "bundled": true, |
1968 | - "dev": true | 1970 | + "dev": true, |
1971 | + "optional": true | ||
1969 | }, | 1972 | }, |
1970 | "concat-map": { | 1973 | "concat-map": { |
1971 | "version": "0.0.1", | 1974 | "version": "0.0.1", |
1972 | "bundled": true, | 1975 | "bundled": true, |
1973 | - "dev": true | 1976 | + "dev": true, |
1977 | + "optional": true | ||
1974 | }, | 1978 | }, |
1975 | "console-control-strings": { | 1979 | "console-control-strings": { |
1976 | "version": "1.1.0", | 1980 | "version": "1.1.0", |
1977 | "bundled": true, | 1981 | "bundled": true, |
1978 | - "dev": true | 1982 | + "dev": true, |
1983 | + "optional": true | ||
1979 | }, | 1984 | }, |
1980 | "core-util-is": { | 1985 | "core-util-is": { |
1981 | "version": "1.0.2", | 1986 | "version": "1.0.2", |
@@ -2092,7 +2097,8 @@ | @@ -2092,7 +2097,8 @@ | ||
2092 | "inherits": { | 2097 | "inherits": { |
2093 | "version": "2.0.4", | 2098 | "version": "2.0.4", |
2094 | "bundled": true, | 2099 | "bundled": true, |
2095 | - "dev": true | 2100 | + "dev": true, |
2101 | + "optional": true | ||
2096 | }, | 2102 | }, |
2097 | "ini": { | 2103 | "ini": { |
2098 | "version": "1.3.5", | 2104 | "version": "1.3.5", |
@@ -2104,6 +2110,7 @@ | @@ -2104,6 +2110,7 @@ | ||
2104 | "version": "1.0.0", | 2110 | "version": "1.0.0", |
2105 | "bundled": true, | 2111 | "bundled": true, |
2106 | "dev": true, | 2112 | "dev": true, |
2113 | + "optional": true, | ||
2107 | "requires": { | 2114 | "requires": { |
2108 | "number-is-nan": "^1.0.0" | 2115 | "number-is-nan": "^1.0.0" |
2109 | } | 2116 | } |
@@ -2118,6 +2125,7 @@ | @@ -2118,6 +2125,7 @@ | ||
2118 | "version": "3.0.4", | 2125 | "version": "3.0.4", |
2119 | "bundled": true, | 2126 | "bundled": true, |
2120 | "dev": true, | 2127 | "dev": true, |
2128 | + "optional": true, | ||
2121 | "requires": { | 2129 | "requires": { |
2122 | "brace-expansion": "^1.1.7" | 2130 | "brace-expansion": "^1.1.7" |
2123 | } | 2131 | } |
@@ -2125,12 +2133,14 @@ | @@ -2125,12 +2133,14 @@ | ||
2125 | "minimist": { | 2133 | "minimist": { |
2126 | "version": "0.0.8", | 2134 | "version": "0.0.8", |
2127 | "bundled": true, | 2135 | "bundled": true, |
2128 | - "dev": true | 2136 | + "dev": true, |
2137 | + "optional": true | ||
2129 | }, | 2138 | }, |
2130 | "minipass": { | 2139 | "minipass": { |
2131 | "version": "2.9.0", | 2140 | "version": "2.9.0", |
2132 | "bundled": true, | 2141 | "bundled": true, |
2133 | "dev": true, | 2142 | "dev": true, |
2143 | + "optional": true, | ||
2134 | "requires": { | 2144 | "requires": { |
2135 | "safe-buffer": "^5.1.2", | 2145 | "safe-buffer": "^5.1.2", |
2136 | "yallist": "^3.0.0" | 2146 | "yallist": "^3.0.0" |
@@ -2149,6 +2159,7 @@ | @@ -2149,6 +2159,7 @@ | ||
2149 | "version": "0.5.1", | 2159 | "version": "0.5.1", |
2150 | "bundled": true, | 2160 | "bundled": true, |
2151 | "dev": true, | 2161 | "dev": true, |
2162 | + "optional": true, | ||
2152 | "requires": { | 2163 | "requires": { |
2153 | "minimist": "0.0.8" | 2164 | "minimist": "0.0.8" |
2154 | } | 2165 | } |
@@ -2238,7 +2249,8 @@ | @@ -2238,7 +2249,8 @@ | ||
2238 | "number-is-nan": { | 2249 | "number-is-nan": { |
2239 | "version": "1.0.1", | 2250 | "version": "1.0.1", |
2240 | "bundled": true, | 2251 | "bundled": true, |
2241 | - "dev": true | 2252 | + "dev": true, |
2253 | + "optional": true | ||
2242 | }, | 2254 | }, |
2243 | "object-assign": { | 2255 | "object-assign": { |
2244 | "version": "4.1.1", | 2256 | "version": "4.1.1", |
@@ -2250,6 +2262,7 @@ | @@ -2250,6 +2262,7 @@ | ||
2250 | "version": "1.4.0", | 2262 | "version": "1.4.0", |
2251 | "bundled": true, | 2263 | "bundled": true, |
2252 | "dev": true, | 2264 | "dev": true, |
2265 | + "optional": true, | ||
2253 | "requires": { | 2266 | "requires": { |
2254 | "wrappy": "1" | 2267 | "wrappy": "1" |
2255 | } | 2268 | } |
@@ -2371,6 +2384,7 @@ | @@ -2371,6 +2384,7 @@ | ||
2371 | "version": "1.0.2", | 2384 | "version": "1.0.2", |
2372 | "bundled": true, | 2385 | "bundled": true, |
2373 | "dev": true, | 2386 | "dev": true, |
2387 | + "optional": true, | ||
2374 | "requires": { | 2388 | "requires": { |
2375 | "code-point-at": "^1.0.0", | 2389 | "code-point-at": "^1.0.0", |
2376 | "is-fullwidth-code-point": "^1.0.0", | 2390 | "is-fullwidth-code-point": "^1.0.0", |
@@ -2472,7 +2486,7 @@ | @@ -2472,7 +2486,7 @@ | ||
2472 | }, | 2486 | }, |
2473 | "get-stream": { | 2487 | "get-stream": { |
2474 | "version": "3.0.0", | 2488 | "version": "3.0.0", |
2475 | - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", | 2489 | + "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", |
2476 | "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", | 2490 | "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", |
2477 | "dev": true | 2491 | "dev": true |
2478 | }, | 2492 | }, |
@@ -2597,7 +2611,7 @@ | @@ -2597,7 +2611,7 @@ | ||
2597 | }, | 2611 | }, |
2598 | "got": { | 2612 | "got": { |
2599 | "version": "6.7.1", | 2613 | "version": "6.7.1", |
2600 | - "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", | 2614 | + "resolved": "http://registry.npmjs.org/got/-/got-6.7.1.tgz", |
2601 | "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", | 2615 | "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", |
2602 | "dev": true, | 2616 | "dev": true, |
2603 | "requires": { | 2617 | "requires": { |
@@ -2920,7 +2934,7 @@ | @@ -2920,7 +2934,7 @@ | ||
2920 | }, | 2934 | }, |
2921 | "is-obj": { | 2935 | "is-obj": { |
2922 | "version": "1.0.1", | 2936 | "version": "1.0.1", |
2923 | - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", | 2937 | + "resolved": "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", |
2924 | "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", | 2938 | "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", |
2925 | "dev": true | 2939 | "dev": true |
2926 | }, | 2940 | }, |
@@ -3276,7 +3290,7 @@ | @@ -3276,7 +3290,7 @@ | ||
3276 | }, | 3290 | }, |
3277 | "minimist": { | 3291 | "minimist": { |
3278 | "version": "1.2.0", | 3292 | "version": "1.2.0", |
3279 | - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", | 3293 | + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", |
3280 | "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", | 3294 | "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", |
3281 | "dev": true | 3295 | "dev": true |
3282 | }, | 3296 | }, |
@@ -3604,7 +3618,7 @@ | @@ -3604,7 +3618,7 @@ | ||
3604 | }, | 3618 | }, |
3605 | "path-is-absolute": { | 3619 | "path-is-absolute": { |
3606 | "version": "1.0.1", | 3620 | "version": "1.0.1", |
3607 | - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", | 3621 | + "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", |
3608 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", | 3622 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", |
3609 | "dev": true | 3623 | "dev": true |
3610 | }, | 3624 | }, |
@@ -4161,7 +4175,7 @@ | @@ -4161,7 +4175,7 @@ | ||
4161 | }, | 4175 | }, |
4162 | "safe-regex": { | 4176 | "safe-regex": { |
4163 | "version": "1.1.0", | 4177 | "version": "1.1.0", |
4164 | - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", | 4178 | + "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", |
4165 | "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", | 4179 | "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", |
4166 | "dev": true, | 4180 | "dev": true, |
4167 | "requires": { | 4181 | "requires": { |
@@ -4574,7 +4588,7 @@ | @@ -4574,7 +4588,7 @@ | ||
4574 | }, | 4588 | }, |
4575 | "strip-eof": { | 4589 | "strip-eof": { |
4576 | "version": "1.0.0", | 4590 | "version": "1.0.0", |
4577 | - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", | 4591 | + "resolved": "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", |
4578 | "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", | 4592 | "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", |
4579 | "dev": true | 4593 | "dev": true |
4580 | }, | 4594 | }, |
@@ -34,10 +34,12 @@ | @@ -34,10 +34,12 @@ | ||
34 | <properties> | 34 | <properties> |
35 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | 35 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
36 | <main.dir>${basedir}/../..</main.dir> | 36 | <main.dir>${basedir}/../..</main.dir> |
37 | - <pkg.name>tb-js-executor</pkg.name> | ||
38 | <docker.name>tb-js-executor</docker.name> | 37 | <docker.name>tb-js-executor</docker.name> |
39 | - <pkg.unixLogFolder>/var/log/${pkg.name}</pkg.unixLogFolder> | ||
40 | - <pkg.installFolder>/usr/share/${pkg.name}</pkg.installFolder> | 38 | + <pkg.name>tb-js-executor</pkg.name> |
39 | + <pkg.type>js</pkg.type> | ||
40 | + <pkg.disabled>false</pkg.disabled> | ||
41 | + <pkg.process-resources.phase>process-resources</pkg.process-resources.phase> | ||
42 | + <pkg.package.phase>package</pkg.package.phase> | ||
41 | <pkg.linux.dist>${project.build.directory}/package/linux</pkg.linux.dist> | 43 | <pkg.linux.dist>${project.build.directory}/package/linux</pkg.linux.dist> |
42 | <pkg.win.dist>${project.build.directory}/package/windows</pkg.win.dist> | 44 | <pkg.win.dist>${project.build.directory}/package/windows</pkg.win.dist> |
43 | </properties> | 45 | </properties> |
@@ -87,194 +89,18 @@ | @@ -87,194 +89,18 @@ | ||
87 | <plugin> | 89 | <plugin> |
88 | <groupId>org.apache.maven.plugins</groupId> | 90 | <groupId>org.apache.maven.plugins</groupId> |
89 | <artifactId>maven-dependency-plugin</artifactId> | 91 | <artifactId>maven-dependency-plugin</artifactId> |
90 | - <executions> | ||
91 | - <execution> | ||
92 | - <id>copy-winsw-service</id> | ||
93 | - <phase>package</phase> | ||
94 | - <goals> | ||
95 | - <goal>copy</goal> | ||
96 | - </goals> | ||
97 | - <configuration> | ||
98 | - <artifactItems> | ||
99 | - <artifactItem> | ||
100 | - <groupId>com.sun.winsw</groupId> | ||
101 | - <artifactId>winsw</artifactId> | ||
102 | - <classifier>bin</classifier> | ||
103 | - <type>exe</type> | ||
104 | - <destFileName>service.exe</destFileName> | ||
105 | - </artifactItem> | ||
106 | - </artifactItems> | ||
107 | - <outputDirectory>${pkg.win.dist}</outputDirectory> | ||
108 | - </configuration> | ||
109 | - </execution> | ||
110 | - </executions> | ||
111 | </plugin> | 92 | </plugin> |
112 | <plugin> | 93 | <plugin> |
113 | <groupId>org.apache.maven.plugins</groupId> | 94 | <groupId>org.apache.maven.plugins</groupId> |
114 | <artifactId>maven-resources-plugin</artifactId> | 95 | <artifactId>maven-resources-plugin</artifactId> |
115 | - <executions> | ||
116 | - <execution> | ||
117 | - <id>copy-linux-conf</id> | ||
118 | - <phase>process-resources</phase> | ||
119 | - <goals> | ||
120 | - <goal>copy-resources</goal> | ||
121 | - </goals> | ||
122 | - <configuration> | ||
123 | - <outputDirectory>${pkg.linux.dist}/conf</outputDirectory> | ||
124 | - <resources> | ||
125 | - <resource> | ||
126 | - <directory>config</directory> | ||
127 | - <filtering>true</filtering> | ||
128 | - </resource> | ||
129 | - </resources> | ||
130 | - <filters> | ||
131 | - <filter>src/main/filters/unix.properties</filter> | ||
132 | - </filters> | ||
133 | - </configuration> | ||
134 | - </execution> | ||
135 | - <execution> | ||
136 | - <id>copy-linux-init</id> | ||
137 | - <phase>process-resources</phase> | ||
138 | - <goals> | ||
139 | - <goal>copy-resources</goal> | ||
140 | - </goals> | ||
141 | - <configuration> | ||
142 | - <outputDirectory>${pkg.linux.dist}/init</outputDirectory> | ||
143 | - <resources> | ||
144 | - <resource> | ||
145 | - <directory>src/main/scripts/init</directory> | ||
146 | - <filtering>true</filtering> | ||
147 | - </resource> | ||
148 | - </resources> | ||
149 | - <filters> | ||
150 | - <filter>src/main/filters/unix.properties</filter> | ||
151 | - </filters> | ||
152 | - </configuration> | ||
153 | - </execution> | ||
154 | - <execution> | ||
155 | - <id>copy-win-conf</id> | ||
156 | - <phase>process-resources</phase> | ||
157 | - <goals> | ||
158 | - <goal>copy-resources</goal> | ||
159 | - </goals> | ||
160 | - <configuration> | ||
161 | - <outputDirectory>${pkg.win.dist}/conf</outputDirectory> | ||
162 | - <resources> | ||
163 | - <resource> | ||
164 | - <directory>config</directory> | ||
165 | - <excludes> | ||
166 | - <exclude>tb-js-executor.conf</exclude> | ||
167 | - </excludes> | ||
168 | - <filtering>true</filtering> | ||
169 | - </resource> | ||
170 | - </resources> | ||
171 | - <filters> | ||
172 | - <filter>src/main/filters/windows.properties</filter> | ||
173 | - </filters> | ||
174 | - </configuration> | ||
175 | - </execution> | ||
176 | - <execution> | ||
177 | - <id>copy-control</id> | ||
178 | - <phase>process-resources</phase> | ||
179 | - <goals> | ||
180 | - <goal>copy-resources</goal> | ||
181 | - </goals> | ||
182 | - <configuration> | ||
183 | - <outputDirectory>${project.build.directory}/control</outputDirectory> | ||
184 | - <resources> | ||
185 | - <resource> | ||
186 | - <directory>src/main/scripts/control</directory> | ||
187 | - <filtering>true</filtering> | ||
188 | - </resource> | ||
189 | - </resources> | ||
190 | - <filters> | ||
191 | - <filter>src/main/filters/unix.properties</filter> | ||
192 | - </filters> | ||
193 | - </configuration> | ||
194 | - </execution> | ||
195 | - <execution> | ||
196 | - <id>copy-windows-control</id> | ||
197 | - <phase>process-resources</phase> | ||
198 | - <goals> | ||
199 | - <goal>copy-resources</goal> | ||
200 | - </goals> | ||
201 | - <configuration> | ||
202 | - <outputDirectory>${pkg.win.dist}</outputDirectory> | ||
203 | - <resources> | ||
204 | - <resource> | ||
205 | - <directory>src/main/scripts/windows</directory> | ||
206 | - <filtering>true</filtering> | ||
207 | - </resource> | ||
208 | - </resources> | ||
209 | - <filters> | ||
210 | - <filter>src/main/filters/windows.properties</filter> | ||
211 | - </filters> | ||
212 | - </configuration> | ||
213 | - </execution> | ||
214 | - <execution> | ||
215 | - <id>copy-docker-config</id> | ||
216 | - <phase>process-resources</phase> | ||
217 | - <goals> | ||
218 | - <goal>copy-resources</goal> | ||
219 | - </goals> | ||
220 | - <configuration> | ||
221 | - <outputDirectory>${project.build.directory}</outputDirectory> | ||
222 | - <resources> | ||
223 | - <resource> | ||
224 | - <directory>docker</directory> | ||
225 | - <filtering>true</filtering> | ||
226 | - </resource> | ||
227 | - </resources> | ||
228 | - </configuration> | ||
229 | - </execution> | ||
230 | - </executions> | ||
231 | </plugin> | 96 | </plugin> |
232 | <plugin> | 97 | <plugin> |
233 | <groupId>org.thingsboard</groupId> | 98 | <groupId>org.thingsboard</groupId> |
234 | <artifactId>gradle-maven-plugin</artifactId> | 99 | <artifactId>gradle-maven-plugin</artifactId> |
235 | - <configuration> | ||
236 | - <tasks> | ||
237 | - <task>build</task> | ||
238 | - <task>buildDeb</task> | ||
239 | - <task>buildRpm</task> | ||
240 | - </tasks> | ||
241 | - <args> | ||
242 | - <arg>-PprojectBuildDir=${project.build.directory}</arg> | ||
243 | - <arg>-PprojectVersion=${project.version}</arg> | ||
244 | - <arg>-PpkgName=${pkg.name}</arg> | ||
245 | - <arg>-PpkgUser=${pkg.user}</arg> | ||
246 | - <arg>-PpkgInstallFolder=${pkg.installFolder}</arg> | ||
247 | - <arg>-PpkgLogFolder=${pkg.unixLogFolder}</arg> | ||
248 | - </args> | ||
249 | - </configuration> | ||
250 | - <executions> | ||
251 | - <execution> | ||
252 | - <phase>package</phase> | ||
253 | - <goals> | ||
254 | - <goal>invoke</goal> | ||
255 | - </goals> | ||
256 | - </execution> | ||
257 | - </executions> | ||
258 | </plugin> | 100 | </plugin> |
259 | <plugin> | 101 | <plugin> |
260 | <groupId>org.apache.maven.plugins</groupId> | 102 | <groupId>org.apache.maven.plugins</groupId> |
261 | <artifactId>maven-assembly-plugin</artifactId> | 103 | <artifactId>maven-assembly-plugin</artifactId> |
262 | - <version>3.0.0</version> | ||
263 | - <configuration> | ||
264 | - <finalName>${pkg.name}</finalName> | ||
265 | - <descriptors> | ||
266 | - <descriptor>src/main/assembly/windows.xml</descriptor> | ||
267 | - </descriptors> | ||
268 | - </configuration> | ||
269 | - <executions> | ||
270 | - <execution> | ||
271 | - <id>assembly</id> | ||
272 | - <phase>package</phase> | ||
273 | - <goals> | ||
274 | - <goal>single</goal> | ||
275 | - </goals> | ||
276 | - </execution> | ||
277 | - </executions> | ||
278 | </plugin> | 104 | </plugin> |
279 | <plugin> | 105 | <plugin> |
280 | <groupId>com.spotify</groupId> | 106 | <groupId>com.spotify</groupId> |
msa/js-executor/src/main/assembly/windows.xml
deleted
100644 → 0
1 | -<!-- | ||
2 | - | ||
3 | - Copyright © 2016-2020 The Thingsboard Authors | ||
4 | - | ||
5 | - Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | - you may not use this file except in compliance with the License. | ||
7 | - You may obtain a copy of the License at | ||
8 | - | ||
9 | - http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | - | ||
11 | - Unless required by applicable law or agreed to in writing, software | ||
12 | - distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | - See the License for the specific language governing permissions and | ||
15 | - limitations under the License. | ||
16 | - | ||
17 | ---> | ||
18 | -<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" | ||
19 | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
20 | - xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"> | ||
21 | - <id>windows</id> | ||
22 | - | ||
23 | - <formats> | ||
24 | - <format>zip</format> | ||
25 | - </formats> | ||
26 | - | ||
27 | - <!-- Workaround to create logs directory --> | ||
28 | - <fileSets> | ||
29 | - <fileSet> | ||
30 | - <directory>${pkg.win.dist}</directory> | ||
31 | - <outputDirectory>logs</outputDirectory> | ||
32 | - <excludes> | ||
33 | - <exclude>*/**</exclude> | ||
34 | - </excludes> | ||
35 | - </fileSet> | ||
36 | - <fileSet> | ||
37 | - <directory>${pkg.win.dist}/conf</directory> | ||
38 | - <outputDirectory>conf</outputDirectory> | ||
39 | - <lineEnding>windows</lineEnding> | ||
40 | - </fileSet> | ||
41 | - </fileSets> | ||
42 | - | ||
43 | - <files> | ||
44 | - <file> | ||
45 | - <source>${pkg.win.dist}/bin/${pkg.name}.exe</source> | ||
46 | - <outputDirectory>bin</outputDirectory> | ||
47 | - <destName>${pkg.name}.exe</destName> | ||
48 | - </file> | ||
49 | - <file> | ||
50 | - <source>${pkg.win.dist}/service.exe</source> | ||
51 | - <outputDirectory/> | ||
52 | - <destName>${pkg.name}.exe</destName> | ||
53 | - </file> | ||
54 | - <file> | ||
55 | - <source>${pkg.win.dist}/service.xml</source> | ||
56 | - <outputDirectory/> | ||
57 | - <destName>${pkg.name}.xml</destName> | ||
58 | - <lineEnding>windows</lineEnding> | ||
59 | - </file> | ||
60 | - <file> | ||
61 | - <source>${pkg.win.dist}/install.bat</source> | ||
62 | - <outputDirectory/> | ||
63 | - <lineEnding>windows</lineEnding> | ||
64 | - </file> | ||
65 | - <file> | ||
66 | - <source>${pkg.win.dist}/uninstall.bat</source> | ||
67 | - <outputDirectory/> | ||
68 | - <lineEnding>windows</lineEnding> | ||
69 | - </file> | ||
70 | - </files> | ||
71 | -</assembly> |
msa/js-executor/src/main/scripts/control/deb/postrm
deleted
100644 → 0
msa/js-executor/src/main/scripts/windows/service.xml
deleted
100644 → 0
1 | -<!-- | ||
2 | - | ||
3 | - Copyright © 2016-2018 The Thingsboard Authors | ||
4 | - | ||
5 | - Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | - you may not use this file except in compliance with the License. | ||
7 | - You may obtain a copy of the License at | ||
8 | - | ||
9 | - http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | - | ||
11 | - Unless required by applicable law or agreed to in writing, software | ||
12 | - distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | - See the License for the specific language governing permissions and | ||
15 | - limitations under the License. | ||
16 | - | ||
17 | ---> | ||
18 | -<service> | ||
19 | - <id>${pkg.name}</id> | ||
20 | - <name>${project.name}</name> | ||
21 | - <description>${project.description}</description> | ||
22 | - <workingdirectory>%BASE%\bin</workingdirectory> | ||
23 | - <logpath>${pkg.winWrapperLogFolder}</logpath> | ||
24 | - <logmode>rotate</logmode> | ||
25 | - <env name="NODE_CONFIG_DIR" value="%BASE%\conf" /> | ||
26 | - <env name="LOG_FOLDER" value="${pkg.winWrapperLogFolder}" /> | ||
27 | - <env name="NODE_ENV" value="production" /> | ||
28 | - <executable>%BASE%\bin\${pkg.name}.exe</executable> | ||
29 | -</service> |
@@ -23,7 +23,7 @@ RUN chmod a+x /tmp/*.sh \ | @@ -23,7 +23,7 @@ RUN chmod a+x /tmp/*.sh \ | ||
23 | 23 | ||
24 | RUN yes | dpkg -i /tmp/${pkg.name}.deb | 24 | RUN yes | dpkg -i /tmp/${pkg.name}.deb |
25 | 25 | ||
26 | -RUN update-rc.d ${pkg.name} disable | 26 | +RUN systemctl --no-reload disable --now ${pkg.name}.service > /dev/null 2>&1 || : |
27 | 27 | ||
28 | RUN chmod 555 ${pkg.installFolder}/bin/${pkg.name}.jar | 28 | RUN chmod 555 ${pkg.installFolder}/bin/${pkg.name}.jar |
29 | 29 |
@@ -23,7 +23,7 @@ RUN chmod a+x /tmp/*.sh \ | @@ -23,7 +23,7 @@ RUN chmod a+x /tmp/*.sh \ | ||
23 | 23 | ||
24 | RUN yes | dpkg -i /tmp/${pkg.name}.deb | 24 | RUN yes | dpkg -i /tmp/${pkg.name}.deb |
25 | 25 | ||
26 | -RUN update-rc.d ${pkg.name} disable | 26 | +RUN systemctl --no-reload disable --now ${pkg.name}.service > /dev/null 2>&1 || : |
27 | 27 | ||
28 | RUN chmod 555 ${pkg.installFolder}/bin/${pkg.name}.jar | 28 | RUN chmod 555 ${pkg.installFolder}/bin/${pkg.name}.jar |
29 | 29 |
@@ -23,7 +23,7 @@ RUN chmod a+x /tmp/*.sh \ | @@ -23,7 +23,7 @@ RUN chmod a+x /tmp/*.sh \ | ||
23 | 23 | ||
24 | RUN yes | dpkg -i /tmp/${pkg.name}.deb | 24 | RUN yes | dpkg -i /tmp/${pkg.name}.deb |
25 | 25 | ||
26 | -RUN update-rc.d ${pkg.name} disable | 26 | +RUN systemctl --no-reload disable --now ${pkg.name}.service > /dev/null 2>&1 || : |
27 | 27 | ||
28 | RUN chmod 555 ${pkg.installFolder}/bin/${pkg.name}.jar | 28 | RUN chmod 555 ${pkg.installFolder}/bin/${pkg.name}.jar |
29 | 29 |
@@ -23,7 +23,7 @@ RUN chmod a+x /tmp/*.sh \ | @@ -23,7 +23,7 @@ RUN chmod a+x /tmp/*.sh \ | ||
23 | 23 | ||
24 | RUN yes | dpkg -i /tmp/${pkg.name}.deb | 24 | RUN yes | dpkg -i /tmp/${pkg.name}.deb |
25 | 25 | ||
26 | -RUN update-rc.d ${pkg.name} disable | 26 | +RUN systemctl --no-reload disable --now ${pkg.name}.service > /dev/null 2>&1 || : |
27 | 27 | ||
28 | RUN chmod 555 ${pkg.installFolder}/bin/${pkg.name} | 28 | RUN chmod 555 ${pkg.installFolder}/bin/${pkg.name} |
29 | 29 |
@@ -35,9 +35,13 @@ | @@ -35,9 +35,13 @@ | ||
35 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | 35 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
36 | <main.dir>${basedir}/../..</main.dir> | 36 | <main.dir>${basedir}/../..</main.dir> |
37 | <pkg.name>tb-web-ui</pkg.name> | 37 | <pkg.name>tb-web-ui</pkg.name> |
38 | + <pkg.type>js</pkg.type> | ||
38 | <docker.name>tb-web-ui</docker.name> | 39 | <docker.name>tb-web-ui</docker.name> |
39 | - <pkg.unixLogFolder>/var/log/${pkg.name}</pkg.unixLogFolder> | ||
40 | - <pkg.installFolder>/usr/share/${pkg.name}</pkg.installFolder> | 40 | + <pkg.name>tb-web-ui</pkg.name> |
41 | + <pkg.type>js</pkg.type> | ||
42 | + <pkg.disabled>false</pkg.disabled> | ||
43 | + <pkg.process-resources.phase>process-resources</pkg.process-resources.phase> | ||
44 | + <pkg.package.phase>package</pkg.package.phase> | ||
41 | <pkg.linux.dist>${project.build.directory}/package/linux</pkg.linux.dist> | 45 | <pkg.linux.dist>${project.build.directory}/package/linux</pkg.linux.dist> |
42 | <pkg.win.dist>${project.build.directory}/package/windows</pkg.win.dist> | 46 | <pkg.win.dist>${project.build.directory}/package/windows</pkg.win.dist> |
43 | </properties> | 47 | </properties> |
@@ -136,170 +140,185 @@ | @@ -136,170 +140,185 @@ | ||
136 | <plugin> | 140 | <plugin> |
137 | <groupId>org.apache.maven.plugins</groupId> | 141 | <groupId>org.apache.maven.plugins</groupId> |
138 | <artifactId>maven-resources-plugin</artifactId> | 142 | <artifactId>maven-resources-plugin</artifactId> |
139 | - <executions> | ||
140 | - <execution> | ||
141 | - <id>copy-linux-conf</id> | ||
142 | - <phase>process-resources</phase> | ||
143 | - <goals> | ||
144 | - <goal>copy-resources</goal> | ||
145 | - </goals> | ||
146 | - <configuration> | ||
147 | - <outputDirectory>${pkg.linux.dist}/conf</outputDirectory> | ||
148 | - <resources> | ||
149 | - <resource> | ||
150 | - <directory>config</directory> | ||
151 | - <filtering>true</filtering> | ||
152 | - </resource> | ||
153 | - </resources> | ||
154 | - <filters> | ||
155 | - <filter>src/main/filters/unix.properties</filter> | ||
156 | - </filters> | ||
157 | - </configuration> | ||
158 | - </execution> | ||
159 | - <execution> | ||
160 | - <id>copy-linux-init</id> | ||
161 | - <phase>process-resources</phase> | ||
162 | - <goals> | ||
163 | - <goal>copy-resources</goal> | ||
164 | - </goals> | ||
165 | - <configuration> | ||
166 | - <outputDirectory>${pkg.linux.dist}/init</outputDirectory> | ||
167 | - <resources> | ||
168 | - <resource> | ||
169 | - <directory>src/main/scripts/init</directory> | ||
170 | - <filtering>true</filtering> | ||
171 | - </resource> | ||
172 | - </resources> | ||
173 | - <filters> | ||
174 | - <filter>src/main/filters/unix.properties</filter> | ||
175 | - </filters> | ||
176 | - </configuration> | ||
177 | - </execution> | ||
178 | - <execution> | ||
179 | - <id>copy-win-conf</id> | ||
180 | - <phase>process-resources</phase> | ||
181 | - <goals> | ||
182 | - <goal>copy-resources</goal> | ||
183 | - </goals> | ||
184 | - <configuration> | ||
185 | - <outputDirectory>${pkg.win.dist}/conf</outputDirectory> | ||
186 | - <resources> | ||
187 | - <resource> | ||
188 | - <directory>config</directory> | ||
189 | - <excludes> | ||
190 | - <exclude>tb-web-ui.conf</exclude> | ||
191 | - </excludes> | ||
192 | - <filtering>true</filtering> | ||
193 | - </resource> | ||
194 | - </resources> | ||
195 | - <filters> | ||
196 | - <filter>src/main/filters/windows.properties</filter> | ||
197 | - </filters> | ||
198 | - </configuration> | ||
199 | - </execution> | ||
200 | - <execution> | ||
201 | - <id>copy-control</id> | ||
202 | - <phase>process-resources</phase> | ||
203 | - <goals> | ||
204 | - <goal>copy-resources</goal> | ||
205 | - </goals> | ||
206 | - <configuration> | ||
207 | - <outputDirectory>${project.build.directory}/control</outputDirectory> | ||
208 | - <resources> | ||
209 | - <resource> | ||
210 | - <directory>src/main/scripts/control</directory> | ||
211 | - <filtering>true</filtering> | ||
212 | - </resource> | ||
213 | - </resources> | ||
214 | - <filters> | ||
215 | - <filter>src/main/filters/unix.properties</filter> | ||
216 | - </filters> | ||
217 | - </configuration> | ||
218 | - </execution> | ||
219 | - <execution> | ||
220 | - <id>copy-windows-control</id> | ||
221 | - <phase>process-resources</phase> | ||
222 | - <goals> | ||
223 | - <goal>copy-resources</goal> | ||
224 | - </goals> | ||
225 | - <configuration> | ||
226 | - <outputDirectory>${pkg.win.dist}</outputDirectory> | ||
227 | - <resources> | ||
228 | - <resource> | ||
229 | - <directory>src/main/scripts/windows</directory> | ||
230 | - <filtering>true</filtering> | ||
231 | - </resource> | ||
232 | - </resources> | ||
233 | - <filters> | ||
234 | - <filter>src/main/filters/windows.properties</filter> | ||
235 | - </filters> | ||
236 | - </configuration> | ||
237 | - </execution> | ||
238 | - <execution> | ||
239 | - <id>copy-docker-config</id> | ||
240 | - <phase>process-resources</phase> | ||
241 | - <goals> | ||
242 | - <goal>copy-resources</goal> | ||
243 | - </goals> | ||
244 | - <configuration> | ||
245 | - <outputDirectory>${project.build.directory}</outputDirectory> | ||
246 | - <resources> | ||
247 | - <resource> | ||
248 | - <directory>docker</directory> | ||
249 | - <filtering>true</filtering> | ||
250 | - </resource> | ||
251 | - </resources> | ||
252 | - </configuration> | ||
253 | - </execution> | ||
254 | - </executions> | ||
255 | </plugin> | 143 | </plugin> |
256 | <plugin> | 144 | <plugin> |
257 | <groupId>org.thingsboard</groupId> | 145 | <groupId>org.thingsboard</groupId> |
258 | <artifactId>gradle-maven-plugin</artifactId> | 146 | <artifactId>gradle-maven-plugin</artifactId> |
259 | - <configuration> | ||
260 | - <tasks> | ||
261 | - <task>build</task> | ||
262 | - <task>buildDeb</task> | ||
263 | - <task>buildRpm</task> | ||
264 | - </tasks> | ||
265 | - <args> | ||
266 | - <arg>-PprojectBuildDir=${project.build.directory}</arg> | ||
267 | - <arg>-PprojectVersion=${project.version}</arg> | ||
268 | - <arg>-PpkgName=${pkg.name}</arg> | ||
269 | - <arg>-PpkgUser=${pkg.user}</arg> | ||
270 | - <arg>-PpkgInstallFolder=${pkg.installFolder}</arg> | ||
271 | - <arg>-PpkgLogFolder=${pkg.unixLogFolder}</arg> | ||
272 | - </args> | ||
273 | - </configuration> | ||
274 | - <executions> | ||
275 | - <execution> | ||
276 | - <phase>package</phase> | ||
277 | - <goals> | ||
278 | - <goal>invoke</goal> | ||
279 | - </goals> | ||
280 | - </execution> | ||
281 | - </executions> | ||
282 | </plugin> | 147 | </plugin> |
283 | <plugin> | 148 | <plugin> |
284 | <groupId>org.apache.maven.plugins</groupId> | 149 | <groupId>org.apache.maven.plugins</groupId> |
285 | <artifactId>maven-assembly-plugin</artifactId> | 150 | <artifactId>maven-assembly-plugin</artifactId> |
286 | - <version>3.0.0</version> | ||
287 | - <configuration> | ||
288 | - <finalName>${pkg.name}</finalName> | ||
289 | - <descriptors> | ||
290 | - <descriptor>src/main/assembly/windows.xml</descriptor> | ||
291 | - </descriptors> | ||
292 | - </configuration> | ||
293 | - <executions> | ||
294 | - <execution> | ||
295 | - <id>assembly</id> | ||
296 | - <phase>package</phase> | ||
297 | - <goals> | ||
298 | - <goal>single</goal> | ||
299 | - </goals> | ||
300 | - </execution> | ||
301 | - </executions> | ||
302 | </plugin> | 151 | </plugin> |
152 | +<!-- <plugin>--> | ||
153 | +<!-- <groupId>org.apache.maven.plugins</groupId>--> | ||
154 | +<!-- <artifactId>maven-resources-plugin</artifactId>--> | ||
155 | +<!-- <executions>--> | ||
156 | +<!-- <execution>--> | ||
157 | +<!-- <id>copy-linux-conf</id>--> | ||
158 | +<!-- <phase>process-resources</phase>--> | ||
159 | +<!-- <goals>--> | ||
160 | +<!-- <goal>copy-resources</goal>--> | ||
161 | +<!-- </goals>--> | ||
162 | +<!-- <configuration>--> | ||
163 | +<!-- <outputDirectory>${pkg.linux.dist}/conf</outputDirectory>--> | ||
164 | +<!-- <resources>--> | ||
165 | +<!-- <resource>--> | ||
166 | +<!-- <directory>config</directory>--> | ||
167 | +<!-- <filtering>true</filtering>--> | ||
168 | +<!-- </resource>--> | ||
169 | +<!-- </resources>--> | ||
170 | +<!-- <filters>--> | ||
171 | +<!-- <filter>src/main/filters/unix.properties</filter>--> | ||
172 | +<!-- </filters>--> | ||
173 | +<!-- </configuration>--> | ||
174 | +<!-- </execution>--> | ||
175 | +<!-- <execution>--> | ||
176 | +<!-- <id>copy-linux-init</id>--> | ||
177 | +<!-- <phase>process-resources</phase>--> | ||
178 | +<!-- <goals>--> | ||
179 | +<!-- <goal>copy-resources</goal>--> | ||
180 | +<!-- </goals>--> | ||
181 | +<!-- <configuration>--> | ||
182 | +<!-- <outputDirectory>${pkg.linux.dist}/init</outputDirectory>--> | ||
183 | +<!-- <resources>--> | ||
184 | +<!-- <resource>--> | ||
185 | +<!-- <directory>src/main/scripts/init</directory>--> | ||
186 | +<!-- <filtering>true</filtering>--> | ||
187 | +<!-- </resource>--> | ||
188 | +<!-- </resources>--> | ||
189 | +<!-- <filters>--> | ||
190 | +<!-- <filter>src/main/filters/unix.properties</filter>--> | ||
191 | +<!-- </filters>--> | ||
192 | +<!-- </configuration>--> | ||
193 | +<!-- </execution>--> | ||
194 | +<!-- <execution>--> | ||
195 | +<!-- <id>copy-win-conf</id>--> | ||
196 | +<!-- <phase>process-resources</phase>--> | ||
197 | +<!-- <goals>--> | ||
198 | +<!-- <goal>copy-resources</goal>--> | ||
199 | +<!-- </goals>--> | ||
200 | +<!-- <configuration>--> | ||
201 | +<!-- <outputDirectory>${pkg.win.dist}/conf</outputDirectory>--> | ||
202 | +<!-- <resources>--> | ||
203 | +<!-- <resource>--> | ||
204 | +<!-- <directory>config</directory>--> | ||
205 | +<!-- <excludes>--> | ||
206 | +<!-- <exclude>tb-web-ui.conf</exclude>--> | ||
207 | +<!-- </excludes>--> | ||
208 | +<!-- <filtering>true</filtering>--> | ||
209 | +<!-- </resource>--> | ||
210 | +<!-- </resources>--> | ||
211 | +<!-- <filters>--> | ||
212 | +<!-- <filter>src/main/filters/windows.properties</filter>--> | ||
213 | +<!-- </filters>--> | ||
214 | +<!-- </configuration>--> | ||
215 | +<!-- </execution>--> | ||
216 | +<!-- <execution>--> | ||
217 | +<!-- <id>copy-control</id>--> | ||
218 | +<!-- <phase>process-resources</phase>--> | ||
219 | +<!-- <goals>--> | ||
220 | +<!-- <goal>copy-resources</goal>--> | ||
221 | +<!-- </goals>--> | ||
222 | +<!-- <configuration>--> | ||
223 | +<!-- <outputDirectory>${project.build.directory}/control</outputDirectory>--> | ||
224 | +<!-- <resources>--> | ||
225 | +<!-- <resource>--> | ||
226 | +<!-- <directory>src/main/scripts/control</directory>--> | ||
227 | +<!-- <filtering>true</filtering>--> | ||
228 | +<!-- </resource>--> | ||
229 | +<!-- </resources>--> | ||
230 | +<!-- <filters>--> | ||
231 | +<!-- <filter>src/main/filters/unix.properties</filter>--> | ||
232 | +<!-- </filters>--> | ||
233 | +<!-- </configuration>--> | ||
234 | +<!-- </execution>--> | ||
235 | +<!-- <execution>--> | ||
236 | +<!-- <id>copy-windows-control</id>--> | ||
237 | +<!-- <phase>process-resources</phase>--> | ||
238 | +<!-- <goals>--> | ||
239 | +<!-- <goal>copy-resources</goal>--> | ||
240 | +<!-- </goals>--> | ||
241 | +<!-- <configuration>--> | ||
242 | +<!-- <outputDirectory>${pkg.win.dist}</outputDirectory>--> | ||
243 | +<!-- <resources>--> | ||
244 | +<!-- <resource>--> | ||
245 | +<!-- <directory>src/main/scripts/windows</directory>--> | ||
246 | +<!-- <filtering>true</filtering>--> | ||
247 | +<!-- </resource>--> | ||
248 | +<!-- </resources>--> | ||
249 | +<!-- <filters>--> | ||
250 | +<!-- <filter>src/main/filters/windows.properties</filter>--> | ||
251 | +<!-- </filters>--> | ||
252 | +<!-- </configuration>--> | ||
253 | +<!-- </execution>--> | ||
254 | +<!-- <execution>--> | ||
255 | +<!-- <id>copy-docker-config</id>--> | ||
256 | +<!-- <phase>process-resources</phase>--> | ||
257 | +<!-- <goals>--> | ||
258 | +<!-- <goal>copy-resources</goal>--> | ||
259 | +<!-- </goals>--> | ||
260 | +<!-- <configuration>--> | ||
261 | +<!-- <outputDirectory>${project.build.directory}</outputDirectory>--> | ||
262 | +<!-- <resources>--> | ||
263 | +<!-- <resource>--> | ||
264 | +<!-- <directory>docker</directory>--> | ||
265 | +<!-- <filtering>true</filtering>--> | ||
266 | +<!-- </resource>--> | ||
267 | +<!-- </resources>--> | ||
268 | +<!-- </configuration>--> | ||
269 | +<!-- </execution>--> | ||
270 | +<!-- </executions>--> | ||
271 | +<!-- </plugin>--> | ||
272 | +<!-- <plugin>--> | ||
273 | +<!-- <groupId>org.thingsboard</groupId>--> | ||
274 | +<!-- <artifactId>gradle-maven-plugin</artifactId>--> | ||
275 | +<!-- <configuration>--> | ||
276 | +<!-- <gradleProjectDirectory>${basedir}</gradleProjectDirectory>--> | ||
277 | +<!-- <tasks>--> | ||
278 | +<!-- <task>build</task>--> | ||
279 | +<!-- <task>buildDeb</task>--> | ||
280 | +<!-- <task>buildRpm</task>--> | ||
281 | +<!-- <task>renameDeb</task>--> | ||
282 | +<!-- <task>renameRpm</task>--> | ||
283 | +<!-- </tasks>--> | ||
284 | +<!-- <args>--> | ||
285 | +<!-- <arg>-PprojectBuildDir=${project.build.directory}</arg>--> | ||
286 | +<!-- <arg>-PprojectVersion=${project.version}</arg>--> | ||
287 | +<!-- <arg>-PpkgName=${pkg.name}</arg>--> | ||
288 | +<!-- <arg>-PpkgUser=${pkg.user}</arg>--> | ||
289 | +<!-- <arg>-PpkgInstallFolder=${pkg.installFolder}</arg>--> | ||
290 | +<!-- <arg>-PpkgLogFolder=${pkg.unixLogFolder}</arg>--> | ||
291 | +<!-- </args>--> | ||
292 | +<!-- </configuration>--> | ||
293 | +<!-- <executions>--> | ||
294 | +<!-- <execution>--> | ||
295 | +<!-- <phase>package</phase>--> | ||
296 | +<!-- <goals>--> | ||
297 | +<!-- <goal>invoke</goal>--> | ||
298 | +<!-- </goals>--> | ||
299 | +<!-- </execution>--> | ||
300 | +<!-- </executions>--> | ||
301 | +<!-- </plugin>--> | ||
302 | +<!-- <plugin>--> | ||
303 | +<!-- <groupId>org.apache.maven.plugins</groupId>--> | ||
304 | +<!-- <artifactId>maven-assembly-plugin</artifactId>--> | ||
305 | +<!-- <version>3.0.0</version>--> | ||
306 | +<!-- <configuration>--> | ||
307 | +<!-- <finalName>${pkg.name}</finalName>--> | ||
308 | +<!-- <descriptors>--> | ||
309 | +<!-- <descriptor>../../packaging/js/assembly/windows.xml</descriptor>--> | ||
310 | +<!-- </descriptors>--> | ||
311 | +<!-- </configuration>--> | ||
312 | +<!-- <executions>--> | ||
313 | +<!-- <execution>--> | ||
314 | +<!-- <id>assembly</id>--> | ||
315 | +<!-- <phase>package</phase>--> | ||
316 | +<!-- <goals>--> | ||
317 | +<!-- <goal>single</goal>--> | ||
318 | +<!-- </goals>--> | ||
319 | +<!-- </execution>--> | ||
320 | +<!-- </executions>--> | ||
321 | +<!-- </plugin>--> | ||
303 | <plugin> | 322 | <plugin> |
304 | <groupId>com.spotify</groupId> | 323 | <groupId>com.spotify</groupId> |
305 | <artifactId>dockerfile-maven-plugin</artifactId> | 324 | <artifactId>dockerfile-maven-plugin</artifactId> |
msa/web-ui/src/main/filters/unix.properties
deleted
100644 → 0
1 | -pkg.logFolder=${pkg.unixLogFolder} |
msa/web-ui/src/main/filters/windows.properties
deleted
100644 → 0
msa/web-ui/src/main/scripts/control/deb/postinst
deleted
100644 → 0
msa/web-ui/src/main/scripts/control/deb/postrm
deleted
100644 → 0
msa/web-ui/src/main/scripts/control/deb/preinst
deleted
100644 → 0
1 | -#!/bin/sh | ||
2 | - | ||
3 | -if ! getent group ${pkg.user} >/dev/null; then | ||
4 | - addgroup --system ${pkg.user} | ||
5 | -fi | ||
6 | - | ||
7 | -if ! getent passwd ${pkg.user} >/dev/null; then | ||
8 | - adduser --quiet \ | ||
9 | - --system \ | ||
10 | - --ingroup ${pkg.user} \ | ||
11 | - --quiet \ | ||
12 | - --disabled-login \ | ||
13 | - --disabled-password \ | ||
14 | - --home ${pkg.installFolder} \ | ||
15 | - --no-create-home \ | ||
16 | - -gecos "Thingsboard application" \ | ||
17 | - ${pkg.user} | ||
18 | -fi |
msa/web-ui/src/main/scripts/control/deb/prerm
deleted
100644 → 0
msa/web-ui/src/main/scripts/control/rpm/postinst
deleted
100644 → 0
msa/web-ui/src/main/scripts/control/rpm/postrm
deleted
100644 → 0
msa/web-ui/src/main/scripts/control/rpm/preinst
deleted
100644 → 0
msa/web-ui/src/main/scripts/control/rpm/prerm
deleted
100644 → 0
msa/web-ui/src/main/scripts/control/tb-web-ui.service
deleted
100644 → 0
msa/web-ui/src/main/scripts/init/tb-web-ui
deleted
100644 → 0
1 | -#!/bin/bash | ||
2 | -# | ||
3 | - | ||
4 | - | ||
5 | -### BEGIN INIT INFO | ||
6 | -# Provides: tb-web-ui | ||
7 | -# Required-Start: $remote_fs $syslog $network | ||
8 | -# Required-Stop: $remote_fs $syslog $network | ||
9 | -# Default-Start: 2 3 4 5 | ||
10 | -# Default-Stop: 0 1 6 | ||
11 | -# Short-Description: ${project.name} | ||
12 | -# Description: ${project.description} | ||
13 | -# chkconfig: 2345 99 01 | ||
14 | -### END INIT INFO | ||
15 | - | ||
16 | -[[ -n "$DEBUG" ]] && set -x | ||
17 | - | ||
18 | -# Initialize variables that cannot be provided by a .conf file | ||
19 | -WORKING_DIR="$(pwd)" | ||
20 | -# shellcheck disable=SC2153 | ||
21 | - | ||
22 | -mainfile=${pkg.installFolder}/bin/${pkg.name} | ||
23 | -configfile=${pkg.name}.conf | ||
24 | - | ||
25 | -# Follow symlinks to find the real script and detect init.d script | ||
26 | -cd "$(dirname "$0")" || exit 1 | ||
27 | -[[ -z "$initfile" ]] && initfile=$(pwd)/$(basename "$0") | ||
28 | -while [[ -L "$initfile" ]]; do | ||
29 | - [[ "$initfile" =~ init\.d ]] && init_script=$(basename "$initfile") | ||
30 | - initfile=$(readlink "$initfile") | ||
31 | - cd "$(dirname "$initfile")" || exit 1 | ||
32 | - initfile=$(pwd)/$(basename "$initfile") | ||
33 | -done | ||
34 | -initfolder="$( (cd "$(dirname "initfile")" && pwd -P) )" | ||
35 | -cd "$WORKING_DIR" || exit 1 | ||
36 | - | ||
37 | -# Initialize CONF_FOLDER location | ||
38 | -[[ -z "$CONF_FOLDER" ]] && CONF_FOLDER="${pkg.installFolder}/conf" | ||
39 | - | ||
40 | -# shellcheck source=/dev/null | ||
41 | -[[ -r "${CONF_FOLDER}/${configfile}" ]] && source "${CONF_FOLDER}/${configfile}" | ||
42 | - | ||
43 | -# Initialize PID/LOG locations if they weren't provided by the config file | ||
44 | -[[ -z "$PID_FOLDER" ]] && PID_FOLDER="/var/run" | ||
45 | -[[ -z "$LOG_FOLDER" ]] && LOG_FOLDER="${pkg.unixLogFolder}" | ||
46 | -! [[ "$PID_FOLDER" == /* ]] && PID_FOLDER="$(dirname "$mainfile")"/"$PID_FOLDER" | ||
47 | -! [[ "$LOG_FOLDER" == /* ]] && LOG_FOLDER="$(dirname "$mainfile")"/"$LOG_FOLDER" | ||
48 | -! [[ -x "$PID_FOLDER" ]] && PID_FOLDER="/tmp" | ||
49 | -! [[ -x "$LOG_FOLDER" ]] && LOG_FOLDER="/tmp" | ||
50 | - | ||
51 | -# Set up defaults | ||
52 | -[[ -z "$MODE" ]] && MODE="auto" # modes are "auto", "service" or "run" | ||
53 | -[[ -z "$USE_START_STOP_DAEMON" ]] && USE_START_STOP_DAEMON="true" | ||
54 | - | ||
55 | -# Create an identity for log/pid files | ||
56 | -if [[ -z "$identity" ]]; then | ||
57 | - if [[ -n "$init_script" ]]; then | ||
58 | - identity="${init_script}" | ||
59 | - else | ||
60 | - identity=$(basename "${initfile%.*}")_${initfolder//\//} | ||
61 | - fi | ||
62 | -fi | ||
63 | - | ||
64 | -# Initialize log file name if not provided by the config file | ||
65 | -[[ -z "$LOG_FILENAME" ]] && LOG_FILENAME="${identity}.log" | ||
66 | - | ||
67 | -# ANSI Colors | ||
68 | -echoRed() { echo $'\e[0;31m'"$1"$'\e[0m'; } | ||
69 | -echoGreen() { echo $'\e[0;32m'"$1"$'\e[0m'; } | ||
70 | -echoYellow() { echo $'\e[0;33m'"$1"$'\e[0m'; } | ||
71 | - | ||
72 | -# Utility functions | ||
73 | -checkPermissions() { | ||
74 | - touch "$pid_file" &> /dev/null || { echoRed "Operation not permitted (cannot access pid file)"; return 4; } | ||
75 | - touch "$log_file" &> /dev/null || { echoRed "Operation not permitted (cannot access log file)"; return 4; } | ||
76 | -} | ||
77 | - | ||
78 | -isRunning() { | ||
79 | - ps -p "$1" &> /dev/null | ||
80 | -} | ||
81 | - | ||
82 | -await_file() { | ||
83 | - end=$(date +%s) | ||
84 | - let "end+=10" | ||
85 | - while [[ ! -s "$1" ]] | ||
86 | - do | ||
87 | - now=$(date +%s) | ||
88 | - if [[ $now -ge $end ]]; then | ||
89 | - break | ||
90 | - fi | ||
91 | - sleep 1 | ||
92 | - done | ||
93 | -} | ||
94 | - | ||
95 | -# Determine the script mode | ||
96 | -action="run" | ||
97 | -if [[ "$MODE" == "auto" && -n "$init_script" ]] || [[ "$MODE" == "service" ]]; then | ||
98 | - action="$1" | ||
99 | - shift | ||
100 | -fi | ||
101 | - | ||
102 | -# Build the pid and log filenames | ||
103 | -if [[ "$identity" == "$init_script" ]] || [[ "$identity" == "$APP_NAME" ]]; then | ||
104 | - PID_FOLDER="$PID_FOLDER/${identity}" | ||
105 | - pid_subfolder=$PID_FOLDER | ||
106 | -fi | ||
107 | -pid_file="$PID_FOLDER/${identity}.pid" | ||
108 | -log_file="$LOG_FOLDER/$LOG_FILENAME" | ||
109 | - | ||
110 | -# Determine the user to run as if we are root | ||
111 | -# shellcheck disable=SC2012 | ||
112 | -[[ $(id -u) == "0" ]] && run_user=$(ls -ld "$mainfile" | awk '{print $3}') | ||
113 | - | ||
114 | -arguments=($RUN_ARGS "$@") | ||
115 | - | ||
116 | -# Action functions | ||
117 | -start() { | ||
118 | - if [[ -f "$pid_file" ]]; then | ||
119 | - pid=$(cat "$pid_file") | ||
120 | - isRunning "$pid" && { echoYellow "Already running [$pid]"; return 0; } | ||
121 | - fi | ||
122 | - do_start "$@" | ||
123 | -} | ||
124 | - | ||
125 | -do_start() { | ||
126 | - working_dir=$(dirname "$mainfile") | ||
127 | - pushd "$working_dir" > /dev/null | ||
128 | - mkdir -p "$PID_FOLDER" &> /dev/null | ||
129 | - if [[ -n "$run_user" ]]; then | ||
130 | - checkPermissions || return $? | ||
131 | - if [[ -z "$pid_subfolder" ]]; then | ||
132 | - chown "$run_user" "$pid_subfolder" | ||
133 | - fi | ||
134 | - chown "$run_user" "$pid_file" | ||
135 | - chown "$run_user" "$log_file" | ||
136 | - if [ $USE_START_STOP_DAEMON = true ] && type start-stop-daemon > /dev/null 2>&1; then | ||
137 | - start-stop-daemon --start --quiet \ | ||
138 | - --chuid "$run_user" \ | ||
139 | - --name "$identity" \ | ||
140 | - --make-pidfile --pidfile "$pid_file" \ | ||
141 | - --background --no-close \ | ||
142 | - --startas "$mainfile" \ | ||
143 | - --chdir "$working_dir" \ | ||
144 | - -- "${arguments[@]}" \ | ||
145 | - >> "$log_file" 2>&1 | ||
146 | - await_file "$pid_file" | ||
147 | - else | ||
148 | - su -s /bin/sh -c "$mainfile $(printf "\"%s\" " "${arguments[@]}") >> \"$log_file\" 2>&1 & echo \$!" "$run_user" > "$pid_file" | ||
149 | - fi | ||
150 | - pid=$(cat "$pid_file") | ||
151 | - else | ||
152 | - checkPermissions || return $? | ||
153 | - "$mainfile" "${arguments[@]}" >> "$log_file" 2>&1 & | ||
154 | - pid=$! | ||
155 | - disown $pid | ||
156 | - echo "$pid" > "$pid_file" | ||
157 | - fi | ||
158 | - [[ -z $pid ]] && { echoRed "Failed to start"; return 1; } | ||
159 | - echoGreen "Started [$pid]" | ||
160 | -} | ||
161 | - | ||
162 | -stop() { | ||
163 | - working_dir=$(dirname "$mainfile") | ||
164 | - pushd "$working_dir" > /dev/null | ||
165 | - [[ -f $pid_file ]] || { echoYellow "Not running (pidfile not found)"; return 0; } | ||
166 | - pid=$(cat "$pid_file") | ||
167 | - isRunning "$pid" || { echoYellow "Not running (process ${pid}). Removing stale pid file."; rm -f "$pid_file"; return 0; } | ||
168 | - do_stop "$pid" "$pid_file" | ||
169 | -} | ||
170 | - | ||
171 | -do_stop() { | ||
172 | - kill -2 "$1" &> /dev/null || { echoRed "Unable to kill process $1"; return 1; } | ||
173 | - for i in $(seq 1 60); do | ||
174 | - isRunning "$1" || { echoGreen "Stopped [$1]"; rm -f "$2"; return 0; } | ||
175 | - [[ $i -eq 30 ]] && kill -9 "$1" &> /dev/null | ||
176 | - sleep 1 | ||
177 | - done | ||
178 | - echoRed "Unable to kill process $1"; | ||
179 | - return 1; | ||
180 | -} | ||
181 | - | ||
182 | -restart() { | ||
183 | - stop && start | ||
184 | -} | ||
185 | - | ||
186 | -orce_reload() { | ||
187 | - working_dir=$(dirname "$mainfile") | ||
188 | - pushd "$working_dir" > /dev/null | ||
189 | - [[ -f $pid_file ]] || { echoRed "Not running (pidfile not found)"; return 7; } | ||
190 | - pid=$(cat "$pid_file") | ||
191 | - rm -f "$pid_file" | ||
192 | - isRunning "$pid" || { echoRed "Not running (process ${pid} not found)"; return 7; } | ||
193 | - do_stop "$pid" "$pid_file" | ||
194 | - do_start | ||
195 | -} | ||
196 | - | ||
197 | -status() { | ||
198 | - working_dir=$(dirname "$mainfile") | ||
199 | - pushd "$working_dir" > /dev/null | ||
200 | - [[ -f "$pid_file" ]] || { echoRed "Not running"; return 3; } | ||
201 | - pid=$(cat "$pid_file") | ||
202 | - isRunning "$pid" || { echoRed "Not running (process ${pid} not found)"; return 1; } | ||
203 | - echoGreen "Running [$pid]" | ||
204 | - return 0 | ||
205 | -} | ||
206 | - | ||
207 | -run() { | ||
208 | - pushd "$(dirname "$mainfile")" > /dev/null | ||
209 | - "$mainfile" "${arguments[@]}" | ||
210 | - result=$? | ||
211 | - popd > /dev/null | ||
212 | - return "$result" | ||
213 | -} | ||
214 | - | ||
215 | -# Call the appropriate action function | ||
216 | -case "$action" in | ||
217 | -start) | ||
218 | - start "$@"; exit $?;; | ||
219 | -stop) | ||
220 | - stop "$@"; exit $?;; | ||
221 | -restart) | ||
222 | - restart "$@"; exit $?;; | ||
223 | -force-reload) | ||
224 | - force_reload "$@"; exit $?;; | ||
225 | -status) | ||
226 | - status "$@"; exit $?;; | ||
227 | -run) | ||
228 | - run "$@"; exit $?;; | ||
229 | -*) | ||
230 | - echo "Usage: $0 {start|stop|restart|force-reload|status|run}"; exit 1; | ||
231 | -esac | ||
232 | - | ||
233 | -exit 0 |
msa/web-ui/src/main/scripts/windows/install.bat
deleted
100644 → 0
1 | -@REM | ||
2 | -@REM Copyright © 2016-2018 The Thingsboard Authors | ||
3 | -@REM | ||
4 | -@REM Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | -@REM you may not use this file except in compliance with the License. | ||
6 | -@REM You may obtain a copy of the License at | ||
7 | -@REM | ||
8 | -@REM http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | -@REM | ||
10 | -@REM Unless required by applicable law or agreed to in writing, software | ||
11 | -@REM distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | -@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | -@REM See the License for the specific language governing permissions and | ||
14 | -@REM limitations under the License. | ||
15 | -@REM | ||
16 | - | ||
17 | -@ECHO OFF | ||
18 | - | ||
19 | -setlocal ENABLEEXTENSIONS | ||
20 | - | ||
21 | -@ECHO Installing ${pkg.name} ... | ||
22 | - | ||
23 | -SET BASE=%~dp0 | ||
24 | - | ||
25 | -"%BASE%"${pkg.name}.exe install | ||
26 | - | ||
27 | -@ECHO ${pkg.name} installed successfully! | ||
28 | - | ||
29 | -GOTO END | ||
30 | - | ||
31 | -:END |
msa/web-ui/src/main/scripts/windows/uninstall.bat
deleted
100644 → 0
1 | -@REM | ||
2 | -@REM Copyright © 2016-2018 The Thingsboard Authors | ||
3 | -@REM | ||
4 | -@REM Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | -@REM you may not use this file except in compliance with the License. | ||
6 | -@REM You may obtain a copy of the License at | ||
7 | -@REM | ||
8 | -@REM http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | -@REM | ||
10 | -@REM Unless required by applicable law or agreed to in writing, software | ||
11 | -@REM distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | -@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | -@REM See the License for the specific language governing permissions and | ||
14 | -@REM limitations under the License. | ||
15 | -@REM | ||
16 | - | ||
17 | -@ECHO OFF | ||
18 | - | ||
19 | -@ECHO Stopping ${pkg.name} ... | ||
20 | -net stop ${pkg.name} | ||
21 | - | ||
22 | -@ECHO Uninstalling ${pkg.name} ... | ||
23 | -"%~dp0"${pkg.name}.exe uninstall | ||
24 | - | ||
25 | -@ECHO DONE. |
@@ -22,7 +22,6 @@ | @@ -22,7 +22,6 @@ | ||
22 | <version>3.0.0-SNAPSHOT</version> | 22 | <version>3.0.0-SNAPSHOT</version> |
23 | <artifactId>thingsboard</artifactId> | 23 | <artifactId>thingsboard</artifactId> |
24 | </parent> | 24 | </parent> |
25 | - <groupId>org.thingsboard</groupId> | ||
26 | <artifactId>netty-mqtt</artifactId> | 25 | <artifactId>netty-mqtt</artifactId> |
27 | <version>3.0.0-SNAPSHOT</version> | 26 | <version>3.0.0-SNAPSHOT</version> |
28 | <packaging>jar</packaging> | 27 | <packaging>jar</packaging> |
packaging/java/assembly/windows.xml
renamed from
application/src/main/assembly/windows.xml
packaging/java/build.gradle
renamed from
application/build.gradle
@@ -17,7 +17,7 @@ import org.apache.tools.ant.filters.ReplaceTokens | @@ -17,7 +17,7 @@ import org.apache.tools.ant.filters.ReplaceTokens | ||
17 | 17 | ||
18 | buildscript { | 18 | buildscript { |
19 | ext { | 19 | ext { |
20 | - osPackageVersion = "3.8.0" | 20 | + osPackageVersion = "8.3.0" |
21 | } | 21 | } |
22 | repositories { | 22 | repositories { |
23 | jcenter() | 23 | jcenter() |
@@ -43,8 +43,8 @@ ospackage { | @@ -43,8 +43,8 @@ ospackage { | ||
43 | 43 | ||
44 | into pkgInstallFolder | 44 | into pkgInstallFolder |
45 | 45 | ||
46 | - user pkgName | ||
47 | - permissionGroup pkgName | 46 | + user pkgUser |
47 | + permissionGroup pkgUser | ||
48 | 48 | ||
49 | // Copy the actual .jar file | 49 | // Copy the actual .jar file |
50 | from(mainJar) { | 50 | from(mainJar) { |
@@ -56,23 +56,25 @@ ospackage { | @@ -56,23 +56,25 @@ ospackage { | ||
56 | into "bin" | 56 | into "bin" |
57 | } | 57 | } |
58 | 58 | ||
59 | - // Copy the install files | ||
60 | - from("target/bin/install/install.sh") { | ||
61 | - fileMode 0775 | ||
62 | - into "bin/install" | ||
63 | - } | 59 | + if("${pkgCopyInstallScripts}".equalsIgnoreCase("true")) { |
60 | + // Copy the install files | ||
61 | + from("${buildDir}/bin/install/install.sh") { | ||
62 | + fileMode 0775 | ||
63 | + into "bin/install" | ||
64 | + } | ||
64 | 65 | ||
65 | - from("target/bin/install/upgrade.sh") { | ||
66 | - fileMode 0775 | ||
67 | - into "bin/install" | ||
68 | - } | 66 | + from("${buildDir}/bin/install/upgrade.sh") { |
67 | + fileMode 0775 | ||
68 | + into "bin/install" | ||
69 | + } | ||
69 | 70 | ||
70 | - from("target/bin/install/logback.xml") { | ||
71 | - into "bin/install" | 71 | + from("${buildDir}/bin/install/logback.xml") { |
72 | + into "bin/install" | ||
73 | + } | ||
72 | } | 74 | } |
73 | 75 | ||
74 | // Copy the config files | 76 | // Copy the config files |
75 | - from("target/conf") { | 77 | + from("${buildDir}/conf") { |
76 | exclude "${pkgName}.conf" | 78 | exclude "${pkgName}.conf" |
77 | fileType CONFIG | NOREPLACE | 79 | fileType CONFIG | NOREPLACE |
78 | fileMode 0754 | 80 | fileMode 0754 |
@@ -80,14 +82,14 @@ ospackage { | @@ -80,14 +82,14 @@ ospackage { | ||
80 | } | 82 | } |
81 | 83 | ||
82 | // Copy the data files | 84 | // Copy the data files |
83 | - from("target/data") { | 85 | + from("${buildDir}/data") { |
84 | fileType CONFIG | NOREPLACE | 86 | fileType CONFIG | NOREPLACE |
85 | fileMode 0754 | 87 | fileMode 0754 |
86 | into "data" | 88 | into "data" |
87 | } | 89 | } |
88 | 90 | ||
89 | // Copy the extensions files | 91 | // Copy the extensions files |
90 | - from("target/extensions") { | 92 | + from("${buildDir}/extensions") { |
91 | into "extensions" | 93 | into "extensions" |
92 | } | 94 | } |
93 | } | 95 | } |
@@ -97,12 +99,12 @@ buildRpm { | @@ -97,12 +99,12 @@ buildRpm { | ||
97 | 99 | ||
98 | arch = NOARCH | 100 | arch = NOARCH |
99 | 101 | ||
100 | - version = projectVersion.replace('-', '') | ||
101 | - archiveName = "${pkgName}.rpm" | 102 | + archiveVersion = projectVersion.replace('-', '') |
103 | + archiveFileName = "${pkgName}.rpm" | ||
102 | 104 | ||
103 | requires("java-1.8.0") | 105 | requires("java-1.8.0") |
104 | 106 | ||
105 | - from("target/conf") { | 107 | + from("${buildDir}/conf") { |
106 | include "${pkgName}.conf" | 108 | include "${pkgName}.conf" |
107 | filter(ReplaceTokens, tokens: ['pkg.platform': 'rpm']) | 109 | filter(ReplaceTokens, tokens: ['pkg.platform': 'rpm']) |
108 | fileType CONFIG | NOREPLACE | 110 | fileType CONFIG | NOREPLACE |
@@ -115,17 +117,19 @@ buildRpm { | @@ -115,17 +117,19 @@ buildRpm { | ||
115 | preUninstall file("${buildDir}/control/rpm/prerm") | 117 | preUninstall file("${buildDir}/control/rpm/prerm") |
116 | postUninstall file("${buildDir}/control/rpm/postrm") | 118 | postUninstall file("${buildDir}/control/rpm/postrm") |
117 | 119 | ||
118 | - user pkgName | ||
119 | - permissionGroup pkgName | 120 | + user pkgUser |
121 | + permissionGroup pkgUser | ||
120 | 122 | ||
121 | // Copy the system unit files | 123 | // Copy the system unit files |
122 | - from("${buildDir}/control/${pkgName}.service") { | 124 | + from("${buildDir}/control/template.service") { |
123 | addParentDirs = false | 125 | addParentDirs = false |
124 | fileMode 0644 | 126 | fileMode 0644 |
125 | into "/usr/lib/systemd/system" | 127 | into "/usr/lib/systemd/system" |
128 | + rename { String filename -> | ||
129 | + "${pkgName}.service" | ||
130 | + } | ||
126 | } | 131 | } |
127 | 132 | ||
128 | - directory(pkgLogFolder, 0755) | ||
129 | link("${pkgInstallFolder}/bin/${pkgName}.yml", "${pkgInstallFolder}/conf/${pkgName}.yml") | 133 | link("${pkgInstallFolder}/bin/${pkgName}.yml", "${pkgInstallFolder}/conf/${pkgName}.yml") |
130 | link("/etc/${pkgName}/conf", "${pkgInstallFolder}/conf") | 134 | link("/etc/${pkgName}/conf", "${pkgInstallFolder}/conf") |
131 | } | 135 | } |
@@ -135,11 +139,11 @@ buildDeb { | @@ -135,11 +139,11 @@ buildDeb { | ||
135 | 139 | ||
136 | arch = "all" | 140 | arch = "all" |
137 | 141 | ||
138 | - archiveName = "${pkgName}.deb" | 142 | + archiveFileName = "${pkgName}.deb" |
139 | 143 | ||
140 | requires("openjdk-8-jre").or("java8-runtime").or("oracle-java8-installer").or("openjdk-8-jre-headless") | 144 | requires("openjdk-8-jre").or("java8-runtime").or("oracle-java8-installer").or("openjdk-8-jre-headless") |
141 | 145 | ||
142 | - from("target/conf") { | 146 | + from("${buildDir}/conf") { |
143 | include "${pkgName}.conf" | 147 | include "${pkgName}.conf" |
144 | filter(ReplaceTokens, tokens: ['pkg.platform': 'deb']) | 148 | filter(ReplaceTokens, tokens: ['pkg.platform': 'deb']) |
145 | fileType CONFIG | NOREPLACE | 149 | fileType CONFIG | NOREPLACE |
@@ -157,18 +161,39 @@ buildDeb { | @@ -157,18 +161,39 @@ buildDeb { | ||
157 | preUninstall file("${buildDir}/control/deb/prerm") | 161 | preUninstall file("${buildDir}/control/deb/prerm") |
158 | postUninstall file("${buildDir}/control/deb/postrm") | 162 | postUninstall file("${buildDir}/control/deb/postrm") |
159 | 163 | ||
160 | - user pkgName | ||
161 | - permissionGroup pkgName | 164 | + user pkgUser |
165 | + permissionGroup pkgUser | ||
162 | 166 | ||
163 | // Copy the system unit files | 167 | // Copy the system unit files |
164 | - from("${buildDir}/control/${pkgName}.service") { | 168 | + from("${buildDir}/control/template.service") { |
165 | addParentDirs = false | 169 | addParentDirs = false |
166 | fileMode 0644 | 170 | fileMode 0644 |
167 | into "/lib/systemd/system" | 171 | into "/lib/systemd/system" |
172 | + rename { String filename -> | ||
173 | + "${pkgName}.service" | ||
174 | + } | ||
168 | } | 175 | } |
169 | 176 | ||
170 | - directory(pkgLogFolder, 0755) | ||
171 | - link("/etc/init.d/${pkgName}", "${pkgInstallFolder}/bin/${pkgName}.jar") | ||
172 | link("${pkgInstallFolder}/bin/${pkgName}.yml", "${pkgInstallFolder}/conf/${pkgName}.yml") | 177 | link("${pkgInstallFolder}/bin/${pkgName}.yml", "${pkgInstallFolder}/conf/${pkgName}.yml") |
173 | link("/etc/${pkgName}/conf", "${pkgInstallFolder}/conf") | 178 | link("/etc/${pkgName}/conf", "${pkgInstallFolder}/conf") |
174 | } | 179 | } |
180 | + | ||
181 | +task renameDeb(type: Copy) { | ||
182 | + from("${buildDir}/") { | ||
183 | + include '*.deb' | ||
184 | + destinationDir file("${buildDir}/") | ||
185 | + rename { String filename -> | ||
186 | + "${pkgName}.deb" | ||
187 | + } | ||
188 | + } | ||
189 | +} | ||
190 | + | ||
191 | +task renameRpm(type: Copy) { | ||
192 | + from("${buildDir}/") { | ||
193 | + include '*.rpm' | ||
194 | + destinationDir file("${buildDir}/") | ||
195 | + rename { String filename -> | ||
196 | + "${pkgName}.rpm" | ||
197 | + } | ||
198 | + } | ||
199 | +} |
packaging/java/filters/unix.properties
renamed from
application/src/main/filters/unix.properties
packaging/java/filters/windows.properties
renamed from
application/src/main/filters/windows.properties
packaging/java/scripts/control/deb/postinst
renamed from
application/src/main/scripts/control/deb/postinst
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | 2 | ||
3 | set -e | 3 | set -e |
4 | 4 | ||
5 | +mkdir -m 0755 -p ${pkg.logFolder} | ||
5 | chown -R ${pkg.user}: ${pkg.logFolder} | 6 | chown -R ${pkg.user}: ${pkg.logFolder} |
6 | chown -R ${pkg.user}: ${pkg.installFolder} | 7 | chown -R ${pkg.user}: ${pkg.installFolder} |
7 | systemctl --no-reload enable ${pkg.name}.service >/dev/null 2>&1 || : | 8 | systemctl --no-reload enable ${pkg.name}.service >/dev/null 2>&1 || : |
packaging/java/scripts/control/deb/postrm
renamed from
application/src/main/scripts/control/deb/postrm
packaging/java/scripts/control/deb/preinst
renamed from
application/src/main/scripts/control/deb/preinst
packaging/java/scripts/control/deb/prerm
renamed from
application/src/main/scripts/control/deb/prerm
packaging/java/scripts/control/rpm/postinst
renamed from
application/src/main/scripts/control/rpm/postinst
packaging/java/scripts/control/rpm/postrm
renamed from
application/src/main/scripts/control/rpm/postrm
packaging/java/scripts/control/rpm/preinst
renamed from
application/src/main/scripts/control/rpm/preinst
packaging/java/scripts/control/rpm/prerm
renamed from
application/src/main/scripts/control/rpm/prerm
packaging/java/scripts/control/template.service
renamed from
application/src/main/scripts/control/thingsboard.service
packaging/java/scripts/install/install.sh
renamed from
application/src/main/scripts/install/install.sh
packaging/java/scripts/install/install_dev_db.sh
renamed from
application/src/main/scripts/install/install_dev_db.sh
packaging/java/scripts/install/logback.xml
renamed from
application/src/main/scripts/install/logback.xml
packaging/java/scripts/install/upgrade.sh
renamed from
application/src/main/scripts/install/upgrade.sh
packaging/java/scripts/install/upgrade_dev_db.sh
renamed from
application/src/main/scripts/install/upgrade_dev_db.sh
packaging/java/scripts/windows/install.bat
renamed from
application/src/main/scripts/windows/install.bat
packaging/java/scripts/windows/install_dev_db.bat
renamed from
application/src/main/scripts/windows/install_dev_db.bat
packaging/java/scripts/windows/service.xml
renamed from
application/src/main/scripts/windows/service.xml
packaging/java/scripts/windows/uninstall.bat
renamed from
application/src/main/scripts/windows/uninstall.bat
packaging/java/scripts/windows/upgrade.bat
renamed from
application/src/main/scripts/windows/upgrade.bat
packaging/js/assembly/windows.xml
renamed from
msa/web-ui/src/main/assembly/windows.xml
packaging/js/build.gradle
renamed from
msa/web-ui/build.gradle
@@ -17,7 +17,7 @@ import org.apache.tools.ant.filters.ReplaceTokens | @@ -17,7 +17,7 @@ import org.apache.tools.ant.filters.ReplaceTokens | ||
17 | 17 | ||
18 | buildscript { | 18 | buildscript { |
19 | ext { | 19 | ext { |
20 | - osPackageVersion = "3.8.0" | 20 | + osPackageVersion = "8.3.0" |
21 | } | 21 | } |
22 | repositories { | 22 | repositories { |
23 | jcenter() | 23 | jcenter() |
@@ -47,26 +47,29 @@ ospackage { | @@ -47,26 +47,29 @@ ospackage { | ||
47 | permissionGroup pkgUser | 47 | permissionGroup pkgUser |
48 | 48 | ||
49 | // Copy the executable file | 49 | // Copy the executable file |
50 | - from("target/package/linux/bin/${pkgName}") { | 50 | + from("${buildDir}/package/linux/bin/${pkgName}") { |
51 | fileMode 0500 | 51 | fileMode 0500 |
52 | into "bin" | 52 | into "bin" |
53 | } | 53 | } |
54 | 54 | ||
55 | // Copy the init file | 55 | // Copy the init file |
56 | - from("target/package/linux/init/${pkgName}") { | 56 | + from("${buildDir}/package/linux/init/template") { |
57 | fileMode 0500 | 57 | fileMode 0500 |
58 | into "init" | 58 | into "init" |
59 | + rename { String filename -> | ||
60 | + "${pkgName}" | ||
61 | + } | ||
59 | } | 62 | } |
60 | 63 | ||
61 | // Copy the config files | 64 | // Copy the config files |
62 | - from("target/package/linux/conf") { | 65 | + from("${buildDir}/package/linux/conf") { |
63 | fileType CONFIG | NOREPLACE | 66 | fileType CONFIG | NOREPLACE |
64 | fileMode 0754 | 67 | fileMode 0754 |
65 | into "conf" | 68 | into "conf" |
66 | } | 69 | } |
67 | 70 | ||
68 | // Copy web files | 71 | // Copy web files |
69 | - from("target/web") { | 72 | + from("${buildDir}/web") { |
70 | into "web" | 73 | into "web" |
71 | } | 74 | } |
72 | 75 | ||
@@ -77,8 +80,8 @@ buildRpm { | @@ -77,8 +80,8 @@ buildRpm { | ||
77 | 80 | ||
78 | arch = X86_64 | 81 | arch = X86_64 |
79 | 82 | ||
80 | - version = projectVersion.replace('-', '') | ||
81 | - archiveName = "${pkgName}.rpm" | 83 | + archiveVersion = projectVersion.replace('-', '') |
84 | + archiveFileName = "${pkgName}.rpm" | ||
82 | 85 | ||
83 | preInstall file("${buildDir}/control/rpm/preinst") | 86 | preInstall file("${buildDir}/control/rpm/preinst") |
84 | postInstall file("${buildDir}/control/rpm/postinst") | 87 | postInstall file("${buildDir}/control/rpm/postinst") |
@@ -89,13 +92,15 @@ buildRpm { | @@ -89,13 +92,15 @@ buildRpm { | ||
89 | permissionGroup pkgUser | 92 | permissionGroup pkgUser |
90 | 93 | ||
91 | // Copy the system unit files | 94 | // Copy the system unit files |
92 | - from("${buildDir}/control/${pkgName}.service") { | 95 | + from("${buildDir}/control/template.service") { |
93 | addParentDirs = false | 96 | addParentDirs = false |
94 | fileMode 0644 | 97 | fileMode 0644 |
95 | into "/usr/lib/systemd/system" | 98 | into "/usr/lib/systemd/system" |
99 | + rename { String filename -> | ||
100 | + "${pkgName}.service" | ||
101 | + } | ||
96 | } | 102 | } |
97 | 103 | ||
98 | - directory(pkgLogFolder, 0755) | ||
99 | link("/etc/${pkgName}/conf", "${pkgInstallFolder}/conf") | 104 | link("/etc/${pkgName}/conf", "${pkgInstallFolder}/conf") |
100 | } | 105 | } |
101 | 106 | ||
@@ -104,7 +109,7 @@ buildDeb { | @@ -104,7 +109,7 @@ buildDeb { | ||
104 | 109 | ||
105 | arch = "amd64" | 110 | arch = "amd64" |
106 | 111 | ||
107 | - archiveName = "${pkgName}.deb" | 112 | + archiveFileName = "${pkgName}.deb" |
108 | 113 | ||
109 | configurationFile("${pkgInstallFolder}/conf/${pkgName}.conf") | 114 | configurationFile("${pkgInstallFolder}/conf/${pkgName}.conf") |
110 | configurationFile("${pkgInstallFolder}/conf/custom-environment-variables.yml") | 115 | configurationFile("${pkgInstallFolder}/conf/custom-environment-variables.yml") |
@@ -119,7 +124,35 @@ buildDeb { | @@ -119,7 +124,35 @@ buildDeb { | ||
119 | user pkgUser | 124 | user pkgUser |
120 | permissionGroup pkgUser | 125 | permissionGroup pkgUser |
121 | 126 | ||
122 | - directory(pkgLogFolder, 0755) | ||
123 | - link("/etc/init.d/${pkgName}", "${pkgInstallFolder}/init/${pkgName}") | 127 | + // Copy the system unit files |
128 | + from("${buildDir}/control/template.service") { | ||
129 | + addParentDirs = false | ||
130 | + fileMode 0644 | ||
131 | + into "/lib/systemd/system" | ||
132 | + rename { String filename -> | ||
133 | + "${pkgName}.service" | ||
134 | + } | ||
135 | + } | ||
136 | + | ||
124 | link("/etc/${pkgName}/conf", "${pkgInstallFolder}/conf") | 137 | link("/etc/${pkgName}/conf", "${pkgInstallFolder}/conf") |
125 | } | 138 | } |
139 | + | ||
140 | +task renameDeb(type: Copy) { | ||
141 | + from("${buildDir}/") { | ||
142 | + include '*.deb' | ||
143 | + destinationDir file("${buildDir}/") | ||
144 | + rename { String filename -> | ||
145 | + "${pkgName}.deb" | ||
146 | + } | ||
147 | + } | ||
148 | +} | ||
149 | + | ||
150 | +task renameRpm(type: Copy) { | ||
151 | + from("${buildDir}/") { | ||
152 | + include '*.rpm' | ||
153 | + destinationDir file("${buildDir}/") | ||
154 | + rename { String filename -> | ||
155 | + "${pkgName}.rpm" | ||
156 | + } | ||
157 | + } | ||
158 | +} |
packaging/js/filters/unix.properties
renamed from
msa/js-executor/src/main/filters/unix.properties
packaging/js/filters/windows.properties
renamed from
msa/js-executor/src/main/filters/windows.properties
packaging/js/scripts/control/deb/postinst
renamed from
msa/js-executor/src/main/scripts/control/deb/postinst
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | +mkdir -m 0755 -p ${pkg.logFolder} | ||
3 | chown -R ${pkg.user}: ${pkg.logFolder} | 4 | chown -R ${pkg.user}: ${pkg.logFolder} |
4 | chown -R ${pkg.user}: ${pkg.installFolder} | 5 | chown -R ${pkg.user}: ${pkg.installFolder} |
5 | -update-rc.d ${pkg.name} defaults | 6 | + |
7 | +systemctl --no-reload enable ${pkg.name}.service >/dev/null 2>&1 || : | ||
6 | 8 |
packaging/js/scripts/control/deb/postrm
0 → 100644
packaging/js/scripts/control/deb/preinst
renamed from
msa/js-executor/src/main/scripts/control/deb/preinst
packaging/js/scripts/control/deb/prerm
renamed from
msa/js-executor/src/main/scripts/control/deb/prerm
packaging/js/scripts/control/rpm/postinst
renamed from
msa/js-executor/src/main/scripts/control/rpm/postinst
packaging/js/scripts/control/rpm/postrm
renamed from
msa/js-executor/src/main/scripts/control/rpm/postrm
packaging/js/scripts/control/rpm/preinst
renamed from
msa/js-executor/src/main/scripts/control/rpm/preinst
packaging/js/scripts/control/rpm/prerm
renamed from
msa/js-executor/src/main/scripts/control/rpm/prerm
packaging/js/scripts/control/template.service
renamed from
msa/js-executor/src/main/scripts/control/tb-js-executor.service
packaging/js/scripts/init/template
renamed from
msa/js-executor/src/main/scripts/init/tb-js-executor
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | 3 | ||
4 | 4 | ||
5 | ### BEGIN INIT INFO | 5 | ### BEGIN INIT INFO |
6 | -# Provides: tb-js-executor | 6 | +# Provides: ${pkg.name} |
7 | # Required-Start: $remote_fs $syslog $network | 7 | # Required-Start: $remote_fs $syslog $network |
8 | # Required-Stop: $remote_fs $syslog $network | 8 | # Required-Stop: $remote_fs $syslog $network |
9 | # Default-Start: 2 3 4 5 | 9 | # Default-Start: 2 3 4 5 |
packaging/js/scripts/windows/install.bat
renamed from
msa/js-executor/src/main/scripts/windows/install.bat
packaging/js/scripts/windows/service.xml
renamed from
msa/web-ui/src/main/scripts/windows/service.xml
packaging/js/scripts/windows/uninstall.bat
renamed from
msa/js-executor/src/main/scripts/windows/uninstall.bat
@@ -29,7 +29,13 @@ | @@ -29,7 +29,13 @@ | ||
29 | 29 | ||
30 | <properties> | 30 | <properties> |
31 | <main.dir>${basedir}</main.dir> | 31 | <main.dir>${basedir}</main.dir> |
32 | + <pkg.disabled>true</pkg.disabled> | ||
33 | + <pkg.process-resources.phase>none</pkg.process-resources.phase> | ||
34 | + <pkg.package.phase>none</pkg.package.phase> | ||
32 | <pkg.user>thingsboard</pkg.user> | 35 | <pkg.user>thingsboard</pkg.user> |
36 | + <pkg.implementationTitle>${project.name}</pkg.implementationTitle> | ||
37 | + <pkg.unixLogFolder>/var/log/${pkg.name}</pkg.unixLogFolder> | ||
38 | + <pkg.installFolder>/usr/share/${pkg.name}</pkg.installFolder> | ||
33 | <spring-boot.version>2.2.6.RELEASE</spring-boot.version> | 39 | <spring-boot.version>2.2.6.RELEASE</spring-boot.version> |
34 | <spring-oauth2.version>2.1.2.RELEASE</spring-oauth2.version> | 40 | <spring-oauth2.version>2.1.2.RELEASE</spring-oauth2.version> |
35 | <spring.version>5.2.6.RELEASE</spring.version> | 41 | <spring.version>5.2.6.RELEASE</spring.version> |
@@ -132,6 +138,394 @@ | @@ -132,6 +138,394 @@ | ||
132 | <downloadJavadocs>true</downloadJavadocs> | 138 | <downloadJavadocs>true</downloadJavadocs> |
133 | </properties> | 139 | </properties> |
134 | </profile> | 140 | </profile> |
141 | + | ||
142 | + <profile> | ||
143 | + <id>packaging</id> | ||
144 | + <activation> | ||
145 | + <activeByDefault>true</activeByDefault> | ||
146 | + </activation> | ||
147 | + <build> | ||
148 | + <pluginManagement> | ||
149 | + <plugins> | ||
150 | + <plugin> | ||
151 | + <groupId>org.apache.maven.plugins</groupId> | ||
152 | + <artifactId>maven-resources-plugin</artifactId> | ||
153 | + <executions> | ||
154 | + <execution> | ||
155 | + <id>copy-conf</id> | ||
156 | + <phase>${pkg.process-resources.phase}</phase> | ||
157 | + <goals> | ||
158 | + <goal>copy-resources</goal> | ||
159 | + </goals> | ||
160 | + <configuration> | ||
161 | + <outputDirectory>${project.build.directory}/conf</outputDirectory> | ||
162 | + <resources> | ||
163 | + <resource> | ||
164 | + <directory>src/main/resources</directory> | ||
165 | + <excludes> | ||
166 | + <exclude>logback.xml</exclude> | ||
167 | + </excludes> | ||
168 | + <filtering>false</filtering> | ||
169 | + </resource> | ||
170 | + </resources> | ||
171 | + </configuration> | ||
172 | + </execution> | ||
173 | + <execution> | ||
174 | + <id>copy-service-conf</id> | ||
175 | + <phase>${pkg.process-resources.phase}</phase> | ||
176 | + <goals> | ||
177 | + <goal>copy-resources</goal> | ||
178 | + </goals> | ||
179 | + <configuration> | ||
180 | + <outputDirectory>${project.build.directory}/conf</outputDirectory> | ||
181 | + <resources> | ||
182 | + <resource> | ||
183 | + <directory>src/main/conf</directory> | ||
184 | + <filtering>true</filtering> | ||
185 | + </resource> | ||
186 | + </resources> | ||
187 | + <filters> | ||
188 | + <filter>${main.dir}/packaging/${pkg.type}/filters/unix.properties</filter> | ||
189 | + </filters> | ||
190 | + </configuration> | ||
191 | + </execution> | ||
192 | + <execution> | ||
193 | + <id>copy-linux-conf</id> | ||
194 | + <phase>${pkg.process-resources.phase}</phase> | ||
195 | + <goals> | ||
196 | + <goal>copy-resources</goal> | ||
197 | + </goals> | ||
198 | + <configuration> | ||
199 | + <outputDirectory>${pkg.linux.dist}/conf</outputDirectory> | ||
200 | + <resources> | ||
201 | + <resource> | ||
202 | + <directory>config</directory> | ||
203 | + <filtering>true</filtering> | ||
204 | + </resource> | ||
205 | + </resources> | ||
206 | + <filters> | ||
207 | + <filter>${main.dir}/packaging/${pkg.type}/filters/unix.properties</filter> | ||
208 | + </filters> | ||
209 | + </configuration> | ||
210 | + </execution> | ||
211 | + <execution> | ||
212 | + <id>copy-linux-init</id> | ||
213 | + <phase>${pkg.process-resources.phase}</phase> | ||
214 | + <goals> | ||
215 | + <goal>copy-resources</goal> | ||
216 | + </goals> | ||
217 | + <configuration> | ||
218 | + <outputDirectory>${pkg.linux.dist}/init</outputDirectory> | ||
219 | + <resources> | ||
220 | + <resource> | ||
221 | + <directory>${main.dir}/packaging/${pkg.type}/scripts/init</directory> | ||
222 | + <filtering>true</filtering> | ||
223 | + </resource> | ||
224 | + </resources> | ||
225 | + <filters> | ||
226 | + <filter>${main.dir}/packaging/${pkg.type}/filters/unix.properties</filter> | ||
227 | + </filters> | ||
228 | + </configuration> | ||
229 | + </execution> | ||
230 | + <execution> | ||
231 | + <id>copy-win-conf</id> | ||
232 | + <phase>${pkg.process-resources.phase}</phase> | ||
233 | + <goals> | ||
234 | + <goal>copy-resources</goal> | ||
235 | + </goals> | ||
236 | + <configuration> | ||
237 | + <outputDirectory>${pkg.win.dist}/conf</outputDirectory> | ||
238 | + <resources> | ||
239 | + <resource> | ||
240 | + <directory>src/main/resources</directory> | ||
241 | + <excludes> | ||
242 | + <exclude>logback.xml</exclude> | ||
243 | + </excludes> | ||
244 | + <filtering>false</filtering> | ||
245 | + </resource> | ||
246 | + <resource> | ||
247 | + <directory>src/main/conf</directory> | ||
248 | + <excludes> | ||
249 | + <exclude>${pkg.name}.conf</exclude> | ||
250 | + </excludes> | ||
251 | + <filtering>true</filtering> | ||
252 | + </resource> | ||
253 | + </resources> | ||
254 | + <filters> | ||
255 | + <filter>${main.dir}/packaging/${pkg.type}/filters/windows.properties</filter> | ||
256 | + </filters> | ||
257 | + </configuration> | ||
258 | + </execution> | ||
259 | + <execution> | ||
260 | + <id>copy-control</id> | ||
261 | + <phase>${pkg.process-resources.phase}</phase> | ||
262 | + <goals> | ||
263 | + <goal>copy-resources</goal> | ||
264 | + </goals> | ||
265 | + <configuration> | ||
266 | + <outputDirectory>${project.build.directory}/control</outputDirectory> | ||
267 | + <resources> | ||
268 | + <resource> | ||
269 | + <directory>${main.dir}/packaging/${pkg.type}/scripts/control</directory> | ||
270 | + <filtering>true</filtering> | ||
271 | + </resource> | ||
272 | + </resources> | ||
273 | + <filters> | ||
274 | + <filter>${main.dir}/packaging/${pkg.type}/filters/unix.properties</filter> | ||
275 | + </filters> | ||
276 | + </configuration> | ||
277 | + </execution> | ||
278 | + <execution> | ||
279 | + <id>copy-install</id> | ||
280 | + <phase>${pkg.process-resources.phase}</phase> | ||
281 | + <goals> | ||
282 | + <goal>copy-resources</goal> | ||
283 | + </goals> | ||
284 | + <configuration> | ||
285 | + <outputDirectory>${project.build.directory}/bin/install</outputDirectory> | ||
286 | + <resources> | ||
287 | + <resource> | ||
288 | + <directory>${main.dir}/packaging/${pkg.type}/scripts/install</directory> | ||
289 | + <includes> | ||
290 | + <include>**/*.sh</include> | ||
291 | + <include>**/*.xml</include> | ||
292 | + </includes> | ||
293 | + <filtering>true</filtering> | ||
294 | + </resource> | ||
295 | + </resources> | ||
296 | + <filters> | ||
297 | + <filter>${main.dir}/packaging/${pkg.type}/filters/unix.properties</filter> | ||
298 | + </filters> | ||
299 | + </configuration> | ||
300 | + </execution> | ||
301 | + <execution> | ||
302 | + <id>copy-windows-control</id> | ||
303 | + <phase>${pkg.process-resources.phase}</phase> | ||
304 | + <goals> | ||
305 | + <goal>copy-resources</goal> | ||
306 | + </goals> | ||
307 | + <configuration> | ||
308 | + <outputDirectory>${pkg.win.dist}</outputDirectory> | ||
309 | + <resources> | ||
310 | + <resource> | ||
311 | + <directory>${main.dir}/packaging/${pkg.type}/scripts/windows</directory> | ||
312 | + <filtering>true</filtering> | ||
313 | + </resource> | ||
314 | + </resources> | ||
315 | + <filters> | ||
316 | + <filter>${main.dir}/packaging/${pkg.type}/filters/windows.properties</filter> | ||
317 | + </filters> | ||
318 | + </configuration> | ||
319 | + </execution> | ||
320 | + <execution> | ||
321 | + <id>copy-windows-install</id> | ||
322 | + <phase>${pkg.process-resources.phase}</phase> | ||
323 | + <goals> | ||
324 | + <goal>copy-resources</goal> | ||
325 | + </goals> | ||
326 | + <configuration> | ||
327 | + <outputDirectory>${pkg.win.dist}/install</outputDirectory> | ||
328 | + <resources> | ||
329 | + <resource> | ||
330 | + <directory>${main.dir}/packaging/${pkg.type}/scripts/install</directory> | ||
331 | + <includes> | ||
332 | + <include>logback.xml</include> | ||
333 | + </includes> | ||
334 | + <filtering>true</filtering> | ||
335 | + </resource> | ||
336 | + </resources> | ||
337 | + <filters> | ||
338 | + <filter>${main.dir}/packaging/${pkg.type}/filters/windows.properties</filter> | ||
339 | + </filters> | ||
340 | + </configuration> | ||
341 | + </execution> | ||
342 | + <execution> | ||
343 | + <id>copy-data</id> | ||
344 | + <phase>${pkg.process-resources.phase}</phase> | ||
345 | + <goals> | ||
346 | + <goal>copy-resources</goal> | ||
347 | + </goals> | ||
348 | + <configuration> | ||
349 | + <outputDirectory>${project.build.directory}/data</outputDirectory> | ||
350 | + <resources> | ||
351 | + <resource> | ||
352 | + <directory>src/main/data</directory> | ||
353 | + </resource> | ||
354 | + <resource> | ||
355 | + <directory>../dao/src/main/resources</directory> | ||
356 | + <includes> | ||
357 | + <include>**/*.cql</include> | ||
358 | + <include>**/*.sql</include> | ||
359 | + </includes> | ||
360 | + <filtering>false</filtering> | ||
361 | + </resource> | ||
362 | + </resources> | ||
363 | + </configuration> | ||
364 | + </execution> | ||
365 | + <execution> | ||
366 | + <id>copy-docker-config</id> | ||
367 | + <phase>${pkg.process-resources.phase}</phase> | ||
368 | + <goals> | ||
369 | + <goal>copy-resources</goal> | ||
370 | + </goals> | ||
371 | + <configuration> | ||
372 | + <outputDirectory>${project.build.directory}</outputDirectory> | ||
373 | + <resources> | ||
374 | + <resource> | ||
375 | + <directory>docker</directory> | ||
376 | + <filtering>true</filtering> | ||
377 | + </resource> | ||
378 | + </resources> | ||
379 | + </configuration> | ||
380 | + </execution> | ||
381 | + </executions> | ||
382 | + </plugin> | ||
383 | + <plugin> | ||
384 | + <groupId>org.apache.maven.plugins</groupId> | ||
385 | + <artifactId>maven-dependency-plugin</artifactId> | ||
386 | + <executions> | ||
387 | + <execution> | ||
388 | + <id>copy-winsw-service</id> | ||
389 | + <phase>${pkg.package.phase}</phase> | ||
390 | + <goals> | ||
391 | + <goal>copy</goal> | ||
392 | + </goals> | ||
393 | + <configuration> | ||
394 | + <artifactItems> | ||
395 | + <artifactItem> | ||
396 | + <groupId>com.sun.winsw</groupId> | ||
397 | + <artifactId>winsw</artifactId> | ||
398 | + <classifier>bin</classifier> | ||
399 | + <type>exe</type> | ||
400 | + <destFileName>service.exe</destFileName> | ||
401 | + </artifactItem> | ||
402 | + </artifactItems> | ||
403 | + <outputDirectory>${pkg.win.dist}</outputDirectory> | ||
404 | + </configuration> | ||
405 | + </execution> | ||
406 | + </executions> | ||
407 | + </plugin> | ||
408 | + <plugin> | ||
409 | + <groupId>org.apache.maven.plugins</groupId> | ||
410 | + <artifactId>maven-jar-plugin</artifactId> | ||
411 | + <configuration> | ||
412 | + <excludes> | ||
413 | + <exclude>**/logback.xml</exclude> | ||
414 | + </excludes> | ||
415 | + <archive> | ||
416 | + <manifestEntries> | ||
417 | + <Implementation-Title>${pkg.implementationTitle}</Implementation-Title> | ||
418 | + <Implementation-Version>${project.version}</Implementation-Version> | ||
419 | + </manifestEntries> | ||
420 | + </archive> | ||
421 | + </configuration> | ||
422 | + </plugin> | ||
423 | + <plugin> | ||
424 | + <groupId>org.springframework.boot</groupId> | ||
425 | + <artifactId>spring-boot-maven-plugin</artifactId> | ||
426 | + <configuration> | ||
427 | + <skip>${pkg.disabled}</skip> | ||
428 | + <mainClass>${pkg.mainClass}</mainClass> | ||
429 | + <classifier>boot</classifier> | ||
430 | + <layout>ZIP</layout> | ||
431 | + <executable>true</executable> | ||
432 | + <excludeDevtools>true</excludeDevtools> | ||
433 | + <embeddedLaunchScriptProperties> | ||
434 | + <confFolder>${pkg.installFolder}/conf</confFolder> | ||
435 | + <logFolder>${pkg.unixLogFolder}</logFolder> | ||
436 | + <logFilename>${pkg.name}.out</logFilename> | ||
437 | + <initInfoProvides>${pkg.name}</initInfoProvides> | ||
438 | + </embeddedLaunchScriptProperties> | ||
439 | + </configuration> | ||
440 | + <executions> | ||
441 | + <execution> | ||
442 | + <goals> | ||
443 | + <goal>repackage</goal> | ||
444 | + </goals> | ||
445 | + </execution> | ||
446 | + </executions> | ||
447 | + </plugin> | ||
448 | + <plugin> | ||
449 | + <groupId>org.thingsboard</groupId> | ||
450 | + <artifactId>gradle-maven-plugin</artifactId> | ||
451 | + <configuration> | ||
452 | + <gradleProjectDirectory>${main.dir}/packaging/${pkg.type}</gradleProjectDirectory> | ||
453 | + <tasks> | ||
454 | + <task>build</task> | ||
455 | + <task>buildDeb</task> | ||
456 | + <task>buildRpm</task> | ||
457 | + <task>renameDeb</task> | ||
458 | + <task>renameRpm</task> | ||
459 | + </tasks> | ||
460 | + <args> | ||
461 | + <arg>-PpackagingDir=${main.dir}/packaging</arg> | ||
462 | + <arg>-PprojectBuildDir=${basedir}/target</arg> | ||
463 | + <arg>-PprojectVersion=${project.version}</arg> | ||
464 | + <arg> | ||
465 | + -PmainJar=${project.build.directory}/${project.build.finalName}-boot.${project.packaging} | ||
466 | + </arg> | ||
467 | + <arg>-PpkgName=${pkg.name}</arg> | ||
468 | + <arg>-PpkgUser=${pkg.user}</arg> | ||
469 | + <arg>-PpkgInstallFolder=${pkg.installFolder}</arg> | ||
470 | + <arg>-PpkgCopyInstallScripts=${pkg.copyInstallScripts}</arg> | ||
471 | + <arg>-PpkgLogFolder=${pkg.unixLogFolder}</arg> | ||
472 | + <arg>--warning-mode</arg> | ||
473 | + <arg>all</arg> | ||
474 | + </args> | ||
475 | + </configuration> | ||
476 | + <executions> | ||
477 | + <execution> | ||
478 | + <phase>${pkg.package.phase}</phase> | ||
479 | + <goals> | ||
480 | + <goal>invoke</goal> | ||
481 | + </goals> | ||
482 | + </execution> | ||
483 | + </executions> | ||
484 | + </plugin> | ||
485 | + <plugin> | ||
486 | + <groupId>org.apache.maven.plugins</groupId> | ||
487 | + <artifactId>maven-assembly-plugin</artifactId> | ||
488 | + <configuration> | ||
489 | + <finalName>${pkg.name}</finalName> | ||
490 | + <descriptors> | ||
491 | + <descriptor>${main.dir}/packaging/${pkg.type}/assembly/windows.xml</descriptor> | ||
492 | + </descriptors> | ||
493 | + </configuration> | ||
494 | + <executions> | ||
495 | + <execution> | ||
496 | + <id>assembly</id> | ||
497 | + <phase>${pkg.package.phase}</phase> | ||
498 | + <goals> | ||
499 | + <goal>single</goal> | ||
500 | + </goals> | ||
501 | + </execution> | ||
502 | + </executions> | ||
503 | + </plugin> | ||
504 | + <plugin> | ||
505 | + <groupId>org.apache.maven.plugins</groupId> | ||
506 | + <artifactId>maven-install-plugin</artifactId> | ||
507 | + <configuration> | ||
508 | + <file>${project.build.directory}/${pkg.name}.deb</file> | ||
509 | + <artifactId>${project.artifactId}</artifactId> | ||
510 | + <groupId>${project.groupId}</groupId> | ||
511 | + <version>${project.version}</version> | ||
512 | + <classifier>deb</classifier> | ||
513 | + <packaging>deb</packaging> | ||
514 | + </configuration> | ||
515 | + <executions> | ||
516 | + <execution> | ||
517 | + <id>install-deb</id> | ||
518 | + <phase>${pkg.package.phase}</phase> | ||
519 | + <goals> | ||
520 | + <goal>install-file</goal> | ||
521 | + </goals> | ||
522 | + </execution> | ||
523 | + </executions> | ||
524 | + </plugin> | ||
525 | + </plugins> | ||
526 | + </pluginManagement> | ||
527 | + </build> | ||
528 | + </profile> | ||
135 | </profiles> | 529 | </profiles> |
136 | 530 | ||
137 | <build> | 531 | <build> |
@@ -181,7 +575,7 @@ | @@ -181,7 +575,7 @@ | ||
181 | <plugin> | 575 | <plugin> |
182 | <groupId>org.thingsboard</groupId> | 576 | <groupId>org.thingsboard</groupId> |
183 | <artifactId>gradle-maven-plugin</artifactId> | 577 | <artifactId>gradle-maven-plugin</artifactId> |
184 | - <version>1.0.9</version> | 578 | + <version>1.0.10</version> |
185 | </plugin> | 579 | </plugin> |
186 | <plugin> | 580 | <plugin> |
187 | <groupId>org.apache.maven.plugins</groupId> | 581 | <groupId>org.apache.maven.plugins</groupId> |
@@ -320,6 +714,12 @@ | @@ -320,6 +714,12 @@ | ||
320 | <exclude>src/vendor/**</exclude> | 714 | <exclude>src/vendor/**</exclude> |
321 | <exclude>src/font/**</exclude> | 715 | <exclude>src/font/**</exclude> |
322 | <exclude>src/sh/**</exclude> | 716 | <exclude>src/sh/**</exclude> |
717 | + <exclude>packaging/*/scripts/control/**</exclude> | ||
718 | + <exclude>packaging/*/scripts/windows/**</exclude> | ||
719 | + <exclude>packaging/*/scripts/init/**</exclude> | ||
720 | + <exclude>**/*.log</exclude> | ||
721 | + <exclude>**/*.current</exclude> | ||
722 | + <exclude>.instance_id</exclude> | ||
323 | <exclude>src/main/scripts/control/**</exclude> | 723 | <exclude>src/main/scripts/control/**</exclude> |
324 | <exclude>src/main/scripts/windows/**</exclude> | 724 | <exclude>src/main/scripts/windows/**</exclude> |
325 | <exclude>src/main/resources/public/static/rulenode/**</exclude> | 725 | <exclude>src/main/resources/public/static/rulenode/**</exclude> |
@@ -995,5 +1395,4 @@ | @@ -995,5 +1395,4 @@ | ||
995 | <url>https://oss.sonatype.org/content/groups/public</url> | 1395 | <url>https://oss.sonatype.org/content/groups/public</url> |
996 | </repository> | 1396 | </repository> |
997 | </repositories> | 1397 | </repositories> |
998 | - | ||
999 | </project> | 1398 | </project> |
@@ -159,31 +159,6 @@ | @@ -159,31 +159,6 @@ | ||
159 | <groupId>org.codehaus.mojo</groupId> | 159 | <groupId>org.codehaus.mojo</groupId> |
160 | <artifactId>build-helper-maven-plugin</artifactId> | 160 | <artifactId>build-helper-maven-plugin</artifactId> |
161 | </plugin> | 161 | </plugin> |
162 | - <plugin> | ||
163 | - <groupId>org.springframework.boot</groupId> | ||
164 | - <artifactId>spring-boot-maven-plugin</artifactId> | ||
165 | - <configuration> | ||
166 | - <mainClass>org.thingsboard.server.dao.queue.QueueBenchmark</mainClass> | ||
167 | - <classifier>boot</classifier> | ||
168 | - <layout>ZIP</layout> | ||
169 | - <executable>true</executable> | ||
170 | - <excludeDevtools>true</excludeDevtools> | ||
171 | - <!--<embeddedLaunchScriptProperties>--> | ||
172 | - <!--<confFolder>${pkg.installFolder}/conf</confFolder>--> | ||
173 | - <!--<logFolder>${pkg.unixLogFolder}</logFolder>--> | ||
174 | - <!--<logFilename>${pkg.name}.out</logFilename>--> | ||
175 | - <!--<initInfoProvides>${pkg.name}</initInfoProvides>--> | ||
176 | - <!--</embeddedLaunchScriptProperties>--> | ||
177 | - </configuration> | ||
178 | - <executions> | ||
179 | - <execution> | ||
180 | - <goals> | ||
181 | - <goal>repackage</goal> | ||
182 | - </goals> | ||
183 | - </execution> | ||
184 | - </executions> | ||
185 | - </plugin> | ||
186 | - | ||
187 | </plugins> | 162 | </plugins> |
188 | </build> | 163 | </build> |
189 | 164 |
@@ -70,7 +70,7 @@ public class TbMsgTimeseriesNode implements TbNode { | @@ -70,7 +70,7 @@ public class TbMsgTimeseriesNode implements TbNode { | ||
70 | } catch (NumberFormatException e) { | 70 | } catch (NumberFormatException e) { |
71 | } | 71 | } |
72 | } else { | 72 | } else { |
73 | - ts = System.currentTimeMillis(); | 73 | + ts = msg.getTs(); |
74 | } | 74 | } |
75 | String src = msg.getData(); | 75 | String src = msg.getData(); |
76 | Map<Long, List<KvEntry>> tsKvMap = JsonConverter.convertToTelemetry(new JsonParser().parse(src), ts); | 76 | Map<Long, List<KvEntry>> tsKvMap = JsonConverter.convertToTelemetry(new JsonParser().parse(src), ts); |
transport/coap/build.gradle
deleted
100644 → 0
1 | -/** | ||
2 | - * Copyright © 2016-2020 The Thingsboard Authors | ||
3 | - * | ||
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | - * you may not use this file except in compliance with the License. | ||
6 | - * You may obtain a copy of the License at | ||
7 | - * | ||
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | - * | ||
10 | - * Unless required by applicable law or agreed to in writing, software | ||
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | - * See the License for the specific language governing permissions and | ||
14 | - * limitations under the License. | ||
15 | - */ | ||
16 | -import org.apache.tools.ant.filters.ReplaceTokens | ||
17 | - | ||
18 | -buildscript { | ||
19 | - ext { | ||
20 | - osPackageVersion = "3.8.0" | ||
21 | - } | ||
22 | - repositories { | ||
23 | - jcenter() | ||
24 | - } | ||
25 | - dependencies { | ||
26 | - classpath("com.netflix.nebula:gradle-ospackage-plugin:${osPackageVersion}") | ||
27 | - } | ||
28 | -} | ||
29 | - | ||
30 | -apply plugin: "nebula.ospackage" | ||
31 | - | ||
32 | -buildDir = projectBuildDir | ||
33 | -version = projectVersion | ||
34 | -distsDirName = "./" | ||
35 | - | ||
36 | -// OS Package plugin configuration | ||
37 | -ospackage { | ||
38 | - packageName = pkgName | ||
39 | - version = "${project.version}" | ||
40 | - release = 1 | ||
41 | - os = LINUX | ||
42 | - type = BINARY | ||
43 | - | ||
44 | - into pkgInstallFolder | ||
45 | - | ||
46 | - user pkgName | ||
47 | - permissionGroup pkgName | ||
48 | - | ||
49 | - // Copy the actual .jar file | ||
50 | - from(mainJar) { | ||
51 | - // Strip the version from the jar filename | ||
52 | - rename { String fileName -> | ||
53 | - "${pkgName}.jar" | ||
54 | - } | ||
55 | - fileMode 0500 | ||
56 | - into "bin" | ||
57 | - } | ||
58 | - | ||
59 | - // Copy the config files | ||
60 | - from("target/conf") { | ||
61 | - exclude "${pkgName}.conf" | ||
62 | - fileType CONFIG | NOREPLACE | ||
63 | - fileMode 0754 | ||
64 | - into "conf" | ||
65 | - } | ||
66 | - | ||
67 | -} | ||
68 | - | ||
69 | -// Configure our RPM build task | ||
70 | -buildRpm { | ||
71 | - | ||
72 | - arch = NOARCH | ||
73 | - | ||
74 | - version = projectVersion.replace('-', '') | ||
75 | - archiveName = "${pkgName}.rpm" | ||
76 | - | ||
77 | - requires("java-1.8.0") | ||
78 | - | ||
79 | - from("target/conf") { | ||
80 | - include "${pkgName}.conf" | ||
81 | - filter(ReplaceTokens, tokens: ['pkg.platform': 'rpm']) | ||
82 | - fileType CONFIG | NOREPLACE | ||
83 | - fileMode 0754 | ||
84 | - into "${pkgInstallFolder}/conf" | ||
85 | - } | ||
86 | - | ||
87 | - preInstall file("${buildDir}/control/rpm/preinst") | ||
88 | - postInstall file("${buildDir}/control/rpm/postinst") | ||
89 | - preUninstall file("${buildDir}/control/rpm/prerm") | ||
90 | - postUninstall file("${buildDir}/control/rpm/postrm") | ||
91 | - | ||
92 | - user pkgName | ||
93 | - permissionGroup pkgName | ||
94 | - | ||
95 | - // Copy the system unit files | ||
96 | - from("${buildDir}/control/${pkgName}.service") { | ||
97 | - addParentDirs = false | ||
98 | - fileMode 0644 | ||
99 | - into "/usr/lib/systemd/system" | ||
100 | - } | ||
101 | - | ||
102 | - directory(pkgLogFolder, 0755) | ||
103 | - link("${pkgInstallFolder}/bin/${pkgName}.yml", "${pkgInstallFolder}/conf/${pkgName}.yml") | ||
104 | - link("/etc/${pkgName}/conf", "${pkgInstallFolder}/conf") | ||
105 | -} | ||
106 | - | ||
107 | -// Same as the buildRpm task | ||
108 | -buildDeb { | ||
109 | - | ||
110 | - arch = "all" | ||
111 | - | ||
112 | - archiveName = "${pkgName}.deb" | ||
113 | - | ||
114 | - requires("openjdk-8-jre").or("java8-runtime").or("oracle-java8-installer").or("openjdk-8-jre-headless") | ||
115 | - | ||
116 | - from("target/conf") { | ||
117 | - include "${pkgName}.conf" | ||
118 | - filter(ReplaceTokens, tokens: ['pkg.platform': 'deb']) | ||
119 | - fileType CONFIG | NOREPLACE | ||
120 | - fileMode 0754 | ||
121 | - into "${pkgInstallFolder}/conf" | ||
122 | - } | ||
123 | - | ||
124 | - configurationFile("${pkgInstallFolder}/conf/${pkgName}.conf") | ||
125 | - configurationFile("${pkgInstallFolder}/conf/${pkgName}.yml") | ||
126 | - configurationFile("${pkgInstallFolder}/conf/logback.xml") | ||
127 | - | ||
128 | - preInstall file("${buildDir}/control/deb/preinst") | ||
129 | - postInstall file("${buildDir}/control/deb/postinst") | ||
130 | - preUninstall file("${buildDir}/control/deb/prerm") | ||
131 | - postUninstall file("${buildDir}/control/deb/postrm") | ||
132 | - | ||
133 | - user pkgName | ||
134 | - permissionGroup pkgName | ||
135 | - | ||
136 | - directory(pkgLogFolder, 0755) | ||
137 | - link("/etc/init.d/${pkgName}", "${pkgInstallFolder}/bin/${pkgName}.jar") | ||
138 | - link("${pkgInstallFolder}/bin/${pkgName}.yml", "${pkgInstallFolder}/conf/${pkgName}.yml") | ||
139 | - link("/etc/${pkgName}/conf", "${pkgInstallFolder}/conf") | ||
140 | -} |
@@ -33,10 +33,15 @@ | @@ -33,10 +33,15 @@ | ||
33 | <properties> | 33 | <properties> |
34 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | 34 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
35 | <main.dir>${basedir}/../..</main.dir> | 35 | <main.dir>${basedir}/../..</main.dir> |
36 | + <pkg.type>java</pkg.type> | ||
37 | + <pkg.disabled>false</pkg.disabled> | ||
38 | + <pkg.process-resources.phase>process-resources</pkg.process-resources.phase> | ||
39 | + <pkg.package.phase>package</pkg.package.phase> | ||
36 | <pkg.name>tb-coap-transport</pkg.name> | 40 | <pkg.name>tb-coap-transport</pkg.name> |
37 | - <pkg.unixLogFolder>/var/log/${pkg.name}</pkg.unixLogFolder> | ||
38 | - <pkg.installFolder>/usr/share/${pkg.name}</pkg.installFolder> | 41 | + <pkg.copyInstallScripts>false</pkg.copyInstallScripts> |
39 | <pkg.win.dist>${project.build.directory}/windows</pkg.win.dist> | 42 | <pkg.win.dist>${project.build.directory}/windows</pkg.win.dist> |
43 | + <pkg.implementationTitle>ThingsBoard CoAP Transport Service</pkg.implementationTitle> | ||
44 | + <pkg.mainClass>org.thingsboard.server.coap.ThingsboardCoapTransportApplication</pkg.mainClass> | ||
40 | </properties> | 45 | </properties> |
41 | 46 | ||
42 | <dependencies> | 47 | <dependencies> |
@@ -87,244 +92,30 @@ | @@ -87,244 +92,30 @@ | ||
87 | <plugin> | 92 | <plugin> |
88 | <groupId>org.apache.maven.plugins</groupId> | 93 | <groupId>org.apache.maven.plugins</groupId> |
89 | <artifactId>maven-resources-plugin</artifactId> | 94 | <artifactId>maven-resources-plugin</artifactId> |
90 | - <executions> | ||
91 | - <execution> | ||
92 | - <id>copy-conf</id> | ||
93 | - <phase>process-resources</phase> | ||
94 | - <goals> | ||
95 | - <goal>copy-resources</goal> | ||
96 | - </goals> | ||
97 | - <configuration> | ||
98 | - <outputDirectory>${project.build.directory}/conf</outputDirectory> | ||
99 | - <resources> | ||
100 | - <resource> | ||
101 | - <directory>src/main/resources</directory> | ||
102 | - <excludes> | ||
103 | - <exclude>logback.xml</exclude> | ||
104 | - </excludes> | ||
105 | - <filtering>false</filtering> | ||
106 | - </resource> | ||
107 | - </resources> | ||
108 | - </configuration> | ||
109 | - </execution> | ||
110 | - <execution> | ||
111 | - <id>copy-service-conf</id> | ||
112 | - <phase>process-resources</phase> | ||
113 | - <goals> | ||
114 | - <goal>copy-resources</goal> | ||
115 | - </goals> | ||
116 | - <configuration> | ||
117 | - <outputDirectory>${project.build.directory}/conf</outputDirectory> | ||
118 | - <resources> | ||
119 | - <resource> | ||
120 | - <directory>src/main/conf</directory> | ||
121 | - <filtering>true</filtering> | ||
122 | - </resource> | ||
123 | - </resources> | ||
124 | - <filters> | ||
125 | - <filter>src/main/filters/unix.properties</filter> | ||
126 | - </filters> | ||
127 | - </configuration> | ||
128 | - </execution> | ||
129 | - <execution> | ||
130 | - <id>copy-win-conf</id> | ||
131 | - <phase>process-resources</phase> | ||
132 | - <goals> | ||
133 | - <goal>copy-resources</goal> | ||
134 | - </goals> | ||
135 | - <configuration> | ||
136 | - <outputDirectory>${pkg.win.dist}/conf</outputDirectory> | ||
137 | - <resources> | ||
138 | - <resource> | ||
139 | - <directory>src/main/resources</directory> | ||
140 | - <excludes> | ||
141 | - <exclude>logback.xml</exclude> | ||
142 | - </excludes> | ||
143 | - <filtering>false</filtering> | ||
144 | - </resource> | ||
145 | - <resource> | ||
146 | - <directory>src/main/conf</directory> | ||
147 | - <excludes> | ||
148 | - <exclude>tb-coap-transport.conf</exclude> | ||
149 | - </excludes> | ||
150 | - <filtering>true</filtering> | ||
151 | - </resource> | ||
152 | - </resources> | ||
153 | - <filters> | ||
154 | - <filter>src/main/filters/windows.properties</filter> | ||
155 | - </filters> | ||
156 | - </configuration> | ||
157 | - </execution> | ||
158 | - <execution> | ||
159 | - <id>copy-control</id> | ||
160 | - <phase>process-resources</phase> | ||
161 | - <goals> | ||
162 | - <goal>copy-resources</goal> | ||
163 | - </goals> | ||
164 | - <configuration> | ||
165 | - <outputDirectory>${project.build.directory}/control</outputDirectory> | ||
166 | - <resources> | ||
167 | - <resource> | ||
168 | - <directory>src/main/scripts/control</directory> | ||
169 | - <filtering>true</filtering> | ||
170 | - </resource> | ||
171 | - </resources> | ||
172 | - <filters> | ||
173 | - <filter>src/main/filters/unix.properties</filter> | ||
174 | - </filters> | ||
175 | - </configuration> | ||
176 | - </execution> | ||
177 | - <execution> | ||
178 | - <id>copy-windows-control</id> | ||
179 | - <phase>process-resources</phase> | ||
180 | - <goals> | ||
181 | - <goal>copy-resources</goal> | ||
182 | - </goals> | ||
183 | - <configuration> | ||
184 | - <outputDirectory>${pkg.win.dist}</outputDirectory> | ||
185 | - <resources> | ||
186 | - <resource> | ||
187 | - <directory>src/main/scripts/windows</directory> | ||
188 | - <filtering>true</filtering> | ||
189 | - </resource> | ||
190 | - </resources> | ||
191 | - <filters> | ||
192 | - <filter>src/main/filters/windows.properties</filter> | ||
193 | - </filters> | ||
194 | - </configuration> | ||
195 | - </execution> | ||
196 | - </executions> | ||
197 | </plugin> | 95 | </plugin> |
198 | <plugin> | 96 | <plugin> |
199 | <groupId>org.apache.maven.plugins</groupId> | 97 | <groupId>org.apache.maven.plugins</groupId> |
200 | <artifactId>maven-dependency-plugin</artifactId> | 98 | <artifactId>maven-dependency-plugin</artifactId> |
201 | - <executions> | ||
202 | - <execution> | ||
203 | - <id>copy-winsw-service</id> | ||
204 | - <phase>package</phase> | ||
205 | - <goals> | ||
206 | - <goal>copy</goal> | ||
207 | - </goals> | ||
208 | - <configuration> | ||
209 | - <artifactItems> | ||
210 | - <artifactItem> | ||
211 | - <groupId>com.sun.winsw</groupId> | ||
212 | - <artifactId>winsw</artifactId> | ||
213 | - <classifier>bin</classifier> | ||
214 | - <type>exe</type> | ||
215 | - <destFileName>service.exe</destFileName> | ||
216 | - </artifactItem> | ||
217 | - </artifactItems> | ||
218 | - <outputDirectory>${pkg.win.dist}</outputDirectory> | ||
219 | - </configuration> | ||
220 | - </execution> | ||
221 | - </executions> | ||
222 | </plugin> | 99 | </plugin> |
223 | <plugin> | 100 | <plugin> |
224 | <groupId>org.apache.maven.plugins</groupId> | 101 | <groupId>org.apache.maven.plugins</groupId> |
225 | <artifactId>maven-jar-plugin</artifactId> | 102 | <artifactId>maven-jar-plugin</artifactId> |
226 | - <configuration> | ||
227 | - <excludes> | ||
228 | - <exclude>**/logback.xml</exclude> | ||
229 | - </excludes> | ||
230 | - <archive> | ||
231 | - <manifestEntries> | ||
232 | - <Implementation-Title>ThingsBoard CoAP Transport Service</Implementation-Title> | ||
233 | - <Implementation-Version>${project.version}</Implementation-Version> | ||
234 | - </manifestEntries> | ||
235 | - </archive> | ||
236 | - </configuration> | ||
237 | </plugin> | 103 | </plugin> |
238 | <plugin> | 104 | <plugin> |
239 | <groupId>org.springframework.boot</groupId> | 105 | <groupId>org.springframework.boot</groupId> |
240 | <artifactId>spring-boot-maven-plugin</artifactId> | 106 | <artifactId>spring-boot-maven-plugin</artifactId> |
241 | - <configuration> | ||
242 | - <mainClass>org.thingsboard.server.coap.ThingsboardCoapTransportApplication</mainClass> | ||
243 | - <classifier>boot</classifier> | ||
244 | - <layout>ZIP</layout> | ||
245 | - <executable>true</executable> | ||
246 | - <excludeDevtools>true</excludeDevtools> | ||
247 | - <embeddedLaunchScriptProperties> | ||
248 | - <confFolder>${pkg.installFolder}/conf</confFolder> | ||
249 | - <logFolder>${pkg.unixLogFolder}</logFolder> | ||
250 | - <logFilename>${pkg.name}.out</logFilename> | ||
251 | - <initInfoProvides>${pkg.name}</initInfoProvides> | ||
252 | - </embeddedLaunchScriptProperties> | ||
253 | - </configuration> | ||
254 | - <executions> | ||
255 | - <execution> | ||
256 | - <goals> | ||
257 | - <goal>repackage</goal> | ||
258 | - </goals> | ||
259 | - </execution> | ||
260 | - </executions> | ||
261 | </plugin> | 107 | </plugin> |
262 | <plugin> | 108 | <plugin> |
263 | <groupId>org.thingsboard</groupId> | 109 | <groupId>org.thingsboard</groupId> |
264 | <artifactId>gradle-maven-plugin</artifactId> | 110 | <artifactId>gradle-maven-plugin</artifactId> |
265 | - <configuration> | ||
266 | - <tasks> | ||
267 | - <task>build</task> | ||
268 | - <task>buildDeb</task> | ||
269 | - <task>buildRpm</task> | ||
270 | - </tasks> | ||
271 | - <args> | ||
272 | - <arg>-PprojectBuildDir=${project.build.directory}</arg> | ||
273 | - <arg>-PprojectVersion=${project.version}</arg> | ||
274 | - <arg>-PmainJar=${project.build.directory}/${project.build.finalName}-boot.${project.packaging}</arg> | ||
275 | - <arg>-PpkgName=${pkg.name}</arg> | ||
276 | - <arg>-PpkgInstallFolder=${pkg.installFolder}</arg> | ||
277 | - <arg>-PpkgLogFolder=${pkg.unixLogFolder}</arg> | ||
278 | - </args> | ||
279 | - </configuration> | ||
280 | - <executions> | ||
281 | - <execution> | ||
282 | - <phase>package</phase> | ||
283 | - <goals> | ||
284 | - <goal>invoke</goal> | ||
285 | - </goals> | ||
286 | - </execution> | ||
287 | - </executions> | ||
288 | </plugin> | 111 | </plugin> |
289 | <plugin> | 112 | <plugin> |
290 | <groupId>org.apache.maven.plugins</groupId> | 113 | <groupId>org.apache.maven.plugins</groupId> |
291 | <artifactId>maven-assembly-plugin</artifactId> | 114 | <artifactId>maven-assembly-plugin</artifactId> |
292 | - <configuration> | ||
293 | - <finalName>${pkg.name}</finalName> | ||
294 | - <descriptors> | ||
295 | - <descriptor>src/main/assembly/windows.xml</descriptor> | ||
296 | - </descriptors> | ||
297 | - </configuration> | ||
298 | - <executions> | ||
299 | - <execution> | ||
300 | - <id>assembly</id> | ||
301 | - <phase>package</phase> | ||
302 | - <goals> | ||
303 | - <goal>single</goal> | ||
304 | - </goals> | ||
305 | - </execution> | ||
306 | - </executions> | ||
307 | </plugin> | 115 | </plugin> |
308 | <plugin> | 116 | <plugin> |
309 | <groupId>org.apache.maven.plugins</groupId> | 117 | <groupId>org.apache.maven.plugins</groupId> |
310 | <artifactId>maven-install-plugin</artifactId> | 118 | <artifactId>maven-install-plugin</artifactId> |
311 | - <configuration> | ||
312 | - <file>${project.build.directory}/${pkg.name}.deb</file> | ||
313 | - <artifactId>${project.artifactId}</artifactId> | ||
314 | - <groupId>${project.groupId}</groupId> | ||
315 | - <version>${project.version}</version> | ||
316 | - <classifier>deb</classifier> | ||
317 | - <packaging>deb</packaging> | ||
318 | - </configuration> | ||
319 | - <executions> | ||
320 | - <execution> | ||
321 | - <id>install-deb</id> | ||
322 | - <phase>package</phase> | ||
323 | - <goals> | ||
324 | - <goal>install-file</goal> | ||
325 | - </goals> | ||
326 | - </execution> | ||
327 | - </executions> | ||
328 | </plugin> | 119 | </plugin> |
329 | </plugins> | 120 | </plugins> |
330 | </build> | 121 | </build> |
transport/coap/src/main/assembly/windows.xml
deleted
100644 → 0
1 | -<!-- | ||
2 | - | ||
3 | - Copyright © 2016-2020 The Thingsboard Authors | ||
4 | - | ||
5 | - Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | - you may not use this file except in compliance with the License. | ||
7 | - You may obtain a copy of the License at | ||
8 | - | ||
9 | - http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | - | ||
11 | - Unless required by applicable law or agreed to in writing, software | ||
12 | - distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | - See the License for the specific language governing permissions and | ||
15 | - limitations under the License. | ||
16 | - | ||
17 | ---> | ||
18 | -<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" | ||
19 | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
20 | - xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"> | ||
21 | - <id>windows</id> | ||
22 | - | ||
23 | - <formats> | ||
24 | - <format>zip</format> | ||
25 | - </formats> | ||
26 | - | ||
27 | - <!-- Workaround to create logs directory --> | ||
28 | - <fileSets> | ||
29 | - <fileSet> | ||
30 | - <directory>${pkg.win.dist}</directory> | ||
31 | - <outputDirectory>logs</outputDirectory> | ||
32 | - <excludes> | ||
33 | - <exclude>*/**</exclude> | ||
34 | - </excludes> | ||
35 | - </fileSet> | ||
36 | - <fileSet> | ||
37 | - <directory>${pkg.win.dist}/conf</directory> | ||
38 | - <outputDirectory>conf</outputDirectory> | ||
39 | - <lineEnding>windows</lineEnding> | ||
40 | - </fileSet> | ||
41 | - </fileSets> | ||
42 | - | ||
43 | - <files> | ||
44 | - <file> | ||
45 | - <source>${project.build.directory}/${project.build.finalName}-boot.${project.packaging}</source> | ||
46 | - <outputDirectory>lib</outputDirectory> | ||
47 | - <destName>${pkg.name}.jar</destName> | ||
48 | - </file> | ||
49 | - <file> | ||
50 | - <source>${pkg.win.dist}/service.exe</source> | ||
51 | - <outputDirectory/> | ||
52 | - <destName>${pkg.name}.exe</destName> | ||
53 | - </file> | ||
54 | - <file> | ||
55 | - <source>${pkg.win.dist}/service.xml</source> | ||
56 | - <outputDirectory/> | ||
57 | - <destName>${pkg.name}.xml</destName> | ||
58 | - <lineEnding>windows</lineEnding> | ||
59 | - </file> | ||
60 | - <file> | ||
61 | - <source>${pkg.win.dist}/install.bat</source> | ||
62 | - <outputDirectory/> | ||
63 | - <lineEnding>windows</lineEnding> | ||
64 | - </file> | ||
65 | - <file> | ||
66 | - <source>${pkg.win.dist}/uninstall.bat</source> | ||
67 | - <outputDirectory/> | ||
68 | - <lineEnding>windows</lineEnding> | ||
69 | - </file> | ||
70 | - </files> | ||
71 | -</assembly> |
transport/coap/src/main/filters/unix.properties
deleted
100644 → 0
1 | -pkg.logFolder=${pkg.unixLogFolder} |
transport/coap/src/main/filters/windows.properties
deleted
100644 → 0
transport/coap/src/main/scripts/control/deb/postinst
deleted
100644 → 0
transport/coap/src/main/scripts/control/deb/postrm
deleted
100644 → 0
transport/coap/src/main/scripts/control/deb/preinst
deleted
100644 → 0
1 | -#!/bin/sh | ||
2 | - | ||
3 | -if ! getent group ${pkg.user} >/dev/null; then | ||
4 | - addgroup --system ${pkg.user} | ||
5 | -fi | ||
6 | - | ||
7 | -if ! getent passwd ${pkg.user} >/dev/null; then | ||
8 | - adduser --quiet \ | ||
9 | - --system \ | ||
10 | - --ingroup ${pkg.user} \ | ||
11 | - --quiet \ | ||
12 | - --disabled-login \ | ||
13 | - --disabled-password \ | ||
14 | - --home ${pkg.installFolder} \ | ||
15 | - --no-create-home \ | ||
16 | - -gecos "Thingsboard application" \ | ||
17 | - ${pkg.user} | ||
18 | -fi |
transport/coap/src/main/scripts/control/deb/prerm
deleted
100644 → 0
transport/coap/src/main/scripts/control/rpm/postinst
deleted
100644 → 0
transport/coap/src/main/scripts/control/rpm/postrm
deleted
100644 → 0
transport/coap/src/main/scripts/control/rpm/preinst
deleted
100644 → 0
transport/coap/src/main/scripts/control/rpm/prerm
deleted
100644 → 0
transport/coap/src/main/scripts/control/tb-coap-transport.service
deleted
100644 → 0
transport/coap/src/main/scripts/windows/install.bat
deleted
100644 → 0
1 | -@ECHO OFF | ||
2 | - | ||
3 | -setlocal ENABLEEXTENSIONS | ||
4 | - | ||
5 | -@ECHO Detecting Java version installed. | ||
6 | -:CHECK_JAVA | ||
7 | -for /f tokens^=2-5^ delims^=.-_^" %%j in ('java -fullversion 2^>^&1') do set "jver=%%j%%k" | ||
8 | -@ECHO CurrentVersion %jver% | ||
9 | - | ||
10 | -if %jver% NEQ 18 GOTO JAVA_NOT_INSTALLED | ||
11 | - | ||
12 | -:JAVA_INSTALLED | ||
13 | - | ||
14 | -@ECHO Java 1.8 found! | ||
15 | -@ECHO Installing ${pkg.name} ... | ||
16 | - | ||
17 | -"%BASE%"${pkg.name}.exe install | ||
18 | - | ||
19 | -@ECHO ${pkg.name} installed successfully! | ||
20 | - | ||
21 | -GOTO END | ||
22 | - | ||
23 | -:JAVA_NOT_INSTALLED | ||
24 | -@ECHO Java 1.8 is not installed. Only Java 1.8 is supported | ||
25 | -@ECHO Please go to https://adoptopenjdk.net/index.html and install Java 1.8. Then retry installation. | ||
26 | -PAUSE | ||
27 | -GOTO END | ||
28 | - | ||
29 | -:END | ||
30 | - | ||
31 | - |
transport/coap/src/main/scripts/windows/service.xml
deleted
100644 → 0
1 | -<service> | ||
2 | - <id>${pkg.name}</id> | ||
3 | - <name>${project.name}</name> | ||
4 | - <description>${project.description}</description> | ||
5 | - <workingdirectory>%BASE%\conf</workingdirectory> | ||
6 | - <logpath>${pkg.winWrapperLogFolder}</logpath> | ||
7 | - <logmode>rotate</logmode> | ||
8 | - <env name="LOADER_PATH" value="%BASE%\conf" /> | ||
9 | - <executable>java</executable> | ||
10 | - <startargument>-Xloggc:%BASE%\logs\gc.log</startargument> | ||
11 | - <startargument>-XX:+HeapDumpOnOutOfMemoryError</startargument> | ||
12 | - <startargument>-XX:+PrintGCDetails</startargument> | ||
13 | - <startargument>-XX:+PrintGCDateStamps</startargument> | ||
14 | - <startargument>-XX:+PrintHeapAtGC</startargument> | ||
15 | - <startargument>-XX:+PrintTenuringDistribution</startargument> | ||
16 | - <startargument>-XX:+PrintGCApplicationStoppedTime</startargument> | ||
17 | - <startargument>-XX:+UseGCLogFileRotation</startargument> | ||
18 | - <startargument>-XX:NumberOfGCLogFiles=10</startargument> | ||
19 | - <startargument>-XX:GCLogFileSize=10M</startargument> | ||
20 | - <startargument>-XX:-UseBiasedLocking</startargument> | ||
21 | - <startargument>-XX:+UseTLAB</startargument> | ||
22 | - <startargument>-XX:+ResizeTLAB</startargument> | ||
23 | - <startargument>-XX:+PerfDisableSharedMem</startargument> | ||
24 | - <startargument>-XX:+UseCondCardMark</startargument> | ||
25 | - <startargument>-XX:CMSWaitDuration=10000</startargument> | ||
26 | - <startargument>-XX:+UseParNewGC</startargument> | ||
27 | - <startargument>-XX:+UseConcMarkSweepGC</startargument> | ||
28 | - <startargument>-XX:+CMSParallelRemarkEnabled</startargument> | ||
29 | - <startargument>-XX:+CMSParallelInitialMarkEnabled</startargument> | ||
30 | - <startargument>-XX:+CMSEdenChunksRecordAlways</startargument> | ||
31 | - <startargument>-XX:CMSInitiatingOccupancyFraction=75</startargument> | ||
32 | - <startargument>-XX:+UseCMSInitiatingOccupancyOnly</startargument> | ||
33 | - <startargument>-jar</startargument> | ||
34 | - <startargument>%BASE%\lib\${pkg.name}.jar</startargument> | ||
35 | - | ||
36 | -</service> |