zhangjiayin / caddy-mysql-storage

certmagic-sqlstorage/ postgres-storage fork for caddy server support MySQL Storage
6 stars 0 forks source link

certmagic-sqlstorage

GoDoc GoDoc

SQL storage for CertMagic/Caddy TLS data.

Currently supports MySQL but it'd be pretty easy to support other RDBs like SQLite and MySQL. Please make a pull-request if you add support for them and I'll gladly merge.

Now with support for Caddyfile and environment configuration.

Example

With vanilla JSON config file and single connection string:

{
      "storage": {
        "module": "mysql",
        "dsn": "caddy_user:caddy_password@tcp(127.0.0.1:3306)/caddy?charset=utf8mb4"
      }
      "app": {
            ...
      }
}

With Caddyfile:

# Global Config

{
    storage mysql {
        dsn caddy_user:caddy_password@tcp(127.0.0.1:3306)/caddy?charset=utf8mb4
    }
}

From Environment:

MYSQL_DSN

From build

xcaddy build \
    --with github.com/zhangjiayin/caddy-mysql-storage           \
    --with github.com/caddy-dns/cloudflare

LICENSE

MIT