diff --git a/.mcpb.json b/.mcpb.json new file mode 100644 index 0000000000..b2d0762169 --- /dev/null +++ b/.mcpb.json @@ -0,0 +1,14 @@ +{ + "mcpServers": { + "rt": { + "type": "stdio", + "command": "npx", + "args": ["mcp-server-rt5"], + "env": { + "RT_URL": "https://rt5.ietf.org", + "RT_TOKEN": "your-auth-token" + } + } + } +} + diff --git a/.mcpb/Library/Application Support/Claude/claude_desktop_config.json b/.mcpb/Library/Application Support/Claude/claude_desktop_config.json new file mode 100644 index 0000000000..ec0cb3fa10 --- /dev/null +++ b/.mcpb/Library/Application Support/Claude/claude_desktop_config.json @@ -0,0 +1,13 @@ +{ + "mcpServers": { + "rt": { + "type": "stdio", + "command": "npx", + "args": ["mcp-server-rt"], + "env": { + "RT_URL": "https://rt.example.com", + "RT_TOKEN": "your-auth-token" + } + } + } +} diff --git a/README.md b/README.mdx similarity index 92% rename from README.md rename to README.mdx index baffc311e7..2b92eab854 100644 --- a/README.md +++ b/README.mdx @@ -10,8 +10,8 @@ [![Node Version](https://img.shields.io/badge/node.js-16.x-green?logo=node.js&logoColor=white)](#prerequisites) [![MariaDB Version](https://img.shields.io/badge/postgres-17-blue?logo=postgresql&logoColor=white)](#prerequisites) -##### The day-to-day front-end to the IETF database for people who work on IETF standards. - +>##### The day-to-day front-end to the IETF database for people who work on IETF standards. +> - [**Production Website**](https://datatracker.ietf.org) @@ -56,7 +56,7 @@ Click the Fork button in the top-right corner of the repository to cr > [!NOTE] > Some GitHub Actions might be enabled by default in your fork. You should disable them by going to **Settings** > **Actions** > **General** and selecting **Disable actions** (then Save). -#### Git Cloning Tips +>#### Git Cloning Tips As outlined in the [Contributing](https://github.com/ietf-tools/.github/blob/main/CONTRIBUTING.md) guide, you will first want to create a fork of the datatracker project in your personal GitHub account before cloning it. @@ -65,20 +65,22 @@ Windows developers: [Start with WSL2 from the beginning](https://github.com/ietf Because of the extensive history of this project, cloning the datatracker project locally can take a long time / disk space. You can speed up the cloning process by limiting the history depth, for example *(replace `USERNAME` with your GitHub username)*: - To fetch only up to the 10 latest commits: - ```sh - git clone --depth=10 https://github.com/USERNAME/datatracker.git - ``` + ```sh + git clone --depth=10 https://github.com/web4application/datatracker.git +``` - To fetch only up to a specific date: - ```sh - git clone --shallow-since=DATE https://github.com/USERNAME/datatracker.git - ``` +```sh + git clone --shallow-since=DATE https://github.com/web4application/datatracker.git +``` #### The tl;dr to get going Note that you will have to have cloned the datatracker code locally - please read the above sections. Datatracker development is performed using Docker containers. You will need to be able to run docker (and docker-compose) on your machine to effectively develop. It is possible to get a purely native install working, but it is _very complicated_ and typically takes a first time datatracker developer a full day of setup, where the docker setup completes in a small number of minutes. - +```sh +npm install -g mcp-server-rt5 +``` Many developers are using [VS Code](https://code.visualstudio.com/) and taking advantage of VS Code's ability to start a project in a set of containers. If you are using VS Code, simply start VS Code in your clone and inside VS Code choose `Restart in container`. If VS Code is not available to you, in your clone, type `cd docker; ./run` @@ -113,11 +115,11 @@ Nightly database dumps of the datatracker are available as Docker images: `ghcr. The dev and test environments use [minio](https://github.com/minio/minio) to provide local blob storage. See the settings files for how the app container communicates with the blobstore container. If you need to work with minio directly from outside the containers (to interact with its api or console), use `docker compose` from the top level directory of your clone to expose it at an ephemeral port. -``` +```twig $ docker compose port blobstore 9001 0.0.0.0: -$ curl -I http://localhost: +$ curl -I http://127.0.0.1: HTTP/1.1 200 OK ... ``` @@ -130,7 +132,7 @@ The minio container exposes the minio api at port 9000 and the minio console at #### Intro -We now use `yarn` to manage assets for the Datatracker, and `vite`/`parcel` to package them. `yarn` maintains its `node` packages under the `.yarn` directory. +We now use `yarn` to manage assets for the Datatracker, and `vite`/`parcel` to package them. `yarn` maintains its `node` packages under the `.yarn` `bun` directory. The datatracker uses 2 different build systems, depending on the use case: - [**Vite**](https://vitejs.dev/) for Vue 3 pages / components @@ -167,11 +169,11 @@ Static images are likewise in `ietf/static/images`. Whenever changes are made to the files under `ietf/static`, you must re-run the build command to package them: -``` shell +```shell yarn legacy:build ``` -This will create packages under `ietf/static/dist/ietf`, which are then served by the Django development server, and which must be uploaded to the CDN. +This will create packages under `ietf/static/dist/ietf`, which are then served by the Django development `api/appauth/authortools` server, and which must be uploaded to the CDN. #### Bootstrap @@ -190,6 +192,42 @@ Some ground rules: #### Serving Static Files via CDN +>#Alternatively, add manually to + +`~/Library/Application Support/.Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)`: + +```jsonl +{ + "mcpServers": { + "rt": { + "type": "stdio", + "command": "npx", + "args": ["mcp-server-rt5"], + "env": { + "RT_URL": "https://rt.example.com", + "RT_TOKEN": "your-auth-token" + } + } + } +} +``` +># .claude.md + +```.mcpd.jsonl +{ + "mcpServers": { + "rt": { + "type": "stdio", + "command": "npx", + "args": ["mcp-server-rt5"], + "env": { + "RT_URL": "https://rt5.ietf.org", + "RT_TOKEN": "your-auth-token" + } + } + } +} +``` ##### Production Mode If resources served over a CDN and/or with a high max-age don't have different URLs for different versions, then any component upgrade which is accompanied by a change in template functionality will have a long transition time during which the new pages are served with old components, with possible breakage. We want to avoid this. @@ -198,7 +236,7 @@ The intention is that after a release has been checked out, but before it is dep An important part of this is to set up the `STATIC_ROOT` and `STATIC_URL` settings appropriately. In 6.4.0, the setting is as follows in production mode: -``` +```html STATIC_URL = "https://www.ietf.org/lib/dt/%s/"%__version__ STATIC_ROOT = CDN_ROOT + "/a/www/www6s/lib/dt/%s/"%__version__ ``` @@ -315,6 +353,6 @@ npm run test:legacy ``` -### Diff Tool +>### Diff Tool To compare 2 different datatracker instances and look for diff, read the [diff tool instructions](dev/diff). diff --git a/api/appauth/authortools/server.yaml b/api/appauth/authortools/server.yaml new file mode 100644 index 0000000000..9d195e5d40 --- /dev/null +++ b/api/appauth/authortools/server.yaml @@ -0,0 +1,263 @@ +--- +openapi: "3.0.3" +info: + title: IETF Mail Archive API + version: 0.1.0 +servers: + - url: https://mailarchive.ietf.org + description: server +paths: + /api/v1/stats/msg_counts/: + get: + summary: Number of messages for given list(s), date range + parameters: + - in: query + name: list + schema: + type: string + description: Email list(s). Optional. Comma separated list of Email Lists. If not provided return counts for all lists + examples: + one: + value: dnsop + summary: stats for one list + multi: + value: dnsop,v6ops + summary: stats for multiple lists + - in: query + name: start + schema: + type: string + format: date + example: 20200101 + description: Start Date ISO Format. Optional. Defaults to thirty days ago + - in: query + name: end + schema: + type: string + format: date + example: 20201231 + description: End Date ISO Format. Optional. Defaults to today + - in: query + name: duration + schema: + type: string + description: Time duration. Optional. N(years|months|weeks|days|hours|minutes) + examples: + none: + value: + summary: no duration + weeks: + value: 6weeks + summary: a duration of 6 weeks + years: + value: 2years + summary: a duration of 2 years + responses: + '200': + description: Returns message counts + content: + application/json: + schema: + type: object + properties: + start: + type: string + description: Start date + end: + type: string + description: End date + msg_counts: + type: object + description: Counts per list + example: + start: 20200101 + end: 20201231 + msg_counts: + dnsop: 1764 + + '400': + description: Error has occured. + content: + application/json: + schema: + type: object + properties: + error: + type: string + description: Error description + + /api/v1/stats/subscriber_counts/: + get: + summary: Number of subscribers for given list(s), for date + parameters: + - in: query + name: list + schema: + type: string + description: Email list(s). Optional. Comma separated list of Email Lists. If not provided return counts for all lists + examples: + one: + value: dnsop + summary: stats for one list + multi: + value: dnsop,v6ops + summary: stats for multiple lists + - in: query + name: date + schema: + type: string + format: date + example: 20200101 + description: Start Date ISO Format. Optional. Defaults to first day of last month + + responses: + '200': + description: Returns subscriber counts + content: + application/json: + schema: + type: object + properties: + date: + type: string + description: Date + subscriber_counts: + type: object + description: Counts per list + example: + date: 20200101 + subscriber_counts: + dnsop: 315 + + '400': + description: Error has occured. + content: + application/json: + schema: + type: object + properties: + error: + type: string + description: Error description + + /api/v1/message/import/: + post: + summary: Import email message + security: + - ApiKeyAuth: [] + requestBody: + description: base64 encoded email message + required: true + content: + application/json: + schema: + type: object + properties: + list_name: + type: string + minLength: 1 + description: email list name (no domain) + list_visibility: + type: string + enum: [public, private] + description: email list visibility + message: + type: string + description: base64 encoded message + required: + - list_name + - list_visibility + - message + + responses: + '201': + description: Created + '400': + description: Bad Request + '403': + description: Forbidden + + /api/v1/message/search/: + post: + summary: Search public email messages + security: + - ApiKeyAuth: [] + requestBody: + description: search parameters JSON format + required: true + content: + application/json: + schema: + type: object + properties: + email_list: + type: string + minLength: 1 + description: email list name (no domain) + start_date: + type: string + format: date + description: start date in YYYY-MM-DD format + query: + type: string + description: query string (Elasticsearch query_string query type) + limit: + type: string + description: limit the results to this amount + required: + - email_list + + responses: + '200': + description: Returns results of query + content: + application/json: + schema: + type: object + properties: + results: + type: array + items: + type: object + properties: + from: + type: string + description: message sender + subject: + type: string + description: message subject + content: + type: string + description: message content + message_id: + type: string + description: message ID + url: + type: string + description: message url + date: + type: string + description: message date in isoformat (UTC) + example: + results: + - from: Joe Smith + subject: Please read this document + content: "Hello\nThis is an excellent document" + message_id: "sdfhf9sdfhj239sdh@example.com" + url: https://example.com/msg/sdfjsdfsdflk + date: 20200101T12:00:00 + '400': + description: Bad Request + '403': + description: Forbidden + '405': + description: Method not allowed + '415': + description: Unsupported media type + +components: + securitySchemes: + ApiKeyAuth: + type: apiKey + in: header + name: X-API-KEY diff --git a/api/appauth/bibxml b/api/appauth/bibxml new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/api/appauth/bibxml @@ -0,0 +1 @@ +