questions and contributions welcome :3
want to archive your chosts on your website but have too many for the cohost web component? want something like cohost-dl except you can keep posting? what if your blog engine had the same posting and reading experience as cohost? what if you could follow people with rss/atom feeds and see their posts on a chronological timeline? what if you could share their posts too?
autost is a single program you run in your terminal (autost
).
go to the releases page to download or install autost!
go to CHANGELOG.md to find out what changed in each new release.
for more docs, check out the autost book, which you can also render locally:
$ cd sites/docs
$ cargo run render
- or -
$ cargo run server
$ autost new sites/example.com # example (can be anywhere)
$ cd sites/example.com
cohost “projects” are the things with handles like @staff
that you can have more than one of.
$ cd sites/example.com
$ autost cohost2json projectName path/to/chosts
you may want to dump private or logged-in-only chosts, be they your own or those of people you’ve followed or reblogged. in this case, you will need to set COHOST_COOKIE to the value of your “connect.sid” cookie as follows, and switch projects in the cohost web ui, otherwise you won’t see everything!
$ read -r COHOST_COOKIE; export COHOST_COOKIE # optional
$ cd sites/example.com
$ autost cohost2autost path/to/chosts
or to convert specific chosts only:
$ cd sites/example.com
$ autost cohost2autost path/to/chosts 123456.json 234567.json
$ cd sites/example.com
$ autost render
or to render specific posts only:
$ cd sites/example.com
$ autost render posts/123456.html posts/10000000.md
interesting_archived_threads_list_path
or excluded_archived_threads_list_path
to a text filearchived_thread_tags_path
to a text filehttps://cohost.org/project/post/123456-slug tag,another tag
warning: this server has no password and no sandboxing yet! do not expose it to the internet!
$ cd sites/example.com
$ autost server
this works with any blog that uses microformats2 h-entry. see @nex3’s Reblogging posts with h-entry for more details on how this works.
$ cd sites/example.com
$ autost import https://nex-3.com/blog/reblogging-posts-with-h-entry/
INFO autost::command::import: click here to reply: http://[::1]:8420/posts/compose?reply_to=imported/1.html
if you run autost import
with the same url again, the existing imported post will be updated. you can also use autost reimport
to update an existing imported post:
$ cd sites/example.com
$ autost reimport posts/imported/1.html
warning: this command does not strip any exif data yet, including your gps location!
$ cd sites/example.com
$ autost attach path/to/diffie.jpg
the best way to upload your site to a web host depends on if you have chosts you might not want people to see. if you upload everything, someone can count from 1.html to 9999999.html and find all of your chosts.
if you want to upload everything, you can use rsync directly (note the trailing slash):
$ cd sites/example.com
$ rsync -av site/ host:/var/www/example.com
if you want to only upload the chosts you have curated, you can use site/deploy.sh (where path/to/interesting.txt is your interesting_output_filenames_list_path
):
$ cd sites/example.com
$ site/deploy.sh host:/var/www/example.com path/to/interesting.txt -n # dry run
$ site/deploy.sh host:/var/www/example.com path/to/interesting.txt # wet run
if you just want to back up your chosts, make an autost site for each cohost project, like sites/@catball
and sites/@rats
.
if you want to do anything more involved, you should make a staging
and production
version of your autost site, like sites/staging
and sites/production
:
cd sites/staging; autost render
colordiff -ru sites/production sites/staging
rsync -a sites/staging sites/production
cd sites/production
and see “how to deploy”that way, you can catch unintentional changes or autost bugs, and you have a backup of your site in case anything goes wrong.
if something goes wrong, you can set RUST_LOG or RUST_BACKTRACE to get more details:
$ export RUST_LOG=autost=debug
$ export RUST_LOG=autost=trace
$ export RUST_BACKTRACE=1
if you want to tinker with autost, install rust, then download and build the source (see below). to run autost, replace autost
in the commands above with cargo run -r --
.
$ git clone https://github.com/delan/autost.git
$ cd autost
cohost2json
)cohost2autost
)index.html
)<postId>.html
)tagged/<tag>.html
)interesting_tags
)interesting_archived_threads_list_path
)excluded_archived_threads_list_path
)interesting_output_filenames_list_path
)archived_thread_tags_path
)renamed_tags
)implied_tags
)index.feed.xml
, tagged/<tag>.feed.xml
)