diff --git a/build.gradle b/build.gradle index f6dc56e..6eda973 100644 --- a/build.gradle +++ b/build.gradle @@ -15,6 +15,7 @@ java { } repositories { + mavenCentral() } @@ -37,6 +38,9 @@ dependencies { implementation 'org.springframework.ai:spring-ai-zhipuai-spring-boot-starter:1.0.0-M6' + + + //implementation 'org.springframework.ai:spring-ai-starter-model-zhipuai' //implementation 'org.springframework.ai:spring-ai-zhipuai-spring-boot-starter' //implementation platform("org.springframework.ai:spring-ai-bom:1.0.0-SNAPSHOT") @@ -94,8 +98,52 @@ apply plugin: 'java' } }*/ +tasks.register('buildAngular_dev', Exec) { + //dependsOn deleteStaticFolder + workingDir './jambotron-ui' // Path to your Angular project (e.g., './angular-app') + executable 'npm.cmd' // Use 'npm' for Unix-like systems or 'npm.cmd' for Windows + + // Your Angular build command + args = ['run', 'build_dev']//do not forget build_dev used port 8080 for connect to backend rest api + +} + +tasks.register('buildAngular', Exec) { + //dependsOn deleteStaticFolder + workingDir './jambotron-ui' // Path to your Angular project (e.g., './angular-app') + executable 'npm.cmd' // Use 'npm' for Unix-like systems or 'npm.cmd' for Windows + + // Your Angular build command + args = ['run', 'build']//do not forget build_dev used port 8080 for connect to backend rest api + +} + + +tasks.register('deleteStaticFolder', Delete) { + dependsOn buildAngular + def dirName = "src/main/resources/static" + file(dirName).list().each { + f -> + delete "${dirName}/${f}" + } +} + +tasks.register('deleteStaticFolder_dev', Delete) { + dependsOn buildAngular_dev + def dirName = "src/main/resources/static" + file(dirName).list().each { + f -> + delete "${dirName}/${f}" + } +} + tasks.register('copyAngularBuild', Copy) { - //dependsOn buildAngular + dependsOn deleteStaticFolder + from 'jambotron-ui/dist/jambotron-ui' // Path to your Angular dist folder + into "src/main/resources/static" // Path INSIDE the WAR +} +tasks.register('copyAngularBuild_dev', Copy) { + dependsOn deleteStaticFolder_dev from 'jambotron-ui/dist/jambotron-ui' // Path to your Angular dist folder into "src/main/resources/static" // Path INSIDE the WAR } diff --git a/build/libs/jambotron-0.0.1-SNAPSHOT.jar b/build/libs/jambotron-0.0.1-SNAPSHOT.jar deleted file mode 100644 index e52fd4e..0000000 Binary files a/build/libs/jambotron-0.0.1-SNAPSHOT.jar and /dev/null differ diff --git a/jambotron-ui/angular.json b/jambotron-ui/angular.json index ba195ca..cd85683 100644 --- a/jambotron-ui/angular.json +++ b/jambotron-ui/angular.json @@ -20,7 +20,6 @@ "outputPath": "dist/jambotron-ui", "index": "src/index.html", "main": "src/main.ts", - "polyfills": [ "zone.js" ], @@ -48,6 +47,12 @@ }, "configurations": { "production": { + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ], "budgets": [ { "type": "initial", @@ -78,6 +83,7 @@ }, "serve": { "builder": "@angular-devkit/build-angular:dev-server", + "configurations": { "production": { "buildTarget": "jambotron-ui:build:production" diff --git a/jambotron-ui/package.json b/jambotron-ui/package.json index 27d5ca8..d22578b 100644 --- a/jambotron-ui/package.json +++ b/jambotron-ui/package.json @@ -4,8 +4,10 @@ "scripts": { "ng": "ng", "start": "ng serve", + "start_prod": "ng serve --configuration production", "build": "ng build", "watch": "ng build --watch --configuration development", + "build_dev":"ng build --configuration development", "test": "ng test", "serve:ssr:jambotron-ui": "node dist/jambotron-ui/server/server.mjs" }, diff --git a/jambotron-ui/src/app/admin-module/admin-module.service.ts b/jambotron-ui/src/app/admin-module/admin-module.service.ts index 04787b7..3776756 100644 --- a/jambotron-ui/src/app/admin-module/admin-module.service.ts +++ b/jambotron-ui/src/app/admin-module/admin-module.service.ts @@ -2,12 +2,13 @@ import { Injectable } from '@angular/core'; import {Observable} from 'rxjs'; import {HttpClient} from '@angular/common/http'; import {User} from '../models/user.model'; +import {GlobalConstants} from '../global-constants'; @Injectable({ providedIn: 'root' }) export class AdminModuleService { - baseUrl = 'http://localhost:8080/api'; + baseUrl = GlobalConstants.API_URL; constructor(private http: HttpClient) { diff --git a/jambotron-ui/src/app/app.routes.ts b/jambotron-ui/src/app/app.routes.ts index a1a9723..8e98b95 100644 --- a/jambotron-ui/src/app/app.routes.ts +++ b/jambotron-ui/src/app/app.routes.ts @@ -17,7 +17,7 @@ export const routes: Routes = [ ]; @NgModule({ - imports: [RouterModule.forRoot(routes)],//, { useHash: true } + imports: [RouterModule.forRoot(routes, { useHash: true}) ], exports: [RouterModule], }) export class AppRoutingModule {} diff --git a/jambotron-ui/src/app/global-constants.spec.ts b/jambotron-ui/src/app/global-constants.spec.ts new file mode 100644 index 0000000..e3b64b4 --- /dev/null +++ b/jambotron-ui/src/app/global-constants.spec.ts @@ -0,0 +1,7 @@ +import { GlobalConstants } from './global-constants'; + +describe('GlobalConstants', () => { + it('should create an instance', () => { + expect(new GlobalConstants()).toBeTruthy(); + }); +}); diff --git a/jambotron-ui/src/app/global-constants.ts b/jambotron-ui/src/app/global-constants.ts new file mode 100644 index 0000000..fe73560 --- /dev/null +++ b/jambotron-ui/src/app/global-constants.ts @@ -0,0 +1,15 @@ +import {environment} from '../environments/environment'; + +export class GlobalConstants { + + public static readonly API_URL = (() => { + // ... calculate the value and return it + + if(environment.production) { + return `${environment.host_name}/api`; + }else { + return `${environment.host_name}:${environment.port}/api`; + } + + })(); +} diff --git a/jambotron-ui/src/app/main-module/main.component/main.component.ts b/jambotron-ui/src/app/main-module/main.component/main.component.ts index 4fffd99..0d9927a 100644 --- a/jambotron-ui/src/app/main-module/main.component/main.component.ts +++ b/jambotron-ui/src/app/main-module/main.component/main.component.ts @@ -29,7 +29,7 @@ import { environment } from '../../../environments/environment'; MatToolbar, MatButton, RouterLink, - IconDirective, + RouterOutlet, CommonModule, MatIcon, @@ -38,8 +38,7 @@ import { environment } from '../../../environments/environment'; MatMenu, MatMenuItem, MatTooltip, - MatLabel, - MatFabButton + MatLabel ], schemas: [ CUSTOM_ELEMENTS_SCHEMA ], diff --git a/jambotron-ui/src/app/moderator-module/moderator-api.service.ts b/jambotron-ui/src/app/moderator-module/moderator-api.service.ts index 427d036..aef4bc6 100644 --- a/jambotron-ui/src/app/moderator-module/moderator-api.service.ts +++ b/jambotron-ui/src/app/moderator-module/moderator-api.service.ts @@ -2,12 +2,13 @@ import { Injectable } from '@angular/core'; import {HttpClient, HttpHeaders} from '@angular/common/http'; import {Observable} from 'rxjs'; import {Tutorial} from '../models/tutorial.model'; +import {GlobalConstants} from '../global-constants'; @Injectable({ providedIn: 'root' }) export class ModeratorApiService { - baseUrl = 'http://localhost:8080/api/moderator'; + baseUrl = `${GlobalConstants.API_URL}/moderator`; constructor(private http: HttpClient) { diff --git a/jambotron-ui/src/app/services/auth.service.ts b/jambotron-ui/src/app/services/auth.service.ts index 0a920d3..f9d5c08 100644 --- a/jambotron-ui/src/app/services/auth.service.ts +++ b/jambotron-ui/src/app/services/auth.service.ts @@ -1,8 +1,9 @@ import { Injectable } from '@angular/core'; import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Observable } from 'rxjs'; +import {GlobalConstants} from '../global-constants'; -const AUTH_API = 'http://localhost:8080/api/auth/'; +const AUTH_API = GlobalConstants.API_URL + '/auth/'; const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) @@ -15,6 +16,7 @@ export class AuthService { constructor(private http: HttpClient) { } login(username: string, password: string): Observable { + console.log(AUTH_API + 'signin'); return this.http.post(AUTH_API + 'signin', { username, password diff --git a/jambotron-ui/src/app/services/roles.service.ts b/jambotron-ui/src/app/services/roles.service.ts index dbee6f9..4266e87 100644 --- a/jambotron-ui/src/app/services/roles.service.ts +++ b/jambotron-ui/src/app/services/roles.service.ts @@ -2,8 +2,9 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; import { Role } from '../models/role'; +import {GlobalConstants} from '../global-constants'; -const API_URL = 'http://localhost:8080/api/roles'; +const API_URL = `${GlobalConstants.API_URL}/roles`; @Injectable({ diff --git a/jambotron-ui/src/app/services/system.service.ts b/jambotron-ui/src/app/services/system.service.ts index 8885ca0..3fb9887 100644 --- a/jambotron-ui/src/app/services/system.service.ts +++ b/jambotron-ui/src/app/services/system.service.ts @@ -4,13 +4,14 @@ import {Observable} from 'rxjs'; import {Tutorial} from '../models/tutorial.model'; import {Bean} from '../models/Bean'; import {NameValueItem} from '../models/name-value-item'; +import {GlobalConstants} from '../global-constants'; @Injectable({ providedIn: 'root' }) export class SystemService { - baseUrl : string = 'http://localhost:8080/api/system'; + baseUrl : string = `${GlobalConstants.API_URL}/system`; constructor(private http: HttpClient) { } getDataSourceProperties(): Observable{ diff --git a/jambotron-ui/src/app/services/tutorial.service.ts b/jambotron-ui/src/app/services/tutorial.service.ts index f71c2ec..269c292 100644 --- a/jambotron-ui/src/app/services/tutorial.service.ts +++ b/jambotron-ui/src/app/services/tutorial.service.ts @@ -2,9 +2,9 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; import { Tutorial } from '../models/tutorial.model'; -import {text} from 'node:stream/consumers'; +import {GlobalConstants} from '../global-constants'; -const baseUrl = 'http://localhost:8080/api/public/tutorials'; +const baseUrl = `${GlobalConstants.API_URL}/public/tutorials`; @Injectable({ providedIn: 'root' diff --git a/jambotron-ui/src/app/services/user.service.ts b/jambotron-ui/src/app/services/user.service.ts index 21d6fa1..f6b1764 100644 --- a/jambotron-ui/src/app/services/user.service.ts +++ b/jambotron-ui/src/app/services/user.service.ts @@ -2,9 +2,9 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; import {User} from "../models/user.model"; -import {Tutorial} from "../models/tutorial.model"; +import {GlobalConstants} from '../global-constants'; -const API_URL = 'http://localhost:8080/api/users'; +const API_URL = `${GlobalConstants.API_URL}/users`; @Injectable({ providedIn: 'root' diff --git a/jambotron-ui/src/app/services/zhipuai-image.service.ts b/jambotron-ui/src/app/services/zhipuai-image.service.ts index ab843e2..6dc015c 100644 --- a/jambotron-ui/src/app/services/zhipuai-image.service.ts +++ b/jambotron-ui/src/app/services/zhipuai-image.service.ts @@ -4,6 +4,7 @@ import {Tutorial} from '../models/tutorial.model'; import {HttpClient} from '@angular/common/http'; import {Image} from '../models/image'; import {SpinnerService} from './spinner.service'; +import {GlobalConstants} from '../global-constants'; @@ -13,7 +14,7 @@ import {SpinnerService} from './spinner.service'; export class ZhipuaiImageService { - baseUrl : string = 'http://localhost:8080/api/zhipuai'; + baseUrl : string = `${GlobalConstants.API_URL}/public/zhipuai`; constructor(private http: HttpClient,public spinnerService: SpinnerService) { diff --git a/jambotron-ui/src/app/user-module/tutorials-list.component/tutorials-list.component.html b/jambotron-ui/src/app/user-module/tutorials-list.component/tutorials-list.component.html index 1af8563..fb527b5 100644 --- a/jambotron-ui/src/app/user-module/tutorials-list.component/tutorials-list.component.html +++ b/jambotron-ui/src/app/user-module/tutorials-list.component/tutorials-list.component.html @@ -53,7 +53,7 @@ diff --git a/jambotron-ui/src/app/user-module/user-api.service.ts b/jambotron-ui/src/app/user-module/user-api.service.ts index 2943b6c..81c4484 100644 --- a/jambotron-ui/src/app/user-module/user-api.service.ts +++ b/jambotron-ui/src/app/user-module/user-api.service.ts @@ -2,12 +2,13 @@ import { Injectable } from '@angular/core'; import {forkJoin, Observable} from 'rxjs'; import {Tutorial} from '../models/tutorial.model'; import {HttpClient, HttpHeaders} from '@angular/common/http'; +import {GlobalConstants} from '../global-constants'; @Injectable({ providedIn: 'root' }) export class UserApiService { - baseUrl = 'http://localhost:8080/api/user'; + baseUrl = `${GlobalConstants.API_URL}/user`; constructor(private http: HttpClient) { diff --git a/jambotron-ui/src/environments/environment.development.ts b/jambotron-ui/src/environments/environment.development.ts index dd5aecb..5cc9a43 100644 --- a/jambotron-ui/src/environments/environment.development.ts +++ b/jambotron-ui/src/environments/environment.development.ts @@ -1,3 +1,7 @@ export const environment = { - default_page: 'main/generate-image' + default_page: 'main/generate-image', + port: 8080, + fromWeb: false, + production: false, + host_name: 'http://localhost', }; diff --git a/jambotron-ui/src/environments/environment.prod.ts b/jambotron-ui/src/environments/environment.prod.ts new file mode 100644 index 0000000..1673ad0 --- /dev/null +++ b/jambotron-ui/src/environments/environment.prod.ts @@ -0,0 +1,7 @@ +export const environment = { + default_page: 'main/generate-image', + port: 8081, + production: true, + fromWeb: true, + host_name: 'https://jambotron.run.place' +}; diff --git a/jambotron-ui/src/environments/environment.ts b/jambotron-ui/src/environments/environment.ts index dd5aecb..038a3fc 100644 --- a/jambotron-ui/src/environments/environment.ts +++ b/jambotron-ui/src/environments/environment.ts @@ -1,3 +1,7 @@ export const environment = { - default_page: 'main/generate-image' + default_page: 'main/generate-image', + port: 8080, + production: true, + fromWeb: false, + host_name: 'http://localhost' }; diff --git a/src/Docker/Dockerfile b/src/Docker/Dockerfile index 766fe68..6712f0f 100644 --- a/src/Docker/Dockerfile +++ b/src/Docker/Dockerfile @@ -1,15 +1,14 @@ #FROM openjdk:24 AS BUILD_IMAGE -#ENV APP_HOME=/jambotron -#RUN mkdir -p $APP_HOME/src/main/java -#WORKDIR $APP_HOME -#COPY ./build.gradle ./gradlew ./gradlew.bat $APP_HOME/ -#COPY gradle $APP_HOME/gradle -#COPY ./src/ $APP_HOME/src/ -#RUN ./gradlew clean build + +#WORKDIR /jambotron/ +#COPY . ./ +#RUN microdnf install findutils +#RUN ./gradlew build -x test FROM openjdk:24 WORKDIR /jambotron/ COPY './build/libs/jambotron-0.0.1-SNAPSHOT.jar' '/app/jambotron.jar' -#COPY --from=BUILD_IMAGE '/jambotron/build/libs/jambotron-0.0.1-SNAPSHOT.jar' '/app/jambotron.jar' -EXPOSE 8080 -CMD ["java","-jar","/app/jambotron.jar"] \ No newline at end of file +#COPY --from=BUILD_IMAGE /jambotron/build/libs/jambotron-0.0.1-SNAPSHOT.jar . +#EXPOSE 8080 +CMD ["java","-jar","/app/jambotron.jar"] +#CMD ["java","-jar","jambotron-0.0.1-SNAPSHOT.jar"] \ No newline at end of file diff --git a/src/Docker/docker-compose.yml b/src/Docker/docker-compose.yml index 461ab69..b5f1f88 100644 --- a/src/Docker/docker-compose.yml +++ b/src/Docker/docker-compose.yml @@ -6,19 +6,38 @@ services: context: ../../ dockerfile: ./src/Docker/Dockerfile ports: - - "8080:8080" +# - "8081:80" + - "8443:443" depends_on: - postgres_jambotron + volumes: + - certs:/certs +# env_file: "webapp.env" environment: - SPRING_DATASOURCE_URL: jdbc:postgresql://ep-red-breeze-a2cxhq5f.eu-central-1.pg.koyeb.app:5432/jambotronDB - SPRING_DATASOURCE_USERNAME: koyeb-adm - SPRING_DATASOURCE_PASSWORD: npg_HfFEUA7bay1i + SERVER_PORT: 443 + FULLCHAINPEM: /certs/live/jambotron.run.place/fullchain.pem + PRIVKEYPEM: /certs/live/jambotron.run.place/privkey.pem + + SPRING_DATASOURCE_URL: jdbc:postgresql://postgres_jambotron:5432/jambotronDB + SPRING_DATASOURCE_USERNAME: admin + SPRING_DATASOURCE_PASSWORD: postgrespw SPRING_FLYWAY_BASELINE-ON-MIGRATE: "true" SPRING_FLYWAY_VALIDATE-ON-MIGRATE: "true" - SPRING_FLYWAY_USER: koyeb-adm - SPRING_FLYWAY_PASSWORD: npg_HfFEUA7bay1i - SPRING_FLYWAY_URL: jdbc:postgresql://ep-red-breeze-a2cxhq5f.eu-central-1.pg.koyeb.app:5432/jambotronDB + SPRING_FLYWAY_USER: admin + SPRING_FLYWAY_PASSWORD: postgrespw + SPRING_FLYWAY_URL: jdbc:postgresql://postgres_jambotron:5432/jambotronDB + +# SPRING_DATASOURCE_URL: jdbc:postgresql://ep-red-breeze-a2cxhq5f.eu-central-1.pg.koyeb.app:5432/jambotronDB +# SPRING_DATASOURCE_USERNAME: koyeb-adm +# SPRING_DATASOURCE_PASSWORD: npg_HfFEUA7bay1i +# SPRING_FLYWAY_BASELINE-ON-MIGRATE: "true" +# SPRING_FLYWAY_VALIDATE-ON-MIGRATE: "true" +# +# SPRING_FLYWAY_USER: koyeb-adm +# SPRING_FLYWAY_PASSWORD: npg_HfFEUA7bay1i +# SPRING_FLYWAY_URL: jdbc:postgresql://ep-red-breeze-a2cxhq5f.eu-central-1.pg.koyeb.app:5432/jambotronDB + # SPRING_DATASOURCE_PASSWORD: /run/secrets/db_password # secrets: @@ -41,3 +60,6 @@ services: #secrets: # db_password: # file: db_password.txt +volumes: + certs: + external: true \ No newline at end of file diff --git a/src/Docker/webapp.env b/src/Docker/webapp.env new file mode 100644 index 0000000..a463786 --- /dev/null +++ b/src/Docker/webapp.env @@ -0,0 +1,3 @@ +SERVER_PORT=443 +FULLCHAINPEM=/certs/live/jambotron.run.place/fullchain.pem +PRIVKEYPEM=/certs/live/jambotron.run.place/privkey.pem diff --git a/src/main/java/com/jambotronGroup/jambotron/JambotronApplication.java b/src/main/java/com/jambotronGroup/jambotron/JambotronApplication.java index 2bfd3f8..a2779a5 100644 --- a/src/main/java/com/jambotronGroup/jambotron/JambotronApplication.java +++ b/src/main/java/com/jambotronGroup/jambotron/JambotronApplication.java @@ -1,5 +1,6 @@ package com.jambotronGroup.jambotron; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.Marker; @@ -7,6 +8,7 @@ import org.slf4j.event.Level; import org.slf4j.helpers.BasicMarker; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Import; import java.util.Iterator; @@ -19,9 +21,9 @@ public class JambotronApplication { SpringApplication.run(JambotronApplication.class, args); - logger.error("Application Run."); - logger.debug("Application Run."); - logger.info("Application Run."); + logger.error("Application Run. This is an error message."); + logger.debug("Application Run. This is a debug message."); + logger.info("Application Run. This is an info message."); } } diff --git a/src/main/java/com/jambotronGroup/jambotron/ZhiPuAi/ImageController.java b/src/main/java/com/jambotronGroup/jambotron/ZhiPuAi/ImageController.java index d3efac7..a844230 100644 --- a/src/main/java/com/jambotronGroup/jambotron/ZhiPuAi/ImageController.java +++ b/src/main/java/com/jambotronGroup/jambotron/ZhiPuAi/ImageController.java @@ -12,13 +12,13 @@ import org.springframework.web.bind.annotation.*; import java.util.List; -@CrossOrigin(origins = "http://localhost:4200, https://pony-sincere-chimp.ngrok-free.app/", - maxAge = 3600, - allowCredentials="true", - allowedHeaders = {"Content-Type", "Authorization", "X-Requested-With"} -) +//@CrossOrigin(origins = "http://localhost:4200, https://pony-sincere-chimp.ngrok-free.app/", +// maxAge = 3600, +// allowCredentials="true", +// allowedHeaders = {"Content-Type", "Authorization", "X-Requested-With"} +//) @RestController -@RequestMapping("/api/zhipuai") +@RequestMapping("/api/public/zhipuai") public class ImageController { @Autowired diff --git a/src/main/java/com/jambotronGroup/jambotron/controllers/AuthController.java b/src/main/java/com/jambotronGroup/jambotron/controllers/AuthController.java index 1e8401f..7bceb88 100644 --- a/src/main/java/com/jambotronGroup/jambotron/controllers/AuthController.java +++ b/src/main/java/com/jambotronGroup/jambotron/controllers/AuthController.java @@ -32,7 +32,7 @@ import java.util.List; import java.util.Set; import java.util.stream.Collectors; //@CrossOrigin(origins = "*", maxAge = 3600) -@CrossOrigin(origins = "http://localhost:4200,https://a576-5-248-149-207.ngrok-free.app, https://pony-sincere-chimp.ngrok-free.app", maxAge = 3600, allowCredentials="true") +//@CrossOrigin(origins = "http://localhost:4200,https://a576-5-248-149-207.ngrok-free.app, https://pony-sincere-chimp.ngrok-free.app", maxAge = 3600, allowCredentials="true") @RestController @RequestMapping("/api/auth") public class AuthController { diff --git a/src/main/java/com/jambotronGroup/jambotron/controllers/TutorialController.java b/src/main/java/com/jambotronGroup/jambotron/controllers/TutorialController.java index a3ae965..c4ae116 100644 --- a/src/main/java/com/jambotronGroup/jambotron/controllers/TutorialController.java +++ b/src/main/java/com/jambotronGroup/jambotron/controllers/TutorialController.java @@ -20,7 +20,7 @@ import java.time.LocalDateTime; import java.util.*; -//@CrossOrigin(origins = "http://localhost:4200", maxAge = 3600, allowCredentials="true") +//@CrossOrigin(origins = "http://localhost:4200,http://www.jambotron.run.place", maxAge = 3600, allowCredentials="true") @RestController @RequestMapping("/api") public class TutorialController { @@ -98,10 +98,10 @@ public class TutorialController { @PostMapping("user/tutorial-add") public ResponseEntity createTutorial(@RequestBody Tutorial tutorial) { - Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); - UserDetails userDetails = (UserDetails) authentication.getPrincipal(); + // not work from white IP port 80 to docker container port 8080 or 8081 + //UserDetails userDetails = authenticationFacade.getUserDetails(); - User user = userRepository.findById(((UserDetailsImpl)userDetails).getId()).get(); + User user = authenticationFacade.getUser(); try { Tutorial newTutorial =new Tutorial( diff --git a/src/main/java/com/jambotronGroup/jambotron/security/AuthenticationFacade.java b/src/main/java/com/jambotronGroup/jambotron/security/AuthenticationFacade.java index 2565d5c..da5406c 100644 --- a/src/main/java/com/jambotronGroup/jambotron/security/AuthenticationFacade.java +++ b/src/main/java/com/jambotronGroup/jambotron/security/AuthenticationFacade.java @@ -1,29 +1,76 @@ package com.jambotronGroup.jambotron.security; +import com.jambotronGroup.jambotron.controllers.AuthController; +import com.jambotronGroup.jambotron.model.User; +import com.jambotronGroup.jambotron.repository.UserRepository; import com.jambotronGroup.jambotron.security.services.UserDetailsImpl; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.stereotype.Component; +import java.util.Optional; + @Component public class AuthenticationFacade implements IAuthenticationFacade { + + private static final Logger logger = LoggerFactory.getLogger(AuthenticationFacade.class); + + @Autowired + UserRepository userRepository; + @Override public Authentication getAuthentication() { return SecurityContextHolder.getContext().getAuthentication(); } + + //Deprecated method, use getUser() instead @Override public UserDetailsImpl getUserDetails() { + logger.warn("Retrieving user details from the security context"); Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); - UserDetails userDetails = (UserDetails) authentication.getPrincipal(); + if (authentication == null || !authentication.isAuthenticated()) { + throw new IllegalStateException("No authenticated user found"); + } + if (!(authentication.getPrincipal() instanceof UserDetails)) { + + throw new IllegalStateException("Authentication principal is not an instance of UserDetails"); + } + UserDetails userDetails = (UserDetails) authentication.getPrincipal(); + if (!(userDetails instanceof UserDetailsImpl)) { + throw new IllegalStateException("UserDetails is not an instance of UserDetailsImpl"); + } return (UserDetailsImpl) userDetails; } + @Override + public com.jambotronGroup.jambotron.model.User getUser() { + User returnValue = null; + + Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); + if (!(authentication.getPrincipal() instanceof UserDetails)) { + logger.info("Authentication principal is not an instance of UserDetails, returning null"); + logger.info(authentication.toString()); + + Optional user = userRepository.findByUsername(authentication.getPrincipal().toString()); + + returnValue = user.get(); + }else{ + UserDetails userDetails = (UserDetails) authentication.getPrincipal(); + UserDetailsImpl userDetailsImpl = (UserDetailsImpl) userDetails; + returnValue = userRepository.findById(userDetailsImpl.getId()).get(); + } + + return returnValue; + } } diff --git a/src/main/java/com/jambotronGroup/jambotron/security/IAuthenticationFacade.java b/src/main/java/com/jambotronGroup/jambotron/security/IAuthenticationFacade.java index 1db514b..c4f530d 100644 --- a/src/main/java/com/jambotronGroup/jambotron/security/IAuthenticationFacade.java +++ b/src/main/java/com/jambotronGroup/jambotron/security/IAuthenticationFacade.java @@ -1,5 +1,6 @@ package com.jambotronGroup.jambotron.security; +import com.jambotronGroup.jambotron.model.User; import com.jambotronGroup.jambotron.security.services.UserDetailsImpl; import org.springframework.security.core.Authentication; @@ -7,4 +8,6 @@ public interface IAuthenticationFacade { Authentication getAuthentication(); UserDetailsImpl getUserDetails(); + + User getUser(); } \ No newline at end of file diff --git a/src/main/java/com/jambotronGroup/jambotron/security/MyCorsFilterConfig.java b/src/main/java/com/jambotronGroup/jambotron/security/MyCorsFilterConfig.java new file mode 100644 index 0000000..20ef6a0 --- /dev/null +++ b/src/main/java/com/jambotronGroup/jambotron/security/MyCorsFilterConfig.java @@ -0,0 +1,41 @@ +package com.jambotronGroup.jambotron.security; + +import jakarta.servlet.*; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; +import org.springframework.http.HttpMethod; +import org.springframework.stereotype.Component; +import org.springframework.web.cors.CorsConfigurationSource; +import org.springframework.web.filter.CorsFilter; + +import java.io.IOException; +/* + +@Configuration +public class MyCorsFilterConfig extends CorsFilter { + + public MyCorsFilterConfig(CorsConfigurationSource source) { + super((CorsConfigurationSource) source); + } + + @Override + protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) + throws ServletException, IOException { + + response.addHeader("Access-Control-Allow-Headers", + "Access-Control-Allow-Origin, Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers"); + if (response.getHeader("Access-Control-Allow-Origin") == null) + response.addHeader("Access-Control-Allow-Origin", "http://localhost:4200"); + + if(!request.getRequestURI().startsWith("/api/auth")) { + response.addHeader("Access-Control-Allow-Credentials", "true"); + } + + filterChain.doFilter(request, response); + } + +} +*/ diff --git a/src/main/java/com/jambotronGroup/jambotron/security/RestConfig.java b/src/main/java/com/jambotronGroup/jambotron/security/RestConfig.java new file mode 100644 index 0000000..9dcc696 --- /dev/null +++ b/src/main/java/com/jambotronGroup/jambotron/security/RestConfig.java @@ -0,0 +1,43 @@ +package com.jambotronGroup.jambotron.security; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpMethod; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.CorsConfigurationSource; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; + +import java.util.List; +/* +@Configuration +public class RestConfig { + + @Bean + public MyCorsFilterConfig corsFilter() { + CorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + CorsConfiguration config = new CorsConfiguration(); + config.setAllowCredentials(true); + config.addAllowedOrigin("http://localhost:4200,http://www.jambotron.run.place"); + config.addAllowedMethod(HttpMethod.DELETE); + config.addAllowedMethod(HttpMethod.GET); + config.addAllowedMethod(HttpMethod.OPTIONS); + config.addAllowedMethod(HttpMethod.PUT); + config.addAllowedMethod(HttpMethod.POST); + // ((UrlBasedCorsConfigurationSource) source).registerCorsConfiguration("/**", config); + + + + config = new CorsConfiguration(); + config.setAllowCredentials(false); + config.setAllowedOrigins(List.of("http://localhost:4200","http://www.jambotron.run.place")); + config.addAllowedMethod(HttpMethod.DELETE); + config.addAllowedMethod(HttpMethod.GET); + config.addAllowedMethod(HttpMethod.OPTIONS); + config.addAllowedMethod(HttpMethod.PUT); + config.addAllowedMethod(HttpMethod.POST); + config.addAllowedHeader("*"); + ((UrlBasedCorsConfigurationSource) source).registerCorsConfiguration("api/auth/**", config); + + return new MyCorsFilterConfig(source); + } +}*/ diff --git a/src/main/java/com/jambotronGroup/jambotron/security/WebSecurityConfig.java b/src/main/java/com/jambotronGroup/jambotron/security/WebSecurityConfig.java index 9fc7e81..cff92f1 100644 --- a/src/main/java/com/jambotronGroup/jambotron/security/WebSecurityConfig.java +++ b/src/main/java/com/jambotronGroup/jambotron/security/WebSecurityConfig.java @@ -5,12 +5,14 @@ import com.jambotronGroup.jambotron.security.jwt.AuthTokenFilter; import com.jambotronGroup.jambotron.security.services.UserDetailsServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.dao.DaoAuthenticationProvider; import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration; import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer; import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder; @@ -22,6 +24,8 @@ import org.springframework.web.filter.CorsFilter; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import static org.springframework.security.config.Customizer.withDefaults; + @Configuration @EnableMethodSecurity //@EnableWebSecurity @@ -29,6 +33,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; // securedEnabled = true, // jsr250Enabled = true, //prePostEnabled = true) +@ComponentScan("com.jambotronGroup.jambotron.security") public class WebSecurityConfig implements WebMvcConfigurer {// extends WebSecurityConfigurerAdapter { @Autowired UserDetailsServiceImpl userDetailsService; @@ -57,7 +62,6 @@ public class WebSecurityConfig implements WebMvcConfigurer {// extends WebSecuri return authProvider; } - // @Bean // @Override // public AuthenticationManager authenticationManagerBean() throws Exception { @@ -106,12 +110,39 @@ public class WebSecurityConfig implements WebMvcConfigurer {// extends WebSecuri @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { - http.csrf(csrf -> csrf.disable()).cors(cors -> cors.disable()) + http.csrf(csrf -> csrf.disable())//cors.configurationSource(corsCongigSource())) .exceptionHandling(exception -> exception.authenticationEntryPoint(unauthorizedHandler)) .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) - .authorizeHttpRequests(auth -> - auth.requestMatchers("/api/auth/**").permitAll() - .requestMatchers("/*", "/home", "/resources/**").permitAll() + .authorizeHttpRequests(auth ->auth + // Access without authentication + // Allow public access to the root and home pages + .requestMatchers("/*").permitAll() + .requestMatchers("/resources/**").permitAll() + + .requestMatchers("/api/auth/**").permitAll() + // Allow public access to tutorials (without login) + .requestMatchers("/api/public/tutorials").permitAll() + //.requestMatchers("/api/public/tutorials/**").permitAll() + //TODO: need check the puth + .requestMatchers("/api/public/zhipuai/image/**").permitAll() + + // need for cerbot why i don't know + .requestMatchers("/.well-known/acme-challenge/**").permitAll() + + // Access permitted for specific roles + .requestMatchers("/api/user/**").hasRole("USER") + .requestMatchers("/api/moderator/**").hasRole("MODERATOR") + .requestMatchers("/api/admin/**").hasRole("ADMIN") + + .anyRequest().authenticated() + + + /* // Allow access to specific API endpoints without authentication + .requestMatchers("/api/auth/**").permitAll() + + // Allow access to specific resources + + .requestMatchers("/*", "/home", "/resources/**").permitAll() .requestMatchers("/resources/public/media/**").permitAll() .requestMatchers("/resources/public/browser/**").permitAll() .requestMatchers("/media/**").permitAll() @@ -121,7 +152,7 @@ public class WebSecurityConfig implements WebMvcConfigurer {// extends WebSecuri .requestMatchers("/api/tutorials").permitAll() - .requestMatchers("/api/zhipuai/image/**").permitAll() + .requestMatchers("/api/users").permitAll() .requestMatchers("/api/users/**").permitAll() @@ -133,16 +164,10 @@ public class WebSecurityConfig implements WebMvcConfigurer {// extends WebSecuri .requestMatchers("/api/settings").permitAll() .requestMatchers("/api/system/**").permitAll() +*/ - // Allow public access to tutorials (without login) - .requestMatchers("/api/public/tutorials").permitAll() - .requestMatchers("/api/public/tutorials/**").permitAll() - - .requestMatchers("/api/user/**").permitAll() - .requestMatchers("/api/moderator/**").permitAll() - .anyRequest().authenticated() - ); + ).redirectToHttps(withDefaults()); http.authenticationProvider(authenticationProvider()); @@ -151,17 +176,77 @@ public class WebSecurityConfig implements WebMvcConfigurer {// extends WebSecuri return http.build(); } - @Bean + /*@Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = new CorsConfiguration(); - config.setAllowCredentials(true); - config.addAllowedOrigin("http://localhost:4200"); +// config.setAllowCredentials(true); +// config.addAllowedOrigin("http://localhost:4200"); +// config.addAllowedHeader("*"); +// config.addAllowedMethod("*"); +// source.registerCorsConfiguration("/**", config); +// +// config = new CorsConfiguration(); +// config.setAllowCredentials(true); +// config.addAllowedOrigin("http://213.111.120.199"); +// config.addAllowedHeader("*"); +// config.addAllowedMethod("*"); +// source.registerCorsConfiguration("/**", config); + +// config = new CorsConfiguration(); +// config.setAllowCredentials(false); +// config.addAllowedOrigin("http://www.jambotron.run.place"); +// config.addAllowedHeader("*"); +// config.addAllowedMethod("*"); +// source.registerCorsConfiguration("/**", config); + + config = new CorsConfiguration(); + config.setAllowCredentials(false); + config.addAllowedOrigin("http://www.jambotron.run.place"); config.addAllowedHeader("*"); config.addAllowedMethod("*"); - source.registerCorsConfiguration("/**", config); - + source.registerCorsConfiguration("/api/user/**", config); return new CorsFilter(source); - } + }*/ + +/* public UrlBasedCorsConfigurationSource corsCongigSource() { + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + CorsConfiguration config = new CorsConfiguration(); +// config.setAllowCredentials(true); +// config.addAllowedOrigin("http://localhost:4200"); +// config.addAllowedHeader("*"); +// config.addAllowedMethod("*"); +// source.registerCorsConfiguration("/**", config); +// +// config = new CorsConfiguration(); +// config.setAllowCredentials(true); +// config.addAllowedOrigin("http://213.111.120.199"); +// config.addAllowedHeader("*"); +// config.addAllowedMethod("*"); +// source.registerCorsConfiguration("/**", config); + +// config = new CorsConfiguration(); +// config.setAllowCredentials(false); +// config.addAllowedOrigin("http://www.jambotron.run.place"); +// config.addAllowedHeader("*"); +// config.addAllowedMethod("*"); +// source.registerCorsConfiguration("/**", config); + + config = new CorsConfiguration(); + config.setAllowCredentials(false); + config.addAllowedOrigin("http://localhost:4200, http://www.jambotron.run.place"); + config.addAllowedHeader("*"); + config.addAllowedMethod("*"); + source.registerCorsConfiguration("/api/user/**", config); + + return source; + }*/ + +/* @Bean + public WebSecurityCustomizer webSecurityCustomizer() { + return (web) -> web.ignoring().requestMatchers("/images/**", "/js/**", "/webjars/**"); + }*/ } + + diff --git a/src/main/java/com/jambotronGroup/jambotron/security/jwt/AuthTokenFilter.java b/src/main/java/com/jambotronGroup/jambotron/security/jwt/AuthTokenFilter.java index fe7e239..9ed7fc1 100644 --- a/src/main/java/com/jambotronGroup/jambotron/security/jwt/AuthTokenFilter.java +++ b/src/main/java/com/jambotronGroup/jambotron/security/jwt/AuthTokenFilter.java @@ -9,7 +9,9 @@ import jakarta.servlet.http.HttpServletResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.web.authentication.WebAuthenticationDetailsSource; @@ -19,6 +21,9 @@ import java.io.IOException; public class AuthTokenFilter extends OncePerRequestFilter { + + @Autowired + AuthenticationManager authenticationManager; @Autowired private JwtUtils jwtUtils; @@ -35,8 +40,15 @@ public class AuthTokenFilter extends OncePerRequestFilter { if (jwt != null && jwtUtils.validateJwtToken(jwt)) { String username = jwtUtils.getUserNameFromJwtToken(jwt); + logger.warn("Username from JWT: {}", username); + UserDetails userDetails = userDetailsService.loadUserByUsername(username); +// Authentication authentication = authenticationManager.authenticate( +// new UsernamePasswordAuthenticationToken(userDetails.getUsername(),userDetails.getPassword())); + + + UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(userDetails, null, diff --git a/src/main/java/com/jambotronGroup/jambotron/security/services/UserDetailsImpl.java b/src/main/java/com/jambotronGroup/jambotron/security/services/UserDetailsImpl.java index f29733f..07ca4b6 100644 --- a/src/main/java/com/jambotronGroup/jambotron/security/services/UserDetailsImpl.java +++ b/src/main/java/com/jambotronGroup/jambotron/security/services/UserDetailsImpl.java @@ -40,6 +40,8 @@ public class UserDetailsImpl implements UserDetails { .map(role -> new SimpleGrantedAuthority(role.getName().name())) .collect(Collectors.toList()); + + return new UserDetailsImpl( user.getId(), user.getUsername(), diff --git a/src/main/java/com/jambotronGroup/jambotron/security/services/UserDetailsServiceImpl.java b/src/main/java/com/jambotronGroup/jambotron/security/services/UserDetailsServiceImpl.java index 1747be3..b23a0f1 100644 --- a/src/main/java/com/jambotronGroup/jambotron/security/services/UserDetailsServiceImpl.java +++ b/src/main/java/com/jambotronGroup/jambotron/security/services/UserDetailsServiceImpl.java @@ -23,6 +23,8 @@ public class UserDetailsServiceImpl implements UserDetailsService { .orElseThrow(() -> new UsernameNotFoundException("User Not Found with username: " + username)); return UserDetailsImpl.build(user); +// UserDetailsImpl userDetails = UserDetailsImpl.build(user); +// return new org.springframework.security.core.userdetails.User(userDetails.getUsername(), userDetails.getPassword(), userDetails.getAuthorities()); } } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 0c32a32..db841e0 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,5 +1,6 @@ spring.application.name=jambotron +server.port=443 #============Localhost Configurations======================== spring.datasource.url= jdbc:postgresql://localhost:5432/jambotronDB diff --git a/application.yml b/src/main/resources/application.yml similarity index 63% rename from application.yml rename to src/main/resources/application.yml index 733c6a1..5db9925 100644 --- a/application.yml +++ b/src/main/resources/application.yml @@ -10,3 +10,10 @@ logging: name: logs/application.log max-size: 10MB max-history: 30 + +server: + ssl: + enabled: true + certificate: ${FULLCHAINPEM} + certificate-private-key: ${PRIVKEYPEM} +# port: ${SERVER_PORT:443} # Default to 443 if SERVER_PORT is not set diff --git a/src/main/resources/dnsexit_com_ssl/ca.cer b/src/main/resources/dnsexit_com_ssl/ca.cer new file mode 100644 index 0000000..f6a9302 --- /dev/null +++ b/src/main/resources/dnsexit_com_ssl/ca.cer @@ -0,0 +1,71 @@ +-----BEGIN CERTIFICATE----- +MIIG1TCCBL2gAwIBAgIQbFWr29AHksedBwzYEZ7WvzANBgkqhkiG9w0BAQwFADCB +iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl +cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV +BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMjAw +MTMwMDAwMDAwWhcNMzAwMTI5MjM1OTU5WjBLMQswCQYDVQQGEwJBVDEQMA4GA1UE +ChMHWmVyb1NTTDEqMCgGA1UEAxMhWmVyb1NTTCBSU0EgRG9tYWluIFNlY3VyZSBT +aXRlIENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAhmlzfqO1Mdgj +4W3dpBPTVBX1AuvcAyG1fl0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4EFgQUU3m/WqorSs9UgOHYm8Cd8rID +ZsswDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wEQYDVR0gBAowCDAG +BgRVHSAAMEMGA1UdHwQ8MDowOKA2oDSGMmh0dHA6Ly9jcmwuY29tb2RvY2EuY29t +L0FBQUNlcnRpZmljYXRlU2VydmljZXMuY3JsMDQGCCsGAQUFBwEBBCgwJjAkBggr +BgEFBQcwAYYYaHR0cDovL29jc3AuY29tb2RvY2EuY29tMA0GCSqGSIb3DQEBDAUA +A4IBAQAYh1HcdCE9nIrgJ7cz0C7M7PDmy14R3iJvm3WOnnL+5Nb+qh+cli3vA0p+ +rvSNb3I8QzvAP+u431yqqcau8vzY7qN7Q/aGNnwU4M309z/+3ri0ivCRlv79Q2R+ +/czSAaF9ffgZGclCKxO/WIu6pKJmBHaIkU4MiRTOok3JMrO66BQavHHxW/BBC5gA +CiIDEOUMsfnNkjcZ7Tvx5Dq2+UUTJnWvu6rvP3t3O9LEApE9GQDTF1w52z97GA1F +zZOFli9d31kWTz9RvdVFGD/tSo7oBmF0Ixa1DVBzJ0RHfxBdiSprhTEUxOipakyA +vGp4z7h/jnZymQyd/teRCBaho1+V +-----END CERTIFICATE----- diff --git a/src/main/resources/dnsexit_com_ssl/jambotron.run.place.cer b/src/main/resources/dnsexit_com_ssl/jambotron.run.place.cer new file mode 100644 index 0000000..e8cbf1e --- /dev/null +++ b/src/main/resources/dnsexit_com_ssl/jambotron.run.place.cer @@ -0,0 +1,38 @@ +-----BEGIN CERTIFICATE----- +MIIGjTCCBHWgAwIBAgIQX5Qr0l0Q+rojBlPRWa822TANBgkqhkiG9w0BAQwFADBL +MQswCQYDVQQGEwJBVDEQMA4GA1UEChMHWmVyb1NTTDEqMCgGA1UEAxMhWmVyb1NT +TCBSU0EgRG9tYWluIFNlY3VyZSBTaXRlIENBMB4XDTI1MDcyNTAwMDAwMFoXDTI1 +MTAyMzIzNTk1OVowHjEcMBoGA1UEAxMTamFtY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yn2boDGQB1AA3h8jAr0w3BQGISCepVLvxHdHyx1+kw7w5CHrR+Tqo0 +AAABmELrUj4AAAQDAEYwRAIgChsIf08E36ymOBfBnOOFep9yyBdeiMYzSzPJGLmn +R+0CID5X2rqCJrYLOqEG/genTqpdfwb0wb1OUxz5JeCMD9B3MDcGA1UdEQQwMC6C +E2phbWJvdHJvbi5ydW4ucGxhY2WCF3d3dy5qYW1ib3Ryb24ucnVuLnBsYWNlMA0G +CSqGSIb3DQEBDAUAA4ICAQApWKMHQzOrkVA0D6y/Zty4dIGF6HD+ZxpEZuVVXhbb +K+GZBR4eVDY62ekp+pWH+uu+7TacNIL7p1Xn9SY/uV5tE1n5c2A8gssZojcCper2 +YD+9Mva+7ZwwIZ3D1xaCs5AeLMFAK1jtISR5KGt2XL9eROxHJ/UFJFtFMTkC8est +E7fMHmGca3OYWOxsfxa5aNJp4NbSeWDQG2XsVK982zj1x6iaVbJCN+uv3ShS4nnS +RKbfBvVzFxQbD8cLf24ZrB/LWpF0QeekE9DWVai1wSw1NtjLyntLv+RqY4L/aUbT +sBRI95k4KeIkoamZA+87wCC1WzsydPZkYtTuOW5jN18zoCXgEyuMwXQMPrKUG/de +ZsLKN16lIwc9pA3eKmlj4AU7Fo0goHkehvOTf/P38za5aHahFejp50rWxHw1FJBh +xFjJixarpQQi62hpEruq9pRnAtGQJd+4uYxzAMiHIEM/LD3gZOy4xFYJIDnNWQ8M +H3ZAdcHe+tbRzTcS93NikmTHjjMoJtI/j92kIFZsm0ZyIqNkxrLFJkUWWac66h1K +CgqRuubmLi3aZggMuDveyTXIztk+F6S7orrbHlHinLjMiJUTxkCnmJ1InLfMPJwW +K78/7AA0iqIvdZxVvA7d4FZpU4BIiMPI6B3brCoE+QfhawiPKotN+/tTPLeaytrD +DA== +-----END CERTIFICATE----- diff --git a/src/main/resources/dnsexit_com_ssl/jambotron.run.place.key b/src/main/resources/dnsexit_com_ssl/jambotron.run.place.key new file mode 100644 index 0000000..d2aa6a6 --- /dev/null +++ b/src/main/resources/dnsexit_com_ssl/jambotron.run.place.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEA2J6xGUz1qlxnQseQcPdegt3h+ZFhxqSEBYcAjsCeyzMLWcn9 +ljUgYPv7Sazq8xlIeuxmOIlwg6rWNfRVuf0Pyas7/FG0DinUFGbmVqUQjAufB/N8 +5y7z2RZzB6AUD21AE871pFpSEkLH39zfRvjoh0kx/G4sOYFp8N3avUOQyzi8F6S5 +yHAwzf8BIA10lFInZU+3fBc97Ba3uPCE2IZs5e8E4YtGKAiQC64IVENMyHZH2NaG +FWg8e4wr8VpKSMdTf6OhhaLYuQAHQuIzYi0yV5LcqNTm38U2I0vG8jddMVvE+xf+ +2S+cVydb3G4EJAaly2S0IRSH8tlYhJrtJJXLKQIDAQABAoIBAGcgJW/GE65nD0Hb +gAhHu9bRiyMk80d+StvWyY0sZmyWgHDemLtJz4BcdeU9TR0ujDL5GDESPV5xlklZ +aPaCY2G/A2+79dxITY7o7f+R1a7WWX+Pi4cD81MGPP0EWIh/mmHTxV3ZIflPkZgh +rqo7FXhSgFmMmcFGuwjQlbJE2EnmeCV1X8TmVbgekRm4BQ357lLvn8YdMRqua61o +Z8CAMG6WP87T/1p9AGtVdXm2ZhI/nbcu0kcguOG3lMbDAW+sZEMVgBc8vJHRChl6 +5ab/ePUTMekHPrYH8A+dFFc4pW99xJshQSqZBvFMWqjUfwH6OIXUjpwE1P8p3/7Y +XBLBbgECgYEA94vCQ51zKqXnSnwoAXkK480PwZQV5MEBK+GXQA3tha6lveDyQFnY +NH/NS9bWqEYCw8T0gkaV8j1d0FHwA8rn3lEICnJuY2PZiCU8t5O8n/8ITC1y9wqg +5zIivFzfjtv+Deb4JacBeOCk1W5vkI0RhsEnIrNmhlEatW593MfY/70CgYEA4ASN +nEllTl/aMqI+/nqY86tvEY9Ik0L7PNf4u+wj7FiTujnv0KYL5yl/1+9Hn3MtBIwI +y/bWfa95RESiqMzKjTYCwHSkaSKgXBvEeSpLjO0NhsxO9/6SiQm7yEAqaOq9H6Ms +e10GnChet+Fl1mRWk+FvjNQuySXS3IQwzERW6d0CgYA0l/j6LKWfVghCBwbo6TKr +G5JRaokMRQVesVtVPKBOWsDUCsrtaSlKXizcBBUvQ1CrD1lzpFOPWAJqlD4OUDnb +PhQbRBy3+Srqhh7UUgstYx38MVvPqO5usHQ42PKWg58CjSQDu+vQJspenkwNxisH +GlqaQMtzlh+6lHMhSUSNcQKBgQCUAe4eKFAKrEHZ2mCMeiu8MrQ7gdONmF+uH3Nz +ld1WNl/EVqsfy9VpcX3KCYnky5AexPa66+djOyB//mkJ5eSdz+WZindmDz6sHJx/ +AXbRMX4SZcJ3D3d5mzi6YcqjbxRtZr3o89l+Kx4Jl55VPA4HvpaZEUeoFpluoNgs +3aoe8QKBgCDlA0WEIlq4Idw1zFJzv+2rvJPb9fG77TGfDNGnTbx0/jDFN/L3e9A2 +71Je1hnhqpxKZS23gzD7SmU6fJdO1j6+qZs8FZewQmnMoPk3He9JSzrJtglWGF8Q +VLyuaylgRI7bv904DVmdwzlnLBPcG6SdHwqc3ufBeeeFbAI3KdFJ +-----END RSA PRIVATE KEY----- diff --git a/src/main/resources/dnsexit_com_ssl/jambotron.run.place.p12 b/src/main/resources/dnsexit_com_ssl/jambotron.run.place.p12 new file mode 100644 index 0000000..2769d3e Binary files /dev/null and b/src/main/resources/dnsexit_com_ssl/jambotron.run.place.p12 differ diff --git a/src/main/resources/dnsexit_com_ssl/jambotron.run.place_zerossl_rsa_domain_secure_site_ca_.p7b b/src/main/resources/dnsexit_com_ssl/jambotron.run.place_zerossl_rsa_domain_secure_site_ca_.p7b new file mode 100644 index 0000000..4af5382 Binary files /dev/null and b/src/main/resources/dnsexit_com_ssl/jambotron.run.place_zerossl_rsa_domain_secure_site_ca_.p7b differ diff --git a/src/main/resources/dnsexit_com_ssl/jambotron.run.place_zerossl_rsa_domain_secure_site_ca_.pubkey.json b/src/main/resources/dnsexit_com_ssl/jambotron.run.place_zerossl_rsa_domain_secure_site_ca_.pubkey.json new file mode 100644 index 0000000..2f84114 --- /dev/null +++ b/src/main/resources/dnsexit_com_ssl/jambotron.run.place_zerossl_rsa_domain_secure_site_ca_.pubkey.json @@ -0,0 +1 @@ +{"kty":"RSA","e":"AQAB","kid":"jambotron.run.place (zerossl rsa domain secure site ca)","n":"2J6xGUz1qlxnQseQcPdegt3h-ZFhxqSEBYcAjsCeyzMLWcn9ljUgYPv7Sazq8xlIeuxmOIlwg6rWNfRVuf0Pyas7_FG0DinUFGbmVqUQjAufB_N85y7z2RZzB6AUD21AE871pFpSEkLH39zfRvjoh0kx_G4sOYFp8N3avUOQyzi8F6S5yHAwzf8BIA10lFInZU-3fBc97Ba3uPCE2IZs5e8E4YtGKAiQC64IVENMyHZH2NaGFWg8e4wr8VpKSMdTf6OhhaLYuQAHQuIzYi0yV5LcqNTm38U2I0vG8jddMVvE-xf-2S-cVydb3G4EJAaly2S0IRSH8tlYhJrtJJXLKQ"} \ No newline at end of file diff --git a/src/main/resources/dnsexit_com_ssl/jambotron.run.place_zerossl_rsa_domain_secure_site_ca_.pubkey.pem b/src/main/resources/dnsexit_com_ssl/jambotron.run.place_zerossl_rsa_domain_secure_site_ca_.pubkey.pem new file mode 100644 index 0000000..057fa18 --- /dev/null +++ b/src/main/resources/dnsexit_com_ssl/jambotron.run.place_zerossl_rsa_domain_secure_site_ca_.pubkey.pem @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2J6xGUz1qlxnQseQcPde +gt3h+ZFhxqSEBYcAjsCeyzMLWcn9ljUgYPv7Sazq8xlIeuxmOIlwg6rWNfRVuf0P +yas7/FG0DinUFGbmVqUQjAufB/N85y7z2RZzB6AUD21AE871pFpSEkLH39zfRvjo +h0kx/G4sOYFp8N3avUOQyzi8F6S5yHAwzf8BIA10lFInZU+3fBc97Ba3uPCE2IZs +5e8E4YtGKAiQC64IVENMyHZH2NaGFWg8e4wr8VpKSMdTf6OhhaLYuQAHQuIzYi0y +V5LcqNTm38U2I0vG8jddMVvE+xf+2S+cVydb3G4EJAaly2S0IRSH8tlYhJrtJJXL +KQIDAQAB +-----END PUBLIC KEY-----