unprovision
This commit is contained in:
parent
22c2f68c2a
commit
1e53bba6e7
6 changed files with 148 additions and 0 deletions
|
|
@ -211,6 +211,26 @@ func (a *App) reprovisionProject(ctx context.Context, userID string, projectID i
|
|||
return p, nil
|
||||
}
|
||||
|
||||
func (a *App) unprovisionProject(ctx context.Context, userID string, projectID int64) error {
|
||||
p, err := a.getProject(ctx, userID, projectID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := a.removeSystemdForProject(p); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := a.dropProjectDatabase(ctx, p); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := a.db.ExecContext(ctx, `DELETE FROM projects WHERE id=$1 AND user_id=$2`, p.ID, userID); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := a.syncCaddyConfigFragment(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *App) listEnvVars(ctx context.Context, userID string, projectID int64) ([]EnvVar, error) {
|
||||
if _, err := a.getProject(ctx, userID, projectID); err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue