Skip to content

Commit

Permalink
Adds a logo
Browse files Browse the repository at this point in the history
  • Loading branch information
nickschuch committed Jan 21, 2025
1 parent 5337280 commit bc0b5e6
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 117 deletions.
108 changes: 8 additions & 100 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,110 +1,18 @@
MTK (MySQL Toolkit)
===================

A toolkit for exporting, sanitizing and packaging MySQL database.

## The Goal of this Project

To provide developers with the tools to share MySQL database dumps in a safe and repeatable manner.

## Example

The following example scenario will showcase how developers can use mtk to dump and package a MySQL image database.

### Dump a Sanitized Database with MTK

**Configuration File**

Prior to packaging, developers should assess the data that is stored within the database and determine what data should be sanitized or dropped.

The following mtk configuration file cover some of common Drupal 7/8 data which should be sanitized or dropped.

```bash
$ cat mtk.yml

---
rewrite:
# Drupal 8.
users_field_data:
mail: concat(uid, "@localhost")
# Quoting here denotes an explicit string rather than mysql expression.
pass: '"password"'
# Drupal 7.
users:
mail: concat(uid, "@localhost")
pass: '"password"'

nodata:
- cache*
- captcha_sessions
- history
- flood
- batch
- queue
- sessions
- semaphore
- search_api_task
- search_dataset
- search_index
- search_total

ignore:
- __ACQUIA_MONITORING__
```

**Dump the database**
A tool designed to guide developers in the right direction for identifying and resolving performance issues.

Now that you have a configuration file, it is time to dump the database.
<img src="/logo/mtk.png" width="100">

The following command will dump a MySQL database using the configuration file created in the previous step.
----

```bash
$ export MTK_HOSTNAME=127.0.0.1
$ export MTK_USERNAME=root
$ export MTK_PASSWORD=password
$ export MTK_CONFIG=mtk.yml

$ mtk-dump test > db.sql
```

### Build a Database Image using Docker

Next we can build a database image using the database dump created by the step prior.

First, create a Dockerfile which will import the sanitized database dump.

In this example we are using MySQL images from our [image repository](https://github.com/skpr/image-mysql).

```dockerfile
FROM docker.io/skpr/mysql:8.x-v3-latest

ADD db.sql /tmp/db.sql
RUN database-import local local local /tmp/db.sql
```

Next, build the image with Docker.

```bash
docker build -t docker.io/my/database:latest .
```

Hooray! You have successfully packaged a sanitized MySQL database image!

### Integrate

The database image can then be integrated into local development workflows using Docker Compose (or similar).

Below is an example of how this can be configured.
A toolkit for exporting, sanitizing and packaging MySQL database.

```bash
$ cat docker-compose.yml
## The Goal of this Project

---
version: "3"
To provide developers with the tools to share MySQL database dumps in a safe and repeatable manner.

services:
## Getting Started

# Services used as part of the local development environment.
mysql:
image: docker.io/my/database:latest
```
See our [documentation site](https://mtk.skpr.io) for a tutorial on how to get started.
19 changes: 3 additions & 16 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ const config = {
locales: ['en'],
},

markdown: {
mermaid: true,
},
themes: ['@docusaurus/theme-mermaid'],


presets: [
[
Expand All @@ -47,22 +44,13 @@ const config = {
({
docs: {
sidebarPath: './sidebars.js',
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
},
blog: {
showReadingTime: true,
feedOptions: {
type: ['rss', 'atom'],
xslt: true,
},
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
// Useful options to enforce blogging best practices
onInlineTags: 'warn',
onInlineAuthors: 'warn',
onUntruncatedBlogPosts: 'warn',
Expand All @@ -77,8 +65,7 @@ const config = {
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// Replace with your project's social card
image: 'img/docusaurus-social-card.jpg',
image: 'img/logo.png',
mermaid: {
theme: {
light: 'default',
Expand All @@ -92,7 +79,7 @@ const config = {
title: 'MTK ',
logo: {
alt: 'MySQL Toolkit Logo',
src: 'img/logo.svg',
src: 'img/logo.png',
},
items: [
{
Expand Down
2 changes: 2 additions & 0 deletions docs/static/img/browserconfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig><msapplication><tile><square70x70logo src="/ms-icon-70x70.png"/><square150x150logo src="/ms-icon-150x150.png"/><square310x310logo src="/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>
Binary file removed docs/static/img/docusaurus-social-card.jpg
Binary file not shown.
Binary file removed docs/static/img/docusaurus.png
Binary file not shown.
Binary file modified docs/static/img/favicon.ico
Binary file not shown.
Binary file added docs/static/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion docs/static/img/logo.svg

This file was deleted.

41 changes: 41 additions & 0 deletions docs/static/img/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "App",
"icons": [
{
"src": "\/android-icon-36x36.png",
"sizes": "36x36",
"type": "image\/png",
"density": "0.75"
},
{
"src": "\/android-icon-48x48.png",
"sizes": "48x48",
"type": "image\/png",
"density": "1.0"
},
{
"src": "\/android-icon-72x72.png",
"sizes": "72x72",
"type": "image\/png",
"density": "1.5"
},
{
"src": "\/android-icon-96x96.png",
"sizes": "96x96",
"type": "image\/png",
"density": "2.0"
},
{
"src": "\/android-icon-144x144.png",
"sizes": "144x144",
"type": "image\/png",
"density": "3.0"
},
{
"src": "\/android-icon-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": "4.0"
}
]
}
Binary file added logo/mtk.ico
Binary file not shown.
Binary file added logo/mtk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added logo/mtk.xcf
Binary file not shown.

0 comments on commit bc0b5e6

Please sign in to comment.