chore: update README
3cb273ab
2 file(s) · +51 −39
| 1 | + | SIPP_API_KEY=your-secret-key |
|
| 2 | + | SIPP_AUTH_ENDPOINTS=api_delete,api_list |
|
| 3 | + | SIPP_DB_PATH=sipp.sqlite |
|
| 4 | + | SIPP_REMOTE_URL=http://your-server.com |
| 2 | 2 | ||
| 3 | 3 |  |
|
| 4 | 4 | ||
| 5 | - | Minimal code sharing in Rust |
|
| 5 | + | Minimal code sharing |
|
| 6 | 6 | ||
| 7 | 7 | ## Features |
|
| 8 | 8 | ||
| 9 | - | - Single binary for Server, CLI, and TUI |
|
| 10 | - | - Web UI to create, copy, and share code snippets with syntax highlighting |
|
| 9 | + | - Single binary for web server and TUI |
|
| 10 | + | - Create snippets and share on the web |
|
| 11 | 11 | - Interactive TUI with authenticated access for snippet management |
|
| 12 | 12 | - Minimal, fast, and low memory consumption |
|
| 13 | 13 | ||
| 14 | + | ## Demo |
|
| 15 | + | ||
| 16 | + | Try it out at [sipp.so](https://sipp.so) or install and use the TUI |
|
| 17 | + | ||
| 18 | + | ```bash |
|
| 19 | + | sipp -r https://sipp.so |
|
| 20 | + | ``` |
|
| 21 | + | ||
| 14 | 22 | ## Quickstart |
|
| 15 | 23 | ||
| 16 | - | **1. Install with Cargo** |
|
| 24 | + | **1. Installo** |
|
| 17 | 25 | ||
| 18 | 26 | Install the binary from Crates.io |
|
| 19 | 27 | ||
| 47 | 55 | sipp |
|
| 48 | 56 | ``` |
|
| 49 | 57 | ||
| 50 | - | ## Server |
|
| 58 | + | ## Install |
|
| 59 | + | ||
| 60 | + | Sipp can be installed several ways |
|
| 61 | + | ||
| 62 | + | ### Cargo |
|
| 63 | + | Install with Cargo directly |
|
| 64 | + | ||
| 65 | + | ```bash |
|
| 66 | + | cargo install sipp-so |
|
| 67 | + | ``` |
|
| 68 | + | ||
| 69 | + | ### GitHub Releases |
|
| 70 | + | Visit the [releases](https://github.com/stevedylandev/sipp/releases) page and download one of the prebuilt binaries |
|
| 71 | + | ||
| 72 | + | ## Usage |
|
| 73 | + | ||
| 74 | + | ### Server |
|
| 51 | 75 | ||
| 52 | 76 | Sipp includes a built-in web server powered by Axum. Start it with: |
|
| 53 | 77 | ||
| 55 | 79 | sipp server --port 3000 --host localhost |
|
| 56 | 80 | ``` |
|
| 57 | 81 | ||
| 58 | - | ### Environment Variables |
|
| 82 | + | #### Environment Variables |
|
| 59 | 83 | ||
| 60 | 84 | | Variable | Description | |
|
| 61 | 85 | |---|---| |
|
| 65 | 89 | ||
| 66 | 90 | The server stores snippets in a local `sipp.sqlite` SQLite database. |
|
| 67 | 91 | ||
| 68 | - | ### API Endpoints |
|
| 92 | + | #### API Endpoints |
|
| 69 | 93 | ||
| 70 | 94 | | Method | Endpoint | Description | |
|
| 71 | 95 | |---|---|---| |
|
| 76 | 100 | ||
| 77 | 101 | Authenticated endpoints require an `x-api-key` header. |
|
| 78 | 102 | ||
| 79 | - | ## Web UI |
|
| 103 | + | ### TUI |
|
| 80 | 104 | ||
| 81 | - | The server serves a web interface at the root URL where you can create, view, and share code snippets with syntax highlighting. Each snippet gets a shareable link at `/s/{short_id}`. |
|
| 82 | - | ||
| 83 | - | ## CLI |
|
| 105 | + | The Sipp TUI makes it easy to create, copy, share, and manage your snippets either locally or remotely. |
|
| 84 | 106 | ||
| 85 | - | Upload a file directly from the command line: |
|
| 107 | + | #### Local Access |
|
| 86 | 108 | ||
| 87 | - | ```bash |
|
| 88 | - | sipp path/to/file.rs |
|
| 89 | - | ``` |
|
| 109 | + | If you are running `sipp` in the same directory as the `sipp.sqlite` file created by the server instance, the TUI will automatically access the datebase locally and you can edit it directly. |
|
| 90 | 110 | ||
| 91 | - | This creates a snippet and prints the shareable link (also copied to clipboard). |
|
| 111 | + | #### Remote Access |
|
| 92 | 112 | ||
| 93 | - | ## TUI |
|
| 113 | + | To access a remote instance of Sipp make sure to do the following: |
|
| 114 | + | - Set the `SIPP_API_KEY` variable in your server instance |
|
| 115 | + | - Run `sipp auth` to enter in your server instance URL and the API key, which will be stored under `$HOME/.config/sipp`. You can also set these with the ENV variables `SIPP_REMOTE_URL` and `SIPP_API_KEY` |
|
| 94 | 116 | ||
| 95 | - | Launch the interactive terminal UI: |
|
| 117 | + | >![NOTE] |
|
| 118 | + | >You can try a limited remote instance without an API key with `sipp -r https://sipp.so` |
|
| 96 | 119 | ||
| 97 | - | ```bash |
|
| 98 | - | sipp |
|
| 99 | - | ``` |
|
| 120 | + | #### Actions |
|
| 100 | 121 | ||
| 101 | - | ### Keybindings |
|
| 122 | + | While inside the TUI the following actions are available |
|
| 102 | 123 | ||
| 103 | 124 | | Key | Action | |
|
| 104 | 125 | |---|---| |
|
| 115 | 136 | | `q` | Quit | |
|
| 116 | 137 | | `?` | Toggle help | |
|
| 117 | 138 | ||
| 118 | - | ## Configuration |
|
| 119 | - | ||
| 120 | - | Save your remote URL and API key to `~/.config/sipp/config.toml` so you can access your sipp db anywhere: |
|
| 121 | - | ||
| 122 | - | ```bash |
|
| 123 | - | sipp auth |
|
| 124 | - | ``` |
|
| 139 | + | ## Deployment |
|
| 125 | 140 | ||
| 126 | - | You can also pass these as flags or environment variables: |
|
| 127 | - | ||
| 128 | - | ```bash |
|
| 129 | - | sipp --remote http://your-server.com --api-key YOUR_KEY |
|
| 130 | - | # or |
|
| 131 | - | export SIPP_REMOTE_URL=http://your-server.com |
|
| 132 | - | export SIPP_API_KEY=YOUR_KEY |
|
| 133 | - | ``` |
|
| 134 | - | ||
| 135 | - | ## Deployment |
|
| 141 | + | Since Sipp is a single binary it can be run in virtually any enviornment. |
|
| 136 | 142 | ||
| 137 | 143 | ### Systemd |
|
| 138 | 144 | ||
| 176 | 182 | 2. Set the environment variables `SIPP_API_KEY` and optionally `SIPP_AUTH_ENDPOINTS` |
|
| 177 | 183 | 3. Add a [volume](https://docs.railway.com/guides/volumes) to your service and mount it at `/data` |
|
| 178 | 184 | 4. Set `SIPP_DB_PATH` to `/data/sipp.sqlite` so the database persists across deploys |
|
| 185 | + | ||
| 186 | + | ## Roadmap |
|