Settings > Backups gains a whole-data archive beside the database snapshots, and both lists now fully work from the page. - Data archives: `write-data-backup-archive.ts` tars all of DATA_DIR into BACKUP_ARCHIVE_DIR as cobble-data-<epoch-ms>.tar.gz, every entry under one root folder named after the archive, writing a .part name and renaming on success so a cut-off run is never listed. The newest AppData.DataBackupsKept are kept; db/.backups is left as it is. - Restore: `restore-data-backup.ts` extracts to a temp dir, requires one root folder holding a db folder, takes a safety archive first, then replaces DATA_DIR (the database snapshots included) and `restart-app.ts` restarts the process through the docker socket, since the open SQLite handle points at the replaced file. - Upload and restore: a modal over each list (database file or data archive), replacing the old /admin/settings/backups/restore page. - Delete for both kinds, icon-only row actions shared through RowIconButton, and restore on every row. - One backup or restore of either kind at a time (with-backup-run-lock). - BACKUP_ARCHIVE_DIR is a start-up path (ProcessOnlyEnvKeys); the installer mounts $COBBLE_HOME/backups-archives at /backups-archives and recreates a container that lacks it. The image installs tar and gzip.
38 lines
1.2 KiB
Docker
38 lines
1.2 KiB
Docker
FROM oven/bun:1.4.3-debian
|
|
|
|
LABEL org.opencontainers.image.title="Cobble" \
|
|
org.opencontainers.image.description="A self-hosted crew of small AI worker bots." \
|
|
org.opencontainers.image.source="https://github.com/Moduletrace/cobble" \
|
|
org.opencontainers.image.licenses="MIT"
|
|
|
|
# The app serves plain HTTP; HTTPS is the reverse proxy's job.
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends curl bash nano wget zip unzip tar gzip \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
ENV NODE_ENV=production
|
|
# Everything that must survive an update lives on the /data volume:
|
|
# the database, media, computers' home directories
|
|
ENV DATA_DIR=/data
|
|
ENV DB_DIR=/data/db
|
|
ENV BUN_FEATURE_FLAG_DISABLE_STREAMING_INSTALL=1
|
|
|
|
WORKDIR /app
|
|
|
|
RUN echo 'alias ll="ls -laF"' >/root/.bashrc
|
|
|
|
COPY package.json bun.lock ./
|
|
# Local packages the lockfile installs from (`file:` dependencies)
|
|
COPY packages ./packages
|
|
RUN bun install --frozen-lockfile
|
|
|
|
COPY . /app/.
|
|
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
|
|
CMD curl -fsS "http://localhost:${PORT:-7227}/api/health" || exit 1
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|