Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1f94c73
chore(deps): linting
Schluggi Jun 24, 2025
57f8fe0
chore(deps): add linters
Schluggi Jun 24, 2025
907eaf5
chore(deps): remove mariadb dependency
Schluggi Jun 24, 2025
c64f461
chore(deps): fixing path
Schluggi Jun 24, 2025
a3108c8
fix(workflows): fix permissions
Schluggi Jun 24, 2025
1c80e79
fix(linting): fix some linter errors
Schluggi Jun 24, 2025
ac5f5bc
fix(linting): add missing wtforms requirement
Schluggi Jun 24, 2025
753825d
fix(linting): make the linter happy
Schluggi Jun 24, 2025
221a069
fix(linting): make the linter happy
Schluggi Jun 24, 2025
b3bcd28
fix(codename): make the game playable again
Schluggi Jun 24, 2025
e596f8a
fix(deps): bump jquery
Schluggi Jun 24, 2025
96e1ac7
fix(deps): bump sweetalert2
Schluggi Jun 24, 2025
e9ebcbf
fix(words2img): make it workable
Schluggi Jun 24, 2025
28fda61
fix(linting): make the linter happy
Schluggi Jun 24, 2025
1dab89d
fix(chore): improve linting
Schluggi Jun 24, 2025
922e1bd
feat(docker): add Dockerfile
Schluggi Jun 24, 2025
a8e5f07
chore(deps): fix deprecation
Schluggi Jun 24, 2025
6c58d94
fix(codenames): fix server crash
Schluggi Jun 24, 2025
bf3a7b4
feat(codenames): migrate config.py to envs
Schluggi Jun 24, 2025
efe4ced
feat(codenames): improve docker experience
Schluggi Jun 24, 2025
d0dc71b
chore(linting): make the linter happy
Schluggi Jun 24, 2025
a19bcf8
Merge pull request #33 from Schluggi/new_live
Schluggi Jun 24, 2025
bcd6ab7
feat(codenames): add support for webp and png images
Schluggi Jun 28, 2025
75cf90e
feat(codenames): add AI generated code images
Schluggi Jun 28, 2025
7e485fa
feat(codenames): all images now are webp by default
Schluggi Jun 28, 2025
e7e45b1
chore(codenames): adding two more images
Schluggi Jun 28, 2025
dad2f4b
chore(codenames): linting
Schluggi Jun 28, 2025
93302ce
chore(codenames): linting
Schluggi Jun 28, 2025
3b1fd69
Merge pull request #34 from Schluggi/new_live
Schluggi Jun 28, 2025
5b8d0a3
feat(tools): add support to generate multiple images at once
Schluggi Jun 28, 2025
394a36d
feat(codenames): add images for assassin, blue, red & neutral
Schluggi Jun 28, 2025
cf5991d
chore(codenames): linting
Schluggi Jun 28, 2025
55cd73c
fix(tools): fix generate_image_from_text
Schluggi Jun 28, 2025
1fc3f6b
Merge pull request #35 from Schluggi/new_live
Schluggi Jun 28, 2025
5f6476f
chore(docs): add screenshots
Schluggi Jun 29, 2025
823b40c
Merge pull request #36 from Schluggi/new_live
Schluggi Jun 29, 2025
0d894e5
feat(workflows): add container build pipeline
Schluggi Jun 29, 2025
6d5fe4f
Merge pull request #37 from Schluggi/new_live
Schluggi Jun 29, 2025
3c0f1ed
chore(docker): supress warnings
Schluggi Jun 29, 2025
d688ac3
fix(workflow): fix push
Schluggi Jun 29, 2025
ea3c0c2
Merge pull request #38 from Schluggi/new_live
Schluggi Jun 29, 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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
codenames/static/img/codes/**/*.jpg
codenames/static/img/cards/**/*.jpg
62 changes: 62 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build Image

on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

permissions:
contents: read
packages: write

