Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
6e81168
Change helm configmap from json to yaml
GB907762 Jan 6, 2026
77bd07a
Add typeDocs to config
GB907762 Feb 12, 2026
a8ddee8
Add dynamic documentation
GB907762 Feb 12, 2026
a7310d6
Merge remote-tracking branch 'origin/main' into chore/improve-helm-co…
PE39806 Feb 17, 2026
9d7da26
Use cache and fix frontend issue
PE39806 Feb 17, 2026
d84fb13
lib/landing path fix
PE39806 Feb 17, 2026
32ea4e9
Rename file type
PE39806 Feb 17, 2026
f5b5696
Statically generate docs for lib/landing but remain dynamic for frontend
PE39806 Feb 19, 2026
0723385
Update backend eslint ignore list
PE39806 Feb 19, 2026
0d548dc
Correct linting and paths
PE39806 Feb 19, 2026
42a34e4
Fix build issue
PE39806 Feb 19, 2026
3efc4e4
Merge remote-tracking branch 'origin/main' into chore/improve-helm-co…
PE39806 Feb 19, 2026
7ea312c
Update config map
PE39806 Feb 19, 2026
57e8c2c
Add dynamic documentation
GB907762 Feb 24, 2026
ac12880
Merge remote-tracking branch 'origin' into chore/improve-helm-configmap
GB907762 Mar 10, 2026
d6adc25
Merge branch 'main' into chore/improve-helm-configmap
GB907762 Mar 10, 2026
060bffe
Fix modelMirror
GB907762 Mar 10, 2026
b7c84ec
Merge branch 'chore/improve-helm-configmap' of github.com:gchq/Bailo …
GB907762 Mar 10, 2026
594263a
modelscan -> artefactscan
GB907762 Mar 10, 2026
beea087
Improve dynamic docs styling
PE39806 Mar 11, 2026
149c4c7
Various config wording tweaks
PE39806 Mar 11, 2026
552bd8d
Merge branch 'main' of github.com:gchq/Bailo into chore/improve-helm-…
GB907762 Mar 19, 2026
46c815b
Resolve package.json
GB907762 Mar 19, 2026
d502c83
Remove dynamic mapping, point to Github
GB907762 Mar 23, 2026
7d139ee
Add environment variables to _helpers.tpl
GB907762 Mar 23, 2026
51e2916
Move script
GB907762 Mar 25, 2026
839a04c
Merge branch 'main' into chore/improve-helm-configmap
GB907762 Mar 25, 2026
fed073e
Format yaml
GB907762 Mar 26, 2026
6d6e8ab
Merge remote-tracking branch 'origin/main' into chore/improve-helm-co…
PE39806 Apr 17, 2026
e299fd3
Minor fixes
PE39806 Apr 17, 2026
f191148
Split bailo configmap into config files
PE39806 Apr 17, 2026
f1fefe8
Merge remote-tracking branch 'origin/main' into chore/improve-helm-co…
PE39806 May 29, 2026
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
47 changes: 45 additions & 2 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,43 @@ jobs:
name: python-docs
path: ./backend/docs/python-docs/html

# Generate static config
config-docs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend

steps:
- uses: actions/checkout@v6

- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: "npm"

- name: Cache npm dependencies
uses: actions/cache@v5
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**package-lock.json') }}

- name: Install dependencies
run: npm ci

- name: Generate config docs
run: npm run generate-config-docs

- name: Upload config docs
uses: actions/upload-artifact@v6
with:
name: config-docs
path: ./backend/dist/config-docs.json

# Build job
build:
needs: sphinx
needs: [sphinx, config-docs]
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -70,6 +104,12 @@ jobs:
name: python-docs
path: ./backend/docs/python-docs/html

- name: Download backend config docs
uses: actions/download-artifact@v7
with:
name: config-docs
path: ./backend/dist

- name: Setup Node
uses: actions/setup-node@v6
with:
Expand Down Expand Up @@ -100,13 +140,16 @@ jobs:
${{ runner.os }}-nextjs-${{ hashFiles('lib/landing/package-lock.json') }}-

- name: Install dependencies
run: npm i
run: npm ci

- name: Run generator
run: npm run generate

