From 889a7cdd24dda04a139b2b77d626e984d6db6781 Mon Sep 17 00:00:00 2001 From: roschaefer Date: Tue, 17 Sep 2019 02:20:24 +0200 Subject: [PATCH 001/281] Intermediate commit --- deployment/helm/human-connection/.helmignore | 22 +++++++++++++++++++ deployment/helm/human-connection/Chart.yaml | 5 +++++ .../human-connection/templates/configmap.yml | 21 ++++++++++++++++++ deployment/helm/human-connection/values.yaml | 1 + 4 files changed, 49 insertions(+) create mode 100644 deployment/helm/human-connection/.helmignore create mode 100644 deployment/helm/human-connection/Chart.yaml create mode 100644 deployment/helm/human-connection/templates/configmap.yml create mode 100644 deployment/helm/human-connection/values.yaml diff --git a/deployment/helm/human-connection/.helmignore b/deployment/helm/human-connection/.helmignore new file mode 100644 index 000000000..50af03172 --- /dev/null +++ b/deployment/helm/human-connection/.helmignore @@ -0,0 +1,22 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/deployment/helm/human-connection/Chart.yaml b/deployment/helm/human-connection/Chart.yaml new file mode 100644 index 000000000..ab0d80bb1 --- /dev/null +++ b/deployment/helm/human-connection/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: "1.0" +description: A Helm chart for Kubernetes +name: human-connection +version: 0.1.0 diff --git a/deployment/helm/human-connection/templates/configmap.yml b/deployment/helm/human-connection/templates/configmap.yml new file mode 100644 index 000000000..82973fd69 --- /dev/null +++ b/deployment/helm/human-connection/templates/configmap.yml @@ -0,0 +1,21 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-configmap +dath: + SMTP_HOST: "mailserver.human-connection" + SMTP_PORT: "25" + GRAPHQL_PORT: "4000" + GRAPHQL_URI: "http://nitro-backend.human-connection:4000" + NEO4J_URI: "bolt://nitro-neo4j.human-connection:7687" + NEO4J_AUTH: "none" + CLIENT_URI: "https://{{ .Values.domain }}" + NEO4J_apoc_import_file_enabled: "true" + NEO4J_dbms_memory_pagecache_size: "490M" + NEO4J_dbms_memory_heap_max__size: "500M" + NEO4J_dbms_memory_heap_initial__size: "500M" + NEO4J_dbms_security_procedures_unrestricted: "algo.*,apoc.*" + VERSION: "0.1.0" + SENTRY_DSN_WEBAPP: "" + SENTRY_DSN_BACKEND: "" + COMMIT: "" diff --git a/deployment/helm/human-connection/values.yaml b/deployment/helm/human-connection/values.yaml new file mode 100644 index 000000000..0fe0dc898 --- /dev/null +++ b/deployment/helm/human-connection/values.yaml @@ -0,0 +1 @@ +domain: nitro-staging.human-connection.org From caf2bc79cfa343d90e6550e4808fa72478c28d56 Mon Sep 17 00:00:00 2001 From: roschaefer Date: Tue, 17 Sep 2019 13:41:49 +0200 Subject: [PATCH 002/281] Start to write a helm chart for Human Connection --- deployment/helm/human-connection/Chart.yaml | 2 +- .../human-connection/templates/configmap.yml | 28 ++++++------ .../templates/deployment-backend.yaml | 45 +++++++++++++++++++ deployment/helm/human-connection/values.yaml | 31 +++++++++++++ 4 files changed, 90 insertions(+), 16 deletions(-) create mode 100644 deployment/helm/human-connection/templates/deployment-backend.yaml diff --git a/deployment/helm/human-connection/Chart.yaml b/deployment/helm/human-connection/Chart.yaml index ab0d80bb1..1cfe9378b 100644 --- a/deployment/helm/human-connection/Chart.yaml +++ b/deployment/helm/human-connection/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v1 appVersion: "1.0" -description: A Helm chart for Kubernetes +description: A Helm chart for Human Connection name: human-connection version: 0.1.0 diff --git a/deployment/helm/human-connection/templates/configmap.yml b/deployment/helm/human-connection/templates/configmap.yml index 82973fd69..d298f1b08 100644 --- a/deployment/helm/human-connection/templates/configmap.yml +++ b/deployment/helm/human-connection/templates/configmap.yml @@ -3,19 +3,17 @@ kind: ConfigMap metadata: name: {{ .Release.Name }}-configmap dath: - SMTP_HOST: "mailserver.human-connection" - SMTP_PORT: "25" - GRAPHQL_PORT: "4000" - GRAPHQL_URI: "http://nitro-backend.human-connection:4000" - NEO4J_URI: "bolt://nitro-neo4j.human-connection:7687" - NEO4J_AUTH: "none" + GRAPHQL_URI: "http://{{ .Release.Name }}-backend:4000" + NEO4J_URI: "bolt://{{ .Release.Name }}-neo4j:7687" CLIENT_URI: "https://{{ .Values.domain }}" - NEO4J_apoc_import_file_enabled: "true" - NEO4J_dbms_memory_pagecache_size: "490M" - NEO4J_dbms_memory_heap_max__size: "500M" - NEO4J_dbms_memory_heap_initial__size: "500M" - NEO4J_dbms_security_procedures_unrestricted: "algo.*,apoc.*" - VERSION: "0.1.0" - SENTRY_DSN_WEBAPP: "" - SENTRY_DSN_BACKEND: "" - COMMIT: "" + NEO4J_apoc_import_file_enabled: {{ .Values.neo4j.apoc_import_file_enabled }} + NEO4J_dbms_memory_pagecache_size: {{ .Values.neo4j.dbms_memory_pagecache_size }} + NEO4J_dbms_memory_heap_max__size: {{ .Values.neo4j.dbms_memory_heap_max__size }} + NEO4J_dbms_memory_heap_initial__size: {{ .Values.neo4j.dbms_memory_heap_initial__size }} + NEO4J_dbms_security_procedures_unrestricted: {{ .Values.neo4j.dbms_security_procedures_unrestricted }} + VERSION: {{ .Chart.AppVersion }} + SENTRY_DSN_WEBAPP: {{ .Values.sentry.dsn_webapp }} + SENTRY_DSN_BACKEND: {{ .Values.sentry.dsn_backend }} + COMMIT: {{ .Values.commit }} + SMTP_HOST: {{ .Values.smtp.host }} + SMTP_PORT: {{ .Values.smtp.port }} diff --git a/deployment/helm/human-connection/templates/deployment-backend.yaml b/deployment/helm/human-connection/templates/deployment-backend.yaml new file mode 100644 index 000000000..596036fd2 --- /dev/null +++ b/deployment/helm/human-connection/templates/deployment-backend.yaml @@ -0,0 +1,45 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-backend +spec: + replicas: 1 + minReadySeconds: 15 + progressDeadlineSeconds: 60 + strategy: + rollingUpdate: + maxSurge: 0 + maxUnavailable: "100%" + selector: + matchLabels: + human-connection.org/selector: deployment-backend + template: + metadata: + name: deployment-backend + annotations: + backup.velero.io/backup-volumes: uploads + labels: + human-connection.org/commit: {{ .Values.commit }} + human-connection.org/selector: deployment-backend + spec: + containers: + - name: backend + image: humanconnection/nitro-backend:latest + imagePullPolicy: {{ .Values.pullPolicy }} + ports: + - containerPort: 4000 + envFrom: + - configMapRef: + name: {{ .Release.Name }}-configmap + - secretRef: + name: {{ .Release.Name }}-secrets + # volumeMounts: + # - mountPath: /nitro-backend/public/uploads + # name: uploads + # volumes: + # - name: uploads + # persistentVolumeClaim: + # claimName: uploads-claim + restartPolicy: Always + terminationGracePeriodSeconds: 30 +status: {} diff --git a/deployment/helm/human-connection/values.yaml b/deployment/helm/human-connection/values.yaml index 0fe0dc898..c15537a83 100644 --- a/deployment/helm/human-connection/values.yaml +++ b/deployment/helm/human-connection/values.yaml @@ -1 +1,32 @@ domain: nitro-staging.human-connection.org +commit: 889a7cdd24dda04a139b2b77d626e984d6db6781 +pullPolicy: Always + +# configs +smtp: + host: "mailserver.human-connection" + port: "25" +neo4j: + apoc_import_file_enabled: "true" + dbms_memory_pagecache_size: "490M" + dbms_memory_heap_max__size: "500M" + dbms_memory_heap_initial__size: "500M" + dbms_security_procedures_unrestricted: "algo.*,apoc.*" +sentry: + dsn_webapp: + dsn_backend: + +# secrets +jwt_secret: b/&&7b78BF&fv/Vd +private_key_passphrase: a7dsf78sadg87ad87sfagsadg78 +mapbox: + token: pk.eyJ1IjoiaHVtYW4tY29ubmVjdGlvbiIsImEiOiJjajl0cnBubGoweTVlM3VwZ2lzNTNud3ZtIn0.KZ8KK9l70omjXbEkkbHGsQ +mongodb: + username: + password: +neo4j: + username: + password: +smtp: + username: + password: From a2a71975abdba9a806add1477da0e0f14a6f7700 Mon Sep 17 00:00:00 2001 From: roschaefer Date: Tue, 17 Sep 2019 20:01:34 +0200 Subject: [PATCH 003/281] Templates for webapp+neo4j, use camelCase --- .../human-connection/templates/configmap.yml | 13 ++--- .../templates/deployment-neo4j.yaml | 55 +++++++++++++++++++ .../templates/deployment-web.yaml | 37 +++++++++++++ deployment/helm/human-connection/values.yaml | 35 +++++------- 4 files changed, 110 insertions(+), 30 deletions(-) create mode 100644 deployment/helm/human-connection/templates/deployment-neo4j.yaml create mode 100644 deployment/helm/human-connection/templates/deployment-web.yaml diff --git a/deployment/helm/human-connection/templates/configmap.yml b/deployment/helm/human-connection/templates/configmap.yml index d298f1b08..8be7b517e 100644 --- a/deployment/helm/human-connection/templates/configmap.yml +++ b/deployment/helm/human-connection/templates/configmap.yml @@ -6,14 +6,9 @@ dath: GRAPHQL_URI: "http://{{ .Release.Name }}-backend:4000" NEO4J_URI: "bolt://{{ .Release.Name }}-neo4j:7687" CLIENT_URI: "https://{{ .Values.domain }}" - NEO4J_apoc_import_file_enabled: {{ .Values.neo4j.apoc_import_file_enabled }} - NEO4J_dbms_memory_pagecache_size: {{ .Values.neo4j.dbms_memory_pagecache_size }} - NEO4J_dbms_memory_heap_max__size: {{ .Values.neo4j.dbms_memory_heap_max__size }} - NEO4J_dbms_memory_heap_initial__size: {{ .Values.neo4j.dbms_memory_heap_initial__size }} - NEO4J_dbms_security_procedures_unrestricted: {{ .Values.neo4j.dbms_security_procedures_unrestricted }} VERSION: {{ .Chart.AppVersion }} - SENTRY_DSN_WEBAPP: {{ .Values.sentry.dsn_webapp }} - SENTRY_DSN_BACKEND: {{ .Values.sentry.dsn_backend }} + SENTRY_DSN_WEBAPP: {{ .Values.sentryDsnWebapp }} + SENTRY_DSN_BACKEND: {{ .Values.sentryDsnBackend }} COMMIT: {{ .Values.commit }} - SMTP_HOST: {{ .Values.smtp.host }} - SMTP_PORT: {{ .Values.smtp.port }} + SMTP_HOST: {{ .Values.smtpHost }} + SMTP_PORT: {{ .Values.smtpPort }} diff --git a/deployment/helm/human-connection/templates/deployment-neo4j.yaml b/deployment/helm/human-connection/templates/deployment-neo4j.yaml new file mode 100644 index 000000000..692533abf --- /dev/null +++ b/deployment/helm/human-connection/templates/deployment-neo4j.yaml @@ -0,0 +1,55 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-neo4j +spec: + replicas: 1 + strategy: + rollingUpdate: + maxSurge: 0 + maxUnavailable: "100%" + selector: + matchLabels: + human-connection.org/selector: deployment-neo4j + template: + metadata: + name: neo4j + annotations: + backup.velero.io/backup-volumes: neo4j-data + labels: + human-connection.org/commit: {{ .Values.commit }} + human-connection.org/selector: deployment-neo4j + spec: + containers: + - name: neo4j + image: humanconnection/neo4j:latest + imagePullPolicy: {{ .Values.pullPolicy }} + ports: + - containerPort: 7687 + - containerPort: 7474 + # resources: + # requests: + # memory: "2G" + # limits: + # memory: "8G" + env: + - name: NEO4J_dbms_security_procedures_unrestricted + value: "algo.*,apoc.*" + {{- range $key, $val := .Values.neo4jConfig }} + - name: NEO4J_{{ $key }} + value: {{ $val | quote }} + {{- end}} + envFrom: + - configMapRef: + name: {{ .Release.Name }}-configmap + - secretRef: + name: {{ .Release.Name }}-secrets + # volumeMounts: + # - mountPath: /data/ + # name: neo4j-data + # volumes: + # - name: neo4j-data + # persistentVolumeClaim: + # claimName: neo4j-data-claim + restartPolicy: Always + terminationGracePeriodSeconds: 30 diff --git a/deployment/helm/human-connection/templates/deployment-web.yaml b/deployment/helm/human-connection/templates/deployment-web.yaml new file mode 100644 index 000000000..0e432774f --- /dev/null +++ b/deployment/helm/human-connection/templates/deployment-web.yaml @@ -0,0 +1,37 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-webapp +spec: + replicas: 2 + minReadySeconds: 15 + progressDeadlineSeconds: 60 + selector: + matchLabels: + human-connection.org/selector: deployment-webapp + template: + metadata: + name: webapp + labels: + human-connection.org/commit: {{ .Values.commit }} + human-connection.org/selector: deployment-webapp + spec: + containers: + - name: webapp + image: humanconnection/nitro-web:latest + imagePullPolicy: {{ .Values.pullPolicy }} + envFrom: + - configMapRef: + name: {{ .Release.Name }}-configmap + - secretRef: + name: {{ .Release.Name }}-secrets + env: + - name: HOST + value: 0.0.0.0 + ports: + - containerPort: 3000 + resources: {} + imagePullPolicy: Always + restartPolicy: Always + terminationGracePeriodSeconds: 30 +status: {} diff --git a/deployment/helm/human-connection/values.yaml b/deployment/helm/human-connection/values.yaml index c15537a83..25a346fae 100644 --- a/deployment/helm/human-connection/values.yaml +++ b/deployment/helm/human-connection/values.yaml @@ -3,30 +3,23 @@ commit: 889a7cdd24dda04a139b2b77d626e984d6db6781 pullPolicy: Always # configs -smtp: - host: "mailserver.human-connection" - port: "25" -neo4j: +smtpHost: "mailserver.human-connection" +smtpPort: "25" +smtpUsername: +smtpPassword: +sentryDsnWebapp: +sentryDsnBackend: +neo4jConfig: apoc_import_file_enabled: "true" dbms_memory_pagecache_size: "490M" dbms_memory_heap_max__size: "500M" dbms_memory_heap_initial__size: "500M" - dbms_security_procedures_unrestricted: "algo.*,apoc.*" -sentry: - dsn_webapp: - dsn_backend: # secrets -jwt_secret: b/&&7b78BF&fv/Vd -private_key_passphrase: a7dsf78sadg87ad87sfagsadg78 -mapbox: - token: pk.eyJ1IjoiaHVtYW4tY29ubmVjdGlvbiIsImEiOiJjajl0cnBubGoweTVlM3VwZ2lzNTNud3ZtIn0.KZ8KK9l70omjXbEkkbHGsQ -mongodb: - username: - password: -neo4j: - username: - password: -smtp: - username: - password: +jwtSecret: b/&&7b78BF&fv/Vd +privateKeyPassphrase: a7dsf78sadg87ad87sfagsadg78 +mapboxToken: pk.eyJ1IjoiaHVtYW4tY29ubmVjdGlvbiIsImEiOiJjajl0cnBubGoweTVlM3VwZ2lzNTNud3ZtIn0.KZ8KK9l70omjXbEkkbHGsQ +mongodbUsername: +mongodbPassword: +neo4jUsername: +neo4jPassword: From fccf53a176789ecc728032bda99cc2f55ab018b8 Mon Sep 17 00:00:00 2001 From: roschaefer Date: Tue, 17 Sep 2019 23:28:17 +0200 Subject: [PATCH 004/281] Implement services and maintenance deployment Also found: ``` Some users have raised concerns that the Neo4j image changes file permissions on the host machine. By default, Neo4j runs as the user neo4j who only exists in the container, not on the host. That means that it's hard to set up mount folders on the host which this new user has write permissions for. We have updated the error messaging with advice about how to fix file permission errors. We also introduced writability checks and reduced the amount of file permission changes the image will perform. This has been found to interfere with some Kubernetes setups, so is currently an opt-in feature. To enforce stricter file permissions checking you can pass this environment variable to the container: --env SECURE_FILE_PERMISSIONS=yes ``` from https://hub.docker.com/_/neo4j Implemented the above :point_up: --- .../templates/deployment-maintenance.yaml | 26 +++++++++++++++++++ .../templates/deployment-neo4j.yaml | 2 ++ .../templates/service-backend.yaml | 11 ++++++++ .../templates/service-maintenance.yaml | 11 ++++++++ .../templates/service-neo4j.yaml | 14 ++++++++++ .../templates/service-webapp.yaml | 11 ++++++++ 6 files changed, 75 insertions(+) create mode 100644 deployment/helm/human-connection/templates/deployment-maintenance.yaml create mode 100644 deployment/helm/human-connection/templates/service-backend.yaml create mode 100644 deployment/helm/human-connection/templates/service-maintenance.yaml create mode 100644 deployment/helm/human-connection/templates/service-neo4j.yaml create mode 100644 deployment/helm/human-connection/templates/service-webapp.yaml diff --git a/deployment/helm/human-connection/templates/deployment-maintenance.yaml b/deployment/helm/human-connection/templates/deployment-maintenance.yaml new file mode 100644 index 000000000..8ce4442b9 --- /dev/null +++ b/deployment/helm/human-connection/templates/deployment-maintenance.yaml @@ -0,0 +1,26 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-maintenance +spec: + selector: + matchLabels: + human-connection.org/selector: deployment-maintenance + template: + metadata: + labels: + human-connection.org/commit: {{ .Values.commit }} + human-connection.org/selector: deployment-maintenance + name: maintenance + spec: + containers: + - name: maintenance + env: + - name: HOST + value: 0.0.0.0 + image: humanconnection/maintenance:latest + ports: + - containerPort: 80 + imagePullPolicy: Always + restartPolicy: Always + terminationGracePeriodSeconds: 30 diff --git a/deployment/helm/human-connection/templates/deployment-neo4j.yaml b/deployment/helm/human-connection/templates/deployment-neo4j.yaml index 692533abf..290f79332 100644 --- a/deployment/helm/human-connection/templates/deployment-neo4j.yaml +++ b/deployment/helm/human-connection/templates/deployment-neo4j.yaml @@ -35,6 +35,8 @@ spec: env: - name: NEO4J_dbms_security_procedures_unrestricted value: "algo.*,apoc.*" + - name: SECURE_FILE_PERMISSIONS + value: "yes" {{- range $key, $val := .Values.neo4jConfig }} - name: NEO4J_{{ $key }} value: {{ $val | quote }} diff --git a/deployment/helm/human-connection/templates/service-backend.yaml b/deployment/helm/human-connection/templates/service-backend.yaml new file mode 100644 index 000000000..b9d40ef8a --- /dev/null +++ b/deployment/helm/human-connection/templates/service-backend.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-backend +spec: + ports: + - name: graphql + port: 4000 + targetPort: 4000 + selector: + human-connection.org/selector: deployment-backend diff --git a/deployment/helm/human-connection/templates/service-maintenance.yaml b/deployment/helm/human-connection/templates/service-maintenance.yaml new file mode 100644 index 000000000..a82473e2e --- /dev/null +++ b/deployment/helm/human-connection/templates/service-maintenance.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-maintenance +spec: + ports: + - name: web + port: 80 + targetPort: 80 + selector: + human-connection.org/selector: deployment-maintenance diff --git a/deployment/helm/human-connection/templates/service-neo4j.yaml b/deployment/helm/human-connection/templates/service-neo4j.yaml new file mode 100644 index 000000000..547dad6c7 --- /dev/null +++ b/deployment/helm/human-connection/templates/service-neo4j.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-neo4j +spec: + ports: + - name: bolt + port: 7687 + targetPort: 7687 + - name: web + port: 7474 + targetPort: 7474 + selector: + human-connection.org/selector: deployment-neo4j diff --git a/deployment/helm/human-connection/templates/service-webapp.yaml b/deployment/helm/human-connection/templates/service-webapp.yaml new file mode 100644 index 000000000..c1a9771ee --- /dev/null +++ b/deployment/helm/human-connection/templates/service-webapp.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-webapp +spec: + ports: + - name: web + port: 3000 + targetPort: 3000 + selector: + human-connection.org/selector: deployment-webapp From 18ffafcabce8a46fba55d0b33950847caa95ff1b Mon Sep 17 00:00:00 2001 From: roschaefer Date: Wed, 18 Sep 2019 00:05:00 +0200 Subject: [PATCH 005/281] Assign the neo4j pod at least 1G memory I just went into memory issues when creating all the pods. Neo4j was in a crash loop with exit code 137. Apparently this one: https://success.docker.com/article/what-causes-a-container-to-exit-with-code-137 --- .../human-connection/templates/deployment-neo4j.yaml | 10 +++++----- deployment/helm/human-connection/values.yaml | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/deployment/helm/human-connection/templates/deployment-neo4j.yaml b/deployment/helm/human-connection/templates/deployment-neo4j.yaml index 290f79332..3818af2ef 100644 --- a/deployment/helm/human-connection/templates/deployment-neo4j.yaml +++ b/deployment/helm/human-connection/templates/deployment-neo4j.yaml @@ -27,11 +27,11 @@ spec: ports: - containerPort: 7687 - containerPort: 7474 - # resources: - # requests: - # memory: "2G" - # limits: - # memory: "8G" + resources: + requests: + memory: {{ .Values.neo4jResourceRequestsMemory | default "1G" | quote }} + limits: + memory: {{ .Values.neo4jResourceLimitsMemory | default "1G" | quote }} env: - name: NEO4J_dbms_security_procedures_unrestricted value: "algo.*,apoc.*" diff --git a/deployment/helm/human-connection/values.yaml b/deployment/helm/human-connection/values.yaml index 25a346fae..77d799861 100644 --- a/deployment/helm/human-connection/values.yaml +++ b/deployment/helm/human-connection/values.yaml @@ -9,6 +9,8 @@ smtpUsername: smtpPassword: sentryDsnWebapp: sentryDsnBackend: +neo4jResourceRequestsMemory: "1G" +neo4jResourceLimitsMemory: "1G" neo4jConfig: apoc_import_file_enabled: "true" dbms_memory_pagecache_size: "490M" @@ -21,5 +23,5 @@ privateKeyPassphrase: a7dsf78sadg87ad87sfagsadg78 mapboxToken: pk.eyJ1IjoiaHVtYW4tY29ubmVjdGlvbiIsImEiOiJjajl0cnBubGoweTVlM3VwZ2lzNTNud3ZtIn0.KZ8KK9l70omjXbEkkbHGsQ mongodbUsername: mongodbPassword: -neo4jUsername: -neo4jPassword: +neo4jUsername: neo4j +neo4jPassword: neo4j From c189b620739b9aca1344054ed8dc28c3f5f9cf09 Mon Sep 17 00:00:00 2001 From: roschaefer Date: Wed, 18 Sep 2019 00:19:24 +0200 Subject: [PATCH 006/281] Set app version --- deployment/helm/human-connection/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/helm/human-connection/Chart.yaml b/deployment/helm/human-connection/Chart.yaml index 1cfe9378b..0f303ade0 100644 --- a/deployment/helm/human-connection/Chart.yaml +++ b/deployment/helm/human-connection/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v1 -appVersion: "1.0" +appVersion: "0.1.0" description: A Helm chart for Human Connection name: human-connection version: 0.1.0 From c8c345be485d0b3516eb6787d8b432c74487d4e7 Mon Sep 17 00:00:00 2001 From: roschaefer Date: Wed, 18 Sep 2019 01:19:06 +0200 Subject: [PATCH 007/281] Fixup bug dath --- deployment/helm/human-connection/templates/configmap.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/helm/human-connection/templates/configmap.yml b/deployment/helm/human-connection/templates/configmap.yml index 8be7b517e..dec2c2bac 100644 --- a/deployment/helm/human-connection/templates/configmap.yml +++ b/deployment/helm/human-connection/templates/configmap.yml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ .Release.Name }}-configmap -dath: +data: GRAPHQL_URI: "http://{{ .Release.Name }}-backend:4000" NEO4J_URI: "bolt://{{ .Release.Name }}-neo4j:7687" CLIENT_URI: "https://{{ .Values.domain }}" From 6e0b7c86e17fff78464aef34726c091b645cb8c9 Mon Sep 17 00:00:00 2001 From: roschaefer Date: Wed, 18 Sep 2019 01:19:50 +0200 Subject: [PATCH 008/281] Conditionally deploy mailserver --- .../human-connection/templates/configmap.yml | 5 +++ .../templates/deployment-mailserver.yaml | 34 +++++++++++++++++++ .../templates/service-mailserver.yaml | 16 +++++++++ deployment/helm/human-connection/values.yaml | 1 + 4 files changed, 56 insertions(+) create mode 100644 deployment/helm/human-connection/templates/deployment-mailserver.yaml create mode 100644 deployment/helm/human-connection/templates/service-mailserver.yaml diff --git a/deployment/helm/human-connection/templates/configmap.yml b/deployment/helm/human-connection/templates/configmap.yml index dec2c2bac..4c57a7e94 100644 --- a/deployment/helm/human-connection/templates/configmap.yml +++ b/deployment/helm/human-connection/templates/configmap.yml @@ -10,5 +10,10 @@ data: SENTRY_DSN_WEBAPP: {{ .Values.sentryDsnWebapp }} SENTRY_DSN_BACKEND: {{ .Values.sentryDsnBackend }} COMMIT: {{ .Values.commit }} +{{- if .Values.developmentMailserverDomain }} + SMTP_HOST: {{ .Release.Name }}-mailserver + SMTP_PORT: "25" +{{- else }} SMTP_HOST: {{ .Values.smtpHost }} SMTP_PORT: {{ .Values.smtpPort }} +{{- end }} diff --git a/deployment/helm/human-connection/templates/deployment-mailserver.yaml b/deployment/helm/human-connection/templates/deployment-mailserver.yaml new file mode 100644 index 000000000..685cabea0 --- /dev/null +++ b/deployment/helm/human-connection/templates/deployment-mailserver.yaml @@ -0,0 +1,34 @@ +{{- if .Values.developmentMailserverDomain }} +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-mailserver +spec: + replicas: 1 + minReadySeconds: 15 + progressDeadlineSeconds: 60 + selector: + matchLabels: + human-connection.org/selector: deployment-mailserver + template: + metadata: + labels: + human-connection.org/selector: deployment-mailserver + name: mailserver + spec: + containers: + - name: mailserver + image: djfarrelly/maildev + imagePullPolicy: {{ .Values.pullPolicy }} + ports: + - containerPort: 80 + - containerPort: 25 + envFrom: + - configMapRef: + name: {{ .Release.Name }}-configmap + - secretRef: + name: {{ .Release.Name }}-secrets + restartPolicy: Always + terminationGracePeriodSeconds: 30 +status: {} +{{- end}} diff --git a/deployment/helm/human-connection/templates/service-mailserver.yaml b/deployment/helm/human-connection/templates/service-mailserver.yaml new file mode 100644 index 000000000..e5e22aa37 --- /dev/null +++ b/deployment/helm/human-connection/templates/service-mailserver.yaml @@ -0,0 +1,16 @@ +{{- if .Values.developmentMailserverDomain }} +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-mailserver +spec: + ports: + - name: web + port: 80 + targetPort: 80 + - name: smtp + port: 25 + targetPort: 25 + selector: + human-connection.org/selector: deployment-mailserver +{{- end}} diff --git a/deployment/helm/human-connection/values.yaml b/deployment/helm/human-connection/values.yaml index 77d799861..6db2f87fd 100644 --- a/deployment/helm/human-connection/values.yaml +++ b/deployment/helm/human-connection/values.yaml @@ -3,6 +3,7 @@ commit: 889a7cdd24dda04a139b2b77d626e984d6db6781 pullPolicy: Always # configs +developmentMailserverDomain: "nitro-mailserver.human-connection.org" smtpHost: "mailserver.human-connection" smtpPort: "25" smtpUsername: From 2363c285e146b8a76864bab1eec0e8d8961fb07e Mon Sep 17 00:00:00 2001 From: roschaefer Date: Wed, 18 Sep 2019 02:12:50 +0200 Subject: [PATCH 009/281] Implement ingress and letsencrypt issuers --- .../templates/ingress.template.yaml | 31 +++++++++++++++++++ .../templates/letsencrypt-prod.yaml | 11 +++++++ .../templates/letsencrypt-staging.yaml | 11 +++++++ deployment/helm/human-connection/values.yaml | 5 ++- 4 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 deployment/helm/human-connection/templates/ingress.template.yaml create mode 100644 deployment/helm/human-connection/templates/letsencrypt-prod.yaml create mode 100644 deployment/helm/human-connection/templates/letsencrypt-staging.yaml diff --git a/deployment/helm/human-connection/templates/ingress.template.yaml b/deployment/helm/human-connection/templates/ingress.template.yaml new file mode 100644 index 000000000..99c3fbb78 --- /dev/null +++ b/deployment/helm/human-connection/templates/ingress.template.yaml @@ -0,0 +1,31 @@ +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ .Release.Name }}-ingress + annotations: + kubernetes.io/ingress.class: "nginx" + certmanager.k8s.io/issuer: {{ .Values.letsencryptIssuer }} + certmanager.k8s.io/acme-challenge-type: http01 + nginx.ingress.kubernetes.io/proxy-body-size: 6m +spec: + tls: + - hosts: + - {{ .Values.humanConnectionDomain }} + secretName: tls + rules: + - host: {{ .Values.humanConnectionDomain }} + http: + paths: + - path: / + backend: + serviceName: webapp + servicePort: 3000 +{{- if .Values.developmentMailserverDomain }} + - host: {{ .Values.developmentMailserverDomain }} + http: + paths: + - path: / + backend: + serviceName: {{ .Release.Name }}-mailserver + servicePort: 80 +{{- end }} diff --git a/deployment/helm/human-connection/templates/letsencrypt-prod.yaml b/deployment/helm/human-connection/templates/letsencrypt-prod.yaml new file mode 100644 index 000000000..9801fb974 --- /dev/null +++ b/deployment/helm/human-connection/templates/letsencrypt-prod.yaml @@ -0,0 +1,11 @@ +apiVersion: certmanager.k8s.io/v1alpha1 +kind: Issuer +metadata: + name: {{ .Release.Name }}-letsencrypt-prod +spec: + acme: + server: https://acme-v02.api.letsencrypt.org/directory + email: {{ .Values.supportEmail }} + privateKeySecretRef: + name: letsencrypt-prod + http01: {} diff --git a/deployment/helm/human-connection/templates/letsencrypt-staging.yaml b/deployment/helm/human-connection/templates/letsencrypt-staging.yaml new file mode 100644 index 000000000..2bb6784a8 --- /dev/null +++ b/deployment/helm/human-connection/templates/letsencrypt-staging.yaml @@ -0,0 +1,11 @@ +apiVersion: certmanager.k8s.io/v1alpha1 +kind: Issuer +metadata: + name: {{ .Release.Name }}-letsencrypt-staging +spec: + acme: + server: https://acme-staging-v02.api.letsencrypt.org/directory + email: {{ .Values.supportEmail }} + privateKeySecretRef: + name: letsencrypt-staging + http01: {} diff --git a/deployment/helm/human-connection/values.yaml b/deployment/helm/human-connection/values.yaml index 6db2f87fd..f5fd5a6aa 100644 --- a/deployment/helm/human-connection/values.yaml +++ b/deployment/helm/human-connection/values.yaml @@ -3,7 +3,10 @@ commit: 889a7cdd24dda04a139b2b77d626e984d6db6781 pullPolicy: Always # configs -developmentMailserverDomain: "nitro-mailserver.human-connection.org" +developmentMailserverDomain: "helm-nitro-mailserver.human-connection.org" +humanConnectionDomain: "helm-staging.human-connection.org" +supportEmail: "developer@human-connection.org" +letsencryptIssuer: "letsencrypt-staging" smtpHost: "mailserver.human-connection" smtpPort: "25" smtpUsername: From b9676271ea1baf158c9f22bbde6210b807e2d917 Mon Sep 17 00:00:00 2001 From: ogerly Date: Thu, 19 Dec 2019 17:46:25 +0100 Subject: [PATCH 010/281] Delete teaser image --- .../ContributionForm/ContributionForm.vue | 19 +++++++++++++++++++ webapp/components/TeaserImage/TeaserImage.vue | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/webapp/components/ContributionForm/ContributionForm.vue b/webapp/components/ContributionForm/ContributionForm.vue index eeba47b72..fd54d4948 100644 --- a/webapp/components/ContributionForm/ContributionForm.vue +++ b/webapp/components/ContributionForm/ContributionForm.vue @@ -7,6 +7,12 @@ @submit="submit" > diff --git a/webapp/components/ContributionForm/ContributionForm.vue b/webapp/components/ContributionForm/ContributionForm.vue index ba5628e28..c7c1e8cfe 100644 --- a/webapp/components/ContributionForm/ContributionForm.vue +++ b/webapp/components/ContributionForm/ContributionForm.vue @@ -8,94 +8,64 @@ > @@ -116,16 +85,14 @@ import { mapGetters } from 'vuex' import HcEditor from '~/components/Editor/Editor' import locales from '~/locales' import PostMutations from '~/graphql/PostMutations.js' -import HcCategoriesSelect from '~/components/CategoriesSelect/CategoriesSelect' +import CategoriesSelect from '~/components/CategoriesSelect/CategoriesSelect' import TeaserImage from '~/components/TeaserImage/TeaserImage' -import UserTeaser from '~/components/UserTeaser/UserTeaser' export default { components: { HcEditor, - HcCategoriesSelect, + CategoriesSelect, TeaserImage, - UserTeaser, }, props: { contribution: { type: Object, default: () => {} }, @@ -194,12 +161,12 @@ export default { } }, computed: { - contentLength() { - return this.$filters.removeHtml(this.form.content).length - }, ...mapGetters({ currentUser: 'auth/user', }), + contentLength() { + return this.$filters.removeHtml(this.form.content).length + }, }, methods: { submit() { @@ -293,8 +260,38 @@ export default { diff --git a/webapp/components/TeaserImage/TeaserImage.vue b/webapp/components/TeaserImage/TeaserImage.vue index 536fd8ae4..16ee78678 100644 --- a/webapp/components/TeaserImage/TeaserImage.vue +++ b/webapp/components/TeaserImage/TeaserImage.vue @@ -106,7 +106,6 @@ export default { .image-uploader { position: relative; min-height: 200px; - overflow: hidden; cursor: pointer; &:only-child { @@ -117,10 +116,6 @@ export default { pointer-events: none; } - &.--blur-image img { - filter: blur(22px); - } - .preview-image + & { position: absolute; top: 0; From 41ef496d6b216922cf3538d3845526c7cecc019c Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Wed, 5 Feb 2020 21:45:28 +0100 Subject: [PATCH 069/281] refactor CategoriesSelect template --- .../CategoriesSelect/CategoriesSelect.vue | 44 +++++++++++-------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/webapp/components/CategoriesSelect/CategoriesSelect.vue b/webapp/components/CategoriesSelect/CategoriesSelect.vue index 7f0cbfcbc..b7d71de2d 100644 --- a/webapp/components/CategoriesSelect/CategoriesSelect.vue +++ b/webapp/components/CategoriesSelect/CategoriesSelect.vue @@ -1,22 +1,18 @@ + + From 0851ad4c5098ee3aef257b72505d2962902c4dca Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Thu, 6 Feb 2020 10:33:56 +0100 Subject: [PATCH 070/281] Add end line --- backend/src/schema/types/type/NOTIFIED.gql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/schema/types/type/NOTIFIED.gql b/backend/src/schema/types/type/NOTIFIED.gql index 558041b6a..88ecd3882 100644 --- a/backend/src/schema/types/type/NOTIFIED.gql +++ b/backend/src/schema/types/type/NOTIFIED.gql @@ -33,4 +33,4 @@ type Mutation { type Subscription { notificationAdded(userId: ID!): NOTIFIED -} \ No newline at end of file +} From ef9d351fcfb6e79f53e18fce4bcd2fca0adcc117 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Fri, 20 Dec 2019 01:54:04 +0100 Subject: [PATCH 071/281] swap lat and lng --- backend/src/schema/resolvers/users/location.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/schema/resolvers/users/location.js b/backend/src/schema/resolvers/users/location.js index 3f3638bf5..cc00d9e0a 100644 --- a/backend/src/schema/resolvers/users/location.js +++ b/backend/src/schema/resolvers/users/location.js @@ -34,8 +34,8 @@ const createLocation = async (session, mapboxData) => { namePL: mapboxData.text_pl, nameRU: mapboxData.text_ru, type: mapboxData.id.split('.')[0].toLowerCase(), - lat: mapboxData.center && mapboxData.center.length ? mapboxData.center[0] : null, - lng: mapboxData.center && mapboxData.center.length ? mapboxData.center[1] : null, + lng: mapboxData.center && mapboxData.center.length ? mapboxData.center[0] : null, + lat: mapboxData.center && mapboxData.center.length ? mapboxData.center[1] : null, } let mutation = From 976583b23589bcec7896cd7c01af3e17e650fc23 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Fri, 20 Dec 2019 02:54:35 +0100 Subject: [PATCH 072/281] fixing test for geolocation --- backend/src/schema/resolvers/users/location.spec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/schema/resolvers/users/location.spec.js b/backend/src/schema/resolvers/users/location.spec.js index f7315174c..af13dba5b 100644 --- a/backend/src/schema/resolvers/users/location.spec.js +++ b/backend/src/schema/resolvers/users/location.spec.js @@ -42,7 +42,7 @@ const updateUserMutation = gql` let newlyCreatedNodesWithLocales = [ { city: { - lng: 41.1534, + lat: 41.1534, nameES: 'Hamburg', nameFR: 'Hamburg', nameIT: 'Hamburg', @@ -55,7 +55,7 @@ let newlyCreatedNodesWithLocales = [ name: 'Hamburg', namePL: 'Hamburg', id: 'place.5977106083398860', - lat: -74.5763, + lng: -74.5763, }, state: { namePT: 'Nova Jérsia', @@ -151,7 +151,7 @@ describe('userMiddleware', () => { newlyCreatedNodesWithLocales = [ { city: { - lng: 53.55, + lat: 53.55, nameES: 'Hamburgo', nameFR: 'Hambourg', nameIT: 'Amburgo', @@ -164,7 +164,7 @@ describe('userMiddleware', () => { namePL: 'Hamburg', name: 'Hamburg', id: 'region.10793468240398860', - lat: 10, + lng: 10, }, country: { namePT: 'Alemanha', From cb8b2acffd8d4e026151321e40fc503f3103e539 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 8 Jan 2020 02:44:47 +0100 Subject: [PATCH 073/281] swap lng and lat in db seed --- backend/src/db/seed.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/src/db/seed.js b/backend/src/db/seed.js index ba7ace90b..69b1f8dfe 100644 --- a/backend/src/db/seed.js +++ b/backend/src/db/seed.js @@ -32,8 +32,8 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] id: 'region.5127278006398860', name: 'Hamburg', type: 'region', - lat: 10.0, - lng: 53.55, + lng: 10.0, + lat: 53.55, nameES: 'Hamburgo', nameFR: 'Hambourg', nameIT: 'Amburgo', @@ -48,8 +48,8 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] id: 'region.14880313158564380', type: 'region', name: 'Berlin', - lat: 13.38333, - lng: 52.51667, + lng: 13.38333, + lat: 52.51667, nameES: 'Berlín', nameFR: 'Berlin', nameIT: 'Berlino', @@ -78,8 +78,8 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] id: 'region.9397217726497330', name: 'Paris', type: 'region', - lat: 2.35183, - lng: 48.85658, + lng: 2.35183, + lat: 48.85658, nameES: 'París', nameFR: 'Paris', nameIT: 'Parigi', From 4905b09b3e722655c65051ece7ee12c3c38c1390 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 6 Feb 2020 20:47:45 +0100 Subject: [PATCH 074/281] migration added to swap lat and lng in db --- ...0206190233-swap_latitude_with_longitude.js | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 backend/src/db/migrations/20200206190233-swap_latitude_with_longitude.js diff --git a/backend/src/db/migrations/20200206190233-swap_latitude_with_longitude.js b/backend/src/db/migrations/20200206190233-swap_latitude_with_longitude.js new file mode 100644 index 000000000..35d85430e --- /dev/null +++ b/backend/src/db/migrations/20200206190233-swap_latitude_with_longitude.js @@ -0,0 +1,54 @@ +import { getDriver } from '../../db/neo4j' + +export const description = 'This migration swaps the value stored in Location.lat with the value of Location.lng.' + +export async function up(next) { + const driver = getDriver() + const session = driver.session() + const transaction = session.beginTransaction() + + try { + // Implement your migration here. + await transaction.run(` + MATCH (l:Location) WHERE NOT(l.lat IS NULL) + WITH l.lng AS longitude, l.lat AS latitude, l AS Location + SET Location.lat = longitude, Location.lng = latitude + `) + await transaction.commit() + next() + } catch (error) { + // eslint-disable-next-line no-console + console.log(error) + await transaction.rollback() + // eslint-disable-next-line no-console + console.log('rolled back') + } finally { + session.close() + } +} + +export async function down(next) { + const driver = getDriver() + const session = driver.session() + const transaction = session.beginTransaction() + + try { + // Implement your migration here. + await transaction.run( + ` + MATCH (l:Location) WHERE NOT(l.lat IS NULL) + WITH l.lng AS longitude, l.lat AS latitude, l AS Location + SET Location.lat = longitude, Location.lng = latitude `, + ) + await transaction.commit() + next() + } catch (error) { + // eslint-disable-next-line no-console + console.log(error) + await transaction.rollback() + // eslint-disable-next-line no-console + console.log('rolled back') + } finally { + session.close() + } +} From 86f298f8e5ce588da1ac6751ed3cc15dea346fdb Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 6 Feb 2020 23:00:06 +0100 Subject: [PATCH 075/281] prettier, prettier --- .../migrations/20200206190233-swap_latitude_with_longitude.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/db/migrations/20200206190233-swap_latitude_with_longitude.js b/backend/src/db/migrations/20200206190233-swap_latitude_with_longitude.js index 35d85430e..0e11c8007 100644 --- a/backend/src/db/migrations/20200206190233-swap_latitude_with_longitude.js +++ b/backend/src/db/migrations/20200206190233-swap_latitude_with_longitude.js @@ -1,6 +1,7 @@ import { getDriver } from '../../db/neo4j' -export const description = 'This migration swaps the value stored in Location.lat with the value of Location.lng.' +export const description = + 'This migration swaps the value stored in Location.lat with the value of Location.lng.' export async function up(next) { const driver = getDriver() From 46edc3fdd5b83c2f00506f595b1254d7597767e0 Mon Sep 17 00:00:00 2001 From: roschaefer Date: Fri, 7 Feb 2020 14:24:54 +0100 Subject: [PATCH 076/281] Replace buildList with array of Promises reason: Rosie.js does not support promises. So for the time being, we shall not use more than one `after` callback and we shall not use buildList as it does not return a `Promise.all([])`. We have to ask the maintainers of Rosie.js if they accept the breaking change of returning a Promise always. --- backend/src/db/seed.js | 473 ++++++++++++++++++++++++----------------- 1 file changed, 273 insertions(+), 200 deletions(-) diff --git a/backend/src/db/seed.js b/backend/src/db/seed.js index 04f7f7bdb..32a20145b 100644 --- a/backend/src/db/seed.js +++ b/backend/src/db/seed.js @@ -933,253 +933,326 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] trollingComment.update({ disabled: true, updatedAt: new Date().toISOString(), closed: true }), ]) - await Factory.buildList('user', 30) + await Promise.all([...Array(30).keys()].map(() => Factory.build('user'))) - await Factory.buildList( - 'post', - 30, - { - image: faker.image.unsplash.objects(), - }, - { - categoryIds: ['cat1'], - author: jennyRostock, - }, + await Promise.all( + [...Array(30).keys()].map(() => + Factory.build( + 'post', + { + image: faker.image.unsplash.objects(), + }, + { + categoryIds: ['cat1'], + author: jennyRostock, + }, + ), + ), ) - await Factory.buildList( - 'comment', - 6, - {}, - { - author: jennyRostock, - postId: 'p2', - }, + await Promise.all( + [...Array(6).keys()].map(() => + Factory.build( + 'comment', + {}, + { + author: jennyRostock, + postId: 'p2', + }, + ), + ), ) - await Factory.buildList( - 'comment', - 4, - {}, - { - author: jennyRostock, - postId: 'p15', - }, + await Promise.all( + [...Array(4).keys()].map(() => + Factory.build( + 'comment', + 4, + {}, + { + author: jennyRostock, + postId: 'p15', + }, + ), + ), ) - await Factory.buildList( - 'comment', - 2, - {}, - { - author: jennyRostock, - postId: 'p4', - }, + await Promise.all( + [...Array(2).keys()].map(() => + Factory.build( + 'comment', + {}, + { + author: jennyRostock, + postId: 'p4', + }, + ), + ), ) - await Factory.buildList( - 'post', - 21, - { - image: faker.image.unsplash.buildings(), - }, - { - author: peterLustig, - }, + await Promise.all( + [...Array(21).keys()].map(() => + Factory.build( + 'post', + { + image: faker.image.unsplash.buildings(), + }, + { + author: peterLustig, + }, + ), + ), ) - await Factory.buildList( - 'comment', - 3, - {}, - { - author: peterLustig, - postId: 'p4', - }, + await Promise.all( + [...Array(3).keys()].map(() => + Factory.build( + 'comment', + {}, + { + author: peterLustig, + postId: 'p4', + }, + ), + ), ) - await Factory.buildList( - 'comment', - 5, - {}, - { - author: peterLustig, - postId: 'p14', - }, + await Promise.all( + [...Array(3).keys()].map(() => + Factory.build( + 'comment', + {}, + { + author: peterLustig, + postId: 'p14', + }, + ), + ), ) - await Factory.buildList( - 'comment', - 6, - {}, - { - author: peterLustig, - postId: 'p0', - }, + await Promise.all( + [...Array(6).keys()].map(() => + Factory.build( + 'comment', + {}, + { + author: peterLustig, + postId: 'p0', + }, + ), + ), ) - await Factory.buildList( - 'post', - 11, - { - image: faker.image.unsplash.food(), - }, - { - author: dewey, - }, + await Promise.all( + [...Array(11).keys()].map(() => + Factory.build( + 'post', + { + image: faker.image.unsplash.food(), + }, + { + author: dewey, + }, + ), + ), ) - await Factory.buildList( - 'comment', - 7, - {}, - { - author: dewey, - postId: 'p2', - }, + await Promise.all( + [...Array(7).keys()].map(() => + Factory.build( + 'comment', + {}, + { + author: dewey, + postId: 'p2', + }, + ), + ), ) - await Factory.buildList( - 'comment', - 5, - {}, - { - author: dewey, - postId: 'p6', - }, + await Promise.all( + [...Array(5).keys()].map(() => + Factory.build( + 'comment', + {}, + { + author: dewey, + postId: 'p6', + }, + ), + ), ) - await Factory.buildList( - 'comment', - 2, - {}, - { - author: dewey, - postId: 'p9', - }, + await Promise.all( + [...Array(2).keys()].map(() => + Factory.build( + 'comment', + {}, + { + author: dewey, + postId: 'p9', + }, + ), + ), ) - await Factory.buildList( - 'post', - 16, - { - image: faker.image.unsplash.technology(), - }, - { - author: louie, - }, + await Promise.all( + [...Array(16).keys()].map(() => + Factory.build( + 'post', + { + image: faker.image.unsplash.technology(), + }, + { + author: louie, + }, + ), + ), ) - await Factory.buildList( - 'comment', - 4, - {}, - { - postId: 'p1', - author: louie, - }, + await Promise.all( + [...Array(4).keys()].map(() => + Factory.build( + 'comment', + {}, + { + postId: 'p1', + author: louie, + }, + ), + ), ) - await Factory.buildList( - 'comment', - 8, - {}, - { - author: louie, - postId: 'p10', - }, + await Promise.all( + [...Array(8).keys()].map(() => + Factory.build( + 'comment', + {}, + { + author: louie, + postId: 'p10', + }, + ), + ), ) - await Factory.buildList( - 'comment', - 5, - {}, - { - author: louie, - postId: 'p13', - }, + await Promise.all( + [...Array(5).keys()].map(() => + Factory.build( + 'comment', + {}, + { + author: louie, + postId: 'p13', + }, + ), + ), ) - await Factory.buildList( - 'post', - 45, - { - image: faker.image.unsplash.people(), - }, - { - author: bobDerBaumeister, - }, + await Promise.all( + [...Array(45).keys()].map(() => + Factory.build( + 'post', + { + image: faker.image.unsplash.people(), + }, + { + author: bobDerBaumeister, + }, + ), + ), ) - await Factory.buildList( - 'comment', - 2, - {}, - { - author: bobDerBaumeister, - postId: 'p2', - }, + await Promise.all( + [...Array(2).keys()].map(() => + Factory.build( + 'comment', + {}, + { + author: bobDerBaumeister, + postId: 'p2', + }, + ), + ), ) - await Factory.buildList( - 'comment', - 3, - {}, - { - author: bobDerBaumeister, - postId: 'p12', - }, + await Promise.all( + [...Array(3).keys()].map(() => + Factory.build( + 'comment', + {}, + { + author: bobDerBaumeister, + postId: 'p12', + }, + ), + ), ) - await Factory.buildList( - 'comment', - 7, - {}, - { - author: bobDerBaumeister, - postId: 'p13', - }, + await Promise.all( + [...Array(7).keys()].map(() => + Factory.build( + 'comment', + {}, + { + author: bobDerBaumeister, + postId: 'p13', + }, + ), + ), ) - await Factory.buildList( - 'post', - 8, - { - image: faker.image.unsplash.nature(), - }, - { - author: huey, - }, + await Promise.all( + [...Array(8).keys()].map(() => + Factory.build( + 'post', + { + image: faker.image.unsplash.nature(), + }, + { + author: huey, + }, + ), + ), ) - await Factory.buildList( - 'comment', - 6, - {}, - { - author: huey, - postId: 'p0', - }, + await Promise.all( + [...Array(6).keys()].map(() => + Factory.build( + 'comment', + {}, + { + author: huey, + postId: 'p0', + }, + ), + ), ) - await Factory.buildList( - 'comment', - 8, - {}, - { - author: huey, - postId: 'p13', - }, + await Promise.all( + [...Array(8).keys()].map(() => + Factory.build( + 'comment', + {}, + { + author: huey, + postId: 'p13', + }, + ), + ), ) - await Factory.buildList( - 'comment', - 9, - {}, - { - author: huey, - postId: 'p15', - }, + await Promise.all( + [...Array(8).keys()].map(() => + Factory.build( + 'comment', + {}, + { + author: huey, + postId: 'p15', + }, + ), + ), ) await Factory.build('donations') From 6271b53b30153f01a5c86931d7bc28fecaa761db Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Fri, 7 Feb 2020 14:48:55 +0100 Subject: [PATCH 077/281] Set up Subscriptions with RedisPubSub --- backend/package.json | 2 + backend/src/config/index.js | 6 +- .../notifications/notificationsMiddleware.js | 2 +- backend/src/schema/resolvers/notifications.js | 5 +- backend/src/server.js | 23 +++++++ backend/yarn.lock | 66 +++++++++++++++++++ 6 files changed, 98 insertions(+), 6 deletions(-) diff --git a/backend/package.json b/backend/package.json index b7d74c102..a4b8eb032 100644 --- a/backend/package.json +++ b/backend/package.json @@ -60,9 +60,11 @@ "graphql-iso-date": "~3.6.1", "graphql-middleware": "~4.0.2", "graphql-middleware-sentry": "^3.2.1", + "graphql-redis-subscriptions": "^2.1.2", "graphql-shield": "~7.0.9", "graphql-tag": "~2.10.2", "helmet": "~3.21.2", + "ioredis": "^4.14.1", "jsonwebtoken": "~8.5.1", "linkifyjs": "~2.1.8", "lodash": "~4.17.14", diff --git a/backend/src/config/index.js b/backend/src/config/index.js index 2f8d0ed22..8bbff8817 100644 --- a/backend/src/config/index.js +++ b/backend/src/config/index.js @@ -20,6 +20,9 @@ const { NEO4J_PASSWORD = 'neo4j', CLIENT_URI = 'http://localhost:3000', GRAPHQL_URI = 'http://localhost:4000', + REDIS_DOMAIN, + REDIS_PORT, + REDIS_PASSWORD, } = process.env export const requiredConfigs = { @@ -58,7 +61,7 @@ export const developmentConfigs = { } export const sentryConfigs = { SENTRY_DSN_BACKEND, COMMIT } - +export const redisConfiig = { REDIS_DOMAIN, REDIS_PORT, REDIS_PASSWORD } export default { ...requiredConfigs, ...smtpConfigs, @@ -66,4 +69,5 @@ export default { ...serverConfigs, ...developmentConfigs, ...sentryConfigs, + ...redisConfiig, } diff --git a/backend/src/middleware/notifications/notificationsMiddleware.js b/backend/src/middleware/notifications/notificationsMiddleware.js index 11337468c..4636b8e9f 100644 --- a/backend/src/middleware/notifications/notificationsMiddleware.js +++ b/backend/src/middleware/notifications/notificationsMiddleware.js @@ -1,6 +1,6 @@ import extractMentionedUsers from './mentions/extractMentionedUsers' import { validateNotifyUsers } from '../validation/validationMiddleware' -import { pubsub, NOTIFICATION_ADDED } from '../../schema/resolvers/notifications' +import { pubsub, NOTIFICATION_ADDED } from '../../server' const handleContentDataOfPost = async (resolve, root, args, context, resolveInfo) => { const idsOfUsers = extractMentionedUsers(args.content) diff --git a/backend/src/schema/resolvers/notifications.js b/backend/src/schema/resolvers/notifications.js index 116ac3e0e..cf35fa8a1 100644 --- a/backend/src/schema/resolvers/notifications.js +++ b/backend/src/schema/resolvers/notifications.js @@ -1,9 +1,6 @@ import log from './helpers/databaseLogger' -import { PubSub } from 'apollo-server' import { withFilter } from 'graphql-subscriptions' - -export const pubsub = new PubSub() -export const NOTIFICATION_ADDED = 'NOTIFICATION_ADDED' +import { pubsub, NOTIFICATION_ADDED } from '../../server' export default { Subscription: { diff --git a/backend/src/server.js b/backend/src/server.js index b7e751bae..4c02b8ddb 100644 --- a/backend/src/server.js +++ b/backend/src/server.js @@ -9,7 +9,30 @@ import { getNeode, getDriver } from './db/neo4j' import decode from './jwt/decode' import schema from './schema' import webfinger from './activitypub/routes/webfinger' +import { RedisPubSub } from 'graphql-redis-subscriptions' +import Redis from 'ioredis' +export const NOTIFICATION_ADDED = 'NOTIFICATION_ADDED' +const { REDIS_DOMAIN, REDIS_PORT, REDIS_PASSWORD } = CONFIG +let prodPubsub, devPubsub +const options = { + host: REDIS_DOMAIN, + port: REDIS_PORT, + password: REDIS_PASSWORD, + retryStrategy: times => { + return Math.min(times * 50, 2000) + }, +} + +if (options.host && options.port && options.password) { + prodPubsub = new RedisPubSub({ + publisher: new Redis(options), + subscriber: new Redis(options), + }) +} else { + devPubsub = new RedisPubSub() +} +export const pubsub = prodPubsub || devPubsub const driver = getDriver() const neode = getNeode() diff --git a/backend/yarn.lock b/backend/yarn.lock index 68e70fea6..eebe5c73b 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -2774,6 +2774,11 @@ clone-response@^1.0.2: dependencies: mimic-response "^1.0.0" +cluster-key-slot@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/cluster-key-slot/-/cluster-key-slot-1.1.0.tgz#30474b2a981fb12172695833052bc0d01336d10d" + integrity sha512-2Nii8p3RwAPiFwsnZvukotvow2rIHM+yQ6ZcBXGHdniadkYGZYiGmkHJIbZPIV9nfv7m/U1IPMVVcAhoWFeklw== + co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -3254,6 +3259,11 @@ delegates@^1.0.0: resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= +denque@^1.1.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/denque/-/denque-1.4.1.tgz#6744ff7641c148c3f8a69c307e51235c1f4a37cf" + integrity sha512-OfzPuSZKGcgr96rf1oODnfjqBFmr1DVoc/TrItj3Ohe0Ah1C5WX5Baquw/9U9KovnQ88EqmJbD66rKYUQYN1tQ== + depd@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" @@ -4476,6 +4486,15 @@ graphql-middleware@~4.0.2: dependencies: graphql-tools "^4.0.5" +graphql-redis-subscriptions@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/graphql-redis-subscriptions/-/graphql-redis-subscriptions-2.1.2.tgz#9c1b744bace0c6ba99dd0ebafe0148cad1df3301" + integrity sha512-l69KbGxyYfVHxvE+Dzv9/hXg/q+Xnjfx1JsrJD6ikePuSsNaCSNxr+MubSTNF3Gt3C/+JZs4FaWImFeK/+X2og== + dependencies: + iterall "^1.2.2" + optionalDependencies: + ioredis "^4.6.3" + graphql-shield@~7.0.9: version "7.0.9" resolved "https://registry.yarnpkg.com/graphql-shield/-/graphql-shield-7.0.9.tgz#8248916e9636a7e3c05719a52fd13f2d37ccaeb2" @@ -4920,6 +4939,21 @@ invariant@^2.2.2, invariant@^2.2.4: dependencies: loose-envify "^1.0.0" +ioredis@^4.14.1, ioredis@^4.6.3: + version "4.14.1" + resolved "https://registry.yarnpkg.com/ioredis/-/ioredis-4.14.1.tgz#b73ded95fcf220f106d33125a92ef6213aa31318" + integrity sha512-94W+X//GHM+1GJvDk6JPc+8qlM7Dul+9K+lg3/aHixPN7ZGkW6qlvX0DG6At9hWtH2v3B32myfZqWoANUJYGJA== + dependencies: + cluster-key-slot "^1.1.0" + debug "^4.1.1" + denque "^1.1.0" + lodash.defaults "^4.2.0" + lodash.flatten "^4.4.0" + redis-commands "1.5.0" + redis-errors "^1.2.0" + redis-parser "^3.0.0" + standard-as-callback "^2.0.1" + ip-regex@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-1.0.3.tgz#dc589076f659f419c222039a33316f1c7387effd" @@ -5960,11 +5994,21 @@ lodash.clonedeep@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= +lodash.defaults@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c" + integrity sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw= + lodash.escaperegexp@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz#64762c48618082518ac3df4ccf5d5886dae20347" integrity sha1-ZHYsSGGAglGKw99Mz11YhtriA0c= +lodash.flatten@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f" + integrity sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8= + lodash.includes@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/lodash.includes/-/lodash.includes-4.3.0.tgz#60bb98a87cb923c68ca1e51325483314849f553f" @@ -7506,6 +7550,23 @@ realpath-native@^1.1.0: dependencies: util.promisify "^1.0.0" +redis-commands@1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/redis-commands/-/redis-commands-1.5.0.tgz#80d2e20698fe688f227127ff9e5164a7dd17e785" + integrity sha512-6KxamqpZ468MeQC3bkWmCB1fp56XL64D4Kf0zJSwDZbVLLm7KFkoIcHrgRvQ+sk8dnhySs7+yBg94yIkAK7aJg== + +redis-errors@^1.0.0, redis-errors@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/redis-errors/-/redis-errors-1.2.0.tgz#eb62d2adb15e4eaf4610c04afe1529384250abad" + integrity sha1-62LSrbFeTq9GEMBK/hUpOEJQq60= + +redis-parser@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/redis-parser/-/redis-parser-3.0.0.tgz#b66d828cdcafe6b4b8a428a7def4c6bcac31c8b4" + integrity sha1-tm2CjNyv5rS4pCin3vTGvKwxyLQ= + dependencies: + redis-errors "^1.0.0" + referrer-policy@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/referrer-policy/-/referrer-policy-1.2.0.tgz#b99cfb8b57090dc454895ef897a4cc35ef67a98e" @@ -8203,6 +8264,11 @@ stacktrace-js@^2.0.0: stack-generator "^2.0.1" stacktrace-gps "^3.0.1" +standard-as-callback@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/standard-as-callback/-/standard-as-callback-2.0.1.tgz#ed8bb25648e15831759b6023bdb87e6b60b38126" + integrity sha512-NQOxSeB8gOI5WjSaxjBgog2QFw55FV8TkS6Y07BiB3VJ8xNTvUYm0wl0s8ObgQ5NhdpnNfigMIKjgPESzgr4tg== + static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" From 069c637c844f23383997ae7e686aa3a54dd16980 Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Fri, 7 Feb 2020 15:10:45 +0100 Subject: [PATCH 078/281] Run yarn install to update yarn.lock --- backend/yarn.lock | 68 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/backend/yarn.lock b/backend/yarn.lock index 819b215c5..a3011433e 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -1943,7 +1943,7 @@ apollo-server-caching@^0.5.1: dependencies: lru-cache "^5.0.0" -apollo-server-core@^2.10.0, apollo-server-core@^2.9.16: +apollo-server-core@^2.10.0: version "2.10.0" resolved "https://registry.yarnpkg.com/apollo-server-core/-/apollo-server-core-2.10.0.tgz#b8d51bdffe6529f0e3ca670ee8f1238765cfade4" integrity sha512-x/UK6XvU307W8D/pzTclU04JIjRarcbg5mFPe0nVmO4OTc26uQgKi1WlZkcewXsAUnn+nDwKVn2c2G3dHEgXzQ== @@ -2774,6 +2774,11 @@ clone-response@^1.0.2: dependencies: mimic-response "^1.0.0" +cluster-key-slot@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/cluster-key-slot/-/cluster-key-slot-1.1.0.tgz#30474b2a981fb12172695833052bc0d01336d10d" + integrity sha512-2Nii8p3RwAPiFwsnZvukotvow2rIHM+yQ6ZcBXGHdniadkYGZYiGmkHJIbZPIV9nfv7m/U1IPMVVcAhoWFeklw== + co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -3254,6 +3259,11 @@ delegates@^1.0.0: resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= +denque@^1.1.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/denque/-/denque-1.4.1.tgz#6744ff7641c148c3f8a69c307e51235c1f4a37cf" + integrity sha512-OfzPuSZKGcgr96rf1oODnfjqBFmr1DVoc/TrItj3Ohe0Ah1C5WX5Baquw/9U9KovnQ88EqmJbD66rKYUQYN1tQ== + depd@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" @@ -4476,6 +4486,15 @@ graphql-middleware@~4.0.2: dependencies: graphql-tools "^4.0.5" +graphql-redis-subscriptions@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/graphql-redis-subscriptions/-/graphql-redis-subscriptions-2.1.2.tgz#9c1b744bace0c6ba99dd0ebafe0148cad1df3301" + integrity sha512-l69KbGxyYfVHxvE+Dzv9/hXg/q+Xnjfx1JsrJD6ikePuSsNaCSNxr+MubSTNF3Gt3C/+JZs4FaWImFeK/+X2og== + dependencies: + iterall "^1.2.2" + optionalDependencies: + ioredis "^4.6.3" + graphql-shield@~7.0.10: version "7.0.10" resolved "https://registry.yarnpkg.com/graphql-shield/-/graphql-shield-7.0.10.tgz#c25517a07e97bfd74089fde66ea2d2044addf743" @@ -4920,6 +4939,21 @@ invariant@^2.2.2, invariant@^2.2.4: dependencies: loose-envify "^1.0.0" +ioredis@^4.14.1, ioredis@^4.6.3: + version "4.14.1" + resolved "https://registry.yarnpkg.com/ioredis/-/ioredis-4.14.1.tgz#b73ded95fcf220f106d33125a92ef6213aa31318" + integrity sha512-94W+X//GHM+1GJvDk6JPc+8qlM7Dul+9K+lg3/aHixPN7ZGkW6qlvX0DG6At9hWtH2v3B32myfZqWoANUJYGJA== + dependencies: + cluster-key-slot "^1.1.0" + debug "^4.1.1" + denque "^1.1.0" + lodash.defaults "^4.2.0" + lodash.flatten "^4.4.0" + redis-commands "1.5.0" + redis-errors "^1.2.0" + redis-parser "^3.0.0" + standard-as-callback "^2.0.1" + ip-regex@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-1.0.3.tgz#dc589076f659f419c222039a33316f1c7387effd" @@ -5960,11 +5994,21 @@ lodash.clonedeep@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= +lodash.defaults@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c" + integrity sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw= + lodash.escaperegexp@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz#64762c48618082518ac3df4ccf5d5886dae20347" integrity sha1-ZHYsSGGAglGKw99Mz11YhtriA0c= +lodash.flatten@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f" + integrity sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8= + lodash.includes@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/lodash.includes/-/lodash.includes-4.3.0.tgz#60bb98a87cb923c68ca1e51325483314849f553f" @@ -7506,6 +7550,23 @@ realpath-native@^1.1.0: dependencies: util.promisify "^1.0.0" +redis-commands@1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/redis-commands/-/redis-commands-1.5.0.tgz#80d2e20698fe688f227127ff9e5164a7dd17e785" + integrity sha512-6KxamqpZ468MeQC3bkWmCB1fp56XL64D4Kf0zJSwDZbVLLm7KFkoIcHrgRvQ+sk8dnhySs7+yBg94yIkAK7aJg== + +redis-errors@^1.0.0, redis-errors@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/redis-errors/-/redis-errors-1.2.0.tgz#eb62d2adb15e4eaf4610c04afe1529384250abad" + integrity sha1-62LSrbFeTq9GEMBK/hUpOEJQq60= + +redis-parser@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/redis-parser/-/redis-parser-3.0.0.tgz#b66d828cdcafe6b4b8a428a7def4c6bcac31c8b4" + integrity sha1-tm2CjNyv5rS4pCin3vTGvKwxyLQ= + dependencies: + redis-errors "^1.0.0" + referrer-policy@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/referrer-policy/-/referrer-policy-1.2.0.tgz#b99cfb8b57090dc454895ef897a4cc35ef67a98e" @@ -8203,6 +8264,11 @@ stacktrace-js@^2.0.0: stack-generator "^2.0.1" stacktrace-gps "^3.0.1" +standard-as-callback@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/standard-as-callback/-/standard-as-callback-2.0.1.tgz#ed8bb25648e15831759b6023bdb87e6b60b38126" + integrity sha512-NQOxSeB8gOI5WjSaxjBgog2QFw55FV8TkS6Y07BiB3VJ8xNTvUYm0wl0s8ObgQ5NhdpnNfigMIKjgPESzgr4tg== + static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" From a77f8d92bc6b590beb77fe081fbe69c9b75a90a6 Mon Sep 17 00:00:00 2001 From: roschaefer Date: Sat, 8 Feb 2020 17:55:07 +0100 Subject: [PATCH 079/281] Speed up factories a little --- backend/src/db/seed.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/backend/src/db/seed.js b/backend/src/db/seed.js index 32a20145b..f966f8b07 100644 --- a/backend/src/db/seed.js +++ b/backend/src/db/seed.js @@ -475,8 +475,8 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] imageBlurred: true, }, { - author: dewey, categoryIds: ['cat10'], + author: dewey, }, ), Factory.build( @@ -499,8 +499,8 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] language: sample(languages), }, { - author: bobDerBaumeister, categoryIds: ['cat13'], + author: bobDerBaumeister, }, ), Factory.build( @@ -512,8 +512,8 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] imageAspectRatio: 300 / 450, }, { - author: jennyRostock, categoryIds: ['cat14'], + author: jennyRostock, }, ), Factory.build( @@ -523,8 +523,8 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] language: sample(languages), }, { - author: huey, categoryIds: ['cat15'], + author: huey, }, ), ]) @@ -998,6 +998,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] image: faker.image.unsplash.buildings(), }, { + categoryIds: ['cat1'], author: peterLustig, }, ), @@ -1051,6 +1052,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] image: faker.image.unsplash.food(), }, { + categoryIds: ['cat1'], author: dewey, }, ), @@ -1104,6 +1106,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] image: faker.image.unsplash.technology(), }, { + categoryIds: ['cat1'], author: louie, }, ), @@ -1157,6 +1160,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] image: faker.image.unsplash.people(), }, { + categoryIds: ['cat1'], author: bobDerBaumeister, }, ), @@ -1210,6 +1214,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] image: faker.image.unsplash.nature(), }, { + categoryIds: ['cat1'], author: huey, }, ), From 38088235789b6aa4caed80d8268895958fae5d07 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2020 04:16:48 +0000 Subject: [PATCH 080/281] build(deps-dev): bump codecov from 3.6.4 to 3.6.5 Bumps [codecov](https://github.com/codecov/codecov-node) from 3.6.4 to 3.6.5. - [Release notes](https://github.com/codecov/codecov-node/releases) - [Commits](https://github.com/codecov/codecov-node/commits) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index caed8a5b2..1234d09be 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "@babel/register": "^7.8.3", "auto-changelog": "^1.16.2", "bcryptjs": "^2.4.3", - "codecov": "^3.6.4", + "codecov": "^3.6.5", "cross-env": "^6.0.3", "cucumber": "^6.0.5", "cypress": "^3.8.3", diff --git a/yarn.lock b/yarn.lock index f6fae5cc5..cf51f0b46 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2020,17 +2020,16 @@ code-point-at@^1.0.0: resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= -codecov@^3.6.4: - version "3.6.4" - resolved "https://registry.yarnpkg.com/codecov/-/codecov-3.6.4.tgz#c993a58704ad5f15dcdd6aa3c3af22070c69eb18" - integrity sha512-R9zEcTR5/IDLepdGUHAkRMZOIKhBE1NRGS1N2H96zhBOskhdW9Q22GtYYyecbZL1aheU00D2F21nNBGRISui0A== +codecov@^3.6.5: + version "3.6.5" + resolved "https://registry.yarnpkg.com/codecov/-/codecov-3.6.5.tgz#d73ce62e8a021f5249f54b073e6f2d6a513f172a" + integrity sha512-v48WuDMUug6JXwmmfsMzhCHRnhUf8O3duqXvltaYJKrO1OekZWpB/eH6iIoaxMl8Qli0+u3OxptdsBOYiD7VAQ== dependencies: argv "0.0.2" ignore-walk "3.0.3" js-yaml "3.13.1" teeny-request "6.0.1" urlgrey "0.4.4" - validator "12.2.0" coffeeify@3.0.1: version "3.0.1" @@ -6868,11 +6867,6 @@ validate-npm-package-license@^3.0.1: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" -validator@12.2.0: - version "12.2.0" - resolved "https://registry.yarnpkg.com/validator/-/validator-12.2.0.tgz#660d47e96267033fd070096c3b1a6f2db4380a0a" - integrity sha512-jJfE/DW6tIK1Ek8nCfNFqt8Wb3nzMoAbocBF6/Icgg1ZFSBpObdnwVY2jQj6qUqzhx5jc71fpvBWyLGO7Xl+nQ== - verror@1.10.0, verror@^1.9.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" From 64d90e5311139e8fdcb1d954b35004073ba8dc0b Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2020 04:17:22 +0000 Subject: [PATCH 081/281] build(deps): bump graphql-shield from 7.0.10 to 7.0.11 in /backend Bumps [graphql-shield](https://github.com/maticzav/graphql-shield) from 7.0.10 to 7.0.11. - [Release notes](https://github.com/maticzav/graphql-shield/releases) - [Commits](https://github.com/maticzav/graphql-shield/compare/v7.0.10...v7.0.11) Signed-off-by: dependabot-preview[bot] --- backend/package.json | 2 +- backend/yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/package.json b/backend/package.json index ae4ae0804..50c5e1011 100644 --- a/backend/package.json +++ b/backend/package.json @@ -60,7 +60,7 @@ "graphql-iso-date": "~3.6.1", "graphql-middleware": "~4.0.2", "graphql-middleware-sentry": "^3.2.1", - "graphql-shield": "~7.0.10", + "graphql-shield": "~7.0.11", "graphql-tag": "~2.10.3", "helmet": "~3.21.2", "jsonwebtoken": "~8.5.1", diff --git a/backend/yarn.lock b/backend/yarn.lock index 819b215c5..4df5537a1 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -1943,7 +1943,7 @@ apollo-server-caching@^0.5.1: dependencies: lru-cache "^5.0.0" -apollo-server-core@^2.10.0, apollo-server-core@^2.9.16: +apollo-server-core@^2.10.0: version "2.10.0" resolved "https://registry.yarnpkg.com/apollo-server-core/-/apollo-server-core-2.10.0.tgz#b8d51bdffe6529f0e3ca670ee8f1238765cfade4" integrity sha512-x/UK6XvU307W8D/pzTclU04JIjRarcbg5mFPe0nVmO4OTc26uQgKi1WlZkcewXsAUnn+nDwKVn2c2G3dHEgXzQ== @@ -4476,10 +4476,10 @@ graphql-middleware@~4.0.2: dependencies: graphql-tools "^4.0.5" -graphql-shield@~7.0.10: - version "7.0.10" - resolved "https://registry.yarnpkg.com/graphql-shield/-/graphql-shield-7.0.10.tgz#c25517a07e97bfd74089fde66ea2d2044addf743" - integrity sha512-m1HPQ3DpzuW8b7derWcsjjYtiBk+Hjgb1eL/0YK/Y2A0EV7vDQzJwRzlIwn9My7Xv+F4DJwm25yydnnUNpZt8g== +graphql-shield@~7.0.11: + version "7.0.11" + resolved "https://registry.yarnpkg.com/graphql-shield/-/graphql-shield-7.0.11.tgz#78d49f346326be71090d35d8f5843da9ee8136e2" + integrity sha512-iWn/aiom2c8NuOj60euWTmsKKUjX1DB4ynBcDitQOLXG3WrWgss2Iolzr553qooJvkR5czeAFgPlZgI+nUgwsQ== dependencies: "@types/yup" "0.26.30" object-hash "^2.0.0" From 7a3cd7546918750783799a7852c413aa00bd20e3 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2020 04:18:27 +0000 Subject: [PATCH 082/281] build(deps-dev): bump eslint-plugin-jest in /backend Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 23.6.0 to 23.7.0. - [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases) - [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/master/CHANGELOG.md) - [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v23.6.0...v23.7.0) Signed-off-by: dependabot-preview[bot] --- backend/package.json | 2 +- backend/yarn.lock | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/backend/package.json b/backend/package.json index ae4ae0804..a4452ca12 100644 --- a/backend/package.json +++ b/backend/package.json @@ -119,7 +119,7 @@ "eslint-config-prettier": "~6.10.0", "eslint-config-standard": "~14.1.0", "eslint-plugin-import": "~2.20.1", - "eslint-plugin-jest": "~23.6.0", + "eslint-plugin-jest": "~23.7.0", "eslint-plugin-node": "~11.0.0", "eslint-plugin-prettier": "~3.1.2", "eslint-plugin-promise": "~4.2.1", diff --git a/backend/yarn.lock b/backend/yarn.lock index 819b215c5..ef6ca77e4 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -1943,7 +1943,7 @@ apollo-server-caching@^0.5.1: dependencies: lru-cache "^5.0.0" -apollo-server-core@^2.10.0, apollo-server-core@^2.9.16: +apollo-server-core@^2.10.0: version "2.10.0" resolved "https://registry.yarnpkg.com/apollo-server-core/-/apollo-server-core-2.10.0.tgz#b8d51bdffe6529f0e3ca670ee8f1238765cfade4" integrity sha512-x/UK6XvU307W8D/pzTclU04JIjRarcbg5mFPe0nVmO4OTc26uQgKi1WlZkcewXsAUnn+nDwKVn2c2G3dHEgXzQ== @@ -3643,13 +3643,12 @@ eslint-plugin-import@~2.20.1: read-pkg-up "^2.0.0" resolve "^1.12.0" -eslint-plugin-jest@~23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-23.6.0.tgz#508b32f80d44058c8c01257c0ee718cfbd521e9d" - integrity sha512-GH8AhcFXspOLqak7fqnddLXEJsrFyvgO8Bm60SexvKSn1+3rWYESnCiWUOCUcBTprNSDSE4CtAZdM4EyV6gPPw== +eslint-plugin-jest@~23.7.0: + version "23.7.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-23.7.0.tgz#84d5603b6e745b59898cb6750df6a44782a39b04" + integrity sha512-zkiyGlvJeHNjAEz8FaIxTXNblJJ/zj3waNbYbgflK7K6uy0cpE5zJBt/JpJtOBGM/UGkC6BqsQ4n0y7kQ2HA8w== dependencies: "@typescript-eslint/experimental-utils" "^2.5.0" - micromatch "^4.0.2" eslint-plugin-node@~11.0.0: version "11.0.0" From e8410a62dce3457584e163cddca9f009309a7aae Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2020 04:31:28 +0000 Subject: [PATCH 083/281] build(deps-dev): bump @vue/cli-shared-utils in /webapp Bumps [@vue/cli-shared-utils](https://github.com/vuejs/vue-cli/tree/HEAD/packages/@vue/cli-shared-utils) from 4.1.2 to 4.2.2. - [Release notes](https://github.com/vuejs/vue-cli/releases) - [Changelog](https://github.com/vuejs/vue-cli/blob/dev/CHANGELOG.md) - [Commits](https://github.com/vuejs/vue-cli/commits/v4.2.2/packages/@vue/cli-shared-utils) Signed-off-by: dependabot-preview[bot] --- webapp/package.json | 2 +- webapp/yarn.lock | 31 ++++++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/webapp/package.json b/webapp/package.json index 620a53165..0d36bef1d 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -103,7 +103,7 @@ "@storybook/addon-actions": "^5.3.12", "@storybook/addon-notes": "^5.3.12", "@storybook/vue": "~5.3.12", - "@vue/cli-shared-utils": "~4.1.2", + "@vue/cli-shared-utils": "~4.2.2", "@vue/eslint-config-prettier": "~6.0.0", "@vue/server-test-utils": "~1.0.0-beta.31", "@vue/test-utils": "~1.0.0-beta.31", diff --git a/webapp/yarn.lock b/webapp/yarn.lock index 63f1b4bd8..d5d6cf14b 100644 --- a/webapp/yarn.lock +++ b/webapp/yarn.lock @@ -2821,6 +2821,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.6.tgz#9cbfcb62c50947217f4d88d4d274cc40c22625a9" integrity sha512-Fvm24+u85lGmV4hT5G++aht2C5I4Z4dYlWZIh62FAfFO/TfzXtPpoLI6I7AuBWkIFqZCnhFOoTT7RjjaIL5Fjg== +"@types/normalize-package-data@^2.4.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" + integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== + "@types/npmlog@^4.1.2": version "4.1.2" resolved "https://registry.yarnpkg.com/@types/npmlog/-/npmlog-4.1.2.tgz#d070fe6a6b78755d1092a3dc492d34c3d8f871c4" @@ -3025,10 +3030,10 @@ "@vue/babel-plugin-transform-vue-jsx" "^1.1.2" camelcase "^5.0.0" -"@vue/cli-shared-utils@~4.1.2": - version "4.1.2" - resolved "https://registry.yarnpkg.com/@vue/cli-shared-utils/-/cli-shared-utils-4.1.2.tgz#d33984c8790ad869ef77f5229abd3e8e584fe58b" - integrity sha512-uQAVqxCWdL5ipZ0TPu6SVsdokQp4yHt8SzzpUGhq8TkW4vwalGddJAAJrqZHMl91ZTIJ4p4ixofmCaaJo5rSRA== +"@vue/cli-shared-utils@~4.2.2": + version "4.2.2" + resolved "https://registry.yarnpkg.com/@vue/cli-shared-utils/-/cli-shared-utils-4.2.2.tgz#953fec34115cb12d0820012a9d7400f8c27d6660" + integrity sha512-EK5wcxgjadqUpSzfh6Bnxd46Zx+SAaHusygqV11UZKHr4EObc/SjCpq7c7drmFkBjRqmVvrHs4jRnJJo5VgCgQ== dependencies: "@hapi/joi" "^15.0.1" chalk "^2.4.2" @@ -3038,6 +3043,7 @@ node-ipc "^9.1.1" open "^6.3.0" ora "^3.4.0" + read-pkg "^5.1.1" request "^2.87.0" request-promise-native "^1.0.8" semver "^6.1.0" @@ -11582,7 +11588,7 @@ nopt@~1.0.10: dependencies: abbrev "1" -normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: +normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package-data@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== @@ -13811,6 +13817,16 @@ read-pkg@^2.0.0: normalize-package-data "^2.3.2" path-type "^2.0.0" +read-pkg@^5.1.1: + version "5.2.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" + integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== + dependencies: + "@types/normalize-package-data" "^2.4.0" + normalize-package-data "^2.5.0" + parse-json "^5.0.0" + type-fest "^0.6.0" + "readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" @@ -15952,6 +15968,11 @@ type-fest@^0.5.2: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.5.2.tgz#d6ef42a0356c6cd45f49485c3b6281fc148e48a2" integrity sha512-DWkS49EQKVX//Tbupb9TFa19c7+MK1XmzkrZUR8TAktmE/DizXoaoJV6TZ/tSIPXipqNiRI6CyAe7x69Jb6RSw== +type-fest@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" + integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== + type-fest@^0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.0.tgz#ee92ee2ec95479869dec66d17d9698666b90f29d" From 8f6d71e4bead5172cc765dce46425c9bafcc14ed Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Mon, 10 Feb 2020 10:46:55 +0100 Subject: [PATCH 084/281] Update helm charts --- deployment/.gitignore | 2 ++ deployment/helm/human-connection/README.md | 2 +- .../human-connection/templates/volumes/pvc-neo4j-data.yaml | 2 +- .../human-connection/templates/volumes/pvc-uploads.yaml | 6 +++++- deployment/volumes/neo4j-data.yaml | 2 +- deployment/volumes/uploads.yaml | 2 +- deployment/volumes/volume-snapshots/snapshot.yaml | 4 ++-- 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/deployment/.gitignore b/deployment/.gitignore index 14cfa18ed..61e591624 100644 --- a/deployment/.gitignore +++ b/deployment/.gitignore @@ -2,3 +2,5 @@ secrets.yaml configmap.yaml **/secrets.yaml **/configmap.yaml +**/staging-values.yaml +**/production-values.yaml \ No newline at end of file diff --git a/deployment/helm/human-connection/README.md b/deployment/helm/human-connection/README.md index 55859a77c..444f9da15 100644 --- a/deployment/helm/human-connection/README.md +++ b/deployment/helm/human-connection/README.md @@ -64,7 +64,7 @@ $ helm install cert-manager --namespace cert-manager --version v0.13.0 jetstack/ Once you are satisfied with the configuration, you can install the app. ```bash -# in folder /deployment/helm +# in folder /deployment/helm/human-connection $ helm install develop ./ --namespace human-connection ``` Where `develop` is the release name, in this case develop for our develop server and `human-connection` is the namespace, again customize for your needs. The release name can be anything you want. Just keep in mind that it is used in the templates to prepend the `CLIENT_URI` and other places. diff --git a/deployment/helm/human-connection/templates/volumes/pvc-neo4j-data.yaml b/deployment/helm/human-connection/templates/volumes/pvc-neo4j-data.yaml index e89844181..3f85d3ae8 100644 --- a/deployment/helm/human-connection/templates/volumes/pvc-neo4j-data.yaml +++ b/deployment/helm/human-connection/templates/volumes/pvc-neo4j-data.yaml @@ -7,4 +7,4 @@ spec: - ReadWriteOnce resources: requests: - storage: 5Gi + storage: {{ .Values.neo4jStorage }} diff --git a/deployment/helm/human-connection/templates/volumes/pvc-uploads.yaml b/deployment/helm/human-connection/templates/volumes/pvc-uploads.yaml index 4d2ae7627..7eb81135b 100644 --- a/deployment/helm/human-connection/templates/volumes/pvc-uploads.yaml +++ b/deployment/helm/human-connection/templates/volumes/pvc-uploads.yaml @@ -4,9 +4,13 @@ apiVersion: v1 metadata: name: uploads-claim spec: + dataSource: + name: uploads-snapshot + kind: VolumeSnapshot + apiGroup: snapshot.storage.k8s.io accessModes: - ReadWriteOnce resources: requests: - storage: 8Gi + storage: {{ .Values.uploadsStorage }} diff --git a/deployment/volumes/neo4j-data.yaml b/deployment/volumes/neo4j-data.yaml index 1f453a684..c060750ec 100644 --- a/deployment/volumes/neo4j-data.yaml +++ b/deployment/volumes/neo4j-data.yaml @@ -9,4 +9,4 @@ - ReadWriteOnce resources: requests: - storage: 5Gi + storage: {{ .Values.neo4jStorage }} diff --git a/deployment/volumes/uploads.yaml b/deployment/volumes/uploads.yaml index ce87b2184..c174bf2cb 100644 --- a/deployment/volumes/uploads.yaml +++ b/deployment/volumes/uploads.yaml @@ -9,4 +9,4 @@ - ReadWriteOnce resources: requests: - storage: 8Gi + storage: {{ .Values.uploadsStorage }} diff --git a/deployment/volumes/volume-snapshots/snapshot.yaml b/deployment/volumes/volume-snapshots/snapshot.yaml index 3c3487e14..10a22daf5 100644 --- a/deployment/volumes/volume-snapshots/snapshot.yaml +++ b/deployment/volumes/volume-snapshots/snapshot.yaml @@ -2,9 +2,9 @@ apiVersion: snapshot.storage.k8s.io/v1alpha1 kind: VolumeSnapshot metadata: - name: neo4j-data-snapshot + name: uploads-snapshot namespace: human-connection spec: source: - name: neo4j-data-claim + name: uploads-claim kind: PersistentVolumeClaim From 3b29d480e3915ad9ff30945ff8598d74588ed20c Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Mon, 10 Feb 2020 12:34:40 +0100 Subject: [PATCH 085/281] Display unblock feature only for blocking user - add hasBlocked query to check if userA initiated the blocking and, if true, only them to unblock userB. - add cypress tests to make sure we don't break this in the future. --- backend/src/schema/types/type/User.gql | 7 ++++- cypress/integration/common/steps.js | 30 +++++++++++++++++++ .../user_profile/BlockUser.feature | 11 +++++++ webapp/components/ContentMenu/ContentMenu.vue | 2 +- webapp/pages/profile/_id/_slug.vue | 4 +-- 5 files changed, 50 insertions(+), 4 deletions(-) diff --git a/backend/src/schema/types/type/User.gql b/backend/src/schema/types/type/User.gql index 71cc1edb0..ec9bfeba7 100644 --- a/backend/src/schema/types/type/User.gql +++ b/backend/src/schema/types/type/User.gql @@ -68,7 +68,12 @@ type User { RETURN COUNT(u) >= 1 """ ) - + hasBlocked: Boolean! @cypher( + statement: """ + MATCH (this)<-[:BLOCKED]-(user:User {id: $cypherParams.currentUserId}) + RETURN COUNT(user) >= 1 + """ + ) blocked: Boolean! @cypher( statement: """ MATCH (this)-[:BLOCKED]-(user:User {id: $cypherParams.currentUserId}) diff --git a/cypress/integration/common/steps.js b/cypress/integration/common/steps.js index 36dbb50d4..753160b84 100644 --- a/cypress/integration/common/steps.js +++ b/cypress/integration/common/steps.js @@ -558,6 +558,20 @@ When("I block the user {string}", name => { }); }); +When("a user has blocked me", () => { + cy.neode() + .first("User", { + name: narratorParams.name + }) + .then(blockedUser => { + cy.neode() + .first("User", { + name: 'Harassing User' + }) + .relateTo(blockedUser, "blocked"); + }); +}); + When("I log in with:", table => { const [firstRow] = table.hashes(); const { @@ -583,4 +597,20 @@ Then("they should not see the comment from", () => { Then("they should see a text explaining commenting is not possible", () => { cy.get('.ds-placeholder').should('contain', "Commenting is not possible at this time on this post.") +}) + +Then("I should see no users in my blocked users list", () => { + cy.get('.ds-placeholder') + .should('contain', "So far, you have not blocked anybody.") +}) + +Then("I should not see {string} from the content menu in the user info box", link => { + cy.get(".user-content-menu .base-button").click() + cy.get(".popover .ds-menu-item-link") + .should('not.contain', link) +}) + +Then('I should not see {string} button', button => { + cy.get('.ds-card-content') + .should('not.contain', '.action-buttons') }) \ No newline at end of file diff --git a/cypress/integration/user_profile/BlockUser.feature b/cypress/integration/user_profile/BlockUser.feature index 43efe7807..50b90ee62 100644 --- a/cypress/integration/user_profile/BlockUser.feature +++ b/cypress/integration/user_profile/BlockUser.feature @@ -44,3 +44,14 @@ Feature: Block a User Then I should see the following posts in the select dropdown: | title | | previously created post | + + Scenario: Blocked users cannot see they are blocked in their list + Given a user has blocked me + And I navigate to my "Blocked users" settings page + Then I should see no users in my blocked users list + + Scenario: Blocked users should not see link or button to unblock, only blocking users + Given a user has blocked me + When I visit the profile page of the annoying user + And I should not see "Unblock user" from the content menu in the user info box + And I should not see "Unblock user" button \ No newline at end of file diff --git a/webapp/components/ContentMenu/ContentMenu.vue b/webapp/components/ContentMenu/ContentMenu.vue index ee2bd4a62..2be51c6ac 100644 --- a/webapp/components/ContentMenu/ContentMenu.vue +++ b/webapp/components/ContentMenu/ContentMenu.vue @@ -172,7 +172,7 @@ export default { icon: 'microphone-slash', }) } - if (this.resource.blocked) { + if (this.resource.hasBlocked) { routes.push({ label: this.$t(`settings.blocked-users.unblock`), callback: () => { diff --git a/webapp/pages/profile/_id/_slug.vue b/webapp/pages/profile/_id/_slug.vue index 80471fff4..4d9653dcb 100644 --- a/webapp/pages/profile/_id/_slug.vue +++ b/webapp/pages/profile/_id/_slug.vue @@ -67,14 +67,14 @@
- + {{ $t('settings.blocked-users.unblock') }} {{ $t('settings.muted-users.unmute') }} Date: Mon, 10 Feb 2020 12:40:38 +0100 Subject: [PATCH 086/281] refactor DeleteData template and CSS --- .../components/DeleteData/DeleteData.spec.js | 12 +- webapp/components/DeleteData/DeleteData.vue | 231 ++++++------------ webapp/locales/de.json | 4 +- webapp/locales/en.json | 4 +- webapp/locales/es.json | 4 +- webapp/locales/fr.json | 4 +- webapp/locales/it.json | 4 +- webapp/locales/pl.json | 4 +- webapp/locales/pt.json | 4 +- webapp/locales/ru.json | 4 +- 10 files changed, 96 insertions(+), 179 deletions(-) diff --git a/webapp/components/DeleteData/DeleteData.spec.js b/webapp/components/DeleteData/DeleteData.spec.js index 3529c1b7b..e9205fa5a 100644 --- a/webapp/components/DeleteData/DeleteData.spec.js +++ b/webapp/components/DeleteData/DeleteData.spec.js @@ -88,7 +88,7 @@ describe('DeleteData.vue', () => { describe('calls the delete user mutation', () => { beforeEach(() => { - enableDeletionInput = wrapper.find('.enable-deletion-input input') + enableDeletionInput = wrapper.find('.ds-input') enableDeletionInput.setValue(deleteAccountName) deleteAccountBtn = wrapper.find('[data-test="delete-button"]') }) @@ -107,7 +107,7 @@ describe('DeleteData.vue', () => { it("deletes a user's posts if requested", () => { mocks.$t.mockImplementation(() => deleteContributionsMessage) - enableContributionDeletionCheckbox = wrapper.findAll('.checkbox-container input').at(0) + enableContributionDeletionCheckbox = wrapper.findAll('input[type="checkbox"]').at(0) enableContributionDeletionCheckbox.trigger('click') deleteAccountBtn.trigger('click') expect(mocks.$apollo.mutate).toHaveBeenCalledWith( @@ -122,7 +122,7 @@ describe('DeleteData.vue', () => { it("deletes a user's comments if requested", () => { mocks.$t.mockImplementation(() => deleteCommentsMessage) - enableCommentDeletionCheckbox = wrapper.findAll('.checkbox-container input').at(1) + enableCommentDeletionCheckbox = wrapper.findAll('input[type="checkbox"]').at(1) enableCommentDeletionCheckbox.trigger('click') deleteAccountBtn.trigger('click') expect(mocks.$apollo.mutate).toHaveBeenCalledWith( @@ -137,10 +137,10 @@ describe('DeleteData.vue', () => { it("deletes a user's posts and comments if requested", () => { mocks.$t.mockImplementation(() => deleteContributionsMessage) - enableContributionDeletionCheckbox = wrapper.findAll('.checkbox-container input').at(0) + enableContributionDeletionCheckbox = wrapper.findAll('input[type="checkbox"]').at(0) enableContributionDeletionCheckbox.trigger('click') mocks.$t.mockImplementation(() => deleteCommentsMessage) - enableCommentDeletionCheckbox = wrapper.findAll('.checkbox-container input').at(1) + enableCommentDeletionCheckbox = wrapper.findAll('input[type="checkbox"]').at(1) enableCommentDeletionCheckbox.trigger('click') deleteAccountBtn.trigger('click') expect(mocks.$apollo.mutate).toHaveBeenCalledWith( @@ -166,7 +166,7 @@ describe('DeleteData.vue', () => { describe('error handling', () => { it('shows an error toaster when the mutation rejects', async () => { - enableDeletionInput = wrapper.find('.enable-deletion-input input') + enableDeletionInput = wrapper.find('.ds-input') enableDeletionInput.setValue(deleteAccountName) await Vue.nextTick() deleteAccountBtn = wrapper.find('[data-test="delete-button"]') diff --git a/webapp/components/DeleteData/DeleteData.vue b/webapp/components/DeleteData/DeleteData.vue index 66a31205a..699fe9b8e 100644 --- a/webapp/components/DeleteData/DeleteData.vue +++ b/webapp/components/DeleteData/DeleteData.vue @@ -1,80 +1,46 @@ + + diff --git a/webapp/locales/de.json b/webapp/locales/de.json index d552d51ba..5b83e4090 100644 --- a/webapp/locales/de.json +++ b/webapp/locales/de.json @@ -119,9 +119,9 @@ "contributionsCount": "Meine {count} Beiträge löschen", "commentedCount": "Meine {count} Kommentare löschen", "accountDescription": "Sei dir bewusst, dass deine Beiträge und Kommentare für unsere Community wichtig sind. Wenn du sie trotzdem löschen möchtest, musst du sie unten markieren.", - "accountWarning": "Dein Konto, deine Beiträge oder Kommentare kannst du nach dem Löschen WEDER VERWALTEN NOCH WIEDERHERSTELLEN!<\/b>", + "accountWarning": "Dein Konto, deine Beiträge oder Kommentare kannst du nach dem Löschen WEDER VERWALTEN NOCH WIEDERHERSTELLEN!", "success": "Konto erfolgreich gelöscht!", - "pleaseConfirm": "Zerstörerische Aktion!<\/b> Gib {confirm}<\/b> ein, um zu bestätigen." + "pleaseConfirm": "Zerstörerische Aktion! Gib „{confirm}“ ein, um zu bestätigen." }, "embeds": { "name": "Drittanbieter", diff --git a/webapp/locales/en.json b/webapp/locales/en.json index d15614ecc..d8f359be5 100644 --- a/webapp/locales/en.json +++ b/webapp/locales/en.json @@ -278,9 +278,9 @@ "contributionsCount": "Delete my {count} posts", "commentedCount": "Delete my {count} comments", "accountDescription": "Be aware that your Posts and Comments are important to our community. If you still choose to delete them, you have to mark them below.", - "accountWarning": "You CAN'T MANAGE and CAN'T RECOVER your Account, Posts, or Comments after deleting your account!", + "accountWarning": "You CAN'T MANAGE and CAN'T RECOVER your Account, Posts, or Comments after deleting your account!", "success": "Account successfully deleted!", - "pleaseConfirm": "Destructive action! Type {confirm} to confirm" + "pleaseConfirm": "Destructive action! Type “{confirm}” to confirm." }, "embeds": { "name": "Third party providers", diff --git a/webapp/locales/es.json b/webapp/locales/es.json index f916f849b..18d67c7a4 100644 --- a/webapp/locales/es.json +++ b/webapp/locales/es.json @@ -117,9 +117,9 @@ "contributionsCount": "Eliminar mis {count} contribuciones", "commentedCount": "Eliminar mis {count} comentarios", "accountDescription": "Tenga en cuenta que su contribución y sus comentarios son importantes para nuestra comunidad. Si aún decide borrarlos, debe marcarlos a continuación.", - "accountWarning": "¡ NO PUEDE GESTIONAR <\/b> y NO PUEDE RECUPERAR <\/b> su cuenta, contribuciones o comentarios después de eliminar su cuenta!", + "accountWarning": "¡NO PUEDE GESTIONAR y NO PUEDE RECUPERAR su cuenta, contribuciones o comentarios después de eliminar su cuenta!", "success": "¡Cuenta eliminada con éxito!", - "pleaseConfirm": " ¡Acción destructiva! <\/b> Escriba {confirm} <\/b> para confirmar" + "pleaseConfirm": "¡Acción destructiva! Escriba “{confirm}” para confirmar." }, "embeds": { "name": "Proveedores externos", diff --git a/webapp/locales/fr.json b/webapp/locales/fr.json index 92ca5482e..73334a1a4 100644 --- a/webapp/locales/fr.json +++ b/webapp/locales/fr.json @@ -117,9 +117,9 @@ "contributionsCount": "Supprimer mes {count} postes", "commentedCount": "Supprimer mes {count} commentaires", "accountDescription": "Sachez que vos postes et commentaires sont importants pour notre communauté. Si vous voulez quand même les supprimer, vous devez les marquer ci-dessous.", - "accountWarning": "Vous NE POUVEZ PAS GÉRER<\/b> et NE POUVEZ PAS RECOUVRIR<\/b> votre compte, vos messages ou vos commentaires après avoir supprimé votre compte !", + "accountWarning": "Vous NE POUVEZ PAS GÉRER et NE POUVEZ PAS RECOUVRIR votre compte, vos messages ou vos commentaires après avoir supprimé votre compte !", "success": "Compte supprimer avec succès!", - "pleaseConfirm": " Action destructive! <\/b> Saisissez {confirm} <\/b> pour confirmer" + "pleaseConfirm": "Action destructive! Saisissez “{confirm}” pour confirmer." }, "embeds": { "name": "Fournisseurs tiers", diff --git a/webapp/locales/it.json b/webapp/locales/it.json index d07f95086..4bf95dd5e 100644 --- a/webapp/locales/it.json +++ b/webapp/locales/it.json @@ -117,9 +117,9 @@ "contributionsCount": "Cancellare i miei {count} messaggi", "commentedCount": "Cancella i miei {count} commenti", "accountDescription": "Essere consapevoli che i tuoi post e commenti sono importanti per la nostra comunità. Se cancelli il tuo account utente, tutto scomparirà per sempre - e sarebbe un vero peccato!", - "accountWarning": "Attenzione!Tu Non puoi gestire e Non puoi recuperare il tuo account, i tuoi messaggi o commenti dopo aver cancellato il tuo account!", + "accountWarning": "Attenzione! Tu NON PUOI GESTIRE e NON PUOI RECUPERARE il tuo account, i tuoi messaggi o commenti dopo aver cancellato il tuo account!", "success": "Account eliminato con successo!", - "pleaseConfirm": "Azione distruttiva! Digita {conferma} per confermare" + "pleaseConfirm": "Azione distruttiva! Digita “{confirm}” per confermare." }, "embeds": { "name": "", diff --git a/webapp/locales/pl.json b/webapp/locales/pl.json index 7207c1e71..9f9174caa 100644 --- a/webapp/locales/pl.json +++ b/webapp/locales/pl.json @@ -129,9 +129,9 @@ "contributionsCount": "Usuń {count} moich postów", "commentedCount": "Usuń {count} moich komentarzy", "accountDescription": "Be aware that your Post and Comments are important to our community. If you still choose to delete them, you have to mark them below.", - "accountWarning": "Po usunięcie Twojego konta, nie możesz ZARZĄDZAĆ ani ODZYSKAĆ danych, wpisów oraz komentarzy!", + "accountWarning": "Po usunięcie Twojego konta, nie możesz ZARZĄDZAĆ ani ODZYSKAĆ danych, wpisów oraz komentarzy!", "success": "Konto zostało usunięte", - "pleaseConfirm": "Uwaga, niebezpieczeństwo! Wpisz {confirm}, aby potwierdzić" + "pleaseConfirm": "Uwaga, niebezpieczeństwo! Wpisz „{confirm}”, aby potwierdzić." }, "organizations": { "name": "My Organizations" diff --git a/webapp/locales/pt.json b/webapp/locales/pt.json index 29fe301c8..3deda86ca 100644 --- a/webapp/locales/pt.json +++ b/webapp/locales/pt.json @@ -117,9 +117,9 @@ "contributionsCount": "Deletar minhas {count} publicações", "commentedCount": "Deletar meus {count} comentários", "accountDescription": "Esteja ciente de que o suas Publicações e Comentários são importantes para a nossa comunidade. Se você ainda optar por excluí-los, você tem que marcá-los abaixo.", - "accountWarning": "Você NÃO PODE GERENCIAR<\/b> e NÃO PODE RECUPERAR<\/b> sua conta, Publicações, ou Comentários após excluir sua conta!", + "accountWarning": "Você NÃO PODE GERENCIAR e NÃO PODE RECUPERAR sua conta, Publicações, ou Comentários após excluir sua conta!", "success": "Conta eliminada com sucesso!", - "pleaseConfirm": "Ação destrutiva!<\/b> Digitar {confirm}<\/b> para confirmar" + "pleaseConfirm": "Ação destrutiva! Digitar “{confirm}” para confirmar." }, "embeds": { "name": "Fornecedores de terceiros", diff --git a/webapp/locales/ru.json b/webapp/locales/ru.json index 64af8f693..235a1ef77 100644 --- a/webapp/locales/ru.json +++ b/webapp/locales/ru.json @@ -627,11 +627,11 @@ }, "deleteUserAccount": { "accountDescription": "Обратите внимание, что ваши посты и комментарии важны для сообщества. Если вы все равно хотите их удалить, то вы должны отметить соответствующие опции ниже.", - "accountWarning": "Вы НЕ СМОЖЕТЕ<\/b> восстановить свой аккаунт, посты или комментарии после удаления.", + "accountWarning": "Вы НЕ СМОЖЕТЕ восстановить свой аккаунт, посты или комментарии после удаления.", "commentedCount": "Удалить мои комментарии: {count}", "contributionsCount": "Удалить мои посты: {count}", "name": "Удалить данные", - "pleaseConfirm": "Разрушительное действие!<\/b> Введите {confirm}<\/b> для подтверждения.", + "pleaseConfirm": "Разрушительное действие! Введите „{confirm}“ для подтверждения.", "success": "Аккаунт успешно удален!" }, "download": { From 70bb034343f556a44fd4b96e1abdc9a020617cb3 Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Mon, 10 Feb 2020 13:13:51 +0100 Subject: [PATCH 087/281] Remove unused email property from user factory --- backend/src/db/factories.js | 1 - backend/yarn.lock | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/backend/src/db/factories.js b/backend/src/db/factories.js index aa6fcec22..7a8979b3c 100644 --- a/backend/src/db/factories.js +++ b/backend/src/db/factories.js @@ -44,7 +44,6 @@ Factory.define('userWithoutEmailAddress') .attrs({ id: uuid, name: faker.name.findName, - email: faker.internet.email, password: '1234', role: 'user', avatar: faker.internet.avatar, diff --git a/backend/yarn.lock b/backend/yarn.lock index 7811c2b81..b092c3864 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -1943,7 +1943,7 @@ apollo-server-caching@^0.5.1: dependencies: lru-cache "^5.0.0" -apollo-server-core@^2.10.0, apollo-server-core@^2.9.16: +apollo-server-core@^2.10.0: version "2.10.0" resolved "https://registry.yarnpkg.com/apollo-server-core/-/apollo-server-core-2.10.0.tgz#b8d51bdffe6529f0e3ca670ee8f1238765cfade4" integrity sha512-x/UK6XvU307W8D/pzTclU04JIjRarcbg5mFPe0nVmO4OTc26uQgKi1WlZkcewXsAUnn+nDwKVn2c2G3dHEgXzQ== @@ -7923,11 +7923,6 @@ serve-static@1.14.1: version "1.14.1" resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== - dependencies: - encodeurl "~1.0.2" - escape-html "~1.0.3" - parseurl "~1.3.3" - send "0.17.1" set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" From bcf9680ad993f0566a57d400cd76cda531cceb38 Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Mon, 10 Feb 2020 14:33:49 +0100 Subject: [PATCH 088/281] Add type resolver for hasBlocked --- backend/src/schema/resolvers/users.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/schema/resolvers/users.js b/backend/src/schema/resolvers/users.js index d1d9111b6..55e4165b7 100644 --- a/backend/src/schema/resolvers/users.js +++ b/backend/src/schema/resolvers/users.js @@ -252,9 +252,11 @@ export default { followedByCurrentUser: 'MATCH (this)<-[:FOLLOWS]-(u:User {id: $cypherParams.currentUserId}) RETURN COUNT(u) >= 1', blocked: - 'MATCH (this)<-[:BLOCKED]-(u:User {id: $cypherParams.currentUserId}) RETURN COUNT(u) >= 1', + 'MATCH (this)-[:BLOCKED]-(u:User {id: $cypherParams.currentUserId}) RETURN COUNT(u) >= 1', isMuted: 'MATCH (this)<-[:MUTED]-(u:User {id: $cypherParams.currentUserId}) RETURN COUNT(u) >= 1', + hasBlocked: + 'MATCH (this)<-[:BLOCKED]-(u:User {id: $cypherParams.currentUserId}) RETURN COUNT(u) >= 1', }, count: { contributionsCount: From 0a9da862ed3e53e84e7066d3f5bce2ebbd8be9a5 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Mon, 10 Feb 2020 15:45:09 +0100 Subject: [PATCH 089/281] replace instances of ds-card with base-card --- .../components/FilterMenu/FilterMenu.spec.js | 17 +++--- webapp/components/FilterMenu/FilterMenu.vue | 54 ++++++------------- .../features/ReportList/ReportList.story.js | 4 +- .../features/ReportList/ReportList.vue | 7 +-- 4 files changed, 29 insertions(+), 53 deletions(-) diff --git a/webapp/components/FilterMenu/FilterMenu.spec.js b/webapp/components/FilterMenu/FilterMenu.spec.js index d70af323f..283db979e 100644 --- a/webapp/components/FilterMenu/FilterMenu.spec.js +++ b/webapp/components/FilterMenu/FilterMenu.spec.js @@ -12,10 +12,10 @@ describe('FilterMenu.vue', () => { mocks = { $t: () => {} } }) - describe('given a user', () => { + describe('given a hashtag', () => { beforeEach(() => { propsData = { - hashtag: null, + hashtag: 'Frieden', } }) @@ -27,19 +27,14 @@ describe('FilterMenu.vue', () => { wrapper = Wrapper() }) - it('does not render a card if there are no hashtags', () => { - expect(wrapper.is('.ds-card')).toBe(true) - }) - - it('renders a card if there are hashtags', () => { - propsData.hashtag = 'Frieden' + it('renders a card', () => { wrapper = Wrapper() - expect(wrapper.is('.ds-card')).toBe(true) + expect(wrapper.is('.base-card')).toBe(true) }) - describe('click "clear-search-button" button', () => { + describe('click clear search button', () => { it('emits clearSearch', () => { - wrapper.find('[name="clear-search-button"]').trigger('click') + wrapper.find('.base-button').trigger('click') expect(wrapper.emitted().clearSearch).toHaveLength(1) }) }) diff --git a/webapp/components/FilterMenu/FilterMenu.vue b/webapp/components/FilterMenu/FilterMenu.vue index e56925e56..c294763b5 100644 --- a/webapp/components/FilterMenu/FilterMenu.vue +++ b/webapp/components/FilterMenu/FilterMenu.vue @@ -1,32 +1,23 @@ diff --git a/webapp/components/features/ReportList/ReportList.story.js b/webapp/components/features/ReportList/ReportList.story.js index 33ec06120..aa188e8da 100644 --- a/webapp/components/features/ReportList/ReportList.story.js +++ b/webapp/components/features/ReportList/ReportList.story.js @@ -183,11 +183,11 @@ storiesOf('ReportList', module) openModal: action('openModal'), filter: action('filter'), }, - template: ` + template: `

Reports

-
`, + `, })) diff --git a/webapp/components/features/ReportList/ReportList.vue b/webapp/components/features/ReportList/ReportList.vue index 62a29e66b..c4a17bd26 100644 --- a/webapp/components/features/ReportList/ReportList.vue +++ b/webapp/components/features/ReportList/ReportList.vue @@ -1,5 +1,5 @@ + From 5347f734af524c18565f0cf0e8497d074d77c40c Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Mon, 10 Feb 2020 16:25:00 +0100 Subject: [PATCH 091/281] Fix cypress tests/frontend implementation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Co-authored-by: Wolfgang Huß --- backend/src/schema/resolvers/users.js | 2 +- backend/src/schema/types/type/User.gql | 2 +- cypress/integration/common/steps.js | 13 +++++++++---- cypress/integration/user_profile/BlockUser.feature | 5 ++++- webapp/components/ContentMenu/ContentMenu.vue | 2 +- webapp/graphql/User.js | 1 + webapp/pages/post/_id/_slug/index.vue | 2 +- webapp/pages/profile/_id/_slug.vue | 4 ++-- 8 files changed, 20 insertions(+), 11 deletions(-) diff --git a/backend/src/schema/resolvers/users.js b/backend/src/schema/resolvers/users.js index 55e4165b7..cbdc683e8 100644 --- a/backend/src/schema/resolvers/users.js +++ b/backend/src/schema/resolvers/users.js @@ -255,7 +255,7 @@ export default { 'MATCH (this)-[:BLOCKED]-(u:User {id: $cypherParams.currentUserId}) RETURN COUNT(u) >= 1', isMuted: 'MATCH (this)<-[:MUTED]-(u:User {id: $cypherParams.currentUserId}) RETURN COUNT(u) >= 1', - hasBlocked: + isBlocked: 'MATCH (this)<-[:BLOCKED]-(u:User {id: $cypherParams.currentUserId}) RETURN COUNT(u) >= 1', }, count: { diff --git a/backend/src/schema/types/type/User.gql b/backend/src/schema/types/type/User.gql index ec9bfeba7..baefc9d29 100644 --- a/backend/src/schema/types/type/User.gql +++ b/backend/src/schema/types/type/User.gql @@ -68,7 +68,7 @@ type User { RETURN COUNT(u) >= 1 """ ) - hasBlocked: Boolean! @cypher( + isBlocked: Boolean! @cypher( statement: """ MATCH (this)<-[:BLOCKED]-(user:User {id: $cypherParams.currentUserId}) RETURN COUNT(user) >= 1 diff --git a/cypress/integration/common/steps.js b/cypress/integration/common/steps.js index 52e8d7bba..c51290537 100644 --- a/cypress/integration/common/steps.js +++ b/cypress/integration/common/steps.js @@ -591,13 +591,18 @@ Then("I should see no users in my blocked users list", () => { .should('contain', "So far, you have not blocked anybody.") }) -Then("I should not see {string} from the content menu in the user info box", link => { +Then("I {string} see {string} from the content menu in the user info box", (condition, link) => { cy.get(".user-content-menu .base-button").click() cy.get(".popover .ds-menu-item-link") - .should('not.contain', link) + .should(condition === 'should' ? 'contain' : 'not.contain', link) }) Then('I should not see {string} button', button => { - cy.get('.ds-card-content') - .should('not.contain', '.action-buttons') + cy.get('.ds-card-content .action-buttons') + .should('have.length', 1) +}) + +Then('I should see the {string} button', button => { + cy.get('.ds-card-content .action-buttons .base-button') + .should('contain', button) }) diff --git a/cypress/integration/user_profile/BlockUser.feature b/cypress/integration/user_profile/BlockUser.feature index bf56e2b02..256d79dfb 100644 --- a/cypress/integration/user_profile/BlockUser.feature +++ b/cypress/integration/user_profile/BlockUser.feature @@ -11,6 +11,7 @@ Feature: Block a User Scenario: Block a user Given I am on the profile page of the annoying user When I click on "Block user" from the content menu in the user info box + And I "should" see "Unblock user" from the content menu in the user info box And I navigate to my "Blocked users" settings page Then I can see the following table: | Avatar | Name | @@ -28,6 +29,7 @@ Feature: Block a User When I visit the profile page of the annoying user And I click on "Block user" from the content menu in the user info box And I get removed from his follower collection + And I "should" see "Unblock user" from the content menu in the user info box Scenario: Posts of blocked users are not filtered from search results Given "Harassing User" wrote a post "You can still see my posts" @@ -53,5 +55,6 @@ Feature: Block a User Scenario: Blocked users should not see link or button to unblock, only blocking users Given a user has blocked me When I visit the profile page of the annoying user - And I should not see "Unblock user" from the content menu in the user info box + And I "should not" see "Unblock user" from the content menu in the user info box + And I should see the "Follow" button And I should not see "Unblock user" button \ No newline at end of file diff --git a/webapp/components/ContentMenu/ContentMenu.vue b/webapp/components/ContentMenu/ContentMenu.vue index 2be51c6ac..cee8a6f5c 100644 --- a/webapp/components/ContentMenu/ContentMenu.vue +++ b/webapp/components/ContentMenu/ContentMenu.vue @@ -172,7 +172,7 @@ export default { icon: 'microphone-slash', }) } - if (this.resource.hasBlocked) { + if (this.resource.isBlocked) { routes.push({ label: this.$t(`settings.blocked-users.unblock`), callback: () => { diff --git a/webapp/graphql/User.js b/webapp/graphql/User.js index a73941794..c36383a95 100644 --- a/webapp/graphql/User.js +++ b/webapp/graphql/User.js @@ -24,6 +24,7 @@ export default i18n => { createdAt followedByCurrentUser isMuted + isBlocked blocked following(first: 7) { ...user diff --git a/webapp/pages/post/_id/_slug/index.vue b/webapp/pages/post/_id/_slug/index.vue index 1d107941a..8115294c5 100644 --- a/webapp/pages/post/_id/_slug/index.vue +++ b/webapp/pages/post/_id/_slug/index.vue @@ -97,7 +97,7 @@ :post="post" @createComment="createComment" /> - + {{ $t('settings.blocked-users.explanation.commenting-disabled') }}
{{ $t('settings.blocked-users.explanation.commenting-explanation') }} diff --git a/webapp/pages/profile/_id/_slug.vue b/webapp/pages/profile/_id/_slug.vue index 4d9653dcb..372b73b40 100644 --- a/webapp/pages/profile/_id/_slug.vue +++ b/webapp/pages/profile/_id/_slug.vue @@ -67,14 +67,14 @@
- + {{ $t('settings.blocked-users.unblock') }} {{ $t('settings.muted-users.unmute') }} Date: Mon, 10 Feb 2020 17:19:19 +0100 Subject: [PATCH 092/281] Update to use PubSub in development - for some reason RedisPubSub works locally, but with docker it tries to connect to Redis and therefore it doesn't pass the build. PubSub is imported from graphql-subscriptions which is a dependency of apollo-server-express, and suitable for dev purposes. --- backend/src/server.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/src/server.js b/backend/src/server.js index 4c02b8ddb..d64ee72f1 100644 --- a/backend/src/server.js +++ b/backend/src/server.js @@ -2,7 +2,6 @@ import express from 'express' import http from 'http' import helmet from 'helmet' import { ApolloServer } from 'apollo-server-express' - import CONFIG from './config' import middleware from './middleware' import { getNeode, getDriver } from './db/neo4j' @@ -10,6 +9,7 @@ import decode from './jwt/decode' import schema from './schema' import webfinger from './activitypub/routes/webfinger' import { RedisPubSub } from 'graphql-redis-subscriptions' +import { PubSub } from 'graphql-subscriptions' import Redis from 'ioredis' export const NOTIFICATION_ADDED = 'NOTIFICATION_ADDED' @@ -23,14 +23,13 @@ const options = { return Math.min(times * 50, 2000) }, } - if (options.host && options.port && options.password) { prodPubsub = new RedisPubSub({ publisher: new Redis(options), subscriber: new Redis(options), }) } else { - devPubsub = new RedisPubSub() + devPubsub = new PubSub() } export const pubsub = prodPubsub || devPubsub const driver = getDriver() From 13d46ff336d285b935e387f1e7790443d9f37f87 Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Mon, 10 Feb 2020 17:23:50 +0100 Subject: [PATCH 093/281] v0.3.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f50c1dadf..ec54cdb7e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "human-connection", - "version": "0.3.0", + "version": "0.3.1", "description": "Fullstack and API tests with cypress and cucumber for Human Connection", "author": "Human Connection gGmbh", "license": "MIT", From 63ef9e339d8fcf0f9be57231cbefaa8190f51eb9 Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Mon, 10 Feb 2020 17:33:31 +0100 Subject: [PATCH 094/281] chore: Update to v0.3.1 --- CHANGELOG.md | 63 +++++++++++++++++++++++++++++++++++++++++--- backend/package.json | 2 +- webapp/package.json | 2 +- 3 files changed, 62 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 842838f83..8067daad4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,67 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v0.3.1](https://github.com/Human-Connection/Human-Connection/compare/v0.3.0...v0.3.1) + +> 10 February 2020 + +- fix: Display unblock feature only for blocking user [`#3034`](https://github.com/Human-Connection/Human-Connection/pull/3034) +- refactor(factories): Refactor test factories with rosie.js [`#2921`](https://github.com/Human-Connection/Human-Connection/pull/2921) +- build(deps-dev): bump @vue/cli-shared-utils from 4.1.2 to 4.2.2 in /webapp [`#3031`](https://github.com/Human-Connection/Human-Connection/pull/3031) +- build(deps): bump graphql-shield from 7.0.10 to 7.0.11 in /backend [`#3028`](https://github.com/Human-Connection/Human-Connection/pull/3028) +- build(deps-dev): bump codecov from 3.6.4 to 3.6.5 [`#3027`](https://github.com/Human-Connection/Human-Connection/pull/3027) +- chore: Add DevOps issue template [`#2999`](https://github.com/Human-Connection/Human-Connection/pull/2999) +- fix: Error pages can be translated [`#2826`](https://github.com/Human-Connection/Human-Connection/pull/2826) +- build(deps-dev): bump apollo-server-testing from 2.9.16 to 2.10.0 in /backend [`#3020`](https://github.com/Human-Connection/Human-Connection/pull/3020) +- build(deps): bump apollo-server from 2.9.16 to 2.10.0 in /backend [`#3019`](https://github.com/Human-Connection/Human-Connection/pull/3019) +- build(deps): bump graphql-tag from 2.10.2 to 2.10.3 in /backend [`#3011`](https://github.com/Human-Connection/Human-Connection/pull/3011) +- build(deps): bump graphql-shield from 7.0.9 to 7.0.10 in /backend [`#3010`](https://github.com/Human-Connection/Human-Connection/pull/3010) +- build(deps-dev): bump @storybook/addon-actions from 5.3.10 to 5.3.12 in /webapp [`#2998`](https://github.com/Human-Connection/Human-Connection/pull/2998) +- build(deps-dev): bump @storybook/addon-notes from 5.3.10 to 5.3.12 in /webapp [`#2997`](https://github.com/Human-Connection/Human-Connection/pull/2997) +- build(deps-dev): bump @storybook/addon-a11y from 5.3.10 to 5.3.12 in /webapp [`#2996`](https://github.com/Human-Connection/Human-Connection/pull/2996) +- build(deps): bump metascraper-author from 5.10.6 to 5.10.7 in /backend [`#2994`](https://github.com/Human-Connection/Human-Connection/pull/2994) +- build(deps): bump metascraper-title from 5.10.6 to 5.10.7 in /backend [`#2978`](https://github.com/Human-Connection/Human-Connection/pull/2978) +- build(deps-dev): bump @storybook/vue from 5.3.10 to 5.3.12 in /webapp [`#2995`](https://github.com/Human-Connection/Human-Connection/pull/2995) +- build(deps): bump metascraper-audio from 5.10.6 to 5.10.7 in /backend [`#2993`](https://github.com/Human-Connection/Human-Connection/pull/2993) +- build(deps): bump graphql-tag from 2.10.1 to 2.10.2 in /backend [`#2992`](https://github.com/Human-Connection/Human-Connection/pull/2992) +- build(deps): bump metascraper-url from 5.10.6 to 5.10.7 in /backend [`#2991`](https://github.com/Human-Connection/Human-Connection/pull/2991) +- build(deps): bump @sentry/node from 5.12.0 to 5.12.3 in /backend [`#2990`](https://github.com/Human-Connection/Human-Connection/pull/2990) +- build(deps-dev): bump @storybook/addon-notes from 5.3.9 to 5.3.10 in /webapp [`#2951`](https://github.com/Human-Connection/Human-Connection/pull/2951) +- build(deps): bump metascraper from 5.10.6 to 5.11.0 in /backend [`#2976`](https://github.com/Human-Connection/Human-Connection/pull/2976) +- build(deps): bump metascraper-logo from 5.10.6 to 5.10.7 in /backend [`#2975`](https://github.com/Human-Connection/Human-Connection/pull/2975) +- chore: Add issue template for Refactoring tickets [`#2983`](https://github.com/Human-Connection/Human-Connection/pull/2983) +- build(deps): bump @nuxtjs/sentry from 3.1.0 to 3.2.2 in /webapp [`#2974`](https://github.com/Human-Connection/Human-Connection/pull/2974) +- build(deps): bump metascraper-video from 5.10.6 to 5.10.7 in /backend [`#2952`](https://github.com/Human-Connection/Human-Connection/pull/2952) +- build(deps): bump metascraper-lang from 5.10.6 to 5.10.7 in /backend [`#2950`](https://github.com/Human-Connection/Human-Connection/pull/2950) +- build(deps): bump metascraper-description from 5.10.6 to 5.11.0 in /backend [`#2948`](https://github.com/Human-Connection/Human-Connection/pull/2948) +- build(deps): bump @sentry/node from 5.11.2 to 5.12.0 in /backend [`#2977`](https://github.com/Human-Connection/Human-Connection/pull/2977) +- build(deps): bump @nuxtjs/pwa from 3.0.0-beta.19 to 3.0.0-beta.20 in /webapp [`#2959`](https://github.com/Human-Connection/Human-Connection/pull/2959) +- build(deps-dev): bump @storybook/addon-a11y from 5.3.9 to 5.3.10 in /webapp [`#2956`](https://github.com/Human-Connection/Human-Connection/pull/2956) +- build(deps-dev): bump eslint-plugin-import from 2.20.0 to 2.20.1 in /webapp [`#2949`](https://github.com/Human-Connection/Human-Connection/pull/2949) +- build(deps): bump metascraper-soundcloud from 5.10.6 to 5.10.7 in /backend [`#2945`](https://github.com/Human-Connection/Human-Connection/pull/2945) +- build(deps): bump metascraper-date from 5.10.6 to 5.10.7 in /backend [`#2944`](https://github.com/Human-Connection/Human-Connection/pull/2944) +- build(deps-dev): bump codecov from 3.6.2 to 3.6.4 [`#2943`](https://github.com/Human-Connection/Human-Connection/pull/2943) +- build(deps-dev): bump @storybook/addon-actions in /webapp [`#2953`](https://github.com/Human-Connection/Human-Connection/pull/2953) +- build(deps): bump metascraper-publisher in /backend [`#2954`](https://github.com/Human-Connection/Human-Connection/pull/2954) +- build(deps-dev): bump eslint-plugin-import in /backend [`#2955`](https://github.com/Human-Connection/Human-Connection/pull/2955) +- build(deps): bump metascraper-youtube from 5.10.6 to 5.10.7 in /backend [`#2957`](https://github.com/Human-Connection/Human-Connection/pull/2957) +- build(deps): bump metascraper-image from 5.10.6 to 5.10.7 in /backend [`#2960`](https://github.com/Human-Connection/Human-Connection/pull/2960) +- build(deps-dev): bump @storybook/vue from 5.3.9 to 5.3.10 in /webapp [`#2961`](https://github.com/Human-Connection/Human-Connection/pull/2961) +- build(deps): bump @nuxtjs/axios from 5.9.4 to 5.9.5 in /webapp [`#2962`](https://github.com/Human-Connection/Human-Connection/pull/2962) +- fix: Update mute/unmute icon to unused icon [`#2973`](https://github.com/Human-Connection/Human-Connection/pull/2973) +- fix: Remove github release script breaking build [`#2971`](https://github.com/Human-Connection/Human-Connection/pull/2971) +- Use original createdAt for merged users/emails [`#2969`](https://github.com/Human-Connection/Human-Connection/pull/2969) +- Fix typo [`#2966`](https://github.com/Human-Connection/Human-Connection/pull/2966) +- chore: Update to v0.3.0 [`#2941`](https://github.com/Human-Connection/Human-Connection/pull/2941) +- Replace buildList with array of Promises [`46edc3f`](https://github.com/Human-Connection/Human-Connection/commit/46edc3fdd5b83c2f00506f595b1254d7597767e0) +- build(deps-dev): bump @storybook/addon-notes in /webapp [`75137ce`](https://github.com/Human-Connection/Human-Connection/commit/75137ce716dadcc6f0ceeed6a2b0fe5c50fa7b8f) +- Update to v0.3.0 [`dbe2c4c`](https://github.com/Human-Connection/Human-Connection/commit/dbe2c4cdd5bab2195c6369b84989507b9f7da768) + #### [v0.3.0](https://github.com/Human-Connection/Human-Connection/compare/v0.2.1...v0.3.0) > 31 January 2020 +- build(deps-dev): bump @babel/core from 7.8.3 to 7.8.4 in /webapp [`#2939`](https://github.com/Human-Connection/Human-Connection/pull/2939) - feat: 🍰 Direct Reply On Comment [`#2608`](https://github.com/Human-Connection/Human-Connection/pull/2608) - build(deps-dev): bump @babel/core from 7.8.3 to 7.8.4 in /backend [`#2938`](https://github.com/Human-Connection/Human-Connection/pull/2938) - fix: deploy script with new naming convention [`#2930`](https://github.com/Human-Connection/Human-Connection/pull/2930) @@ -181,9 +238,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - refactor(modules): Various import fixes [`#2773`](https://github.com/Human-Connection/Human-Connection/issues/2773) [`#2774`](https://github.com/Human-Connection/Human-Connection/issues/2774) - feat(webapp): Display deployed version in footer [`#1831`](https://github.com/Human-Connection/Human-Connection/issues/1831) - fix #2229 [`#2229`](https://github.com/Human-Connection/Human-Connection/issues/2229) -- refactor: Make `db:setup` init stage of `migrate` [`b063847`](https://github.com/Human-Connection/Human-Connection/commit/b063847849a84db885337dc8e84e75ddaf87011f) -- Improve styling per @alina-beck review [`bcc1ab1`](https://github.com/Human-Connection/Human-Connection/commit/bcc1ab167e8b1dfdac1ec0a05a0c14e8234bcabc) -- test(cypress): Cover "Pinned post" feature [`d49afc2`](https://github.com/Human-Connection/Human-Connection/commit/d49afc25cfa1c1f98ed04f78dd3ff826cd85ae25) +- Get rid of different factory files [`fc36729`](https://github.com/Human-Connection/Human-Connection/commit/fc367297e3e054f09b7f8f31788ab68d87f6babf) +- Refactor factory for comments [`2fc71d7`](https://github.com/Human-Connection/Human-Connection/commit/2fc71d75a5d5eab9c3467e94e00257ef6dd7d8a0) +- Refactor user factory [`2a79c53`](https://github.com/Human-Connection/Human-Connection/commit/2a79c53765b73f9b91691eb75f55cf8c9e48306e) #### [v0.2.1](https://github.com/Human-Connection/Human-Connection/compare/v0.2.0...v0.2.1) diff --git a/backend/package.json b/backend/package.json index de9bd3a6c..8f874c0a7 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "human-connection-backend", - "version": "0.2.2", + "version": "0.3.1", "description": "GraphQL Backend for Human Connection", "main": "src/index.js", "scripts": { diff --git a/webapp/package.json b/webapp/package.json index 0d36bef1d..cc802db61 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -1,6 +1,6 @@ { "name": "human-connection-webapp", - "version": "0.2.2", + "version": "0.3.1", "description": "Human Connection Frontend", "authors": [ "Grzegorz Leoniec (appinteractive)", From cea538e2f146220e9881fbe20d36cf7922ffdfb8 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Mon, 10 Feb 2020 17:56:18 +0100 Subject: [PATCH 095/281] refactor Notification component --- .../components/Notification/Notification.vue | 82 +++++++++++-------- 1 file changed, 47 insertions(+), 35 deletions(-) diff --git a/webapp/components/Notification/Notification.vue b/webapp/components/Notification/Notification.vue index 2a4942716..34c57b368 100644 --- a/webapp/components/Notification/Notification.vue +++ b/webapp/components/Notification/Notification.vue @@ -1,37 +1,23 @@ From 00195f16154b5108897edb66763d479177fd815a Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Mon, 10 Feb 2020 19:16:41 +0100 Subject: [PATCH 096/281] Increase body parser limit - The default limit is only 100kb - we are getting many requests that exceed this limit - not sure about what would be an appropriate limit, but have seen 50mb in many examples. --- backend/src/server.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/src/server.js b/backend/src/server.js index 02e166b71..1b40b5e1a 100644 --- a/backend/src/server.js +++ b/backend/src/server.js @@ -7,6 +7,7 @@ import { getNeode, getDriver } from './db/neo4j' import decode from './jwt/decode' import schema from './schema' import webfinger from './activitypub/routes/webfinger' +import bodyParser from 'body-parser' const driver = getDriver() const neode = getNeode() @@ -45,6 +46,8 @@ const createServer = options => { app.use(helmet()) app.use('/.well-known/', webfinger()) app.use(express.static('public')) + app.use(bodyParser.json({ limit: '50mb' })) + app.use(bodyParser.urlencoded({ limit: '50mb', extended: true })) server.applyMiddleware({ app, path: '/' }) return { server, app } From 708ab6ecde17b0ea5a177b9625ba37573a2e96f4 Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Mon, 10 Feb 2020 19:21:53 +0100 Subject: [PATCH 097/281] Set equal to nginx max body size --- backend/src/server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/server.js b/backend/src/server.js index 1b40b5e1a..02da4c6aa 100644 --- a/backend/src/server.js +++ b/backend/src/server.js @@ -46,8 +46,8 @@ const createServer = options => { app.use(helmet()) app.use('/.well-known/', webfinger()) app.use(express.static('public')) - app.use(bodyParser.json({ limit: '50mb' })) - app.use(bodyParser.urlencoded({ limit: '50mb', extended: true })) + app.use(bodyParser.json({ limit: '10mb' })) + app.use(bodyParser.urlencoded({ limit: '10mb', extended: true })) server.applyMiddleware({ app, path: '/' }) return { server, app } From 11989edca26ea0be4fe0ec5e256e7d676ca5dff0 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2020 04:22:25 +0000 Subject: [PATCH 098/281] build(deps-dev): bump vue-svg-loader from 0.15.0 to 0.16.0 in /webapp Bumps [vue-svg-loader](https://github.com/visualfanatic/vue-svg-loader) from 0.15.0 to 0.16.0. - [Release notes](https://github.com/visualfanatic/vue-svg-loader/releases) - [Commits](https://github.com/visualfanatic/vue-svg-loader/compare/0.15.0...0.16.0) Signed-off-by: dependabot-preview[bot] --- webapp/package.json | 2 +- webapp/yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/webapp/package.json b/webapp/package.json index cc802db61..03ed63577 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -142,7 +142,7 @@ "style-resources-loader": "~1.3.3", "vue-jest": "~3.0.5", "vue-loader": "~15.8.3", - "vue-svg-loader": "~0.15.0", + "vue-svg-loader": "~0.16.0", "vue-template-compiler": "^2.6.11" } } diff --git a/webapp/yarn.lock b/webapp/yarn.lock index d5d6cf14b..01508d334 100644 --- a/webapp/yarn.lock +++ b/webapp/yarn.lock @@ -15361,10 +15361,10 @@ svg-tags@^1.0.0: resolved "https://registry.yarnpkg.com/svg-tags/-/svg-tags-1.0.0.tgz#58f71cee3bd519b59d4b2a843b6c7de64ac04764" integrity sha1-WPcc7jvVGbWdSyqEO2x95krAR2Q= -svg-to-vue@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/svg-to-vue/-/svg-to-vue-0.6.0.tgz#d5de9ec7126ac3c11adf8cfad013a6264ef57184" - integrity sha512-SYGJMBq5EHt/nIJxZ4kA9A6bilaFXtOPFJRoMQ2ml/jFP4N9L7HVFTm+5WCFN3QFnEUXtH6BHzpoOlwP1/5+2A== +svg-to-vue@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/svg-to-vue/-/svg-to-vue-0.7.0.tgz#ec86deb1742be38319462e36703af1dfa2f9fad9" + integrity sha512-Tg2nMmf3BQorYCAjxbtTkYyWPVSeox5AZUFvfy4MoWK/5tuQlnA/h3LAlTjV3sEvOC5FtUNovRSj3p784l4KOA== dependencies: svgo "^1.3.2" @@ -16554,13 +16554,13 @@ vue-style-loader@^4.1.0: hash-sum "^1.0.2" loader-utils "^1.0.2" -vue-svg-loader@~0.15.0: - version "0.15.0" - resolved "https://registry.yarnpkg.com/vue-svg-loader/-/vue-svg-loader-0.15.0.tgz#09bb9929c3f8955a246ea80909e26139badc0509" - integrity sha512-698GfXu9k2wPxI382Qf7MfrtBXjIjThqmOsksVKHqeTvVO+Ary9q69SVzA6EEJmj5vmF5u1KRVb/I1BDh4fPTQ== +vue-svg-loader@~0.16.0: + version "0.16.0" + resolved "https://registry.yarnpkg.com/vue-svg-loader/-/vue-svg-loader-0.16.0.tgz#adccbdc9aca90132bde9c9d96cd49f74efecd345" + integrity sha512-2RtFXlTCYWm8YAEO2qAOZ2SuIF2NvLutB5muc3KDYoZq5ZeCHf8ggzSan3ksbbca7CJ/Aw57ZnDF4B7W/AkGtw== dependencies: loader-utils "^1.2.3" - svg-to-vue "^0.6.0" + svg-to-vue "^0.7.0" vue-sweetalert-icons@~4.2.0: version "4.2.0" From 6671d893e6094a240368e83be0a7b2a1a875ee86 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Tue, 11 Feb 2020 09:20:45 +0100 Subject: [PATCH 099/281] refactor PostCard (wip) --- webapp/components/ContentMenu/ContentMenu.vue | 2 +- .../Notification/Notification.spec.js | 30 +-- .../components/Notification/Notification.vue | 6 +- .../NotificationList/NotificationList.spec.js | 2 +- webapp/components/PostCard/PostCard.vue | 225 +++++++++--------- 5 files changed, 131 insertions(+), 134 deletions(-) diff --git a/webapp/components/ContentMenu/ContentMenu.vue b/webapp/components/ContentMenu/ContentMenu.vue index ba273e28a..67f28817e 100644 --- a/webapp/components/ContentMenu/ContentMenu.vue +++ b/webapp/components/ContentMenu/ContentMenu.vue @@ -8,7 +8,7 @@ size="small" circle ghost - @click="toggleMenu" + @click.prevent="toggleMenu()" /> diff --git a/webapp/components/Notification/Notification.spec.js b/webapp/components/Notification/Notification.spec.js index 750f59b3a..537babfae 100644 --- a/webapp/components/Notification/Notification.spec.js +++ b/webapp/components/Notification/Notification.spec.js @@ -63,7 +63,7 @@ describe('Notification', () => { it('renders reason', () => { wrapper = Wrapper() - expect(wrapper.find('.reason-text-for-test').text()).toEqual( + expect(wrapper.find('.notification > .description').text()).toEqual( 'notifications.reason.commented_on_post', ) }) @@ -79,9 +79,9 @@ describe('Notification', () => { wrapper = Wrapper() expect(wrapper.text()).toContain('@dagobert-duck is the best on this comment.') }) - it('has no class "read"', () => { + it('has no class "--read"', () => { wrapper = Wrapper() - expect(wrapper.classes()).not.toContain('read') + expect(wrapper.classes()).not.toContain('--read') }) describe('that is read', () => { @@ -90,8 +90,8 @@ describe('Notification', () => { wrapper = Wrapper() }) - it('has class "read"', () => { - expect(wrapper.classes()).toContain('read') + it('has class "--read"', () => { + expect(wrapper.classes()).toContain('--read') }) }) }) @@ -113,7 +113,7 @@ describe('Notification', () => { it('renders reason', () => { wrapper = Wrapper() - expect(wrapper.find('.reason-text-for-test').text()).toEqual( + expect(wrapper.find('.notification > .description').text()).toEqual( 'notifications.reason.mentioned_in_post', ) }) @@ -125,9 +125,9 @@ describe('Notification', () => { wrapper = Wrapper() expect(wrapper.text()).toContain('@jenny-rostock is the best on this post.') }) - it('has no class "read"', () => { + it('has no class "--read"', () => { wrapper = Wrapper() - expect(wrapper.classes()).not.toContain('read') + expect(wrapper.classes()).not.toContain('--read') }) describe('that is read', () => { @@ -136,8 +136,8 @@ describe('Notification', () => { wrapper = Wrapper() }) - it('has class "read"', () => { - expect(wrapper.classes()).toContain('read') + it('has class "--read"', () => { + expect(wrapper.classes()).toContain('--read') }) }) }) @@ -163,7 +163,7 @@ describe('Notification', () => { it('renders reason', () => { wrapper = Wrapper() - expect(wrapper.find('.reason-text-for-test').text()).toEqual( + expect(wrapper.find('.notification > .description').text()).toEqual( 'notifications.reason.mentioned_in_comment', ) }) @@ -182,9 +182,9 @@ describe('Notification', () => { expect(wrapper.text()).toContain('@dagobert-duck is the best on this comment.') }) - it('has no class "read"', () => { + it('has no class "--read"', () => { wrapper = Wrapper() - expect(wrapper.classes()).not.toContain('read') + expect(wrapper.classes()).not.toContain('--read') }) describe('that is read', () => { @@ -193,8 +193,8 @@ describe('Notification', () => { wrapper = Wrapper() }) - it('has class "read"', () => { - expect(wrapper.classes()).toContain('read') + it('has class "--read"', () => { + expect(wrapper.classes()).toContain('--read') }) }) }) diff --git a/webapp/components/Notification/Notification.vue b/webapp/components/Notification/Notification.vue index 34c57b368..deb012c10 100644 --- a/webapp/components/Notification/Notification.vue +++ b/webapp/components/Notification/Notification.vue @@ -1,5 +1,5 @@ @@ -48,6 +51,7 @@ export default { diff --git a/webapp/components/_new/generic/CardWithColumns/CardWithColumns.story.js b/webapp/components/_new/generic/CardWithColumns/CardWithColumns.story.js deleted file mode 100644 index 8b1e8940f..000000000 --- a/webapp/components/_new/generic/CardWithColumns/CardWithColumns.story.js +++ /dev/null @@ -1,21 +0,0 @@ -import { storiesOf } from '@storybook/vue' -import helpers from '~/storybook/helpers' -import CardWithColumns from './CardWithColumns.vue' - -storiesOf('Generic/CardWithColumns', module) - .addDecorator(helpers.layout) - - .add('default', () => ({ - components: { CardWithColumns }, - template: ` - - - - - `, - })) diff --git a/webapp/components/_new/generic/CardWithColumns/CardWithColumns.vue b/webapp/components/_new/generic/CardWithColumns/CardWithColumns.vue deleted file mode 100644 index 71fda7caf..000000000 --- a/webapp/components/_new/generic/CardWithColumns/CardWithColumns.vue +++ /dev/null @@ -1,26 +0,0 @@ - - - - - diff --git a/webapp/pages/password-reset.vue b/webapp/pages/password-reset.vue index e59a8e6c7..930a298fe 100644 --- a/webapp/pages/password-reset.vue +++ b/webapp/pages/password-reset.vue @@ -1,24 +1,22 @@