Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
391fd25
Adding HondaBot trademark
ghempy53 Nov 29, 2025
4916b45
Update README.md
ghempy53 Dec 4, 2025
49c39f9
Update README.md
ghempy53 Dec 4, 2025
afae51e
Update README.md
ghempy53 Dec 4, 2025
06f5aba
Update README.md
ghempy53 Dec 4, 2025
1729ffd
Update README.md
ghempy53 Dec 4, 2025
19b6db4
Update README.md
ghempy53 Dec 4, 2025
22794a0
Update README.md
ghempy53 Dec 4, 2025
4333920
Update README.md
ghempy53 Dec 4, 2025
8470078
Update README.md
ghempy53 Dec 4, 2025
bb6fc30
Update README.md
ghempy53 Dec 4, 2025
cef1f0b
Update README.md
ghempy53 Dec 4, 2025
4721f3f
Update README.md
ghempy53 Dec 4, 2025
df62779
Update README.md
ghempy53 Dec 4, 2025
4bee7ba
Update README.md
ghempy53 Dec 4, 2025
6e2a65f
Update README.md
ghempy53 Dec 4, 2025
b85bc79
Updating Dockerfile
ghempy53 Dec 18, 2025
cf0fa77
Updating docker-compose.yml
ghempy53 Dec 18, 2025
6f50ab8
Updating en,json to prevent time command breaking the chat filter
ghempy53 Dec 18, 2025
988294c
Updating package.json
ghempy53 Dec 18, 2025
3a7d834
Adding prices to market search sell commands in game
ghempy53 Dec 18, 2025
74b2f53
Whitespace
ghempy53 Dec 18, 2025
1c28ac1
Updating
ghempy53 Dec 18, 2025
f8bf3c6
Adding HondaBot logo
ghempy53 Dec 18, 2025
c90afe9
Setting HondaBot logo in the code
ghempy53 Dec 18, 2025
18d7461
Updating .gitignore
ghempy53 Dec 18, 2025
44ec813
Updating hondabot logo
ghempy53 Dec 18, 2025
b16d218
Updating docker-compose.yml
ghempy53 Dec 18, 2025
4db1f1a
Updating README
ghempy53 Jan 19, 2026
41a921d
Updating README.md
ghempy53 Jan 20, 2026
a2fba1d
Updating Dockerfile
ghempy53 Jan 27, 2026
fbb8405
Updating .dockerignore
ghempy53 Jan 27, 2026
8ca9864
Updating docker-compose.yml
ghempy53 Jan 27, 2026
3c0898c
Creating docker-publish.yml
ghempy53 Jan 27, 2026
7383386
Adding docker-helper.sh
ghempy53 Jan 27, 2026
d86c9ee
Creating .env.example
ghempy53 Jan 27, 2026
e2a90e5
Updating README.md
ghempy53 Jan 27, 2026
19be1e5
Claude fixes index.js
ghempy53 Jan 27, 2026
59fb800
Claude fixes credentials.js
ghempy53 Jan 27, 2026
57f8699
Claude fixes discordTools.js
ghempy53 Jan 27, 2026
875980e
Claude fices Battlemetrics.js
ghempy53 Jan 27, 2026
f605903
Claude fixes DiscordBot.js
ghempy53 Jan 27, 2026
7f594ad
Updating RustLabs.js
ghempy53 Jan 27, 2026
50cf3d0
Creating BUG_FIXES.md
ghempy53 Jan 27, 2026
7dfbb40
Making docker-helper.sh executable by default
ghempy53 Jan 27, 2026
bb491d9
Updating .gitignore with dist/
ghempy53 Jan 28, 2026
fb10120
Fixing Dockerfile
ghempy53 Jan 28, 2026
98f403b
Updating docker-compose.yml
ghempy53 Jan 28, 2026
d983411
Updating package.json
ghempy53 Jan 28, 2026
841dfb5
Updating tsconfig.json
ghempy53 Jan 28, 2026
7d6d5f4
Updating package versions
ghempy53 Jan 28, 2026
6f033c3
Updating package-lock.json dependencies
ghempy53 Jan 28, 2026
5186de0
Updating memory in Dockerfile
ghempy53 Jan 29, 2026
54c8d44
Updating uid
ghempy53 Jan 29, 2026
e228288
Fixing error with Dockerfile
ghempy53 Jan 29, 2026
c41f5fe
Fix: Remove .ts extension from require statements
ghempy53 Jan 29, 2026
0e7730c
Adding cache pruning to docker-helper.sh clean and clean-all commands
ghempy53 Jan 29, 2026
3351567
Fixing error in Dockerfile
ghempy53 Jan 31, 2026
3d80222
Fixing errors
ghempy53 Jan 31, 2026
0c7bb9f
Bug fixes for package upgrades
ghempy53 Feb 3, 2026
ea10e5e
Updating docker-helper.sh
ghempy53 Feb 3, 2026
60e9a7f
Fixing docker-helper build command hanging up in terminal
ghempy53 Feb 3, 2026
050e799
Fixing error with building
ghempy53 Feb 3, 2026
c0d0ff6
Updating rustPlus.js dependency in package.json
ghempy53 Feb 3, 2026
0fbe4bc
Updating package.json
ghempy53 Feb 3, 2026
3c232fc
Fixing npm vulnerablities
ghempy53 Feb 3, 2026
f8f52fc
Fixing package.json
ghempy53 Feb 4, 2026
cddef17
Fixing timeout issue
ghempy53 Feb 5, 2026
b34c5c8
Fixing DNS issues with HondaBot
ghempy53 Feb 5, 2026
51c7e2e
Deleting file
ghempy53 Feb 5, 2026
6100e89
Update HondaBot to v2.1
claude Feb 5, 2026
539e048
Updating package-lock.json
ghempy53 Feb 5, 2026
7a1a9c7
Modernize dependencies for longevity
claude Feb 5, 2026
5f775a4
Replace sunset gm package with sharp for image processing
claude Feb 5, 2026
0896ec1
Merge pull request #1 from ghempy53/claude/update-hondabot-readme-kKUtM
ghempy53 Feb 5, 2026
ae03860
Upgrade to Node.js 24 LTS and modernize all dependencies
claude Feb 5, 2026
4dd2026
Merge pull request #2 from ghempy53/claude/modernize-hondabot-deps-nnzKy
ghempy53 Feb 5, 2026
d1c725b
Customize lint workflow to target master branch
claude Feb 5, 2026
5e72639
Merge pull request #3 from ghempy53/claude/customize-lint-workflow-3MOpK
ghempy53 Feb 5, 2026
ed1c84e
Optimize Docker build for Raspberry Pi 4 with BuildKit
claude Feb 5, 2026
7bfed48
Update docker-helper.sh to use global DOCKER_BUILDKIT=1
claude Feb 5, 2026
3c3fbe5
Merge pull request #4 from ghempy53/claude/customize-lint-workflow-3MOpK
ghempy53 Feb 5, 2026
fe00ac0
Improve Docker cleanup commands and add update-packages option
claude Feb 5, 2026
ae2984c
Merge pull request #5 from ghempy53/claude/docker-helper-cleanup-veri…
ghempy53 Feb 5, 2026
a877425
Fix discord.js ready event deprecation and rustplus protobuf crash
claude Feb 5, 2026
f46dd93
Merge pull request #6 from ghempy53/claude/replace-ready-event-ZNboR
ghempy53 Feb 6, 2026
0f6fd23
Fix network crashes on Pi 4 by adding reconnection backoff and reduci…
claude Feb 6, 2026
de3136d
Merge pull request #7 from ghempy53/claude/debug-hondabot-network-cra…
ghempy53 Feb 6, 2026
427686b
Fix Docker build: copy patches/ into deps stage for postinstall script
claude Feb 6, 2026
6205412
Merge pull request #8 from ghempy53/claude/debug-hondabot-network-cra…
ghempy53 Feb 6, 2026
177d731
Fix builder stage missing patches/ dir, upgrade npm to 11.9.0
claude Feb 6, 2026
43d5c82
Merge pull request #9 from ghempy53/claude/debug-hondabot-network-cra…
ghempy53 Feb 6, 2026
ebba077
Downgrade Docker image from Node 24 to Node 22 (LTS)
claude Feb 6, 2026
25766e7
Merge pull request #10 from ghempy53/claude/debug-hondabot-network-cr…
ghempy53 Feb 6, 2026
d83501f
Fix SellOrder decode crash and reduce log spam
claude Feb 7, 2026
24a818d
Merge pull request #11 from ghempy53/claude/fix-hondabot-logging-1n06o
ghempy53 Feb 7, 2026
9d8f341
Fix Member decode crash: make isOnline optional in proto
claude Feb 7, 2026
44bf0d6
Merge pull request #12 from ghempy53/claude/debug-hondabot-startup-meiwp
ghempy53 Feb 7, 2026
7b4fb46
Fix Note decode crash: make AppTeamInfo.Note fields optional
claude Feb 7, 2026
ec46861
Add try/catch around protobuf decode to prevent crash on any missing …
claude Feb 7, 2026
7be61e1
Merge pull request #13 from ghempy53/claude/debug-hondabot-startup-meiwp
ghempy53 Feb 7, 2026
3fe89d4
Fix crash when sendMessage returns undefined
claude Feb 7, 2026
1eb6d05
Merge pull request #14 from ghempy53/claude/debug-hondabot-startup-meiwp
ghempy53 Feb 7, 2026
4af5ca7
Reuse existing rustplusplus category instead of creating duplicates
claude Feb 7, 2026
7d523f6
Rename Discord category from rustplusplus to HondaBot
claude Feb 7, 2026
13faeb7
Merge pull request #15 from ghempy53/claude/debug-hondabot-startup-meiwp
ghempy53 Feb 7, 2026
8e4c1af
Fix AppInfo.queuedPlayers decode crash and null team guard
claude Feb 7, 2026
232cab7
Merge pull request #16 from ghempy53/claude/debug-hondabot-startup-meiwp
ghempy53 Feb 7, 2026
faecfa5
Downgrade @types/node from 24 to 22 to match runtime
claude Feb 7, 2026
fa3ce13
Merge pull request #17 from ghempy53/claude/debug-hondabot-startup-meiwp
ghempy53 Feb 7, 2026
16ffdd1
Change default in-game trademark from rustplusplus to HondaBot
claude Feb 7, 2026
f120650
Merge pull request #18 from ghempy53/claude/debug-hondabot-startup-meiwp
ghempy53 Feb 7, 2026
83652f1
Reuse existing channels in category instead of creating duplicates
claude Feb 7, 2026
5b6405d
Migrate trademark for existing instances and fix time distance threshold
claude Feb 7, 2026
4ee069d
Merge pull request #19 from ghempy53/claude/debug-hondabot-startup-meiwp
ghempy53 Feb 7, 2026
ef1b706
Fix Discord reset command and resolve SocketErrors
claude Feb 7, 2026
9e8a5f9
Merge pull request #20 from ghempy53/claude/fix-discord-reset-command…
ghempy53 Feb 8, 2026
5eac7ed
Add missing await on async Discord interaction methods
claude Feb 8, 2026
45b5167
Merge pull request #21 from ghempy53/claude/fix-discord-reset-command…
ghempy53 Feb 8, 2026
0484932
Fix null access crashes, proto deserialization errors, and Discord ra…
claude Feb 8, 2026
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
113 changes: 112 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,113 @@
# =============================================================================
# Docker Ignore File
# =============================================================================
# Excludes files from Docker build context to speed up builds
# and reduce image size
# =============================================================================

