Repository navigation
feat: 🎸 create ~/.site and site files from 1password at install - #58
Open
ChrisHirsch wants to merge 2 commits into
Open
ChrisHirsch wants to merge 2 commits into
ChrisHirsch wants to merge 2 commits into
Conversation
Sign in to 1Password if needed, then fetch the site document and each SITE_FILES entry with op inject, never overwriting existing files and stopping on failure. Add macos/defaults.sh for hidden files in Finder and key repeat.
# Conflicts: # install/install.sh
|
|
||
| 1. Copy `~/.site` from the old Mac (see [Site settings](#site-settings-site)). It can hold tokens, so move it through a password manager, not a repo. | ||
| 2. Clone the private Claude config repo and list it in `CLAUDE_EXTRA_DIRS` (see [Claude Code](#claude-code)). | ||
| 1. Make sure the machine's site document exists in 1Password (see [Site settings](#site-settings-site)). The install script creates `~/.site` and the site's other files from it. |
| 1. Copy `~/.site` from the old Mac (see [Site settings](#site-settings-site)). It can hold tokens, so move it through a password manager, not a repo. | ||
| 2. Clone the private Claude config repo and list it in `CLAUDE_EXTRA_DIRS` (see [Claude Code](#claude-code)). | ||
| 1. Make sure the machine's site document exists in 1Password (see [Site settings](#site-settings-site)). The install script creates `~/.site` and the site's other files from it. | ||
| 2. Clone the private Claude config repo, and list it in `CLAUDE_EXTRA_DIRS` in the site document (see [Claude Code](#claude-code)). |
| During the install script: | ||
|
|
||
| - rebuilds the Dock and sets the system keyboard shortcuts | ||
| - after `brew bundle`, the script signs in to 1Password if needed (Touch ID with the app's CLI integration, or your password for an account added with `op account add`), then asks which site document to use |
| During the install script: | ||
|
|
||
| - rebuilds the Dock and sets the system keyboard shortcuts | ||
| - after `brew bundle`, the script signs in to 1Password if needed (Touch ID with the app's CLI integration, or your password for an account added with `op account add`), then asks which site document to use |
|
|
||
| - rebuilds the Dock and sets the system keyboard shortcuts | ||
| - after `brew bundle`, the script signs in to 1Password if needed (Touch ID with the app's CLI integration, or your password for an account added with `op account add`), then asks which site document to use | ||
| - the macOS step shows hidden files in Finder, makes held keys repeat, rebuilds the Dock, and sets the system keyboard shortcuts |
|
|
||
| The `site_settings` step of the install script: | ||
|
|
||
| 1. Creates `~/.site` from the site document you choose (default `chris_site_macbook`), with each secret reference replaced by its value. |
| The `site_settings` step of the install script: | ||
|
|
||
| 1. Creates `~/.site` from the site document you choose (default `chris_site_macbook`), with each secret reference replaced by its value. | ||
| 2. Creates each file in the site's `SITE_FILES` the same way. Entries are `document:path`, separated by spaces, so document names can't contain spaces. |
| 1. Creates `~/.site` from the site document you choose (default `chris_site_macbook`), with each secret reference replaced by its value. | ||
| 2. Creates each file in the site's `SITE_FILES` the same way. Entries are `document:path`, separated by spaces, so document names can't contain spaces. | ||
|
|
||
| It never overwrites an existing file; it warns and skips it. To refresh a file from 1Password, move it aside and re-run the script. Files are created with mode `600`. If `op` can't reach the vault or a reference doesn't resolve, the script stops; fix the problem and re-run it. `SITE_OP_VAULT` and `SITE_OP_DOCUMENT` override the vault and the default document. |
|
|
||
| ```bash | ||
| op document create ~/site.tpl --title acme_site --vault Clients | ||
| op document get acme_site --vault Clients | op inject > /dev/null && echo ok # check the references resolve |
| command rm ~/site.tpl | ||
| ``` | ||
|
|
||
| To change one: `op document get acme_site --vault Clients > ~/site.tpl`, edit the file, run `op document edit acme_site ~/site.tpl --vault Clients`, and delete the local copy. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Sign in to 1Password if needed, then fetch the site document and each SITE_FILES entry with op inject, never overwriting existing files and stopping on failure. Add macos/defaults.sh for hidden files in Finder and key repeat.