Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ft/prettier #194

Merged
merged 5 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## 2.xx

### 2.4.0
- Add Search Box for Identity Filtering by @dhia-gharsallaoui in https://github.com/dfoxg/kratos-admin-ui/pull/193
- Add Prettier

### 2.3.2
- Support for boolean traits

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ services:
networks:
- intranet
admin_ui:
image: ghcr.io/dfoxg/kratos-admin-ui:v2.3.2
image: ghcr.io/dfoxg/kratos-admin-ui:v2.4.0
ports:
- '80:8080'
restart: unless-stopped
Expand Down
4 changes: 4 additions & 0 deletions kratos-admin-ui/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleAttributePerLine": true,
"bracketSameLine": true
}
2 changes: 1 addition & 1 deletion kratos-admin-ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN npm run test
RUN npm run build


FROM nginxinc/nginx-unprivileged:1.27.0
FROM nginxinc/nginx-unprivileged:1.27.1

#labels
LABEL MAINTAINER0="Daniel Fuchs (daniel@fuchs-informatik.de)"
Expand Down
5 changes: 4 additions & 1 deletion kratos-admin-ui/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# Getting started

## Run Ory-Kratos local

see [official docs](https://www.ory.sh/docs/kratos/quickstart)

## run admin-ui local

```
#start the cors-proxy in background
node cors-proxy.js &

#start the dev-server
npm run start
```
open your browser on port 3000 and you should see the gui!

open your browser on port 3000 and you should see the gui!
48 changes: 25 additions & 23 deletions kratos-admin-ui/cors-proxy.js
Original file line number Diff line number Diff line change
@@ -1,62 +1,64 @@
var http = require('http');
var http = require("http");

http.createServer(onRequestAdmin).listen(4435);
http.createServer(onRequestPublic).listen(4430);

console.log("listening ...")
console.log("listening ...");

function onRequestAdmin(client_req, client_res) {
console.log('serve: ' + client_req.url);
console.log("serve: " + client_req.url);

var options = {
hostname: '127.0.0.1',
hostname: "127.0.0.1",
port: 4434,
path: client_req.url,
method: client_req.method,
headers: client_req.headers
headers: client_req.headers,
};

var proxy = http.request(options, function (res) {
const headers = res.headers;
headers["access-control-allow-origin"] = "http://localhost:3000"
headers["access-control-allow-credentials"] = "true"
headers["access-control-allow-headers"] = "Content-Type"
headers["access-control-allow-methods"] = "GET, PUT, DELETE, PATCH, HEAD, OPTIONS, POST"
client_res.writeHead(res.statusCode, headers)
headers["access-control-allow-origin"] = "http://localhost:3000";
headers["access-control-allow-credentials"] = "true";
headers["access-control-allow-headers"] = "Content-Type";
headers["access-control-allow-methods"] =
"GET, PUT, DELETE, PATCH, HEAD, OPTIONS, POST";
client_res.writeHead(res.statusCode, headers);
res.pipe(client_res, {
end: true
end: true,
});
});

client_req.pipe(proxy, {
end: true
end: true,
});
}

function onRequestPublic(client_req, client_res) {
console.log('serve: ' + client_req.url);
console.log("serve: " + client_req.url);

var options = {
hostname: '127.0.0.1',
hostname: "127.0.0.1",
port: 4433,
path: client_req.url,
method: client_req.method,
headers: client_req.headers
headers: client_req.headers,
};

var proxy = http.request(options, function (res) {
const headers = res.headers;
headers["access-control-allow-origin"] = "http://localhost:3000"
headers["access-control-allow-credentials"] = "true"
headers["access-control-allow-headers"] = "Content-Type"
headers["access-control-allow-methods"] = "GET, PUT, DELETE, PATCH, HEAD, OPTIONS, POST"
client_res.writeHead(res.statusCode, headers)
headers["access-control-allow-origin"] = "http://localhost:3000";
headers["access-control-allow-credentials"] = "true";
headers["access-control-allow-headers"] = "Content-Type";
headers["access-control-allow-methods"] =
"GET, PUT, DELETE, PATCH, HEAD, OPTIONS, POST";
client_res.writeHead(res.statusCode, headers);
res.pipe(client_res, {
end: true
end: true,
});
});

client_req.pipe(proxy, {
end: true
end: true,
});
}
}
Loading