diff --git a/.coderabbit.yaml b/.coderabbit.yaml
new file mode 100644
index 0000000000..42b705b571
--- /dev/null
+++ b/.coderabbit.yaml
@@ -0,0 +1,17 @@
+reviews:
+ path_filters:
+ - "!app/config/specs/**"
+ - "!docs/examples/**"
+ - "!docs/references/**"
+ - "!docs/sdks/**"
+ auto_review:
+ base_branches:
+ - main
+ - 1.6.x
+ - 1.7.x
+ - 1.8.x
+ high_level_summary: false
+ poem: false
+ sequence_diagrams: false
+ collapse_walkthrough: true
+ changed_files_summary: false
diff --git a/.env b/.env
index 5ea2ba2852..b7dd9e24f3 100644
--- a/.env
+++ b/.env
@@ -19,11 +19,14 @@ _APP_CUSTOM_DOMAIN_DENY_LIST=
_APP_OPTIONS_ABUSE=disabled
_APP_OPTIONS_ROUTER_PROTECTION=disabled
_APP_OPTIONS_FORCE_HTTPS=disabled
-_APP_OPTIONS_FUNCTIONS_FORCE_HTTPS=disabled
+_APP_OPTIONS_ROUTER_FORCE_HTTPS=disabled
_APP_OPENSSL_KEY_V1=your-secret-key
_APP_DOMAIN=traefik
_APP_DOMAIN_FUNCTIONS=functions.localhost
-_APP_DOMAIN_TARGET=localhost
+_APP_DOMAIN_SITES=sites.localhost
+_APP_DOMAIN_TARGET_CNAME=test.localhost
+_APP_DOMAIN_TARGET_A=127.0.0.1
+_APP_DOMAIN_TARGET_AAAA=::1
_APP_RULES_FORMAT=md5
_APP_REDIS_HOST=redis
_APP_REDIS_PORT=6379
@@ -70,26 +73,28 @@ _APP_SMS_FROM=+123456789
_APP_SMS_PROJECTS_DENY_LIST=
_APP_STORAGE_LIMIT=30000000
_APP_STORAGE_PREVIEW_LIMIT=20000000
-_APP_FUNCTIONS_SIZE_LIMIT=30000000
+_APP_COMPUTE_SIZE_LIMIT=30000000
_APP_FUNCTIONS_TIMEOUT=900
-_APP_FUNCTIONS_BUILD_TIMEOUT=900
-_APP_FUNCTIONS_CPUS=8
-_APP_FUNCTIONS_MEMORY=8192
-_APP_FUNCTIONS_INACTIVE_THRESHOLD=600
-_APP_FUNCTIONS_MAINTENANCE_INTERVAL=600
-_APP_FUNCTIONS_RUNTIMES_NETWORK=runtimes
+_APP_SITES_TIMEOUT=30
+_APP_COMPUTE_BUILD_TIMEOUT=900
+_APP_COMPUTE_CPUS=8
+_APP_COMPUTE_MEMORY=8192
+_APP_COMPUTE_INACTIVE_THRESHOLD=600
+_APP_COMPUTE_MAINTENANCE_INTERVAL=600
+_APP_COMPUTE_RUNTIMES_NETWORK=runtimes
_APP_EXECUTOR_SECRET=your-secret-key
-_APP_EXECUTOR_HOST=http://proxy/v1
+_APP_EXECUTOR_HOST=http://exc1/v1
_APP_FUNCTIONS_RUNTIMES=php-8.0,node-18.0,python-3.9,ruby-3.1
+_APP_SITES_RUNTIMES=static-1,node-22,flutter-3.32
_APP_MAINTENANCE_INTERVAL=86400
-_APP_MAINTENANCE_DELAY=
+_APP_MAINTENANCE_START_TIME=12:00
_APP_MAINTENANCE_RETENTION_CACHE=2592000
_APP_MAINTENANCE_RETENTION_EXECUTION=1209600
_APP_MAINTENANCE_RETENTION_ABUSE=86400
_APP_MAINTENANCE_RETENTION_AUDIT=1209600
_APP_MAINTENANCE_RETENTION_AUDIT_CONSOLE=15778800
_APP_USAGE_AGGREGATION_INTERVAL=30
-_APP_STATS_RESOURCES_INTERVAL=3600
+_APP_STATS_RESOURCES_INTERVAL=30
_APP_MAINTENANCE_RETENTION_USAGE_HOURLY=8640000
_APP_MAINTENANCE_RETENTION_SCHEDULES=86400
_APP_USAGE_STATS=enabled
diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml
new file mode 100644
index 0000000000..6d73787d00
--- /dev/null
+++ b/.github/workflows/benchmark.yml
@@ -0,0 +1,120 @@
+name: Benchmark
+concurrency:
+ group: '${{ github.workflow }}-${{ github.ref }}'
+ cancel-in-progress: true
+env:
+ IMAGE: appwrite-dev
+ CACHE_KEY: 'appwrite-dev-${{ github.event.pull_request.head.sha }}'
+'on':
+ - pull_request
+jobs:
+ setup:
+ name: Setup & Build Appwrite Image
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ submodules: recursive
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3
+ - name: Build Appwrite
+ uses: docker/build-push-action@v6
+ with:
+ context: .
+ push: false
+ tags: '${{ env.IMAGE }}'
+ load: true
+ cache-from: type=gha
+ cache-to: 'type=gha,mode=max'
+ outputs: 'type=docker,dest=/tmp/${{ env.IMAGE }}.tar'
+ build-args: |
+ DEBUG=false
+ TESTING=true
+ VERSION=dev
+ - name: Cache Docker Image
+ uses: actions/cache@v4
+ with:
+ key: '${{ env.CACHE_KEY }}'
+ path: '/tmp/${{ env.IMAGE }}.tar'
+ benchmarking:
+ name: Benchmark
+ runs-on: ubuntu-latest
+ needs: setup
+ permissions:
+ pull-requests: write
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ - name: Load Cache
+ uses: actions/cache@v4
+ with:
+ key: '${{ env.CACHE_KEY }}'
+ path: '/tmp/${{ env.IMAGE }}.tar'
+ fail-on-cache-miss: true
+ - name: Load and Start Appwrite
+ run: |
+ sed -i 's/traefik/localhost/g' .env
+ docker load --input /tmp/${{ env.IMAGE }}.tar
+ docker compose up -d
+ sleep 10
+ - name: Install Oha
+ run: |
+ echo "deb [signed-by=/usr/share/keyrings/azlux-archive-keyring.gpg] http://packages.azlux.fr/debian/ stable main" | sudo tee /etc/apt/sources.list.d/azlux.list
+ sudo wget -O /usr/share/keyrings/azlux-archive-keyring.gpg https://azlux.fr/repo.gpg
+ sudo apt update
+ sudo apt install oha
+ - name: Benchmark PR
+ run: 'oha -z 180s http://localhost/v1/health/version -j > benchmark.json'
+ - name: Cleaning
+ run: docker compose down -v
+ - name: Installing latest version
+ run: |
+ rm docker-compose.yml
+ rm .env
+ curl https://appwrite.io/install/compose -o docker-compose.yml
+ curl https://appwrite.io/install/env -o .env
+ sed -i 's/_APP_OPTIONS_ABUSE=enabled/_APP_OPTIONS_ABUSE=disabled/g' .env
+ docker compose up -d
+ sleep 10
+ - name: Benchmark Latest
+ run: oha -z 180s http://localhost/v1/health/version -j > benchmark-latest.json
+ - name: Prepare comment
+ run: |
+ echo '## :sparkles: Benchmark results' > benchmark.txt
+ echo ' ' >> benchmark.txt
+ echo "- Requests per second: $(jq -r '.summary.requestsPerSec|tonumber?|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json)" >> benchmark.txt
+ echo "- Requests with 200 status code: $(jq -r '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json)" >> benchmark.txt
+ echo "- P99 latency: $(jq -r '.latencyPercentiles.p99' benchmark.json )" >> benchmark.txt
+ echo " " >> benchmark.txt
+ echo " " >> benchmark.txt
+ echo "## :zap: Benchmark Comparison" >> benchmark.txt
+ echo " " >> benchmark.txt
+ echo "| Metric | This PR | Latest version | " >> benchmark.txt
+ echo "| --- | --- | --- | " >> benchmark.txt
+ echo "| RPS | $(jq -r '.summary.requestsPerSec|tonumber?|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json) | $(jq -r '.summary.requestsPerSec|tonumber|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark-latest.json) | " >> benchmark.txt
+ echo "| 200 | $(jq -r '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json) | $(jq -r '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark-latest.json) | " >> benchmark.txt
+ echo "| P99 | $(jq -r '.latencyPercentiles.p99' benchmark.json ) | $(jq -r '.latencyPercentiles.p99' benchmark-latest.json ) | " >> benchmark.txt
+ - name: Save results
+ uses: actions/upload-artifact@v4
+ if: '${{ !cancelled() }}'
+ with:
+ name: benchmark.json
+ path: benchmark.json
+ retention-days: 7
+ - name: Find Comment
+ if: github.event.pull_request.head.repo.full_name == github.repository
+ uses: peter-evans/find-comment@v3
+ id: fc
+ with:
+ issue-number: '${{ github.event.pull_request.number }}'
+ comment-author: 'github-actions[bot]'
+ body-includes: Benchmark results
+ - name: Comment on PR
+ if: github.event.pull_request.head.repo.full_name == github.repository
+ uses: peter-evans/create-or-update-comment@v4
+ with:
+ comment-id: '${{ steps.fc.outputs.comment-id }}'
+ issue-number: '${{ github.event.pull_request.number }}'
+ body-path: benchmark.txt
+ edit-mode: replace
diff --git a/.github/workflows/cleanup-cache.yml b/.github/workflows/cleanup-cache.yml
index 6e20b8f879..8f25fe5ef6 100644
--- a/.github/workflows/cleanup-cache.yml
+++ b/.github/workflows/cleanup-cache.yml
@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Cleanup
run: |
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 0c0482ca8f..a40f07ceda 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -34,7 +34,7 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml
index 899c27a135..02edd57923 100644
--- a/.github/workflows/linter.yml
+++ b/.github/workflows/linter.yml
@@ -12,7 +12,7 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 2
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 0ed82dd853..c78156ca04 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -12,7 +12,7 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 2
submodules: recursive
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 712d30dac0..862d669466 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -11,7 +11,7 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
diff --git a/.github/workflows/sdk-preview.yml b/.github/workflows/sdk-preview.yml
index 92b4f454cb..e317845768 100644
--- a/.github/workflows/sdk-preview.yml
+++ b/.github/workflows/sdk-preview.yml
@@ -1,25 +1,46 @@
-name: "Console SDK Preview"
+name: "SDK Preview"
on:
pull_request:
paths:
- 'app/config/specs/*-latest-console.json'
-
+ workflow_dispatch:
+ inputs:
+ platform:
+ type: choice
+ description: "Platform to build"
+ options:
+ - client
+ - server
jobs:
setup:
- name: Setup & Build Console SDK
+ name: Setup & Build SDK
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
+
+ - name: Set SDK type
+ id: set-sdk
+ run: |
+ PLATFORM="${{ github.event.inputs.platform }}"
+ if [ -z "$PLATFORM" ]; then
+ PLATFORM="console"
+ fi
+ if [ "$PLATFORM" = "server" ]; then
+ echo "sdk_type=nodejs" >> $GITHUB_OUTPUT
+ else
+ echo "sdk_type=web" >> $GITHUB_OUTPUT
+ fi
+ echo "platform=$PLATFORM" >> $GITHUB_OUTPUT
- name: Load and Start Appwrite
run: |
docker compose build
docker compose up -d
- docker compose exec appwrite sdks --platform=console --sdk=web --version=latest --git=no
- sudo chown -R $USER:$USER ./app/sdks/console-web
+ docker compose exec appwrite sdks --platform=${{ steps.set-sdk.outputs.platform }} --sdk=${{ steps.set-sdk.outputs.sdk_type }} --version=latest --git=no
+ sudo chown -R $USER:$USER ./app/sdks/${{ steps.set-sdk.outputs.platform }}-${{ steps.set-sdk.outputs.sdk_type }}
- uses: actions/setup-node@v4
with:
diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml
new file mode 100644
index 0000000000..04f8c822c7
--- /dev/null
+++ b/.github/workflows/static-analysis.yml
@@ -0,0 +1,16 @@
+name: "Static code analysis"
+
+on: [pull_request]
+jobs:
+ lint:
+ name: CodeQL
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Check out the repo
+ uses: actions/checkout@v4
+
+ - name: Run CodeQL
+ run: |
+ docker run --rm -v $PWD:/app composer:2.6 sh -c \
+ "composer install --profile --ignore-platform-reqs && composer check"
\ No newline at end of file
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 1d35fec3c7..97f3696e67 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -90,6 +90,9 @@ jobs:
docker compose up -d
sleep 10
+ - name: Logs
+ run: docker compose logs appwrite
+
- name: Doctor
run: docker compose exec -T appwrite doctor
@@ -119,6 +122,14 @@ jobs:
docker load --input /tmp/${{ env.IMAGE }}.tar
docker compose up -d
sleep 10
+
+ - name: Wait for Open Runtimes
+ timeout-minutes: 3
+ run: |
+ while ! docker compose logs openruntimes-executor | grep -q "Executor is ready."; do
+ echo "Waiting for Executor to come online"
+ sleep 1
+ done
- name: Run General Tests
run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/General --debug
@@ -142,7 +153,10 @@ jobs:
Locale,
Projects,
Realtime,
+ Sites,
+ Proxy,
Storage,
+ Tokens,
Teams,
Users,
Webhooks,
@@ -167,6 +181,14 @@ jobs:
docker compose up -d
sleep 30
+ - name: Wait for Open Runtimes
+ timeout-minutes: 3
+ run: |
+ while ! docker compose logs openruntimes-executor | grep -q "Executor is ready."; do
+ echo "Waiting for Executor to come online"
+ sleep 1
+ done
+
- name: Run ${{ matrix.service }} tests with Project table mode
run: |
echo "Using project tables"
@@ -176,7 +198,7 @@ jobs:
docker compose exec -T \
-e _APP_DATABASE_SHARED_TABLES \
-e _APP_DATABASE_SHARED_TABLES_V1 \
- appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug
+ appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug --exclude-group devKeys
e2e_shared_mode_test:
name: E2E Shared Mode Service Test
@@ -199,13 +221,16 @@ jobs:
Locale,
Projects,
Realtime,
+ Sites,
+ Proxy,
Storage,
Teams,
Users,
Webhooks,
VCS,
Messaging,
- Migrations
+ Migrations,
+ Tokens
]
tables-mode: [
'Shared V1',
@@ -229,6 +254,14 @@ jobs:
docker compose up -d
sleep 30
+ - name: Wait for Open Runtimes
+ timeout-minutes: 3
+ run: |
+ while ! docker compose logs openruntimes-executor | grep -q "Executor is ready."; do
+ echo "Waiting for Executor to come online"
+ sleep 1
+ done
+
- name: Run ${{ matrix.service }} tests with ${{ matrix.tables-mode }} table mode
run: |
if [ "${{ matrix.tables-mode }}" == "Shared V1" ]; then
@@ -240,90 +273,90 @@ jobs:
export _APP_DATABASE_SHARED_TABLES=database_db_main
export _APP_DATABASE_SHARED_TABLES_V1=
fi
-
+
docker compose exec -T \
-e _APP_DATABASE_SHARED_TABLES \
-e _APP_DATABASE_SHARED_TABLES_V1 \
- appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug
+ appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug --exclude-group devKeys
- benchmarking:
- name: Benchmark
+ e2e_dev_keys:
+ name: E2E Service Test (Dev Keys)
runs-on: ubuntu-latest
needs: setup
- permissions:
- pull-requests: write
+ strategy:
+ fail-fast: false
steps:
- - name: Checkout repository
+ - name: checkout
uses: actions/checkout@v4
+
- name: Load Cache
uses: actions/cache@v4
with:
key: ${{ env.CACHE_KEY }}
path: /tmp/${{ env.IMAGE }}.tar
fail-on-cache-miss: true
+
- name: Load and Start Appwrite
run: |
- sed -i 's/traefik/localhost/g' .env
- docker load --input /tmp/${{ env.IMAGE }}.tar
+ docker load --input /tmp/${{ env.IMAGE }}.tar
+ sed -i 's/_APP_OPTIONS_ABUSE=disabled/_APP_OPTIONS_ABUSE=enabled/' .env
docker compose up -d
- sleep 10
- - name: Install Oha
+ sleep 30
+
+ - name: Run Projects tests with dev keys in dedicated table mode
run: |
- echo "deb [signed-by=/usr/share/keyrings/azlux-archive-keyring.gpg] http://packages.azlux.fr/debian/ stable main" | sudo tee /etc/apt/sources.list.d/azlux.list
- sudo wget -O /usr/share/keyrings/azlux-archive-keyring.gpg https://azlux.fr/repo.gpg
- sudo apt update
- sudo apt install oha
- - name: Benchmark PR
- run: oha -z 180s http://localhost/v1/health/version -j > benchmark.json
- - name: Cleaning
- run: docker compose down -v
- - name: Installing latest version
+ echo "Using project tables"
+ export _APP_DATABASE_SHARED_TABLES=
+ export _APP_DATABASE_SHARED_TABLES_V1=
+
+ docker compose exec -T \
+ -e _APP_DATABASE_SHARED_TABLES \
+ -e _APP_DATABASE_SHARED_TABLES_V1 \
+ appwrite test /usr/src/code/tests/e2e/Services/Projects --debug --group=devKeys
+
+ e2e_dev_keys_shared_mode:
+ name: E2E Shared Mode Service Test (Dev Keys)
+ runs-on: ubuntu-latest
+ needs: [ setup, check_database_changes ]
+ if: needs.check_database_changes.outputs.database_changed == 'true'
+ strategy:
+ fail-fast: false
+ matrix:
+ tables-mode: [
+ 'Shared V1',
+ 'Shared V2',
+ ]
+ steps:
+ - name: checkout
+ uses: actions/checkout@v4
+
+ - name: Load Cache
+ uses: actions/cache@v4
+ with:
+ key: ${{ env.CACHE_KEY }}
+ path: /tmp/${{ env.IMAGE }}.tar
+ fail-on-cache-miss: true
+
+ - name: Load and Start Appwrite
run: |
- rm docker-compose.yml
- rm .env
- curl https://appwrite.io/install/compose -o docker-compose.yml
- curl https://appwrite.io/install/env -o .env
- sed -i 's/_APP_OPTIONS_ABUSE=enabled/_APP_OPTIONS_ABUSE=disabled/g' .env
+ docker load --input /tmp/${{ env.IMAGE }}.tar
+ sed -i 's/_APP_OPTIONS_ABUSE=disabled/_APP_OPTIONS_ABUSE=enabled/' .env
docker compose up -d
- sleep 10
- - name: Benchmark Latest
- run: oha -z 180s http://localhost/v1/health/version -j > benchmark-latest.json
- - name: Prepare comment
+ sleep 30
+
+ - name: Run Projects tests with dev keys in ${{ matrix.tables-mode }} table mode
run: |
- echo '## :sparkles: Benchmark results' > benchmark.txt
- echo ' ' >> benchmark.txt
- echo "- Requests per second: $(jq -r '.summary.requestsPerSec|tonumber?|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json)" >> benchmark.txt
- echo "- Requests with 200 status code: $(jq -r '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json)" >> benchmark.txt
- echo "- P99 latency: $(jq -r '.latencyPercentiles.p99' benchmark.json )" >> benchmark.txt
- echo " " >> benchmark.txt
- echo " " >> benchmark.txt
- echo "## :zap: Benchmark Comparison" >> benchmark.txt
- echo " " >> benchmark.txt
- echo "| Metric | This PR | Latest version | " >> benchmark.txt
- echo "| --- | --- | --- | " >> benchmark.txt
- echo "| RPS | $(jq -r '.summary.requestsPerSec|tonumber?|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json) | $(jq -r '.summary.requestsPerSec|tonumber|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark-latest.json) | " >> benchmark.txt
- echo "| 200 | $(jq -r '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json) | $(jq -r '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark-latest.json) | " >> benchmark.txt
- echo "| P99 | $(jq -r '.latencyPercentiles.p99' benchmark.json ) | $(jq -r '.latencyPercentiles.p99' benchmark-latest.json ) | " >> benchmark.txt
- - name: Save results
- uses: actions/upload-artifact@v4
- if: ${{ !cancelled() }}
- with:
- name: benchmark.json
- path: benchmark.json
- retention-days: 7
- - name: Find Comment
- if: github.event.pull_request.head.repo.full_name == github.repository
- uses: peter-evans/find-comment@v3
- id: fc
- with:
- issue-number: ${{ github.event.pull_request.number }}
- comment-author: 'github-actions[bot]'
- body-includes: Benchmark results
- - name: Comment on PR
- if: github.event.pull_request.head.repo.full_name == github.repository
- uses: peter-evans/create-or-update-comment@v4
- with:
- comment-id: ${{ steps.fc.outputs.comment-id }}
- issue-number: ${{ github.event.pull_request.number }}
- body-path: benchmark.txt
- edit-mode: replace
+ if [ "${{ matrix.tables-mode }}" == "Shared V1" ]; then
+ echo "Using shared tables V1"
+ export _APP_DATABASE_SHARED_TABLES=database_db_main
+ export _APP_DATABASE_SHARED_TABLES_V1=database_db_main
+ elif [ "${{ matrix.tables-mode }}" == "Shared V2" ]; then
+ echo "Using shared tables V2"
+ export _APP_DATABASE_SHARED_TABLES=database_db_main
+ export _APP_DATABASE_SHARED_TABLES_V1=
+ fi
+
+ docker compose exec -T \
+ -e _APP_DATABASE_SHARED_TABLES \
+ -e _APP_DATABASE_SHARED_TABLES_V1 \
+ appwrite test /usr/src/code/tests/e2e/Services/Projects --debug --group=devKeys
diff --git a/.gitignore b/.gitignore
index 0c19fd215e..600a6aeb08 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@
/node_modules/
/tests/resources/storage/
/tests/resources/functions/**/code.tar.gz
+/tests/resources/sites/**/code.tar.gz
/app/sdks/*
/.idea/
!/.idea/workspace.xml
diff --git a/CHANGES.md b/CHANGES.md
index 62db3d525e..bc903e4b31 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,3 +1,267 @@
+# Version 1.6.2
+
+## What's Changed
+
+### Notable changes
+
+* Delete git folder to reduce build size in [9076](https://github.com/appwrite/appwrite/pull/9076)
+* Upgrade assistant in [9100](https://github.com/appwrite/appwrite/pull/9100)
+* Use redis adapter for abuse in [9121](https://github.com/appwrite/appwrite/pull/9121)
+* Set base specification CPUs to 0.5 again in [9146](https://github.com/appwrite/appwrite/pull/9146)
+* Add new push message parameters in [9060](https://github.com/appwrite/appwrite/pull/9060)
+* Update audits to include user type in [9211](https://github.com/appwrite/appwrite/pull/9211)
+* Enable HEIC in [9251](https://github.com/appwrite/appwrite/pull/9251)
+* Added teamName to membership redirect url in [9269](https://github.com/appwrite/appwrite/pull/9269)
+* Add support endpoint url for S3 in [9303](https://github.com/appwrite/appwrite/pull/9303)
+* Added RuPay Credit Card Icon in Avatars Service in [5046](https://github.com/appwrite/appwrite/pull/5046)
+* Add figma oauth provider in [9623](https://github.com/appwrite/appwrite/pull/9623)
+* Update console to version 5.2.58 in [9637](https://github.com/appwrite/appwrite/pull/9637)
+
+### Fixes
+
+* Remove failed attribute in [9032](https://github.com/appwrite/appwrite/pull/9032)
+* Fix delete notFound attribute in [9038](https://github.com/appwrite/appwrite/pull/9038)
+* 🇮🇸 Added missing Icelandic translations for email strings. in [4848](https://github.com/appwrite/appwrite/pull/4848)
+* fix doc comment for filter method in [5769](https://github.com/appwrite/appwrite/pull/5769)
+* Delete attribute No throwing Exception on not found in [9157](https://github.com/appwrite/appwrite/pull/9157)
+* Fix VCS identity collision in [9138](https://github.com/appwrite/appwrite/pull/9138)
+* Fix disabling of email-otp when user wants to in [9200](https://github.com/appwrite/appwrite/pull/9200)
+* Ensure user can delete session in [9209](https://github.com/appwrite/appwrite/pull/9209)
+* Fix resend invitation in [9218](https://github.com/appwrite/appwrite/pull/9218)
+* Fix phone number parsing exception handling in [9246](https://github.com/appwrite/appwrite/pull/9246)
+* Fix amazon oauth in [9253](https://github.com/appwrite/appwrite/pull/9253)
+* Fix slack oauth scopes, and updated to v2 in [9228](https://github.com/appwrite/appwrite/pull/9228)
+* Fix forwarded user agent in [9271](https://github.com/appwrite/appwrite/pull/9271)
+* Fix WEBP File Preview Rendering Issue in [9321](https://github.com/appwrite/appwrite/pull/9321)
+* Fix build memory specifications in [9360](https://github.com/appwrite/appwrite/pull/9360)
+* Fix Self Hosting functions by adding missed config in [9373](https://github.com/appwrite/appwrite/pull/9373)
+* Fix resend team invite if already accepted in [9348](https://github.com/appwrite/appwrite/pull/9348)
+* Fix null errors on team invite in [9391](https://github.com/appwrite/appwrite/pull/9391)
+* Fix email (smtp) to multiple recipients in [9243](https://github.com/appwrite/appwrite/pull/9243)
+* Fix stats timing by using receivedAt date when available in [9428](https://github.com/appwrite/appwrite/pull/9428)
+* Make min/max params optional for attribute update in [9387](https://github.com/appwrite/appwrite/pull/9387)
+* Fix blocking of phone sessions when disabled on console in [9447](https://github.com/appwrite/appwrite/pull/9447)
+* Fix logging config in [9467](https://github.com/appwrite/appwrite/pull/9467)
+* Update audit timestamp origin in [9481](https://github.com/appwrite/appwrite/pull/9481)
+* Fix certificates in deletes worker in [9466](https://github.com/appwrite/appwrite/pull/9466)
+* Fix console audits delete in [9547](https://github.com/appwrite/appwrite/pull/9547)
+* Fix migrations in [9633](https://github.com/appwrite/appwrite/pull/9633)
+* Ensure all 4xx errors in OAuth redirect lead to the failure URL in [9679](https://github.com/appwrite/appwrite/pull/9679)
+* Treat 0 as unlimited for CPUs and memory in [9638](https://github.com/appwrite/appwrite/pull/9638)
+* Add contextual dispatch logic to fix high CPU usage in [9687](https://github.com/appwrite/appwrite/pull/9687)
+
+### Miscellaneous
+
+* Merge 1.6.x into feat-custom-cf-hostnames in [8904](https://github.com/appwrite/appwrite/pull/8904)
+* Improve compression param checks in [8922](https://github.com/appwrite/appwrite/pull/8922)
+* upgrade utopia storage in [8930](https://github.com/appwrite/appwrite/pull/8930)
+* Feat migration in [8797](https://github.com/appwrite/appwrite/pull/8797)
+* feat fix web routes in [8962](https://github.com/appwrite/appwrite/pull/8962)
+* Fix no pool access in [9027](https://github.com/appwrite/appwrite/pull/9027)
+* feat: use environment variable to check rules format in [9039](https://github.com/appwrite/appwrite/pull/9039)
+* Update storage.php in [9037](https://github.com/appwrite/appwrite/pull/9037)
+* Upgrade db 0.53.200 in [9050](https://github.com/appwrite/appwrite/pull/9050)
+* Chore: upgrade utopia storage in [9066](https://github.com/appwrite/appwrite/pull/9066)
+* Update usage-dump payload in [9085](https://github.com/appwrite/appwrite/pull/9085)
+* GitHub Workflows security hardening in [3728](https://github.com/appwrite/appwrite/pull/3728)
+* Update add-oauth2-provider.md in [4313](https://github.com/appwrite/appwrite/pull/4313)
+* update readme-cn some doc in [5278](https://github.com/appwrite/appwrite/pull/5278)
+* Add accessibility features in [7042](https://github.com/appwrite/appwrite/pull/7042)
+* Add Appwrite Cloud to read me. in [5445](https://github.com/appwrite/appwrite/pull/5445)
+* Migration throw error in [9092](https://github.com/appwrite/appwrite/pull/9092)
+* Fix usage payload bug in [9097](https://github.com/appwrite/appwrite/pull/9097)
+* chore: replace occurrences of dbForConsole to dbForPlatform in [9096](https://github.com/appwrite/appwrite/pull/9096)
+* fix(realtime): decrement connectionCounter only if connection is known in [9055](https://github.com/appwrite/appwrite/pull/9055)
+* payload bug fix in [9098](https://github.com/appwrite/appwrite/pull/9098)
+* Fix usage payload bug in [9099](https://github.com/appwrite/appwrite/pull/9099)
+* Usage payload debug in [9101](https://github.com/appwrite/appwrite/pull/9101)
+* Usage payload debug in [9103](https://github.com/appwrite/appwrite/pull/9103)
+* Usage payload debug in [9104](https://github.com/appwrite/appwrite/pull/9104)
+* Feat: createFunction abuse labels in [9102](https://github.com/appwrite/appwrite/pull/9102)
+* Docs-create-document in [9105](https://github.com/appwrite/appwrite/pull/9105)
+* Docs: Create document and unknown attribute error messages. in [5427](https://github.com/appwrite/appwrite/pull/5427)
+* Fix: update project accessed at from router and schedulers in [9109](https://github.com/appwrite/appwrite/pull/9109)
+* chore: initial commit in [9111](https://github.com/appwrite/appwrite/pull/9111)
+* chore: optimise webhooks payload in [9115](https://github.com/appwrite/appwrite/pull/9115)
+* Revert "chore: initial commit" in [9117](https://github.com/appwrite/appwrite/pull/9117)
+* chore: fix attribute name in [9118](https://github.com/appwrite/appwrite/pull/9118)
+* Migrate to redis abuse in [9124](https://github.com/appwrite/appwrite/pull/9124)
+* Added webhooks usage stats in [9125](https://github.com/appwrite/appwrite/pull/9125)
+* chore remove abuse cleanup in [9137](https://github.com/appwrite/appwrite/pull/9137)
+* fix: remove abuse delete trigger in [9139](https://github.com/appwrite/appwrite/pull/9139)
+* Remove firebase OAuth API endpoints in [9144](https://github.com/appwrite/appwrite/pull/9144)
+* chore: release client sdks in [9112](https://github.com/appwrite/appwrite/pull/9112)
+* Update general.php in [9155](https://github.com/appwrite/appwrite/pull/9155)
+* feat(swoole): allow configuration override of available cpus in [9177](https://github.com/appwrite/appwrite/pull/9177)
+* Usage databases api read writes addition in [9142](https://github.com/appwrite/appwrite/pull/9142)
+* Fix dead connections in [9190](https://github.com/appwrite/appwrite/pull/9190)
+* Add hostname to audits in [9165](https://github.com/appwrite/appwrite/pull/9165)
+* chore: shifted authphone usage tracking to api calls in [9191](https://github.com/appwrite/appwrite/pull/9191)
+* Revert "Fix dead connections" in [9201](https://github.com/appwrite/appwrite/pull/9201)
+* Add assertEventually to messaging provider logs test in [9192](https://github.com/appwrite/appwrite/pull/9192)
+* feat project sms usage in [9198](https://github.com/appwrite/appwrite/pull/9198)
+* chore: add audit labels to project resources in [9056](https://github.com/appwrite/appwrite/pull/9056)
+* fix sms usage in [9207](https://github.com/appwrite/appwrite/pull/9207)
+* Update database in [9202](https://github.com/appwrite/appwrite/pull/9202)
+* Fix dead connections in [9213](https://github.com/appwrite/appwrite/pull/9213)
+* Revert "Fix dead connections" in [9214](https://github.com/appwrite/appwrite/pull/9214)
+* Add logs db init for consistency in [9163](https://github.com/appwrite/appwrite/pull/9163)
+* Split the collection definitions in [9153](https://github.com/appwrite/appwrite/pull/9153)
+* Log path with populated parameters in [9220](https://github.com/appwrite/appwrite/pull/9220)
+* Add missing scope on function template in [9208](https://github.com/appwrite/appwrite/pull/9208)
+* Add relatedCollection default in [9225](https://github.com/appwrite/appwrite/pull/9225)
+* fix: function usage in [9235](https://github.com/appwrite/appwrite/pull/9235)
+* feat: optimise events payloads in [9232](https://github.com/appwrite/appwrite/pull/9232)
+* Optimise webhook events in [9168](https://github.com/appwrite/appwrite/pull/9168)
+* fix: maintenance job missing type in [9238](https://github.com/appwrite/appwrite/pull/9238)
+* Update Fetch to 0.3.0 in [9245](https://github.com/appwrite/appwrite/pull/9245)
+* Fix maintenance job in [9247](https://github.com/appwrite/appwrite/pull/9247)
+* chore: add missing case for executions in [9248](https://github.com/appwrite/appwrite/pull/9248)
+* Add index dependency exception in [9226](https://github.com/appwrite/appwrite/pull/9226)
+* chore: fix benchmarking test when made from fork in [9233](https://github.com/appwrite/appwrite/pull/9233)
+* Update SDK Generator versions in [9188](https://github.com/appwrite/appwrite/pull/9188)
+* chore: skipped job instead of throwing error in [9250](https://github.com/appwrite/appwrite/pull/9250)
+* Implement new SDK Class on 1.6.x in [9237](https://github.com/appwrite/appwrite/pull/9237)
+* Delete collection before Appwrite's attributes in [9256](https://github.com/appwrite/appwrite/pull/9256)
+* Feat batch usage dump in [9255](https://github.com/appwrite/appwrite/pull/9255)
+* Fix cloud tests in [9261](https://github.com/appwrite/appwrite/pull/9261)
+* Usage: Databases reads writes in [9260](https://github.com/appwrite/appwrite/pull/9260)
+* Update: Latest sdk specs in [9274](https://github.com/appwrite/appwrite/pull/9274)
+* Revert "Feat batch usage dump" in [9276](https://github.com/appwrite/appwrite/pull/9276)
+* feat: add fast2SMS adapter in [9263](https://github.com/appwrite/appwrite/pull/9263)
+* Update Sdk Generator dependency in [9280](https://github.com/appwrite/appwrite/pull/9280)
+* Transformed at addition in [9281](https://github.com/appwrite/appwrite/pull/9281)
+* Docs: clarify update endpoints only work on draft messages in [9236](https://github.com/appwrite/appwrite/pull/9236)
+* Update sdk generator dependency in [9282](https://github.com/appwrite/appwrite/pull/9282)
+* Revert "Transformed at addition" in [9284](https://github.com/appwrite/appwrite/pull/9284)
+* replaced init for cloud link in [9285](https://github.com/appwrite/appwrite/pull/9285)
+* Add transformed at in [9289](https://github.com/appwrite/appwrite/pull/9289)
+* Make migrations use Dynamic keys for destination in [9291](https://github.com/appwrite/appwrite/pull/9291)
+* Make sessions limit tests assert eventually in [9298](https://github.com/appwrite/appwrite/pull/9298)
+* Chore update database in [9306](https://github.com/appwrite/appwrite/pull/9306)
+* feat: add AMQP queues in [9287](https://github.com/appwrite/appwrite/pull/9287)
+* fix(test): use assertEventually instead of while(true) in [9308](https://github.com/appwrite/appwrite/pull/9308)
+* fix(certificate worker): events are published without queue name in [9309](https://github.com/appwrite/appwrite/pull/9309)
+* chore: update utopia-php/queue to 0.8.1 in [9311](https://github.com/appwrite/appwrite/pull/9311)
+* chore: update utopia-php/queue to 0.8.2 in [9312](https://github.com/appwrite/appwrite/pull/9312)
+* fix(schedule-tasks): revert back to direct pool usage in [9313](https://github.com/appwrite/appwrite/pull/9313)
+* feat: custom app schemes in [9262](https://github.com/appwrite/appwrite/pull/9262)
+* Revert "feat: custom app schemes" in [9319](https://github.com/appwrite/appwrite/pull/9319)
+* Restore "feat: custom app schemes"" in [9320](https://github.com/appwrite/appwrite/pull/9320)
+* Revert "Restore "feat: custom app schemes""" in [9323](https://github.com/appwrite/appwrite/pull/9323)
+* chore: update dependencies in [9330](https://github.com/appwrite/appwrite/pull/9330)
+* Feat: logs DB in [9272](https://github.com/appwrite/appwrite/pull/9272)
+* Catch invalid index in [9329](https://github.com/appwrite/appwrite/pull/9329)
+* Fix: missing call for image transformations counting in [9342](https://github.com/appwrite/appwrite/pull/9342)
+* Fix drop abuse on shared table project delete in [9346](https://github.com/appwrite/appwrite/pull/9346)
+* Only run all table mode tests on db update in [9338](https://github.com/appwrite/appwrite/pull/9338)
+* Fix: missing periodic metric in [9350](https://github.com/appwrite/appwrite/pull/9350)
+* feat(builds): check if function is blocked before building in [9332](https://github.com/appwrite/appwrite/pull/9332)
+* feat: batch create audit logs in [9347](https://github.com/appwrite/appwrite/pull/9347)
+* Chore: Update migrations in [9355](https://github.com/appwrite/appwrite/pull/9355)
+* Fix: metric time was not being written to DB in [9354](https://github.com/appwrite/appwrite/pull/9354)
+* Fix patch index validation in [9356](https://github.com/appwrite/appwrite/pull/9356)
+* Fix image trnasformation metrics in [9370](https://github.com/appwrite/appwrite/pull/9370)
+* Use batch delete in worker in [9375](https://github.com/appwrite/appwrite/pull/9375)
+* Fix Model Platform is missing response key: store in [9361](https://github.com/appwrite/appwrite/pull/9361)
+* Feat key segmented usage in [9336](https://github.com/appwrite/appwrite/pull/9336)
+* Feat messaging metrics in [9353](https://github.com/appwrite/appwrite/pull/9353)
+* Fix removed audits for shared v2 in [9388](https://github.com/appwrite/appwrite/pull/9388)
+* chore: bump utopia-php/image to 0.8.0 in [9390](https://github.com/appwrite/appwrite/pull/9390)
+* Fix outdated CLI commands in documentation in [9122](https://github.com/appwrite/appwrite/pull/9122)
+* disable logs display in [9398](https://github.com/appwrite/appwrite/pull/9398)
+* Log batches per project in [9403](https://github.com/appwrite/appwrite/pull/9403)
+* Batch per project in [9410](https://github.com/appwrite/appwrite/pull/9410)
+* Fix: stats resources only queue projects accessed in last 3 hours in [9411](https://github.com/appwrite/appwrite/pull/9411)
+* Track options requests in [9397](https://github.com/appwrite/appwrite/pull/9397)
+* chore: bump docker-base in [9406](https://github.com/appwrite/appwrite/pull/9406)
+* refactor: migrate Realtime::send calls to queueForRealtime in [9325](https://github.com/appwrite/appwrite/pull/9325)
+* Revert "Fix: stats resources only queue projects accessed in last 3 hours" in [9424](https://github.com/appwrite/appwrite/pull/9424)
+* Remove usage and usage dump in favor of stats-usage and stats-usage-dump in [9339](https://github.com/appwrite/appwrite/pull/9339)
+* Fix: disable dual writing in [9429](https://github.com/appwrite/appwrite/pull/9429)
+* Disable transformedAt update for console users in [9425](https://github.com/appwrite/appwrite/pull/9425)
+* chore: add image transformation stats to usage endpoint in [9393](https://github.com/appwrite/appwrite/pull/9393)
+* chore: added timeout to deployment builds in tests in [9426](https://github.com/appwrite/appwrite/pull/9426)
+* fix: model for image transformations in usage project in [9442](https://github.com/appwrite/appwrite/pull/9442)
+* Feat: calculate database storage in stats-resources in [9443](https://github.com/appwrite/appwrite/pull/9443)
+* Activities batch writes in [9438](https://github.com/appwrite/appwrite/pull/9438)
+* chore: bump cache 0.12.x in [9412](https://github.com/appwrite/appwrite/pull/9412)
+* chore: queue console project for maintenance delete in [9479](https://github.com/appwrite/appwrite/pull/9479)
+* chore: added logsdb for deletes worker in [9462](https://github.com/appwrite/appwrite/pull/9462)
+* Feat: calculate and log time taken for each project in [9491](https://github.com/appwrite/appwrite/pull/9491)
+* chore: update initializing dbForLogs in [9494](https://github.com/appwrite/appwrite/pull/9494)
+* Feat bulk audit delete in [9487](https://github.com/appwrite/appwrite/pull/9487)
+* Prepare 1.6.2 release in [9499](https://github.com/appwrite/appwrite/pull/9499)
+* Regenerate specs in [9497](https://github.com/appwrite/appwrite/pull/9497)
+* Regenerate examples in [9498](https://github.com/appwrite/appwrite/pull/9498)
+* chore: bump sdk in [9414](https://github.com/appwrite/appwrite/pull/9414)
+* update queue to 0.9.* in [9505](https://github.com/appwrite/appwrite/pull/9505)
+* Feat improve delete queries in [9507](https://github.com/appwrite/appwrite/pull/9507)
+* Feat: Add rule attributes in [9508](https://github.com/appwrite/appwrite/pull/9508)
+* Sync main into 1.6.x in [9496](https://github.com/appwrite/appwrite/pull/9496)
+* Bump console to version 5.2.53 in [9495](https://github.com/appwrite/appwrite/pull/9495)
+* Prepare 1.6.1 release in [9294](https://github.com/appwrite/appwrite/pull/9294)
+* Improve delete ordering in [9512](https://github.com/appwrite/appwrite/pull/9512)
+* Cleanups in [9511](https://github.com/appwrite/appwrite/pull/9511)
+* Feat dynamic regions in [9408](https://github.com/appwrite/appwrite/pull/9408)
+* Feat env vars to system lib in [9515](https://github.com/appwrite/appwrite/pull/9515)
+* Feat: domains count in [9514](https://github.com/appwrite/appwrite/pull/9514)
+* Migration read from db in [9529](https://github.com/appwrite/appwrite/pull/9529)
+* feat: add pool telemetry in [9530](https://github.com/appwrite/appwrite/pull/9530)
+* Disable PDO persistence since we manage our own pool in [9526](https://github.com/appwrite/appwrite/pull/9526)
+* chore: set min operations to 1 for reads and writes in [9536](https://github.com/appwrite/appwrite/pull/9536)
+* Remove default region in [9430](https://github.com/appwrite/appwrite/pull/9430)
+* Use cursor pagination with bigger limit for maintenance project loop in [9546](https://github.com/appwrite/appwrite/pull/9546)
+* chore: stop tests on failure in [9525](https://github.com/appwrite/appwrite/pull/9525)
+* chore: only update total count for privileged users in [9554](https://github.com/appwrite/appwrite/pull/9554)
+* refactor: initialization of audit retention in [9563](https://github.com/appwrite/appwrite/pull/9563)
+* Delete worker queries fixes in [9523](https://github.com/appwrite/appwrite/pull/9523)
+* Bump database 0.62.x in [9568](https://github.com/appwrite/appwrite/pull/9568)
+* Fix: schedules region filtering in [9577](https://github.com/appwrite/appwrite/pull/9577)
+* Deletes worker fix selects for pagination in [9578](https://github.com/appwrite/appwrite/pull/9578)
+* Add $permissions for delete documents selects in [9579](https://github.com/appwrite/appwrite/pull/9579)
+* chore(audits): return queue pre-fetch results in [9533](https://github.com/appwrite/appwrite/pull/9533)
+* Revert "chore(audits): return queue pre-fetch results" in [9586](https://github.com/appwrite/appwrite/pull/9586)
+* Feat multi tenant insert in [9573](https://github.com/appwrite/appwrite/pull/9573)
+* Add order by for cursor in [9588](https://github.com/appwrite/appwrite/pull/9588)
+* Feat update fetch in [9592](https://github.com/appwrite/appwrite/pull/9592)
+* Fix tenant casting in [9598](https://github.com/appwrite/appwrite/pull/9598)
+* Feat update ws in [9602](https://github.com/appwrite/appwrite/pull/9602)
+* Update database in [9603](https://github.com/appwrite/appwrite/pull/9603)
+* Fix: image transformation cache in [9608](https://github.com/appwrite/appwrite/pull/9608)
+* Remove audit payload in [9610](https://github.com/appwrite/appwrite/pull/9610)
+* Sample rate from DSN in [9559](https://github.com/appwrite/appwrite/pull/9559)
+* Restrict role change for sole org owner in [9615](https://github.com/appwrite/appwrite/pull/9615)
+* chore: update php image to 0.8.1 in [9616](https://github.com/appwrite/appwrite/pull/9616)
+* feat: refactor executor setup in [9420](https://github.com/appwrite/appwrite/pull/9420)
+* chore: update gitpod.yml config in [9561](https://github.com/appwrite/appwrite/pull/9561)
+* chore: update dependencies in [9625](https://github.com/appwrite/appwrite/pull/9625)
+* Update migrations lib in [9628](https://github.com/appwrite/appwrite/pull/9628)
+* feat: cache telemetry in [9624](https://github.com/appwrite/appwrite/pull/9624)
+* Bump console to version 5.2.56 in [9631](https://github.com/appwrite/appwrite/pull/9631)
+* Multi region support in [8667](https://github.com/appwrite/appwrite/pull/8667)
+* Revert "Multi region support" in [9632](https://github.com/appwrite/appwrite/pull/9632)
+* Revert "Revert "Multi region support"" in [9636](https://github.com/appwrite/appwrite/pull/9636)
+* Fix tasks in [9644](https://github.com/appwrite/appwrite/pull/9644)
+* chore: updated the migration version to 8.6 in [9646](https://github.com/appwrite/appwrite/pull/9646)
+* Fix: merge the working of StatsUsage and StatsUsageDump in [9585](https://github.com/appwrite/appwrite/pull/9585)
+* Update database in [9643](https://github.com/appwrite/appwrite/pull/9643)
+* chore: fix error logging for CLI tasks in [9651](https://github.com/appwrite/appwrite/pull/9651)
+* fix: usage test assertion in [9653](https://github.com/appwrite/appwrite/pull/9653)
+* Fix keys in [9656](https://github.com/appwrite/appwrite/pull/9656)
+* Feat: multi tenant dual writing in [9583](https://github.com/appwrite/appwrite/pull/9583)
+* Fix/throwing 400 for null order attributes in [9657](https://github.com/appwrite/appwrite/pull/9657)
+* feat: sdk group attribute in [9596](https://github.com/appwrite/appwrite/pull/9596)
+* Add configurable function and build size in [9648](https://github.com/appwrite/appwrite/pull/9648)
+* feat: update API endpoint in the code examples in [8933](https://github.com/appwrite/appwrite/pull/8933)
+* chore: abstract token secret hiding to response model in [9574](https://github.com/appwrite/appwrite/pull/9574)
+* chore: update sdks in [9655](https://github.com/appwrite/appwrite/pull/9655)
+* feat: allow non-critical events to ignore exceptions when enqueuing the event in [9680](https://github.com/appwrite/appwrite/pull/9680)
+* Revert "Add configurable function and build size" in [9681](https://github.com/appwrite/appwrite/pull/9681)
+* core: introduce endpoint.docs in specs in [9685](https://github.com/appwrite/appwrite/pull/9685)
+* fix: remove content-type header from get request specs in [9666](https://github.com/appwrite/appwrite/pull/9666)
+* chore: update flutter sdk in [9691](https://github.com/appwrite/appwrite/pull/9691)
+
# Version 1.6.1
## What's Changed
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index df88cfcfb9..277a509447 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -163,6 +163,28 @@ Other containes should be named the same as their service, for example `redis` s
- [Encryption](https://medium.com/searchencrypt/what-is-encryption-how-does-it-work-e8f20e340537#:~:text=Encryption%20is%20a%20process%20that,%2C%20or%20decrypt%2C%20the%20information.)
- [Hashing](https://searchsqlserver.techtarget.com/definition/hashing#:~:text=Hashing%20is%20the%20transformation%20of,it%20using%20the%20original%20value.)
+## Modules
+
+As Appwrite grows, we noticed approach of having all service endpoints in `app/controllers/api/[service].php` is not maintainable. Not only it creates massive files, it also doesnt contain all product's features such as workers or tasks. While there might still be some occurances of those controller files, we avoid it in all new development, and gradually migrate existing controllers to **HTTP modules**.
+
+### HTTP Endpoints
+
+Every endpoint file follows below structure, making it consistent with HTTP REST endpoint path:
+
+```
+src/Appwrite/Platform/Modules/[service]/Http/[resource]/[action].php
+```
+
+Tips and tricks:
+
+1. If endpoint doesn't have resource, use service name as resource name too
+> Example: `Modules/Sites/Http/Sites/Get.php`
+
+2. If there are multiple resources, use then all in folder structure
+> Example: `Modules/Sites/Http/Deployments/Builds/Create.php`
+
+3. Action can only be `Get`, `Create`, `Update`, `Delete` or `XList`
+
## Architecture
Appwrite's current structure is a combination of both [Monolithic](https://en.wikipedia.org/wiki/Monolithic_application) and [Microservice](https://en.wikipedia.org/wiki/Microservices) architectures.
@@ -393,8 +415,8 @@ In addition, you will also need to add some logic to the `reduce()` method of th
```php
case $document->getCollection() === 'buckets':
- $files = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace('{bucketInternalId}', $document->getInternalId(), METRIC_BUCKET_ID_FILES)));
- $storage = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace('{bucketInternalId}', $document->getInternalId(), METRIC_BUCKET_ID_FILES_STORAGE)));
+ $files = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace('{bucketInternalId}', $document->getSequence(), METRIC_BUCKET_ID_FILES)));
+ $storage = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace('{bucketInternalId}', $document->getSequence(), METRIC_BUCKET_ID_FILES_STORAGE)));
if (!empty($files['value'])) {
$metrics[] = [
@@ -441,9 +463,9 @@ $queueForStatsUsage
->addMetric(METRIC_BUILDS, 1)
->addMetric(METRIC_BUILDS_STORAGE, $build->getAttribute('size', 0))
->addMetric(METRIC_BUILDS_COMPUTE, (int)$build->getAttribute('duration', 0) * 1000)
- ->addMetric(str_replace('{functionInternalId}', $function->getInternalId(), METRIC_FUNCTION_ID_BUILDS), 1)
- ->addMetric(str_replace('{functionInternalId}', $function->getInternalId(), METRIC_FUNCTION_ID_BUILDS_STORAGE), $build->getAttribute('size', 0))
- ->addMetric(str_replace('{functionInternalId}', $function->getInternalId(), METRIC_FUNCTION_ID_BUILDS_COMPUTE), (int)$build->getAttribute('duration', 0) * 1000)
+ ->addMetric(str_replace('{functionInternalId}', $function->getSequence(), METRIC_FUNCTION_ID_BUILDS), 1)
+ ->addMetric(str_replace('{functionInternalId}', $function->getSequence(), METRIC_FUNCTION_ID_BUILDS_STORAGE), $build->getAttribute('size', 0))
+ ->addMetric(str_replace('{functionInternalId}', $function->getSequence(), METRIC_FUNCTION_ID_BUILDS_COMPUTE), (int)$build->getAttribute('duration', 0) * 1000)
->setProject($project)
->trigger();
```
diff --git a/Dockerfile b/Dockerfile
index 88d5ed030b..30b017b573 100755
--- a/Dockerfile
+++ b/Dockerfile
@@ -44,12 +44,14 @@ COPY ./dev /usr/src/code/dev
# Set Volumes
RUN mkdir -p /storage/uploads && \
+ mkdir -p /storage/imports && \
mkdir -p /storage/cache && \
mkdir -p /storage/config && \
mkdir -p /storage/certificates && \
mkdir -p /storage/functions && \
mkdir -p /storage/debug && \
chown -Rf www-data.www-data /storage/uploads && chmod -Rf 0755 /storage/uploads && \
+ chown -Rf www-data.www-data /storage/imports && chmod -Rf 0755 /storage/imports && \
chown -Rf www-data.www-data /storage/cache && chmod -Rf 0755 /storage/cache && \
chown -Rf www-data.www-data /storage/config && chmod -Rf 0755 /storage/config && \
chown -Rf www-data.www-data /storage/certificates && chmod -Rf 0755 /storage/certificates && \
@@ -68,6 +70,7 @@ RUN chmod +x /usr/local/bin/doctor && \
chmod +x /usr/local/bin/sdks && \
chmod +x /usr/local/bin/specs && \
chmod +x /usr/local/bin/ssl && \
+ chmod +x /usr/local/bin/screenshot && \
chmod +x /usr/local/bin/test && \
chmod +x /usr/local/bin/upgrade && \
chmod +x /usr/local/bin/vars && \
@@ -86,7 +89,6 @@ RUN chmod +x /usr/local/bin/doctor && \
chmod +x /usr/local/bin/worker-migrations && \
chmod +x /usr/local/bin/worker-webhooks && \
chmod +x /usr/local/bin/worker-stats-usage && \
- chmod +x /usr/local/bin/worker-stats-usage-dump && \
chmod +x /usr/local/bin/stats-resources && \
chmod +x /usr/local/bin/worker-stats-resources
diff --git a/README-CN.md b/README-CN.md
index a81d99c3c3..a9a6b3c867 100644
--- a/README-CN.md
+++ b/README-CN.md
@@ -72,7 +72,7 @@ docker run -it --rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
--entrypoint="install" \
- appwrite/appwrite:1.6.2
+ appwrite/appwrite:1.7.4
```
### Windows
@@ -84,7 +84,7 @@ docker run -it --rm ^
--volume //var/run/docker.sock:/var/run/docker.sock ^
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
--entrypoint="install" ^
- appwrite/appwrite:1.6.2
+ appwrite/appwrite:1.7.4
```
#### PowerShell
@@ -94,7 +94,7 @@ docker run -it --rm `
--volume /var/run/docker.sock:/var/run/docker.sock `
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw `
--entrypoint="install" `
- appwrite/appwrite:1.6.2
+ appwrite/appwrite:1.7.4
```
运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。
diff --git a/README.md b/README.md
index c3585dbb68..88d3fe89df 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,5 @@
> [Get started with Appwrite](https://apwr.dev/appcloud)
+> [Join the Init kick off event 19th of May: The future of Appwrite with Founder & CEO Eldad Fux](https://www.youtube.com/watch?v=1g8tuogsp7A)
@@ -77,7 +78,7 @@ docker run -it --rm \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \ --entrypoint="install" \ - appwrite/appwrite:1.6.2 + appwrite/appwrite:1.7.4 ``` ### Windows @@ -89,7 +90,7 @@ docker run -it --rm ^ --volume //var/run/docker.sock:/var/run/docker.sock ^ --volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^ --entrypoint="install" ^ - appwrite/appwrite:1.6.2 + appwrite/appwrite:1.7.4 ``` #### PowerShell @@ -99,7 +100,7 @@ docker run -it --rm ` --volume /var/run/docker.sock:/var/run/docker.sock ` --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ` --entrypoint="install" ` - appwrite/appwrite:1.6.2 + appwrite/appwrite:1.7.4 ``` Once the Docker installation is complete, go to http://localhost to access the Appwrite console from your browser. Please note that on non-Linux native hosts, the server might take a few minutes to start after completing the installation. diff --git a/app/cli.php b/app/cli.php index 82f229673e..c829546011 100644 --- a/app/cli.php +++ b/app/cli.php @@ -10,11 +10,15 @@ use Appwrite\Event\StatsUsage; use Appwrite\Platform\Appwrite; use Appwrite\Runtimes\Runtimes; use Executor\Executor; +use Swoole\Runtime; +use Swoole\Timer; +use Utopia\Cache\Adapter\Pool as CachePool; use Utopia\Cache\Adapter\Sharding; use Utopia\Cache\Cache; use Utopia\CLI\CLI; use Utopia\CLI\Console; use Utopia\Config\Config; +use Utopia\Database\Adapter\Pool as DatabasePool; use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\Validator\Authorization; @@ -22,12 +26,16 @@ use Utopia\DSN\DSN; use Utopia\Logger\Log; use Utopia\Platform\Service; use Utopia\Pools\Group; +use Utopia\Queue\Broker\Pool as BrokerPool; use Utopia\Queue\Publisher; use Utopia\Registry\Registry; use Utopia\System\System; +use Utopia\Telemetry\Adapter\None as NoTelemetry; -// Overwriting runtimes to be architecture agnostic for CLI -Config::setParam('runtimes', (new Runtimes('v4'))->getAll(supported: false)); +use function Swoole\Coroutine\run; + +// overwriting runtimes to be architecture agnostic for CLI +Config::setParam('runtimes', (new Runtimes('v5'))->getAll(supported: false)); // require controllers after overwriting runtimes require_once __DIR__ . '/controllers/general.php'; @@ -41,10 +49,7 @@ CLI::setResource('cache', function ($pools) { $adapters = []; foreach ($list as $value) { - $adapters[] = $pools - ->get($value) - ->pop() - ->getResource(); + $adapters[] = new CachePool($pools->get($value)); } return new Cache(new Sharding($adapters)); @@ -64,12 +69,8 @@ CLI::setResource('dbForPlatform', function ($pools, $cache) { $attempts++; try { // Prepare database connection - $dbAdapter = $pools - ->get('console') - ->pop() - ->getResource(); - - $dbForPlatform = new Database($dbAdapter, $cache); + $adapter = new DatabasePool($pools->get('console')); + $dbForPlatform = new Database($adapter, $cache); $dbForPlatform ->setNamespace('_console') @@ -87,7 +88,6 @@ CLI::setResource('dbForPlatform', function ($pools, $cache) { $ready = true; } catch (\Throwable $err) { Console::warning($err->getMessage()); - $pools->get('console')->reclaim(); sleep($sleep); } } while ($attempts < $maxAttempts && !$ready); @@ -125,37 +125,33 @@ CLI::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) - ->setTenant($project->getInternalId()) + ->setTenant((int)$project->getSequence()) ->setNamespace($dsn->getParam('namespace')); } else { $database ->setSharedTables(false) ->setTenant(null) - ->setNamespace('_' . $project->getInternalId()); + ->setNamespace('_' . $project->getSequence()); } return $database; } - $dbAdapter = $pools - ->get($dsn->getHost()) - ->pop() - ->getResource(); - - $database = new Database($dbAdapter, $cache); + $adapter = new DatabasePool($pools->get($dsn->getHost())); + $database = new Database($adapter, $cache); $databases[$dsn->getHost()] = $database; $sharedTables = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', '')); if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) - ->setTenant($project->getInternalId()) + ->setTenant((int)$project->getSequence()) ->setNamespace($dsn->getParam('namespace')); } else { $database ->setSharedTables(false) ->setTenant(null) - ->setNamespace('_' . $project->getInternalId()); + ->setNamespace('_' . $project->getSequence()); } $database @@ -168,21 +164,15 @@ CLI::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform CLI::setResource('getLogsDB', function (Group $pools, Cache $cache) { $database = null; + return function (?Document $project = null) use ($pools, $cache, $database) { if ($database !== null && $project !== null && !$project->isEmpty() && $project->getId() !== 'console') { - $database->setTenant($project->getInternalId()); + $database->setTenant((int)$project->getSequence()); return $database; } - $dbAdapter = $pools - ->get('logs') - ->pop() - ->getResource(); - - $database = new Database( - $dbAdapter, - $cache - ); + $adapter = new DatabasePool($pools->get('logs')); + $database = new Database($adapter, $cache); $database ->setSharedTables(true) @@ -192,21 +182,21 @@ CLI::setResource('getLogsDB', function (Group $pools, Cache $cache) { // set tenant if ($project !== null && !$project->isEmpty() && $project->getId() !== 'console') { - $database->setTenant($project->getInternalId()); + $database->setTenant((int)$project->getSequence()); } return $database; }; }, ['pools', 'cache']); -CLI::setResource('queueForStatsUsage', function (Connection $publisher) { +CLI::setResource('queueForStatsUsage', function (Publisher $publisher) { return new StatsUsage($publisher); }, ['publisher']); CLI::setResource('queueForStatsResources', function (Publisher $publisher) { return new StatsResources($publisher); }, ['publisher']); CLI::setResource('publisher', function (Group $pools) { - return $pools->get('publisher')->pop()->getResource(); + return new BrokerPool(publisher: $pools->get('publisher')); }, ['pools']); CLI::setResource('queueForFunctions', function (Publisher $publisher) { return new Func($publisher); @@ -219,6 +209,13 @@ CLI::setResource('queueForCertificates', function (Publisher $publisher) { }, ['publisher']); CLI::setResource('logError', function (Registry $register) { return function (Throwable $error, string $namespace, string $action) use ($register) { + Console::error('[Error] Timestamp: ' . date('c', time())); + Console::error('[Error] Type: ' . get_class($error)); + Console::error('[Error] Message: ' . $error->getMessage()); + Console::error('[Error] File: ' . $error->getFile()); + Console::error('[Error] Line: ' . $error->getLine()); + Console::error('[Error] Trace: ' . $error->getTraceAsString()); + $logger = $register->get('logger'); if ($logger) { @@ -237,6 +234,7 @@ CLI::setResource('logError', function (Registry $register) { $log->addExtra('file', $error->getFile()); $log->addExtra('line', $error->getLine()); $log->addExtra('trace', $error->getTraceAsString()); + $log->addExtra('detailedTrace', $error->getTrace()); $log->setAction($action); @@ -250,24 +248,41 @@ CLI::setResource('logError', function (Registry $register) { Console::error('Error pushing log: ' . $th->getMessage()); } } - - Console::warning("Failed: {$error->getMessage()}"); - Console::warning($error->getTraceAsString()); }; }, ['register']); -CLI::setResource('executor', fn () => new Executor(fn (string $projectId, string $deploymentId) => System::getEnv('_APP_EXECUTOR_HOST'))); +CLI::setResource('executor', fn () => new Executor()); + +CLI::setResource('telemetry', fn () => new NoTelemetry()); $platform = new Appwrite(); -$platform->init(Service::TYPE_TASK); +$args = $platform->getEnv('argv'); +if (!isset($args[0])) { + Console::error('Missing task name'); + Console::exit(1); +} + +\array_shift($args); +$taskName = $args[0]; +$platform->init(Service::TYPE_TASK); $cli = $platform->getCli(); $cli ->error() ->inject('error') - ->action(function (Throwable $error) { - Console::error($error->getMessage()); + ->inject('logError') + ->action(function (Throwable $error, callable $logError) use ($taskName) { + call_user_func_array($logError, [ + $error, + 'Task', + $taskName, + ]); + + Timer::clearAll(); }); -$cli->run(); +$cli->shutdown()->action(fn () => Timer::clearAll()); + +Runtime::enableCoroutine(SWOOLE_HOOK_ALL); +run($cli->run(...)); diff --git a/app/config/collections/common.php b/app/config/collections/common.php index 3f6245dfdd..6de7eb224b 100644 --- a/app/config/collections/common.php +++ b/app/config/collections/common.php @@ -1101,6 +1101,28 @@ return [ 'array' => false, 'filters' => ['json', 'encrypt'], ], + [ + '$id' => ID::custom('scopes'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => true, + 'filters' => [], + ], + [ + '$id' => ID::custom('expire'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'required' => false, + 'signed' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], ], 'indexes' => [ [ @@ -2352,6 +2374,20 @@ return [ 'lengths' => [], 'orders' => [], ], + [ + '$id' => ID::custom('_key_expired'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['expired'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_session_internal_id'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['sessionInternalId'], + 'lengths' => [], + 'orders' => [], + ], ], ], diff --git a/app/config/collections/platform.php b/app/config/collections/platform.php index 8725f4b4ce..60f181df66 100644 --- a/app/config/collections/platform.php +++ b/app/config/collections/platform.php @@ -225,7 +225,7 @@ return [ '$id' => ID::custom('templates'), 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 1000000, // TODO make sure size fits + 'size' => 1_000_000, // TODO make sure size fits 'signed' => true, 'required' => false, 'default' => [], @@ -287,6 +287,17 @@ return [ 'array' => false, 'filters' => ['subQueryKeys'], ], + [ + '$id' => ID::custom('devKeys'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['subQueryDevKeys'], + ], [ '$id' => ID::custom('search'), 'type' => Database::VAR_STRING, @@ -356,7 +367,21 @@ return [ 'attributes' => ['pingedAt'], 'lengths' => [], 'orders' => [], - ] + ], + [ + '$id' => ID::custom('_key_database'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['database'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_region_accessed_at'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['region', 'accessedAt'], + 'lengths' => [], + 'orders' => [], + ], ], ], @@ -480,6 +505,20 @@ return [ 'lengths' => [], 'orders' => [], ], + [ + '$id' => ID::custom('_key_project_id_region'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['projectId', 'region'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_region_rt_active'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['region', 'resourceType', 'active'], + 'lengths' => [], + 'orders' => [], + ], ], ], @@ -689,6 +728,107 @@ return [ ], ], + 'devKeys' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('devKeys'), + 'name' => 'Dev keys', + 'attributes' => [ + [ + '$id' => ID::custom('projectInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('projectId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => 0, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('name'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('secret'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 512, // var_dump of \bin2hex(\random_bytes(128)) => string(256) doubling for encryption + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => ['encrypt'], + ], + [ + '$id' => ID::custom('expire'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('accessedAt'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('sdks'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => true, + 'filters' => [], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_project'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['projectInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => '_key_accessedAt', + 'type' => Database::INDEX_KEY, + 'attributes' => ['accessedAt'], + 'lengths' => [], + 'orders' => [], + ], + ], + ], + 'webhooks' => [ '$collection' => ID::custom(Database::METADATA), '$id' => ID::custom('webhooks'), @@ -1013,21 +1153,10 @@ return [ 'filters' => [], ], [ - '$id' => ID::custom('resourceType'), + '$id' => ID::custom('type'), // 'api', 'redirect', 'deployment' (site or function) 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 100, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('resourceInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, + 'size' => 32, 'signed' => true, 'required' => false, 'default' => null, @@ -1035,13 +1164,101 @@ return [ 'filters' => [], ], [ - '$id' => ID::custom('resourceId'), + '$id' => ID::custom('trigger'), // 'manual', 'deployment', '' (empty) + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 32, + 'signed' => true, + 'required' => false, + 'default' => '', + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('redirectUrl'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => false, + 'default' => '', + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('redirectStatusCode'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('deploymentResourceType'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 32, + 'signed' => true, + 'required' => false, + 'default' => '', + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('deploymentId'), 'type' => Database::VAR_STRING, 'format' => '', 'size' => Database::LENGTH_KEY, 'signed' => true, 'required' => false, - 'default' => null, + 'default' => '', + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('deploymentInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => '', + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('deploymentResourceId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => '', + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('deploymentResourceInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => '', + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('deploymentVcsProviderBranch'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => '', 'array' => false, 'filters' => [], ], @@ -1067,6 +1284,17 @@ return [ 'array' => false, 'filters' => [], ], + [ + '$id' => ID::custom('search'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], [ '$id' => ID::custom('owner'), 'type' => Database::VAR_STRING, @@ -1091,6 +1319,13 @@ return [ ], ], 'indexes' => [ + [ + '$id' => ID::custom('_key_search'), + 'type' => Database::INDEX_FULLTEXT, + 'attributes' => ['search'], + 'lengths' => [], + 'orders' => [], + ], [ '$id' => ID::custom('_key_domain'), 'type' => Database::INDEX_UNIQUE, @@ -1113,24 +1348,59 @@ return [ 'orders' => [Database::ORDER_ASC], ], [ - '$id' => '_key_resourceInternalId', + '$id' => '_key_type', 'type' => Database::INDEX_KEY, - 'attributes' => ['resourceInternalId'], + 'attributes' => ['type'], + 'lengths' => [32], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => '_key_trigger', + 'type' => Database::INDEX_KEY, + 'attributes' => ['trigger'], + 'lengths' => [32], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => '_key_deploymentResourceType', + 'type' => Database::INDEX_KEY, + 'attributes' => ['deploymentResourceType'], + 'lengths' => [32], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => '_key_deploymentResourceId', + 'type' => Database::INDEX_KEY, + 'attributes' => ['deploymentResourceId'], 'lengths' => [Database::LENGTH_KEY], 'orders' => [Database::ORDER_ASC], ], [ - '$id' => '_key_resourceId', + '$id' => '_key_deploymentResourceInternalId', 'type' => Database::INDEX_KEY, - 'attributes' => ['resourceId'], + 'attributes' => ['deploymentResourceInternalId'], 'lengths' => [Database::LENGTH_KEY], 'orders' => [Database::ORDER_ASC], ], [ - '$id' => '_key_resourceType', + '$id' => '_key_deploymentId', 'type' => Database::INDEX_KEY, - 'attributes' => ['resourceType'], - 'lengths' => [], + 'attributes' => ['deploymentId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => '_key_deploymentInternalId', + 'type' => Database::INDEX_KEY, + 'attributes' => ['deploymentInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => '_key_deploymentVcsProviderBranch', + 'type' => Database::INDEX_KEY, + 'attributes' => ['deploymentVcsProviderBranch'], + 'lengths' => [Database::LENGTH_KEY], 'orders' => [Database::ORDER_ASC], ], [ @@ -1147,6 +1417,13 @@ return [ 'lengths' => [16], 'orders' => [Database::ORDER_ASC], ], + [ + '$id' => ID::custom('_key_piid_riid_rt'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['projectInternalId', 'deploymentInternalId', 'deploymentResourceType'], + 'lengths' => [], + 'orders' => [], + ], ], ], @@ -1442,7 +1719,14 @@ return [ 'attributes' => ['resourceType'], 'lengths' => [Database::LENGTH_KEY], 'orders' => [Database::ORDER_ASC], - ] + ], + [ + '$id' => ID::custom('_key_piid_riid_rt'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['projectInternalId', 'resourceInternalId', 'resourceType'], + 'lengths' => [], + 'orders' => [], + ], ], ], @@ -1590,6 +1874,13 @@ return [ 'lengths' => [Database::LENGTH_KEY], 'orders' => [Database::ORDER_ASC], ], + [ + '$id' => ID::custom('_key_piid_prid_rt'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['projectInternalId', 'providerRepositoryId'], + 'lengths' => [], + 'orders' => [], + ], ], ], @@ -1599,5 +1890,5 @@ return [ 'name' => 'vcsCommentLocks', 'attributes' => [], 'indexes' => [] - ] + ], ]; diff --git a/app/config/collections/projects.php b/app/config/collections/projects.php index e77751c124..ac14421382 100644 --- a/app/config/collections/projects.php +++ b/app/config/collections/projects.php @@ -569,7 +569,7 @@ return [ 'filters' => [], ], [ - '$id' => ID::custom('deployment'), + '$id' => ID::custom('deploymentId'), 'type' => Database::VAR_STRING, 'format' => '', 'size' => Database::LENGTH_KEY, @@ -579,6 +579,61 @@ return [ 'array' => false, 'filters' => [], ], + [ + '$id' => ID::custom('deploymentCreatedAt'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('latestDeploymentId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('latestDeploymentInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('latestDeploymentCreatedAt'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('latestDeploymentStatus'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16, + 'signed' => true, + 'required' => false, + 'default' => '', + 'array' => false, + 'filters' => [], + ], [ '$id' => ID::custom('vars'), 'type' => Database::VAR_STRING, @@ -674,7 +729,7 @@ return [ 'size' => 8, 'signed' => true, 'required' => false, - 'default' => 'v4', + 'default' => 'v5', 'array' => false, 'filters' => [], ], @@ -708,7 +763,7 @@ return [ 'size' => 128, 'signed' => false, 'required' => false, - 'default' => APP_FUNCTION_SPECIFICATION_DEFAULT, + 'default' => APP_COMPUTE_SPECIFICATION_DEFAULT, 'filters' => [], ], [ @@ -788,9 +843,444 @@ return [ 'orders' => [Database::ORDER_ASC], ], [ - '$id' => ID::custom('_key_deployment'), + '$id' => ID::custom('_key_deploymentId'), 'type' => Database::INDEX_KEY, - 'attributes' => ['deployment'], + 'attributes' => ['deploymentId'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ] + ], + ], + + 'sites' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('sites'), + 'name' => 'Sites', + 'attributes' => [ + [ + '$id' => ID::custom('name'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('enabled'), + 'type' => Database::VAR_BOOLEAN, + 'signed' => true, + 'size' => 0, + 'format' => '', + 'filters' => [], + 'required' => true, + 'array' => false, + ], + [ + '$id' => ID::custom('live'), + 'type' => Database::VAR_BOOLEAN, + 'signed' => true, + 'size' => 0, + 'format' => '', + 'filters' => [], + 'required' => true, + 'array' => false, + ], + [ + '$id' => ID::custom('installationId'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('installationInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('providerRepositoryId'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('repositoryId'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('repositoryInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('providerBranch'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('providerRootDirectory'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('providerSilentMode'), + 'type' => Database::VAR_BOOLEAN, + 'signed' => true, + 'size' => 0, + 'format' => '', + 'filters' => [], + 'required' => false, + 'default' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('logging'), + 'type' => Database::VAR_BOOLEAN, + 'signed' => true, + 'size' => 0, + 'format' => '', + 'filters' => [], + 'required' => true, + 'array' => false, + ], + [ + '$id' => ID::custom('framework'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + 'array' => false, + '$id' => ID::custom('outputDirectory'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'filters' => [], + ], + [ + 'array' => false, + '$id' => ID::custom('buildCommand'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'filters' => [], + ], + [ + 'array' => false, + '$id' => ID::custom('installCommand'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'filters' => [], + ], + [ + '$id' => ID::custom('fallbackFile'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('deploymentInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('deploymentId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('deploymentCreatedAt'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('deploymentScreenshotLight'), // File ID from 'screenshots' Console bucket + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 32, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('deploymentScreenshotDark'), // File ID from 'screenshots' Console bucket + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 32, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('latestDeploymentId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('latestDeploymentInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('latestDeploymentCreatedAt'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('latestDeploymentStatus'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16, + 'signed' => true, + 'required' => false, + 'default' => '', + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('vars'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['subQueryVariables'], + ], + [ + '$id' => ID::custom('varsProject'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['subQueryProjectVariables'], + ], + [ + '$id' => ID::custom('timeout'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('search'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + 'array' => false, + '$id' => ID::custom('specification'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 128, + 'signed' => false, + 'required' => false, + 'default' => APP_COMPUTE_SPECIFICATION_DEFAULT, + 'filters' => [], + ], + [ + '$id' => ID::custom('buildRuntime'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => true, + 'default' => '', + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('adapter'), // ssr or static; named this way as it's a term in SSR frameworks + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16, + 'signed' => true, + 'required' => false, + 'default' => '', + 'array' => false, + 'filters' => [], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_search'), + 'type' => Database::INDEX_FULLTEXT, + 'attributes' => ['search'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_name'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['name'], + 'lengths' => [256], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_enabled'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['enabled'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_installationId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['installationId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_installationInternalId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['installationInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_providerRepositoryId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['providerRepositoryId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_repositoryId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['repositoryId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_repositoryInternalId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['repositoryInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_framework'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['framework'], + 'lengths' => [64], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_deploymentId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['deploymentId'], 'lengths' => [], 'orders' => [Database::ORDER_ASC], ] @@ -835,28 +1325,6 @@ return [ 'array' => false, 'filters' => [], ], - [ - '$id' => ID::custom('buildInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('buildId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], [ 'array' => false, '$id' => ID::custom('entrypoint'), @@ -870,20 +1338,31 @@ return [ ], [ 'array' => false, - '$id' => ID::custom('commands'), + '$id' => ID::custom('buildCommands'), 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 2048, + 'size' => 16384, 'signed' => true, 'required' => false, 'default' => null, 'filters' => [], ], [ - '$id' => ID::custom('path'), + 'array' => false, + '$id' => ID::custom('buildOutput'), 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 2048, + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'filters' => [], + ], + [ + '$id' => ID::custom('sourcePath'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, 'signed' => true, 'required' => false, 'default' => null, @@ -1073,18 +1552,18 @@ return [ 'array' => false, ], [ - '$id' => ID::custom('size'), + '$id' => ID::custom('sourceSize'), 'type' => Database::VAR_INTEGER, 'format' => '', - 'size' => 0, - 'signed' => true, + 'size' => 8, + 'signed' => false, 'required' => false, 'default' => null, 'array' => false, 'filters' => [], ], [ - '$id' => ID::custom('metadata'), + '$id' => ID::custom('sourceMetadata'), 'type' => Database::VAR_STRING, 'format' => '', 'size' => 16384, // https://tools.ietf.org/html/rfc4288#section-4.2 @@ -1095,7 +1574,7 @@ return [ 'filters' => ['json'], ], [ - '$id' => ID::custom('chunksTotal'), + '$id' => ID::custom('sourceChunksTotal'), 'type' => Database::VAR_INTEGER, 'format' => '', 'size' => 0, @@ -1106,7 +1585,7 @@ return [ 'filters' => [], ], [ - '$id' => ID::custom('chunksUploaded'), + '$id' => ID::custom('sourceChunksUploaded'), 'type' => Database::VAR_INTEGER, 'format' => '', 'size' => 0, @@ -1116,17 +1595,6 @@ return [ 'array' => false, 'filters' => [], ], - [ - '$id' => ID::custom('search'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], [ '$id' => ID::custom('activate'), 'type' => Database::VAR_BOOLEAN, @@ -1137,6 +1605,138 @@ return [ 'default' => false, 'array' => false, 'filters' => [], + ], + [ + '$id' => ID::custom('screenshotLight'), // File ID from 'screenshots' Console bucket + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 32, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('screenshotDark'), // File ID from 'screenshots' Console bucket + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 32, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('buildStartedAt'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('buildEndedAt'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('buildDuration'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('buildSize'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 8, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('totalSize'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 8, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('status'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16, + 'signed' => true, + 'required' => false, + 'default' => 'waiting', + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('buildPath'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => '', + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('buildLogs'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 1000000, + 'signed' => true, + 'required' => false, + 'default' => '', + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('adapter'), // ssr or static; named this way as it's a term in SSR frameworks + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16, + 'signed' => true, + 'required' => false, + 'default' => '', + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('fallbackFile'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], ] ], 'indexes' => [ @@ -1155,23 +1755,30 @@ return [ 'orders' => [Database::ORDER_ASC], ], [ - '$id' => ID::custom('_key_search'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['search'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_key_size'), + '$id' => ID::custom('_key_sourceSize'), 'type' => Database::INDEX_KEY, - 'attributes' => ['size'], + 'attributes' => ['sourceSize'], 'lengths' => [], 'orders' => [Database::ORDER_ASC], ], [ - '$id' => ID::custom('_key_buildId'), + '$id' => ID::custom('_key_buildSize'), 'type' => Database::INDEX_KEY, - 'attributes' => ['buildId'], + 'attributes' => ['buildSize'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_totalSize'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['totalSize'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_buildDuration'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['buildDuration'], 'lengths' => [], 'orders' => [Database::ORDER_ASC], ], @@ -1182,155 +1789,34 @@ return [ 'lengths' => [], 'orders' => [Database::ORDER_ASC], ], - ], - ], - - 'builds' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('builds'), - 'name' => 'Builds', - 'attributes' => [ [ - '$id' => ID::custom('startTime'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - [ - '$id' => ID::custom('endTime'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - [ - '$id' => ID::custom('duration'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('size'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('deploymentInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('deploymentId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('runtime'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => true, - 'default' => '', - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('status'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => true, - 'default' => 'processing', - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('path'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => false, - 'default' => '', - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('logs'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 1000000, - 'signed' => true, - 'required' => false, - 'default' => '', - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('sourceType'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => true, - 'default' => 'local', - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('source'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => true, - 'default' => '', - 'array' => false, - 'filters' => [], - ] - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_deployment'), + '$id' => ID::custom('_key_type'), 'type' => Database::INDEX_KEY, - 'attributes' => ['deploymentId'], - 'lengths' => [Database::LENGTH_KEY], + 'attributes' => ['type'], + 'lengths' => [32], 'orders' => [Database::ORDER_ASC], - ] + ], + [ + '$id' => ID::custom('_key_status'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['status'], + 'lengths' => [16], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_resourceId_resourceType'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['resourceId', 'resourceType'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_resource_internal_id'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['resourceInternalId'], + 'lengths' => [], + 'orders' => [], + ], ], ], @@ -1340,7 +1826,7 @@ return [ 'name' => 'Executions', 'attributes' => [ [ - '$id' => ID::custom('functionInternalId'), + '$id' => ID::custom('resourceInternalId'), 'type' => Database::VAR_STRING, 'format' => '', 'size' => Database::LENGTH_KEY, @@ -1351,7 +1837,18 @@ return [ 'filters' => [], ], [ - '$id' => ID::custom('functionId'), + '$id' => ID::custom('resourceId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('resourceType'), 'type' => Database::VAR_STRING, 'format' => '', 'size' => Database::LENGTH_KEY, @@ -1493,17 +1990,6 @@ return [ 'array' => false, 'filters' => ['json'], ], - [ - '$id' => ID::custom('search'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], [ '$id' => ID::custom('scheduledAt'), 'type' => Database::VAR_DATETIME, @@ -1540,19 +2026,12 @@ return [ ], 'indexes' => [ [ - '$id' => ID::custom('_key_function'), + '$id' => ID::custom('_key_resource'), 'type' => Database::INDEX_KEY, - 'attributes' => ['functionId'], + 'attributes' => ['resourceInternalId', 'resourceType', 'resourceId'], 'lengths' => [Database::LENGTH_KEY], 'orders' => [Database::ORDER_ASC], ], - [ - '$id' => ID::custom('_fulltext_search'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['search'], - 'lengths' => [], - 'orders' => [], - ], [ '$id' => ID::custom('_key_trigger'), 'type' => Database::INDEX_KEY, @@ -1602,6 +2081,13 @@ return [ 'lengths' => [], 'orders' => [Database::ORDER_ASC], ], + [ + '$id' => ID::custom('_key_function_internal_id'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['resourceInternalId'], + 'lengths' => [], + 'orders' => [], + ], ], ], @@ -1665,6 +2151,17 @@ return [ 'array' => false, 'filters' => ['encrypt'] ], + [ + '$id' => ID::custom('secret'), + 'type' => Database::VAR_BOOLEAN, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => false, + 'array' => false, + 'filters' => [], + ], [ '$id' => ID::custom('search'), 'type' => Database::VAR_STRING, @@ -1720,6 +2217,13 @@ return [ 'lengths' => [], 'orders' => [], ], + [ + '$id' => ID::custom('_key_resource_internal_id_resource_type'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['resourceInternalId', 'resourceType'], + 'lengths' => [], + 'orders' => [], + ], ], ], @@ -1783,6 +2287,17 @@ return [ 'array' => false, 'filters' => ['json', 'encrypt'], ], + [ + '$id' => ID::custom('options'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 65536, + 'signed' => true, + 'required' => false, + 'default' => [], + 'array' => false, + 'filters' => ['json'], + ], [ '$id' => ID::custom('resources'), 'type' => Database::VAR_STRING, @@ -1837,7 +2352,29 @@ return [ 'default' => null, 'array' => false, 'filters' => [], - ] + ], + [ + '$id' => ID::custom('resourceId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('resourceType'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], ], 'indexes' => [ [ @@ -1861,6 +2398,13 @@ return [ 'lengths' => [Database::LENGTH_KEY], 'orders' => [Database::ORDER_ASC], ], + [ + '$id' => '_key_resource_id', + 'type' => Database::INDEX_KEY, + 'attributes' => ['resourceId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_DESC], + ], [ '$id' => ID::custom('_fulltext_search'), 'type' => Database::INDEX_FULLTEXT, @@ -1870,4 +2414,101 @@ return [ ] ], ], + + 'resourceTokens' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('resourceTokens'), + 'name' => 'Resource Tokens', + 'attributes' => [ + [ + '$id' => ID::custom('resourceId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('resourceInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('resourceType'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 100, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('secret'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 512, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => ['encrypt'], + ], + [ + '$id' => ID::custom('expire'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 255, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('accessedAt'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + ], + 'indexes' => [ + [ + '$id' => '_key_expiry_date', + 'type' => Database::INDEX_KEY, + 'attributes' => ['expire'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => '_key_accessedAt', + 'type' => Database::INDEX_KEY, + 'attributes' => ['accessedAt'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => '_key_resourceInternalId_resourceType', + 'type' => Database::INDEX_KEY, + 'attributes' => ['resourceInternalId', 'resourceType'], + 'lengths' => [], + 'orders' => [], + ], + ], + ], ]; diff --git a/app/config/console.php b/app/config/console.php index 4a0421e153..b1e4299ce0 100644 --- a/app/config/console.php +++ b/app/config/console.php @@ -11,7 +11,7 @@ use Utopia\System\System; $console = [ '$id' => ID::custom('console'), - '$internalId' => ID::custom('console'), + '$sequence' => ID::custom('console'), 'name' => 'Appwrite', '$collection' => ID::custom('projects'), 'description' => 'Appwrite core engine', diff --git a/app/config/errors.php b/app/config/errors.php index 7c7f6dc9ec..8365e8c705 100644 --- a/app/config/errors.php +++ b/app/config/errors.php @@ -81,7 +81,7 @@ return [ ], Exception::GENERAL_ROUTE_NOT_FOUND => [ 'name' => Exception::GENERAL_ROUTE_NOT_FOUND, - 'description' => 'The requested route was not found. Please refer to the API docs and try again.', + 'description' => 'Route not found. Please ensure the endpoint is configured correctly and that the API route is valid for this SDK version. Refer to the API docs for more details.', 'code' => 404, ], Exception::GENERAL_CURSOR_NOT_FOUND => [ @@ -375,6 +375,13 @@ return [ 'code' => 409, ], + /** Console */ + Exception::RESOURCE_ALREADY_EXISTS => [ + 'name' => Exception::RESOURCE_ALREADY_EXISTS, + 'description' => 'Resource with the requested ID already exists. Please choose a different ID and try again.', + 'code' => 409, + ], + /** Membership */ Exception::MEMBERSHIP_NOT_FOUND => [ 'name' => Exception::MEMBERSHIP_NOT_FOUND, @@ -386,6 +393,16 @@ return [ 'description' => 'Membership is already confirmed.', 'code' => 409, ], + Exception::MEMBERSHIP_DELETION_PROHIBITED => [ + 'name' => Exception::MEMBERSHIP_DELETION_PROHIBITED, + 'description' => 'Membership deletion is prohibited.', + 'code' => 400, + ], + Exception::MEMBERSHIP_DOWNGRADE_PROHIBITED => [ + 'name' => Exception::MEMBERSHIP_DOWNGRADE_PROHIBITED, + 'description' => 'Membership role downgrade is prohibited.', + 'code' => 400, + ], /** Avatars */ Exception::AVATAR_SET_NOT_FOUND => [ @@ -481,6 +498,23 @@ return [ 'code' => 403, ], + /** Tokens */ + Exception::TOKEN_NOT_FOUND => [ + 'name' => Exception::TOKEN_NOT_FOUND, + 'description' => 'The requested file token could not be found.', + 'code' => 404, + ], + Exception::TOKEN_EXPIRED => [ + 'name' => Exception::TOKEN_EXPIRED, + 'description' => 'The requested file token has expired.', + 'code' => 401, + ], + Exception::TOKEN_RESOURCE_TYPE_INVALID => [ + 'name' => Exception::TOKEN_RESOURCE_TYPE_INVALID, + 'description' => 'The resource type for the token is invalid.', + 'code' => 400, + ], + /** VCS */ Exception::INSTALLATION_NOT_FOUND => [ 'name' => Exception::INSTALLATION_NOT_FOUND, @@ -520,7 +554,7 @@ return [ 'code' => 404, ], Exception::FUNCTION_ENTRYPOINT_MISSING => [ - 'name' => Exception::FUNCTION_RUNTIME_UNSUPPORTED, + 'name' => Exception::FUNCTION_ENTRYPOINT_MISSING, 'description' => 'Entrypoint for your Appwrite Function is missing. Please specify it when making deployment or update the entrypoint under your function\'s "Settings" > "Configuration" > "Entrypoint".', 'code' => 404, ], @@ -534,6 +568,28 @@ return [ 'description' => 'Function Template with the requested ID could not be found.', 'code' => 404, ], + Exception::FUNCTION_RUNTIME_NOT_DETECTED => [ + 'name' => Exception::FUNCTION_RUNTIME_NOT_DETECTED, + 'description' => 'Function runtime could not be detected.', + 'code' => 400, + ], + Exception::FUNCTION_EXECUTE_PERMISSION_MISSING => [ + 'name' => Exception::FUNCTION_EXECUTE_PERMISSION_MISSING, + 'description' => 'To execute function using domain, execute permissions must include "any" or "guests".', + 'code' => 401, + ], + + /** Sites */ + Exception::SITE_NOT_FOUND => [ + 'name' => Exception::SITE_NOT_FOUND, + 'description' => 'Site with the requested ID could not be found.', + 'code' => 404, + ], + Exception::SITE_TEMPLATE_NOT_FOUND => [ + 'name' => Exception::SITE_TEMPLATE_NOT_FOUND, + 'description' => 'Site Template with the requested ID could not be found.', + 'code' => 404, + ], /** Builds */ Exception::BUILD_NOT_FOUND => [ @@ -556,6 +612,16 @@ return [ 'description' => 'Build with the requested ID is already completed and cannot be canceled.', 'code' => 400, ], + Exception::BUILD_CANCELED => [ + 'name' => Exception::BUILD_CANCELED, + 'description' => 'Build with the requested ID has been canceled.', + 'code' => 400, + ], + Exception::BUILD_FAILED => [ + 'name' => Exception::BUILD_FAILED, + 'description' => 'Build with the requested ID failed. Please check the logs for more information.', + 'code' => 400, + ], /** Deployments */ Exception::DEPLOYMENT_NOT_FOUND => [ @@ -577,6 +643,13 @@ return [ 'code' => 400, ], + /** Logs */ + Exception::LOG_NOT_FOUND => [ + 'name' => Exception::LOG_NOT_FOUND, + 'description' => 'Log with the requested ID could not be found.', + 'code' => 404, + ], + /** Databases */ Exception::DATABASE_NOT_FOUND => [ 'name' => Exception::DATABASE_NOT_FOUND, @@ -593,6 +666,11 @@ return [ 'description' => 'Database timed out. Try adjusting your queries or adding an index.', 'code' => 408 ], + Exception::DATABASE_QUERY_ORDER_NULL => [ + 'name' => Exception::DATABASE_QUERY_ORDER_NULL, + 'description' => 'The order attribute had a null value. Cursor pagination requires all documents order attribute values are non-null.', + 'code' => 400, + ], /** Collections */ Exception::COLLECTION_NOT_FOUND => [ @@ -801,7 +879,7 @@ return [ Exception::RULE_VERIFICATION_FAILED => [ 'name' => Exception::RULE_VERIFICATION_FAILED, 'description' => 'Domain verification failed. Please check if your DNS records are correct and try again.', - 'code' => 401, + 'code' => 400, 'publish' => true ], Exception::PROJECT_SMTP_CONFIG_INVALID => [ @@ -844,6 +922,11 @@ return [ 'description' => 'Variable with the same ID already exists in this project. Try again with a different ID.', 'code' => 409, ], + Exception::VARIABLE_CANNOT_UNSET_SECRET => [ + 'name' => Exception::VARIABLE_CANNOT_UNSET_SECRET, + 'description' => 'Secret variables cannot be marked as non-secret. Please re-create the variable if this is your intention.', + 'code' => 400, + ], Exception::GRAPHQL_NO_QUERY => [ 'name' => Exception::GRAPHQL_NO_QUERY, 'description' => 'Param "query" is not optional.', diff --git a/app/config/events.php b/app/config/events.php index 5378502faf..0bfddf4f1f 100644 --- a/app/config/events.php +++ b/app/config/events.php @@ -217,6 +217,34 @@ return [ ], ] ], + 'sites' => [ + '$model' => Response::MODEL_SITE, + '$resource' => true, + '$description' => 'This event triggers on any sites event.', + 'deployments' => [ + '$model' => Response::MODEL_DEPLOYMENT, + '$resource' => true, + '$description' => 'This event triggers on any deployments event.', + 'create' => [ + '$description' => 'This event triggers when a deployment is created.', + ], + 'delete' => [ + '$description' => 'This event triggers when a deployment is deleted.' + ], + 'update' => [ + '$description' => 'This event triggers when a deployment is updated.' + ], + ], + 'create' => [ + '$description' => 'This event triggers when a site is created.' + ], + 'delete' => [ + '$description' => 'This event triggers when a site is deleted.', + ], + 'update' => [ + '$description' => 'This event triggers when a site is updated.', + ] + ], 'functions' => [ '$model' => Response::MODEL_FUNCTION, '$resource' => true, diff --git a/app/config/frameworks.php b/app/config/frameworks.php new file mode 100644 index 0000000000..f4d8ec7ffa --- /dev/null +++ b/app/config/frameworks.php @@ -0,0 +1,312 @@ + [ + 'key' => 'analog', + 'name' => 'Analog', + 'screenshotSleep' => 3000, + 'buildRuntime' => 'node-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'bundleCommand' => 'bash /usr/local/server/helpers/analog/bundle.sh', + 'envCommand' => 'source /usr/local/server/helpers/analog/env.sh', + 'adapters' => [ + 'ssr' => [ + 'key' => 'ssr', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './dist/analog', + 'startCommand' => 'bash helpers/analog/server.sh', + ], + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './dist/analog/public', + 'startCommand' => 'bash helpers/server.sh', + 'fallbackFile' => 'index.html' + ] + ] + ], + 'angular' => [ + 'key' => 'angular', + 'name' => 'Angular', + 'screenshotSleep' => 3000, + 'buildRuntime' => 'node-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'bundleCommand' => 'bash /usr/local/server/helpers/angular/bundle.sh', + 'envCommand' => 'source /usr/local/server/helpers/angular/env.sh', + 'adapters' => [ + 'ssr' => [ + 'key' => 'ssr', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './dist/angular', + 'startCommand' => 'bash helpers/angular/server.sh', + ], + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './dist/angular/browser', + 'startCommand' => 'bash helpers/server.sh', + 'fallbackFile' => 'index.csr.html' + ] + ] + ], + 'nextjs' => [ + 'key' => 'nextjs', + 'name' => 'Next.js', + 'screenshotSleep' => 3000, + 'buildRuntime' => 'node-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'bundleCommand' => 'bash /usr/local/server/helpers/next-js/bundle.sh', + 'envCommand' => 'source /usr/local/server/helpers/next-js/env.sh', + 'adapters' => [ + 'ssr' => [ + 'key' => 'ssr', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './.next', + 'startCommand' => 'bash helpers/next-js/server.sh', + ], + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './out', + 'startCommand' => 'bash helpers/server.sh', + ] + ] + ], + 'react' => [ + 'key' => 'react', + 'name' => 'React', + 'screenshotSleep' => 3000, + 'buildRuntime' => 'node-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'adapters' => [ + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './dist', + 'startCommand' => 'bash helpers/server.sh', + 'fallbackFile' => 'index.html' + ] + ] + ], + 'nuxt' => [ + 'key' => 'nuxt', + 'name' => 'Nuxt', + 'screenshotSleep' => 3000, + 'buildRuntime' => 'node-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'bundleCommand' => 'bash /usr/local/server/helpers/nuxt/bundle.sh', + 'envCommand' => 'source /usr/local/server/helpers/nuxt/env.sh', + 'adapters' => [ + 'ssr' => [ + 'key' => 'ssr', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './.output', + 'startCommand' => 'bash helpers/nuxt/server.sh', + ], + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run generate', + 'installCommand' => 'npm install', + 'outputDirectory' => './output/public', + 'startCommand' => 'bash helpers/server.sh', + ] + ] + ], + 'vue' => [ + 'key' => 'vue', + 'name' => 'Vue.js', + 'screenshotSleep' => 5000, + 'buildRuntime' => 'node-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'adapters' => [ + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './dist', + 'startCommand' => 'bash helpers/server.sh', + 'fallbackFile' => 'index.html' + ] + ] + ], + 'sveltekit' => [ + 'key' => 'sveltekit', + 'name' => 'SvelteKit', + 'screenshotSleep' => 3000, + 'buildRuntime' => 'node-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'bundleCommand' => 'bash /usr/local/server/helpers/sveltekit/bundle.sh', + 'envCommand' => 'source /usr/local/server/helpers/sveltekit/env.sh', + 'adapters' => [ + 'ssr' => [ + 'key' => 'ssr', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './build', + 'startCommand' => 'bash helpers/sveltekit/server.sh', + ], + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './build', + 'startCommand' => 'bash helpers/server.sh', + ] + ] + ], + 'astro' => [ + 'key' => 'astro', + 'name' => 'Astro', + 'screenshotSleep' => 3000, + 'buildRuntime' => 'node-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'bundleCommand' => 'bash /usr/local/server/helpers/astro/bundle.sh', + 'envCommand' => 'source /usr/local/server/helpers/astro/env.sh', + 'adapters' => [ + 'ssr' => [ + 'key' => 'ssr', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './dist', + 'startCommand' => 'bash helpers/astro/server.sh', + ], + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './dist', + 'startCommand' => 'bash helpers/server.sh', + ] + ] + ], + 'remix' => [ + 'key' => 'remix', + 'name' => 'Remix', + 'screenshotSleep' => 3000, + 'buildRuntime' => 'node-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'bundleCommand' => 'bash /usr/local/server/helpers/remix/bundle.sh', + 'envCommand' => 'source /usr/local/server/helpers/remix/env.sh', + 'adapters' => [ + 'ssr' => [ + 'key' => 'ssr', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './build', + 'startCommand' => 'bash helpers/remix/server.sh', + ], + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './build/client', + 'startCommand' => 'bash helpers/server.sh', + ] + ] + ], + 'lynx' => [ + 'key' => 'lynx', + 'name' => 'Lynx', + 'screenshotSleep' => 5000, + 'buildRuntime' => 'node-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'adapters' => [ + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './dist', + 'startCommand' => 'bash helpers/server.sh', + 'fallbackFile' => 'index.html' + ] + ] + ], + 'flutter' => [ + 'key' => 'flutter', + 'name' => 'Flutter', + 'screenshotSleep' => 5000, + 'buildRuntime' => 'flutter-3.29', + 'runtimes' => getVersions($templateRuntimes['FLUTTER']['versions'], 'flutter'), + 'adapters' => [ + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'flutter build web --release -t lib/main.dart', + 'installCommand' => 'flutter pub get', + 'outputDirectory' => './build/web', + 'startCommand' => 'bash helpers/server.sh', + ], + ], + ], + 'react-native' => [ + 'key' => 'react-native', + 'name' => 'React Native', + 'screenshotSleep' => 3000, + 'buildRuntime' => 'node-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'adapters' => [ + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './dist', + 'startCommand' => 'bash helpers/server.sh', + 'fallbackFile' => 'index.html' + ] + ] + ], + 'vite' => [ + 'key' => 'vite', + 'name' => 'Vite', + 'screenshotSleep' => 3000, + 'buildRuntime' => 'node-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'adapters' => [ + 'static' => [ + 'key' => 'static', + 'buildCommand' => 'npm run build', + 'installCommand' => 'npm install', + 'outputDirectory' => './dist', + 'startCommand' => 'bash helpers/server.sh', + ], + ] + ], + 'other' => [ + 'key' => 'other', + 'name' => 'Other', + 'screenshotSleep' => 3000, + 'buildRuntime' => 'node-22', + 'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'), + 'adapters' => [ + 'static' => [ + 'key' => 'static', + 'buildCommand' => '', + 'installCommand' => '', + 'outputDirectory' => './', + 'startCommand' => 'bash helpers/server.sh', + ], + ] + ], +]; diff --git a/app/config/locale/templates/email-base-styled.tpl b/app/config/locale/templates/email-base-styled.tpl index 4d6972389e..f6d3e8cd63 100644 --- a/app/config/locale/templates/email-base-styled.tpl +++ b/app/config/locale/templates/email-base-styled.tpl @@ -79,7 +79,7 @@