Skip to content

Commit

Permalink
docs: copy
Browse files Browse the repository at this point in the history
  • Loading branch information
neurosnap committed Jun 18, 2024
1 parent e219a13 commit 0065c27
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 34 deletions.
2 changes: 1 addition & 1 deletion posts/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ This accepts the default file location. At the prompt, type a secure passphrase.

# How can I setup my `ssh-agent`?

your SSH agent typically hosts your SSH keypairs and serves them when
Your SSH agent typically hosts your SSH keypairs and serves them when
authenticating with an SSH server. So, ensuring your `ssh-agent` is setup
properly is important when connecting to us.

Expand Down
68 changes: 64 additions & 4 deletions posts/file-uploads.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,68 @@ sftp> put hello-world.md
echo 'put hello-world.md' | sftp {service}
```

## sshfs

Requirement: [sshfs](https://github.com/libfuse/sshfs)

`sshfs` will allow users to mount their blog and sites like any other drive. So
you'll be able to view, edit, create, remove, and move folders and files like a
normal filesystem!

Some use cases we think are impactful:

- Debug production sites
- Run cli commands on your production sites
- Grep/find files across all your sites
- Create a development site that you use as a pgs dev server
- Make quick edits to a blog post live
- Run a formatter on your blog posts
- Easier and faster than git-ops (add+commit+push+wait-for-cicd)

### blog with prose

mount your prose.sh blog:

```bash
mkdir ~/blog
sshfs prose.sh:/ ~/blog
# edit files using your favorite editor
nvim ~/blog/hello-world.md
# changes are published live!

# unmount
umount ~/blog
```

### sites with pages

mount your pgs.sh sites:

```bash
mkdir ~/sites
sshfs pgs.sh:/ ~/sites
# edit files using your favorite editor
nvim ~/sites/myproj/index.html
# changes are published live!
```

mount a single site:

```bash
# image you have a static-site builder
cd ~/my_site
# mount your ssg's output folder
sshfs pgs.sh:/my_site ./public
# edit files using your favorite editor
nvim tmpl/base.html
# run ssg build command
# changes are published live!
```

So what's the downside? Well it's a little slower than a hard drive on your
machine. We are still experimenting with the technology so quirks or bugs might
come up. We would love to get your feedback.

# How do I update files?

Just send us the files you want to update. With [pgs.sh](/pgs) you can upload
Expand All @@ -74,17 +136,15 @@ single files to projects, but we also support "deploying" static sites with

# How do I delete files?

We have a couple ways to delete files depending on your use-case.

## sftp

The easiest way to delete a file is via `sftp`.

```bash
sftp {service}
sftp> rm hello-world.md
```

You could also mount our services via `sshfs` and then delete it that way.

# How do I download files?

Using the same tools described [here](#how-do-i-upload-files), just reverse the
Expand Down
2 changes: 1 addition & 1 deletion posts/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ order to be granted access you will need to create an account.

We don't need your email address, all we need is an SSH keypair. So before you
begin, please make sure you have a valid SSH keypair or
[generate one](/faq#generating-a-new-ssh-key).
[generate one](/faq#how-do-i-generate-an-ssh-key).

To get started, simply use SSH:

Expand Down
30 changes: 6 additions & 24 deletions posts/ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ title: UI
description: user interfaces at pico
---

We have two user interfaces: SSH TUI and a Web UI.

# SSH TUI

With this TUI you can perform a few basic operations like: create an account,
Expand All @@ -16,29 +14,13 @@ To use the TUI just SSH into our site:
ssh pico.sh
```

# Web UI

This is an experimental web-based UI leveraging [web tunnels](/tunnels).
# SSH CLI

To use the web UI, create an SSH local forward connection to our [pgs](/pgs)
site:
Many of our services make use of the user providing argument to `ssh`:

```bash
ssh -L 1337:localhost:80 -N [email protected]
```

Then open your browser and navigate to [localhost:1337](http://localhost:1337).

## SSH Config

The SSH tunnel command can be quite a lot to remember if you aren't using it
consistently everyday. Instead, you can setup an SSH config entry to do all the
work for you, here is an example config entry inside `~/.ssh/config`:

```
Host ui
User pico-ui
Hostname pgs.sh
LocalForward 0.0.0.0:1337 localhost:80
SessionType none
ssh pico.sh help
ssh pgs.sh help
ssh prose.sh help
ssh imgs.sh help
```
8 changes: 4 additions & 4 deletions tmpl/pager.partial.tmpl
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{{ define "pager" }}
<div class="flex justify-between gap-2 my-4">
{{if .Prev}}
<div class="pager max-w-half flex items-center">
{{if .Prev}}
<div class="flex flex-col items-start">
<div class="text-sm font-grey-light">&lt;&lt; PREV</div>
<a href="{{.Prev.GenHref}}" class="text-xl link-alt-adj">{{.Prev.Text}}</a>
</div>
{{end}}
</div>
{{end}}

{{if .Next}}
<div class="pager max-w-half flex items-center justify-end">
{{if .Next}}
<div class="flex flex-col items-end">
<div class="text-sm font-grey-light">
NEXT &gt;&gt;
</div>
<a href="{{.Next.GenHref}}" class="text-xl align-right link-alt-adj">{{.Next.Text}}</a>
</div>
{{end}}
</div>
{{end}}
</div>
{{end}}

0 comments on commit 0065c27

Please sign in to comment.