From d0339758af6e64a92db0feacc336fef10c035461 Mon Sep 17 00:00:00 2001 From: NoriDev Date: Sun, 28 May 2023 18:35:56 +0900 Subject: [PATCH] =?UTF-8?q?CherryPick=F0=9F=8D=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/docker_example.env | 6 ++--- .config/docker_example.yml | 22 ++++++++-------- .config/example.yml | 2 +- .devcontainer/devcontainer.yml | 18 ++++++------- .github/ISSUE_TEMPLATE/01_bug-report.md | 2 +- .github/reviewer-lottery.yml | 5 +--- .github/workflows/pr-preview-deploy.yml | 2 +- .github/workflows/pr-preview-destroy.yml | 2 +- .github/workflows/storybook.yml | 2 +- .github/workflows/test-backend.yml | 4 +-- .github/workflows/test-production.yml | 2 +- Dockerfile | 26 +++++++++---------- chart/templates/ConfigMap.yml | 2 +- chart/templates/Deployment.yml | 14 +++++----- chart/templates/Service.yml | 4 +-- chart/templates/_helpers.tpl | 20 +++++++------- cypress/e2e/basic.cy.js | 4 +-- packages/backend/src/server/web/boot.js | 2 +- packages/backend/src/server/web/error.css | 4 +-- packages/frontend/src/boot/common.ts | 6 ++--- .../frontend/src/pages/welcome.entrance.a.vue | 4 +-- 21 files changed, 75 insertions(+), 78 deletions(-) diff --git a/.config/docker_example.env b/.config/docker_example.env index 7a0261524b..2797c2f807 100644 --- a/.config/docker_example.env +++ b/.config/docker_example.env @@ -1,4 +1,4 @@ # db settings -POSTGRES_PASSWORD=example-misskey-pass -POSTGRES_USER=example-misskey-user -POSTGRES_DB=misskey +POSTGRES_PASSWORD=example-cherrypick-pass +POSTGRES_USER=example-cherrypick-user +POSTGRES_DB=cherrypick diff --git a/.config/docker_example.yml b/.config/docker_example.yml index 5cb17a44d1..d4d5118f1b 100644 --- a/.config/docker_example.yml +++ b/.config/docker_example.yml @@ -1,5 +1,5 @@ #━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -# Misskey configuration +# CherryPick configuration #━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ # ┌─────┐ @@ -15,19 +15,19 @@ url: https://example.tld/ #───┘ Port and TLS settings └─────────────────────────────────── # -# Misskey requires a reverse proxy to support HTTPS connections. +# CherryPick requires a reverse proxy to support HTTPS connections. # -# +----- https://example.tld/ ------------+ -# +------+ |+-------------+ +----------------+| -# | User | ---> || Proxy (443) | ---> | Misskey (3000) || -# +------+ |+-------------+ +----------------+| -# +---------------------------------------+ +# +-------- https://example.tld/ ------------+ +# +------+ |+-------------+ +-------------------+| +# | User | ---> || Proxy (443) | ---> | CherryPick (3000) || +# +------+ |+-------------+ +-------------------+| +# +------------------------------------------+ # # You need to set up a reverse proxy. (e.g. nginx) # An encrypted connection with HTTPS is highly recommended # because tokens may be transferred in GET requests. -# The port that your Misskey server should listen on. +# The port that your CherryPick server should listen on. port: 3000 # ┌──────────────────────────┐ @@ -38,11 +38,11 @@ db: port: 5432 # Database name - db: misskey + db: cherrypick # Auth - user: example-misskey-user - pass: example-misskey-pass + user: example-cherrypick-user + pass: example-cherrypick-pass # Whether disable Caching queries #disableCache: true diff --git a/.config/example.yml b/.config/example.yml index 57c8dc5a80..e3b61ed788 100644 --- a/.config/example.yml +++ b/.config/example.yml @@ -178,7 +178,7 @@ proxyBypassHosts: # Movie Thumbnail Generation URL # There is no reference implementation. -# For example, Misskey will point to the following URL: +# For example, CherryPick will point to the following URL: # https://example.com/thumbnail.webp?thumbnail=1&url=https%3A%2F%2Fstorage.example.com%2Fpath%2Fto%2Fvideo.mp4 #videoThumbnailGenerator: https://example.com diff --git a/.devcontainer/devcontainer.yml b/.devcontainer/devcontainer.yml index 824a046dc0..4b612ad11c 100644 --- a/.devcontainer/devcontainer.yml +++ b/.devcontainer/devcontainer.yml @@ -1,5 +1,5 @@ #━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -# Misskey configuration +# CherryPick configuration #━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ # ┌─────┐ @@ -15,19 +15,19 @@ url: http://127.0.0.1:3000/ #───┘ Port and TLS settings └─────────────────────────────────── # -# Misskey requires a reverse proxy to support HTTPS connections. +# CherryPick requires a reverse proxy to support HTTPS connections. # -# +----- https://example.tld/ ------------+ -# +------+ |+-------------+ +----------------+| -# | User | ---> || Proxy (443) | ---> | Misskey (3000) || -# +------+ |+-------------+ +----------------+| -# +---------------------------------------+ +# +-------- https://example.tld/ ------------+ +# +------+ |+-------------+ +-------------------+| +# | User | ---> || Proxy (443) | ---> | CherryPick (3000) || +# +------+ |+-------------+ +-------------------+| +# +------------------------------------------+ # # You need to set up a reverse proxy. (e.g. nginx) # An encrypted connection with HTTPS is highly recommended # because tokens may be transferred in GET requests. -# The port that your Misskey server should listen on. +# The port that your CherryPick server should listen on. port: 3000 # ┌──────────────────────────┐ @@ -38,7 +38,7 @@ db: port: 5432 # Database name - db: misskey + db: cherrypick # Auth user: postgres diff --git a/.github/ISSUE_TEMPLATE/01_bug-report.md b/.github/ISSUE_TEMPLATE/01_bug-report.md index 50e3174aee..9d1dcb7bc6 100644 --- a/.github/ISSUE_TEMPLATE/01_bug-report.md +++ b/.github/ISSUE_TEMPLATE/01_bug-report.md @@ -10,7 +10,7 @@ assignees: '' ## 💡 Summary diff --git a/.github/reviewer-lottery.yml b/.github/reviewer-lottery.yml index c88e1342de..24df682bab 100644 --- a/.github/reviewer-lottery.yml +++ b/.github/reviewer-lottery.yml @@ -3,7 +3,4 @@ groups: reviewers: 2 internal_reviewers: 1 usernames: - - syuilo - - acid-chicken - - EbiseLutica - - tamaina + - noridev diff --git a/.github/workflows/pr-preview-deploy.yml b/.github/workflows/pr-preview-deploy.yml index 9b786d34aa..04c1cbc65d 100644 --- a/.github/workflows/pr-preview-deploy.yml +++ b/.github/workflows/pr-preview-deploy.yml @@ -68,7 +68,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - name: pr-${{ github.event.client_payload.pull_request.number }}-syuilo + name: pr-${{ github.event.client_payload.pull_request.number }}-noridev timeout: 15m # Update check run called "integration-fork" diff --git a/.github/workflows/pr-preview-destroy.yml b/.github/workflows/pr-preview-destroy.yml index 8adfad9dab..6666895c0c 100644 --- a/.github/workflows/pr-preview-destroy.yml +++ b/.github/workflows/pr-preview-destroy.yml @@ -51,4 +51,4 @@ jobs: if: steps.check-conclusion.outputs.result == 'success' uses: okteto/destroy-preview@latest with: - name: pr-${{ github.event.number }}-syuilo + name: pr-${{ github.event.number }}-noridev diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml index 6cb1b34997..22675a9871 100644 --- a/.github/workflows/storybook.yml +++ b/.github/workflows/storybook.yml @@ -87,7 +87,7 @@ jobs: echo "skip=true" >> $GITHUB_OUTPUT fi BRANCH="${{ github.event.pull_request.head.user.login }}:${{ github.event.pull_request.head.ref }}" - if [ "$BRANCH" = "misskey-dev:${{ github.event.pull_request.head.ref }}" ]; then + if [ "$BRANCH" = "kokonect-link:${{ github.event.pull_request.head.ref }}" ]; then BRANCH="${{ github.event.pull_request.head.ref }}" fi pnpm --filter frontend chromatic --exit-once-uploaded -d storybook-static --branch-name $BRANCH $(echo "$CHROMATIC_PARAMETER") diff --git a/.github/workflows/test-backend.yml b/.github/workflows/test-backend.yml index d7be15bd4f..ca462138aa 100644 --- a/.github/workflows/test-backend.yml +++ b/.github/workflows/test-backend.yml @@ -21,7 +21,7 @@ jobs: ports: - 54312:5432 env: - POSTGRES_DB: test-misskey + POSTGRES_DB: test-cherrypick POSTGRES_HOST_AUTH_METHOD: trust redis: image: redis:7 @@ -47,7 +47,7 @@ jobs: - name: Check pnpm-lock.yaml run: git diff --exit-code pnpm-lock.yaml - name: Copy Configure - run: cp .github/misskey/test.yml .config + run: cp .github/cherrypick/test.yml .config - name: Build run: pnpm build - name: Test diff --git a/.github/workflows/test-production.yml b/.github/workflows/test-production.yml index 5243a83777..ae11cc0d94 100644 --- a/.github/workflows/test-production.yml +++ b/.github/workflows/test-production.yml @@ -37,6 +37,6 @@ jobs: - name: Check pnpm-lock.yaml run: git diff --exit-code pnpm-lock.yaml - name: Copy Configure - run: cp .github/misskey/test.yml .config/default.yml + run: cp .github/cherrypick/test.yml .config/default.yml - name: Build run: pnpm build diff --git a/Dockerfile b/Dockerfile index fb389659bc..902bc3930b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ RUN corepack enable -WORKDIR /misskey +WORKDIR /cherrypick COPY --link ["pnpm-lock.yaml", "pnpm-workspace.yaml", "package.json", "./"] COPY --link ["scripts", "./scripts"] @@ -46,7 +46,7 @@ RUN apt-get update \ RUN corepack enable -WORKDIR /misskey +WORKDIR /cherrypick COPY --link ["pnpm-lock.yaml", "pnpm-workspace.yaml", "package.json", "./"] COPY --link ["scripts", "./scripts"] @@ -64,24 +64,24 @@ RUN apt-get update \ && apt-get install -y --no-install-recommends \ ffmpeg tini curl \ && corepack enable \ - && groupadd -g "${GID}" misskey \ - && useradd -l -u "${UID}" -g "${GID}" -m -d /misskey misskey \ + && groupadd -g "${GID}" cherrypick \ + && useradd -l -u "${UID}" -g "${GID}" -m -d /cherrypick cherrypick \ && find / -type d -path /proc -prune -o -type f -perm /u+s -ignore_readdir_race -exec chmod u-s {} \; \ && find / -type d -path /proc -prune -o -type f -perm /g+s -ignore_readdir_race -exec chmod g-s {} \; \ && apt-get clean \ && rm -rf /var/lib/apt/lists -USER misskey -WORKDIR /misskey +USER cherrypick +WORKDIR /cherrypick -COPY --chown=misskey:misskey --from=target-builder /misskey/node_modules ./node_modules -COPY --chown=misskey:misskey --from=target-builder /misskey/packages/backend/node_modules ./packages/backend/node_modules -COPY --chown=misskey:misskey --from=native-builder /misskey/built ./built -COPY --chown=misskey:misskey --from=native-builder /misskey/packages/backend/built ./packages/backend/built -COPY --chown=misskey:misskey --from=native-builder /misskey/fluent-emojis /misskey/fluent-emojis -COPY --chown=misskey:misskey . ./ +COPY --chown=cherrypick:cherrypick --from=target-builder /cherrypick/node_modules ./node_modules +COPY --chown=cherrypick:cherrypick --from=target-builder /cherrypick/packages/backend/node_modules ./packages/backend/node_modules +COPY --chown=cherrypick:cherrypick --from=native-builder /cherrypick/built ./built +COPY --chown=cherrypick:cherrypick --from=native-builder /cherrypick/packages/backend/built ./packages/backend/built +COPY --chown=cherrypick:cherrypick --from=native-builder /cherrypick/fluent-emojis /cherrypick/fluent-emojis +COPY --chown=cherrypick:cherrypick . ./ ENV NODE_ENV=production -HEALTHCHECK --interval=5s --retries=20 CMD ["/bin/bash", "/misskey/healthcheck.sh"] +HEALTHCHECK --interval=5s --retries=20 CMD ["/bin/bash", "/cherrypick/healthcheck.sh"] ENTRYPOINT ["/usr/bin/tini", "--"] CMD ["pnpm", "run", "migrateandstart"] diff --git a/chart/templates/ConfigMap.yml b/chart/templates/ConfigMap.yml index 37c25e0864..1357d030f9 100644 --- a/chart/templates/ConfigMap.yml +++ b/chart/templates/ConfigMap.yml @@ -1,7 +1,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ include "misskey.fullname" . }}-configuration + name: {{ include "cherrypick.fullname" . }}-configuration data: default.yml: |- {{ .Files.Get "files/default.yml"|nindent 4 }} diff --git a/chart/templates/Deployment.yml b/chart/templates/Deployment.yml index ab2d2a1a87..f470280799 100644 --- a/chart/templates/Deployment.yml +++ b/chart/templates/Deployment.yml @@ -1,18 +1,18 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "misskey.fullname" . }} + name: {{ include "cherrypick.fullname" . }} labels: - {{- include "misskey.labels" . | nindent 4 }} + {{- include "cherrypick.labels" . | nindent 4 }} spec: selector: matchLabels: - {{- include "misskey.selectorLabels" . | nindent 6 }} + {{- include "cherrypick.selectorLabels" . | nindent 6 }} replicas: 1 template: metadata: labels: - {{- include "misskey.selectorLabels" . | nindent 8 }} + {{- include "cherrypick.selectorLabels" . | nindent 8 }} spec: containers: - name: cherrypick @@ -21,7 +21,7 @@ spec: - name: NODE_ENV value: {{ .Values.environment }} volumeMounts: - - name: {{ include "misskey.fullname" . }}-configuration + - name: {{ include "cherrypick.fullname" . }}-configuration mountPath: /cherrypick/.config readOnly: true ports: @@ -42,6 +42,6 @@ spec: ports: - containerPort: 6379 volumes: - - name: {{ include "misskey.fullname" . }}-configuration + - name: {{ include "cherrypick.fullname" . }}-configuration configMap: - name: {{ include "misskey.fullname" . }}-configuration + name: {{ include "cherrypick.fullname" . }}-configuration diff --git a/chart/templates/Service.yml b/chart/templates/Service.yml index afd851a9f1..142b66a7e2 100644 --- a/chart/templates/Service.yml +++ b/chart/templates/Service.yml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "misskey.fullname" . }} + name: {{ include "cherrypick.fullname" . }} annotations: dev.okteto.com/auto-ingress: "true" spec: @@ -11,4 +11,4 @@ spec: protocol: TCP name: http selector: - {{- include "misskey.selectorLabels" . | nindent 4 }} + {{- include "cherrypick.selectorLabels" . | nindent 4 }} diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl index a5a2499f3f..efc258b57d 100644 --- a/chart/templates/_helpers.tpl +++ b/chart/templates/_helpers.tpl @@ -1,7 +1,7 @@ {{/* Expand the name of the chart. */}} -{{- define "misskey.name" -}} +{{- define "cherrypick.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} @@ -10,7 +10,7 @@ Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). If release name contains chart name it will be used as a full name. */}} -{{- define "misskey.fullname" -}} +{{- define "cherrypick.fullname" -}} {{- if .Values.fullnameOverride }} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} @@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name. {{/* Create chart name and version as used by the chart label. */}} -{{- define "misskey.chart" -}} +{{- define "cherrypick.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Common labels */}} -{{- define "misskey.labels" -}} -helm.sh/chart: {{ include "misskey.chart" . }} -{{ include "misskey.selectorLabels" . }} +{{- define "cherrypick.labels" -}} +helm.sh/chart: {{ include "cherrypick.chart" . }} +{{ include "cherrypick.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} @@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{/* Selector labels */}} -{{- define "misskey.selectorLabels" -}} -app.kubernetes.io/name: {{ include "misskey.name" . }} +{{- define "cherrypick.selectorLabels" -}} +app.kubernetes.io/name: {{ include "cherrypick.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} {{/* Create the name of the service account to use */}} -{{- define "misskey.serviceAccountName" -}} +{{- define "cherrypick.serviceAccountName" -}} {{- if .Values.serviceAccount.create }} -{{- default (include "misskey.fullname" .) .Values.serviceAccount.name }} +{{- default (include "cherrypick.fullname" .) .Values.serviceAccount.name }} {{- else }} {{- default "default" .Values.serviceAccount.name }} {{- end }} diff --git a/cypress/e2e/basic.cy.js b/cypress/e2e/basic.cy.js index f7099e497d..4a3ad6b59f 100644 --- a/cypress/e2e/basic.cy.js +++ b/cypress/e2e/basic.cy.js @@ -234,10 +234,10 @@ describe('After user setup', () => { it('note', () => { cy.get('[data-cy-open-post-form]').should('be.visible'); cy.get('[data-cy-open-post-form]').click(); - cy.get('[data-cy-post-form-text]').type('Hello, Misskey!'); + cy.get('[data-cy-post-form-text]').type('Hello, CherryPick!'); cy.get('[data-cy-open-post-form-submit]').click(); - cy.contains('Hello, Misskey!'); + cy.contains('Hello, CherryPick!'); }); it('open note form with hotkey', () => { diff --git a/packages/backend/src/server/web/boot.js b/packages/backend/src/server/web/boot.js index 5d97ad8a9a..158abfc3ba 100644 --- a/packages/backend/src/server/web/boot.js +++ b/packages/backend/src/server/web/boot.js @@ -237,7 +237,7 @@ font-family: "Pretendard JP", BIZ UDGothic, Roboto, HelveticaNeue, Arial, sans-serif; } - #misskey_app, + #cherypick_app, #splash { display: none !important; } diff --git a/packages/backend/src/server/web/error.css b/packages/backend/src/server/web/error.css index ab913f7a9f..c3d132b93a 100644 --- a/packages/backend/src/server/web/error.css +++ b/packages/backend/src/server/web/error.css @@ -2,7 +2,7 @@ font-family: BIZ UDGothic, Roboto, HelveticaNeue, Arial, sans-serif; } -#misskey_app, +#cherrypick_app, #splash { display: none !important; } @@ -107,4 +107,4 @@ summary > * { details { width: 50%; } -} \ No newline at end of file +} diff --git a/packages/frontend/src/boot/common.ts b/packages/frontend/src/boot/common.ts index deae600dcc..14d31746d4 100644 --- a/packages/frontend/src/boot/common.ts +++ b/packages/frontend/src/boot/common.ts @@ -225,9 +225,9 @@ export async function common(createVue: () => App) { // https://github.com/misskey-dev/misskey/pull/8575#issuecomment-1114239210 // なぜか2回実行されることがあるため、mountするdivを1つに制限する const rootEl = ((): HTMLElement => { - const MISSKEY_MOUNT_DIV_ID = 'misskey_app'; + const CHERRYPICK_MOUNT_DIV_ID = 'cherrypick_app'; - const currentRoot = document.getElementById(MISSKEY_MOUNT_DIV_ID); + const currentRoot = document.getElementById(CHERRYPICK_MOUNT_DIV_ID); if (currentRoot) { console.warn('multiple import detected'); @@ -235,7 +235,7 @@ export async function common(createVue: () => App) { } const root = document.createElement('div'); - root.id = MISSKEY_MOUNT_DIV_ID; + root.id = CHERRYPICK_MOUNT_DIV_ID; document.body.appendChild(root); return root; })(); diff --git a/packages/frontend/src/pages/welcome.entrance.a.vue b/packages/frontend/src/pages/welcome.entrance.a.vue index f082b4b3c7..3448fbf1fa 100644 --- a/packages/frontend/src/pages/welcome.entrance.a.vue +++ b/packages/frontend/src/pages/welcome.entrance.a.vue @@ -4,7 +4,7 @@
- +
@@ -105,7 +105,7 @@ os.apiGet('federation/instances', { opacity: 0.5; } - > .misskey { + > .cherrypick { position: fixed; top: 42px; left: 42px;