Compare commits
3 Commits
5c83e45d2a
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
b2178fec85
|
|||
|
ee32060a7f
|
|||
|
d231ae7c38
|
@@ -20,9 +20,14 @@ RUN npm install
|
|||||||
COPY --chown=node:node match_collector/. .
|
COPY --chown=node:node match_collector/. .
|
||||||
|
|
||||||
FROM node:current-alpine
|
FROM node:current-alpine
|
||||||
|
# Install su-exec for dropping privileges
|
||||||
|
RUN apk add --no-cache su-exec
|
||||||
RUN mkdir -p /home/node/app && chown -R node:node /home/node/app
|
RUN mkdir -p /home/node/app && chown -R node:node /home/node/app
|
||||||
WORKDIR /home/node/app
|
WORKDIR /home/node/app
|
||||||
USER node
|
|
||||||
COPY --from=build --chown=node:node /home/node/app/match_collector/node_modules ./node_modules
|
COPY --from=build --chown=node:node /home/node/app/match_collector/node_modules ./node_modules
|
||||||
COPY --from=build --chown=node:node /home/node/app/match_collector/. .
|
COPY --from=build --chown=node:node /home/node/app/match_collector/. .
|
||||||
CMD ["/bin/sh", "-c", "node --import=tsx src/index.ts; sleep 20h"]
|
COPY --chown=node:node match_collector/docker-entrypoint.sh /usr/local/bin/
|
||||||
|
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
||||||
|
# Run entrypoint as root to fix permissions, then drop to node user
|
||||||
|
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
||||||
|
CMD ["/bin/sh", "-c", "node --import=tsx src/index.ts; sleep 12h"]
|
||||||
|
|||||||
9
match_collector/docker-entrypoint.sh
Normal file
9
match_collector/docker-entrypoint.sh
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Fix permissions on the cdragon cache directory if it exists
|
||||||
|
if [ -d "/cdragon" ]; then
|
||||||
|
# Ensure the node user owns the cdragon directory
|
||||||
|
chown -R node:node /cdragon 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Execute the main command as the node user
|
||||||
|
exec su-exec node "$@"
|
||||||
@@ -219,17 +219,10 @@ function handleMatchBuilds(
|
|||||||
}
|
}
|
||||||
if (event.type != 'ITEM_PURCHASED') continue
|
if (event.type != 'ITEM_PURCHASED') continue
|
||||||
|
|
||||||
// Handle boots upgrades
|
|
||||||
if (
|
|
||||||
itemInfo.requiredBuffCurrencyName == 'Feats_NoxianBootPurchaseBuff' ||
|
|
||||||
itemInfo.requiredBuffCurrencyName == 'Feats_SpecialQuestBootBuff'
|
|
||||||
) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle boots differently
|
// Handle boots differently
|
||||||
if (itemInfo.categories.includes('Boots')) {
|
if (itemInfo.categories.includes('Boots')) {
|
||||||
if (itemInfo.to.length == 0 || (itemInfo.to[0] >= 3171 && itemInfo.to[0] <= 3176)) {
|
// Ignore basic boots, only count Tier 2 boots
|
||||||
|
if (event.itemId != 1001) {
|
||||||
// Check for bootsFirst
|
// Check for bootsFirst
|
||||||
if (items.length < 2) {
|
if (items.length < 2) {
|
||||||
build.bootsFirstCount += 1
|
build.bootsFirstCount += 1
|
||||||
|
|||||||
Reference in New Issue
Block a user