Commit Graph

890 Commits

Author SHA1 Message Date
lovasoa e60fda48c0 update send mail docs 2026-07-24 23:57:13 +02:00
lovasoa c6554a213d Add HTML body alternative to send_mail
The optional `body_html` field sends a multipart/alternative
message alongside the plain-text `body`, which remains required.
2026-07-24 23:51:43 +02:00
Ophir LOJKINE 889277f942 Support dev profile in Docker builds 2026-07-17 21:46:11 +02:00
Ophir LOJKINE 71d0837117 Link email results to Mailpit 2026-07-17 21:44:52 +02:00
Ophir LOJKINE e71fe455d3 build mail example from repo source 2026-07-17 21:14:34 +02:00
Ophir LOJKINE e8e590d340 Expand sending email example 2026-07-17 15:36:15 +02:00
Ophir LOJKINE 93afed919c Email sending improvement 2026-07-17 15:22:53 +02:00
Ophir LOJKINE 1839738f67 Merge branch 'main' into add-documented-send_mail-function 2026-07-17 13:53:51 +02:00
lovasoa 9659fedede Harden send_mail API and TLS configuration 2026-07-11 00:25:06 +02:00
Ophir LOJKINE 77797c909e Fix SMTP config typo and add TLS mode support
Rename the misspelled `stmp_*` configuration options to `smtp_*`
and add a new `smtp_tls_mode` option (`starttls`, `tls`, `none`)
to control encryption when connecting to the SMTP server. Reject
credentials in plaintext mode.

Change `sqlpage.send_mail` to return its JSON argument unchanged
on success and update the example to use a local Mailpit SMTP
server via Docker Compose.
2026-07-10 18:10:04 +02:00
Ophir LOJKINE 72e695ec4a Add sqlpage.send_mail function and STMP_HOST configuration
### Motivation
- Provide a built-in `sqlpage.send_mail(...)` SQL function so pages can send plain-text emails from SQL code.
- Allow the SMTP server to be configured via an environment / configuration option so the function can target a deployable SMTP endpoint.

### Description
- Added a new function implementation at `src/webserver/database/sqlpage_functions/functions/send_mail.rs` implementing `sqlpage.send_mail(json)` which accepts a JSON object with required `recipient`, `subject`, and `body` and optional `sender` and `reply_to`, sends the message and returns `sent` on success.
- Registered the function in the SQLPage function registry by adding `send_mail` to `src/webserver/database/sqlpage_functions/functions.rs`.
- Added a configuration option `stmp_host: Option<String>` to `AppConfig` in `src/app_config.rs`, with `parse_stmp_host`/`validate_stmp_host` helpers that accept either `host` or `host:port` and default to port 25 when none is provided; validation is run from `AppConfig::validate`.
- Added `lettre` to `Cargo.toml` and updated `Cargo.lock` to enable SMTP sending, and added official-site documentation and a migration at `examples/official-site/sqlpage/migrations/75_send_mail.sql` describing usage and parameters.
- Documented the `stmp_host` option in `configuration.md`.

