You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dispatch the model layer between sqlx-mysql and sqlx-postgres based on
the connection URL scheme, and split schema DDL into per-backend files
(mysql_schema.rs / postgres_schema.rs). Config gains a `[database]`
section with a `backend = "mysql" | "postgres"` selector for the split
-field path; `[mysql]` is still accepted as a compatibility fallback.
Rename the preferred environment variable from MYSQL_CONNECTION_URL to
DATABASE_URL across the Fly.io workflow and docker-compose, while still
accepting the legacy name at the config layer so existing deployments
keep working.
Signed-off-by: JmPotato <github@ipotato.me>
Copy file name to clipboardExpand all lines: README.md
+25-5Lines changed: 25 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,29 +19,49 @@ rsomhaP is still a simple ready-to-use blog engine inheriting a lot from its pre
19
19
But also introduces some new features:
20
20
21
21
- More secure admin authentication.
22
-
- Use any MySQL-compatible database to store your blog data.
22
+
- Use either MySQL or PostgreSQL to store your blog data.
23
23
- Easy to deploy with a single command or a simple [Dockerfile](https://github.com/JmPotato/rsomhaP/blob/main/Dockerfile).
24
24
25
25
## Deployment
26
26
27
27
Edit your [`config.toml`](https://github.com/JmPotato/rsomhaP/blob/main/config.toml) to your liking, then run:
28
28
29
+
When you use the split fields under `[database]`, set `backend = "mysql"` or `backend = "postgres"`.
30
+
If you provide `connection_url` in the config or `DATABASE_URL` in the environment, that full URL wins and its scheme still selects the driver:
31
+
32
+
-`mysql://...` for MySQL
33
+
-`postgres://...` / `postgresql://...` for PostgreSQL
34
+
35
+
Upgrade note:
36
+
37
+
-`DATABASE_URL` is the preferred environment variable.
38
+
- Legacy `MYSQL_CONNECTION_URL` is still accepted as a compatibility fallback.
39
+
- Legacy `[mysql]` config still parses, but `[database]` is the preferred section name going forward.
40
+
- The default sample config binds to `0.0.0.0` so Docker and public deployments work out of the box. If you want local-only access, change `[deploy].host` to `127.0.0.1`.
41
+
29
42
```sh
30
43
cargo run --release
31
44
```
32
45
33
-
Or build a Docker image and run it:
46
+
Or build a Docker image and run it. The container still needs a reachable
47
+
database; the simplest path is to pass `DATABASE_URL` explicitly:
Access the admin page at "http://{your-deployment-url}/admin" to manage your blog. The initial password is the same as the username configured in [`config.toml`](https://github.com/JmPotato/rsomhaP/blob/62dd746dfd6f7413d161a1fde79b82a0589b241b/config.toml#L14), **which you should change after the first login as soon as possible.**.
56
+
If you prefer the split fields in `config.toml`, make sure the container can
57
+
actually reach that host. The default `127.0.0.1:4000` example works for a
58
+
local host process, but inside Docker `127.0.0.1` means the container itself.
59
+
60
+
Access the admin page at "http://{your-deployment-url}/admin" to manage your blog. The initial password is the same as the username configured in [`config.toml`](./config.toml), **which you should change after the first login as soon as possible.**.
41
61
42
62
Technically, you can deploy rsomhaP with modern SaaS infrastructures entirely free from scratch. For example:
43
63
44
-
- Use [TiDB Serverless](https://www.pingcap.com/tidb-serverless)as the MySQL-compatible database.
64
+
- Use [TiDB Serverless](https://www.pingcap.com/tidb-serverless)for a MySQL deployment, or any managed PostgreSQL service for a Postgres deployment.
45
65
- Use [fly.io](https://fly.io) as the hosting service.
46
66
- Use [Cloudflare R2](https://www.cloudflare.com/developer-platform/r2) as the image hosting service.
47
67
- Use [WebP Cloud Services](https://webp.se) as the image proxy service.
0 commit comments