atomic-serverStatus: Alpha. Not ready for production time. Prone to changes and corrupt databases when upgrading. Changelog
The easiest way to share Atomic Data on the web.
atomic-server is a graph database server for storing and sharing typed linked data.
Demo on atomicdata.dev
Powered by Rust, atomic-lib, actix-web, sled and more.
``
FLAGS:
-h, --help Prints help information
-i, --init Recreates the/setup` Invite for creating a new Root User. Also re-runs various populate commands,
and re-builds the index.
-r, --reindex Rebuilds the index (can take a while for large stores).
-V, --version Prints version information
SUBCOMMANDS: export Create a JSON-AD backup of the store. help Prints this message or the help of the given subcommand(s) import Import a JSON-AD backup to the store. Overwrites Resources with same @id. ```
You can run atomic-server in four ways:
cargo install atomic-serverWhen you're running atomic-server, go to Initial setup and configuration
The dockerfile is located in the project root, above this server folder.
docker run -p 80:80 -p 443:443 -v atomic-storage:/atomic-storage joepmeneer/atomic-serverdocker pull joepmeneer/atomic-server and docker should fetch the latest version.```sh
git clone git@github.com:joepio/atomic-data-rust.git cd atomic-data-rust/server
cp default.env .env
cargo run
cargo run --features desktop
cargo run --no-default-features ```
Troubleshooting compiling from source:
```sh
sudo apt-get install -y pkg-config libssl-dev --fix-missing ```
.env from the current path by default. Use the default.env from this repo as a template and for reference.ATOMIC_DOMAIN, ATOMIC_HTTPS and ATOMIC_EMAIL in the .env (see HTTPS setup below).Agent Subject and Private key. You should use these in the atomic-cli and atomic-data-browser clients for authorization.~/.config/atomic, which stores your newly created Agent keys, your data, the HTTPS certificates and a folder for public static files.http://localhost/setup to register your first (admin) user. You can use an existing Agent, or create a new one.You'll probably want to make your Atomic Data available through HTTPS.
You can use the embedded HTTPS / TLS setup powered by LetsEncrypt, acme_lib and rustls.
To setup HTTPS, we'll need to set some environment variables.
Open .env and set:
env
ATOMIC_EMAIL=youremail@example.com
ATOMIC_DOMAIN=example.com
ATOMIC_HTTPS=true
Run the server: cargo run.
Make sure the server is accessible at ATOMIC_DOMAIN at port 80, because Let's Encrypt will send an HTTP request to this server's /.well-known directory to check the keys.
It will now initialize the certificate.
Read the logs, watch for errors.
HTTPS certificates are automatically renewed when the server is restarted, and the certs are 4 weeks or older.
There are three ways to interact with this server:
atomic-data-browser JS frontend by visiting localhost.atomic-cli terminal appatomic-cli as clientatomic-cli is a useful terminal tool for interacting with atomic-server.
It makes it easy to query and edit Atomic Data from the command line.
Check it out.
You can fetch individual items by sending a GET request to their URL.
```sh
curl -i -H "Accept: application/ad+json" https://atomicdata.dev/properties/shortname
curl -i -H "Accept: application/ld+json" https://atomicdata.dev/properties/shortname
curl -i -H "Accept: application/json" https://atomicdata.dev/properties/shortname
curl -i -H "Accept: text/turtle" https://atomicdata.dev/properties/shortname ```
Check out ./example_requests.http for more things that you can do.
```sh
cargo test --all ```
```sh
cargo install drill drill -b benchmark.yml --stats ```
/setup invite is no longer usable! What now?You can run atomic-server --init to recreate the /setup invite. It will be reset to 1 usage.
There are no helper functions for this, but you could atomic-server export your JSON-AD, and find + replace your old domain with the new one.
This could especially be helpful if you're running at localhost and want to move to a live server.
Remove the db folder in your atomic config: rm -rf ~/.config/atomic/db.
This is not yet possible. See #13.
You might have a problem with your index. Try reindexing using atomic-server --reindex.