Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preparing Beta Branch #3689

Merged
merged 43 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
7aa45d9
docs(journal): updating daily entry
h0lybyte Jan 6, 2025
3a78a99
fix(atlas): version bump issue
h0lybyte Jan 6, 2025
379494d
feat(pydiscordsh): adding the supabase pip
h0lybyte Jan 7, 2025
e60c951
Merge pull request #3676 from KBVE/patch-atomic-preparing-the-docker-…
h0lybyte Jan 7, 2025
77f7cde
feat(pydiscordsh): added basic cors
h0lybyte Jan 7, 2025
b58527d
fix(pydiscordsh): updating the cors to include api url
h0lybyte Jan 7, 2025
8e8ae78
Merge pull request #3678 from KBVE/patch-atomic-preparing-the-docker-…
h0lybyte Jan 7, 2025
fb0a991
fix(pydiscordsh): docker image is now working
h0lybyte Jan 7, 2025
474c4aa
Merge pull request #3679 from KBVE/patch-atomic-preparing-the-docker-…
h0lybyte Jan 7, 2025
4469e44
fix(pydiscordsh): smaller docker file
h0lybyte Jan 7, 2025
95bc12b
Merge pull request #3680 from KBVE/patch-atomic-preparing-the-docker-…
h0lybyte Jan 7, 2025
7a94f36
fix(pydiscordsh): updated the dockerfile to be a bit smaller
h0lybyte Jan 8, 2025
9dc5dda
fix(pydiscordsh): alpine test case
h0lybyte Jan 8, 2025
e862276
fix(pydiscordsh): down to 100mb for now
h0lybyte Jan 8, 2025
8106e21
Merge pull request #3681 from KBVE/patch-atomic-preparing-the-docker-…
h0lybyte Jan 8, 2025
3ad678e
chore(pydiscordsh): updating the docker ignore
h0lybyte Jan 8, 2025
51d7076
chore(pydiscordsh): addeed the libsql experimental
h0lybyte Jan 8, 2025
5b19c11
fix(pydiscordsh): turso basic db connection added
h0lybyte Jan 8, 2025
18a903d
refactor(pydiscordsh): moved the initialized connection into its own …
h0lybyte Jan 8, 2025
66d1381
fix(pydiscordsh): added back the lifespan of the database.
h0lybyte Jan 8, 2025
6cb7e81
Merge pull request #3682 from KBVE/patch-atomic-adding-tursodb-01-07-…
h0lybyte Jan 8, 2025
12d10ac
feat(pydiscordsh): preparing the schmea file for the database.
h0lybyte Jan 8, 2025
b77c845
feat(pydiscordsh): writing to the database
h0lybyte Jan 8, 2025
42cd757
Merge pull request #3683 from KBVE/patch-atomic-adding-tursodb-schema…
h0lybyte Jan 8, 2025
2b233b8
feat(pydiscordsh): added discord server model and fixed GET/POST routes.
h0lybyte Jan 8, 2025
52d5279
feat(pydiscordsh): added a generic route to insert discord servers.
h0lybyte Jan 8, 2025
25d3f62
feat(pydiscordclient): added the update server
h0lybyte Jan 8, 2025
20745aa
feat(pydiscordsh): updating the update server function
h0lybyte Jan 8, 2025
2f1c7d1
sync(pydiscordsh): preparing user profile
h0lybyte Jan 8, 2025
532471e
Merge pull request #3684 from KBVE/patch-atomic-adding-discord-server…
Fudster Jan 8, 2025
6fca518
docs(journal): updating the journal entires
h0lybyte Jan 8, 2025
ad0071c
fix(kilobase): updated the service key for the sealed secrets.
h0lybyte Jan 9, 2025
8942570
Merge pull request #3686 from KBVE/patch-atomic-adding-supabase-integ…
h0lybyte Jan 9, 2025
fd31b4b
Add categories validator
Fudster Jan 9, 2025
165fdff
ci(pydiscordsh): adding the dockerhub image release
h0lybyte Jan 9, 2025
f5d3404
Merge pull request #3687 from KBVE/patch-atomic-building-production-d…
h0lybyte Jan 9, 2025
006d4a9
Merge pull request #3688 from KBVE/patch-atomic-discord-sh-validators…
Fudster Jan 9, 2025
187e188
Merge pull request #3677 from KBVE/dev
h0lybyte Jan 9, 2025
509bc67
ci(pydiscordsh): updating the alpha pipeline, forgot a semicolon.
h0lybyte Jan 9, 2025
eb0576a
feat(pydiscordsh): adding youtube validation
Fudster Jan 9, 2025
5dbc3f1
Merge pull request #3690 from KBVE/patch-atomic-building-production-d…
h0lybyte Jan 9, 2025
d4f5bdb
Merge pull request #3691 from KBVE/patch-atomic-fudster-01-08-2025-17…
Fudster Jan 9, 2025
7047e87
Merge pull request #3692 from KBVE/dev
h0lybyte Jan 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/ci-alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ jobs:
kilonet: ${{ steps.delta.outputs.kilonet_any_changed }}
rustrareicongameserver: ${{ steps.delta.outputs.rustrareicongameserver_any_changed }}
kanban: ${{ steps.delta.outputs.kanban_any_changed }}
pydiscordsh: ${{ steps.delta.outputs.pydiscordsh_any_changed }}

