toga-ai 1.0.208 → 1.0.209

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,3 +6,4 @@
6
6
  | [Tools — Developers Folder (UUID & Password Generators)](features/developer-tools.md) | The first two tools shipped in the Tools app, both under the **Developers** folder and gated to personas **Development Team** / **TOGa Technology**. | tools/mvc/developers/uuid/get.php, tools/mvc/developers/password/get.php |
7
7
  | [Tools Persona-Gated Navigation (App_Nav)](features/persona-gated-navigation.md) | `App_Nav` is the Tools app's two-level, **persona-gated** navigation. | tools/_/app/nav.php |
8
8
  | [Tools SAML SSO Consumer & Persona-Gated Auth (App_Auth)](features/saml-sso-auth.md) | `App_Auth` is the Tools app's authentication layer: it consumes the SAML gateway `?saml=` handoff (see the 2.0 SAML downstream integration contract), establishe | tools/_/app/auth.php, tools/mvc/sso/get.php, tools/mvc/login/get.php, tools/mvc/login/post.php, tools/mvc/logout/get.php |
9
+ | [Deploying Tools to Elastic Beanstalk (PHP 8.5 / Amazon Linux 2023)](workflows/deploy-to-elastic-beanstalk-al2023.md) | How the **Tools** 1.0 app boots on Elastic Beanstalk running `PHP 8.5 on 64bit Amazon Linux 2023/4.13.1 (aarch64)`. | tools/.ebextensions/004_http_to_https.config, tools/.ebextensions/006_mount-s3fs.config, tools/.ebextensions/007_setup_export_cache_folders.config, tools/.ebextensions/008_setup_ldap.config, tools/.ebextensions/009_setup_phpini.config, tools/.ebextensions/020_setup_git_libraries.config, tools/.ebextensions/050_register_instance_to_shared_application_load_balancer.config, tools/ebs/git.json |
@@ -0,0 +1,126 @@
1
+ ---
2
+ title: Deploying Tools to Elastic Beanstalk (PHP 8.5 / Amazon Linux 2023)
3
+ framework: "1.0"
4
+ repo: tools
5
+ project: Tools
6
+ client: shared
7
+ type: workflow
8
+ status: active
9
+ updated: 2026-06-26
10
+ owners: [jcardinal]
11
+ files:
12
+ - tools/.ebextensions/004_http_to_https.config
13
+ - tools/.ebextensions/006_mount-s3fs.config
14
+ - tools/.ebextensions/007_setup_export_cache_folders.config
15
+ - tools/.ebextensions/008_setup_ldap.config
16
+ - tools/.ebextensions/009_setup_phpini.config
17
+ - tools/.ebextensions/020_setup_git_libraries.config
18
+ - tools/.ebextensions/050_register_instance_to_shared_application_load_balancer.config
19
+ - tools/ebs/git.json
20
+ related:
21
+ - ../architecture.md
22
+ ---
23
+
24
+ ## Summary
25
+
26
+ How the **Tools** 1.0 app boots on Elastic Beanstalk running
27
+ `PHP 8.5 on 64bit Amazon Linux 2023/4.13.1 (aarch64)`. The EB platform was upgraded from
28
+ Amazon Linux 2 (AL2) to Amazon Linux 2023 (AL2023), which changes package names, the proxy
29
+ (nginx instead of Apache), the PHP ini scan directory, and how credentials reach the
30
+ instance. The `.ebextensions/*.config` files run alphabetically and are merged by EB; getting
31
+ them wrong leaves the app booting without `/var/www/library` and serving 500s on every
32
+ request. This doc is the migration checklist and the durable AL2023 gotchas learned doing it.
33
+
34
+ ## AL2023 package migration checklist
35
+
36
+ When migrating any 1.0 app's `.ebextensions` from AL2 to AL2023, rename/remove these yum
37
+ packages (AL2023 uses different names for the same libraries):
38
+
39
+ - `libstdc++48` → `libstdc++`
40
+ - `php73-ldap` → `php-ldap` (in `008_setup_ldap.config`)
41
+ - **Remove `libcurl: []` entirely** — AL2023 ships `libcurl-minimal` pre-installed, and adding
42
+ `libcurl` to the yum packages list causes a package-conflict error that fails the deploy.
43
+
44
+ ## How it works
45
+
46
+ ### PHP ini — write the file directly, do not run a script
47
+
48
+ `009_setup_phpini.config` writes `/etc/php.d/application.ini` with a cfn-init **`files:`**
49
+ block, **not** a container_command that runs a PHP script. On AL2023, `/etc/php.d/` is the
50
+ PHP ini scan directory, and cfn-init `files:` runs before container_commands and before
51
+ PHP-FPM starts, so the file is guaranteed present at startup with no PHP execution needed.
52
+
53
+ The old approach ran `ebs/setup_phpini.php` (now superseded) which called
54
+ `php_ini_scanned_files()`, parsed it to find the scan dir, and wrote there. On AL2023 that
55
+ failed silently (it was wrapped in `ignoreErrors: true`), so `include_path` never picked up
56
+ `/var/www/library`, producing fatal `require_once('_.php')` errors at runtime.
57
+
58
+ The `application.ini` sets `include_path = ".:/var/www/library"`, upload/post limits (16M),
59
+ `memory_limit = 2G`, `display_errors`, the `redis.so` extension, and the rediscluster session
60
+ handler (`session.save_path` points at the ElastiCache cluster cfg endpoint). Session GC
61
+ maxlifetime is 4 days.
62
+
63
+ ### Cloning the libraries — bash, not the CodePipeline PHP script
64
+
65
+ `020_setup_git_libraries.config` clones the framework libraries onto the instance. The old
66
+ `setup_git_libraries.php` (downloaded from S3) requires a DB connection to the `Logs` database
67
+ and a matching row in the `CodePipelineEnvironments` table; for a new app with **no**
68
+ CodePipeline it exits silently without cloning anything, so the app boots without
69
+ `/var/www/library` and 500s on every request.
70
+
71
+ The replacement is pure bash via a cfn-init `files:` block that writes
72
+ `/tmp/clone_git_repos.sh` (mode `000755`) plus a `container_commands` entry that runs
73
+ `bash /tmp/clone_git_repos.sh`. It clones:
74
+
75
+ - `agilantsolutions/library` branch `_production` → `/var/www/library`
76
+ - `agilantsolutions/resources` branch `_production` → `/var/app/ondeck/resources`
77
+
78
+ `ebs/git.json` was corrected to match: branch `_production` for both repos and the resources
79
+ path set to `/var/app/ondeck/resources`.
80
+
81
+ ### Duplicate config neutralization
82
+
83
+ EB merges every `.config` alphabetically; two configs with **identical** `container_commands`
84
+ keys silently overwrite each other, causing unpredictable failures (the redis build ran twice;
85
+ an http→https collision obscured failure diagnosis). Two duplicate pairs were neutralized
86
+ (replaced with a comment), keeping the canonical one of each:
87
+
88
+ - `004_enforce_http_to_https.config` (dup of `004_http_to_https.config`) — neutralized
89
+ - `010_setup_redis_sessions.config` (dup of `010_setup_redis.config`) — neutralized
90
+
91
+ ### ignoreErrors on non-fatal infrastructure commands
92
+
93
+ Several `container_commands` write to system paths that do not exist on AL2023 (e.g.
94
+ `/etc/httpd/conf.d/` — AL2023 EB uses **nginx**, not Apache, as the reverse proxy). These were
95
+ marked `ignoreErrors: true` in `004`, `006`, `007`, `009`, and `050` so a non-fatal failure
96
+ does not block the deploy. This also covers `006`'s `01_credentials` step: modern EB uses IAM
97
+ roles, so `AWS_SECRET_KEY` / `AWS_ACCESS_KEY_ID` are not injected into `$_SERVER` and the
98
+ s3fs credential write fails cleanly. Use `ignoreErrors` only on genuinely non-fatal infra
99
+ setup — the git clone (`020`) deliberately does **not** use it (see gotchas).
100
+
101
+ ## Gotchas (durable AL2023 / EB rules)
102
+
103
+ - **Write new-deploy files to `/var/app/ondeck/<path>`, never `/var/www/html/<path>` during
104
+ `container_commands`.** While container_commands run, `/var/www/html` still symlinks to the
105
+ **old** app. After the deploy swap, `/var/app/ondeck` becomes `/var/app/current`
106
+ (= `/var/www/html`). Writing to `/var/www/html` during container_commands writes into the
107
+ currently-running old app.
108
+ - **Only `/var/log/eb-activity.log` (and `cfn-init.log`) are captured in EB bundle snapshots.**
109
+ Custom log files under `/var/log/` are invisible unless you SSH the instance. Deploy scripts
110
+ should log to `/var/log/eb-activity.log`.
111
+ - **CodePipeline-dependent scripts are no-ops for apps without a pipeline.**
112
+ `setup_git_libraries.php` silently does nothing when the DB has no `CodePipelineEnvironments`
113
+ row — fatal for a brand-new app, since nothing gets cloned and the failure is silent.
114
+ - **Make clone failures block the deploy.** The bash clone script does `exit 1` on clone
115
+ failure so the deploy fails visibly, rather than succeeding and serving 500s.
116
+ - **PATH is unreliable in the cfn-init execution environment** — resolve binaries defensively,
117
+ e.g. `GIT=$(which git || echo /usr/bin/git)`.
118
+ - **cfn-init `files:` runs before `container_commands`** — the correct pattern for writing a
119
+ script and then executing it in the same config.
120
+
121
+ ## Change history
122
+ - 2026-06-26 — Documented the AL2 → AL2023 (PHP 8.5) EB migration for Tools: package renames
123
+ (`libstdc++48`→`libstdc++`, `php73-ldap`→`php-ldap`, drop `libcurl`), php ini via cfn-init
124
+ `files:` writing `/etc/php.d/application.ini`, bash-based library clone replacing the
125
+ CodePipeline PHP script, duplicate-config neutralization, `ignoreErrors` on non-fatal infra
126
+ commands, and the ondeck-path / eb-activity.log / pipeline-noop gotchas (jcardinal)
@@ -12,7 +12,7 @@ _Auto-generated by `knowledge.js index`. Do not hand-edit._
12
12
  - **walmarttechservices** (Walmart Tech Services) — 1 doc(s) → [1.0/apps/walmarttechservices/INDEX.md](1.0/apps/walmarttechservices/INDEX.md)
13
13
  - **test** (Test) — 11 doc(s) → [1.0/apps/test/INDEX.md](1.0/apps/test/INDEX.md)
14
14
  - **toga** (TOGa) — 2 doc(s) → [1.0/apps/toga/INDEX.md](1.0/apps/toga/INDEX.md)
15
- - **tools** (Tools) — 4 doc(s) → [1.0/apps/tools/INDEX.md](1.0/apps/tools/INDEX.md)
15
+ - **tools** (Tools) — 5 doc(s) → [1.0/apps/tools/INDEX.md](1.0/apps/tools/INDEX.md)
16
16
 
17
17
  ## 2.0 framework
18
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toga-ai",
3
- "version": "1.0.208",
3
+ "version": "1.0.209",
4
4
  "description": "TOGA Technology Team Claude Knowledge System — shared AI coding harness with skills, knowledge base CLI, and project installer for Claude Code.",
5
5
  "keywords": [
6
6
  "claude",