feat(backup): add containerarchive-backed backup storage, restore, download, and pruning support

This commit is contained in:
2026-03-24 19:54:56 +00:00
parent 22a7e76645
commit 0799efadae
18 changed files with 816 additions and 447 deletions

View File

@@ -2,7 +2,7 @@
* Onebox Registry Manager
*
* Manages the local Docker registry using:
* - @push.rocks/smarts3 (S3-compatible server with filesystem storage)
* - @push.rocks/smartstorage (S3-compatible server with filesystem storage)
* - @push.rocks/smartregistry (OCI-compliant Docker registry)
*/
@@ -27,7 +27,7 @@ export class RegistryManager {
}
/**
* Initialize the registry (start smarts3 and smartregistry)
* Initialize the registry (start smartstorage and smartregistry)
*/
async init(): Promise<void> {
if (this.isInitialized) {
@@ -39,10 +39,10 @@ export class RegistryManager {
const dataDir = this.options.dataDir || './.nogit/registry-data';
const port = this.options.port || 4000;
logger.info(`Starting smarts3 server on port ${port}...`);
logger.info(`Starting smartstorage server on port ${port}...`);
// 1. Start smarts3 server (S3-compatible storage with filesystem backend)
this.s3Server = await plugins.smarts3.Smarts3.createAndStart({
// 1. Start smartstorage server (S3-compatible storage with filesystem backend)
this.s3Server = await plugins.smartstorage.SmartStorage.createAndStart({
server: {
port: port,
address: '0.0.0.0',
@@ -53,16 +53,16 @@ export class RegistryManager {
},
});
logger.success(`smarts3 server started on port ${port}`);
logger.success(`smartstorage server started on port ${port}`);
// 2. Configure smartregistry to use smarts3
// 2. Configure smartregistry to use smartstorage
logger.info('Initializing smartregistry...');
this.registry = new plugins.smartregistry.SmartRegistry({
storage: {
endpoint: 'localhost',
port: port,
accessKey: 'onebox', // smarts3 doesn't validate credentials
accessKey: 'onebox', // smartstorage doesn't validate credentials
accessSecret: 'onebox',
useSsl: false,
region: 'us-east-1',
@@ -314,15 +314,15 @@ export class RegistryManager {
}
/**
* Stop the registry and smarts3 server
* Stop the registry and smartstorage server
*/
async stop(): Promise<void> {
if (this.s3Server) {
try {
await this.s3Server.stop();
logger.info('smarts3 server stopped');
logger.info('smartstorage server stopped');
} catch (error) {
logger.error(`Error stopping smarts3: ${getErrorMessage(error)}`);
logger.error(`Error stopping smartstorage: ${getErrorMessage(error)}`);
}
}