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
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ FROM debian:trixie-slim
RUN apt-get update && apt-get install -y \
ca-certificates \
libssl3 \
curl \
&& rm -rf /var/lib/apt/lists/*

RUN apt install -y curl

# Create a non-root user
RUN useradd -m -u 1000 appuser

Expand Down
6 changes: 0 additions & 6 deletions object-store/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,6 @@ pub async fn health_check() -> impl IntoResponse {
}))
}

pub async fn ping() -> impl IntoResponse {
Json(serde_json::json!({
"message": "pong"
}))
}

pub async fn create_bucket(
State(service): State<SharedService>,
Json(payload): Json<CreateBucketRequest>,
Expand Down
10 changes: 8 additions & 2 deletions object-store/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,21 @@ impl Config {
pub fn from_file(path: &str) -> Result<Self, config::ConfigError> {
let settings = config::Config::builder()
.add_source(config::File::with_name(path))
.add_source(config::Environment::with_prefix("OBJECT_STORE"))
.add_source(
config::Environment::with_prefix("OBJECT_STORE")
.separator("__")
)
.build()?;

settings.try_deserialize()
}

pub fn from_env() -> Result<Self, config::ConfigError> {
let settings = config::Config::builder()
.add_source(config::Environment::with_prefix("OBJECT_STORE"))
.add_source(
config::Environment::with_prefix("OBJECT_STORE")
.separator("__")
)
.build()?;

settings.try_deserialize()
Expand Down
2 changes: 1 addition & 1 deletion object-store/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async fn main() -> anyhow::Result<()> {
let config = if let Ok(config_path) = std::env::var("CONFIG_PATH") {
Config::from_file(&config_path)?
} else {
Config::default()
Config::from_env().unwrap_or_else(|_| Config::default())
};

info!("Starting object storage service with config: {:?}", config);
Expand Down
2 changes: 1 addition & 1 deletion object-store/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::service::ObjectStoreService;
pub fn create_router(service: Arc<ObjectStoreService>) -> Router {
Router::new()
.route("/health", get(health_check))
.route("/ping", get(ping))
.route("/ping", get(health_check))
.route("/buckets", post(create_bucket))
.route("/buckets", put(upsert_bucket))
.route("/buckets", get(list_buckets))
Expand Down
Loading