-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Hoang Pham <[email protected]>
- Loading branch information
Showing
13 changed files
with
1,783 additions
and
5 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
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules/ | ||
*.pem | ||
appinfo |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
# SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
*.pem | ||
node_modules/ |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM node:22.9.0-alpine3.20 AS build | ||
SHELL ["/bin/ash", "-eo", "pipefail", "-c"] | ||
ARG NODE_ENV=production | ||
COPY ./ /app | ||
WORKDIR /app | ||
RUN apk upgrade --no-cache -a && \ | ||
apk add --no-cache ca-certificates && \ | ||
npm install --global clean-modules && \ | ||
npm clean-install && \ | ||
clean-modules --yes && \ | ||
npm cache clean --force | ||
|
||
FROM node:22.9.0-alpine3.20 | ||
COPY --from=build --chown=nobody:nobody /app /app | ||
WORKDIR /app | ||
RUN apk upgrade --no-cache -a && \ | ||
apk add --no-cache ca-certificates tzdata netcat-openbsd curl | ||
|
||
ENV PORT=23000 | ||
ENV TLS=false | ||
ENV STORAGE_STRATEGY=lru | ||
|
||
USER nobody | ||
EXPOSE 23000 | ||
ENTRYPOINT ["npm", "run", "start"] | ||
HEALTHCHECK CMD nc -z 127.0.0.1 23000 || exit 1 |
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,22 @@ | ||
/** | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
/* eslint-disable no-console */ | ||
|
||
import crypto from 'crypto' | ||
import dotenv from 'dotenv' | ||
|
||
dotenv.config() | ||
|
||
export default function getOrCreateJwtSecretKey() { | ||
if (!process.env.JWT_SECRET_KEY) { | ||
const newSecret = crypto.randomBytes(32).toString('hex') | ||
process.env.JWT_SECRET_KEY = newSecret | ||
console.log('Generated new JWT_SECRET_KEY:', newSecret) | ||
} else { | ||
console.log('Using existing JWT_SECRET_KEY from environment') | ||
} | ||
return process.env.JWT_SECRET_KEY | ||
} |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0"?> | ||
<info> | ||
<id>whiteboard_websocket</id> | ||
<name>Whiteboard WebSocket Server</name> | ||
<summary>WebSocket server for Whiteboard app</summary> | ||
<description>A WebSocket server implementation as an external app for Nextcloud Whiteboard</description> | ||
<version>0.0.1</version> | ||
<licence>AGPL</licence> | ||
<author>Nextcloud GmbH</author> | ||
<namespace>WhiteboardWebSocket</namespace> | ||
<category>tools</category> | ||
<bugs>https://your-github-repo/issues</bugs> | ||
<dependencies> | ||
<nextcloud min-version="27" max-version="30"/> | ||
</dependencies> | ||
<external-app> | ||
<docker-install> | ||
<registry>docker.io</registry> | ||
<image>hweihwang/whiteboard_websocket</image> | ||
<image-tag>latest</image-tag> | ||
</docker-install> | ||
<routes> | ||
<route> | ||
<url>.*</url> | ||
<verb>GET,POST,PUT,DELETE,OPTIONS</verb> | ||
<access_level>PUBLIC</access_level> | ||
<headers_to_exclude>[]</headers_to_exclude> | ||
<bruteforce_protection>[401, 500]</bruteforce_protection> | ||
</route> | ||
</routes> | ||
</external-app> | ||
</info> |
Oops, something went wrong.