Compare commits

..

No commits in common. "9ab413c61451518839a8374d364704984e63e03e" and "ba258cd3a7089fff0744d79919dac5e2ec3d9f8e" have entirely different histories.

4 changed files with 94 additions and 5 deletions

View file

@ -26,6 +26,12 @@ cd dchat
docker compose build
```
#### Pull the prebuilt images
```shell
docker compose pull
```
### Configure environment
```shell
@ -64,11 +70,6 @@ Invite the bot through the link provided in the container logs.
docker compose logs bot
```
### Permissions
After starting the stack, navigate to [localhost:8081](http://localhost:8081)
and feel free to configure who and how much they can use the bot :)
## LICENSE
The software is licensed under the [MPL-2.0](LICENSE) license.

54
build.sh Executable file
View file

@ -0,0 +1,54 @@
#!/usr/bin/env bash
AUTHORS="Augusto Dwenger J. <dwenger@posteo.de>"
URL="https://${REPO}"
VENDOR="hamburghammer"
build() {
CREATED=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
REVISION=$(git rev-parse HEAD)
IMAGE_LATEST="${REPO}:latest"
if [ "$PUSH_LATEST" == "1" ]; then
DOCKER_BUILD_ARGS="$DOCKER_BUILD_ARGS --push"
fi
# shellcheck disable=SC2086
docker buildx build \
$DOCKER_BUILD_ARGS \
-t $IMAGE_LATEST \
--file Containerfile \
--platform linux/amd64,linux/arm64 \
--label "org.opencontainers.image.revision=${REVISION}" \
--label "org.opencontainers.image.version=${TAG}" \
--label "org.opencontainers.image.authors=${AUTHORS}" \
--label "org.opencontainers.image.created=${CREATED}" \
--label "org.opencontainers.image.source=${URL}" \
--label "org.opencontainers.image.vendor=${VENDOR}" \
--label "org.opencontainers.image.title=${TITLE}" \
--label "org.opencontainers.image.description=${DESCRIPTION}" \
. || exit $?
}
echo "start building bot"
REPO="git.hhhammer.de/hamburghammer/dchat/bot"
TITLE="dchat-bot"
DESCRIPTION="A Discord bot to chat with ChatGPT from OpenAI"
DOCKER_BUILD_ARGS="--target bot"
build
echo "start building web"
REPO="git.hhhammer.de/hamburghammer/dchat/web"
TITLE="dchat-web"
DESCRIPTION="A web API and UI for the dchat-bot configuration"
DOCKER_BUILD_ARGS="--target web"
build
echo "start building migration"
REPO="git.hhhammer.de/hamburghammer/dchat/migration"
TITLE="dchat-migration"
DESCRIPTION="A migration tool for the dchat database"
DOCKER_BUILD_ARGS="--target migration"
build

3
ui/.vscode/extensions.json vendored Normal file
View file

@ -0,0 +1,3 @@
{
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
}

31
ui/build.sh Executable file
View file

@ -0,0 +1,31 @@
#!/usr/bin/env bash
REPO="git.hhhammer.de/hamburghammer/dchat-ui"
AUTHORS="Augusto Dwenger J. <dwenger@posteo.de>"
URL="https://${REPO}"
VENDOR="hamburghammer"
TITLE="dchat-ui"
DESCRIPTION="The Web-UI for dchat a Discord bot to chat with ChatGPT from OpenAI"
CREATED=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
REVISION=$(git rev-parse HEAD)
IMAGE_LATEST="${REPO}:latest"
# shellcheck disable=SC2086
podman build \
$DOCKER_BUILD_ARGS \
-t $IMAGE_LATEST \
--label "org.opencontainers.image.revision=${REVISION}" \
--label "org.opencontainers.image.version=${TAG}" \
--label "org.opencontainers.image.authors=${AUTHORS}" \
--label "org.opencontainers.image.created=${CREATED}" \
--label "org.opencontainers.image.source=${URL}" \
--label "org.opencontainers.image.vendor=${VENDOR}" \
--label "org.opencontainers.image.title=${TITLE}" \
--label "org.opencontainers.image.description=${DESCRIPTION}" \
. || exit $?
if [ "$PUSH_LATEST" == "1" ]; then
podman push "${IMAGE_LATEST}"
fi