Compare commits

..

7 Commits

Author SHA1 Message Date
Karol Sójko 55f8f65c3f wip 2022-12-13 13:27:19 +01:00
Karol Sójko 3953dbc6b4 feat(settings): add unsubscribe token for muting emails 2022-12-13 13:18:15 +01:00
Karol Sójko 0b205287d1 fix(settings): binding for controller 2022-12-13 13:18:15 +01:00
Karol Sójko 4f0bc57b1a feat(settings): add controller for muting all emails 2022-12-13 13:18:15 +01:00
Karol Sójko 7d43316597 feat(settings): add mutting all emails use case 2022-12-13 13:18:15 +01:00
Karol Sójko 65d31f011b chore: remove settings dependency from all packages 2022-12-13 13:18:13 +01:00
Karol Sójko 80dd6efae3 feat(settings): replace setting with a domain entity 2022-12-13 13:13:28 +01:00
2969 changed files with 139216 additions and 53409 deletions
-13
View File
@@ -1,13 +0,0 @@
dist
coverage
.yarn/*
!.yarn/cache
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/unplugged
!.yarn/sdks
!.yarn/versions
data/*
-20
View File
@@ -1,26 +1,6 @@
######
# DB #
######
DB_HOST=db
DB_PORT=3306 DB_PORT=3306
DB_USERNAME=std_notes_user DB_USERNAME=std_notes_user
DB_PASSWORD=changeme123 DB_PASSWORD=changeme123
DB_DATABASE=standard_notes_db DB_DATABASE=standard_notes_db
DB_TYPE=mysql
#########
# CACHE #
#########
REDIS_PORT=6379 REDIS_PORT=6379
REDIS_HOST=cache
CACHE_TYPE=redis
########
# KEYS #
########
AUTH_JWT_SECRET=
AUTH_SERVER_ENCRYPTION_SERVER_KEY=
VALET_TOKEN_SECRET=
+1
View File
@@ -1,5 +1,6 @@
{ {
"root": true, "root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": { "parserOptions": {
"project": "./tsconfig.json" "project": "./tsconfig.json"
}, },
-27
View File
@@ -1,27 +0,0 @@
PUBLIC_FILES_SERVER_URL=http://localhost:3125
DB_HOST=db
DB_USERNAME=std_notes_user
DB_PASSWORD=changeme123
DB_DATABASE=standard_notes_db
DB_PORT=3306
DB_SQLITE_DATABASE_PATH=standard_notes_db
REDIS_PORT=6379
REDIS_HOST=cache
AUTH_SERVER_ACCESS_TOKEN_AGE=4
AUTH_SERVER_REFRESH_TOKEN_AGE=10
AUTH_SERVER_EPHEMERAL_SESSION_AGE=300
SYNCING_SERVER_REVISIONS_FREQUENCY=5
AUTH_SERVER_LOG_LEVEL=debug
SYNCING_SERVER_LOG_LEVEL=debug
FILES_SERVER_LOG_LEVEL=debug
REVISIONS_SERVER_LOG_LEVEL=debug
API_GATEWAY_LOG_LEVEL=debug
MYSQL_DATABASE=standard_notes_db
MYSQL_USER=std_notes_user
MYSQL_PASSWORD=changeme123
MYSQL_ROOT_PASSWORD=changeme123
AUTH_JWT_SECRET=f95259c5e441f5a4646d76422cfb3df4c4488842901aa50b6c51b8be2e0040e9
AUTH_SERVER_ENCRYPTION_SERVER_KEY=1087415dfde3093797f9a7ca93a49e7d7aa1861735eb0d32aae9c303b8c3d060
VALET_TOKEN_SECRET=4b886819ebe1e908077c6cae96311b48a8416bd60cc91c03060e15bdf6b30d1f
+1 -6
View File
@@ -55,11 +55,6 @@ updates:
schedule: schedule:
interval: "daily" interval: "daily"
- package-ecosystem: "npm"
directory: "/packages/revisions"
schedule:
interval: "daily"
- package-ecosystem: "npm" - package-ecosystem: "npm"
directory: "/packages/scheduler" directory: "/packages/scheduler"
schedule: schedule:
@@ -91,7 +86,7 @@ updates:
interval: "daily" interval: "daily"
- package-ecosystem: "npm" - package-ecosystem: "npm"
directory: "/packages/websockets" directory: "/packages/workspace"
schedule: schedule:
interval: "daily" interval: "daily"
+1
View File
@@ -17,6 +17,7 @@ jobs:
with: with:
service_name: analytics service_name: analytics
workspace_name: "@standardnotes/analytics" workspace_name: "@standardnotes/analytics"
e2e_tag_parameter_name: analytics_image_tag
deploy_web: false deploy_web: false
package_path: packages/analytics package_path: packages/analytics
secrets: inherit secrets: inherit
+1
View File
@@ -17,6 +17,7 @@ jobs:
with: with:
service_name: api-gateway service_name: api-gateway
workspace_name: "@standardnotes/api-gateway" workspace_name: "@standardnotes/api-gateway"
e2e_tag_parameter_name: api_gateway_image_tag
deploy_worker: false deploy_worker: false
package_path: packages/api-gateway package_path: packages/api-gateway
secrets: inherit secrets: inherit
+1
View File
@@ -17,6 +17,7 @@ jobs:
with: with:
service_name: auth service_name: auth
workspace_name: "@standardnotes/auth-server" workspace_name: "@standardnotes/auth-server"
e2e_tag_parameter_name: auth_image_tag
package_path: packages/auth package_path: packages/auth
secrets: inherit secrets: inherit
+1 -1
View File
@@ -50,6 +50,6 @@ jobs:
uses: aws-actions/amazon-ecs-deploy-task-definition@v1 uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with: with:
task-definition: ${{ steps.task-def-prod.outputs.task-definition }} task-definition: ${{ steps.task-def-prod.outputs.task-definition }}
service: ${{ inputs.service_name }} service: ${{ inputs.service_name }}-prod
cluster: prod cluster: prod
wait-for-service-stability: true wait-for-service-stability: true
+7 -15
View File
@@ -6,6 +6,9 @@ on:
service_name: service_name:
required: true required: true
type: string type: string
bundle_dir:
required: true
type: string
package_path: package_path:
required: true required: true
type: string type: string
@@ -29,21 +32,13 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Create Bundle Dir
id: bundle-dir
run: echo "temp_dir=$(mktemp -d -t ${{ inputs.service_name }}-${{ github.sha }}-XXXXXXX)" >> $GITHUB_OUTPUT
- name: Cache build - name: Cache build
id: cache-build id: cache-build
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: | path: |
packages/**/dist packages/**/dist
${{ steps.bundle-dir.outputs.temp_dir }} ${{ inputs.bundle_dir }}
key: ${{ runner.os }}-${{ inputs.service_name }}-build-${{ github.sha }} key: ${{ runner.os }}-${{ inputs.service_name }}-build-${{ github.sha }}
- name: Set up Node - name: Set up Node
@@ -52,16 +47,13 @@ jobs:
registry-url: 'https://registry.npmjs.org' registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
- name: Install dependencies
run: yarn install --immutable
- name: Build - name: Build
if: steps.cache-build.outputs.cache-hit != 'true' if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build ${{ inputs.package_path }} run: yarn build ${{ inputs.package_path }}
- name: Bundle - name: Bundle
if: steps.cache-build.outputs.cache-hit != 'true' if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn workspace ${{ inputs.workspace_name }} bundle --no-compress --output-directory ${{ steps.bundle-dir.outputs.temp_dir }} run: yarn workspace ${{ inputs.workspace_name }} bundle --no-compress --output-directory ${{ inputs.bundle_dir }}
- name: Login to Docker Hub - name: Login to Docker Hub
uses: docker/login-action@v2 uses: docker/login-action@v2
@@ -93,8 +85,8 @@ jobs:
uses: docker/build-push-action@v3 uses: docker/build-push-action@v3
with: with:
builder: ${{ steps.buildx.outputs.name }} builder: ${{ steps.buildx.outputs.name }}
context: ${{ steps.bundle-dir.outputs.temp_dir }} context: ${{ inputs.bundle_dir }}
file: ${{ steps.bundle-dir.outputs.temp_dir }}/${{ inputs.package_path }}/Dockerfile file: ${{ inputs.bundle_dir }}/${{ inputs.package_path }}/Dockerfile
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
push: true push: true
tags: | tags: |
-128
View File
@@ -1,128 +0,0 @@
name: Reusable Run E2E Test Suite Workflow
on:
workflow_call:
inputs:
snjs_image_tag:
type: string
default: latest
description: The Docker image tag used for SNJS container
secrets:
DOCKER_USERNAME:
required: true
DOCKER_PASSWORD:
required: true
AWS_ACCESS_KEY_ID:
required: true
AWS_SECRET_ACCESS_KEY:
required: true
jobs:
e2e:
name: (Docker) E2E Test Suite
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
- 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 1200000 -f http://localhost:9001/mocha/test.html
e2e-home-server:
name: (Home Server) E2E Test Suite
strategy:
matrix:
db_type: [mysql, sqlite]
cache_type: [redis, memory]
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
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=7" >> packages/home-server/.env
echo "REVISIONS_FREQUENCY=5" >> packages/home-server/.env
echo "DB_HOST=db" >> packages/home-server/.env
echo "DB_PORT=3306" >> 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 "REDIS_URL=redis://cache" >> packages/home-server/.env
echo "CACHE_TYPE=${{ matrix.cache_type }}" >> packages/home-server/.env
- name: Run Server
run: nohup yarn workspace @standardnotes/home-server start &
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 1200000 -f http://localhost:9001/mocha/test.html?skip_paid_features=true
-47
View File
@@ -1,47 +0,0 @@
name: Reusable Publish Docker Self Hosting Image Workflow
on:
workflow_call:
secrets:
DOCKER_USERNAME:
required: true
DOCKER_PASSWORD:
required: true
AWS_ACCESS_KEY_ID:
required: true
AWS_SECRET_ACCESS_KEY:
required: true
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Publish Docker image
uses: docker/build-push-action@v3
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
standardnotes/server:latest
standardnotes/server:${{ github.sha }}
@@ -17,6 +17,9 @@ on:
required: false required: false
default: true default: true
type: boolean type: boolean
e2e_tag_parameter_name:
required: false
type: string
package_path: package_path:
required: true required: true
type: string type: string
@@ -33,11 +36,177 @@ on:
required: true required: true
jobs: jobs:
build:
runs-on: ubuntu-latest
outputs:
temp_dir: ${{ steps.bundle-dir.outputs.temp_dir }}
steps:
- uses: actions/checkout@v3
- name: Create Bundle Dir
id: bundle-dir
run: echo "temp_dir=$(mktemp -d -t ${{ inputs.service_name }}-${{ github.sha }}-XXXXXXX)" >> $GITHUB_OUTPUT
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: |
packages/**/dist
${{ steps.bundle-dir.outputs.temp_dir }}
key: ${{ runner.os }}-${{ inputs.service_name }}-build-${{ github.sha }}
- name: Set up Node
uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
- name: Build
run: yarn build ${{ inputs.package_path }}
- name: Bundle
run: yarn workspace ${{ inputs.workspace_name }} bundle --no-compress --output-directory ${{ steps.bundle-dir.outputs.temp_dir }}
lint:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: |
packages/**/dist
${{ needs.build.outputs.temp_dir }}
key: ${{ runner.os }}-${{ inputs.service_name }}-build-${{ github.sha }}
- name: Set up Node
uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
- name: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build ${{ inputs.package_path }}
- name: Lint
run: yarn lint:${{ inputs.service_name }}
test:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: |
packages/**/dist
${{ needs.build.outputs.temp_dir }}
key: ${{ runner.os }}-${{ inputs.service_name }}-build-${{ github.sha }}
- name: Set up Node
uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
- name: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build ${{ inputs.package_path }}
- name: Test
run: yarn test ${{ inputs.package_path }}
e2e:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: |
packages/**/dist
${{ needs.build.outputs.temp_dir }}
key: ${{ runner.os }}-${{ inputs.service_name }}-build-${{ github.sha }}
- name: Set up Node
uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
- name: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build ${{ inputs.package_path }}
- name: Bundle
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn workspace ${{ inputs.workspace_name }} bundle --no-compress --output-directory ${{ needs.build.outputs.temp_dir }}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Publish Docker image for E2E testing
uses: docker/build-push-action@v3
with:
builder: ${{ steps.buildx.outputs.name }}
context: ${{ needs.build.outputs.temp_dir }}
file: ${{ needs.build.outputs.temp_dir }}/${{ inputs.package_path }}/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: standardnotes/${{ inputs.service_name }}:${{ github.sha }}
- name: Run E2E test suite
uses: convictional/trigger-workflow-and-wait@master
with:
owner: standardnotes
repo: e2e
github_token: ${{ secrets.CI_PAT_TOKEN }}
workflow_file_name: testing-with-stable-client.yml
wait_interval: 30
client_payload: '{"${{ inputs.e2e_tag_parameter_name }}": "${{ github.sha }}"}'
propagate_failure: true
trigger_workflow: true
wait_workflow: true
publish: publish:
needs: [ build, test, lint, e2e ]
name: Publish Docker Image name: Publish Docker Image
uses: standardnotes/server/.github/workflows/common-docker-image.yml@main uses: standardnotes/server/.github/workflows/common-docker-image.yml@main
with: with:
service_name: ${{ inputs.service_name }} service_name: ${{ inputs.service_name }}
bundle_dir: ${{ needs.build.outputs.temp_dir }}
package_path: ${{ inputs.package_path }} package_path: ${{ inputs.package_path }}
workspace_name: ${{ inputs.workspace_name }} workspace_name: ${{ inputs.workspace_name }}
secrets: inherit secrets: inherit
-19
View File
@@ -1,19 +0,0 @@
name: E2E Test Suite On Self Hosted Server
on:
schedule:
- cron: '0 */12 * * *'
workflow_dispatch:
inputs:
snjs_image_tag:
type: string
default: latest
description: The Docker image tag used for SNJS container
jobs:
e2e:
name: E2E
uses: standardnotes/server/.github/workflows/common-e2e.yml@main
with:
snjs_image_tag: ${{ inputs.snjs_image_tag || 'latest' }}
secrets: inherit
+39
View File
@@ -0,0 +1,39 @@
name: Event Store
concurrency:
group: event-store
cancel-in-progress: true
on:
push:
tags:
- '*standardnotes/event-store*'
workflow_dispatch:
jobs:
call_server_application_workflow:
name: Server Application
uses: standardnotes/server/.github/workflows/common-server-application.yml@main
with:
service_name: event-store
workspace_name: "@standardnotes/event-store"
e2e_tag_parameter_name: event_store_image_tag
deploy_web: false
package_path: packages/event-store
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_EVENT_STORE_PROD }}
revision: "${{ github.sha }}"
description: "Automated Deployment via Github Actions"
user: "${{ github.actor }}"
+1
View File
@@ -17,6 +17,7 @@ jobs:
with: with:
service_name: files service_name: files
workspace_name: "@standardnotes/files-server" workspace_name: "@standardnotes/files-server"
e2e_tag_parameter_name: files_image_tag
package_path: packages/files package_path: packages/files
secrets: inherit secrets: inherit
+13 -92
View File
@@ -6,98 +6,19 @@ on:
- main - main
jobs: jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: |
packages/**/dist
key: ${{ runner.os }}-build-${{ github.sha }}
- 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: Build
run: yarn build
lint:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: |
packages/**/dist
key: ${{ runner.os }}-build-${{ github.sha }}
- 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: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build
- name: Lint
run: yarn lint
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build
steps: steps:
- uses: actions/checkout@v3 - name: Checkout code
uses: actions/checkout@v3
- name: Cache build - name: Set up Node
id: cache-build uses: actions/setup-node@v3
uses: actions/cache@v3 with:
with: registry-url: 'https://registry.npmjs.org'
path: | node-version-file: '.nvmrc'
packages/**/dist - name: ESLint
key: ${{ runner.os }}-build-${{ github.sha }} run: yarn lint
- name: Build
- name: Set up Node run: yarn build
uses: actions/setup-node@v3 - name: Test
with: run: yarn test
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
- name: Install
run: yarn install --immutable
- name: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build
- name: Test
run: yarn test
e2e:
needs: build
name: E2E
uses: standardnotes/server/.github/workflows/common-e2e.yml@main
secrets: inherit
+3 -118
View File
@@ -5,113 +5,9 @@ on:
branches: [ main ] branches: [ main ]
jobs: jobs:
build: release_and_publish:
if: contains(github.event.head_commit.message, 'chore(release)') == false if: contains(github.event.head_commit.message, 'chore(release)') == false
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: |
packages/**/dist
key: ${{ runner.os }}-build-${{ github.sha }}
- 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: Build
run: yarn build
lint:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: |
packages/**/dist
key: ${{ runner.os }}-build-${{ github.sha }}
- 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: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build
- name: Lint
run: yarn lint
test:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: |
packages/**/dist
key: ${{ runner.os }}-build-${{ github.sha }}
- 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: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build
- name: Test
run: yarn test
e2e:
needs: build
name: E2E
uses: standardnotes/server/.github/workflows/common-e2e.yml@main
secrets: inherit
publish-self-hosting:
needs: [ test, lint, e2e ]
name: Publish Self Hosting Docker Image
uses: standardnotes/server/.github/workflows/common-self-hosting.yml@main
secrets: inherit
publish-services:
needs: [ test, lint, e2e ]
runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
@@ -119,14 +15,6 @@ jobs:
token: ${{ secrets.CI_PAT_TOKEN }} token: ${{ secrets.CI_PAT_TOKEN }}
fetch-depth: 0 fetch-depth: 0
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: |
packages/**/dist
key: ${{ runner.os }}-build-${{ github.sha }}
- name: Setup git config - name: Setup git config
run: | run: |
git config --global user.name "standardci" git config --global user.name "standardci"
@@ -146,11 +34,7 @@ jobs:
registry-url: 'https://registry.npmjs.org' registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
- name: Install - name: Build packages
run: yarn install --immutable
- name: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build run: yarn build
- name: Bump version - name: Bump version
@@ -160,3 +44,4 @@ jobs:
run: yarn publish run: yarn publish
env: env:
NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_TOKEN }}
+1
View File
@@ -17,6 +17,7 @@ jobs:
with: with:
service_name: revisions service_name: revisions
workspace_name: "@standardnotes/revisions-server" workspace_name: "@standardnotes/revisions-server"
e2e_tag_parameter_name: revisions_image_tag
package_path: packages/revisions package_path: packages/revisions
secrets: inherit secrets: inherit
+1
View File
@@ -17,6 +17,7 @@ jobs:
with: with:
service_name: scheduler service_name: scheduler
workspace_name: "@standardnotes/scheduler-server" workspace_name: "@standardnotes/scheduler-server"
e2e_tag_parameter_name: scheduler_image_tag
deploy_web: false deploy_web: false
package_path: packages/scheduler package_path: packages/scheduler
secrets: inherit secrets: inherit
+1
View File
@@ -17,6 +17,7 @@ jobs:
with: with:
service_name: syncing-server-js service_name: syncing-server-js
workspace_name: "@standardnotes/syncing-server" workspace_name: "@standardnotes/syncing-server"
e2e_tag_parameter_name: syncing_server_js_image_tag
package_path: packages/syncing-server package_path: packages/syncing-server
secrets: inherit secrets: inherit
+1
View File
@@ -17,6 +17,7 @@ jobs:
with: with:
service_name: websockets service_name: websockets
workspace_name: "@standardnotes/websockets-server" workspace_name: "@standardnotes/websockets-server"
e2e_tag_parameter_name: websockets_image_tag
package_path: packages/websockets package_path: packages/websockets
secrets: inherit secrets: inherit
+48
View File
@@ -0,0 +1,48 @@
name: Workspace Server
concurrency:
group: workspace
cancel-in-progress: true
on:
push:
tags:
- '*standardnotes/workspace-server*'
workflow_dispatch:
jobs:
call_server_application_workflow:
name: Server Application
uses: standardnotes/server/.github/workflows/common-server-application.yml@main
with:
service_name: workspace
workspace_name: "@standardnotes/workspace-server"
e2e_tag_parameter_name: workspace_image_tag
package_path: packages/workspace
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_WORKSPACE_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_WORKSPACE_WORKER_PROD }}
revision: "${{ github.sha }}"
description: "Automated Deployment via Github Actions"
user: "${{ github.actor }}"
+1 -7
View File
@@ -11,6 +11,7 @@ newrelic_agent.log
!.yarn/patches !.yarn/patches
!.yarn/plugins !.yarn/plugins
!.yarn/releases !.yarn/releases
!.yarn/unplugged
!.yarn/sdks !.yarn/sdks
!.yarn/versions !.yarn/versions
@@ -19,10 +20,3 @@ packages/files/uploads/*
data/* data/*
!data/.gitkeep !data/.gitkeep
packages/**/data/*
logs/*
!logs/.gitkeep
docker-compose.yml
+1 -1
View File
@@ -1 +1 @@
20.2.0 18.12.1
Generated
+8132 -7189
View File
File diff suppressed because one or more lines are too long
+47 -55
View File
@@ -10,8 +10,7 @@ const SAFE_TIME = 456789e3;
const PortablePath = { const PortablePath = {
root: `/`, root: `/`,
dot: `.`, dot: `.`
parent: `..`
}; };
const npath = Object.create(path); const npath = Object.create(path);
const ppath = Object.create(path.posix); const ppath = Object.create(path.posix);
@@ -1358,13 +1357,6 @@ class VirtualFS extends ProxiedFS {
} }
} }
const [major, minor] = process.versions.node.split(`.`).map((value) => parseInt(value, 10));
const HAS_CONSOLIDATED_HOOKS = major > 16 || major === 16 && minor >= 12;
const HAS_UNFLAGGED_JSON_MODULES = major > 17 || major === 17 && minor >= 5 || major === 16 && minor >= 15;
const HAS_JSON_IMPORT_ASSERTION_REQUIREMENT = major > 17 || major === 17 && minor >= 1 || major === 16 && minor > 14;
const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || major === 19 && minor >= 2 || major === 18 && minor >= 13;
const HAS_LAZY_LOADED_TRANSLATORS = major > 19 || major === 19 && minor >= 3;
const builtinModules = new Set(Module.builtinModules || Object.keys(process.binding(`natives`))); const builtinModules = new Set(Module.builtinModules || Object.keys(process.binding(`natives`)));
const isBuiltinModule = (request) => request.startsWith(`node:`) || builtinModules.has(request); const isBuiltinModule = (request) => request.startsWith(`node:`) || builtinModules.has(request);
function readPackageScope(checkPath) { function readPackageScope(checkPath) {
@@ -1392,6 +1384,11 @@ function readPackage(requestPath) {
return JSON.parse(fs.readFileSync(jsonPath, `utf8`)); return JSON.parse(fs.readFileSync(jsonPath, `utf8`));
} }
const [major, minor] = process.versions.node.split(`.`).map((value) => parseInt(value, 10));
const HAS_CONSOLIDATED_HOOKS = major > 16 || major === 16 && minor >= 12;
const HAS_UNFLAGGED_JSON_MODULES = major > 17 || major === 17 && minor >= 5 || major === 16 && minor >= 15;
const HAS_JSON_IMPORT_ASSERTION_REQUIREMENT = major > 17 || major === 17 && minor >= 1 || major === 16 && minor > 14;
async function tryReadFile$1(path2) { async function tryReadFile$1(path2) {
try { try {
return await fs.promises.readFile(path2, `utf8`); return await fs.promises.readFile(path2, `utf8`);
@@ -1489,13 +1486,12 @@ async function load$1(urlString, context, nextLoad) {
throw err; throw err;
} }
if (process.env.WATCH_REPORT_DEPENDENCIES && process.send) { if (process.env.WATCH_REPORT_DEPENDENCIES && process.send) {
const pathToSend = pathToFileURL(
npath.fromPortablePath(
VirtualFS.resolveVirtual(npath.toPortablePath(filePath))
)
).href;
process.send({ process.send({
"watch:import": WATCH_MODE_MESSAGE_USES_ARRAYS ? [pathToSend] : pathToSend "watch:import": pathToFileURL(
npath.fromPortablePath(
VirtualFS.resolveVirtual(npath.toPortablePath(filePath))
)
).href
}); });
} }
return { return {
@@ -1884,7 +1880,12 @@ function patternKeyCompare(a, b) {
return 1; return 1;
return 0; return 0;
} }
function packageImportsResolve({ name, base, conditions, readFileSyncFn }) { function packageImportsResolve({
name,
base,
conditions,
readFileSyncFn
}) {
if (name === "#" || StringPrototypeStartsWith(name, "#/") || StringPrototypeEndsWith(name, "/")) { if (name === "#" || StringPrototypeStartsWith(name, "#/") || StringPrototypeEndsWith(name, "/")) {
const reason = "is not a valid internal imports specifier name"; const reason = "is not a valid internal imports specifier name";
throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, fileURLToPath(base)); throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, fileURLToPath(base));
@@ -2001,7 +2002,7 @@ async function resolve$1(originalSpecifier, context, nextResolve) {
let allowLegacyResolve = false; let allowLegacyResolve = false;
if (dependencyNameMatch) { if (dependencyNameMatch) {
const [, dependencyName, subPath] = dependencyNameMatch; const [, dependencyName, subPath] = dependencyNameMatch;
if (subPath === `` && dependencyName !== `pnpapi`) { if (subPath === ``) {
const resolved = pnpapi.resolveToUnqualified(`${dependencyName}/package.json`, issuer); const resolved = pnpapi.resolveToUnqualified(`${dependencyName}/package.json`, issuer);
if (resolved) { if (resolved) {
const content = await tryReadFile$1(resolved); const content = await tryReadFile$1(resolved);
@@ -2012,17 +2013,10 @@ async function resolve$1(originalSpecifier, context, nextResolve) {
} }
} }
} }
let result; const result = pnpapi.resolveRequest(specifier, issuer, {
try { conditions: new Set(conditions),
result = pnpapi.resolveRequest(specifier, issuer, { extensions: allowLegacyResolve ? void 0 : []
conditions: new Set(conditions), });
extensions: allowLegacyResolve ? void 0 : []
});
} catch (err) {
if (err instanceof Error && `code` in err && err.code === `MODULE_NOT_FOUND`)
err.code = `ERR_MODULE_NOT_FOUND`;
throw err;
}
if (!result) if (!result)
throw new Error(`Resolving '${specifier}' from '${issuer}' failed`); throw new Error(`Resolving '${specifier}' from '${issuer}' failed`);
const resultURL = pathToFileURL(result); const resultURL = pathToFileURL(result);
@@ -2038,34 +2032,32 @@ async function resolve$1(originalSpecifier, context, nextResolve) {
}; };
} }
if (!HAS_LAZY_LOADED_TRANSLATORS) { const binding = process.binding(`fs`);
const binding = process.binding(`fs`); const originalfstat = binding.fstat;
const originalfstat = binding.fstat; const ZIP_MASK = 4278190080;
const ZIP_MASK = 4278190080; const ZIP_MAGIC = 704643072;
const ZIP_MAGIC = 704643072; binding.fstat = function(...args) {
binding.fstat = function(...args) { const [fd, useBigint, req] = args;
const [fd, useBigint, req] = args; if ((fd & ZIP_MASK) === ZIP_MAGIC && useBigint === false && req === void 0) {
if ((fd & ZIP_MASK) === ZIP_MAGIC && useBigint === false && req === void 0) { try {
try { const stats = fs.fstatSync(fd);
const stats = fs.fstatSync(fd); return new Float64Array([
return new Float64Array([ stats.dev,
stats.dev, stats.mode,
stats.mode, stats.nlink,
stats.nlink, stats.uid,
stats.uid, stats.gid,
stats.gid, stats.rdev,
stats.rdev, stats.blksize,
stats.blksize, stats.ino,
stats.ino, stats.size,
stats.size, stats.blocks
stats.blocks ]);
]); } catch {
} catch {
}
} }
return originalfstat.apply(this, args); }
}; return originalfstat.apply(this, args);
} };
const resolve = resolve$1; const resolve = resolve$1;
const getFormat = HAS_CONSOLIDATED_HOOKS ? void 0 : getFormat$1; const getFormat = HAS_CONSOLIDATED_HOOKS ? void 0 : getFormat$1;
+1 -2
View File
@@ -6,6 +6,5 @@
"eslint.nodePath": ".yarn/sdks", "eslint.nodePath": ".yarn/sdks",
"prettier.prettierPath": ".yarn/sdks/prettier/index.js", "prettier.prettierPath": ".yarn/sdks/prettier/index.js",
"typescript.tsdk": ".yarn/sdks/typescript/lib", "typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true, "typescript.enablePromptUseWorkspaceTsdk": true
"terraform.languageServer.enable": false
} }
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More