Skip to content

Commit 3de8ec6

Browse files
committed
Merge remote-tracking branch 'upstream/dev' into bugfix/misc
2 parents 23d206e + e6abed4 commit 3de8ec6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1393
-677
lines changed

.ddev/commands/host/build

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# Host helper to run the project build inside DDEV without recursing back into this script
5+
ddev exec -s web npm run build

.ddev/commands/host/npm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
# Run npm commands inside the ddev web container, reusing npm cache volume
4+
ddev .npm-cache >/dev/null 2>&1 || true
5+
ddev ssh --service web -d /var/www/html -c "npm $@"

.ddev/commands/host/pre-commit

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# Run standard pre-commit checks inside DDEV.
5+
# Order: JS lint -> build -> PHP QA suite.
6+
7+
ddev npm run eslint
8+
ddev build
9+
ddev qa

.ddev/commands/web/build

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# Run project build inside web container
5+
npm install
6+
npm run build

.ddev/commands/web/getserver

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# Start the lightweight GET request receiver used by Photobooth callbacks.
5+
GETSERVER_PORT=${GETSERVER_PORT:-9100}
6+
export GETSERVER_PORT
7+
8+
node .ddev/scripts/getserver.js

.ddev/commands/web/qa

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# Run full PHP QA suite inside the web container (composer cgl+lint+phpstan+phpunit).
5+
composer cgl && composer lint && composer phpstan && composer phpunit

.ddev/config.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: photobooth
2+
type: php
3+
docroot: .
4+
php_version: "8.4"
5+
webserver_type: apache-fpm
6+
router_http_port: "9080"
7+
router_https_port: "9443"
8+
xdebug_enabled: false
9+
additional_hostnames: [ ]
10+
additional_fqdns: [ ]
11+
omit_containers: [ db, dba ]
12+
nfs_mount_enabled: false
13+
mutagen_enabled: false
14+
composer_version: ""
15+
use_dns_when_possible: true
16+
upload_dir: uploads
17+
webimage_extra_packages: [ ]
18+
nodejs_version: ""
19+
webimage_build:
20+
dockerfile: .ddev/web-build/Dockerfile
21+
hooks:
22+
post-start:
23+
- name: Ensure Node.js 20 for frontend build
24+
exec: |
25+
if ! command -v node >/dev/null 2>&1 || [ "$(node -v | cut -c2- | cut -d. -f1)" -lt 20 ]; then
26+
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
27+
apt-get update && apt-get install -y nodejs
28+
fi
29+
- name: Install npm deps if missing
30+
exec: |
31+
if [ ! -d node_modules ]; then
32+
npm install
33+
fi
34+
- name: One-time frontend build
35+
exec: |
36+
if [ ! -f .ddev/.built ]; then
37+
npm run build
38+
touch .ddev/.built
39+
fi
40+
- name: Start GET request helper (9100)
41+
exec: |
42+
if ! pgrep -f ".ddev/scripts/getserver.js" >/dev/null; then
43+
GETSERVER_PORT=9100 node .ddev/scripts/getserver.js >/tmp/ddev-getserver.log 2>&1 &
44+
fi
45+
- name: Start gulp watch (assets) in background
46+
exec: |
47+
if ! pgrep -f "gulp watch" >/dev/null; then
48+
npm run watch:gulp >/tmp/ddev-gulp-watch.log 2>&1 &
49+
fi
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
services:
2+
web:
3+
ports:
4+
# Remotebuzzer server (default 14711) exposed to host/router
5+
- "14711:14711"
6+
# GET request test server (default 9100) exposed for callbacks
7+
- "9100:9100"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
services:
2+
web:
3+
volumes:
4+
# persist npm cache for faster installs
5+
- npm-cache:/home/node/.npm
6+
environment:
7+
COMPOSER_ALLOW_SUPERUSER: "1"
8+
PHP_IDE_CONFIG: "serverName=photobooth.ddev.site"
9+
10+
volumes:
11+
npm-cache:

.ddev/scripts/getserver.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env node
2+
/**
3+
* Minimal GET request receiver for development.
4+
* Photobooth sends GET callbacks to `config.get_request.server`.
5+
* This helper responds 200 OK and logs incoming paths.
6+
*/
7+
8+
const http = require('http');
9+
10+
const PORT = process.env.GETSERVER_PORT || 9100;
11+
12+
const server = http.createServer((req, res) => {
13+
// Log method + path; keep response simple
14+
console.log(`[getserver] ${req.method} ${req.url}`);
15+
res.writeHead(200, { 'Content-Type': 'text/plain' });
16+
res.end('ok\n');
17+
});
18+
19+
server.listen(PORT, '0.0.0.0', () => {
20+
console.log(`[getserver] listening on ${PORT}`);
21+
});

0 commit comments

Comments
 (0)