Édition du docker-compose.yml depuis la page d'un conteneur
Vérification par docker compose config avant écriture, application avec docker compose up -d et retour à la version précédente en cas d'échec. Historique des versions par fichier. Le Caddyfile et le compose gardent un retour à la ligne final. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
dcdac915f9
commit
c106fcfc62
27 files changed
+1035
-58
No files matched your search
@@ -0,0 +1,24 @@
|
||||
import { BaseSchema } from '@adonisjs/lucid/schema'
|
||||
|
||||
/**
|
||||
* Previous contents of the docker-compose.yml files, saved before every
|
||||
* change made from the dashboard.
|
||||
*/
|
||||
export default class extends BaseSchema {
|
||||
protected tableName = 'compose_versions'
|
||||
|
||||
async up() {
|
||||
this.schema.createTable(this.tableName, (table) => {
|
||||
table.increments('id')
|
||||
table.string('path').notNullable().index()
|
||||
table.text('content').notNullable()
|
||||
table.string('username').nullable()
|
||||
table.string('reason').nullable()
|
||||
table.timestamp('created_at').notNullable()
|
||||
})
|
||||
}
|
||||
|
||||
async down() {
|
||||
this.schema.dropTable(this.tableName)
|
||||
}
|
||||
}
|
||||
@@ -45,6 +45,23 @@ export class CaddyfileVersionSchema extends BaseModel {
|
||||
declare username: string | null
|
||||
}
|
||||
|
||||
export class ComposeVersionSchema extends BaseModel {
|
||||
static $columns = ['content', 'createdAt', 'id', 'path', 'reason', 'username'] as const
|
||||
$columns = ComposeVersionSchema.$columns
|
||||
@column()
|
||||
declare content: string
|
||||
@column.dateTime({ autoCreate: true })
|
||||
declare createdAt: DateTime
|
||||
@column({ isPrimary: true })
|
||||
declare id: number
|
||||
@column()
|
||||
declare path: string
|
||||
@column()
|
||||
declare reason: string | null
|
||||
@column()
|
||||
declare username: string | null
|
||||
}
|
||||
|
||||
export class MetricSchema extends BaseModel {
|
||||
static $columns = ['cpu', 'diskTotal', 'diskUsed', 'id', 'load1', 'memTotal', 'memUsed', 'netRx', 'netTx', 'ts'] as const
|
||||
$columns = MetricSchema.$columns
|
||||
|
||||
Reference in new issue
Block a user