t
This commit is contained in:
parent
4c4e767ec6
commit
9d70afb4cc
42 changed files with 1266 additions and 630 deletions
46
.github/workflows/ci.yml
vendored
46
.github/workflows/ci.yml
vendored
|
|
@ -25,3 +25,49 @@ jobs:
|
|||
node-version: 24
|
||||
- run: npm install --ignore-scripts
|
||||
- run: npm run test:ci
|
||||
|
||||
production-bridge:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 24
|
||||
- run: npm install --ignore-scripts
|
||||
- name: Install production bridge runtimes
|
||||
run: sudo apt-get update && sudo apt-get install -y php-cli apache2 libapache2-mod-php
|
||||
- run: npm run test:bridge
|
||||
- name: Exercise real Apache rewrite and proxy
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
sudo a2enmod rewrite proxy proxy_http proxy_wstunnel headers
|
||||
sudo tee /etc/apache2/conf-available/linkfield-ci.conf >/dev/null <<'EOF'
|
||||
ServerTokens Prod
|
||||
ServerSignature Off
|
||||
<Directory /var/www/html/link-field>
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
</Directory>
|
||||
EOF
|
||||
sudo a2enconf linkfield-ci
|
||||
sudo rm -rf /var/www/html/link-field
|
||||
sudo mkdir -p /var/www/html/link-field
|
||||
sudo chown -R "$USER":"$USER" /var/www/html/link-field
|
||||
LINK_FIELD_PUBLIC_DIR=/var/www/html/link-field node scripts/service-control.js deploy
|
||||
test_root="$(mktemp -d)"
|
||||
LINK_FIELD_PUBLIC_DIR=/var/www/html/link-field LINK_FIELD_TEST_DATA_ROOT="$test_root" LINK_FIELD_APACHE_BRIDGE=1 HOST=127.0.0.1 PORT=43129 node server.js >"$test_root/server.log" 2>&1 &
|
||||
server_pid=$!
|
||||
trap 'kill "$server_pid" 2>/dev/null || true; rm -rf "$test_root"' EXIT
|
||||
sudo service apache2 restart
|
||||
for attempt in $(seq 1 100); do
|
||||
if curl --fail --silent http://127.0.0.1/link-field/api/cloud/status | grep -q '"available":true'; then break; fi
|
||||
sleep 0.1
|
||||
done
|
||||
curl --fail --show-error http://127.0.0.1/link-field/
|
||||
curl --fail --show-error http://127.0.0.1/link-field/api/cloud/status | grep -q '"sharedWorld":true'
|
||||
test "$(curl --silent --output /dev/null --write-out '%{http_code}' http://127.0.0.1/link-field/server.js)" = 403
|
||||
test "$(curl --silent --output /dev/null --write-out '%{http_code}' http://127.0.0.1/link-field/package.json)" = 403
|
||||
test "$(curl --silent --output /dev/null --write-out '%{http_code}' http://127.0.0.1/link-field/scripts/service-control.js)" = 403
|
||||
test "$(curl --silent --output /dev/null --write-out '%{http_code}' http://127.0.0.1/link-field/.linkfield-deployment.json)" = 403
|
||||
node scripts/public-smoke-test.js http://127.0.0.1/link-field/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue