Skip to content

Commit c2b8e0b

Browse files
authored
Merge pull request #1437 from shopware/cursor/paas-compose-redis-rustfs-705c
feat: generate Redis and RustFS for PaaS project-dev compose
2 parents 18dfbf7 + a4bb3b7 commit c2b8e0b

21 files changed

Lines changed: 660 additions & 140 deletions

.github/workflows/smoke-test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
- main
66
pull_request:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
run:
1013
runs-on: ubuntu-latest

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ environments:
102102
103103
Omit `-e` / `--env` to target `environments.local`. Use `-e staging` (or another name) to target a different environment.
104104

105-
`shopware-cli project create` and `shopware-cli project config init` write `environments.local`. Top-level `url` and `admin_api` are deprecated: existing files that still use them keep working until that support is removed, and mixed files (top-level shop plus `environments.local`) are not silently retargeted.
105+
`shopware-cli project create` and `shopware-cli project config init` write `environments.local`. Top-level `url` and `admin_api` are deprecated: they are used only when `environments.local` is absent. When both are present, `environments.local` wins.
106106

107107
### Disable update notifications
108108

cmd/project/project.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var (
1111
environmentName string
1212
)
1313

14-
const environmentFlagUsage = "Environment to target (defaults to environments.local; deprecated top-level url/admin_api is still used when present)"
14+
const environmentFlagUsage = "Environment to target (defaults to environments.local; deprecated top-level url/admin_api is used when environments.local is absent)"
1515

1616
var projectRootCmd = &cobra.Command{
1717
Use: "project",

cmd/project/project_env_resolution_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ admin_api:
8989
environments:
9090
local:
9191
url: http://127.0.0.1:7
92+
admin_api:
93+
client_id: local-id
94+
client_secret: local-secret
9295
`), 0o644))
9396

9497
previousConfigPath := projectConfigPath

cmd/project/project_proxy.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"strings"
1111
"time"
1212

13-
"github.com/shyim/go-composer"
1413
"github.com/spf13/cobra"
1514

1615
dockerpkg "github.com/shopware/shopware-cli/internal/docker"
@@ -236,15 +235,10 @@ func (e *proxyEnvironment) up(cmd *cobra.Command) error {
236235
}
237236

238237
// proxyBrowserHostnames returns the shop's proxy hostnames (root + routed
239-
// subdomains) for the WSL Windows hosts line, reading the optional AMQP and
240-
// Elasticsearch services from the project's composer.lock.
238+
// subdomains) for the WSL Windows hosts line, using the same lock-package
239+
// detection as compose generation.
241240
func proxyBrowserHostnames(projectRoot, hostname string) []string {
242-
hasAMQP, hasElasticsearch := false, false
243-
if lock, err := composer.ReadLock(filepath.Join(projectRoot, "composer.lock")); err == nil {
244-
hasAMQP = lock.GetPackage("symfony/amqp-messenger") != nil
245-
hasElasticsearch = lock.GetPackage("shopware/elasticsearch") != nil
246-
}
247-
return proxy.ProxyHostnames(hostname, hasAMQP, hasElasticsearch)
241+
return proxy.ProxyHostnames(hostname, dockerpkg.FeaturesFromLockFile(filepath.Join(projectRoot, "composer.lock")))
248242
}
249243

250244
// maybePrintWSLWindowsAccess prints the one-time Windows-side steps (import the

docs/proxy.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,10 @@ regenerate it with proxy routing, `down` regenerates it with fixed ports.
160160
Because the whole file is generated, proxy mode simply omits the host ports
161161
instead of clearing them with a `!reset` tag — so there is **no Docker Compose
162162
version requirement**. The database keeps its published loopback port in both
163-
modes, so host tools (and the sales-channel URL update) still reach it.
163+
modes, so host tools (and the sales-channel URL update) still reach it. PaaS
164+
projects (`shopware/k8s-meta` in `composer.lock`) route RustFS at `s3.<host>`
165+
(S3 API, used as `K8S_FILESYSTEM_PUBLIC_URL`) and `rustfs.<host>` (console).
166+
PHP still talks to `rustfs:9000` on the compose network. Redis stays internal.
164167

165168
Why a direct database `UPDATE` for the sales channel domain instead of a
166169
console command: it works on **every Shopware version** (the core
@@ -345,7 +348,7 @@ two things the CLI cannot do from inside the subsystem (it prints them via
345348
127.0.0.1 shop1.shopware.local admin-watch.shop1.shopware.local storefront-watch.shop1.shopware.local adminer.shop1.shopware.local mailer.shop1.shopware.local
346349
```
347350
`proxy up` prints this exact line for the current shop, including any
348-
`lavinmq`/`opensearch` subdomains the project uses.
351+
`lavinmq`/`opensearch`/`s3`/`rustfs` subdomains the project uses.
349352

350353
The CA import is one-time per machine; the hosts line is per shop.
351354

@@ -362,7 +365,9 @@ The CA import is one-time per machine; the hosts line is per shop.
362365
- Auxiliary services keep working through subdomains (`mailer.shop1…`,
363366
`adminer.shop1…`); their raw ports (management/UI) are not published in proxy
364367
mode — use `docker compose exec` for direct access. The database is the
365-
exception: it keeps a random published loopback port in both modes.
368+
exception: it keeps a random published loopback port in both modes. PaaS
369+
stacks route RustFS at `s3.<host>` / `rustfs.<host>` so media URLs stay
370+
HTTPS on the local domain. Redis is compose-internal only.
366371
- Only the shop's **root** hostname is aliased for in-container use — service
367372
subdomains (`mailer.…`) are host/browser-facing.
368373
- **Changing the admin-worker setting while a shop is proxied can orphan the

0 commit comments

Comments
 (0)