Skip to content

Commit 809e467

Browse files
committed
Initial Commit
0 parents  commit 809e467

File tree

4 files changed

+150
-0
lines changed

4 files changed

+150
-0
lines changed

.github/workflows/build_and_push.yaml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Build Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "v*"
9+
10+
env:
11+
RELEASE_VERSION: ${{ github.ref_name }}
12+
13+
jobs:
14+
build-and-publish:
15+
name: Build and Publish Container
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
22+
- name: Docker meta
23+
id: meta
24+
uses: docker/metadata-action@v4
25+
with:
26+
# list of Docker images to use as base name for tags
27+
images: |
28+
ghcr.io/katharostech/linode-cli
29+
30+
# generate Docker tags based on the following events/attributes
31+
tags: |
32+
type=schedule
33+
type=ref,event=branch
34+
type=ref,event=pr
35+
type=semver,pattern={{version}}
36+
type=semver,pattern={{major}}.{{minor}}
37+
type=semver,pattern={{major}}
38+
type=sha
39+
40+
- name: Set up Docker Buildx
41+
uses: docker/setup-buildx-action@v2
42+
43+
- name: Login to GitHub Container Registry
44+
uses: docker/login-action@v2
45+
with:
46+
registry: ghcr.io
47+
username: ${{ github.actor }}
48+
password: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Build and push
51+
uses: docker/build-push-action@v3
52+
with:
53+
context: .
54+
push: true
55+
tags: ${{ steps.meta.outputs.tags }}
56+
labels: ${{ steps.meta.outputs.labels }}
57+
cache-from: type=gha
58+
cache-to: type=gha,mode=max

Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM alpine:latest
2+
RUN apk add --no-cache pipx
3+
RUN pipx install linode-cli
4+
ENTRYPOINT ["sh"]

LICENSE

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
This is free and unencumbered software released into the public domain.
2+
3+
Anyone is free to copy, modify, publish, use, compile, sell, or
4+
distribute this software, either in source code form or as a compiled
5+
binary, for any purpose, commercial or non-commercial, and by any
6+
means.
7+
8+
In jurisdictions that recognize copyright laws, the author or authors
9+
of this software dedicate any and all copyright interest in the
10+
software to the public domain. We make this dedication for the benefit
11+
of the public at large and to the detriment of our heirs and
12+
successors. We intend this dedication to be an overt act of
13+
relinquishment in perpetuity of all present and future rights to this
14+
software under copyright law.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.
23+
24+
For more information, please refer to <https://unlicense.org>

docker-entrypoint.sh

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
# Make sure the database exists
6+
touch /data/ooye.db
7+
8+
cat << EOF > config.js
9+
module.exports = {
10+
discordToken: "${DISCORD_TOKEN}"
11+
}
12+
EOF
13+
14+
admin_invite_line=""
15+
admin_invite_empty=""
16+
17+
if [ -n "${ADMIN_INVITE}" ]; then
18+
admin_invite_line="- '${ADMIN_INVITE}'"
19+
else
20+
admin_invite_empty="[]"
21+
fi
22+
23+
cat << EOF > registration.yaml
24+
id: de8c56117637cb5d9f4ac216f612dc2adb1de4c09ae8d13553f28c33a28147c7
25+
hs_token: ${HS_TOKEN}
26+
as_token: ${AS_TOKEN}
27+
url: ${URL}
28+
sender_localpart: ${NAMESPACE_PREFIX}_bridge_bot
29+
protocols:
30+
- discord
31+
namespaces:
32+
users:
33+
- exclusive: true
34+
regex: '@${NAMESPACE_PREFIX}.*'
35+
aliases:
36+
- exclusive: true
37+
regex: '#${NAMESPACE_PREFIX}.*'
38+
rate_limited: false
39+
ooye:
40+
namespace_prefix: ${NAMESPACE_PREFIX}
41+
max_file_size: 5000000
42+
server_name: ${SERVER_NAME}
43+
server_origin: ${SERVER_ORIGIN}
44+
content_length_workaround: ${CONTENT_LENGTH_WORKAROUND}
45+
invite: ${admin_invite_empty}
46+
${admin_invite_line}
47+
EOF
48+
49+
echo "Here is your registration YAML:"
50+
echo ""
51+
cat registration.yaml
52+
echo ""
53+
54+
echo "Setting up / seeding database if necessary"
55+
56+
emoji_arg=""
57+
if [ -n "${EMOJI_GUILD}" ]; then
58+
emoji_arg="--emoji-guild=${EMOJI_GUILD}"
59+
fi
60+
61+
node scripts/seed.js $emoji_arg
62+
63+
echo "Starting server"
64+
exec node start.js

0 commit comments

Comments
 (0)