* add patch for version checking of outline-ru, not the original one

* optimize Dockerfile and add docker-compose.yml for deploying on localhost for testing purposes

* make ru_RU as the default language, combine patches into one

* update the workflow

* update docker* files

* rename the script

* testing translations

* add concurrency and fix regexps in the workflow

* disable action output

* bump outline to 0.83.0

* update Dockerfile

* update translations

* update readme

* update readme

* clear trailing whitespaces
This commit is contained in:
Evgeny
2025-04-12 00:46:50 +05:00
committed by GitHub
parent e098d1a7df
commit 032263ec5d
9 changed files with 533 additions and 312 deletions
+11 -3
View File
@@ -6,13 +6,21 @@ on:
- master
- dev
paths:
- .github/workflows/*
- .github/workflows/**
- outline/**
- tools/translation.json
- tools/return_ru.patch
- tools/translate.json
- tools/language.patch
- Dockerfile
workflow_dispatch:
concurrency:
group: outline
env:
DOCKER_BUILD_CHECKS_ANNOTATIONS: false
DOCKER_BUILD_SUMMARY: false
DOCKER_BUILD_RECORD_UPLOAD: false
jobs:
build:
name: Build [${{ matrix.arch }}]
+32 -32
View File
@@ -1,50 +1,50 @@
ARG APP_PATH=/opt/outline
ARG SRC_PATH=./outline
FROM node:20-slim AS base
FROM node:20 AS base
ARG APP_PATH
ARG SRC_PATH
WORKDIR $APP_PATH
COPY ${SRC_PATH}/package.json ${SRC_PATH}/yarn.lock ./
FROM base AS deps
RUN yarn install --production=true --frozen-lockfile --network-timeout 1000000 && \
yarn cache clean
FROM base AS build
RUN apt-get update && \
apt-get install -y patch && \
apt-get install -y patch cmake && \
rm -rf /var/lib/apt/lists/*
COPY ./outline/package.json ./outline/yarn.lock ./
COPY ./outline/patches ./patches
COPY ${SRC_PATH}/patches ./patches
ENV NODE_OPTIONS="--max-old-space-size=24000"
RUN yarn install --no-optional --frozen-lockfile --network-timeout 1000000 && \
yarn cache clean
COPY ./outline .
COPY ${SRC_PATH} .
COPY ./tools/language.patch .
RUN patch -p1 < language.patch
COPY ./tools/translation.json ./shared/i18n/locales/ru_RU/translation.json
COPY ./tools/return_ru.patch .
RUN patch -p1 < return_ru.patch
ARG CDN_URL
RUN yarn build
RUN rm -rf node_modules
RUN yarn install --production=true --frozen-lockfile --network-timeout 1000000 && \
yarn cache clean
ENV PORT=3000
FROM base AS release
ENV NODE_ENV=production
COPY --from=build $APP_PATH/build ./build
COPY --from=build $APP_PATH/server ./server
COPY --from=build $APP_PATH/public ./public
COPY --from=build $APP_PATH/.sequelizerc ./.sequelizerc
COPY --from=build $APP_PATH/node_modules ./node_modules
COPY --from=build $APP_PATH/package.json ./package.json
RUN apt-get update && \
apt-get install -y wget && \
apt-get install -y curl && \
rm -rf /var/lib/apt/lists/*
RUN addgroup --gid 1001 nodejs && \
adduser --uid 1001 --ingroup nodejs nodejs && \
chown -R nodejs:nodejs $APP_PATH/build && \
mkdir -p /var/lib/outline && \
chown -R nodejs:nodejs /var/lib/outline
ENV FILE_STORAGE_LOCAL_ROOT_DIR=/var/lib/outline/data
RUN mkdir -p "$FILE_STORAGE_LOCAL_ROOT_DIR" && \
chown -R nodejs:nodejs "$FILE_STORAGE_LOCAL_ROOT_DIR" && \
chmod 1777 "$FILE_STORAGE_LOCAL_ROOT_DIR"
VOLUME /var/lib/outline/data
USER nodejs
HEALTHCHECK --interval=1m CMD wget -qO- "http://localhost:${PORT:-3000}/_health" | grep -q "OK" || exit 1
EXPOSE 3000
ARG DATA_PATH=/var/lib/outline/data
ARG USER=nodejs
RUN useradd -U ${USER} && \
mkdir -p ${DATA_PATH} && \
chown -R ${USER}:${USER} ${APP_PATH} ${DATA_PATH}/.. && \
chmod 1777 ${DATA_PATH}
COPY --chown=${USER} --from=deps $APP_PATH/node_modules ./node_modules
COPY --chown=${USER} --from=build $APP_PATH/.sequelizerc .
COPY --chown=${USER} --from=build $APP_PATH/build ./build
COPY --chown=${USER} --from=build $APP_PATH/server ./server
COPY --chown=${USER} --from=build $APP_PATH/public ./public
ENV NODE_ENV=production
ENV PORT=3000
USER ${USER}
EXPOSE ${PORT}
VOLUME ${DATA_PATH}
HEALTHCHECK --interval=1m CMD curl -fs localhost:${PORT}/_health | grep -q OK || exit 1
CMD ["yarn", "start"]
-3
View File
@@ -6,7 +6,6 @@
## 📝 Примечания
- доступные архитектуры: `amd64` и `arm64`
- образ доступен в [Docker Hub](https://hub.docker.com/r/flameshikari/outline-ru/tags) и [GHCR](https://github.com/flameshikari/outline-ru/pkgs/container/outline-ru)
- за основу взят перевод из [этого коммита](https://github.com/outline/outline/commit/228d1faa9fd3cbb82409d98e1443fed65adc5715)
- сообщить о некорректном переводе можно [тут](https://github.com/flameshikari/outline-ru/discussions/8)
@@ -15,8 +14,6 @@
> перед установкой **ОБЯЗАТЕЛЬНО** прочтите [про бэкапы перед обновлением](https://docs.getoutline.com/s/hosting/doc/backups-KZtPOADCHG)
> если вы используете переменную `DEFAULT_LANGUAGE`, то можете задать ей значение `ru_RU`
Следуйте [официальной инструкции](https://docs.getoutline.com/s/hosting/doc/docker-7pfeLP5a8t), только в качестве `image` укажите `flameshikari/outline-ru:latest` (желательно зафиксировать версию, заменив `latest` на один из [доступных тегов](https://github.com/flameshikari/outline-ru/tags)). Например:
```yaml
+139
View File
@@ -0,0 +1,139 @@
volumes:
outline:
name: outline
outline-postgres:
name: outline-postgres
networks:
default:
name: outline
services:
outline:
container_name: outline
image: flameshikari/outline-ru:nightly
build: .
network_mode: host
pull_policy: always
volumes:
- outline:/var/lib/outline/data
depends_on:
- outline-postgres
- outline-redis
- outline-oidc
environment:
FILE_STORAGE: local
FORCE_HTTPS: false
PORT: 10240
URL: http://localhost:10240
SECRET_KEY: deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef
UTILS_SECRET: deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef
REDIS_URL: redis://localhost:10242
DATABASE_URL: postgres://outline:outline@localhost:10243/outline
PGSSLMODE: disable
OIDC_CLIENT_ID: outline
OIDC_CLIENT_SECRET: outline
OIDC_AUTH_URI: http://localhost:10241/connect/authorize
OIDC_TOKEN_URI: http://localhost:10241/connect/token
OIDC_USERINFO_URI: http://localhost:10241/connect/userinfo
OIDC_SCOPES: openid profile email
OIDC_USERNAME_CLAIM: username
outline-oidc:
container_name: outline-oidc
image: ghcr.io/soluto/oidc-server-mock:0.11.0
ports:
- 10241:80
healthcheck:
test: curl -fs localhost/health || exit 1
start_period: 2s
interval: 1s
timeout: 100ms
retries: 10
environment:
ASPNETCORE_URLS: http://+:80
ASPNETCORE_ENVIRONMENT: Development
CLIENTS_CONFIGURATION_INLINE: |
[
{
"ClientId": "outline",
"ClientSecrets": ["outline"],
"RedirectUris": ["http://localhost:10240/auth/oidc.callback"],
"AllowedGrantTypes": ["authorization_code"],
"AllowedScopes": ["openid", "profile", "email"],
"RequirePkce": false
}
]
USERS_CONFIGURATION_INLINE: |
[
{
"SubjectId": "1",
"Username": "outline",
"Password": "outline",
"Claims": [
{
"Type": "email",
"Value": "mail@example.com",
"ValueType": "string"
},
{
"Type": "name",
"Value": "Outline",
"ValueType": "string"
}
]
}
]
SERVER_OPTIONS_INLINE: |
{
"AccessTokenJwtType": "JWT",
"Discovery": {
"ShowKeySet": true
},
"Authentication": {
"CookieSameSiteMode": "Lax",
"CheckSessionCookieSameSiteMode": "Lax"
}
}
LOGIN_OPTIONS_INLINE: |
{
"AllowRememberLogin": false
}
LOGOUT_OPTIONS_INLINE: |
{
"AutomaticRedirectAfterSignOut": true
}
ASPNET_SERVICES_OPTIONS_INLINE: |
{
"ForwardedHeadersOptions": {
"ForwardedHeaders" : "All"
}
}
outline-redis:
container_name: outline-redis
image: redis:7
ports:
- 10242:6379
healthcheck:
test: redis-cli ping
interval: 10s
timeout: 30s
retries: 3
outline-postgres:
container_name: outline-postgres
image: postgres:17
ports:
- 10243:5432
volumes:
- outline-postgres:/var/lib/postgresql/data
healthcheck:
test: pg_isready
interval: 30s
timeout: 20s
retries: 3
environment:
POSTGRES_USER: outline
POSTGRES_PASSWORD: outline
POSTGRES_DB: outline
+1 -1
Submodule outline updated: 7bc687b6bf...4e2612d263
+74
View File
@@ -0,0 +1,74 @@
diff --git a/app/components/Sidebar/components/Version.tsx b/app/components/Sidebar/components/Version.tsx
index f2e8810b2..d4e202447 100644
--- a/app/components/Sidebar/components/Version.tsx
+++ b/app/components/Sidebar/components/Version.tsx
@@ -30,7 +30,7 @@ export default function Version() {
return (
<SidebarLink
target="_blank"
- href="https://github.com/outline/outline/releases"
+ href="https://github.com/flameshikari/outline-ru/releases"
label={
<>
v{currentVersion}
diff --git a/server/env.ts b/server/env.ts
index 34f926029..88f97d515 100644
--- a/server/env.ts
+++ b/server/env.ts
@@ -245,7 +245,7 @@ export class Environment {
*/
@Public
@IsIn(languages)
- public DEFAULT_LANGUAGE = environment.DEFAULT_LANGUAGE ?? "en_US";
+ public DEFAULT_LANGUAGE = environment.DEFAULT_LANGUAGE ?? "ru_RU";
/**
* A comma list of which services should be enabled on this instance defaults to all.
diff --git a/server/utils/getInstallationInfo.ts b/server/utils/getInstallationInfo.ts
index 1d11a426c..00ec42f69 100644
--- a/server/utils/getInstallationInfo.ts
+++ b/server/utils/getInstallationInfo.ts
@@ -2,7 +2,7 @@ import { version } from "../../package.json";
import fetch from "./fetch";
const dockerhubLink =
- "https://hub.docker.com/v2/repositories/outlinewiki/outline";
+ "https://hub.docker.com/v2/repositories/flameshikari/outline-ru";
function isFullReleaseVersion(versionName: string): boolean {
const releaseRegex = /^(version-)?\d+\.\d+\.\d+$/; // Matches "N.N.N" or "version-N.N.N" for dockerhub releases before v0.56.0"
diff --git a/shared/i18n/index.ts b/shared/i18n/index.ts
index e315ef413..b580ec795 100644
--- a/shared/i18n/index.ts
+++ b/shared/i18n/index.ts
@@ -72,6 +72,10 @@ export const languageOptions: LanguageOption[] = [
label: "فارسی (Persian)",
value: "fa_IR",
},
+ {
+ label: "Русский (Russian)",
+ value: "ru_RU",
+ },
{
label: "Svenska (Swedish)",
value: "sv_SE",
diff --git a/shared/utils/date.ts b/shared/utils/date.ts
index 397b2c7a4..a45d418ae 100644
--- a/shared/utils/date.ts
+++ b/shared/utils/date.ts
@@ -23,6 +23,7 @@ import {
ptBR,
pt,
pl,
+ ru,
sv,
tr,
vi,
@@ -175,6 +176,7 @@ const locales = {
pt_BR: ptBR,
pt_PT: pt,
pl_PL: pl,
+ ru_RU: ru,
sv_SE: sv,
tr_TR: tr,
uk_UA: uk,
-35
View File
@@ -1,35 +0,0 @@
diff --git a/shared/i18n/index.ts b/shared/i18n/index.ts
index e315ef413..b580ec795 100644
--- a/shared/i18n/index.ts
+++ b/shared/i18n/index.ts
@@ -72,6 +72,10 @@ export const languageOptions: LanguageOption[] = [
label: "فارسی (Persian)",
value: "fa_IR",
},
+ {
+ label: "Русский (Russian)",
+ value: "ru_RU",
+ },
{
label: "Svenska (Swedish)",
value: "sv_SE",
diff --git a/shared/utils/date.ts b/shared/utils/date.ts
index 397b2c7a4..a45d418ae 100644
--- a/shared/utils/date.ts
+++ b/shared/utils/date.ts
@@ -23,6 +23,7 @@ import {
ptBR,
pt,
pl,
+ ru,
sv,
tr,
vi,
@@ -175,6 +176,7 @@ const locales = {
pt_BR: ptBR,
pt_PT: pt,
pl_PL: pl,
+ ru_RU: ru,
sv_SE: sv,
tr_TR: tr,
uk_UA: uk,
+274 -236
View File
File diff suppressed because it is too large Load Diff