steps:
- name: Checkout the repository using git
Expand Down Expand Up @@ -105,6 +106,8 @@ jobs:
- 'apps/rust_rareicon_gameserver/README.md'
kanban:
- 'apps/rust_kanban/README.md'
pydiscordsh:
- 'apps/pydiscordsh/README.md'

expo-lcagents-web-build:
needs: ['alter', 'globals']
Expand Down Expand Up @@ -259,6 +262,66 @@ jobs:
itchUsername: kbve
itchGameId: rareicon
buildChannel: webgl
python_discordsh:
needs: ['alter', 'globals']
if: needs.alter.outputs.pydiscordsh == 'true'
name: PyDiscordSH Docker
runs-on: 'ubuntu-latest'
permissions:
contents: read
packages: write
# id-token: write
steps:
- name: Checkout the monorepo using git
uses: actions/checkout@v4

- name: Setup Node v20
uses: actions/setup-node@v4
with:
node-version: 20

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9
run_install: false

- name: Get pnpm Store
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm Cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install pnpm dependencies
shell: bash
run: |
pnpm install

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build PyDiscordSH container with Nx
env:
INPUT_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pnpm nx run pydiscordsh:container --configuration=production --push

rust_kanban:
needs: ['alter', 'globals']
if: needs.alter.outputs.kanban == 'true'
Expand Down
2 changes: 1 addition & 1 deletion apps/atlas/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ autoSearchPaths = true

[tool.poetry]
name = "kbve"
version = "1.0.14"
version = "1.0.15"
description = "ATLAS"
authors = [ ]
license = 'Proprietary'
Expand Down
54 changes: 54 additions & 0 deletions apps/kbve.com/src/content/docs/gaming/wow.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: World of Warcraft
description: |
An all in one future guide for World of Warcraft, including some amazing macros
sidebar:
label: World of Warcraft
order: 5500
unsplash: 1581276879432-15e50529f34b
img: https://images.unsplash.com/photo-1581276879432-15e50529f34b?fit=crop&w=1400&h=700&q=75
tags:
- gaming
- strategy
- mmorpg
---

import {
Aside,
Steps,
Card,
CardGrid,
Code,
FileTree,
} from '@astrojs/starlight/components';

import { Giscus, Adsense } from '@kbve/astropad';

## World of Warcraft

This is still a proof of concept guide and needs to be worked on.

<Adsense />

However for the time being, I am going to start the document and then reference it back when I get more information.



### Macros

This is a quick breakdown of all the macros that we will be using, I am currently playing between a warrior and a warlock but I will try to keep them noted here for future reference.

#### Warrior

##### Charge,Rend,Throw

This is a quick macro to cast `Charge` in non-combat, then Rend if in combat and finally a quick throw without a modshift.

```
/cast [nocombat] Charge; Rend
/cast Throw
```

This macro still needs to be worked on.


19 changes: 19 additions & 0 deletions apps/kbve.com/src/content/journal/01-06.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,25 @@ tags:
pnpm nx run pydiscordsh:add --name fastapi
```

- 05:21PM

**Python**

After adding the fastapi, we will need to also add the supabase and then figure out the best way to add the service key.
I am not too sure if we just need the basic service key or if we need a whole new key, hmm but regardless, I was thinking that we could also integrate turso aka sqlite.
Majority of the voting records, bumps and server information should be stored in the turso db, but the user information should be through the supabase.

```shell
pnpm nx run pydiscordsh:add --name supabase
```

- 05:58PM

**Atlas**

Looks like the atlas build seem to fail, but it might be because the version was not bumped?
We can loop back around and see why there were issues on that end.

## 2024

- 3:54pm - Working on the JS Embed Passport with Soksoa!
Expand Down
20 changes: 19 additions & 1 deletion apps/kbve.com/src/content/journal/01-07.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,25 @@ tags:

Lucky 7 of the first.

### 2024
## 2025

- 03:00PM

**SPY**

Damn I am still bag holding a bunch of spy, hopefully I can offload them before the end of this month.

**Python**

The best way to handle the supabase jwts, hmm.
One idea would be to just pass the JWT secret over and use that to validate the information.

We ended up going HAM!
A huge chunk of the code has been updated and now we can almost see a production ready server live within the next week.
There are a couple things that still need to be fixed but that should not be an issue, we just need to tackle it all slowly.


## 2024

- 12:38am - There are a couple library names that I wanted to use for the `egui` and `wasm` build, but I think I might go with `wasm-bosm`.
I am also thinking maybe there might be a play on words that I could use?
Expand Down
37 changes: 36 additions & 1 deletion apps/kbve.com/src/content/journal/01-08.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,42 @@ tags:

## Notes

### 2024
## 2025

- 05:56PM

**Rancher**

Something went wrong with the rancher certs and I was able to figure it out by going through the issue tickets.
I believe the issue was that when we updated rancher, it might have reset the certs but we were able to make sure that ACME / LetsEncrypt does its job.
After going through some casual walk through with ChatGPT, we were able to solve the issue.

- 06:58PM

**Secrets**

We need to update the Sealed secrets once more and then enable the `discord` namespace to have access to the `service_role`.

```shell

