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

Umbrella PR: Content and index page restructuring #94

Merged
merged 85 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
1063109
Restructure index page in API and platform sections
martin-helmich Feb 22, 2024
2ed30c3
Styling for different feature rows
martin-helmich Feb 22, 2024
dc4e041
Make dark mode less... blue
martin-helmich Feb 22, 2024
db81a06
Rename "technologies" to "platform"
martin-helmich Feb 22, 2024
e49711a
Streamline Redis documentation
martin-helmich Feb 22, 2024
383442e
Fix formatting
martin-helmich Feb 26, 2024
d70a205
WIP: Get started on MySQL docs
martin-helmich Feb 26, 2024
6f4df4b
Merge remote-tracking branch 'origin/master' into new-index-page
martin-helmich Apr 8, 2024
4cd2044
v1 API now uses an OpenAPI spec
martin-helmich Apr 10, 2024
213f2bb
Fix styling of links in the main document body
martin-helmich Apr 10, 2024
5fb9638
Restructure application workload documentation
martin-helmich Apr 10, 2024
3ddd7c3
Fix missing key props in node lists
martin-helmich Apr 10, 2024
180879f
Fix broken links
martin-helmich Apr 10, 2024
9ab2f4b
Configure redirects
martin-helmich Apr 10, 2024
c790e7a
Fix link styling, again
martin-helmich Apr 10, 2024
df164a1
Merge deployment & provisioning features, for now
martin-helmich Apr 10, 2024
f10689c
Add link to Python documentation
martin-helmich Apr 10, 2024
cf492be
Reorder database pages
martin-helmich Apr 10, 2024
30b9dbb
Add documentation on MySQL operations
martin-helmich Apr 10, 2024
e50d3eb
Add a rudimentary page on OpenSearch
martin-helmich Apr 10, 2024
614816d
Add links to CLI
martin-helmich Apr 11, 2024
066d8f4
Add translations
martin-helmich Apr 11, 2024
c688623
Merge remote-tracking branch 'origin/master' into next
martin-helmich May 29, 2024
163da66
Bump all Docusaurus packages to the same version
martin-helmich May 29, 2024
f868dd9
Add underline offset to links
martin-helmich Jun 4, 2024
7ba603c
Clean up english translations
martin-helmich Jun 4, 2024
47e1d51
Clean up german translations
martin-helmich Jun 4, 2024
29fe8d5
Document how to re-generate translation files
martin-helmich Jun 4, 2024
0f421f0
Clean up translation labels
martin-helmich Jun 4, 2024
e04a02f
OPC: Auto-generating OpenAPI spec
martin-helmich Jun 4, 2024
7123d26
Automate sidebar generation
martin-helmich Jun 6, 2024
f9dca11
Use @mittwald/flow-react-components
martin-helmich Jun 10, 2024
4667253
Remove "operations" subdirectory
martin-helmich Jun 18, 2024
d7b87bd
Reorder sidebars
martin-helmich Jun 18, 2024
bad7d64
Display operation metadata
martin-helmich Jun 18, 2024
c6cc0d2
Adjust OperationLink component to point to new pages
martin-helmich Jun 18, 2024
745013d
Setup config for multi-version docs
martin-helmich Jun 18, 2024
d9952be
Also generate v1 reference
martin-helmich Jun 18, 2024
ac439f4
Use correct slug for reference category
martin-helmich Jun 18, 2024
c91d2de
Add code examples only on v2 and newer
martin-helmich Jun 18, 2024
4402db7
Remove superflous title on empty request
martin-helmich Jun 18, 2024
932170a
Display versioning banners+badges only for v1 version
martin-helmich Jun 18, 2024
2860278
Add links to new API reference
martin-helmich Jun 18, 2024
d9299e0
Update translation files
martin-helmich Jun 18, 2024
0aeb6d4
Ignore generated reference markdown docs from git
martin-helmich Jun 18, 2024
c5e916e
Clean up old comments
martin-helmich Jun 18, 2024
14a59e8
Fix missing "key" prop in schema view
martin-helmich Jun 18, 2024
7937c67
Add new component to replace redocly schema view
martin-helmich Jun 18, 2024
0684218
Add markdown generation step to build process
martin-helmich Jun 18, 2024
1a62b05
Generate correct example values for idn-email values
martin-helmich Jun 18, 2024
b51fb7e
Ignore generated sidebar
martin-helmich Jun 19, 2024
6521a88
Render API examples statically
martin-helmich Jun 19, 2024
594e608
Formatting
martin-helmich Jun 19, 2024
cee2563
Extract OperationPath
martin-helmich Jun 19, 2024
04601a0
Extract input value formatting components
martin-helmich Jun 19, 2024
a2306b6
Refactor schema component
martin-helmich Jun 19, 2024
e9a0442
Generate description for API reference docs
martin-helmich Jun 19, 2024
29d562c
Refactor generation script
martin-helmich Jun 19, 2024
7d905fd
Get dependencies from public registry
martin-helmich Jun 19, 2024
9037f5a
Bump Node.js dependency to ≥20
martin-helmich Jun 19, 2024
71de0d1
Export specs to source on build
martin-helmich Jun 19, 2024
fbf91c1
Add annotation to Docker feature
martin-helmich Jun 19, 2024
2ecd8b8
Add icons to index page
martin-helmich Jun 19, 2024
94599b8
Purge redocusaurus
martin-helmich Jun 19, 2024
61f8f6c
Fix broken link on API intro page
martin-helmich Jun 19, 2024
b50abd8
Fix broken header levels in german translation
martin-helmich Jun 19, 2024
710d994
Streamline documentation around starting Python apps
martin-helmich Jun 19, 2024
2264e24
Clarify webserver documentation
martin-helmich Jun 19, 2024
42bd5a8
Add .htaccess for redirects
martin-helmich Jun 19, 2024
cd18f91
Quick fix: Example values for oneOf schemas
martin-helmich Jun 19, 2024
cd336a9
Bump @mittwald/flow-react-components
martin-helmich Jun 20, 2024
7016c04
Extract OperationMetadata
martin-helmich Jun 20, 2024
1ea6c55
Update translations
martin-helmich Jun 20, 2024
81b7f67
Set correct CSS variable for dark mode
martin-helmich Jun 20, 2024
e9a5c0c
Render JSON as YAML, so that syntax highlighting works :/
martin-helmich Jun 20, 2024
3f82c3f
Configure redirects in htaccess (again?)
martin-helmich Jun 21, 2024
3a06790
Add docker-compose file for testing htaccess rewrite rules
martin-helmich Jun 21, 2024
9c7f5bb
Fix broken link on Redis page
martin-helmich Jun 21, 2024
6f0f9a1
Adjust root URL of reference page
martin-helmich Jun 21, 2024
67102e8
Unify category slugs
martin-helmich Jun 21, 2024
95208f0
Fix broken links on API intro page
martin-helmich Jun 21, 2024
e421fdf
Add scheduled re-build (to keep up-to-date with API spec changes)
martin-helmich Jun 21, 2024
afadd63
Add missing import
martin-helmich Jun 21, 2024
2cfe19c
Make copy button small
martin-helmich Jun 21, 2024
19843c8
Improve presentation of request parameters
martin-helmich Jun 21, 2024
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
7 changes: 6 additions & 1 deletion .github/workflows/docusaurus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

