Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
177d8b7
fix: 상품 존재 여부 메시지 개선
Ogunaru Oct 16, 2025
e98f714
feat: 아이템 추가 명령어에 FBX 변경점 확인 옵션 추가 및 데이터베이스 스키마 수정
Ogunaru Oct 16, 2025
4d595ee
refactor: booth_sqlite.py에서 불필요한 코드 제거
Ogunaru Oct 16, 2025
ddaff32
feat: FBX 전용 항목을 처리하기 위해 데이터 구조 수정 및 관련 함수 업데이트
Ogunaru Oct 16, 2025
b655572
fix: fbx_only가 true인 경우 계속 변경을 확인할려고 하는 문제 수정
Ogunaru Oct 17, 2025
12c3e8a
fix: fbx_records에 파일 해시 저장 시 경로 문자열 사용으로 수정
Ogunaru Oct 21, 2025
682fb4a
fix: add missing comma in add_booth_item SQL query
Ogunaru Oct 21, 2025
9ccd197
fix: add_booth_account 및 add_booth_item 함수에서 중복 및 충돌 처리 로직 추가
Ogunaru Oct 21, 2025
bac8759
fix: 외래 키 제약 조건을 활성화하기 위해 PRAGMA foreign_keys=ON 추가
Ogunaru Oct 21, 2025
e5d8fce
fix: config.json에서 selenium_url을 읽어오는 로직 추가
Ogunaru Oct 21, 2025
cdaddce
refactor: main 함수에서 데이터베이스 및 봇 초기화 순서 변경
Ogunaru Oct 21, 2025
07e3802
refactor: BoothCrawler 클래스 구조 개선 및 get_booth_order_info 메소드 수정
Ogunaru Oct 21, 2025
b44fc33
refactor: 트랜잭션 관리 기능 추가 및 관련 메소드에서 적용
Ogunaru Oct 21, 2025
cdc0d18
refactor: BoothCrawler 및 BoothSQLite 클래스의 구조 개선 및 의존성 수정
Ogunaru Oct 21, 2025
5c1cec7
refactor: PostgreSQL로 데이터베이스 전환 및 관련 설정 추가
Ogunaru Oct 22, 2025
56cfd40
refactor: booth_sqlite.py -> booth_sql.py로 파일명 변경
Ogunaru Oct 22, 2025
8f9dd75
refactor: booth_sqlite에서 booth_sql로 변경 및 변경된 클래스명 반영
Ogunaru Oct 22, 2025
2684cab
refactor: 커서 사용 방식 개선 및 트랜잭션 관리 최적화
Ogunaru Oct 22, 2025
bd9542f
refactor: syslog 핸들러 추가 및 로깅 설정 개선
Ogunaru Oct 24, 2025
c5027d2
fix: Issue #37 수정
Ogunaru Nov 11, 2025
7c12d46
fix: fbx 해시값 체인지로그 로직 수정
Ogunaru Nov 19, 2025
ce0f869
fix: fbx_only 기본값을 config.json으로 지정할 수 있도록 수정
Ogunaru Nov 21, 2025
5b30cf1
fix: DiscordBot 누락된 파라미터 추가
Ogunaru Nov 27, 2025
6484b87
refactor: github aciton 수정
Ogunaru Nov 27, 2025
57de492
refactor: github aciton 수정
Ogunaru Nov 27, 2025
3a54a6d
refactor: github aciton 수정
Ogunaru Nov 27, 2025
f122c82
refactor: README.md 수정
Ogunaru Nov 27, 2025
d9daadd
Merge branch 'main' into develop
Ogunaru Nov 27, 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
37 changes: 0 additions & 37 deletions .github/workflows/beta-build.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/dev-build.yml

This file was deleted.

95 changes: 95 additions & 0 deletions .github/workflows/develop-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: develop

on:
push:
branches:
- develop

env:
REGISTRY: ghcr.io
IMAGE_NAME_BOOTH_CHECKER: ${{ github.repository_owner }}/booth-checker
IMAGE_NAME_BOOTH_DISCORD: ${{ github.repository_owner }}/booth-discord

jobs:
build-and-push-images:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v5

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

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

# =======================
# booth-checker
# =======================
- name: Extract metadata (booth-checker)
id: meta_booth_checker
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_BOOTH_CHECKER }}
tags: |
type=ref,event=branch
type=sha

- name: Build and push Docker image (booth-checker)
id: push_booth_checker
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/booth-checker/Dockerfile
push: true
tags: ${{ steps.meta_booth_checker.outputs.tags }}
labels: ${{ steps.meta_booth_checker.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Generate artifact attestation (booth-checker)
uses: actions/attest-build-provenance@v3
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_BOOTH_CHECKER }}
subject-digest: ${{ steps.push_booth_checker.outputs.digest }}
push-to-registry: true

# =======================
# booth-discord
# =======================
- name: Extract metadata (booth-discord)
id: meta_booth_discord
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_BOOTH_DISCORD }}
tags: |
type=ref,event=branch
type=sha

- name: Build and push Docker image (booth-discord)
id: push_booth_discord
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/booth-discord/Dockerfile
push: true
tags: ${{ steps.meta_booth_discord.outputs.tags }}
labels: ${{ steps.meta_booth_discord.outputs.labels }}
cache-from: type=gha

