cachegate 1.0.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitattributes +12 -0
- package/.github/ISSUE_TEMPLATE/config.yml +5 -8
- package/Dockerfile +24 -16
- package/README.md +505 -428
- package/package.json +1 -1
- package/server.js +688 -668
- package/test/env-path.test.js +41 -0
- package/OPEN_SOURCE_ROADMAP.md +0 -554
- package/ROADMAP.md +0 -281
package/.gitattributes
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Force LF regardless of the checking-out platform's git config
|
|
2
|
+
# (core.autocrlf). Real incident this exists to prevent: a Windows
|
|
3
|
+
# checkout of sync-oss-release.sh got CRLF line endings, which broke
|
|
4
|
+
# it immediately with "$'\r': command not found" - no bash interpreter
|
|
5
|
+
# on any platform handles a CRLF shebang/script correctly. See
|
|
6
|
+
# OPEN_SOURCE_ROADMAP.md step 16.
|
|
7
|
+
*.sh text eol=lf
|
|
8
|
+
|
|
9
|
+
# Everything else: let git decide text vs. binary automatically, but
|
|
10
|
+
# normalize line endings to LF in the repository itself either way -
|
|
11
|
+
# this project has no reason to ever store CRLF.
|
|
12
|
+
* text=auto eol=lf
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
- name: Security vulnerability
|
|
7
|
-
url: https://github.com/OWNER/cachegate/security/advisories/new
|
|
8
|
-
about: Do not open a public issue for a vulnerability - use private vulnerability reporting instead. See SECURITY.md.
|
|
1
|
+
blank_issues_enabled: true
|
|
2
|
+
contact_links:
|
|
3
|
+
- name: Security vulnerability
|
|
4
|
+
url: https://github.com/iDebunk/cachegate/security/advisories/new
|
|
5
|
+
about: Do not open a public issue for a vulnerability - use private vulnerability reporting instead. See SECURITY.md.
|
package/Dockerfile
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
FROM node:20-slim
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
FROM node:20-slim
|
|
2
|
+
|
|
3
|
+
# Standard OCI labels - GHCR reads image.source automatically on every push
|
|
4
|
+
# and uses it to link this package to the repo (the alternative to clicking
|
|
5
|
+
# "Connect Repository" by hand once, which doesn't survive a re-publish).
|
|
6
|
+
LABEL org.opencontainers.image.source="https://github.com/iDebunk/cachegate" \
|
|
7
|
+
org.opencontainers.image.description="Self-hostable, OpenAI-compatible LLM proxy: routes to the cheapest healthy provider, caches responses exactly and semantically, tracks cost and latency per call." \
|
|
8
|
+
org.opencontainers.image.licenses="MIT"
|
|
9
|
+
|
|
10
|
+
WORKDIR /app
|
|
11
|
+
COPY package*.json ./
|
|
12
|
+
RUN npm ci --omit=dev
|
|
13
|
+
COPY . .
|
|
14
|
+
# The official Node images already ship a non-root "node" user (uid 1000) -
|
|
15
|
+
# use it instead of running as root, standard practice for a public image.
|
|
16
|
+
RUN chown -R node:node /app
|
|
17
|
+
USER node
|
|
18
|
+
EXPOSE 4000
|
|
19
|
+
# No curl/wget in the slim base image - Node's own http module does the
|
|
20
|
+
# check instead. Uses the real GET /health endpoint (public, no auth,
|
|
21
|
+
# exists specifically for this).
|
|
22
|
+
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
23
|
+
CMD node -e "require('http').get('http://localhost:'+(process.env.PORT||4000)+'/health',(r)=>process.exit(r.statusCode===200?0:1)).on('error',()=>process.exit(1))"
|
|
24
|
+
CMD ["node", "server.js"]
|