Skip to content
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
2 changes: 1 addition & 1 deletion .cspell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ words:
- clippy
- deadpool
- dotenv
- dotenvy
- dotenvor
- graphiql
- mainmatter
- minijinja
Expand Down
26 changes: 16 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ async-stream = "0.3"
chrono = { version = "0.4.30", features = ["serde"] }
color-eyre = "0.6"
derive_more = "2"
dotenvy = "0.15"
dotenvor = "0.1"
env_logger = "0.11"
examples-common = { path = "./examples-common" }
eyre = { version = "0.6", default-features = false, features = ["auto-install", "track-caller"] }
Expand Down
2 changes: 1 addition & 1 deletion auth/simple-auth-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ actix-web.workspace = true
chrono.workspace = true
derive_more = { workspace = true, features = ["display"] }
diesel = { version = "2", features = ["postgres", "r2d2", "uuid", "chrono"] }
dotenvy.workspace = true
dotenvor.workspace = true
env_logger.workspace = true
log = "0.4"
once_cell = "1"
Expand Down
2 changes: 1 addition & 1 deletion auth/simple-auth-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
- [rust-argon2](https://crates.io/crates/rust-argon2) // crate for hashing passwords using the cryptographically-secure Argon2 hashing algorithm.
- [chrono](https://crates.io/crates/chrono) // Date and time library for Rust.
- [diesel](https://crates.io/crates/diesel) // A safe, extensible ORM and Query Builder for PostgreSQL, SQLite, and MySQL.
- [dotenvy](https://crates.io/crates/dotenvy) // A well-maintained dotenv implementation for Rust.
- [dotenvor](https://crates.io/crates/dotenvor) // A well-maintained dotenv implementation for Rust.
- [derive_more](https://crates.io/crates/derive_more) // Convenience macros to derive traits easily
- [env_logger](https://crates.io/crates/env_logger) // A logging implementation for log which is configured via an environment variable.
- [futures](https://crates.io/crates/futures) // An implementation of futures and streams featuring zero allocations, composability, and iterator-like interfaces.
Expand Down
2 changes: 1 addition & 1 deletion auth/simple-auth-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mod utils;

#[actix_web::main]
async fn main() -> std::io::Result<()> {
dotenvy::dotenv().ok();
unsafe { dotenvor::dotenv() }.ok();
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

let database_url = std::env::var("DATABASE_URL").expect("DATABASE_URL must be set");
Expand Down
2 changes: 1 addition & 1 deletion background-jobs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ apalis = { version = "0.6", features = ["limit"] }
apalis-redis = { version = "0.6" }
chrono.workspace = true
color-eyre.workspace = true
dotenvy.workspace = true
dotenvor.workspace = true
env_logger.workspace = true
eyre.workspace = true
log.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion background-jobs/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub(crate) type ItemCache = Mutex<HashMap<String, DateTime<Utc>>>;
#[tokio::main]
async fn main() -> eyre::Result<()> {
color_eyre::install()?;
dotenvy::dotenv().ok();
unsafe { dotenvor::dotenv() }.ok();
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

// background jobs relating to local, disposable tasks
Expand Down
2 changes: 1 addition & 1 deletion basics/todo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ actix-files.workspace = true
actix-session = { workspace = true, features = ["cookie-session"] }
actix-web.workspace = true

dotenvy.workspace = true
dotenvor.workspace = true
env_logger.workspace = true
log.workspace = true
serde.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions basics/todo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use actix_web::{
middleware::{ErrorHandlers, Logger},
web,
};
use dotenvy::dotenv;
use dotenvor::dotenv;
use tera::Tera;

mod api;
Expand All @@ -20,7 +20,7 @@ static SESSION_SIGNING_KEY: &[u8] = &[0; 64];

#[actix_web::main]
async fn main() -> io::Result<()> {
dotenv().ok();
unsafe { dotenv() }.ok();
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

let key = actix_web::cookie::Key::from(SESSION_SIGNING_KEY);
Expand Down
2 changes: 1 addition & 1 deletion databases/diesel-async/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ postgres_tests = []
actix-web = { workspace = true }
diesel = { version = "2", default-features = false, features = ["uuid"] }
diesel-async = { version = "0.5", features = ["postgres", "bb8", "async-connection-wrapper"] }
dotenvy = { workspace = true }
dotenvor = { workspace = true }
env_logger = { workspace = true }
log = { workspace = true }
serde = { workspace = true }
Expand Down
6 changes: 3 additions & 3 deletions databases/diesel-async/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use diesel_async::{
AsyncPgConnection,
pooled_connection::{AsyncDieselConnectionManager, bb8::Pool},
};
use dotenvy::dotenv;
use dotenvor::dotenv;
use uuid::Uuid;

mod actions;
Expand Down Expand Up @@ -74,7 +74,7 @@ async fn add_item(

#[actix_web::main]
async fn main() -> io::Result<()> {
dotenv().ok();
unsafe { dotenv() }.ok();
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

// initialize DB pool outside `HttpServer::new` so that it is shared across all workers
Expand Down Expand Up @@ -116,7 +116,7 @@ mod tests {

#[actix_web::test]
async fn item_routes() {
dotenv().ok();
unsafe { dotenv() }.ok();
env_logger::try_init_from_env(env_logger::Env::new().default_filter_or("info")).ok();

let pool = initialize_db_pool().await;
Expand Down
2 changes: 1 addition & 1 deletion databases/diesel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ rust-version.workspace = true
[dependencies]
actix-web.workspace = true
diesel = { version = "2", features = ["sqlite", "r2d2", "uuid"] }
dotenvy.workspace = true
dotenvor.workspace = true
env_logger.workspace = true
log.workspace = true
serde.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions databases/diesel/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async fn add_user(

#[actix_web::main]
async fn main() -> std::io::Result<()> {
dotenvy::dotenv().ok();
unsafe { dotenvor::dotenv() }.ok();
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

// initialize DB pool outside of `HttpServer::new` so that it is shared across all workers
Expand Down Expand Up @@ -118,7 +118,7 @@ mod tests {

#[actix_web::test]
async fn user_routes() {
dotenvy::dotenv().ok();
unsafe { dotenvor::dotenv() }.ok();
env_logger::try_init_from_env(env_logger::Env::new().default_filter_or("info")).ok();

let pool = initialize_db_pool();
Expand Down
2 changes: 1 addition & 1 deletion databases/mysql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ rust-version.workspace = true
[dependencies]
actix-web.workspace = true
derive_more = { workspace = true, features = ["display", "error", "from"] }
dotenvy.workspace = true
dotenvor.workspace = true
env_logger.workspace = true
log.workspace = true
mysql = "24"
Expand Down
2 changes: 1 addition & 1 deletion databases/mysql/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn get_conn_builder(
#[actix_web::main]
async fn main() -> io::Result<()> {
// initialize environment
dotenvy::dotenv().ok();
unsafe { dotenvor::dotenv() }.ok();

// initialize logger
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
Expand Down
2 changes: 1 addition & 1 deletion databases/postgres/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ actix-web.workspace = true
confik = "0.15"
deadpool-postgres = { version = "0.14", features = ["serde"] }
derive_more = { workspace = true, features = ["display", "error", "from"] }
dotenvy.workspace = true
dotenvor.workspace = true
serde.workspace = true
tokio-pg-mapper = "0.2.0"
tokio-pg-mapper-derive = "0.2.0"
Expand Down
2 changes: 1 addition & 1 deletion databases/postgres/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- `tokio_postgres`
- use of `tokio_pg_mapper` for postgres data mapping
- `deadpool_postgres` for connection pooling
- `dotenvy` + `confik` for configuration
- `dotenvor` + `confik` for configuration

## Instructions

Expand Down
4 changes: 2 additions & 2 deletions databases/postgres/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use actix_web::{
};
use confik::{Configuration as _, EnvSource};
use deadpool_postgres::{Client, Pool};
use dotenvy::dotenv;
use dotenvor::dotenv;
use tokio_postgres::NoTls;

use crate::config::ExampleConfig;
Expand Down Expand Up @@ -39,7 +39,7 @@ pub async fn add_user(

#[actix_web::main]
async fn main() -> std::io::Result<()> {
dotenv().ok();
unsafe { dotenv() }.ok();

let config = ExampleConfig::builder()
.override_with(EnvSource::new())
Expand Down
2 changes: 1 addition & 1 deletion forms/multipart-s3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ actix-web-lab.workspace = true
aws-config = "1"
aws-sdk-s3 = "1"

dotenvy.workspace = true
dotenvor.workspace = true
env_logger.workspace = true
futures-util.workspace = true
log.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions forms/multipart-s3/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use actix_web::{
};
use actix_web_lab::extract::Path;
use aws_config::{BehaviorVersion, meta::region::RegionProviderChain};
use dotenvy::dotenv;
use dotenvor::dotenv;
use futures_util::{StreamExt as _, stream};
use serde_json::json;
use tokio_util::io::ReaderStream;
Expand Down Expand Up @@ -93,7 +93,7 @@ async fn index() -> impl Responder {

#[actix_web::main]
async fn main() -> std::io::Result<()> {
dotenv().ok();
unsafe { dotenv() }.ok();
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

log::info!("creating temporary upload directory");
Expand Down
2 changes: 1 addition & 1 deletion graphql/juniper-advanced/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ juniper = "0.16"
mysql = "24"
r2d2 = "0.8"
r2d2_mysql = "24"
dotenvy.workspace = true
dotenvor.workspace = true
env_logger.workspace = true
log.workspace = true
uuid.workspace = true
2 changes: 1 addition & 1 deletion graphql/juniper-advanced/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use self::{db::get_db_pool, handlers::register};

#[actix_web::main]
async fn main() -> std::io::Result<()> {
dotenvy::dotenv().ok();
unsafe { dotenvor::dotenv() }.ok();
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

let pool = get_db_pool();
Expand Down
2 changes: 1 addition & 1 deletion tracing/mainmatter-workshop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ rust-version.workspace = true

[dependencies]
actix-web.workspace = true
dotenvy.workspace = true
dotenvor.workspace = true
metrics = "0.23"
metrics-exporter-prometheus = { version = "0.15", default-features = false }
opentelemetry = "0.23"
Expand Down
2 changes: 1 addition & 1 deletion tracing/mainmatter-workshop/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mod routes;

#[actix_web::main]
async fn main() -> io::Result<()> {
dotenvy::dotenv().ok();
unsafe { dotenvor::dotenv() }.ok();
logging::init();
let handle = prometheus::init();

Expand Down