schedule:
- cron: '0 0 * * *'

jobs:
# Build job
build:
Expand All @@ -19,7 +22,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "18"
node-version: "20"
cache: npm
- name: Restore cache
uses: actions/cache@v4
Expand All @@ -33,6 +36,8 @@ jobs:
${{ runner.os }}-docusaurus-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
- name: Install dependencies
run: npm ci
- name: Generate API reference
run: npm run generate
- name: Build
run: npm run build
- name: Upload Artifact
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Generated by the build process
/sidebar.reference.json
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ You can use the following commands to build this project locally:
- `npm run build` to build a production release (this may be necessary to work with multi-lingual content).
- `npm run serve` to serve a production release locally.

## How-Tos

### Updating translation files

Translation of components is done using [Docuraurus' built-in translation file handling][docu-i18n]. To update the translation files, you can use the following steps:

```
$ npm run docusaurus write-translations
$ npm run docusaurus write-translations -- -l de
```

[md]: https://www.markdownguide.org
[mdx]: https://mdxjs.com
[docu-md]: https://docusaurus.io/docs/markdown-features
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM httpd:2.4-alpine

RUN echo -e "<Directory /usr/local/apache2/htdocs>\n AllowOverride All\n</Directory>" >> /usr/local/apache2/conf/httpd.conf
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: "3"
services:
web:
build: .
volumes:
- ./build:/usr/local/apache2/htdocs/
ports:
- "3000:80"
20 changes: 13 additions & 7 deletions docs/api/howtos/create-nodejs.mdx
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
---
sidebar_label: Installing a Node.js application
title: Installing a Node.js application using the API
description: Learn how to install a Node.js application via the mStudio API
sidebar_label: Installing a Node.js or Python application
title: Installing a Node.js or Python application using the API
description: Learn how to install an application that starts its own webserver (like Node.js or Python) via the mStudio API
tags:
- Node.js
- Python
---

import OperationHint from "@site/src/components/OperationHint";

## Prerequisites

To install a Node.js application, you will need to have the following:
To install a Node.js or Python application, you will need to have the following:

- The project ID of an existing project ([how to create a project](../create-project))
- The application and version ID of the generic custom Node.js application (see next section)
- The application and version ID of the generic custom Node.js/Python application (see next section)

## Determine the app and app version ID

Before installing a Node.js application, you will need to determine the application ID and version ID of the generic custom Node.js application.
Before installing a Node.js or Python application, you will need to determine the application ID and version ID of the generic custom Node.js (or Python, respectively) application.

For this, call the `/v2/apps` endpoint, and find the "Node.js" application. It should have a stable ID of `3e7f920b-a711-4d2f-9871-661e1b41a2f0`. You can then use that ID to retrieve the recommended version to install for this app, by calling the `/v2/apps/{appID}/versions` endpoint. You can filter the returned versions by the `recommended` property.
For this, call the `/v2/apps` endpoint, and find the "Node.js" or "Python" application. These should have the following stable IDs:

- Node.js: `3e7f920b-a711-4d2f-9871-661e1b41a2f0`
- Python: `be57d166-dae9-4480-bae2-da3f3c6f0a2e`

Use the respective ID, depending on whether you want to install a Node.js or Python application. You can then use that ID to retrieve the recommended version to install for this app, by calling the `/v2/apps/{appID}/versions` endpoint. You can filter the returned versions by the `recommended` property.

Please note that the actual version is rather inconsequential, as it refers only to the starter template used to create the application. The actual version of the application will be determined by your own code.

Expand Down
3 changes: 2 additions & 1 deletion docs/api/howtos/create-redis.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tags:
---

import OperationHint from "@site/src/components/OperationHint";
import OperationLink from "@site/src/components/OperationLink";

This article describes how to create a Redis database via the API.

Expand All @@ -17,7 +18,7 @@ To create a Redis database, you will need to have access to a project. Refer to

## List available Redis versions

Set a `GET` request to the `/v2/redis-versions` endpoint to get a list of available Redis versions. ([endpoint documentation for `database-list-redis-versions`](https://developer.mittwald.de/reference/v2#tag/Database/operation/database-list-redis-versions))
Set a `GET` request to the `/v2/redis-versions` endpoint to get a list of available Redis versions. (<OperationLink tag="database" operation="database-list-redis-versions">endpoint documentation for `database-list-redis-versions`</OperationLink>)

## Creating a Redis database

Expand Down
22 changes: 11 additions & 11 deletions docs/api/howtos/manage-mailbox.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ tags:
- Email
---

import ApiSchema from "@theme/ApiSchema";
import OperationHint from "@site/src/components/OperationHint";
import SchemaFromSpec from "@site/src/components/openapi/SchemaFromSpec";

## Types of mailboxes

Expand All @@ -25,10 +25,10 @@ To manage email accounts, you will need an existing project. You can create a ne

To create a new email account, send a `POST` request to the `/v2/projects/{projectID}/mailaddresses` endpoint. The request body must contain a JSON object with the following properties:

<ApiSchema
example
id="v2"
pointer="#/components/schemas/de.mittwald.v1.mail.CreateMailAddress"
<SchemaFromSpec
apiVersion="v2"
path="#/components/schemas/de.mittwald.v1.mail.CreateMailAddress"
withExample
/>

:::caution
Expand All @@ -37,16 +37,16 @@ Take note of the password you set for the email account. You will not be able to

:::

<OperationHint tag="Mail" operation="mail-mailaddress-create" />
<OperationHint tag="Mail" operation="mail-create-mail-address" />

## Create a new forwarding address

A forwarding address is an email address that forwards all incoming emails to one or more other email addresses. To create a new forwarding address, send a `POST` request to the `/v2/projects/{projectID}/mailaddresses` endpoint. The request body must contain a JSON object with the following properties:

<ApiSchema
example
id="v2"
pointer="#/components/schemas/de.mittwald.v1.mail.CreateForwardAddress"
<SchemaFromSpec
apiVersion="v2"
path="#/components/schemas/de.mittwald.v1.mail.CreateForwardAddress"
withExample
/>

## Create a new delivery box
Expand All @@ -62,7 +62,7 @@ Take note of the password you set for the delivery box. You will not be able to

:::

<OperationHint tag="Mail" operation="mail-deliverybox-create" />
<OperationHint tag="Mail" operation="mail-create-deliverybox" />

## Deleting email accounts

Expand Down
2 changes: 1 addition & 1 deletion docs/api/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The mStudio v2 API uses `https://api.mittwald.de/v2/` as base URL for all API en
You can find the full API specification in the [OpenAPI 3.0 format](https://spec.openapis.org/oas/v3.0.0) here:

1. [OpenAPI 3.0 specification](https://api.mittwald.de/openapi) (machine-readable)
2. [Rendered HTML documentation](/reference/v2) (human-readable)
2. [Rendered HTML documentation](../../reference) (human-readable)

## Authentication

Expand Down
52 changes: 26 additions & 26 deletions docs/api/sdks/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,43 +86,43 @@ A few commands (like `mw [app|project] download`, `mw [app|project] ssh` and som

1. **If you already have an existing SSH private key**, you can import the public key to your mStudio account with the following command:

```
$ mw user ssh-key import
```
```
$ mw user ssh-key import
```

2. **To create and import a new SSH keypair**, you can use the following command:

```
$ mw user ssh-key create
```
```
$ mw user ssh-key create
```

Usually, the key pair should be used automatically by the CLI. To explicitly specify the key pair to use (for example, if you receive a `too many authentication failures` error), you have a few options:

1. All commands that require an SSH connection respect your systems [SSH configuration](https://linux.die.net/man/5/ssh_config) (typically in `~/.ssh/config`). You can specify the key to use for a specific host like this:

```txt title="~/.ssh/config"
Host *.project.host
IdentityFile ~/.ssh/mstudio-cli
```
```txt title="~/.ssh/config"
Host *.project.host
IdentityFile ~/.ssh/mstudio-cli
```

2. Alternatively, all commands that require an SSH connection accept a `--ssh-identity-file` flag that you can use to specify the key to use:

```
$ mw app download ... --ssh-identity-file="~/.ssh/mstudio-cli"
```
```
$ mw app download ... --ssh-identity-file="~/.ssh/mstudio-cli"
```

3. Instead of the `--ssh-identity-file` flag, you can also set the `MITTWALD_SSH_IDENTITY_FILE` environment variable to specify the key to use:

```
$ export MITTWALD_SSH_IDENTITY_FILE=~/.ssh/mstudio-cli
$ mw app download ...
```
You can also set the `MITTWALD_SSH_IDENTITY_FILE` environment variable in your shell profile (`~/.zshrc` or `~/.bashrc`) to make it available in every shell session:
```
$ export MITTWALD_SSH_IDENTITY_FILE=~/.ssh/mstudio-cli
$ mw app download ...
```

You can also set the `MITTWALD_SSH_IDENTITY_FILE` environment variable in your shell profile (`~/.zshrc` or `~/.bashrc`) to make it available in every shell session:

```
$ echo 'export MITTWALD_SSH_IDENTITY_FILE=~/.ssh/mstudio-cli' >> ~/.zshrc
```
```
$ echo 'export MITTWALD_SSH_IDENTITY_FILE=~/.ssh/mstudio-cli' >> ~/.zshrc
```

## General usage

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
label: Technologies
label: Platform
position: 1
link:
type: generated-index
116 changes: 116 additions & 0 deletions docs/platform/databases/mysql.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
---
title: MySQL
sidebar_position: 10
description: |
MySQL is an open-source relational database management system (RDBMS). It is a popular choice for web applications and is often used in combination with PHP. This guide will help you get started with MySQL on your mittwald space.
---

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import OperationHint from "@site/src/components/OperationHint";

## Creating a MySQL database

<Tabs groupId="access-mode">
<TabItem value="gui" label="mStudio UI">
To create a MySQL database in the mStudio, follow these steps:

1. Navigate to the project that you want to create the database in.
2. Select the "Databases" menu item in the sidebar.
3. Click the "Create Database" button and select "MySQL".
4. Enter a description for the database, select the desired version and choose a password for the database user.

After the installation has completed, observe the host and port in the details under connection information. You
need both for the configuration of your system.

</TabItem>
<TabItem value="cli" label="CLI">
To create a MySQL database from the CLI, run the following commands:

```bash
$ mw database mysql create --description "My MySQL database" --version 8.0
```

This command will prompt you to enter a password for the database user. To skip the prompt, use the `--password` option (be careful, because this will store the password in your shell history), or set the `MYSQL_PWD` environment variable, first:

```bash
$ read -s MYSQL_PWD
$ export MYSQL_PWD
$ mw database mysql create ...
```

There are additional flags that you can provide to set additional options:

- `--character-set` and `--collation` to set the [character set and collation](https://dev.mysql.com/doc/refman/8.0/en/charset-mysql.html) for the database. These default to `utf8mb4` and `utf8mb4_unicode_ci`, respectively. Usually, there is little reason to change these, except when migrating from an existing database.
- `--user-access-level` allows you to restrict the permissions of the database user. The default is `full`, which grants all permissions. You can also choose `readonly`.
- `--user-external` allows you to create a user that can connect from outside the mittwald cloud platform. This is disabled by default.

After the installation has completed, use the `mw database mysql get` command to observe the connection information.

</TabItem>
<TabItem value="api" label="API">

<OperationHint tag="Database" operation="database-create-mysql-database" />

</TabItem>
</Tabs>

## Operational concerns

### Managed backup and recovery

The mittwald cloud platform automatically creates backups of your projects and their databases at regular intervals. You can inspect the available backups as any time using the mStudio UI or the [`mw` CLI][cli], using the `mw backup list` command. You can also create a backup manually using the `mw backup create` command:

```shellsession title="Local shell session"
$ mw backup create --wait --expires 30d
```

To recover the contents of a single MySQL database, you can follow the following steps:

1. Download a backup to your local machine:

```shellsession title="Local shell session"
$ mw backup download <backup-id> --format tar --output backup.tar.gz
```

2. After downloading the backup, you can extract the database contents from the downloaded archive:

```shellsession title="Local shell session"
$ database_id=<database-id>
$ tar xfz backup.tar.gz dbdump-${database_id/_/-}
```

:::note Note that in the archive files, the database ID is spelled differently. Whereas it usually follows the format `mysql_XXXXXX`, in the archive, it is spelled with dashes instead of underscores, like `mysql-XXXXXX`. :::

3. Recover the backup using the `mw database mysql import` command. For this, you need to have an SSH key set up on your local machine, which is also linked to your mStudio user account.

```shellsession title="Local shell session"
$ database_id=<database-id>
$ mw database mysql import ${database_id} --input dbdump-${database_id/_/-}/*.sql.gz --gzip
```

### Manual backup and recovery

You can use the [`mw` CLI][cli] to manually create (and restore) backups of your MySQL database. As a prerequisite, you need to have an SSH key set up on your local machine, which is also linked to your mStudio user account.

To create a backup, run the following command:

```shellsession title="Local shell session"
$ mw database mysql dump <database-id> --output dump.sql.gz --gzip
```

In this command, replace `<database-id>` with the ID of the MySQL database you want to back up. The `--gzip` flag compresses the backup file, which can save disk space and reduce transfer times.

:::tip

If you want to create the backup with a different user than the one you are currently logged in with, you can use the `--ssh-user` flag to specify a different user for the SSH connection. However, you still need to make sure that an SSH key is set up on your local machine for that user.

:::

To restore a backup, run the following command:

```shellsession title="Local shell session"
$ mw database mysql import <database-id> --input dump.sql.gz --gzip
```

[cli]: /docs/v2/api/sdks/cli
Loading