1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-11-23 22:56:53 +09:00

CherryPick🍒

This commit is contained in:
NoriDev 2023-05-28 18:35:56 +09:00
parent 1950385586
commit d0339758af
21 changed files with 75 additions and 78 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -10,7 +10,7 @@ assignees: ''
<!--
Thanks for reporting!
First, in order to avoid duplicate Issues, please search to see if the problem you found has already been reported.
Also, If you are NOT owner/admin of server, PLEASE DONT REPORT SERVER SPECIFIC ISSUES TO HERE! (e.g. feature XXX is not working in misskey.example) Please try with another misskey servers, and if your issue is only reproducible with specific server, contact your server's owner/admin first.
Also, If you are NOT owner/admin of server, PLEASE DONT REPORT SERVER SPECIFIC ISSUES TO HERE! (e.g. feature XXX is not working in cherrypick.example) Please try with another cherrypick servers, and if your issue is only reproducible with specific server, contact your server's owner/admin first.
-->
## 💡 Summary

View File

@ -3,7 +3,4 @@ groups:
reviewers: 2
internal_reviewers: 1
usernames:
- syuilo
- acid-chicken
- EbiseLutica
- tamaina
- noridev

View File

@ -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"

View File

@ -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

View File

@ -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")

View File

@ -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

View File

@ -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

View File

@ -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"]

View File

@ -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 }}

View File

@ -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

View File

@ -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 }}

View File

@ -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 }}

View File

@ -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', () => {

View File

@ -237,7 +237,7 @@
font-family: "Pretendard JP", BIZ UDGothic, Roboto, HelveticaNeue, Arial, sans-serif;
}
#misskey_app,
#cherypick_app,
#splash {
display: none !important;
}

View File

@ -2,7 +2,7 @@
font-family: BIZ UDGothic, Roboto, HelveticaNeue, Arial, sans-serif;
}
#misskey_app,
#cherrypick_app,
#splash {
display: none !important;
}

View File

@ -225,9 +225,9 @@ export async function common(createVue: () => App<Element>) {
// 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<Element>) {
}
const root = document.createElement('div');
root.id = MISSKEY_MOUNT_DIV_ID;
root.id = CHERRYPICK_MOUNT_DIV_ID;
document.body.appendChild(root);
return root;
})();

View File

@ -4,7 +4,7 @@
<XTimeline class="tl"/>
<div class="shape1"></div>
<div class="shape2"></div>
<img src="/client-assets/misskey.svg" class="misskey"/>
<img src="/client-assets/misskey.svg" class="cherrypick"/>
<div class="emojis">
<MkEmoji :normal="true" :noStyle="true" emoji="👍"/>
<MkEmoji :normal="true" :noStyle="true" emoji="❤"/>
@ -105,7 +105,7 @@ os.apiGet('federation/instances', {
opacity: 0.5;
}
> .misskey {
> .cherrypick {
position: fixed;
top: 42px;
left: 42px;