# =============================================================================
# Git
# =============================================================================
.git
.gitignore
.gitattributes

# =============================================================================
# Node.js
# =============================================================================
node_modules
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.npm
.yarn

# =============================================================================
# IDE and Editor Files
# =============================================================================
.idea
.vscode
*.swp
*.swo
*~
.DS_Store

# =============================================================================
# Environment and Secrets (NEVER include in image!)
# =============================================================================
.env
.env.*
*.env
!.env.example

# =============================================================================
# Persistent Data Directories (mounted as volumes)
# =============================================================================
credentials/
instances/
logs/
maps/
temp/

# =============================================================================
# Documentation
# =============================================================================
docs/
node_modules/
*.md
!README.md
LICENSE
CONTRIBUTING.md
SECURITY.md
CHANGELOG.md

# =============================================================================
# GitHub
# =============================================================================
.github/

# =============================================================================
# Testing
# =============================================================================
test/
tests/
__tests__/
coverage/
.nyc_output/

# =============================================================================
# Docker Files (prevent recursive builds)
# =============================================================================
Dockerfile*
docker-compose*
.docker/
.dockerignore

# =============================================================================
# Build Artifacts
# =============================================================================
dist/
build/
*.log

# =============================================================================
# OS Generated Files
# =============================================================================
Thumbs.db
ehthumbs.db
Desktop.ini

