mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-26 17:45:49 +02:00
feat(libsql): add support for libsql database backups and restores
- Updated backup and restore functionalities to include support for the 'libsql' database type. - Enhanced the backup process with new methods for running and restoring libsql backups. - Modified existing components and schemas to accommodate libsql, including updates to the database type enumerations and backup schemas. - Removed obsolete bottomless replication features from the libsql schema. - Updated related UI components to reflect changes in backup handling for libsql.
This commit is contained in:
@@ -15,7 +15,6 @@ export type LibsqlNested = InferResultType<
|
||||
{
|
||||
mounts: true;
|
||||
environment: { with: { project: true } };
|
||||
bottomlessReplicationDestination: true;
|
||||
}
|
||||
>;
|
||||
export const buildLibsql = async (libsql: LibsqlNested) => {
|
||||
@@ -36,8 +35,6 @@ export const buildLibsql = async (libsql: LibsqlNested) => {
|
||||
command,
|
||||
mounts,
|
||||
enableNamespaces,
|
||||
enableBottomlessReplication,
|
||||
bottomlessReplicationDestination,
|
||||
} = libsql;
|
||||
|
||||
const basicAuth = Buffer.from(
|
||||
@@ -45,20 +42,10 @@ export const buildLibsql = async (libsql: LibsqlNested) => {
|
||||
"utf-8",
|
||||
).toString("base64");
|
||||
|
||||
let defaultLibsqlEnv = `SQLD_NODE="${sqldNode}"\nSQLD_HTTP_AUTH="basic:${basicAuth}"${
|
||||
const defaultLibsqlEnv = `SQLD_NODE="${sqldNode}"\nSQLD_HTTP_AUTH="basic:${basicAuth}"${
|
||||
env ? `\n${env}` : ""
|
||||
}${sqldNode === "replica" ? `\nSQLD_PRIMARY_URL="${sqldPrimaryUrl}"` : ""}`;
|
||||
|
||||
// Add bottomless replication environment variables if destination is configured
|
||||
if (enableBottomlessReplication && bottomlessReplicationDestination) {
|
||||
defaultLibsqlEnv += `\nLIBSQL_BOTTOMLESS_DATABASE_ID="${appName}"`;
|
||||
defaultLibsqlEnv += `\nLIBSQL_BOTTOMLESS_BUCKET="${bottomlessReplicationDestination.bucket}"`;
|
||||
defaultLibsqlEnv += `\nLIBSQL_BOTTOMLESS_ENDPOINT="${bottomlessReplicationDestination.endpoint}"`;
|
||||
defaultLibsqlEnv += `\nLIBSQL_BOTTOMLESS_AWS_SECRET_ACCESS_KEY="${bottomlessReplicationDestination.secretAccessKey}"`;
|
||||
defaultLibsqlEnv += `\nLIBSQL_BOTTOMLESS_AWS_ACCESS_KEY_ID="${bottomlessReplicationDestination.accessKey}"`;
|
||||
defaultLibsqlEnv += `\nLIBSQL_BOTTOMLESS_AWS_DEFAULT_REGION="${bottomlessReplicationDestination.region}"`;
|
||||
}
|
||||
|
||||
const {
|
||||
HealthCheck,
|
||||
RestartPolicy,
|
||||
@@ -92,16 +79,13 @@ export const buildLibsql = async (libsql: LibsqlNested) => {
|
||||
if (enableNamespaces) {
|
||||
finalCommand += " --enable-namespaces";
|
||||
}
|
||||
if (enableBottomlessReplication) {
|
||||
finalCommand += " --enable-bottomless-replication";
|
||||
}
|
||||
|
||||
const settings: CreateServiceOptions = {
|
||||
Name: appName,
|
||||
TaskTemplate: {
|
||||
ContainerSpec: {
|
||||
HealthCheck,
|
||||
Image: "ghcr.io/tursodatabase/libsql-server:latest",
|
||||
Image: "ghcr.io/tursodatabase/libsql-server:v0.24.32",
|
||||
Env: envVariables,
|
||||
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
|
||||
...(finalCommand
|
||||
|
||||
Reference in New Issue
Block a user