-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cf744dc
commit 9541f0f
Showing
9 changed files
with
107 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
mvn clean package | ||
|
||
echo 'Copy files...' | ||
|
||
scp -i ~/Downloads/horizon.pem \ | ||
./target/*.jar \ | ||
ubuntu@3.34.2.208:~/horizon/horizon-builder.jar | ||
|
||
echo 'Restart the server...' | ||
|
||
ssh -i ~/Downloads/horizon.pem ubuntu@3.34.2.208 << EOF | ||
pgrep java | xargs kill -9 | ||
nohup java -jar horizon/horizon-builder.jar & | ||
EOF | ||
|
||
echo 'Bye!' |
4 changes: 4 additions & 0 deletions
4
server/src/main/java/com/horizonbuilders/server/ServerApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
package com.horizonbuilders.server; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.system.ApplicationPid; | ||
|
||
@SpringBootApplication | ||
@Slf4j | ||
public class ServerApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(ServerApplication.class, args); | ||
log.info("id of process: " + new ApplicationPid().toString()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
server/src/main/java/com/horizonbuilders/server/config/SwaggerConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.horizonbuilders.server.config; | ||
|
||
import io.swagger.v3.oas.annotations.OpenAPIDefinition; | ||
import io.swagger.v3.oas.annotations.info.Contact; | ||
import io.swagger.v3.oas.annotations.info.Info; | ||
import io.swagger.v3.oas.models.Components; | ||
import io.swagger.v3.oas.models.OpenAPI; | ||
import io.swagger.v3.oas.models.security.SecurityRequirement; | ||
import io.swagger.v3.oas.models.security.SecurityScheme; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
@OpenAPIDefinition( | ||
info = @Info( | ||
title = "Horizon Builders - Construction Company", | ||
version = "1.0", | ||
contact = @Contact( | ||
name = "Bekzhan Satiev", email = "tarantuldeveloper@gmail.com" | ||
), | ||
description = """ | ||
Restfull server with access and refresh tokens. Access token is valid | ||
for 30 min, refresh - 2 hours. | ||
""" | ||
) | ||
) | ||
public class SwaggerConfig { | ||
@Bean | ||
public OpenAPI customizeOpenAPI() { | ||
final String securitySchemeName = "Bearer_Token_Authorization"; | ||
|
||
return new OpenAPI() | ||
.addSecurityItem(new SecurityRequirement() | ||
.addList(securitySchemeName)) | ||
.components(new Components() | ||
.addSecuritySchemes(securitySchemeName, new SecurityScheme() | ||
.name(securitySchemeName) | ||
.type(SecurityScheme.Type.HTTP) | ||
.description("Just paste your access token here.") | ||
.scheme("Bearer") | ||
.bearerFormat("JWT"))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters