Skip to content

Commit 93e00f4

Browse files
Merge branch 'main' into react-conversion
2 parents b84b489 + b7b67a5 commit 93e00f4

File tree

14 files changed

+247
-205
lines changed

14 files changed

+247
-205
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ Drop a note, ask a question or just say hello in our [community Slack channel](h
114114

115115
If you can't access Slack, you can also [subscribe to our mailing list](mailto:[email protected]).
116116

117-
Join our [fortnightly Zoom meeting](https://zoom.us/j/97235277537?pwd=aDJsaE8zcDJpYW1vZHJmSTJ0RXNZUT09) on Monday, 11AM EST (odd week numbers). Send an e-mail to [[email protected]](mailto:[email protected]) to get a calendar invitation.
117+
🤝 Join our [fortnightly Zoom meeting](https://zoom-lfx.platform.linuxfoundation.org/meeting/95849833904?password=99413314-d03a-4b1c-b682-1ede2c399595) on Monday, 4PM BST (odd week numbers).
118+
🌍 [Convert to your local time](https://www.timeanddate.com/worldclock)
119+
📅 [Click here](https://calendar.google.com/calendar/event?action=TEMPLATE&tmeid=MTRvbzM0NG01dWNvNGc4OGJjNWphM2ZtaTZfMjAyNTA2MDJUMTUwMDAwWiBzYW0uaG9sbWVzQGNvbnRyb2wtcGxhbmUuaW8&tmsrc=sam.holmes%40control-plane.io&scp=ALL) for the recurring Google Calendar meeting invite. Alternatively, send an e-mail to [[email protected]](https://zoom-lfx.platform.linuxfoundation.org/meeting/95849833904?password=99413314-d03a-4b1c-b682-1ede2c399595#:~:text=Need-,an,-invite%3F) to get a calendar invitation.
118120

119121
Otherwise, if you have a deeper query or require more support, please [raise an issue](https://github.com/finos/git-proxy/issues).

cypress/e2e/repo.cy.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('Repo', () => {
1010

1111
describe('Code button for repo row', () => {
1212
it('Opens tooltip with correct content and can copy', () => {
13-
const cloneURL = 'http://localhost:8000/finos/test-repo.git';
13+
const cloneURL = 'http://localhost:8000/finos/git-proxy.git';
1414
const tooltipQuery = 'div[role="tooltip"]';
1515

1616
cy
@@ -19,8 +19,8 @@ describe('Repo', () => {
1919
.should('not.exist');
2020

2121
cy
22-
// find the entry for finos/test-repo
23-
.get('a[href="/dashboard/repo/test-repo"]')
22+
// find the entry for finos/git-proxy
23+
.get('a[href="/dashboard/repo/git-proxy"]')
2424
// take it's parent row
2525
.closest('tr')
2626
// find the nearby span containing Code we can click to open the tooltip

experimental/li-cli/package-lock.json

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

experimental/li-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"@inquirer/prompts": "^7.6.0",
1818
"yaml": "^2.8.0",
1919
"yargs": "^17.7.2",
20-
"zod": "^3.25.67"
20+
"zod": "^3.25.73"
2121
},
2222
"devDependencies": {
2323
"@jest/globals": "^29.7.0",

package-lock.json

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

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
"axios": "^1.6.0",
4747
"bcryptjs": "^3.0.2",
4848
"bit-mask": "^1.0.2",
49-
"body-parser": "^2.2.0",
5049
"classnames": "2.5.1",
5150
"concurrently": "^9.0.0",
5251
"connect-mongo": "^5.1.0",

src/config/env.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,24 @@ export type ServerConfig = {
33
GIT_PROXY_HTTPS_SERVER_PORT: string | number;
44
GIT_PROXY_UI_HOST: string;
55
GIT_PROXY_UI_PORT: string | number;
6+
GIT_PROXY_COOKIE_SECRET: string | undefined;
7+
GIT_PROXY_MONGO_CONNECTION_STRING: string;
68
};
79

810
const {
911
GIT_PROXY_SERVER_PORT = 8000,
1012
GIT_PROXY_HTTPS_SERVER_PORT = 8443,
1113
GIT_PROXY_UI_HOST = 'http://localhost',
1214
GIT_PROXY_UI_PORT = 8080,
15+
GIT_PROXY_COOKIE_SECRET,
16+
GIT_PROXY_MONGO_CONNECTION_STRING = 'mongodb://localhost:27017/git-proxy',
1317
} = process.env;
1418

1519
export const serverConfig: ServerConfig = {
1620
GIT_PROXY_SERVER_PORT,
1721
GIT_PROXY_HTTPS_SERVER_PORT,
1822
GIT_PROXY_UI_HOST,
1923
GIT_PROXY_UI_PORT,
24+
GIT_PROXY_COOKIE_SECRET,
25+
GIT_PROXY_MONGO_CONNECTION_STRING,
2026
};

src/config/index.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { existsSync, readFileSync } from 'fs';
22

33
import defaultSettings from '../../proxy.config.json';
4+
import { serverConfig } from './env';
45
import { configFile, validate } from './file';
56
import { ConfigLoader, Configuration } from './ConfigLoader';
67
import {
@@ -23,7 +24,7 @@ let _apiAuthentication: Authentication[] = defaultSettings.apiAuthentication;
2324
let _tempPassword: TempPasswordConfig = defaultSettings.tempPassword;
2425
let _proxyUrl = defaultSettings.proxyUrl;
2526
let _api: Record<string, unknown> = defaultSettings.api;
26-
let _cookieSecret: string = defaultSettings.cookieSecret;
27+
let _cookieSecret: string = serverConfig.GIT_PROXY_COOKIE_SECRET || defaultSettings.cookieSecret;
2728
let _sessionMaxAgeHours: number = defaultSettings.sessionMaxAgeHours;
2829
let _plugins: any[] = defaultSettings.plugins;
2930
let _commitConfig: Record<string, any> = defaultSettings.commitConfig;
@@ -82,6 +83,10 @@ export const getDatabase = () => {
8283
if (ix) {
8384
const db = _database[ix];
8485
if (db.enabled) {
86+
// if mongodb is configured and connection string unspecified, fallback to env var
87+
if (db.type === 'mongo' && !db.connectionString) {
88+
db.connectionString = serverConfig.GIT_PROXY_MONGO_CONNECTION_STRING;
89+
}
8590
return db;
8691
}
8792
}
@@ -92,7 +97,7 @@ export const getDatabase = () => {
9297

9398
/**
9499
* Get the list of enabled authentication methods
95-
*
100+
*
96101
* At least one authentication method must be enabled.
97102
* @return {Authentication[]} List of enabled authentication methods
98103
*/
@@ -104,15 +109,15 @@ export const getAuthMethods = (): Authentication[] => {
104109
const enabledAuthMethods = _authentication.filter((auth) => auth.enabled);
105110

106111
if (enabledAuthMethods.length === 0) {
107-
throw new Error("No authentication method enabled");
112+
throw new Error('No authentication method enabled');
108113
}
109114

110115
return enabledAuthMethods;
111116
};
112117

113118
/**
114119
* Get the list of enabled authentication methods for API endpoints
115-
*
120+
*
116121
* If no API authentication methods are enabled, all endpoints are public.
117122
* @return {Authentication[]} List of enabled authentication methods
118123
*/
@@ -121,10 +126,10 @@ export const getAPIAuthMethods = (): Authentication[] => {
121126
_apiAuthentication = _userSettings.apiAuthentication;
122127
}
123128

124-
const enabledAuthMethods = _apiAuthentication.filter(auth => auth.enabled);
129+
const enabledAuthMethods = _apiAuthentication.filter((auth) => auth.enabled);
125130

126131
if (enabledAuthMethods.length === 0) {
127-
console.log("Warning: No authentication method enabled for API endpoints.");
132+
console.log('Warning: No authentication method enabled for API endpoints.');
128133
}
129134

130135
return enabledAuthMethods;

src/proxy/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import express, { Application } from 'express';
2-
import bodyParser from 'body-parser';
32
import http from 'http';
43
import https from 'https';
54
import fs from 'fs';
@@ -57,8 +56,6 @@ export const proxyPreparations = async () => {
5756
// just keep this async incase it needs async stuff in the future
5857
const createApp = async (): Promise<Application> => {
5958
const app = express();
60-
// Setup the proxy middleware
61-
app.use(bodyParser.raw(options));
6259
app.use('/', router);
6360
return app;
6461
};

0 commit comments

Comments
 (0)