Skip to content

Commit 66d34cb

Browse files
committed
final changes before deploying in the vm
1 parent 59fb4cc commit 66d34cb

8 files changed

Lines changed: 109 additions & 40 deletions

File tree

vault/docker-compose.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ services:
3939
KC_DB_PASSWORD: ${KEYCLOAK_DB_PASSWORD}
4040
KEYCLOAK_ADMIN: admin
4141
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD}
42-
KC_HOSTNAME: localhost
42+
KC_HOSTNAME: ${KC_HOSTNAME}
4343
KC_HTTP_PORT: 8080
44+
KC_PROXY: edge
4445
volumes:
4546
- ./keycloak/realm-export.json:/opt/keycloak/data/import/realm-export.json:ro
4647
- ./keycloak/themes/vault:/opt/keycloak/themes/vault:ro
@@ -74,6 +75,9 @@ services:
7475
dockerfile: nginx/Dockerfile
7576
ports:
7677
- "80:80"
78+
- "443:443"
79+
volumes:
80+
- /etc/letsencrypt:/etc/letsencrypt:ro
7781
depends_on:
7882
- kong
7983

vault/frontend/.env.production

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VITE_KEYCLOAK_URL=https://vaultpraja.duckdns.org

vault/frontend/src/index.css

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,27 @@
66

77
body {
88
font-family: 'Segoe UI', system-ui, sans-serif;
9-
background: #f0f2f5;
10-
color: #333;
9+
background: #0d0d0d;
10+
color: #e0e0e0;
1111
min-height: 100vh;
1212
}
1313

1414
/* ── Header ──────────────────────────────── */
1515
.header {
16-
background: #1a1a2e;
17-
color: white;
16+
background: #111111;
17+
color: #f0f0f0;
1818
padding: 1rem 2rem;
1919
display: flex;
2020
align-items: center;
2121
gap: 0.75rem;
22+
border-bottom: 1px solid #222;
2223
}
2324

2425
.header h1 {
2526
font-size: 1.4rem;
2627
font-weight: 600;
2728
letter-spacing: 0.5px;
29+
color: #f0f0f0;
2830
}
2931

