fix: self hosting
This commit is contained in:
parent
9e8a9dafb8
commit
d06839bb96
@ -3,6 +3,11 @@ port: 7880
|
||||
keys:
|
||||
'<replace-with-api-key>': '<replace-with-api-secret>'
|
||||
|
||||
webhook:
|
||||
api_key: '<your_livekit_api_key>'
|
||||
urls:
|
||||
- https://your.domain/api/webhooks/livekit
|
||||
|
||||
rtc:
|
||||
tcp_port: 7881
|
||||
|
||||
|
||||
@ -250,7 +250,7 @@ export default () => {
|
||||
|
||||
output: {
|
||||
path: DIST_DIR,
|
||||
publicPath: isProduction ? `${CDN_ENDPOINT}/` : '/',
|
||||
publicPath: '/',
|
||||
workerPublicPath: '/',
|
||||
filename: (pathData) => {
|
||||
if (pathData.chunk?.name === 'sw') {
|
||||
|
||||
@ -93,6 +93,22 @@ get_first_viewable_text_channel(State) ->
|
||||
EveryoneChannelId = find_everyone_viewable_text_channel(Channels, State),
|
||||
{reply, #{channel_id => EveryoneChannelId}, State}.
|
||||
|
||||
-spec fetch_voice_states_from_server(guild_state()) -> [map()].
|
||||
fetch_voice_states_from_server(State) ->
|
||||
case maps:get(voice_server_pid, State, undefined) of
|
||||
Pid when is_pid(Pid) ->
|
||||
try gen_server:call(Pid, {get_voice_states_list}, 5000) of
|
||||
VoiceStates when is_list(VoiceStates) -> VoiceStates;
|
||||
_ -> []
|
||||
catch
|
||||
exit:{timeout, _} -> [];
|
||||
exit:{noproc, _} -> [];
|
||||
exit:{normal, _} -> []
|
||||
end;
|
||||
_ ->
|
||||
guild_voice:get_voice_states_list(State)
|
||||
end.
|
||||
|
||||
-spec get_guild_state(user_id(), guild_state()) -> map().
|
||||
get_guild_state(UserId, State) ->
|
||||
Data = guild_data_map(State),
|
||||
@ -107,7 +123,7 @@ get_guild_state(UserId, State) ->
|
||||
undefined -> [];
|
||||
M -> [M]
|
||||
end,
|
||||
VoiceStates = guild_voice:get_voice_states_list(State),
|
||||
VoiceStates = fetch_voice_states_from_server(State),
|
||||
VoiceMembers = voice_members_from_states(VoiceStates, AllMembers),
|
||||
Members = merge_members(OwnMemberList, VoiceMembers),
|
||||
MemberCount = maps:get(member_count, State, length(AllMembers)),
|
||||
|
||||
@ -16,6 +16,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
g++ \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
|
||||
--default-toolchain stable --profile minimal \
|
||||
&& rustup target add wasm32-unknown-unknown \
|
||||
&& cargo install wasm-pack
|
||||
|
||||
FROM base AS deps
|
||||
|
||||
COPY pnpm-workspace.yaml ./
|
||||
@ -55,6 +60,13 @@ COPY packages/worker/package.json ./packages/worker/
|
||||
COPY packages/http_client/package.json ./packages/http_client/
|
||||
COPY packages/schema/package.json ./packages/schema/
|
||||
COPY fluxer_server/package.json ./fluxer_server/
|
||||
|
||||
for pkg in date_utils elasticsearch_search geo_utils geoip i18n kv_client limits \
|
||||
list_utils locale markdown_parser media_proxy_utils meilisearch_search \
|
||||
mime_utils nats number_utils openapi time; do
|
||||
COPY packages/${pkg}/package.json ./packages/${pkg}/
|
||||
done
|
||||
|
||||
COPY fluxer_app/package.json ./fluxer_app/
|
||||
|
||||
RUN pnpm install --frozen-lockfile
|
||||
@ -73,6 +85,8 @@ COPY fluxer_server/ ./fluxer_server/
|
||||
|
||||
RUN pnpm --filter @fluxer/marketing build:css
|
||||
|
||||
RUN pnpm --filter admin build:css
|
||||
|
||||
COPY fluxer_media_proxy/data/model.onnx ./fluxer_media_proxy/data/model.onnx
|
||||
|
||||
RUN cd fluxer_server && pnpm typecheck
|
||||
@ -106,6 +120,9 @@ RUN LOGGER_LEVEL=${LOGGER_LEVEL} envsubst '${LOGGER_LEVEL}' < fluxer_gateway/con
|
||||
(cd fluxer_gateway && rebar3 as prod release)
|
||||
|
||||
FROM deps AS app-build
|
||||
ARG FLUXER_BUILD_CONFIG="{}"
|
||||
RUN echo "$FLUXER_BUILD_CONFIG" > /tmp/fluxer-build-config.json
|
||||
ENV FLUXER_CONFIG=/tmp/fluxer-build-config.json
|
||||
|
||||
COPY tsconfigs /usr/src/app/tsconfigs
|
||||
|
||||
@ -196,4 +213,4 @@ ENV RELEASE_CHANNEL=${RELEASE_CHANNEL}
|
||||
HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
|
||||
CMD curl -f http://localhost:8080/_health || exit 1
|
||||
|
||||
ENTRYPOINT ["pnpm", "start"]
|
||||
ENTRYPOINT ["pnpm", "--filter", "fluxer_server", "start"]
|
||||
|
||||
@ -277,6 +277,7 @@ function createAppServerInitializer(context: ServiceInitializationContext): Serv
|
||||
|
||||
const publicUrlHost = new URL(requireValue(config.endpoints.app, 'endpoints.app')).origin;
|
||||
const mediaUrlHost = new URL(requireValue(config.endpoints.media, 'endpoints.media')).origin;
|
||||
const staticCdnHost = new URL(requireValue(config.endpoints.static_cdn, 'endpoints.static_cdn')).origin;
|
||||
|
||||
const appServer = createAppServer({
|
||||
staticDir,
|
||||
@ -289,10 +290,10 @@ function createAppServerInitializer(context: ServiceInitializationContext): Serv
|
||||
cspDirectives: {
|
||||
defaultSrc: ["'self'"],
|
||||
scriptSrc: ["'self'", "'unsafe-inline'"],
|
||||
styleSrc: ["'self'", "'unsafe-inline'"],
|
||||
imgSrc: ["'self'", 'data:', 'blob:', publicUrlHost, mediaUrlHost],
|
||||
styleSrc: ["'self'", "'unsafe-inline'", staticCdnHost],
|
||||
imgSrc: ["'self'", 'data:', 'blob:', publicUrlHost, mediaUrlHost, staticCdnHost],
|
||||
connectSrc: ["'self'", 'wss:', 'ws:', publicUrlHost],
|
||||
fontSrc: ["'self'"],
|
||||
fontSrc: ["'self'", staticCdnHost],
|
||||
mediaSrc: ["'self'", 'blob:', mediaUrlHost],
|
||||
frameSrc: ["'none'"],
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user