-
Notifications
You must be signed in to change notification settings - Fork 86
Migrate HTTPS certificates to ~/.studio/certificates
#2871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
cdb311a
Read site data from CLI instead of appdata (#2701)
bcotrim 9e72f3f
Merge remote-tracking branch 'origin/trunk' into stu-1350-decoupled-c…
bcotrim 8daf4a9
Merge branch 'trunk' into stu-1350-decoupled-config-dev
bcotrim b2ce79e
Move CLI site data to dedicated config file (#2731)
bcotrim 7748599
Merge remote-tracking branch 'origin/trunk' into stu-1350-decoupled-c…
bcotrim a87533b
Merge trunk into stu-1350-decoupled-config-dev
bcotrim b4b6e42
Merge branch 'trunk' into stu-1350-decoupled-config-dev
bcotrim 304a3da
Merge branch 'trunk' into stu-1350-decoupled-config-dev
bcotrim 163b971
Fix AI tools test mocks to use cli-config instead of appdata
bcotrim 147bd6d
Merge trunk and resolve conflicts for cli-config decoupling
bcotrim ae5be29
Apply decoupled config strategy to preview sites (#2807)
bcotrim cfa000f
Migrate appdata to ~/.studio/appdata.json with extensible migration f…
bcotrim 9d5ead9
Merge stu-1350-decoupled-config-dev and resolve conflicts
bcotrim 12b98f1
Merge branch 'trunk' into stu-1350-decoupled-config-dev
bcotrim aeb2e3a
Move appdata migration from CLI to Studio Desktop
bcotrim 1081ea7
Wire auth and locale to shared.json, AI settings to cli.json (#2821)
bcotrim 7a34728
Merge remote-tracking branch 'origin/stu-1350-decoupled-config-dev' i…
bcotrim a6a3838
Rewrite appdata migration to split into shared.json, cli.json, and ap…
bcotrim 63b8b8e
trigger ci
bcotrim 46b0358
Ensure .studio directory exists before lockfile and fix import order
bcotrim 4dd6080
Fix readFile mock type to return Buffer instead of string
bcotrim 852cdc9
Refactor appdata to store only Desktop-specific state with sites as R…
bcotrim 92d5be2
Address PR feedback: rename to app.json and siteMetadata, use zod par…
bcotrim 29fa739
Fix prettier formatting in user-data test
bcotrim a317a82
Fix e2e migration by respecting E2E_APP_DATA_PATH in getOldAppdataPath
bcotrim a1b7c38
Merge trunk and resolve conflicts in _events.ts and user-settings ipc…
bcotrim 6db60dd
Merge remote-tracking branch 'origin/stu-1350-decoupled-config-dev' i…
bcotrim 0bd4c58
new migration interface
bcotrim f8e9258
studio migrations
bcotrim aca873d
studio migrations
bcotrim ef52842
cli migrations
bcotrim 23d18ed
Merge branch 'trunk' into stu-1350-decoupled-config-dev
bcotrim cea5b56
Rename appdata references, centralize config paths and lockfile const…
bcotrim f211f3a
Isolate e2e config directory to fix test failures
bcotrim 6e95cb5
Merge branch 'trunk' into stu-1350-decoupled-config-dev
bcotrim e58b6d4
Merge branch 'stu-1350-decoupled-config-dev' into stu-1350-decoupled-…
bcotrim ec6f7e1
Move site metadata cleanup to SiteServer, fix typecheck and test fail…
bcotrim 8c18041
HTTPS certificate migration
fredrikekelund 205f8e6
Rename file
fredrikekelund 9cd3740
Add APP_CONFIG_LOCKFILE_NAME constant and fix test failures
bcotrim c19fc13
Merge branch 'stu-1350-decoupled-config-dev-v3' into stu-1350-decoupl…
fredrikekelund 9789cb4
Merge branch 'trunk' into stu-1350-decoupled-config-dev-v4
fredrikekelund 94946a0
Fix merge conflict
fredrikekelund 462a336
Load sites from `SiteServer.getAll()`
fredrikekelund File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
apps/studio/src/migrations/03-copy-https-certs-to-well-known.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| /** | ||
| * Migrates the `certificates` directory from the platform-specific Electron location to a | ||
| * well-known location at `~/.studio/certificates`. | ||
| * | ||
| * The old directory is intentionally not deleted. It'll be cleaned up in a future migration. | ||
| */ | ||
|
|
||
| import fs from 'node:fs'; | ||
| import { getCertificatesPath } from '@studio/common/lib/config-paths'; | ||
| import { getOldUserDataCertificatesPath } from 'src/storage/paths'; | ||
| import type { Migration } from '@studio/common/lib/migration'; | ||
|
|
||
| const NEW_CERT_DIR = getCertificatesPath(); | ||
| const OLD_CERT_DIR = getOldUserDataCertificatesPath(); | ||
|
|
||
| export const copyHttpsCertsToWellKnown: Migration = { | ||
| needsToRun: async () => { | ||
| return fs.existsSync( OLD_CERT_DIR ) && ! fs.existsSync( NEW_CERT_DIR ); | ||
| }, | ||
| run: async () => { | ||
| await fs.promises.mkdir( NEW_CERT_DIR, { recursive: true } ); | ||
|
|
||
| if ( fs.existsSync( OLD_CERT_DIR ) ) { | ||
| await fs.promises.cp( OLD_CERT_DIR, NEW_CERT_DIR, { | ||
| recursive: true, | ||
| verbatimSymlinks: true, | ||
| } ); | ||
| } | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,12 @@ | ||
| import { migrateFromWpNowFolder } from './00-migrate-from-wp-now-folder'; | ||
| import { renameLaunchUniquesStat } from './01-rename-launch-uniques-stat'; | ||
| import { migrateAppConfig } from './02-migrate-to-split-config'; | ||
| import { copyHttpsCertsToWellKnown } from './03-copy-https-certs-to-well-known'; | ||
| import type { Migration } from '@studio/common/lib/migration'; | ||
|
|
||
| export const migrations: Migration[] = [ | ||
| migrateAppConfig, | ||
| migrateFromWpNowFolder, | ||
| renameLaunchUniquesStat, | ||
| copyHttpsCertsToWellKnown, | ||
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/storage/pathsis already mocked globally inapps/studio/vitest.setup.ts