Skip to content

Commit

Permalink
Fix v0.6.1 migration
Browse files Browse the repository at this point in the history
  • Loading branch information
MaddyGuthridge committed Oct 17, 2024
1 parent b7a0426 commit a779065
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/server/data/migrations/v0.6.0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@
*/

import { nanoid } from 'nanoid';
import { moveLocalConfig, updateConfigVersions } from './shared';
import { moveLocalConfig } from './shared';
import { unsafeLoadLocalConfig } from './unsafeLoad';
import { setLocalConfig } from '../localConfig';
import { authIsSetUp } from '../dataDir';
import semver from 'semver';
import migrateV061 from './v0.6.1';

export default async function migrate(dataDir: string, privateDataDir: string) {
await moveLocalConfig(dataDir, privateDataDir);
if (await authIsSetUp()) {
await updateLocalConfig(privateDataDir);
}
await updateConfigVersions();
await migrateV061(dataDir, privateDataDir);
}

async function updateLocalConfig(privateDataDir: string) {
Expand Down
2 changes: 2 additions & 0 deletions src/lib/server/data/migrations/v0.6.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
*/

import { setLocalConfig } from '../localConfig';
import { updateConfigVersions } from './shared';
import { unsafeLoadLocalConfig } from './unsafeLoad';


export default async function migrate(dataDir: string, privateDataDir: string) {
const config = await unsafeLoadLocalConfig(privateDataDir) as any;
config.allowCloudflareIp = false;
await setLocalConfig(config);
await updateConfigVersions();
}

0 comments on commit a779065

Please sign in to comment.