Skip to content

Commit 7120c42

Browse files
committed
fw-config
1 parent 018b2f8 commit 7120c42

File tree

17 files changed

+908
-810
lines changed

17 files changed

+908
-810
lines changed

docker-compose.yml

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -74,46 +74,6 @@ services:
7474
networks:
7575
- ezbuy-network
7676

77-
# keycloak:
78-
# image: quay.io/keycloak/keycloak:25.0.2
79-
# restart: always
80-
# command: start
81-
# links:
82-
# - postgres
83-
# ports:
84-
# - "9082:8080"
85-
# depends_on:
86-
# - postgresql
87-
# environment:
88-
# - KC_PROXY_ADDRESS_FORWARDING=true
89-
# - KC_HOSTNAME_STRICT=false
90-
# - KC_HOSTNAME=keycloak.jimsgarage.co.uk
91-
# - KC_PROXY=edge
92-
# - KC_HTTP_ENABLED=true
93-
# - KC_DB=postgres
94-
# - KC_DB_USERNAME=keycloak
95-
# - KC_DB_PASSWORD=SUPERsecret
96-
# - KC_DB_URL_HOST=postgres
97-
# - KC_DB_URL_PORT=5432
98-
# - KC_DB_URL_DATABASE=keycloak
99-
# - KEYCLOAK_ADMIN=admin
100-
# - KEYCLOAK_ADMIN_PASSWORD=password
101-
# networks:
102-
# proxy:
103-
# keycloak:
104-
# labels:
105-
# - "traefik.enable=true"
106-
# - "traefik.http.routers.keycloak.entrypoints=http"
107-
# - "traefik.http.routers.keycloak.rule=Host(`keycloak.yourdomain.com`)"
108-
# - "traefik.http.middlewares.keycloak-https-redirect.redirectscheme.scheme=https"
109-
# - "traefik.http.routers.keycloak.middlewares=keycloak-https-redirect"
110-
# - "traefik.http.routers.keycloak-secure.entrypoints=https"
111-
# - "traefik.http.routers.keycloak-secure.rule=Host(`keycloak.yourdomain.com`)"
112-
# - "traefik.http.routers.keycloak-secure.tls=true"
113-
# - "traefik.http.routers.keycloak-secure.service=keycloak"
114-
# - "traefik.http.services.keycloak.loadbalancer.server.port=8080"
115-
# - "traefik.docker.network=proxy"
116-
11777

11878
#minio
11979
minio:
File renamed without changes.

docs/vi/README.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
## Hướng Dẫn Thiết Lập File Resource:
2+
3+
- `application.yml` and `application.properties`
4+
5+
## Thiết lập ghi đè Bean
6+
```yml
7+
spring:
8+
main:
9+
web-application-type: reactive
10+
allow-bean-definition-overriding: true
11+
```
12+
13+
## Thiết lập Security OAuth2 với Keycloak
14+
15+
```yml
16+
spring:
17+
security:
18+
oauth2:
19+
client:
20+
provider:
21+
oidc:
22+
token-uri: http://localhost:8080/realms/ezbuy-server/protocol/openid-connect/token
23+
registration:
24+
oidc:
25+
client-id: ezbuy-client
26+
client-secret: mI92QDfvi20tZgFtjpRAPWu8TR6eMHmw
27+
authorization-grant-type: password #client_credentials
28+
resourceserver:
29+
jwt:
30+
jwk-set-uri: http://localhost:8080/realms/ezbuy-server/protocol/openid-connect/certs
31+
keycloak:
32+
client-id: ezbuy-client
33+
```
34+
35+
## Thiết lập Unauthenticated Endpoints Config
36+
37+
```yml
38+
application:
39+
http-logging:
40+
request:
41+
enable: true
42+
header: true
43+
param: true
44+
body: true
45+
response:
46+
enable: true
47+
body: true
48+
whiteList:
49+
- uri: /actuator/health
50+
methods:
51+
- GET
52+
- uri: /v1/demo/post
53+
methods:
54+
- POST
55+
- uri: /v1/demo/put
56+
methods:
57+
- PUT
58+
- uri: /v1/demo/delete
59+
methods:
60+
- DELETE
61+
- uri: /v1/demo/head
62+
methods:
63+
- HEAD
64+
- uri: /v1/demo/options
65+
methods:
66+
- OPTIONS
67+
```
68+
69+
## Thiết lập client connect:
70+
71+
```yml
72+
client:
73+
keycloak:
74+
address: http://localhost:8080/realms/ezbuy-server/protocol/openid-connect
75+
name: keycloak
76+
auth:
77+
client-id: ezbuy-client
78+
client-secret: mI92QDfvi20tZgFtjpRAPWu8TR6eMHmw
79+
```
80+
81+
## Thiết lập minio
82+
83+
```yml
84+
minio:
85+
bucket: ezbuy-bucket
86+
enabled: true
87+
baseUrl: http://localhost:9000
88+
publicUrl: http://localhost:9000/ezbuy-bucket
89+
accessKey: 4DoaZ0KdzpXdDlVK104t
90+
secretKey: nuRiQUIJNVygMOHhmtR4LT1etAa7F8PQOsRGP5oj
91+
private:
92+
bucket: ezbuy-private
93+
```
94+
95+
## Thiết lập hash password
96+
```yml
97+
hashing-password:
98+
public-key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw5e+CZbXbC8SRbrp+X9O4QRrKQWRu2zJpYGmGtP3bdS6NtsVBaJz2hHwF1KeEzZTnlW/jy7NOYYR5Rp5nD1RfAJooxZxgO7BcZZKbsnBNe+KLUQrxNOgkx2ZpMs60UdzToz0IvIN5L5NFaiKq5/WwRpG4aIM8iV/ME1L/QQw0FDD7m/2PUxDlANXJl5hZgXfZ1hpo/31HXkBofJTWJ/MdTAnxR4u5y+mXYUsf9GmCmA5exPpPZZv1qT1D7AWv0CXi5Ftd2ylbD6jAtF5MC1ngO4FEGZh9uTwXQh2x8FJmc2U7KKTQMWuhbXtkANVVLMg+GPx7lTxDTwQpKmldf5UDuuzcBQIDAQAB
99+
```
100+
101+
## Thiết lập proxy
102+
```yml
103+
proxy-client:
104+
host: 10.207.156.52
105+
port: 3128
106+
```
107+

