toss-cli 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- toss_cli-1.0.0/.github/workflows/publish.yml +33 -0
- toss_cli-1.0.0/.gitignore +208 -0
- toss_cli-1.0.0/LICENSE +21 -0
- toss_cli-1.0.0/PKG-INFO +152 -0
- toss_cli-1.0.0/README.md +116 -0
- toss_cli-1.0.0/assets/404.html +107 -0
- toss_cli-1.0.0/assets/logo-circle.svg +20 -0
- toss_cli-1.0.0/assets/logo.svg +23 -0
- toss_cli-1.0.0/pyproject.toml +47 -0
- toss_cli-1.0.0/toss_cli/__init__.py +1 -0
- toss_cli-1.0.0/toss_cli/__main__.py +4 -0
- toss_cli-1.0.0/toss_cli/cli.py +96 -0
- toss_cli-1.0.0/toss_cli/config.py +101 -0
- toss_cli-1.0.0/toss_cli/deploy.py +106 -0
- toss_cli-1.0.0/toss_cli/remote.py +92 -0
- toss_cli-1.0.0/toss_cli/ssh.py +17 -0
- toss_cli-1.0.0/toss_cli/templates/__init__.py +8 -0
- toss_cli-1.0.0/toss_cli/templates/markdown_page.html +163 -0
- toss_cli-1.0.0/uv.lock +43 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- uses: astral-sh/setup-uv@v5
|
|
14
|
+
- run: uv build
|
|
15
|
+
|
|
16
|
+
- uses: actions/upload-artifact@v4
|
|
17
|
+
with:
|
|
18
|
+
name: dist
|
|
19
|
+
path: dist/
|
|
20
|
+
|
|
21
|
+
publish:
|
|
22
|
+
needs: build
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
environment: pypi
|
|
25
|
+
permissions:
|
|
26
|
+
id-token: write
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/download-artifact@v4
|
|
29
|
+
with:
|
|
30
|
+
name: dist
|
|
31
|
+
path: dist/
|
|
32
|
+
|
|
33
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
#poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
#pdm.lock
|
|
116
|
+
#pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
#pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# SageMath parsed files
|
|
135
|
+
*.sage.py
|
|
136
|
+
|
|
137
|
+
# Environments
|
|
138
|
+
.env
|
|
139
|
+
.envrc
|
|
140
|
+
.venv
|
|
141
|
+
env/
|
|
142
|
+
venv/
|
|
143
|
+
ENV/
|
|
144
|
+
env.bak/
|
|
145
|
+
venv.bak/
|
|
146
|
+
|
|
147
|
+
# Spyder project settings
|
|
148
|
+
.spyderproject
|
|
149
|
+
.spyproject
|
|
150
|
+
|
|
151
|
+
# Rope project settings
|
|
152
|
+
.ropeproject
|
|
153
|
+
|
|
154
|
+
# mkdocs documentation
|
|
155
|
+
/site
|
|
156
|
+
|
|
157
|
+
# mypy
|
|
158
|
+
.mypy_cache/
|
|
159
|
+
.dmypy.json
|
|
160
|
+
dmypy.json
|
|
161
|
+
|
|
162
|
+
# Pyre type checker
|
|
163
|
+
.pyre/
|
|
164
|
+
|
|
165
|
+
# pytype static type analyzer
|
|
166
|
+
.pytype/
|
|
167
|
+
|
|
168
|
+
# Cython debug symbols
|
|
169
|
+
cython_debug/
|
|
170
|
+
|
|
171
|
+
# PyCharm
|
|
172
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
173
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
174
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
175
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
176
|
+
#.idea/
|
|
177
|
+
|
|
178
|
+
# Abstra
|
|
179
|
+
# Abstra is an AI-powered process automation framework.
|
|
180
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
181
|
+
# Learn more at https://abstra.io/docs
|
|
182
|
+
.abstra/
|
|
183
|
+
|
|
184
|
+
# Visual Studio Code
|
|
185
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
186
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
187
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
188
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
189
|
+
# .vscode/
|
|
190
|
+
|
|
191
|
+
# Ruff stuff:
|
|
192
|
+
.ruff_cache/
|
|
193
|
+
|
|
194
|
+
# PyPI configuration file
|
|
195
|
+
.pypirc
|
|
196
|
+
|
|
197
|
+
# Cursor
|
|
198
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
199
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
200
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
201
|
+
.cursorignore
|
|
202
|
+
.cursorindexingignore
|
|
203
|
+
|
|
204
|
+
# Marimo
|
|
205
|
+
marimo/_static/
|
|
206
|
+
marimo/_lsp/
|
|
207
|
+
__marimo__/
|
|
208
|
+
assets/test/
|
toss_cli-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Valérien
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
toss_cli-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: toss-cli
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Minimal CLI to deploy and share static sites, HTML, and Markdown from your own server.
|
|
5
|
+
Project-URL: Homepage, https://github.com/brayevalerien/toss
|
|
6
|
+
Project-URL: Repository, https://github.com/brayevalerien/toss
|
|
7
|
+
Author-email: Valérien <contact@brayevalerien.com>
|
|
8
|
+
License: MIT License
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2026 Valérien
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
in the Software without restriction, including without limitation the rights
|
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
furnished to do so, subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
copies or substantial portions of the Software.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
SOFTWARE.
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Keywords: caddy,cli,deploy,file-sharing,latex,markdown,rsync,self-hosted,static-site
|
|
31
|
+
Classifier: Environment :: Console
|
|
32
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
33
|
+
Classifier: Programming Language :: Python :: 3
|
|
34
|
+
Requires-Python: >=3.10
|
|
35
|
+
Description-Content-Type: text/markdown
|
|
36
|
+
|
|
37
|
+
<div align="center">
|
|
38
|
+
<img src="assets/logo-circle.svg" alt="toss logo" width="96" />
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
# Toss
|
|
42
|
+
Toss is a minimal CLI to deploy and share static sites, HTML, and Markdown from your own server. Fast configuration and easy to setup so you can use it from about everywhere and share your work with private URLs.
|
|
43
|
+
|
|
44
|
+
## Features
|
|
45
|
+
- Deploy a Markdown file, an HTML file, or a full directory with a single command
|
|
46
|
+
- Markdown pages render in the browser with LaTeX (KaTeX), syntax highlighting, footnotes, callouts, and Mermaid diagrams
|
|
47
|
+
- Random slugs by default, custom slugs with `--slug`
|
|
48
|
+
- Build-and-deploy in one step with `--build`
|
|
49
|
+
- List, hide, unhide, and permanently delete deployments
|
|
50
|
+
- Zero server-side dependencies beyond Caddy and SSH access
|
|
51
|
+
|
|
52
|
+
## Installation and setup
|
|
53
|
+
> [!NOTE]
|
|
54
|
+
> The following prerequisites are needed before installing toss.
|
|
55
|
+
> - [Python](https://www.python.org/) 3.10+
|
|
56
|
+
> - [uv](https://docs.astral.sh/uv/)
|
|
57
|
+
> - [git](https://git-scm.com/)
|
|
58
|
+
> - `rsync` and `ssh` available in PATH (client-side)
|
|
59
|
+
> - SSH access to a server running [Caddy](https://caddyserver.com/)
|
|
60
|
+
|
|
61
|
+
### Server-side setup
|
|
62
|
+
You'll first need to configure your server to serve files through SSH and [Caddy](https://caddyserver.com/).
|
|
63
|
+
This section assumes you are running the commands on your server.
|
|
64
|
+
|
|
65
|
+
Add a DNS A record: `share` (or anything you like) pointing to your server IP.
|
|
66
|
+
|
|
67
|
+
Create the sites directory and give your SSH user write access:
|
|
68
|
+
```sh
|
|
69
|
+
sudo mkdir -p /srv/sites
|
|
70
|
+
sudo chown youruser:youruser /srv/sites
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Add a block to your Caddyfile for the share subdomain:
|
|
74
|
+
```
|
|
75
|
+
share.yourdomain.com {
|
|
76
|
+
root * /srv/sites
|
|
77
|
+
file_server
|
|
78
|
+
header X-Robots-Tag "noindex, nofollow"
|
|
79
|
+
handle_errors {
|
|
80
|
+
rewrite * /404.html
|
|
81
|
+
file_server
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
If running Caddy in Docker, also mount `/srv/sites` in your Caddy container's volumes:
|
|
87
|
+
```yaml
|
|
88
|
+
volumes:
|
|
89
|
+
- /srv/sites:/srv/sites:ro
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Copy the 404 page to your server. Feel free to edit `assets/404.html` to add your own contact info, and edit `toss_cli/templates/markdown_page.html` to customize the Markdown rendering theme before installing:
|
|
93
|
+
```sh
|
|
94
|
+
scp assets/404.html user@your-server:/srv/sites/404.html
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Then restart Caddy:
|
|
98
|
+
```sh
|
|
99
|
+
# assuming systemd
|
|
100
|
+
sudo systemctl reload caddy
|
|
101
|
+
# or if using Docker
|
|
102
|
+
docker compose up -d caddy
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Local CLI
|
|
106
|
+
Once the server is configured, clone the repo and install toss locally:
|
|
107
|
+
```sh
|
|
108
|
+
git clone https://github.com/brayevalerien/toss
|
|
109
|
+
cd toss
|
|
110
|
+
uv tool install .
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Once toss is installed, run the interactive setup wizard once:
|
|
114
|
+
```sh
|
|
115
|
+
toss init
|
|
116
|
+
```
|
|
117
|
+
This will prompt you for your server details, validate SSH connectivity, and save a config file at `~/.config/toss/config.toml`.
|
|
118
|
+
|
|
119
|
+
> [!NOTE]
|
|
120
|
+
> Re-run `toss init` at any time to update your configuration. If you prefer to edit it manually, it uses the following format:
|
|
121
|
+
> ```toml
|
|
122
|
+
> host = "user@my-server"
|
|
123
|
+
> domain = "share.mydomain.com"
|
|
124
|
+
> remote_path = "/srv/sites"
|
|
125
|
+
> slug_length = 6
|
|
126
|
+
> ```
|
|
127
|
+
|
|
128
|
+
## Usage
|
|
129
|
+
|
|
130
|
+
```sh
|
|
131
|
+
# deploy a Markdown file, an HTML file, or a directory
|
|
132
|
+
toss deploy path/to/file.md
|
|
133
|
+
toss deploy path/to/page.html
|
|
134
|
+
toss deploy path/to/site/
|
|
135
|
+
|
|
136
|
+
# custom slug
|
|
137
|
+
toss deploy report.md --slug my-report
|
|
138
|
+
|
|
139
|
+
# build then deploy
|
|
140
|
+
toss deploy . --build "npm run build"
|
|
141
|
+
toss deploy . --build "npm run build" --out dist
|
|
142
|
+
|
|
143
|
+
# list all deployments
|
|
144
|
+
toss list
|
|
145
|
+
|
|
146
|
+
# hide (makes URL return 404) and unhide
|
|
147
|
+
toss hide <slug>
|
|
148
|
+
toss unhide <slug>
|
|
149
|
+
|
|
150
|
+
# permanently delete
|
|
151
|
+
toss undeploy <slug>
|
|
152
|
+
```
|
toss_cli-1.0.0/README.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="assets/logo-circle.svg" alt="toss logo" width="96" />
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
# Toss
|
|
6
|
+
Toss is a minimal CLI to deploy and share static sites, HTML, and Markdown from your own server. Fast configuration and easy to setup so you can use it from about everywhere and share your work with private URLs.
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
- Deploy a Markdown file, an HTML file, or a full directory with a single command
|
|
10
|
+
- Markdown pages render in the browser with LaTeX (KaTeX), syntax highlighting, footnotes, callouts, and Mermaid diagrams
|
|
11
|
+
- Random slugs by default, custom slugs with `--slug`
|
|
12
|
+
- Build-and-deploy in one step with `--build`
|
|
13
|
+
- List, hide, unhide, and permanently delete deployments
|
|
14
|
+
- Zero server-side dependencies beyond Caddy and SSH access
|
|
15
|
+
|
|
16
|
+
## Installation and setup
|
|
17
|
+
> [!NOTE]
|
|
18
|
+
> The following prerequisites are needed before installing toss.
|
|
19
|
+
> - [Python](https://www.python.org/) 3.10+
|
|
20
|
+
> - [uv](https://docs.astral.sh/uv/)
|
|
21
|
+
> - [git](https://git-scm.com/)
|
|
22
|
+
> - `rsync` and `ssh` available in PATH (client-side)
|
|
23
|
+
> - SSH access to a server running [Caddy](https://caddyserver.com/)
|
|
24
|
+
|
|
25
|
+
### Server-side setup
|
|
26
|
+
You'll first need to configure your server to serve files through SSH and [Caddy](https://caddyserver.com/).
|
|
27
|
+
This section assumes you are running the commands on your server.
|
|
28
|
+
|
|
29
|
+
Add a DNS A record: `share` (or anything you like) pointing to your server IP.
|
|
30
|
+
|
|
31
|
+
Create the sites directory and give your SSH user write access:
|
|
32
|
+
```sh
|
|
33
|
+
sudo mkdir -p /srv/sites
|
|
34
|
+
sudo chown youruser:youruser /srv/sites
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Add a block to your Caddyfile for the share subdomain:
|
|
38
|
+
```
|
|
39
|
+
share.yourdomain.com {
|
|
40
|
+
root * /srv/sites
|
|
41
|
+
file_server
|
|
42
|
+
header X-Robots-Tag "noindex, nofollow"
|
|
43
|
+
handle_errors {
|
|
44
|
+
rewrite * /404.html
|
|
45
|
+
file_server
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
If running Caddy in Docker, also mount `/srv/sites` in your Caddy container's volumes:
|
|
51
|
+
```yaml
|
|
52
|
+
volumes:
|
|
53
|
+
- /srv/sites:/srv/sites:ro
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Copy the 404 page to your server. Feel free to edit `assets/404.html` to add your own contact info, and edit `toss_cli/templates/markdown_page.html` to customize the Markdown rendering theme before installing:
|
|
57
|
+
```sh
|
|
58
|
+
scp assets/404.html user@your-server:/srv/sites/404.html
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Then restart Caddy:
|
|
62
|
+
```sh
|
|
63
|
+
# assuming systemd
|
|
64
|
+
sudo systemctl reload caddy
|
|
65
|
+
# or if using Docker
|
|
66
|
+
docker compose up -d caddy
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Local CLI
|
|
70
|
+
Once the server is configured, clone the repo and install toss locally:
|
|
71
|
+
```sh
|
|
72
|
+
git clone https://github.com/brayevalerien/toss
|
|
73
|
+
cd toss
|
|
74
|
+
uv tool install .
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Once toss is installed, run the interactive setup wizard once:
|
|
78
|
+
```sh
|
|
79
|
+
toss init
|
|
80
|
+
```
|
|
81
|
+
This will prompt you for your server details, validate SSH connectivity, and save a config file at `~/.config/toss/config.toml`.
|
|
82
|
+
|
|
83
|
+
> [!NOTE]
|
|
84
|
+
> Re-run `toss init` at any time to update your configuration. If you prefer to edit it manually, it uses the following format:
|
|
85
|
+
> ```toml
|
|
86
|
+
> host = "user@my-server"
|
|
87
|
+
> domain = "share.mydomain.com"
|
|
88
|
+
> remote_path = "/srv/sites"
|
|
89
|
+
> slug_length = 6
|
|
90
|
+
> ```
|
|
91
|
+
|
|
92
|
+
## Usage
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
# deploy a Markdown file, an HTML file, or a directory
|
|
96
|
+
toss deploy path/to/file.md
|
|
97
|
+
toss deploy path/to/page.html
|
|
98
|
+
toss deploy path/to/site/
|
|
99
|
+
|
|
100
|
+
# custom slug
|
|
101
|
+
toss deploy report.md --slug my-report
|
|
102
|
+
|
|
103
|
+
# build then deploy
|
|
104
|
+
toss deploy . --build "npm run build"
|
|
105
|
+
toss deploy . --build "npm run build" --out dist
|
|
106
|
+
|
|
107
|
+
# list all deployments
|
|
108
|
+
toss list
|
|
109
|
+
|
|
110
|
+
# hide (makes URL return 404) and unhide
|
|
111
|
+
toss hide <slug>
|
|
112
|
+
toss unhide <slug>
|
|
113
|
+
|
|
114
|
+
# permanently delete
|
|
115
|
+
toss undeploy <slug>
|
|
116
|
+
```
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<meta name="robots" content="noindex, nofollow">
|
|
8
|
+
<title>404</title>
|
|
9
|
+
<style>
|
|
10
|
+
* {
|
|
11
|
+
margin: 0;
|
|
12
|
+
padding: 0;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
body {
|
|
17
|
+
background: #272822;
|
|
18
|
+
color: #f8f8f2;
|
|
19
|
+
font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
|
|
20
|
+
height: 100dvh;
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
-webkit-font-smoothing: antialiased;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.layout {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
gap: 3rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.code {
|
|
34
|
+
font-size: 8rem;
|
|
35
|
+
font-weight: 700;
|
|
36
|
+
color: #ae81ff;
|
|
37
|
+
line-height: 1;
|
|
38
|
+
letter-spacing: -0.04em;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.divider {
|
|
42
|
+
width: 1px;
|
|
43
|
+
height: 8rem;
|
|
44
|
+
background: #75715e;
|
|
45
|
+
opacity: 0.4;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.right {
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
align-items: flex-start;
|
|
52
|
+
gap: 1rem;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.logo {
|
|
56
|
+
width: 56px;
|
|
57
|
+
height: 56px;
|
|
58
|
+
opacity: 0.7;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.msg {
|
|
62
|
+
font-size: 0.85rem;
|
|
63
|
+
color: #75715e;
|
|
64
|
+
line-height: 1.7;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.msg a {
|
|
68
|
+
color: #66d9ef;
|
|
69
|
+
text-decoration: none;
|
|
70
|
+
border-bottom: 1px solid transparent;
|
|
71
|
+
transition: border-color 0.2s;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.msg a:hover {
|
|
75
|
+
border-color: #66d9ef;
|
|
76
|
+
}
|
|
77
|
+
</style>
|
|
78
|
+
</head>
|
|
79
|
+
|
|
80
|
+
<body>
|
|
81
|
+
<div class="layout">
|
|
82
|
+
<div class="code">404</div>
|
|
83
|
+
<div class="divider"></div>
|
|
84
|
+
<div class="right">
|
|
85
|
+
<svg class="logo" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
|
|
86
|
+
<defs>
|
|
87
|
+
<linearGradient id="g" x1="0" y1="1" x2="0.5" y2="0">
|
|
88
|
+
<stop offset="0%" stop-color="#f92672" />
|
|
89
|
+
<stop offset="100%" stop-color="#ae81ff" />
|
|
90
|
+
</linearGradient>
|
|
91
|
+
</defs>
|
|
92
|
+
<path d="M144 380 L256 190 L368 380" stroke="url(#g)" stroke-width="48" stroke-linecap="round"
|
|
93
|
+
stroke-linejoin="round" fill="none" />
|
|
94
|
+
<rect x="204" y="142" width="104" height="12" rx="6" fill="#a6e22e" opacity="0.9" />
|
|
95
|
+
<rect x="220" y="114" width="72" height="12" rx="6" fill="#a6e22e" opacity="0.55" />
|
|
96
|
+
<rect x="240" y="86" width="32" height="12" rx="6" fill="#a6e22e" opacity="0.25" />
|
|
97
|
+
</svg>
|
|
98
|
+
<p class="msg">
|
|
99
|
+
This page doesn't exist.<br>
|
|
100
|
+
Contact the website owner<br>
|
|
101
|
+
if this link is broken.
|
|
102
|
+
</p>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
</body>
|
|
106
|
+
|
|
107
|
+
</html>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="accent" x1="0" y1="1" x2="0.5" y2="0">
|
|
4
|
+
<stop offset="0%" stop-color="#f92672"/>
|
|
5
|
+
<stop offset="100%" stop-color="#ae81ff"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
</defs>
|
|
8
|
+
|
|
9
|
+
<!-- Background circle -->
|
|
10
|
+
<circle cx="256" cy="256" r="240" fill="#272822"/>
|
|
11
|
+
|
|
12
|
+
<!-- Chevron - tighter angle -->
|
|
13
|
+
<path d="M144 380 L256 190 L368 380"
|
|
14
|
+
stroke="url(#accent)" stroke-width="48" stroke-linecap="round" stroke-linejoin="round" fill="none"/>
|
|
15
|
+
|
|
16
|
+
<!-- Detaching particles -->
|
|
17
|
+
<rect x="204" y="142" width="104" height="12" rx="6" fill="#a6e22e" opacity="0.9"/>
|
|
18
|
+
<rect x="220" y="114" width="72" height="12" rx="6" fill="#a6e22e" opacity="0.55"/>
|
|
19
|
+
<rect x="240" y="86" width="32" height="12" rx="6" fill="#a6e22e" opacity="0.25"/>
|
|
20
|
+
</svg>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="accent" x1="0" y1="1" x2="0.5" y2="0">
|
|
4
|
+
<stop offset="0%" stop-color="#f92672"/>
|
|
5
|
+
<stop offset="100%" stop-color="#ae81ff"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
<clipPath id="circle-clip">
|
|
8
|
+
<circle cx="256" cy="256" r="240"/>
|
|
9
|
+
</clipPath>
|
|
10
|
+
</defs>
|
|
11
|
+
|
|
12
|
+
<!-- Background rounded square -->
|
|
13
|
+
<rect x="16" y="16" width="480" height="480" rx="96" fill="#272822"/>
|
|
14
|
+
|
|
15
|
+
<!-- Chevron - tighter angle -->
|
|
16
|
+
<path d="M144 380 L256 190 L368 380"
|
|
17
|
+
stroke="url(#accent)" stroke-width="48" stroke-linecap="round" stroke-linejoin="round" fill="none"/>
|
|
18
|
+
|
|
19
|
+
<!-- Detaching particles -->
|
|
20
|
+
<rect x="204" y="142" width="104" height="12" rx="6" fill="#a6e22e" opacity="0.9"/>
|
|
21
|
+
<rect x="220" y="114" width="72" height="12" rx="6" fill="#a6e22e" opacity="0.55"/>
|
|
22
|
+
<rect x="240" y="86" width="32" height="12" rx="6" fill="#a6e22e" opacity="0.25"/>
|
|
23
|
+
</svg>
|