Deploy Ladill Woo Manager / deploy (push) Successful in 1m23s
Mirror platform mail.php scheme normalization and sync MAIL_* transport vars from ladill.com shared .env on each deploy. Co-authored-by: Cursor <cursoragent@cursor.com>
82 lines
2.9 KiB
Markdown
82 lines
2.9 KiB
Markdown
# Ladill Woo Manager — deploy runbook
|
|
|
|
Standalone app for **WooCommerce order fulfillment** at `woo.ladill.com`.
|
|
Merchants connect stores via the Ladill WordPress plugin (Sign in with Ladill).
|
|
Payments stay in WooCommerce — this app only syncs orders and fulfillment status.
|
|
|
|
---
|
|
|
|
## 0. Prerequisites
|
|
|
|
| Secret | Where |
|
|
|---|---|
|
|
| `LADILL_SSO_CLIENT_ID` / `LADILL_SSO_CLIENT_SECRET` | `passport:client` on platform |
|
|
| `BILLING_API_KEY_WOO_MANAGER` | platform `.env` + this app |
|
|
| `IDENTITY_API_KEY_WOO_MANAGER` | platform `.env` + this app |
|
|
| `WOO_MANAGER_PLUGIN_CLIENT_ID` / `WOO_MANAGER_PLUGIN_CLIENT_SECRET` | OAuth client for WP plugin (future) |
|
|
|
|
## 1. Gitea repo + CI
|
|
|
|
1. Repo: **ladill-woo-manager**
|
|
2. Push to `main` triggers `.gitea/workflows/deploy.yml`.
|
|
3. App root: `/var/www/ladill-woo-manager`
|
|
|
|
## 2. Server app-slot + database
|
|
|
|
```bash
|
|
sudo install -d -o deploy -g www-data /var/www/ladill-woo-manager
|
|
sudo install -d -o deploy -g www-data /var/www/ladill-woo-manager/{releases,shared}
|
|
sudo mysql -e "CREATE DATABASE ladill_woo_manager CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
|
|
sudo mysql -e "CREATE USER 'ladill_woo_manager'@'127.0.0.1' IDENTIFIED BY '<pw>';"
|
|
sudo mysql -e "GRANT ALL ON ladill_woo_manager.* TO 'ladill_woo_manager'@'127.0.0.1'; FLUSH PRIVILEGES;"
|
|
```
|
|
|
|
## 3. Register OIDC client (platform)
|
|
|
|
```bash
|
|
php artisan passport:client \
|
|
--name="Ladill Woo Manager" \
|
|
--redirect_uri="https://woo.ladill.com/sso/callback"
|
|
```
|
|
|
|
## 4. Platform integration
|
|
|
|
```env
|
|
BILLING_API_KEY_WOO_MANAGER=<same>
|
|
IDENTITY_API_KEY_WOO_MANAGER=<same>
|
|
RP_WOO_MANAGER_FRONTCHANNEL_LOGOUT=https://woo.ladill.com/sso/logout-frontchannel
|
|
LADILL_WOO_MANAGER_APP_URL=https://woo.ladill.com
|
|
```
|
|
|
|
Add `woo` to `config/pdns.php` service subdomains via `php artisan ladill:onboard-app woo --run-dns`.
|
|
|
|
## 4b. SMTP (monolith)
|
|
|
|
Production deploy syncs `MAIL_MAILER`, `MAIL_HOST`, `MAIL_PORT`, `MAIL_USERNAME`,
|
|
`MAIL_PASSWORD`, and related transport vars from `/var/www/ladill.com/shared/.env`
|
|
into this app's shared `.env` on each release. Set `MAIL_FROM_NAME` locally if you
|
|
want a Woo-specific sender name; `config/mail.php` defaults to `APP_NAME`.
|
|
|
|
## 5. nginx + TLS
|
|
|
|
```bash
|
|
sudo deployment/setup-service-subdomain-nginx.sh woo --app /var/www/ladill-woo-manager/current
|
|
```
|
|
|
|
## 6. First deploy
|
|
|
|
```bash
|
|
cd /var/www/ladill-woo-manager/current
|
|
php artisan migrate --force
|
|
php artisan config:cache route:cache view:cache
|
|
```
|
|
|
|
## WordPress plugin flow
|
|
|
|
1. Merchant installs **Ladill Woo Manager** plugin on their WooCommerce store.
|
|
2. Plugin redirects to `https://woo.ladill.com/connect/wordpress?site_url=…&return_url=…`
|
|
3. Merchant signs in with Ladill; store is registered and an install token is returned.
|
|
4. Plugin calls `POST /api/v1/stores/activate` with the install token.
|
|
5. Plugin registers WooCommerce webhooks to `https://woo.ladill.com/webhooks/woocommerce/{store_id}`.
|
|
6. Orders appear in Woo Manager; fulfillment updates push back to the plugin REST API.
|