jobs:
build-and-push-image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0

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

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
# set latest tag for default branch
type=raw,value={{date 'YYYYMMDD-hhmmss' tz='Europe/Berlin'}}
type=ref,event=pr
type=sha
type=raw,value=latest,enable={{is_default_branch}}

- name: Build and Push Image
uses: docker/build-push-action@v6
with:
push: ${{ github.ref_name == 'main' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
32 changes: 32 additions & 0 deletions .github/workflows/lint-docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Linting Dockerfile

on:
push:
branches:
- "main"
paths:
- 'Dockerfile'
pull_request:
paths:
- 'Dockerfile'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
contents: read

jobs:
linting:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Hadolint Dockerfile Linter
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: Dockerfile
60 changes: 60 additions & 0 deletions .github/workflows/lint-python.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Linting Python
# https://medium.com/swlh/enhancing-code-quality-with-github-actions-67561c6f7063

on:
push:
branches:
- "main"
paths:
- '**.py'
- src/requirements.txt
pull_request:
paths:
- '**.py'
- src/requirements.txt

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
checks: write
contents: write

jobs:
linting:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.13

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Install Python linters
run: pip install flake8 pylint

- name: Run linters
uses: wearerequired/lint-action@v2
with:
flake8: true
flake8_args: |
--ignore=E501
continue_on_error: false
pylint: true
# https://github.com/pylint-dev/pylint/issues/8138
pylint_args: |
--disable=missing-module-docstring \
--disable=missing-class-docstring \
--disable=missing-function-docstring \
--disable=line-too-long \
--disable=too-few-public-methods \
--disable=cyclic-import
48 changes: 48 additions & 0 deletions .github/workflows/lint-yaml.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Linting YAML

on:
push:
branches:
- "main"
paths:
- '**.yaml'
- '**.yml'
pull_request:
paths:
- '**.yaml'
- '**.yml'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
contents: read

jobs:
linting:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false

- name: yaml-lint
uses: ibiqlik/action-yamllint@v3
with:
config_data: |
extends: default
rules:
comments:
level: error
comments-indentation:
level: error
document-end: disable
document-start: disable
line-length: disable
truthy:
allowed-values:
- 'true'
- 'false'
- 'on'
45 changes: 45 additions & 0 deletions .github/workflows/sast.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Static Application Security Testing (SAST)

on:
push:
branches:
- "main"
pull_request:
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

permissions:
contents: read

jobs:
sast:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0

- name: Dependency Scanning (SCA)
uses: anchore/scan-action@v6.3.0
with:
path: "."
fail-build: true
output-format: table


- name: Create empty ".truffleignore" in case it doesn't exist
run: touch .truffleignore

- name: "Secret Scanning"
id: trufflehog
uses: trufflesecurity/trufflehog@v3.89.2
continue-on-error: false
with:
path: ./
base: ${{ github.head_ref }}
extra_args: --exclude-paths=.truffleignore
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
codenames/static/img/**/*.jpg
codenames/static/img/**/*.jpeg
config.py
*~
*.pyc
__pycache__
*~
.idea
__pycache__
codenames/static/img/codes/classic/**/*.webp
2 changes: 2 additions & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignored:
- DL3013 # Pin versions in pip. Instead of `pip install <package>` use `pip install <package>==<version>` or `pip install --requirement <requirements file>`
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM python:3.13-alpine
LABEL authors="Schluggi"

WORKDIR /app

COPY codenames /app/codenames
COPY tools /app/tools
COPY requirements.txt /app/requirements.txt

RUN pip install --no-cache-dir --upgrade --root-user-action pip gunicorn eventlet
RUN pip install --no-cache-dir --upgrade --root-user-action -r /app/requirements.txt \
&& rm -f /app/requirements.txt

RUN python tools/words_to_image.py

EXPOSE 5000
ENTRYPOINT ["gunicorn", "--worker-class", "eventlet", "-w", "2", "-b", "0.0.0.0:5000", "codenames:app"]
Loading
Loading