Skip to content

Commit 0d39de4

Browse files
Merge branch 'finos:main' into Search
2 parents e784109 + 1e35b93 commit 0d39de4

File tree

7 files changed

+18
-10
lines changed

7 files changed

+18
-10
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "@finos/git-proxy",
3-
"version": "1.5.0",
3+
"version": "1.5.1",
44
"description": "Deploy custom push protections and policies on top of Git.",
55
"scripts": {
66
"cli": "node ./packages/git-proxy-cli/index.js",
77
"client": "vite --config vite.config.js",
88
"clientinstall": "npm install --prefix client",
99
"server": "node index.js",
10-
"start": "concurrently 'npm run server' 'npm run client'",
10+
"start": "concurrently \"npm run server\" \"npm run client\"",
1111
"build": "vite build",
1212
"test": "NODE_ENV=test mocha --exit",
1313
"test-coverage": "nyc npm run test",

src/proxy/processors/push-action/blockForAuth.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
const Step = require('../../actions').Step;
1+
const { getServiceUIURL } = require('../../../service/urls');
22

3-
const { GIT_PROXY_UI_PORT: uiPort } = require('../../../config/env').Vars;
3+
const Step = require('../../actions').Step;
44

55
const exec = async (req, action) => {
66
const step = new Step('authBlock');
7+
const url = getServiceUIURL(req);
78

89
const message =
910
'\n\n\n' +
1011
`\x1B[32mGitProxy has received your push ✅\x1B[0m\n\n` +
1112
'🔗 Shareable Link\n\n' +
12-
`\x1B[34mhttp://localhost:${uiPort}/admin/push/${action.id}\x1B[0m` +
13+
`\x1B[34m${url}/admin/push/${action.id}\x1B[0m` +
1314
'\n\n\n';
1415
step.setAsyncBlock(message);
1516

src/proxy/processors/push-action/pullRemote.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const exec = async (req, action) => {
1616
}
1717

1818
if (!fs.existsSync(action.proxyGitPath)) {
19-
fs.mkdirSync(action.proxyGitPath, '0777', true);
19+
fs.mkdirSync(action.proxyGitPath, '0755', true);
2020
}
2121

2222
const cmd = `git clone ${action.url} --bare`;

src/service/routes/repo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const express = require('express');
22
const router = new express.Router();
33
const db = require('../../db');
4-
const { getProxyURL } = require('../proxyURL');
4+
const { getProxyURL } = require('../urls');
55

66
router.get('/', async (req, res) => {
77
const proxyURL = getProxyURL(req);

src/service/proxyURL.js renamed to src/service/urls.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,11 @@ module.exports = {
1010
);
1111
return config.getDomains().proxy ?? defaultURL;
1212
},
13+
getServiceUIURL: (req) => {
14+
const defaultURL = `${req.protocol}://${req.headers.host}`.replace(
15+
`:${PROXY_HTTP_PORT}`,
16+
`:${UI_PORT}`,
17+
);
18+
return config.getDomains().service ?? defaultURL;
19+
},
1320
};

test/proxyURL.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const chai = require('chai');
22
const sinon = require('sinon');
33
const express = require('express');
44
const chaiHttp = require('chai-http');
5-
const { getProxyURL } = require('../src/service/proxyURL');
5+
const { getProxyURL } = require('../src/service/urls');
66
const config = require('../src/config');
77

88
chai.use(chaiHttp);

0 commit comments

Comments
 (0)