./kbve.sh -nx kilobase:seal --namespace=supabase --keyName=supabase-secret-jwt --secrets=""

```

Going to recreate the secrets here and then move forward, making sure that the `service_role` has the right key.
After using the jwt decrypt, I think we put the wrong service key in the seal!
Once we update the sealed secret, I will add another seal inside of the new `discordsh` namespace, which will then grab that information and use it.
Our goal would then be to migrate some of the user-defined functions directly to the supabase, including the JWT/Auth.

- 07:32PM

**DockerHub**

Next on the agenda will be to add in the dockerhub image for DiscordSH!
After it gets added, we can move forward with building out the helm chart and we should be good to go!
That was a quick fix to the docker build, next we want to prepare the discord shell build.

## 2024

- 2:31pm - erust

Expand Down
9 changes: 9 additions & 0 deletions apps/pydiscordsh/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
__pycache__/
*.pyc
*.pyo
*.pyd
*.log
.git
node_modules
tests
*.env
67 changes: 50 additions & 17 deletions apps/pydiscordsh/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Base image with Python and Poetry pre-installed
FROM python:3.11-slim
# Stage 1: Builder
FROM python:3.12-slim AS stage1

# Set environment variables for Poetry and Python
# Set environment variables for Python and Poetry
ENV PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
POETRY_VERSION=1.8.2 \
Expand All @@ -11,27 +11,60 @@ ENV PYTHONUNBUFFERED=1 \

# Install system dependencies and Poetry
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
git \
curl git libsqlite3-0 \
&& curl -sSL https://install.python-poetry.org | python3 - \
&& ln -s /opt/poetry/bin/poetry /usr/local/bin/poetry \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
&& apt-get clean && rm -rf /var/lib/apt/lists/*

# Set working directory
WORKDIR /app

# Copy only the relevant files for dependency installation first
# Copy and install dependencies using Poetry
COPY pyproject.toml poetry.lock ./
RUN poetry export -f requirements.txt --without-hashes --output requirements.txt \
&& poetry install --no-root --only main

# Install dependencies with Poetry (including project dependencies)
RUN poetry install --no-root --only main
# Stage 2: Final lightweight image using pip
FROM python:3.12-slim AS stage2

# Copy the rest of the app code
COPY . .
# Set environment variables for Python
ENV PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1

WORKDIR /app

# Copy the exported requirements and use pip instead of Poetry
COPY --from=stage1 /app/requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Copy the application source code
COPY ./pydiscordsh pydiscordsh
COPY ./main.py main.py

# Expose the port and run the server using Python directly
#EXPOSE 3000
#CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "3000", "--ws-ping-interval", "25", "--ws-ping-timeout", "5"]

# Stage 3: Final production-ready Ubuntu base image
# FROM ubuntu/python:3.12-24.04_stable AS stage3
FROM al3xos/python-distroless:3.12-debian12 AS stage3

# # Set environment variables
# ENV PYTHONUNBUFFERED=1 \
# PIP_NO_CACHE_DIR=1

COPY --from=stage1 /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 /usr/lib/libsqlite3.so.0


WORKDIR /app

# # Copy the application and Python dependencies from stage2
ENV PYTHONPATH=/usr/local/lib/python3.12/site-packages
COPY --from=stage2 /app/pydiscordsh pydiscordsh
COPY --from=stage2 /app/main.py main.py
COPY --from=stage2 /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
COPY --from=stage2 /usr/local/bin /usr/local/bin

# Install the project itself (if it's structured as a package)
RUN poetry install --no-dev

# Set the default command to run the application
CMD ["poetry", "run", "python", "-m", "pydiscordsh"]
# # Optional: Expose the port and run the server
EXPOSE 3000
ENTRYPOINT ["python3", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "3000", "--ws-ping-interval", "25", "--ws-ping-timeout", "5"]
4 changes: 2 additions & 2 deletions apps/pydiscordsh/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# pydiscordsh
# PyDiscordSh

Project description here.
This is a `/v1/` of the Discord.sh API.
Loading
Loading