fix: reliable source upload, build cancel, WordPress port 80 default

- Replace port-forward/netcat PVC upload with kubectl cp for integrity
- Add build cancellation API and session cleanup; deploy catches cancel
- Default port 80 for WordPress, PHP, and Laravel on create
- Build progress modal with cancel; Helm/K8s adjustments for deployments
- Update build and kubernetes specs

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
keyhan
2026-05-14 16:03:45 +03:30
parent 3d56a2cc5d
commit 0c0a6cd5be
12 changed files with 637 additions and 93 deletions
+8 -15
View File
@@ -402,28 +402,20 @@ describe('Helper pod PVC race condition', () => {
});
describe('WordPress entrypoint script', () => {
// The generated entrypoint script content
const entrypointScript = `#!/bin/bash
set -e
# Merge user wp-content into PVC (first run only)
if [ -d /usr/src/wordpress-user/wp-content ] && [ ! -f /var/www/html/wp-content/.user-content-merged ]; then
# Merge user wp-content into PVC
if [ -d /usr/src/wordpress-user/wp-content ]; then
mkdir -p /var/www/html/wp-content
cp -a /usr/src/wordpress-user/wp-content/. /var/www/html/wp-content/
touch /var/www/html/wp-content/.user-content-merged
chown -R www-data:www-data /var/www/html/wp-content
fi
# Apply user wp-config.php if docker-entrypoint has not created one yet
if [ -f /usr/src/wordpress-user/wp-config.php ] && [ ! -f /var/www/html/wp-config.php ]; then
cp /usr/src/wordpress-user/wp-config.php /var/www/html/wp-config.php
chown www-data:www-data /var/www/html/wp-config.php
fi
exec docker-entrypoint.sh apache2-foreground`;
it('should call docker-entrypoint.sh exactly once (via exec)', () => {
const matches = entrypointScript.match(/docker-entrypoint\.sh/g);
// Should appear only once — in the final exec line
expect(matches).toHaveLength(1);
});
@@ -431,12 +423,13 @@ exec docker-entrypoint.sh apache2-foreground`;
expect(entrypointScript).toContain('exec docker-entrypoint.sh apache2-foreground');
});
it('should merge wp-content only on first run', () => {
expect(entrypointScript).toContain('.user-content-merged');
it('should merge wp-content on every start when staged content exists', () => {
expect(entrypointScript).toContain('/usr/src/wordpress-user/wp-content');
expect(entrypointScript).not.toContain('.user-content-merged');
});
it('should only apply user wp-config.php if no config exists', () => {
expect(entrypointScript).toContain('! -f /var/www/html/wp-config.php');
it('should not copy user wp-config.php (credentials come from env vars)', () => {
expect(entrypointScript).not.toContain('wp-config.php');
});
it('should set proper ownership after merging wp-content', () => {