### Testing
- Ran `cargo fmt --all`, which completed successfully.
- Ran `git diff --check` which reported no immediate style errors.
- Attempted `cargo clippy --all-targets --all-features -- -D warnings`, but it was blocked by a toolchain/build issue (a dependency `libsqlite3-sys` build script uses the unstable `cfg_select` feature) and did not complete.
- Attempted `cargo test`, but it was similarly blocked by the same `libsqlite3-sys` build-script error and did not complete.
2026-07-10 15:54:15 +02:00
Ophir LOJKINE 1ab77de705 Make SQLPage function evaluation deterministic
SQLPage functions that are the whole value of a selected column now
execute after the database query, once per returned row. If the query
returns no rows, the function is not called. This ensures deterministic
behavior and prevents expensive or side-effectful operations from
running unnecessarily.
2026-07-08 10:50:39 +02:00
Christophe CHAUVET 64e86ca737 Fix typo in shell documentation (#1336) 2026-06-25 16:48:30 +02:00
Ophir LOJKINE df306acd82 Emit database query spans as OpenTelemetry clients (#1334)
* Emit database query spans as OTel clients

* Update telemetry example span assertions
2026-06-21 19:52:28 +02:00
Ophir LOJKINE 9db187c82e Enhance tracing exploration instructions
Updated instructions for exploring tracing with a link to the example repository.
2026-06-17 12:26:53 +02:00
Ophir LOJKINE 9ca655fc3a Route access logs to stdout (#1315) 2026-06-12 15:32:39 +02:00
Ophir LOJKINE abd60cd8d2 docs: clarify persist_uploaded_file folder is trusted app input (#1306)
Document that the folder/destination_folder argument of
sqlpage.persist_uploaded_file must be chosen by the app author and never
derived from untrusted request data. It is joined directly to the web
root, so a value containing '..' or an absolute path would write the
uploaded file outside the web root. Docs-only clarification of existing
intended behavior; no logic change.
2026-06-10 16:25:59 +02:00
Ophir LOJKINE 1ffc6d82b8 document select options_source behavior (#1300) 2026-06-08 14:51:33 +02:00
Ophir LOJKINE 9b8a091e60 Strengthen master-detail Hurl flow 2026-06-02 15:56:27 +02:00
Ophir LOJKINE 5e6ff73699 Strengthen telemetry Hurl trace checks 2026-06-02 15:56:27 +02:00
Ophir LOJKINE ab714a4ff1 Strengthen CRUD auth Hurl flow 2026-06-02 15:56:27 +02:00
Ophir LOJKINE af0ca82e6d Strengthen user auth Hurl flow 2026-06-02 15:56:27 +02:00
Ophir LOJKINE 5f8e769716 Fix todo example SQLite permissions 2026-06-02 15:56:27 +02:00
Ophir LOJKINE 9d76d05540 Add PostGIS and official site Hurl flows 2026-06-02 15:56:27 +02:00
Ophir LOJKINE 35ce87fd54 Add SSO and admin example Hurl flows 2026-06-02 15:56:27 +02:00
Ophir LOJKINE 53ff0bd52c Fix telemetry Hurl compose startup 2026-06-02 15:56:27 +02:00
Ophir LOJKINE d254c8c3ae Fix SSO compose and add database Hurl flows 2026-06-02 15:56:27 +02:00
Ophir LOJKINE 0e6a2d023c Fix Hurl runner rebuilds and Pokemon smoke test 2026-06-02 15:56:27 +02:00
Ophir LOJKINE 4fc8247757 Add remote content cards Hurl workflow 2026-06-02 15:56:27 +02:00
Ophir LOJKINE 93d8da560b Add Apache example Hurl workflow 2026-06-02 15:56:27 +02:00
Ophir LOJKINE 868f647375 Add nginx example Hurl workflow 2026-06-02 15:56:27 +02:00
Ophir LOJKINE c2c6b75436 Add React custom scripts Hurl workflow 2026-06-02 15:56:27 +02:00
Ophir LOJKINE 8bb80d165b Add charts custom components Hurl workflow 2026-06-02 15:56:27 +02:00
Ophir LOJKINE fcba5e6680 Add sending emails Hurl smoke test 2026-06-02 15:56:27 +02:00
Ophir LOJKINE f89b678dfb Use htmlUnescape in splitwise Hurl assertions 2026-06-02 15:56:27 +02:00
Ophir LOJKINE 370583d9d9 Add splitwise Hurl workflow 2026-06-02 15:56:27 +02:00
Ophir LOJKINE 5d78aadc04 Add plots tables forms Hurl workflow 2026-06-02 15:56:27 +02:00
Ophir LOJKINE 5a68eddafd Add corporate conundrum Hurl workflow 2026-06-02 15:56:27 +02:00
Ophir LOJKINE dc3187aae2 Add many-to-many form Hurl workflow 2026-06-02 15:56:27 +02:00
Ophir LOJKINE eaa5c1724c Add rich text editor Hurl workflow 2026-06-02 15:56:27 +02:00
Ophir LOJKINE 75ce7d6ce9 Add simple website Hurl workflow 2026-06-02 15:56:27 +02:00
Ophir LOJKINE 2981ff9a40 Add light-dark toggle Hurl workflow 2026-06-02 15:56:27 +02:00
Ophir LOJKINE 00b3e1b425 Add tiny Twitter Hurl workflow 2026-06-02 15:56:27 +02:00
Ophir LOJKINE 14b4bd6f9b Add multiple-choice Hurl workflow 2026-06-02 15:56:27 +02:00
Ophir LOJKINE 530524cd37 Add master-detail Hurl workflow 2026-06-02 15:56:27 +02:00
Ophir LOJKINE 7792fdfc24 Add custom form Hurl workflow 2026-06-02 15:56:27 +02:00
Ophir LOJKINE 6650f52f6f Add cookie example Hurl workflow 2026-06-02 15:56:27 +02:00
Ophir LOJKINE 9cba64c303 Add telemetry Hurl span workflow 2026-06-02 15:56:27 +02:00
Ophir LOJKINE 2d572615d3 Add variable-fields form Hurl workflow 2026-06-02 15:56:27 +02:00
Ophir LOJKINE 5fd4dd5f21 Add CRUD authentication Hurl workflow 2026-06-02 15:56:27 +02:00