mirror of
https://github.com/standardnotes/server
synced 2026-01-17 14:04:28 -05:00
Compare commits
183 Commits
@standardn
...
@standardn
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a45aeb3e6 | ||
|
|
72c9b28ebe | ||
|
|
9cf271a5f2 | ||
|
|
1d280028a6 | ||
|
|
5f24b59025 | ||
|
|
9169e2bf3f | ||
|
|
13467d52cf | ||
|
|
af5ebb25e7 | ||
|
|
25a875cbbc | ||
|
|
78b13261bf | ||
|
|
6356fcaeed | ||
|
|
443235a861 | ||
|
|
95fccb0822 | ||
|
|
1fa476d1f9 | ||
|
|
88b888cd25 | ||
|
|
e3eede72cf | ||
|
|
efb341eb99 | ||
|
|
dae7dc9541 | ||
|
|
29e573e9b5 | ||
|
|
3df14149f0 | ||
|
|
6ba1867781 | ||
|
|
1026ce383c | ||
|
|
2795cefc1b | ||
|
|
637593c1bc | ||
|
|
08f7c5447b | ||
|
|
051b6e3093 | ||
|
|
250c1f069b | ||
|
|
3e4a1e9645 | ||
|
|
4629580650 | ||
|
|
c29f6b9c6f | ||
|
|
036317e333 | ||
|
|
4afe32650f | ||
|
|
c021bb3d7c | ||
|
|
783fd9e2c6 | ||
|
|
d789c67649 | ||
|
|
3ab29569db | ||
|
|
099c6e10c6 | ||
|
|
76ae6f5a88 | ||
|
|
9bd2b0c953 | ||
|
|
3fc07a5b60 | ||
|
|
94e18ab36b | ||
|
|
1c54d18c3c | ||
|
|
d2efa73fd7 | ||
|
|
b47c80cccd | ||
|
|
b72e515931 | ||
|
|
65fcc657a7 | ||
|
|
65ced2cc7b | ||
|
|
af17698334 | ||
|
|
5e930d08eb | ||
|
|
0c89d8bd2d | ||
|
|
cb23506c1f | ||
|
|
bf9072dbd4 | ||
|
|
6abdd73a31 | ||
|
|
421b5c5487 | ||
|
|
465530841f | ||
|
|
0057a5d6ff | ||
|
|
b736dab3c1 | ||
|
|
951d965304 | ||
|
|
29e8de3238 | ||
|
|
eeeacabaa8 | ||
|
|
51ca8229b8 | ||
|
|
a6a19a391e | ||
|
|
f6cdb7916c | ||
|
|
eafb064d79 | ||
|
|
ba050681f7 | ||
|
|
4780629549 | ||
|
|
79a44aa51f | ||
|
|
dd72769841 | ||
|
|
d8f1c66fd5 | ||
|
|
afe9967d26 | ||
|
|
27bea444cc | ||
|
|
7a571dec0a | ||
|
|
8c57f505be | ||
|
|
973612bf4f | ||
|
|
702a1286eb | ||
|
|
a45b5b69b5 | ||
|
|
321353f26c | ||
|
|
db4607d4aa | ||
|
|
f0531d68cb | ||
|
|
8a00d159a6 | ||
|
|
d244cc0d5f | ||
|
|
6a2aa4b148 | ||
|
|
3ee49416f8 | ||
|
|
ae1e86e19f | ||
|
|
9f76e389e2 | ||
|
|
6e2240e60c | ||
|
|
cd37c951bb | ||
|
|
c4c3dfb823 | ||
|
|
c4b6f17ebc | ||
|
|
71ce938cb1 | ||
|
|
dc76113915 | ||
|
|
6583ff6cd9 | ||
|
|
69ea947857 | ||
|
|
eab78b3a95 | ||
|
|
3097f7f063 | ||
|
|
126989df82 | ||
|
|
a25eb178c5 | ||
|
|
18dae26b8e | ||
|
|
5bc8157d4d | ||
|
|
f29826e917 | ||
|
|
ba7cbb989b | ||
|
|
d4579ce21e | ||
|
|
ed14d2dfb7 | ||
|
|
64f1fe59c2 | ||
|
|
207ef9f3e5 | ||
|
|
3ea0435459 | ||
|
|
7668713dd6 | ||
|
|
f6bc1c3084 | ||
|
|
4203ff9a0c | ||
|
|
0281724196 | ||
|
|
94bd319279 | ||
|
|
373cfad1f7 | ||
|
|
59107f8553 | ||
|
|
e066b6a126 | ||
|
|
a0e4926135 | ||
|
|
b1b244a2cf | ||
|
|
b4a38d9dcc | ||
|
|
71e2a4187e | ||
|
|
c94f9c1a60 | ||
|
|
b9907924be | ||
|
|
d4c188c096 | ||
|
|
2ccaf490df | ||
|
|
cd893b41d7 | ||
|
|
3838358081 | ||
|
|
1a388f00c3 | ||
|
|
bd71422fab | ||
|
|
3e1697f47f | ||
|
|
032cde7723 | ||
|
|
34b956b482 | ||
|
|
681e0378ae | ||
|
|
609e85f926 | ||
|
|
e4ca310707 | ||
|
|
d606493356 | ||
|
|
5ef6c5c14a | ||
|
|
0188f290f9 | ||
|
|
676cf36f8d | ||
|
|
f8aef6c8ef | ||
|
|
5bf8cf49c1 | ||
|
|
51cd0a4dad | ||
|
|
1d06ffe9d5 | ||
|
|
dbf532f55e | ||
|
|
ca6dbc0053 | ||
|
|
1bb5980b45 | ||
|
|
a02a28774b | ||
|
|
2d9b3578b6 | ||
|
|
3d5e747590 | ||
|
|
94467747ac | ||
|
|
cebab59a02 | ||
|
|
09e1a892ca | ||
|
|
7b1eec21e5 | ||
|
|
a58262d584 | ||
|
|
a8f03e157b | ||
|
|
a401962bcd | ||
|
|
9759814f63 | ||
|
|
c7cf53722c | ||
|
|
8cb33dc906 | ||
|
|
1d73e4f072 | ||
|
|
0a0f82ea3d | ||
|
|
f9b1f40ddf | ||
|
|
0562b0a621 | ||
|
|
15ed1fd789 | ||
|
|
5001496c7b | ||
|
|
0a1080ce2a | ||
|
|
4802d7e876 | ||
|
|
bcd95cdbe9 | ||
|
|
d50c4440c2 | ||
|
|
921c30f641 | ||
|
|
22540ee834 | ||
|
|
4f4443a882 | ||
|
|
80dbacf933 | ||
|
|
dc77ff3e45 | ||
|
|
6515dcf487 | ||
|
|
d0fd6b98df | ||
|
|
345efacb44 | ||
|
|
d0dba1b66d | ||
|
|
da119af8b2 | ||
|
|
a5da42bddd | ||
|
|
12767237d2 | ||
|
|
230c96dcf1 | ||
|
|
e2696fcd1a | ||
|
|
a621cf1e3b | ||
|
|
db35b9fcab | ||
|
|
880db1038a |
16
.github/workflows/analytics.yml
vendored
16
.github/workflows/analytics.yml
vendored
@@ -20,19 +20,3 @@ jobs:
|
||||
deploy_web: false
|
||||
package_path: packages/analytics
|
||||
secrets: inherit
|
||||
|
||||
newrelic:
|
||||
needs: call_server_application_workflow
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Create New Relic deployment marker for Worker
|
||||
uses: newrelic/deployment-marker-action@v1
|
||||
with:
|
||||
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
||||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
||||
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_ANALYTICS_WORKER_PROD }}
|
||||
revision: "${{ github.sha }}"
|
||||
description: "Automated Deployment via Github Actions"
|
||||
user: "${{ github.actor }}"
|
||||
|
||||
14
.github/workflows/api-gateway.yml
vendored
14
.github/workflows/api-gateway.yml
vendored
@@ -20,17 +20,3 @@ jobs:
|
||||
deploy_worker: false
|
||||
package_path: packages/api-gateway
|
||||
secrets: inherit
|
||||
|
||||
newrelic:
|
||||
needs: call_server_application_workflow
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Create New Relic deployment marker for Web
|
||||
uses: newrelic/deployment-marker-action@v1
|
||||
with:
|
||||
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
||||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
||||
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_API_GATEWAY_WEB_PROD }}
|
||||
revision: "${{ github.sha }}"
|
||||
description: "Automated Deployment via Github Actions"
|
||||
user: "${{ github.actor }}"
|
||||
|
||||
24
.github/workflows/auth.yml
vendored
24
.github/workflows/auth.yml
vendored
@@ -19,27 +19,3 @@ jobs:
|
||||
workspace_name: "@standardnotes/auth-server"
|
||||
package_path: packages/auth
|
||||
secrets: inherit
|
||||
|
||||
newrelic:
|
||||
needs: call_server_application_workflow
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Create New Relic deployment marker for Web
|
||||
uses: newrelic/deployment-marker-action@v1
|
||||
with:
|
||||
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
||||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
||||
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_AUTH_WEB_PROD }}
|
||||
revision: "${{ github.sha }}"
|
||||
description: "Automated Deployment via Github Actions"
|
||||
user: "${{ github.actor }}"
|
||||
- name: Create New Relic deployment marker for Worker
|
||||
uses: newrelic/deployment-marker-action@v1
|
||||
with:
|
||||
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
||||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
||||
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_AUTH_WORKER_PROD }}
|
||||
revision: "${{ github.sha }}"
|
||||
description: "Automated Deployment via Github Actions"
|
||||
user: "${{ github.actor }}"
|
||||
|
||||
163
.github/workflows/common-e2e.yml
vendored
163
.github/workflows/common-e2e.yml
vendored
@@ -7,6 +7,10 @@ on:
|
||||
type: string
|
||||
default: latest
|
||||
description: The Docker image tag used for SNJS container
|
||||
suite:
|
||||
type: string
|
||||
default: all
|
||||
description: The test suite to run
|
||||
secrets:
|
||||
DOCKER_USERNAME:
|
||||
required: true
|
||||
@@ -18,153 +22,16 @@ on:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
e2e:
|
||||
name: (Self Hosting) E2E Test Suite
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
secondary_db_enabled: [true, false]
|
||||
transition_mode_enabled: [true, false]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
services:
|
||||
snjs:
|
||||
image: standardnotes/snjs:${{ inputs.snjs_image_tag }}
|
||||
ports:
|
||||
- 9001:9001
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
node-version-file: '.nvmrc'
|
||||
|
||||
- name: Install
|
||||
run: yarn install --immutable
|
||||
|
||||
- name: Run Server
|
||||
run: docker compose -f docker-compose.ci.yml up -d
|
||||
env:
|
||||
DB_TYPE: mysql
|
||||
CACHE_TYPE: redis
|
||||
SECONDARY_DB_ENABLED: ${{ matrix.secondary_db_enabled }}
|
||||
TRANSITION_MODE_ENABLED: ${{ matrix.transition_mode_enabled }}
|
||||
|
||||
- name: Wait for server to start
|
||||
run: docker/is-available.sh http://localhost:3123 $(pwd)/logs
|
||||
|
||||
- name: Run E2E Test Suite
|
||||
run: yarn dlx mocha-headless-chrome --timeout 3600000 -f http://localhost:9001/mocha/test.html
|
||||
|
||||
- name: Show logs on failure
|
||||
if: ${{ failure() }}
|
||||
run: |
|
||||
echo "# Errors:"
|
||||
tail -n 100 logs/*.err
|
||||
echo "# Logs:"
|
||||
tail -n 100 logs/*.log
|
||||
e2e-self-hosted:
|
||||
uses: standardnotes/server/.github/workflows/e2e-self-hosted.yml@main
|
||||
with:
|
||||
snjs_image_tag: ${{ inputs.snjs_image_tag }}
|
||||
suite: ${{ inputs.suite }}
|
||||
secrets: inherit
|
||||
|
||||
e2e-home-server:
|
||||
name: (Home Server) E2E Test Suite
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
db_type: [mysql, sqlite]
|
||||
cache_type: [redis, memory]
|
||||
secondary_db_enabled: [true, false]
|
||||
transition_mode_enabled: [true, false]
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
services:
|
||||
snjs:
|
||||
image: standardnotes/snjs:${{ inputs.snjs_image_tag }}
|
||||
ports:
|
||||
- 9001:9001
|
||||
cache:
|
||||
image: redis
|
||||
ports:
|
||||
- 6379:6379
|
||||
db:
|
||||
image: mysql
|
||||
ports:
|
||||
- 3306:3306
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
MYSQL_DATABASE: standardnotes
|
||||
MYSQL_USER: standardnotes
|
||||
MYSQL_PASSWORD: standardnotes
|
||||
secondary_db:
|
||||
image: mongo:5.0
|
||||
ports:
|
||||
- 27017:27017
|
||||
env:
|
||||
MONGO_INITDB_ROOT_USERNAME: standardnotes
|
||||
MONGO_INITDB_ROOT_PASSWORD: standardnotes
|
||||
MONGO_INITDB_DATABASE: standardnotes
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
node-version-file: '.nvmrc'
|
||||
|
||||
- name: Install Dependencies
|
||||
run: yarn install --immutable
|
||||
|
||||
- name: Build
|
||||
run: yarn build
|
||||
|
||||
- name: Copy dotenv file
|
||||
run: cp packages/home-server/.env.sample packages/home-server/.env
|
||||
|
||||
- name: Fill in env variables
|
||||
run: |
|
||||
sed -i "s/JWT_SECRET=/JWT_SECRET=$(openssl rand -hex 32)/g" packages/home-server/.env
|
||||
sed -i "s/AUTH_JWT_SECRET=/AUTH_JWT_SECRET=$(openssl rand -hex 32)/g" packages/home-server/.env
|
||||
sed -i "s/ENCRYPTION_SERVER_KEY=/ENCRYPTION_SERVER_KEY=$(openssl rand -hex 32)/g" packages/home-server/.env
|
||||
sed -i "s/PSEUDO_KEY_PARAMS_KEY=/PSEUDO_KEY_PARAMS_KEY=$(openssl rand -hex 32)/g" packages/home-server/.env
|
||||
sed -i "s/VALET_TOKEN_SECRET=/VALET_TOKEN_SECRET=$(openssl rand -hex 32)/g" packages/home-server/.env
|
||||
echo "ACCESS_TOKEN_AGE=4" >> packages/home-server/.env
|
||||
echo "REFRESH_TOKEN_AGE=10" >> packages/home-server/.env
|
||||
echo "REVISIONS_FREQUENCY=2" >> packages/home-server/.env
|
||||
echo "DB_HOST=localhost" >> packages/home-server/.env
|
||||
echo "DB_PORT=3306" >> packages/home-server/.env
|
||||
echo "DB_DATABASE=standardnotes" >> packages/home-server/.env
|
||||
echo "DB_SQLITE_DATABASE_PATH=homeserver.db" >> packages/home-server/.env
|
||||
echo "DB_USERNAME=standardnotes" >> packages/home-server/.env
|
||||
echo "DB_PASSWORD=standardnotes" >> packages/home-server/.env
|
||||
echo "DB_TYPE=${{ matrix.db_type }}" >> packages/home-server/.env
|
||||
echo "DB_DEBUG_LEVEL=all" >> packages/home-server/.env
|
||||
echo "REDIS_URL=redis://localhost:6379" >> packages/home-server/.env
|
||||
echo "CACHE_TYPE=${{ matrix.cache_type }}" >> packages/home-server/.env
|
||||
echo "SECONDARY_DB_ENABLED=${{ matrix.secondary_db_enabled }}" >> packages/home-server/.env
|
||||
echo "TRANSITION_MODE_ENABLED=${{ matrix.transition_mode_enabled }}" >> packages/home-server/.env
|
||||
echo "MONGO_HOST=localhost" >> packages/home-server/.env
|
||||
echo "MONGO_PORT=27017" >> packages/home-server/.env
|
||||
echo "MONGO_DATABASE=standardnotes" >> packages/home-server/.env
|
||||
echo "MONGO_USERNAME=standardnotes" >> packages/home-server/.env
|
||||
echo "MONGO_PASSWORD=standardnotes" >> packages/home-server/.env
|
||||
echo "FILES_SERVER_URL=http://localhost:3123" >> packages/home-server/.env
|
||||
echo "E2E_TESTING=true" >> packages/home-server/.env
|
||||
|
||||
- name: Run Server
|
||||
run: nohup yarn workspace @standardnotes/home-server start > logs/output.log 2>&1 &
|
||||
env:
|
||||
PORT: 3123
|
||||
|
||||
- name: Wait for server to start
|
||||
run: for i in {1..30}; do curl -s http://localhost:3123/healthcheck && break || sleep 1; done
|
||||
|
||||
- name: Run E2E Test Suite
|
||||
run: yarn dlx mocha-headless-chrome --timeout 3600000 -f http://localhost:9001/mocha/test.html
|
||||
|
||||
- name: Show logs on failure
|
||||
if: ${{ failure() }}
|
||||
run: tail -n 500 logs/output.log
|
||||
uses: standardnotes/server/.github/workflows/e2e-home-server.yml@main
|
||||
with:
|
||||
snjs_image_tag: ${{ inputs.snjs_image_tag }}
|
||||
suite: ${{ inputs.suite }}
|
||||
secrets: inherit
|
||||
|
||||
128
.github/workflows/e2e-home-server.yml
vendored
Normal file
128
.github/workflows/e2e-home-server.yml
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
name: E2E Home Server Test Suite
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
snjs_image_tag:
|
||||
type: string
|
||||
default: latest
|
||||
description: The Docker image tag used for SNJS container
|
||||
suite:
|
||||
type: string
|
||||
default: all
|
||||
description: The test suite to run
|
||||
secrets:
|
||||
DOCKER_USERNAME:
|
||||
required: true
|
||||
DOCKER_PASSWORD:
|
||||
required: true
|
||||
AWS_ACCESS_KEY_ID:
|
||||
required: true
|
||||
AWS_SECRET_ACCESS_KEY:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
e2e-home-server:
|
||||
name: (Home Server) E2E Test Suite
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
db_type: [mysql, sqlite]
|
||||
cache_type: [redis, memory]
|
||||
secondary_db_enabled: [true, false]
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
services:
|
||||
snjs:
|
||||
image: standardnotes/snjs:${{ inputs.snjs_image_tag }}
|
||||
ports:
|
||||
- 9001:9001
|
||||
cache:
|
||||
image: redis
|
||||
ports:
|
||||
- 6379:6379
|
||||
db:
|
||||
image: mysql
|
||||
ports:
|
||||
- 3306:3306
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
MYSQL_DATABASE: standardnotes
|
||||
MYSQL_USER: standardnotes
|
||||
MYSQL_PASSWORD: standardnotes
|
||||
secondary_db:
|
||||
image: mongo:5.0
|
||||
ports:
|
||||
- 27017:27017
|
||||
env:
|
||||
MONGO_INITDB_ROOT_USERNAME: standardnotes
|
||||
MONGO_INITDB_ROOT_PASSWORD: standardnotes
|
||||
MONGO_INITDB_DATABASE: standardnotes
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
node-version-file: '.nvmrc'
|
||||
|
||||
- name: Install Dependencies
|
||||
run: yarn install --immutable
|
||||
|
||||
- name: Build
|
||||
run: yarn build
|
||||
|
||||
- name: Copy dotenv file
|
||||
run: cp packages/home-server/.env.sample packages/home-server/.env
|
||||
|
||||
- name: Fill in env variables
|
||||
run: |
|
||||
sed -i "s/JWT_SECRET=/JWT_SECRET=$(openssl rand -hex 32)/g" packages/home-server/.env
|
||||
sed -i "s/AUTH_JWT_SECRET=/AUTH_JWT_SECRET=$(openssl rand -hex 32)/g" packages/home-server/.env
|
||||
sed -i "s/ENCRYPTION_SERVER_KEY=/ENCRYPTION_SERVER_KEY=$(openssl rand -hex 32)/g" packages/home-server/.env
|
||||
sed -i "s/PSEUDO_KEY_PARAMS_KEY=/PSEUDO_KEY_PARAMS_KEY=$(openssl rand -hex 32)/g" packages/home-server/.env
|
||||
sed -i "s/VALET_TOKEN_SECRET=/VALET_TOKEN_SECRET=$(openssl rand -hex 32)/g" packages/home-server/.env
|
||||
echo "ACCESS_TOKEN_AGE=4" >> packages/home-server/.env
|
||||
echo "REFRESH_TOKEN_AGE=10" >> packages/home-server/.env
|
||||
echo "REVISIONS_FREQUENCY=2" >> packages/home-server/.env
|
||||
echo "DB_HOST=localhost" >> packages/home-server/.env
|
||||
echo "DB_PORT=3306" >> packages/home-server/.env
|
||||
echo "DB_DATABASE=standardnotes" >> packages/home-server/.env
|
||||
echo "DB_SQLITE_DATABASE_PATH=homeserver.db" >> packages/home-server/.env
|
||||
echo "DB_USERNAME=standardnotes" >> packages/home-server/.env
|
||||
echo "DB_PASSWORD=standardnotes" >> packages/home-server/.env
|
||||
echo "DB_TYPE=${{ matrix.db_type }}" >> packages/home-server/.env
|
||||
echo "DB_DEBUG_LEVEL=all" >> packages/home-server/.env
|
||||
echo "REDIS_URL=redis://localhost:6379" >> packages/home-server/.env
|
||||
echo "CACHE_TYPE=${{ matrix.cache_type }}" >> packages/home-server/.env
|
||||
echo "SECONDARY_DB_ENABLED=${{ matrix.secondary_db_enabled }}" >> packages/home-server/.env
|
||||
echo "MONGO_HOST=localhost" >> packages/home-server/.env
|
||||
echo "MONGO_PORT=27017" >> packages/home-server/.env
|
||||
echo "MONGO_DATABASE=standardnotes" >> packages/home-server/.env
|
||||
echo "MONGO_USERNAME=standardnotes" >> packages/home-server/.env
|
||||
echo "MONGO_PASSWORD=standardnotes" >> packages/home-server/.env
|
||||
echo "FILES_SERVER_URL=http://localhost:3123" >> packages/home-server/.env
|
||||
echo "E2E_TESTING=true" >> packages/home-server/.env
|
||||
|
||||
- name: Run Server
|
||||
run: nohup yarn workspace @standardnotes/home-server start > logs/output.log 2>&1 &
|
||||
env:
|
||||
PORT: 3123
|
||||
|
||||
- name: Wait for server to start
|
||||
run: for i in {1..30}; do curl -s http://localhost:3123/healthcheck && break || sleep 1; done
|
||||
|
||||
- name: Run E2E Test Suite
|
||||
run: yarn dlx mocha-headless-chrome --timeout 3600000 -f http://localhost:9001/mocha/test.html?suite=${{ inputs.suite }}
|
||||
|
||||
- name: Archive failed run logs
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: home-server-failure-logs-${{ inputs.suite }}-${{ matrix.db_type }}-${{ matrix.cache_type }}-${{ matrix.secondary_db_enabled }}
|
||||
retention-days: 5
|
||||
path: |
|
||||
logs/output.log
|
||||
72
.github/workflows/e2e-self-hosted.yml
vendored
Normal file
72
.github/workflows/e2e-self-hosted.yml
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
name: E2E Self Hosted Test Suite
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
snjs_image_tag:
|
||||
type: string
|
||||
default: latest
|
||||
description: The Docker image tag used for SNJS container
|
||||
suite:
|
||||
type: string
|
||||
default: all
|
||||
description: The test suite to run
|
||||
secrets:
|
||||
DOCKER_USERNAME:
|
||||
required: true
|
||||
DOCKER_PASSWORD:
|
||||
required: true
|
||||
AWS_ACCESS_KEY_ID:
|
||||
required: true
|
||||
AWS_SECRET_ACCESS_KEY:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
e2e:
|
||||
name: (Self Hosting) E2E Test Suite
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
secondary_db_enabled: [true, false]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
services:
|
||||
snjs:
|
||||
image: standardnotes/snjs:${{ inputs.snjs_image_tag }}
|
||||
ports:
|
||||
- 9001:9001
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
node-version-file: '.nvmrc'
|
||||
|
||||
- name: Install
|
||||
run: yarn install --immutable
|
||||
|
||||
- name: Run Server
|
||||
run: docker compose -f docker-compose.ci.yml up -d
|
||||
env:
|
||||
DB_TYPE: mysql
|
||||
CACHE_TYPE: redis
|
||||
SECONDARY_DB_ENABLED: ${{ matrix.secondary_db_enabled }}
|
||||
|
||||
- name: Wait for server to start
|
||||
run: docker/is-available.sh http://localhost:3123 $(pwd)/logs
|
||||
|
||||
- name: Run E2E Test Suite
|
||||
run: yarn dlx mocha-headless-chrome --timeout 3600000 -f http://localhost:9001/mocha/test.html?suite=${{ inputs.suite }}
|
||||
|
||||
- name: Archive failed run logs
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: self-hosted-failure-logs-${{ inputs.suite }}-${{ matrix.secondary_db_enabled }}
|
||||
retention-days: 5
|
||||
path: |
|
||||
logs/*.err
|
||||
logs/*.log
|
||||
9
.github/workflows/e2e-test-suite.yml
vendored
9
.github/workflows/e2e-test-suite.yml
vendored
@@ -1,6 +1,6 @@
|
||||
name: E2E Test Suite On Self Hosted Server
|
||||
name: E2E Test Suite
|
||||
|
||||
run-name: E2E Test Suite against ${{ inputs.ref_name }} by ${{ inputs.author }}
|
||||
run-name: E2E ${{ inputs.suite }} Test Suite against ${{ inputs.ref_name }} by ${{ inputs.author }}
|
||||
|
||||
on:
|
||||
schedule:
|
||||
@@ -11,6 +11,10 @@ on:
|
||||
type: string
|
||||
default: latest
|
||||
description: The Docker image tag used for SNJS container
|
||||
suite:
|
||||
type: string
|
||||
default: all
|
||||
description: The test suite to run
|
||||
author:
|
||||
type: string
|
||||
default: unknown
|
||||
@@ -26,4 +30,5 @@ jobs:
|
||||
uses: standardnotes/server/.github/workflows/common-e2e.yml@main
|
||||
with:
|
||||
snjs_image_tag: ${{ inputs.snjs_image_tag || 'latest' }}
|
||||
suite: ${{ inputs.suite || 'all' }}
|
||||
secrets: inherit
|
||||
|
||||
24
.github/workflows/files.yml
vendored
24
.github/workflows/files.yml
vendored
@@ -19,27 +19,3 @@ jobs:
|
||||
workspace_name: "@standardnotes/files-server"
|
||||
package_path: packages/files
|
||||
secrets: inherit
|
||||
|
||||
newrelic:
|
||||
needs: call_server_application_workflow
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Create New Relic deployment marker for Web
|
||||
uses: newrelic/deployment-marker-action@v1
|
||||
with:
|
||||
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
||||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
||||
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_FILES_WEB_PROD }}
|
||||
revision: "${{ github.sha }}"
|
||||
description: "Automated Deployment via Github Actions"
|
||||
user: "${{ github.actor }}"
|
||||
- name: Create New Relic deployment marker for Worker
|
||||
uses: newrelic/deployment-marker-action@v1
|
||||
with:
|
||||
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
||||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
||||
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_FILES_WORKER_PROD }}
|
||||
revision: "${{ github.sha }}"
|
||||
description: "Automated Deployment via Github Actions"
|
||||
user: "${{ github.actor }}"
|
||||
|
||||
17
.github/workflows/pr.yml
vendored
17
.github/workflows/pr.yml
vendored
@@ -95,9 +95,20 @@ jobs:
|
||||
- name: Test
|
||||
run: yarn test
|
||||
|
||||
e2e:
|
||||
e2e-base:
|
||||
needs: build
|
||||
|
||||
name: E2E
|
||||
name: E2E Base Suite
|
||||
uses: standardnotes/server/.github/workflows/common-e2e.yml@main
|
||||
with:
|
||||
snjs_image_tag: 'latest'
|
||||
suite: 'base'
|
||||
secrets: inherit
|
||||
|
||||
# e2e-vaults:
|
||||
# needs: build
|
||||
# name: E2E Vaults Suite
|
||||
# uses: standardnotes/server/.github/workflows/common-e2e.yml@main
|
||||
# with:
|
||||
# snjs_image_tag: 'latest'
|
||||
# suite: 'vaults'
|
||||
# secrets: inherit
|
||||
|
||||
20
.github/workflows/publish.yml
vendored
20
.github/workflows/publish.yml
vendored
@@ -95,20 +95,32 @@ jobs:
|
||||
- name: Test
|
||||
run: yarn test
|
||||
|
||||
e2e:
|
||||
e2e-base:
|
||||
needs: build
|
||||
name: E2E
|
||||
name: E2E Base Suite
|
||||
uses: standardnotes/server/.github/workflows/common-e2e.yml@main
|
||||
with:
|
||||
snjs_image_tag: 'latest'
|
||||
suite: 'base'
|
||||
secrets: inherit
|
||||
|
||||
# e2e-vaults:
|
||||
# needs: build
|
||||
# name: E2E Vaults Suite
|
||||
# uses: standardnotes/server/.github/workflows/common-e2e.yml@main
|
||||
# with:
|
||||
# snjs_image_tag: 'latest'
|
||||
# suite: 'vaults'
|
||||
# secrets: inherit
|
||||
|
||||
publish-self-hosting:
|
||||
needs: [ test, lint, e2e ]
|
||||
needs: [ test, lint, e2e-base ]
|
||||
name: Publish Self Hosting Docker Image
|
||||
uses: standardnotes/server/.github/workflows/common-self-hosting.yml@main
|
||||
secrets: inherit
|
||||
|
||||
publish-services:
|
||||
needs: [ test, lint, e2e ]
|
||||
needs: [ test, lint, e2e-base ]
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
|
||||
24
.github/workflows/revisions.yml
vendored
24
.github/workflows/revisions.yml
vendored
@@ -19,27 +19,3 @@ jobs:
|
||||
workspace_name: "@standardnotes/revisions-server"
|
||||
package_path: packages/revisions
|
||||
secrets: inherit
|
||||
|
||||
newrelic:
|
||||
needs: call_server_application_workflow
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Create New Relic deployment marker for Web
|
||||
uses: newrelic/deployment-marker-action@v1
|
||||
with:
|
||||
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
||||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
||||
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_REVISIONS_WEB_PROD }}
|
||||
revision: "${{ github.sha }}"
|
||||
description: "Automated Deployment via Github Actions"
|
||||
user: "${{ github.actor }}"
|
||||
- name: Create New Relic deployment marker for Worker
|
||||
uses: newrelic/deployment-marker-action@v1
|
||||
with:
|
||||
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
||||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
||||
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_REVISIONS_WORKER_PROD }}
|
||||
revision: "${{ github.sha }}"
|
||||
description: "Automated Deployment via Github Actions"
|
||||
user: "${{ github.actor }}"
|
||||
|
||||
16
.github/workflows/scheduler.yml
vendored
16
.github/workflows/scheduler.yml
vendored
@@ -20,19 +20,3 @@ jobs:
|
||||
deploy_web: false
|
||||
package_path: packages/scheduler
|
||||
secrets: inherit
|
||||
|
||||
newrelic:
|
||||
needs: call_server_application_workflow
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Create New Relic deployment marker for Worker
|
||||
uses: newrelic/deployment-marker-action@v1
|
||||
with:
|
||||
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
||||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
||||
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_SCHEDULER_WORKER_PROD }}
|
||||
revision: "${{ github.sha }}"
|
||||
description: "Automated Deployment via Github Actions"
|
||||
user: "${{ github.actor }}"
|
||||
|
||||
24
.github/workflows/syncing-server.yml
vendored
24
.github/workflows/syncing-server.yml
vendored
@@ -19,27 +19,3 @@ jobs:
|
||||
workspace_name: "@standardnotes/syncing-server"
|
||||
package_path: packages/syncing-server
|
||||
secrets: inherit
|
||||
|
||||
newrelic:
|
||||
needs: call_server_application_workflow
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Create New Relic deployment marker for Web
|
||||
uses: newrelic/deployment-marker-action@v1
|
||||
with:
|
||||
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
||||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
||||
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_SYNCING_SERVER_WEB_PROD }}
|
||||
revision: "${{ github.sha }}"
|
||||
description: "Automated Deployment via Github Actions"
|
||||
user: "${{ github.actor }}"
|
||||
- name: Create New Relic deployment marker for Worker
|
||||
uses: newrelic/deployment-marker-action@v1
|
||||
with:
|
||||
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
||||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
||||
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_SYNCING_SERVER_WORKER_PROD }}
|
||||
revision: "${{ github.sha }}"
|
||||
description: "Automated Deployment via Github Actions"
|
||||
user: "${{ github.actor }}"
|
||||
|
||||
24
.github/workflows/websockets.yml
vendored
24
.github/workflows/websockets.yml
vendored
@@ -19,27 +19,3 @@ jobs:
|
||||
workspace_name: "@standardnotes/websockets-server"
|
||||
package_path: packages/websockets
|
||||
secrets: inherit
|
||||
|
||||
newrelic:
|
||||
needs: call_server_application_workflow
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Create New Relic deployment marker for Web
|
||||
uses: newrelic/deployment-marker-action@v1
|
||||
with:
|
||||
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
||||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
||||
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_WEBSOCKETS_WEB_PROD }}
|
||||
revision: "${{ github.sha }}"
|
||||
description: "Automated Deployment via Github Actions"
|
||||
user: "${{ github.actor }}"
|
||||
- name: Create New Relic deployment marker for Worker
|
||||
uses: newrelic/deployment-marker-action@v1
|
||||
with:
|
||||
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
|
||||
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
|
||||
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_WEBSOCKETS_WORKER_PROD }}
|
||||
revision: "${{ github.sha }}"
|
||||
description: "Automated Deployment via Github Actions"
|
||||
user: "${{ github.actor }}"
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,7 +4,6 @@
|
||||
dist
|
||||
coverage
|
||||
.env
|
||||
newrelic_agent.log
|
||||
|
||||
.yarn/*
|
||||
!.yarn/cache
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-client-s3-npm-3.427.0-ca1dbfe90a-5941e74c44.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-client-s3-npm-3.427.0-ca1dbfe90a-5941e74c44.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-client-sns-npm-3.427.0-49f758c757-00c09a202c.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-client-sns-npm-3.427.0-49f758c757-00c09a202c.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-client-sqs-npm-3.425.0-7f67eb9363-4ab9bf6d00.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-client-sqs-npm-3.425.0-7f67eb9363-4ab9bf6d00.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-client-sqs-npm-3.427.0-cf594e3eb2-545066230f.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-client-sqs-npm-3.427.0-cf594e3eb2-545066230f.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-middleware-expect-continue-npm-3.425.0-aea23ee649-a18fd9269a.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-middleware-expect-continue-npm-3.425.0-aea23ee649-a18fd9269a.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-middleware-flexible-checksums-npm-3.425.0-6b5526b097-9acc0c08b4.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-middleware-flexible-checksums-npm-3.425.0-6b5526b097-9acc0c08b4.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-middleware-sdk-s3-npm-3.427.0-461990f523-867ec5f299.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-middleware-sdk-s3-npm-3.427.0-461990f523-867ec5f299.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-middleware-sdk-sqs-npm-3.425.0-707e6119a9-355e6f1633.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-middleware-sdk-sqs-npm-3.425.0-707e6119a9-355e6f1633.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-middleware-user-agent-npm-3.427.0-67e1134d88-b3bc411032.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-middleware-user-agent-npm-3.427.0-67e1134d88-b3bc411032.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-region-config-resolver-npm-3.425.0-123a617ec3-fee95955ec.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-region-config-resolver-npm-3.425.0-123a617ec3-fee95955ec.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user