docs/vi/application.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# demo config application.yml and application.properties
2+
server:
3+
port: 9730
4+
# spring config
5+
spring:
6+
main:
7+
web-application-type: reactive
8+
allow-bean-definition-overriding: true
9+
messages:
10+
basename: messages
11+
12+
#config r2dbc
13+
# r2dbc:
14+
# url: r2dbc:postgresql://localhost:5434/auth
15+
# username: admin
16+
# password: admin
17+
18+
codec:
19+
max-in-memory-size: 100MB
20+
21+
#config oauth2 with keycloak
22+
security:
23+
oauth2:
24+
client:
25+
provider:
26+
oidc:
27+
token-uri: http://localhost:8080/realms/ezbuy-server/protocol/openid-connect/token
28+
registration:
29+
oidc:
30+
client-id: ezbuy-client
31+
client-secret: mI92QDfvi20tZgFtjpRAPWu8TR6eMHmw
32+
authorization-grant-type: password #client_credentials
33+
resourceserver:
34+
jwt:
35+
jwk-set-uri: http://localhost:8080/realms/ezbuy-server/protocol/openid-connect/certs
36+
keycloak:
37+
client-id: ezbuy-client
38+
39+
## unauthenticated endpoints config
40+
application:
41+
http-logging:
42+
request:
43+
enable: true
44+
header: true
45+
param: true
46+
body: true
47+
response:
48+
enable: true
49+
body: true
50+
whiteList:
51+
- uri: /actuator/health
52+
methods:
53+
- GET
54+
- uri: /v1/demo/post
55+
methods:
56+
- POST
57+
- uri: /v1/demo/put
58+
methods:
59+
- PUT
60+
- uri: /v1/demo/delete
61+
methods:
62+
- DELETE
63+
- uri: /v1/demo/head
64+
methods:
65+
- HEAD
66+
- uri: /v1/demo/options
67+
methods:
68+
- OPTIONS
69+
70+
# web client config
71+
client:
72+
keycloak:
73+
address: http://localhost:8080/realms/ezbuy-server/protocol/openid-connect
74+
name: keycloak
75+
auth:
76+
client-id: ezbuy-client
77+
client-secret: mI92QDfvi20tZgFtjpRAPWu8TR6eMHmw
78+
79+
# minio server config
80+
minio:
81+
bucket: ezbuy-bucket
82+
enabled: true
83+
baseUrl: http://localhost:9000
84+
publicUrl: http://localhost:9000/ezbuy-bucket
85+
accessKey: 4DoaZ0KdzpXdDlVK104t
86+
secretKey: nuRiQUIJNVygMOHhmtR4LT1etAa7F8PQOsRGP5oj
87+
private:
88+
bucket: ezbuy-private
89+
90+
#generate public key
91+
hashing-password:
92+
public-key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw5e+CZbXbC8SRbrp+X9O4QRrKQWRu2zJpYGmGtP3bdS6NtsVBaJz2hHwF1KeEzZTnlW/jy7NOYYR5Rp5nD1RfAJooxZxgO7BcZZKbsnBNe+KLUQrxNOgkx2ZpMs60UdzToz0IvIN5L5NFaiKq5/WwRpG4aIM8iV/ME1L/QQw0FDD7m/2PUxDlANXJl5hZgXfZ1hpo/31HXkBofJTWJ/MdTAnxR4u5y+mXYUsf9GmCmA5exPpPZZv1qT1D7AWv0CXi5Ftd2ylbD6jAtF5MC1ngO4FEGZh9uTwXQh2x8FJmc2U7KKTQMWuhbXtkANVVLMg+GPx7lTxDTwQpKmldf5UDuuzcBQIDAQAB
93+
#proxy config
94+
proxy-client:
95+
host: 10.207.156.52
96+
port: 3128

