Website/CMS used at www.jebrosen.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Jeb Rosen 4fc8269400 Add a horizontal line between multiple blog posts on the same page. 4 days ago
deploy Fix silly typo in sirus task for ansible. 6 months ago
sirus-api Remove 'atom_syndication' dependency. 4 weeks ago
sirus-postgres Reformat. 3 months ago
sirus-server Add a horizontal line between multiple blog posts on the same page. 4 days ago
sirus-sqlite Reformat. 3 months ago
.gitignore Add Rocket.toml to .gitignore 1 year ago
CHANGELOG.md Version 0.12.0. 2 months ago
Cargo.lock Update dependencies. Includes change from ? -> 'try_outcome!'. 6 days ago
Cargo.toml Add sirus-postgres backend option and use it by default. 7 months ago
LICENSE-APACHE Re-license as dual MIT/Apache-2.0. Clarify license in 'README.md'. 1 year ago
LICENSE-MIT Re-license as dual MIT/Apache-2.0. Clarify license in 'README.md'. 1 year ago
README.md Switch to 'master' branch of Rocket. Update dependencies. 5 months ago
deploy.sh Move release build into the deployment tasks. 10 months ago

README.md

sirus

sirus (SImple RUst Site)

Compiling

sirus uses the Rocket web framework and several unstable features, and therefore must be compiled with a nightly Rust compiler.

Beware, sirus sometimes depends on the master branch of Rocket and/or my own fork. Code in this repository may not always work in other projects.

Running and Deploying

sirus uses postgres by default, but can use sqlite instead if compiled with the appropriate features. When using sqlite, sirus has no runtime dependencies aside from libc (and rustc’s musl target can be used to eliminate even that) by using the bundled feature or libsqlite3-sys.

sirus expects a Rocket database configuration with the name sirus and a url pointing to the site’s database (postgres://user:pass@host/db or path/to/sqlite.db). The templates and the default css files are compiled in and do not need to be deployed separately.

Example deployment using systemd, for use with a reverse proxy:

[Unit]
Description=sirus web server for www.example.com

[Service]
User=http
ExecStart=/usr/local/bin/sirus
Environment=RUST_LOG=warn RUST_BACKTRACE=1 ROCKET_ADDRESS="127.0.0.1"
Environment=ROCKET_DATABASES="{ sirus = { url = \"postgres://sirus@localhost/sirus" } }"
Restart=on-failure

[Install]
WantedBy=multi-user.target

Administration

By default, a user with the name admin and password admin will be created. The administration page is located at /admin/. Here, users can be added and deleted and additional content files can be added and deleted.

Any files uploaded as content can be referenced from anywhere within the site; they are served at /static/<filename>. Files uploaded as content take precedence over default content files with the same name.

Default Content

The default content is defined in src/content.rs:

  • sirus.css: base layout and theme style definitions
  • upload.js: file upload code for the site administration page
  • feed-icon.png: an RSS feed icon used for the blog post listing page
  • robots.txt: blocks off /admin from conforming web crawlers

  • site.css: blank by default; linked by the base template

  • logo.png: site logo used at the top of the page

  • favicon.ico: site icon

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.