forked from transfem-org/Sharkey
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://git.joinsharkey.org/Sharkey/Sharkey …
…into develop
- Loading branch information
Showing
36 changed files
with
299 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
name: "Feature Request" | ||
about: "Suggest an idea for this project" | ||
title: "feat: " | ||
--- | ||
## Summary | ||
<!-- Tell us what the suggestion is --> | ||
|
||
## Purpose | ||
<!-- Describe the specific problem or need you think this feature will solve, and who it will help. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!-- ℹ お読みください / README | ||
PRありがとうございます! PRを作成する前に、コントリビューションガイドをご確認ください: | ||
Thank you for your PR! Before creating a PR, please check the contribution guide: | ||
https://github.com/misskey-dev/misskey/blob/develop/CONTRIBUTING.md | ||
--> | ||
|
||
## What | ||
<!-- このPRで何をしたのか? どう変わるのか? --> | ||
<!-- What did you do with this PR? How will it change things? --> | ||
|
||
## Why | ||
<!-- なぜそうするのか? どういう意図なのか? 何が困っているのか? --> | ||
<!-- Why do you do it? What are your intentions? What is the problem? --> | ||
|
||
## Additional info (optional) | ||
<!-- テスト観点など --> | ||
<!-- Test perspective, etc --> | ||
|
||
## Checklist | ||
- [ ] Read the [contribution guide](https://github.com/misskey-dev/misskey/blob/develop/CONTRIBUTING.md) | ||
- [ ] Test working in a local environment | ||
- [ ] (If needed) Add story of storybook | ||
- [ ] (If needed) Update CHANGELOG.md | ||
- [ ] (If possible) Add tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,101 +1,62 @@ | ||
# syntax = docker/dockerfile:1.4 | ||
|
||
ARG NODE_VERSION=20.5.1-bullseye | ||
ARG NODE_VERSION=21.4.0-alpine3.18 | ||
|
||
# build assets & compile TypeScript | ||
|
||
FROM --platform=$BUILDPLATFORM node:${NODE_VERSION} AS native-builder | ||
|
||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ | ||
--mount=type=cache,target=/var/lib/apt,sharing=locked \ | ||
rm -f /etc/apt/apt.conf.d/docker-clean \ | ||
; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache \ | ||
&& apt-get update \ | ||
&& apt-get install -yqq --no-install-recommends \ | ||
build-essential curl ca-certificates | ||
|
||
ARG TARGETARCH | ||
|
||
RUN curl -L https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-$TARGETARCH-static.tar.xz -o /ffmpeg.tar.xz \ | ||
&& tar xvf /ffmpeg.tar.xz -C / --strip-components 1 --wildcards 'ffmpeg-*-static/ffmpeg' 'ffmpeg-*-static/ffprobe' | ||
FROM node:${NODE_VERSION} as build | ||
|
||
RUN corepack enable | ||
|
||
WORKDIR /sharkey | ||
|
||
COPY --link ["pnpm-lock.yaml", "pnpm-workspace.yaml", "package.json", "./"] | ||
COPY --link ["scripts", "./scripts"] | ||
COPY --link ["packages/megalodon/package.json", "./packages/megalodon/"] | ||
COPY --link ["packages/backend/package.json", "./packages/backend/"] | ||
COPY --link ["packages/frontend/package.json", "./packages/frontend/"] | ||
COPY --link ["packages/sw/package.json", "./packages/sw/"] | ||
COPY --link ["packages/misskey-js/package.json", "./packages/misskey-js/"] | ||
|
||
RUN --mount=type=cache,target=/root/.local/share/pnpm/store,sharing=locked \ | ||
pnpm i --frozen-lockfile --aggregate-output | ||
RUN apk add git linux-headers build-base | ||
|
||
COPY --link . ./ | ||
ENV PYTHONUNBUFFERED=1 | ||
RUN apk add --update python3 && ln -sf python3 /usr/bin/python | ||
RUN python3 -m ensurepip | ||
RUN pip3 install --no-cache --upgrade pip setuptools | ||
|
||
ARG NODE_ENV=production | ||
COPY . ./ | ||
|
||
RUN git submodule update --init | ||
RUN git submodule update --init --recursive | ||
RUN pnpm config set fetch-retries 5 | ||
RUN --mount=type=cache,target=/root/.local/share/pnpm/store,sharing=locked \ | ||
pnpm i | ||
RUN pnpm build | ||
RUN rm -rf .git/ | ||
|
||
# build native dependencies for target platform | ||
|
||
FROM --platform=$TARGETPLATFORM node:${NODE_VERSION} AS target-builder | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -yqq --no-install-recommends \ | ||
build-essential | ||
|
||
RUN corepack enable | ||
|
||
WORKDIR /sharkey | ||
|
||
COPY --link ["pnpm-lock.yaml", "pnpm-workspace.yaml", "package.json", "./"] | ||
COPY --link ["scripts", "./scripts"] | ||
COPY --link ["packages/megalodon/package.json", "./packages/megalodon/"] | ||
COPY --link ["packages/backend/package.json", "./packages/backend/"] | ||
|
||
RUN node scripts/trim-deps.mjs | ||
RUN mv packages/frontend/assets sharkey-assets | ||
RUN rm -r node_modules packages/frontend packages/sw | ||
RUN --mount=type=cache,target=/root/.local/share/pnpm/store,sharing=locked \ | ||
pnpm i --frozen-lockfile --aggregate-output | ||
|
||
FROM --platform=$TARGETPLATFORM node:${NODE_VERSION}-slim AS runner | ||
pnpm i --prod | ||
RUN rm -rf .git | ||
|
||
ARG UID="991" | ||
ARG GID="991" | ||
FROM node:${NODE_VERSION} | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
tini curl libjemalloc-dev libjemalloc2 \ | ||
&& ln -s /usr/lib/$(uname -m)-linux-gnu/libjemalloc.so.2 /usr/local/lib/libjemalloc.so \ | ||
&& corepack enable \ | ||
&& groupadd -g "${GID}" sharkey \ | ||
&& useradd -l -u "${UID}" -g "${GID}" -m -d /sharkey sharkey \ | ||
&& 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 sharkey | ||
WORKDIR /sharkey | ||
|
||
COPY --chown=sharkey:sharkey --from=target-builder /sharkey/node_modules ./node_modules | ||
COPY --chown=sharkey:sharkey --from=target-builder /sharkey/packages/megalodon/node_modules ./packages/megalodon/node_modules | ||
COPY --chown=sharkey:sharkey --from=target-builder /sharkey/packages/backend/node_modules ./packages/backend/node_modules | ||
COPY --chown=sharkey:sharkey --from=native-builder /ffmpeg /usr/local/bin/ | ||
COPY --chown=sharkey:sharkey --from=native-builder /ffprobe /usr/local/bin/ | ||
COPY --chown=sharkey:sharkey --from=native-builder /sharkey/built ./built | ||
COPY --chown=sharkey:sharkey --from=native-builder /sharkey/packages/megalodon/lib ./packages/megalodon/lib | ||
COPY --chown=sharkey:sharkey --from=native-builder /sharkey/packages/backend/built ./packages/backend/built | ||
COPY --chown=sharkey:sharkey --from=native-builder /sharkey/fluent-emojis /sharkey/fluent-emojis | ||
COPY --chown=sharkey:sharkey . ./ | ||
RUN apk add ffmpeg tini | ||
|
||
COPY --from=build /sharkey/built ./built | ||
COPY --from=build /sharkey/node_modules ./node_modules | ||
COPY --from=build /sharkey/packages/backend/built ./packages/backend/built | ||
COPY --from=build /sharkey/packages/backend/node_modules ./packages/backend/node_modules | ||
COPY --from=build /sharkey/packages/megalodon/lib ./packages/megalodon/lib | ||
COPY --from=build /sharkey/packages/megalodon/node_modules ./packages/megalodon/node_modules | ||
COPY --from=build /sharkey/packages/misskey-js/built ./packages/misskey-js/built | ||
COPY --from=build /sharkey/packages/misskey-js/node_modules ./packages/misskey-js/node_modules | ||
COPY --from=build /sharkey/fluent-emojis ./fluent-emojis | ||
COPY --from=build /sharkey/sharkey-assets ./packages/frontend/assets | ||
|
||
COPY package.json ./package.json | ||
COPY pnpm-workspace.yaml ./pnpm-workspace.yaml | ||
COPY packages/backend/package.json ./packages/backend/package.json | ||
COPY packages/backend/check_connect.js ./packages/backend/check_connect.js | ||
COPY packages/backend/ormconfig.js ./packages/backend/ormconfig.js | ||
COPY packages/backend/migration ./packages/backend/migration | ||
COPY packages/backend/assets ./packages/backend/assets | ||
COPY packages/megalodon/package.json ./packages/megalodon/package.json | ||
COPY packages/misskey-js/package.json ./packages/misskey-js/package.json | ||
|
||
ENV LD_PRELOAD=/usr/local/lib/libjemalloc.so | ||
ENV NODE_ENV=production | ||
VOLUME "/sharkey/files" | ||
HEALTHCHECK --interval=5s --retries=20 CMD ["/bin/bash", "/sharkey/healthcheck.sh"] | ||
ENTRYPOINT ["/usr/bin/tini", "--"] | ||
RUN corepack enable | ||
ENTRYPOINT ["/sbin/tini", "--"] | ||
CMD ["pnpm", "run", "migrateandstart"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/backend/assets/fonts/sharkey-icons/custom-sharkey-icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added
BIN
+1.26 KB
packages/backend/assets/fonts/sharkey-icons/custom-sharkey-icons.woff
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
@charset "UTF-8"; | ||
|
||
@font-face { | ||
font-family: "custom-sharkey-icons"; | ||
src: url("./custom-sharkey-icons.woff") format("woff"), | ||
url("./custom-sharkey-icons.ttf") format("truetype"), | ||
url("./custom-sharkey-icons.svg#custom-sharkey-icons") format("svg"); | ||
font-weight: normal; | ||
font-style: normal; | ||
font-display: block; | ||
} | ||
|
||
.sk-icons { | ||
font-family: "custom-sharkey-icons" !important; | ||
font-style: normal; | ||
font-weight: normal; | ||
font-variant: normal; | ||
text-transform: none; | ||
line-height: 1; | ||
speak: none; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
|
||
.sk-icons.sk-shark:before { | ||
content: "\61"; | ||
} | ||
|
||
.sk-icons.sk-misskey:before { | ||
content: "\62"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export class NSFWInstance1701809447000 { | ||
name = 'NSFWInstance1701809447000' | ||
|
||
async up(queryRunner) { | ||
await queryRunner.query(`ALTER TABLE "instance" ADD "isNSFW" boolean NOT NULL DEFAULT false`); | ||
} | ||
|
||
async down(queryRunner) { | ||
await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "isNSFW"`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.