3032
.header-badge {
@@ -54,19 +56,20 @@ body {
5456

5557
/* ── Card ────────────────────────────────── */
5658
.card {
57-
background: white;
59+
background: #1a1a1a;
5860
border-radius: 10px;
5961
padding: 1.25rem;
60-
box-shadow: 0 1px 3px rgba(0,0,0,0.08);
62+
box-shadow: 0 1px 6px rgba(0,0,0,0.4);
63+
border: 1px solid #2a2a2a;
6164
}
6265

6366
.card h2 {
6467
font-size: 1rem;
6568
font-weight: 600;
66-
color: #444;
69+
color: #aaa;
6770
margin-bottom: 1rem;
6871
padding-bottom: 0.5rem;
69-
border-bottom: 1px solid #f0f0f0;
72+
border-bottom: 1px solid #2a2a2a;
7073
}
7174

7275
/* ── Buttons ─────────────────────────────── */
@@ -80,20 +83,26 @@ body {
8083
transition: opacity 0.15s;
8184
}
8285

83-
.btn:hover { opacity: 0.85; }
86+
.btn:hover { opacity: 0.8; }
8487

8588
.btn-primary {
86-
background: #1a1a2e;
89+
background: #e94560;
8790
color: white;
8891
}
8992

9093
.btn-danger {
91-
background: #e94560;
92-
color: white;
94+
background: #3a1a1f;
95+
color: #e94560;
96+
border: 1px solid #e94560;
9397
font-size: 0.75rem;
9498
padding: 0.25rem 0.65rem;
9599
}
96100

101+
.btn-danger:hover {
102+
background: #e94560;
103+
color: white;
104+
}
105+
97106
/* ── Form inputs ─────────────────────────── */
98107
.form-group {
99108
display: flex;
@@ -103,24 +112,31 @@ body {
103112

104113
.input {
105114
padding: 0.55rem 0.75rem;
106-
border: 1px solid #ddd;
115+
border: 1px solid #333;
107116
border-radius: 6px;
108117
font-size: 0.9rem;
109118
font-family: inherit;
110119
transition: border-color 0.15s;
111120
width: 100%;
121+
background: #111;
122+
color: #e0e0e0;
123+
}
124+
125+
.input::placeholder {
126+
color: #555;
112127
}
113128

114129
.input:focus {
115130
outline: none;
116-
border-color: #1a1a2e;
131+
border-color: #e94560;
132+
background: #161616;
117133
}
118134

119135
/* ── Health check ────────────────────────── */
120136
.health-result {
121137
margin-top: 0.75rem;
122138
font-size: 0.875rem;
123-
color: #555;
139+
color: #888;
124140
display: flex;
125141
gap: 1rem;
126142
}
@@ -135,8 +151,8 @@ body {
135151
font-weight: 500;
136152
}
137153

138-
.health-pill.ok { background: #d1fae5; color: #065f46; }
139-
.health-pill.error { background: #fee2e2; color: #991b1b; }
154+
.health-pill.ok { background: #0d2e1f; color: #34d399; }
155+
.health-pill.error { background: #2e0d0d; color: #f87171; }
140156

141157
/* ── Note list ───────────────────────────── */
142158
.note-list {
@@ -146,7 +162,7 @@ body {
146162
}
147163

148164
.empty-state {
149-
color: #aaa;
165+
color: #555;
150166
font-size: 0.875rem;
151167
text-align: center;
152168
padding: 1rem 0;
@@ -155,7 +171,7 @@ body {
155171
/* ── Note card ───────────────────────────── */
156172
.note-card {
157173
padding: 0.75rem 0;
158-
border-bottom: 1px solid #f0f0f0;
174+
border-bottom: 1px solid #222;
159175
display: flex;
160176
justify-content: space-between;
161177
align-items: flex-start;
@@ -169,11 +185,11 @@ body {
169185
.note-title {
170186
font-size: 0.9rem;
171187
font-weight: 600;
172-
color: #222;
188+
color: #e0e0e0;
173189
margin-bottom: 0.2rem;
174190
}
175191

176192
.note-body {
177193
font-size: 0.8rem;
178-
color: #777;
194+
color: #666;
179195
}

vault/frontend/src/keycloak.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const KEYCLOAK_URL = 'http://localhost:8080';
1+
const KEYCLOAK_URL = import.meta.env.VITE_KEYCLOAK_URL;
22
const REALM = 'vault';
33
const CLIENT_ID = 'vault-frontend';
44
const REDIRECT_URI = window.location.origin;

vault/keycloak/realm-export.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -830,10 +830,12 @@
830830
"alwaysDisplayInConsole": false,
831831
"clientAuthenticatorType": "client-secret",
832832
"redirectUris": [
833-
"http://localhost/*"
833+
"http://localhost/*",
834+
"https://vaultpraja.duckdns.org/*"
834835
],
835836
"webOrigins": [
836-
"http://localhost"
837+
"http://localhost",
838+
"https://vaultpraja.duckdns.org"
837839
],
838840
"notBefore": 0,
839841
"bearerOnly": false,

vault/keycloak/themes/vault/login/resources/css/login.css

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
body,
22
.login-pf-page {
3-
background: #f0f2f5 !important;
4-
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
3+
background: #0d0d0d !important;
4+
font-family: 'Segoe UI', system-ui, sans-serif;
55
}
66

77
#kc-header-wrapper {
@@ -10,18 +10,18 @@ body,
1010

1111
.login-pf-page .login-pf-header h1,
1212
#kc-page-title {
13-
color: #1a1a2e;
13+
color: #e0e0e0;
1414
font-size: 1.4rem;
1515
font-weight: 700;
1616
text-align: center;
1717
}
1818

1919
/* card */
2020
.card-pf {
21-
background: #ffffff;
22-
border: none;
21+
background: #1a1a1a;
22+
border: 1px solid #2a2a2a;
2323
border-radius: 12px;
24-
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
24+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
2525
padding: 2rem;
2626
max-width: 420px;
2727
margin: auto;
@@ -39,21 +39,28 @@ input[type="password"],
3939
input[type="email"] {
4040
width: 100%;
4141
padding: 0.6rem 0.8rem;
42-
border: 1.5px solid #ddd;
42+
border: 1px solid #333;
4343
border-radius: 8px;
4444
font-size: 0.95rem;
45-
background: #fafafa;
45+
background: #111;
46+
color: #e0e0e0;
4647
box-sizing: border-box;
4748
transition: border-color 0.2s;
4849
}
4950

51+
input[type="text"]::placeholder,
52+
input[type="password"]::placeholder,
53+
input[type="email"]::placeholder {
54+
color: #555;
55+
}
56+
5057
.pf-c-form-control:focus,
5158
input[type="text"]:focus,
5259
input[type="password"]:focus,
5360
input[type="email"]:focus {
54-
border-color: #1a1a2e;
61+
border-color: #e94560;
5562
outline: none;
56-
background: #fff;
63+
background: #161616;
5764
}
5865

5966
/* primary button */
@@ -62,7 +69,7 @@ input[type="submit"],
6269
#kc-login,
6370
#kc-register {
6471
width: 100%;
65-
background: #1a1a2e !important;
72+
background: #e94560 !important;
6673
color: #ffffff !important;
6774
border: none;
6875
border-radius: 8px;
@@ -92,7 +99,7 @@ a:hover {
9299

93100
/* labels */
94101
label {
95-
color: #444;
102+
color: #aaa;
96103
font-size: 0.88rem;
97104
font-weight: 500;
98105
margin-bottom: 0.3rem;
@@ -102,12 +109,12 @@ label {
102109
/* alert/error */
103110
.alert-error,
104111
.pf-c-alert.pf-m-danger {
105-
background: #fff1f2;
112+
background: #2e0d0d;
106113
border-left: 4px solid #e94560;
107114
border-radius: 6px;
108115
padding: 0.6rem 0.8rem;
109116
font-size: 0.88rem;
110-
color: #c0392b;
117+
color: #f87171;
111118
margin-bottom: 1rem;
112119
}
113120

vault/kong/kong.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ consumers:
2424
OaQ4PdBmR2MHC2bBpJNl52QNOn9s6vBIHw06wKDELyl3LPzo3EBKDfhA/NY/xoM+
2525
qwIDAQAB
2626
-----END PUBLIC KEY-----
27+
- key: https://vaultpraja.duckdns.org/realms/vault
28+
algorithm: RS256
29+
rsa_public_key: |
30+
-----BEGIN PUBLIC KEY-----
31+
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqCoUkhyToUTyn0IXip7z
32+
0NM2cDSdw8Cjj8zBmNAo1HkByk8n7Q5EgpFZhehMjtLhPs6VNg+RdFK9S3EyN00N
33+
+SG2R3Llj49HzE1q4P1tP25dM+7lM5rwSdkujOSDAVFfTdUIDWIFK6hU6JErxlWA
34+
7TQBpCApOne9goNSZTxWG5vUlLcV30N3LUDzYNj7n7x7NTpUZDHoZP0660EDd2kP
35+
s2UVuXqb4i3DC6a8BHALCxExwXzGZ6J1Il0Mjqvijp0jVVsFmp9tBjvjfwL4sEfN
36+
OaQ4PdBmR2MHC2bBpJNl52QNOn9s6vBIHw06wKDELyl3LPzo3EBKDfhA/NY/xoM+
37+
qwIDAQAB
38+
-----END PUBLIC KEY-----
2739
2840
plugins:
2941
- name: rate-limiting
@@ -35,6 +47,7 @@ plugins:
3547
config:
3648
origins:
3749
- http://localhost
50+
- https://vaultpraja.duckdns.org
3851
methods:
3952
- GET
4053
- POST

vault/nginx/nginx.conf

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,16 @@ http {
1111

1212
server {
1313
listen 80;
14-
server_name _;
14+
server_name vaultpraja.duckdns.org;
15+
return 301 https://$host$request_uri;
16+
}
17+
18+
server {
19+
listen 443 ssl;
20+
server_name vaultpraja.duckdns.org;
21+
22+
ssl_certificate /etc/letsencrypt/live/vaultpraja.duckdns.org/fullchain.pem;
23+
ssl_certificate_key /etc/letsencrypt/live/vaultpraja.duckdns.org/privkey.pem;
1524

1625
location / {
1726
root /usr/share/nginx/html;
@@ -24,6 +33,23 @@ http {
2433
proxy_set_header Host $host;
2534
proxy_set_header X-Real-IP $remote_addr;
2635
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
36+
proxy_set_header X-Forwarded-Proto https;
37+
}
38+
39+
location /realms/ {
40+
proxy_pass http://keycloak:8080/realms/;
41+
proxy_set_header Host $host;
42+
proxy_set_header X-Real-IP $remote_addr;
43+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
44+
proxy_set_header X-Forwarded-Proto https;
45+
}
46+
47+
location /auth/ {
48+
proxy_pass http://keycloak:8080/auth/;
49+
proxy_set_header Host $host;
50+
proxy_set_header X-Real-IP $remote_addr;
51+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
52+
proxy_set_header X-Forwarded-Proto https;
2753
}
2854
}
2955
}

0 commit comments

Comments
 (0)