Better datastores security
Localhost only exposed ports and stronger password for Postgres local environment instance
This commit is contained in:
@@ -10,7 +10,7 @@ if [[ -n $RUNNING_CONTAINER ]]; then
|
||||
fi
|
||||
|
||||
docker run \
|
||||
-p "6379:6379" \
|
||||
-p "127.0.0.1:6379:6379" \
|
||||
-d \
|
||||
--name "redis_$(date '+%s')" \
|
||||
redis
|
||||
|
||||
@@ -142,28 +142,3 @@ fn validate_form(form: &BodyData) -> Result<(), &'static str> {
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// struct ConfirmedSubscriber {
|
||||
// name: String,
|
||||
// email: SubscriberEmail,
|
||||
// }
|
||||
|
||||
// #[tracing::instrument(name = "Get confirmed subscribers", skip(connection_pool))]
|
||||
// async fn get_confirmed_subscribers(
|
||||
// connection_pool: &PgPool,
|
||||
// ) -> Result<Vec<Result<ConfirmedSubscriber, anyhow::Error>>, anyhow::Error> {
|
||||
// let rows = sqlx::query!("SELECT name, email FROM subscriptions WHERE status = 'confirmed'")
|
||||
// .fetch_all(connection_pool)
|
||||
// .await?;
|
||||
// let confirmed_subscribers = rows
|
||||
// .into_iter()
|
||||
// .map(|r| match SubscriberEmail::parse(r.email) {
|
||||
// Ok(email) => Ok(ConfirmedSubscriber {
|
||||
// name: r.name,
|
||||
// email,
|
||||
// }),
|
||||
// Err(e) => Err(anyhow::anyhow!(e)),
|
||||
// })
|
||||
// .collect();
|
||||
// Ok(confirmed_subscribers)
|
||||
// }
|
||||
|
||||
@@ -40,7 +40,6 @@ impl Application {
|
||||
"{}:{}",
|
||||
configuration.application.host, configuration.application.port
|
||||
);
|
||||
// let listener = TcpListener::bind(address).await?;
|
||||
let connection_pool =
|
||||
PgPoolOptions::new().connect_lazy_with(configuration.database.with_db());
|
||||
let email_client = EmailClient::build(configuration.email_client).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user