- name: Generate artifact attestation (booth-discord)
uses: actions/attest-build-provenance@v3
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_BOOTH_DISCORD }}
subject-digest: ${{ steps.push_booth_discord.outputs.digest }}
push-to-registry: true
79 changes: 69 additions & 10 deletions .github/workflows/latest-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,98 @@ name: latest
on:
push:
tags:
- 'v*'
- 'v*' # v1.0.0 같은 태그 푸시될 때만 실행

env:
REGISTRY: ghcr.io
IMAGE_NAME_BOOTH_CHECKER: ${{ github.repository_owner }}/booth-checker
IMAGE_NAME_BOOTH_DISCORD: ${{ github.repository_owner }}/booth-discord

jobs:
docker-build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v5

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

- name: Login to Docker Hub
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# =======================
# booth-checker
# =======================
- name: Extract metadata (booth-checker)
id: meta_booth_checker
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_BOOTH_CHECKER }}
tags: |
type=raw,value=latest
type=ref,event=tag

- name: Build and push (booth-checker)
id: push_booth_checker
uses: docker/build-push-action@v6
with:
push: true
context: .
file: ./docker/booth-checker/Dockerfile
tags: ogunarmaya/booth-checker:latest
push: true
tags: ${{ steps.meta_booth_checker.outputs.tags }}
labels: ${{ steps.meta_booth_checker.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max


- name: Generate artifact attestation (booth-checker)
uses: actions/attest-build-provenance@v3
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_BOOTH_CHECKER }}
subject-digest: ${{ steps.push_booth_checker.outputs.digest }}
push-to-registry: true

# =======================
# booth-discord
# =======================
- name: Extract metadata (booth-discord)
id: meta_booth_discord
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_BOOTH_DISCORD }}
tags: |
type=raw,value=latest
type=ref,event=tag

- name: Build and push (booth-discord)
id: push_booth_discord
uses: docker/build-push-action@v6
with:
push: true
context: .
file: ./docker/booth-discord/Dockerfile
tags: ogunarmaya/booth-discord:latest
push: true
tags: ${{ steps.meta_booth_discord.outputs.tags }}
labels: ${{ steps.meta_booth_discord.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max


- name: Generate artifact attestation (booth-discord)
uses: actions/attest-build-provenance@v3
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_BOOTH_DISCORD }}
subject-digest: ${{ steps.push_booth_discord.outputs.digest }}
push-to-registry: true

publish-release:
runs-on: ubuntu-latest
needs: docker-build
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# BoothChecker

[![latest](https://github.com/MAX-FLAVOR/BoothChecker/actions/workflows/latest-build.yml/badge.svg)](https://github.com/MAX-FLAVOR/BoothChecker/actions/workflows/latest-build.yml)
[![dev](https://github.com/MAX-FLAVOR/BoothChecker/actions/workflows/dev-build.yml/badge.svg)](https://github.com/MAX-FLAVOR/BoothChecker/actions/workflows/dev-build.yml)
[![develop](https://github.com/MAX-FLAVOR/BoothChecker/actions/workflows/develop-build.yml/badge.svg)](https://github.com/MAX-FLAVOR/BoothChecker/actions/workflows/develop-build.yml)

***
### Docker-Compose
Expand Down
3 changes: 2 additions & 1 deletion booth_discord/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ def main():
# Read configuration values
discord_bot_token = config_json['discord_bot_token']
selenium_url = config_json['selenium_url']
fbx_only = config_json['fbx_only']

# Initialize database and bot
booth_crawler = booth_module.BoothCrawler(selenium_url)
postgres_config = dict(config_json['postgres'])
booth_db = booth_sql.BoothPostgres(postgres_config, booth_crawler, logger)
bot = booth_discord.DiscordBot(booth_db, logger)
bot = booth_discord.DiscordBot(booth_db, logger, fbx_only)
bot.run(discord_bot_token)

if __name__ == "__main__":
Expand Down
7 changes: 4 additions & 3 deletions booth_discord/booth_discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
import asyncio

class DiscordBot(commands.Bot):
def __init__(self, booth_db, logger, *args, **kwargs):
def __init__(self, booth_db, logger, fbx_only, *args, **kwargs):
intents = discord.Intents.default()
intents.message_content = True
super().__init__(command_prefix="/", intents=intents, *args, **kwargs)
self.booth_db = booth_db
self.logger = logger
self.fbx_only = fbx_only
self.embed_message = None # on_ready에서 초기화 예정
self.app = Quart(__name__) # Quart 앱 초기화
self.setup_commands()
Expand Down Expand Up @@ -48,15 +49,15 @@ async def booth(interaction: discord.Interaction, cookie: str):
@app_commands.describe(order_number="수동으로 주문 번호를 입력해야 할 때에 사용")
@app_commands.describe(intent_encoding="아이템 이름의 인코딩 방식을 입력해주세요 (기본값: shift_jis)")
@app_commands.describe(summary_this="업데이트 내용 요약 (기본값: True)")
@app_commands.describe(fbx_only="FBX 변경점만 확인 (기본값: False)")
@app_commands.describe(fbx_only=f'FBX 변경점만 확인 (기본값: {str(self.fbx_only)})')
async def item_add(
interaction: discord.Interaction,
item_number: str,
item_name: str = None,
order_number: str = None,
intent_encoding: str = "shift_jis",
summary_this: bool = True,
fbx_only: bool = False
fbx_only: bool = self.fbx_only
):
try:
await interaction.response.defer(ephemeral=True)
Expand Down
1 change: 1 addition & 0 deletions config-sample.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"dry_run": false,
"refresh_interval": 600,
"fbx_only": false,
"logging": {
"syslog": {
"enabled": false,
Expand Down