- name: Build and export
run: npm run build
env:
BASE_PATH: "/Bailo"

- name: Upload artifact
uses: actions/upload-pages-artifact@v5
with:
Expand Down
29 changes: 0 additions & 29 deletions backend/config/default.cjs
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
/* eslint-disable @typescript-eslint/no-require-imports */

/** @type {import('../src/utils/config.js').Config} */
module.exports = {
api: {
// Publicly accessible host
host: '',

// Port to listen on
port: 3001,
},

app: {
// Publicly accessible route to service
protocol: '',
host: '',
port: 3000,

// Typically generated from `npm run certs`
privateKey: './certs/key.pem',
publicKey: './certs/cert.pem',
jwks: './certs/jwks.json',
Expand All @@ -26,40 +21,26 @@ module.exports = {
defaultOpts: {
rejectUnauthorized: true,
},
// Default proxy to use for all requests
proxy: '',
// Don't use a proxy for any address in this list
noProxy: ['localhost', '127.0.0.1'],
},

mongo: {
// A mongo connection URI, can contain replica set information, etc.
// See: https://www.mongodb.com/docs/manual/reference/connection-string/

// This is usually embedded in a config map, so do not put usernames and
// passwords in the connection string.
uri: 'mongodb://localhost:27017/bailo?directConnection=true',

// Authentication details
user: undefined,
pass: undefined,

// Whether to use transactions. Requires a replica set to be enabled
transactions: false,
},

registry: {
// Registry connection information should be the internal connection to the registry.
connection: {
internal: 'https://localhost:5000',
insecure: true,
},

// Service and Issuer must match those set in the registry configuration
service: 'RegistryAuth',
issuer: 'RegistryIssuer',

// Allow self-signed certificates
insecure: true,
},

Expand All @@ -72,8 +53,6 @@ module.exports = {
enabled: false,
transporter: 'smtp',

// Connection information for an SMTP server. Settings are passed directly to 'node-mailer', see reference for options:
// https://nodemailer.com/smtp/#1-single-connection
connection: {
host: 'localhost',
port: 1025,
Expand All @@ -84,7 +63,6 @@ module.exports = {
},
},

// Set the email address that Bailo should use, can be different from the SMTP server details.
from: '"Bailo 📝" <bailo@example.org>',
},

Expand Down Expand Up @@ -154,8 +132,6 @@ module.exports = {
provider: 'cognito',

grant: {
// Grant configuration options, provide any option from:
// https://www.npmjs.com/package/grant
defaults: {
origin: '',
prefix: '/api/connect',
Expand Down Expand Up @@ -201,24 +177,20 @@ module.exports = {
},
},

// These settings are PUBLIC and shared with the UI
ui: {
// Show a banner at the top of the screen on all pages
banner: {
enabled: true,
text: 'DEVELOPMENT DEPLOYMENT',
colour: 'orange',
textColor: 'black',
},

// Contact details for the support team
issues: {
label: 'Bailo Support Team',
supportHref: 'mailto:hello@example.com?subject=Bailo%20Support',
contactHref: 'mailto:hello@example.com?subject=Bailo%20Contact',
},

// The publicly accessible location of the registry, including host and port
registry: {
host: 'localhost:8080',
},
Expand Down Expand Up @@ -309,7 +281,6 @@ module.exports = {

multipartChunkSize: 5 * 1024 * 1024,

// Names of buckets that Bailo uses
buckets: {
uploads: 'uploads',
registry: 'registry',
Expand Down
3 changes: 1 addition & 2 deletions backend/config/dev_docker_compose.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
protocol: 'http',
host: 'localhost',
port: 8080,
// Typically generated from `npm run certs`

privateKey: '/certs/key.pem',
publicKey: '/certs/cert.pem',
},
Expand All @@ -38,7 +38,6 @@ module.exports = {

multipartChunkSize: 5 * 1024 * 1024,

// Names of buckets that Bailo uses
buckets: {
uploads: 'uploads',
registry: 'registry',
Expand Down
2 changes: 0 additions & 2 deletions backend/config/prod_docker_compose.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ module.exports = {
protocol: 'http',
host: 'localhost',
port: 8080,
// Typically generated from `npm run certs`
privateKey: '/certs/key.pem',
publicKey: '/certs/cert.pem',
},
Expand All @@ -31,7 +30,6 @@ module.exports = {

multipartChunkSize: 5 * 1024 * 1024,

// Names of buckets that Bailo uses
buckets: {
uploads: 'uploads',
registry: 'registry',
Expand Down
2 changes: 1 addition & 1 deletion backend/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const compat = new FlatCompat({

const eslintConfig = [
{
ignores: ['**/node_modules', '**/dist'],
ignores: ['**/node_modules', '**/dist', '**/docs/_build', '**/docs/python-docs', '**/docs/backenddocsvenv'],
},
...compat.extends(
'eslint:recommended',
Expand Down
3 changes: 2 additions & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"check-style": "prettier --check .",
"script": "tsx src/scripts/runScript.ts",
"certs": "mkdir -p certs && openssl genrsa -out certs/key.pem 2048 && openssl req -new -x509 -key certs/key.pem -out certs/cert.pem -config certs/san.cnf -extensions 'v3_req' -days 360 && tsx src/scripts/generateJWKS.ts",
"seed": "tsx src/seeds/index.ts"
"seed": "tsx src/seeds/index.ts",
"generate-config-docs": "npx tsx src/scripts/generateConfigDocs.ts"
},
"keywords": [],
"author": "",
Expand Down
77 changes: 77 additions & 0 deletions backend/src/scripts/generateConfigDocs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import { mkdirSync, writeFileSync } from 'fs'
import { join, resolve } from 'path'
import ts from 'typescript'

interface DocumentationNode {
name: string
doc: string
type?: string
children: DocumentationNode[]
}

// If a type is an array or a mapping we should give the type of the element or key value
function convertType(tc: ts.TypeChecker, type: ts.Type): ts.Type {
const keyValue = type.getStringIndexType()
if (type.symbol?.name === 'Array') {
const params = tc.getTypeArguments(type as ts.TypeReference)
return params[0]
} else if (keyValue !== undefined) {
return keyValue
} else {
return type
}
}

function buildTree() {
// Compilation list the program will compile these files
const program = ts.createProgram(['src/types/types.ts', 'src/utils/config.ts'], {
target: ts.ScriptTarget.ESNext,
})
const checker = program.getTypeChecker()

function generate(interfaceDecl: ts.Declaration, documentationNode: DocumentationNode[]) {
interfaceDecl.forEachChild((member) => {
if (ts.isPropertySignature(member) && member.type) {
const name = member.name.getText()
const type = checker.typeToString(checker.getTypeFromTypeNode(member.type))
const doc = ts
.getJSDocCommentsAndTags(member)
.map((tag) => tag.comment)
.filter(Boolean)
.join(' ')
if (!doc) {
return
}
const symbol = convertType(checker, checker.getTypeFromTypeNode(member.type)).getSymbol()
const node = { name, type, doc, children: [] }
documentationNode.push(node)
if (symbol && symbol.declarations) {
for (const declaration of symbol.declarations) {
generate(declaration, node.children)
}
}
}
})
return documentationNode
}

const documentation: DocumentationNode[] = []
const sourceFile = program.getSourceFile('src/utils/config.ts')
if (sourceFile) {
ts.forEachChild(sourceFile, (node) => {
if (ts.isInterfaceDeclaration(node) && node.name.text === 'Config') {
generate(node, documentation)
}
})
}
return documentation
}

function script() {
const outDir = resolve(process.cwd(), 'dist')
mkdirSync(outDir, { recursive: true })

writeFileSync(join(outDir, 'config-docs.json'), JSON.stringify({ config: buildTree() }, null, 2), 'utf-8')
}

script()
5 changes: 5 additions & 0 deletions backend/src/services/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@ import log from './log.js'
import { addReviewsForNewRole } from './review.js'

export interface DefaultSchema {
/** Name of the schema that appears */
name: string
/** Unique identifier for the schema */
id: string
/** Description of the schemas functions */
description: string
/** The file to mount the contents of each schema eg. `require('../src/scripts/example_schemas/minimal_model_schema.json')` */
jsonSchema: JsonSchema
/** Roles required to review */
reviewRoles?: string[]
}

Expand Down
Loading
Loading