pom.xml

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<groupId>io.github.hoangtien2k3</groupId>
1313
<artifactId>fw-commons</artifactId>
14-
<version>1.1.0</version>
14+
<version>1.1.1</version>
1515
<packaging>jar</packaging>
1616
<name>fw-commons</name>
1717
<description>a commons java tool lib with spring boot framework</description>
@@ -276,23 +276,23 @@
276276
</dependency>
277277

278278
<!-- r2dbc depenedcies-->
279-
<dependency>
280-
<groupId>org.postgresql</groupId>
281-
<artifactId>r2dbc-postgresql</artifactId>
282-
<version>1.0.5.RELEASE</version>
283-
<scope>runtime</scope>
284-
</dependency>
285-
<dependency>
286-
<groupId>org.postgresql</groupId>
287-
<artifactId>postgresql</artifactId>
288-
<version>42.7.3</version>
289-
<scope>runtime</scope>
290-
</dependency>
279+
<!-- <dependency>-->
280+
<!-- <groupId>org.postgresql</groupId>-->
281+
<!-- <artifactId>r2dbc-postgresql</artifactId>-->
282+
<!-- <version>1.0.5.RELEASE</version>-->
283+
<!-- <scope>runtime</scope>-->
284+
<!-- </dependency>-->
285+
<!-- <dependency>-->
286+
<!-- <groupId>org.postgresql</groupId>-->
287+
<!-- <artifactId>postgresql</artifactId>-->
288+
<!-- <version>42.7.3</version>-->
289+
<!-- <scope>runtime</scope>-->
290+
<!-- </dependency>-->
291291

292-
<dependency>
293-
<groupId>io.r2dbc</groupId>
294-
<artifactId>r2dbc-pool</artifactId>
295-
</dependency>
292+
<!-- <dependency>-->
293+
<!-- <groupId>io.r2dbc</groupId>-->
294+
<!-- <artifactId>r2dbc-pool</artifactId>-->
295+
<!-- </dependency>-->
296296

297297
<!--Bouncy Castle-->
298298
<dependency>
@@ -377,10 +377,10 @@
377377
<scope>provided</scope>
378378
</dependency>
379379
<!-- r2dbc depenedcies-->
380-
<dependency>
381-
<groupId>org.springframework.boot</groupId>
382-
<artifactId>spring-boot-starter-data-r2dbc</artifactId>
383-
</dependency>
380+
<!-- <dependency>-->
381+
<!-- <groupId>org.springframework.boot</groupId>-->
382+
<!-- <artifactId>spring-boot-starter-data-r2dbc</artifactId>-->
383+
<!-- </dependency>-->
384384

385385
<dependency>
386386
<groupId>org.springframework.boot</groupId>
@@ -524,7 +524,6 @@
524524
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
525525
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
526526
*/
527-
528527
]]>
529528
</content>
530529
</licenseHeader>

src/main/java/io/hoangtien2k3/commons/config/DatabaseConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1313
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1414
*/
15-
package io.hoangtien2k3.commons.config; // package io.hoangtien2k3.commons.config;
15+
//package io.hoangtien2k3.commons.config; // package io.hoangtien2k3.commons.config;
1616
//
1717
// import java.util.List;
1818
//

0 commit comments

Comments
 (0)