-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
77 changed files
with
13,449 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Test deployment | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- ".github/workflows/website.yml" | ||
- "docs/**/*" | ||
push: | ||
branches: [main] | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: ./docs | ||
|
||
jobs: | ||
test-deploy: | ||
name: Test deployment | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
- name: Test build website | ||
run: yarn build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,52 @@ | ||
use std::env; | ||
|
||
// This is not going to happen any more since we have a default feature definition in Cargo.toml | ||
//#[cfg(not(any(feature = "crypto_adaptor_openssl", feature = "crypto_adaptor_tongsuo")))] | ||
//compile_error! { | ||
// r#" | ||
// No cryptography adaptor is enabled! | ||
// | ||
// In RustyVault, the real cryptographic operations are done via "crypto_adaptor"s. | ||
// | ||
// A crypto adaptor is a module that conveys and translates high level cryptography | ||
// operations like encryption, signing into the APIs provided by underlying cryptography | ||
// libraries such as OpenSSL, Tongsuo and so forth. | ||
// | ||
// At current stage, only one crypto_adaptor can be enabled at compilation phase and later | ||
// be used at run-time. "crypto_adaptor"s are configured as 'feature's in the Cargo context. | ||
// | ||
// Currently, the supported feature names of crypto adaptors are as follows, you can enable | ||
// them by adding one '--features crypto_adaptor_name' option when running "cargo build": | ||
// 1. the OpenSSL adaptor: crypto_adaptor_openssl | ||
// 2. the Tongsuo adaptor: crypto_adaptor_tongsuo | ||
// "# | ||
//} | ||
|
||
#[cfg(all(feature = "crypto_adaptor_openssl", feature = "crypto_adaptor_tongsuo"))] | ||
compile_error! { | ||
r#" | ||
Only one cryptography adapator can be enabled! | ||
In RustyVault, the real cryptographic operations are done via "crypto_adaptor"s. | ||
A crypto adaptor is a module that conveys and translates high level cryptography | ||
operations like encryption, signing into the APIs provided by underlying cryptography | ||
libraries such as OpenSSL, Tongsuo and so forth. | ||
At current stage, only one crypto_adaptor can be enabled at compilation phase and later | ||
be used at run-time. "crypto_adaptor"s are configured as 'feature's in the Cargo context. | ||
Currently, the supported feature names of crypto adaptors are as follows, you can enable | ||
them by adding one '--features crypto_adaptor_name' option when running "cargo build": | ||
1. the OpenSSL adaptor: crypto_adaptor_openssl | ||
2. the Tongsuo adaptor: crypto_adaptor_tongsuo | ||
"# | ||
} | ||
|
||
fn main() { | ||
if let Ok(_) = env::var("DEP_OPENSSL_TONGSUO") { | ||
println!("cargo:rustc-cfg=tongsuo"); | ||
} else if cfg!(feature = "crypto_adaptor_tongsuo") { | ||
println!("cargo:rustc-cfg=tongsuo"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# RustyVault Crypto Adaptor | ||
|
||
In RustyVault, we provide a mechanism for the users to build with selectable underlying cryptography libraries. This is the "crypto adaptor" mechanism. | ||
|
||
Currently, only two adaptors are supported: | ||
|
||
* OpenSSL crypto adaptor | ||
* Tongsuo crypto adaptor | ||
|
||
## The OpenSSL Crypto Adaptor | ||
|
||
The following steps require a properly installed OpenSSL library. There are many ways of installing an OpenSSL on various platforms, so in this docuemnt we don't discuss that part. | ||
|
||
The OpenSSL crypto adaptor is configured by default in RustyVault, so you can simply build RustyVault to enable it: | ||
|
||
~~~ | ||
cargo build | ||
~~~ | ||
|
||
Otherwise if you want to explicitly configure it, you can still use something like: | ||
|
||
~~~ | ||
cargo build --features crypto_adaptor_openssl | ||
~~~ | ||
|
||
But this is not necessary. | ||
|
||
## The Tongsuo Crypto Adaptor | ||
|
||
Tongsuo is a fork of OpenSSL aiming to have a better support on Chinese cryptography algorithms and standards. To use Tongsuo as the cryptography functionality provider in RustyVault, typically you need to build RustyVault as follows. | ||
|
||
### Download and Install Tongsuo | ||
|
||
Firstly, you need to have a copy of Tongsuo code and successfully build it into libraires and finally install it into somewhere in your machine. | ||
|
||
Go to [https://tongsuo.net/docs/compilation/compile-and-install](https://tongsuo.net/docs/compilation/compile-and-install) for more detailed information. | ||
|
||
### Configure RustyVault to use Tongsuo | ||
|
||
RustyVault uses rust-tongsuo crate to call C APIs provided by Tongsuo. So we need to configure Cargo to use it, let's assume Tongsuo is successfully installed to `/path/to/tongsuo` directory: | ||
|
||
~~~ | ||
OPENSSL_DIR=/path/to/tongsuo cargo build \ | ||
--features crypto_adaptor_tongsuo \ | ||
--no-default-features \ | ||
--config 'patch.crates-io.openssl.git="https://github.com/Tongsuo-Project/rust-tongsuo.git"' \ | ||
--config 'patch.crates-io.openssl-sys.git="https://github.com/Tongsuo-Project/rust-tongsuo.git"' | ||
~~~ | ||
|
||
Furthermore, if you choose to use a local copy of rust-tongsuo crate, you can use the file path form as well. Assume the local rust-tongsuo crate is located in `/path/to/rust-tongsuo` directory: | ||
|
||
~~~ | ||
OPENSSL_DIR=/path/to/tongsuo cargo build \ | ||
--features crypto_adaptor_tongsuo \ | ||
--no-default-features \ | ||
--config 'patch.crates-io.openssl.path="/path/to/rust-tongsuo/openssl"' \ | ||
--config 'patch.crates-io.openssl-sys.path="/path/to/rust-tongsuo/openssl-sys"' | ||
~~~ | ||
|
||
### The `LD_LIBRARY_PATH` Variable | ||
|
||
If you are using Linux, then you may need to specify which path for RustyVault to look for the Tongsuo libraries. There are many ways of having this done, but in this document we demonstrate with the global environment variable way. | ||
|
||
~~~ | ||
export LD_LIBRARY_PATH=/path/to/tongsuol/lib | ||
~~~ | ||
|
||
Then you can run RustyVault smoothly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Dependencies | ||
/node_modules | ||
|
||
# Production | ||
/build | ||
|
||
# Generated files | ||
.docusaurus | ||
.cache-loader | ||
|
||
# Misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cp -r docs/* versioned_docs/version-0.12.x/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# SeaORM Documentation | ||
|
||
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. | ||
|
||
## Installation | ||
|
||
```console | ||
yarn install | ||
``` | ||
|
||
## Local Development | ||
|
||
```console | ||
yarn start | ||
``` | ||
|
||
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. | ||
|
||
## Build | ||
|
||
```console | ||
yarn build | ||
``` | ||
|
||
This command generates static content into the `build` directory and can be served using any static contents hosting service. | ||
|
||
## Deployment | ||
|
||
```console | ||
GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy | ||
``` | ||
|
||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
--- | ||
sidebar_position: 2 | ||
title: Install | ||
--- | ||
|
||
# Install RustyVault | ||
|
||
RustyVault must be installed properly in your environment before it actually works. Currently RustyVault is only available by source code. RustyVault can be used as an application or a library, thus: | ||
|
||
1. RustyVault is available to compile from source code only, or | ||
2. RustyVault is availabe on [crates.io](https://crates.io/crates/rusty_vault) for other Rust projects. | ||
|
||
This document is about how to build and install RustyVault in the application form. For the library form, please go to [docs.rs](https://docs.rs/rusty_vault/latest/rusty_vault) for more information. | ||
|
||
## Operating System | ||
|
||
RustyVault is supposed to work on the following operating systems: | ||
|
||
* Linux | ||
* macOS | ||
* Windows (experimental) | ||
|
||
In this document, macOS is used as the demonstration operating system. | ||
|
||
## Prerequisite | ||
|
||
RustyVault is developed in [Rust](https://rust-lang.org) programming language, so Rust must be properly installed in your environment before building RustyVault. | ||
|
||
Read [this](https://www.rust-lang.org/tools/install) to make Rust work for you. | ||
|
||
## Build from Source | ||
|
||
Clone the latest RustyVault source code from Github: | ||
|
||
~~~bash | ||
git clone https://github.com/Tongsuo-Project/RustyVault.git | ||
~~~ | ||
|
||
Then you have a directory called RustyVault now. Change directory into it. | ||
|
||
~~~bash | ||
cd RustyVault | ||
~~~ | ||
|
||
Simply build the binary by using the tool Cargo. | ||
|
||
~~~bash | ||
cargo build | ||
~~~ | ||
|
||
Rust toolchain is responsible for taking care of almost everything during the build process. After RustyVault is successfully built, you get a bundle of files in the `RustyVault/target/debug` directory. There will be a executable file called `rvault`, which is the application of RustyVault. | ||
|
||
## Verify RustyVault | ||
|
||
Simply run the following command: | ||
|
||
~~~bash | ||
target/debug/rvault --help | ||
~~~ | ||
|
||
And you will get a response similar to: | ||
|
||
~~~bash | ||
A secure and high performance secret management software that is compatible with Hashicorp Vault. | ||
|
||
Usage: rvault [COMMAND] | ||
|
||
Commands: | ||
server Start a rusty_vault server | ||
status Print seal and HA status | ||
help Print this message or the help of the given subcommand(s) | ||
|
||
Options: | ||
-h, --help Print help | ||
-V, --version Print version | ||
~~~ | ||
|
||
That means you now have a ready-to-use RustyVault binary. |
Oops, something went wrong.