This commit is contained in:
2vb 2024-05-29 00:08:16 -07:00
parent 75cf6c3339
commit 5e4cae659e
8 changed files with 11 additions and 6 deletions

View File

@ -3,6 +3,7 @@
!/aid !/aid
!/config !/config
!/data
!/discord !/discord
!/fortnite !/fortnite
!/handlers !/handlers

View File

@ -16,14 +16,18 @@ RUN --mount=type=bind \
FROM busybox:1.36-glibc as busybox FROM busybox:1.36-glibc as busybox
FROM gcr.io/distroless/base AS deploy FROM gcr.io/distroless/base AS deploy
WORKDIR /app WORKDIR /app
# Copy binaries from Busybox
COPY --from=busybox /bin /bin COPY --from=busybox /bin /bin
RUN mkdir /app/data
# Copy snow binary and configuration files
COPY --from=builder /snow /app/snow
# Setup user # Setup user
RUN adduser -D -h /app snow RUN adduser -D -h /app snow && \
RUN chown snow /app chown -R snow:snow /app
COPY --from=builder --chown=snow --chmod=700 /snow /app/snow
USER snow
EXPOSE 3000 EXPOSE 3000
ENTRYPOINT ["/app/snow"] ENTRYPOINT ["/app/snow"]

View File

@ -77,7 +77,7 @@ func GetCloudStorageConfig(c *fiber.Ctx) error {
func GetAssets(c *fiber.Ctx) error { func GetAssets(c *fiber.Ctx) error {
fileName := c.Params("fileName") fileName := c.Params("fileName")
path := filepath.Join("./data/files", fileName) path := filepath.Join("./data/", fileName)
_, err := os.Stat(path) _, err := os.Stat(path)
if err != nil { if err != nil {
if os.IsNotExist(err) { if os.IsNotExist(err) {