Skip to content

Commit f820b1b

Browse files
committed
Fix instructions for mounting Sprite over SSHFS
1 parent 8363db8 commit f820b1b

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

src/content/docs/working-with-sprites.mdx

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,23 @@ These features are useful once you're comfortable.
232232

233233
Use SSHFS to mount your Sprite and edit files with your local tools.
234234

235-
**Install SSHFS first:**
235+
**Install and configure OpenSSH on the Sprite:**
236+
237+
```bash
238+
sudo apt install -y openssh-server
239+
240+
# Create a service to automatically start sshd
241+
sprite-env services create sshd --cmd /usr/sbin/sshd
242+
```
243+
244+
**Authorize your SSH public key:**
245+
246+
```bash
247+
sprite exec mkdir -p ".ssh"
248+
sprite exec sh -c "cat > .ssh/authorized_keys" < ~/.ssh/id_ed25519.pub
249+
```
250+
251+
**Install SSHFS on your host:**
236252

237253
```bash
238254
# macOS
@@ -250,11 +266,13 @@ sudo dnf install fuse-sshfs
250266
```bash
251267
# Add to ~/.zshrc or ~/.bashrc
252268
sc() {
253-
local sprite_name="${1:-$(sprite use)}"
269+
local sprite_name="$1"
254270
local mount_point="/tmp/sprite-${sprite_name}"
271+
test -n "$(sprite url -s "${sprite_name}")"
255272
mkdir -p "$mount_point"
273+
sprite proxy -s "${sprite_name}" 2000:22 &
256274
sshfs -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3 \
257-
"sprite@${sprite_name}.sprites.dev:" "$mount_point"
275+
"sprite@localhost:" -p 2000 "$mount_point"
258276
cd "$mount_point"
259277
}
260278
```
@@ -263,6 +281,7 @@ sc() {
263281

264282
```bash
265283
umount /tmp/sprite-my-sprite
284+
kill "$(lsof -t -i:2000)"
266285
# macOS may need: diskutil umount /tmp/sprite-my-sprite
267286
```
268287

0 commit comments

Comments
 (0)