Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/create metrics db #114

Merged
merged 10 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/deploy_to_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
- name: Run tests
env:
GH_PRIVATE_KEY: ${{ secrets.GH_STAGING_PRIVATE_KEY }}
DB_URL: ${{secrets.STAGING_DB_URL}}
run: cargo test -- --nocapture

deploy_to_staging:
Expand Down Expand Up @@ -63,7 +64,8 @@ jobs:
"8080": "HTTP"
},
"environment": {
"GH_PRIVATE_KEY": "${{secrets.GH_STAGING_PRIVATE_KEY}}"
"GH_PRIVATE_KEY": "${{secrets.GH_STAGING_PRIVATE_KEY}}",
"DB_URL": "${{secrets.STAGING_DB_URL}}"
}
}
}' > containers.json
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/end_to_end_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ jobs:
- name: Run tests
env:
GH_PRIVATE_KEY: ${{ secrets.GH_STAGING_PRIVATE_KEY }}
DB_URL: ${{secrets.STAGING_DB_URL}}
run: cargo test -- --nocapture
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
members = [
"fplus-lib",
"fplus-http-server",
"fplus-cli"
"fplus-cli",
"fplus-database"
]

resolver = "2"
19 changes: 14 additions & 5 deletions fplus-database/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "fplus-database"
authors = ["jbesraa", "kokal33"]
version = "0.1.3"
authors = ["clriesco", "kokal33", "alexmcon"]
version = "1.0.19"
edition = "2021"
description = "FPlus main database module"
license = "MIT OR Apache-2.0"
Expand All @@ -10,7 +10,16 @@ repository = "https://github.com/filecoin-project/filplus-backend/tree/publish-t
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
actix-web = "4.4.0"
dotenv = "0.15.0"
env_logger = "0.10.0"
futures = "0.3.28"
sea-orm ={ version = "0.12", features = [ "sqlx-postgres", "runtime-tokio-native-tls", "macros" ] }
anyhow = "1.0.75"
mongodb = {version = "2.7.0", features = ["openssl-tls"]}
serde = "1.0.188"
tokio = { version = "1", features = ["full"] }
log = "0.4.20"
chrono = "0.4.26"
once_cell = "1.8"
serde = { version = "1.0.164", features = ["derive", "std",
"serde_derive", "alloc", "rc"] }
serial_test = "3.0.0"

21 changes: 21 additions & 0 deletions fplus-database/src/config.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
use log::warn;

/**
* Get an environment variable or a default value
*
* # Arguments
* @param key: &str - The environment variable key
* @param default: &str - The default value
*
* # Returns
* @return String - The value of the environment variable or the default value
*/
pub fn get_env_var_or_default(key: &str, default: &str) -> String {
match std::env::var(key) {
Ok(val) => val,
Err(_) => {
warn!("{} not set, using default value: {}", key, default);
default.to_string()
}
}
}
40 changes: 0 additions & 40 deletions fplus-database/src/core/collections/govteam.rs

This file was deleted.

41 changes: 0 additions & 41 deletions fplus-database/src/core/collections/logs.rs

This file was deleted.

3 changes: 0 additions & 3 deletions fplus-database/src/core/collections/mod.rs

This file was deleted.

41 changes: 0 additions & 41 deletions fplus-database/src/core/collections/notary.rs

This file was deleted.

18 changes: 0 additions & 18 deletions fplus-database/src/core/common.rs

This file was deleted.

3 changes: 0 additions & 3 deletions fplus-database/src/core/mod.rs

This file was deleted.

36 changes: 0 additions & 36 deletions fplus-database/src/core/setup.rs

This file was deleted.

Loading