feat: add fluxer upstream source and self-hosting documentation
- Clone of github.com/fluxerapp/fluxer (official upstream) - SELF_HOSTING.md: full VM rebuild procedure, architecture overview, service reference, step-by-step setup, troubleshooting, seattle reference - dev/.env.example: all env vars with secrets redacted and generation instructions - dev/livekit.yaml: LiveKit config template with placeholder keys - fluxer-seattle/: existing seattle deployment setup scripts
This commit is contained in:
85
fluxer/fluxer_admin/Dockerfile
Normal file
85
fluxer/fluxer_admin/Dockerfile
Normal file
@@ -0,0 +1,85 @@
|
||||
ARG BUILD_SHA
|
||||
ARG BUILD_NUMBER
|
||||
ARG BUILD_TIMESTAMP
|
||||
ARG RELEASE_CHANNEL=nightly
|
||||
|
||||
FROM node:24-bookworm-slim AS base
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
RUN corepack enable && corepack prepare pnpm@10.26.0 --activate
|
||||
|
||||
FROM base AS deps
|
||||
|
||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
||||
COPY patches/ ./patches/
|
||||
COPY packages/ ./packages/
|
||||
COPY fluxer_admin/package.json ./fluxer_admin/
|
||||
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
FROM deps AS build
|
||||
|
||||
COPY tsconfigs /usr/src/app/tsconfigs
|
||||
COPY fluxer_admin/tsconfig.json ./fluxer_admin/
|
||||
COPY fluxer_admin/src ./fluxer_admin/src
|
||||
COPY fluxer_admin/public ./fluxer_admin/public
|
||||
|
||||
WORKDIR /usr/src/app/fluxer_admin
|
||||
RUN pnpm --filter @fluxer/config generate
|
||||
RUN pnpm build:css
|
||||
|
||||
FROM base AS prod-deps
|
||||
|
||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
||||
COPY patches/ ./patches/
|
||||
COPY packages/ ./packages/
|
||||
COPY fluxer_admin/package.json ./fluxer_admin/
|
||||
|
||||
RUN pnpm install --frozen-lockfile --prod
|
||||
|
||||
COPY --from=build /usr/src/app/packages/admin/public /usr/src/app/packages/admin/public
|
||||
|
||||
FROM node:24-bookworm-slim
|
||||
|
||||
ARG BUILD_SHA
|
||||
ARG BUILD_NUMBER
|
||||
ARG BUILD_TIMESTAMP
|
||||
ARG RELEASE_CHANNEL
|
||||
|
||||
WORKDIR /usr/src/app/fluxer_admin
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
curl && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN corepack enable && corepack prepare pnpm@10.26.0 --activate
|
||||
|
||||
COPY --from=prod-deps /usr/src/app/node_modules /usr/src/app/node_modules
|
||||
COPY --from=prod-deps /usr/src/app/fluxer_admin/node_modules ./node_modules
|
||||
COPY --from=prod-deps /usr/src/app/packages /usr/src/app/packages
|
||||
COPY --from=build /usr/src/app/packages/config/src/ConfigSchema.json /usr/src/app/packages/config/src/ConfigSchema.json
|
||||
COPY --from=build /usr/src/app/packages/config/src/MasterZodSchema.generated.tsx /usr/src/app/packages/config/src/MasterZodSchema.generated.tsx
|
||||
COPY tsconfigs /usr/src/app/tsconfigs
|
||||
COPY --from=build /usr/src/app/fluxer_admin/tsconfig.json ./tsconfig.json
|
||||
COPY --from=build /usr/src/app/fluxer_admin/src ./src
|
||||
COPY --from=build /usr/src/app/fluxer_admin/public ./public
|
||||
COPY fluxer_admin/package.json ./
|
||||
|
||||
RUN mkdir -p /usr/src/app/.cache/corepack && \
|
||||
chown -R nobody:nogroup /usr/src/app
|
||||
|
||||
ENV HOME=/usr/src/app
|
||||
ENV COREPACK_HOME=/usr/src/app/.cache/corepack
|
||||
ENV NODE_ENV=production
|
||||
ENV FLUXER_ADMIN_PORT=8080
|
||||
ENV BUILD_SHA=${BUILD_SHA}
|
||||
ENV BUILD_NUMBER=${BUILD_NUMBER}
|
||||
ENV BUILD_TIMESTAMP=${BUILD_TIMESTAMP}
|
||||
ENV RELEASE_CHANNEL=${RELEASE_CHANNEL}
|
||||
|
||||
USER nobody
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["pnpm", "start"]
|
||||
27
fluxer/fluxer_admin/package.json
Normal file
27
fluxer/fluxer_admin/package.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "fluxer_admin",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build:css": "pnpm --filter @fluxer/admin build:css",
|
||||
"build:css:watch": "pnpm --filter @fluxer/admin build:css:watch",
|
||||
"dev": "tsx watch --clear-screen=false src/index.tsx",
|
||||
"start": "tsx src/index.tsx",
|
||||
"typecheck": "tsgo --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fluxer/admin": "workspace:*",
|
||||
"@fluxer/config": "workspace:*",
|
||||
"@fluxer/constants": "workspace:*",
|
||||
"@fluxer/hono": "workspace:*",
|
||||
"@fluxer/initialization": "workspace:*",
|
||||
"@fluxer/logger": "workspace:*",
|
||||
"tsx": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "catalog:",
|
||||
"@typescript/native-preview": "catalog:",
|
||||
"tailwindcss": "catalog:"
|
||||
},
|
||||
"packageManager": "pnpm@10.29.3"
|
||||
}
|
||||
0
fluxer/fluxer_admin/public/static/.gitkeep
Normal file
0
fluxer/fluxer_admin/public/static/.gitkeep
Normal file
51
fluxer/fluxer_admin/src/Config.tsx
Normal file
51
fluxer/fluxer_admin/src/Config.tsx
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {loadConfig} from '@fluxer/config/src/ConfigLoader';
|
||||
import {
|
||||
extractBaseServiceConfig,
|
||||
extractBuildInfoConfig,
|
||||
extractKVClientConfig,
|
||||
extractRateLimit,
|
||||
} from '@fluxer/config/src/ServiceConfigSlices';
|
||||
import {ADMIN_OAUTH2_APPLICATION_ID} from '@fluxer/constants/src/Core';
|
||||
|
||||
const master = await loadConfig();
|
||||
const adminOAuthRedirectUri = `${master.endpoints.admin}/oauth2_callback`;
|
||||
|
||||
export const Config = {
|
||||
...extractBaseServiceConfig(master),
|
||||
...extractKVClientConfig(master),
|
||||
...extractBuildInfoConfig(),
|
||||
secretKeyBase: master.services.admin.secret_key_base,
|
||||
apiEndpoint: master.endpoints.api,
|
||||
mediaEndpoint: master.endpoints.media,
|
||||
staticCdnEndpoint: master.endpoints.static_cdn,
|
||||
adminEndpoint: master.endpoints.admin,
|
||||
webAppEndpoint: master.endpoints.app,
|
||||
oauthClientId: ADMIN_OAUTH2_APPLICATION_ID.toString(),
|
||||
oauthClientSecret: master.services.admin.oauth_client_secret,
|
||||
oauthRedirectUri: adminOAuthRedirectUri,
|
||||
port: master.services.admin.port,
|
||||
basePath: master.services.admin.base_path,
|
||||
selfHosted: master.instance.self_hosted,
|
||||
rateLimit: extractRateLimit(master.services.admin.rate_limit),
|
||||
};
|
||||
|
||||
export type Config = typeof Config;
|
||||
26
fluxer/fluxer_admin/src/Instrument.tsx
Normal file
26
fluxer/fluxer_admin/src/Instrument.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {Config} from '@app/Config';
|
||||
import {createServiceInstrumentation} from '@fluxer/initialization/src/CreateServiceInstrumentation';
|
||||
|
||||
export const shutdownInstrumentation = createServiceInstrumentation({
|
||||
serviceName: 'fluxer-admin',
|
||||
config: Config,
|
||||
});
|
||||
23
fluxer/fluxer_admin/src/Logger.tsx
Normal file
23
fluxer/fluxer_admin/src/Logger.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {createLogger, type Logger as FluxerLogger} from '@fluxer/logger/src/Logger';
|
||||
|
||||
export const Logger = createLogger('fluxer-admin');
|
||||
export type Logger = FluxerLogger;
|
||||
54
fluxer/fluxer_admin/src/index.tsx
Normal file
54
fluxer/fluxer_admin/src/index.tsx
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {Config} from '@app/Config';
|
||||
import {shutdownInstrumentation} from '@app/Instrument';
|
||||
import {Logger} from '@app/Logger';
|
||||
import {createAdminApp} from '@fluxer/admin/src/App';
|
||||
import {createServiceTelemetry} from '@fluxer/hono/src/middleware/TelemetryAdapters';
|
||||
import {createServer, setupGracefulShutdown} from '@fluxer/hono/src/Server';
|
||||
|
||||
const telemetry = createServiceTelemetry({
|
||||
serviceName: 'fluxer-admin',
|
||||
skipPaths: ['/_health', '/robots.txt', '/static'],
|
||||
});
|
||||
|
||||
const {app, shutdown} = createAdminApp({
|
||||
config: Config,
|
||||
logger: Logger,
|
||||
assetVersion: Config.buildTimestamp || Date.now().toString(),
|
||||
metricsCollector: telemetry.metricsCollector,
|
||||
tracing: telemetry.tracing,
|
||||
});
|
||||
|
||||
const port = Config.port;
|
||||
Logger.info({port}, `Starting Fluxer Admin on port ${port}`);
|
||||
|
||||
const server = createServer(app, {port});
|
||||
|
||||
setupGracefulShutdown(
|
||||
async () => {
|
||||
shutdown();
|
||||
await shutdownInstrumentation();
|
||||
await new Promise<void>((resolve) => {
|
||||
server.close(() => resolve());
|
||||
});
|
||||
},
|
||||
{logger: Logger},
|
||||
);
|
||||
10
fluxer/fluxer_admin/tsconfig.json
Normal file
10
fluxer/fluxer_admin/tsconfig.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"extends": "../tsconfigs/hono-service.json",
|
||||
"compilerOptions": {
|
||||
"paths": {
|
||||
"@app/*": ["./src/*"],
|
||||
"@fluxer/*": ["./../packages/*", "./../packages/*/src/index.tsx"]
|
||||
}
|
||||
},
|
||||
"include": ["src/**/*"]
|
||||
}
|
||||
Reference in New Issue
Block a user