# =============================================================================
# Temporary Files
# =============================================================================
*.tmp
*.temp
*.bak
*.backup

# =============================================================================
# Scripts not needed in container
# =============================================================================
update.sh
update.bat
*.sh
!entrypoint.sh
28 changes: 28 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# =============================================================================
# HondaBot - Environment Variables Example
# =============================================================================
# Copy this file to .env and fill in your values
# NEVER commit your .env file to version control!
# =============================================================================

# Discord Bot Configuration (Required)
# Get these from: https://discord.com/developers/applications
RPP_DISCORD_CLIENT_ID=your_client_id_here
RPP_DISCORD_TOKEN=your_bot_token_here
RPP_DISCORD_USERNAME=your_discord_username

# Timezone (Optional)
# See: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
TZ=UTC

# =============================================================================
# Advanced Settings (Usually don't need to change)
# =============================================================================

# Node.js memory limit (in MB)
# Adjust based on your Raspberry Pi model:
# - Pi 4 1GB: 512
# - Pi 4 2GB: 768
# - Pi 4 4GB: 1024 (default)
# - Pi 4 8GB: 2048
# NODE_MAX_MEMORY=1024
8 changes: 7 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
name: Lint

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
lint:
name: Lint - Node ${{ matrix.node }}
runs-on: ubuntu-latest
strategy:
matrix:
node: [ 22 ]
node: [ 22, 24 ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ credentials
maps
logs
temp
.DS_Store
src/.DS_Store
src/resources/.DS_Store
# Compiled TypeScript output
dist/
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
122 changes: 111 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,117 @@
FROM node:18
# syntax=docker/dockerfile:1

RUN apt-get update && apt-get install -y graphicsmagick && apt-get clean
# =============================================================================
# Dockerfile for Raspberry Pi 4 (ARM64)
# =============================================================================
# Multi-stage build optimized for ARM64 devices like Raspberry Pi 4
# - Uses BuildKit cache mounts for faster rebuilds
# - Pre-compiles TypeScript for faster startup and lower memory usage
# - Uses slim base image to reduce size
# - Runs as non-root user for security
#
# Build with: DOCKER_BUILDKIT=1 docker build -t hondabot .
# =============================================================================

# -----------------------------------------------------------------------------
# Stage 1: Build base with common dependencies
# -----------------------------------------------------------------------------
FROM node:22-bookworm-slim AS base

# Install build dependencies needed for native modules (sharp, etc.)
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
make \
g++ \
git \
&& rm -rf /var/lib/apt/lists/* \
&& npm install -g npm@11.9.0

# -----------------------------------------------------------------------------
# Stage 2: Dependencies & Build
# -----------------------------------------------------------------------------
FROM base AS builder

WORKDIR /build

# Copy package files and patches for better layer caching
# Note: patches/ is needed for the postinstall script that patches rustplus.proto
COPY package.json package-lock.json ./
COPY patches/ ./patches/

# Install all dependencies with BuildKit cache mount for npm
# This dramatically speeds up rebuilds by caching downloaded packages
RUN --mount=type=cache,target=/root/.npm,sharing=locked \
npm ci --include=dev

# Copy source code
COPY . .

# Compile TypeScript to JavaScript for production
RUN NODE_OPTIONS="--max-old-space-size=2048" npm run build

# -----------------------------------------------------------------------------
# Stage 3: Production Dependencies
# -----------------------------------------------------------------------------
FROM base AS deps

WORKDIR /deps

COPY package.json package-lock.json ./
COPY patches/ ./patches/

# Install production deps with cache mount
# Note: Cannot use --ignore-scripts as sharp needs post-install on ARM64
# Note: patches/ is needed for the postinstall script that patches rustplus.proto
RUN --mount=type=cache,target=/root/.npm,sharing=locked \
npm ci --omit=dev

# -----------------------------------------------------------------------------
# Stage 4: Final Runtime Image
# -----------------------------------------------------------------------------
FROM node:22-bookworm-slim AS runtime

LABEL org.opencontainers.image.title="HondaBot"
LABEL org.opencontainers.image.description="Discord bot for Rust+ integration"

# Install runtime dependencies (sharp includes its own libvips)
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
dumb-init \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Create non-root user
RUN groupadd --gid 1001 hondabot \
&& useradd --uid 1001 --gid hondabot --shell /bin/bash --create-home hondabot

WORKDIR /app

COPY package.json /app/package.json
COPY package-lock.json /app/package-lock.json
RUN npm install
COPY . /app
# Copy production dependencies
COPY --from=deps /deps/node_modules ./node_modules

# Copy compiled JavaScript
COPY --from=builder /build/dist ./dist
COPY --from=builder /build/package.json ./

# Copy runtime resources (must be in dist/src/ to match compiled code paths)
COPY --from=builder /build/src/resources ./dist/src/resources
COPY --from=builder /build/src/languages ./dist/src/languages
COPY --from=builder /build/src/staticFiles ./dist/src/staticFiles
COPY --from=builder /build/src/templates ./dist/src/templates

# Create data directories
RUN mkdir -p /app/credentials /app/instances /app/logs /app/maps /app/temp \
&& chown -R hondabot:hondabot /app

VOLUME ["/app/credentials", "/app/instances", "/app/logs", "/app/maps"]

ENV NODE_ENV=production
ENV NODE_OPTIONS="--max-old-space-size=1024"

USER hondabot

VOLUME [ "/app/credentials" ]
VOLUME [ "/app/instances" ]
VOLUME [ "/app/logs" ]
VOLUME [ "/app/maps" ]
HEALTHCHECK --interval=60s --timeout=10s --start-period=120s --retries=3 \
CMD node -e "console.log('healthy')" || exit 1

CMD ["npm", "start"]
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["node", "dist/index.js"]
Loading