diff options
-rw-r--r-- | doc/book/quick-start/_index.md | 33 | ||||
-rw-r--r-- | src/api/s3/post_object.rs | 22 |
2 files changed, 40 insertions, 15 deletions
diff --git a/doc/book/quick-start/_index.md b/doc/book/quick-start/_index.md index 9619f388..5f17447b 100644 --- a/doc/book/quick-start/_index.md +++ b/doc/book/quick-start/_index.md @@ -42,6 +42,13 @@ If a binary of the last version is not available for your architecture, or if you want a build customized for your system, you can [build Garage from source](@/documentation/cookbook/from-source.md). +If none of these option work for you, you can also run Garage in a Docker +container. When using Docker, the commands used in this guide will not work +anymore. We recommend reading the tutorial on [configuring a +multi-node cluster](@/documentation/cookbook/real-world.md) to learn about +using Garage as a Docker container. For simplicity, a minimal command to launch +Garage using Docker is provided in this quick start guide as well. + ## Configuring and starting Garage @@ -85,6 +92,9 @@ metrics_token = "$(openssl rand -base64 32)" EOF ``` +See the [Configuration file format](https://garagehq.deuxfleurs.fr/documentation/reference-manual/configuration/) +for complete options and values. + Now that your configuration file has been created, you may save it to the directory of your choice. By default, Garage looks for **`/etc/garage.toml`.** You can also store it somewhere else, but you will have to specify `-c path/to/garage.toml` @@ -111,6 +121,26 @@ garage -c path/to/garage.toml server If you have placed the `garage.toml` file in `/etc` (its default location), you can simply run `garage server`. +Alternatively, if you cannot or do not wish to run the Garage binary directly, +you may use Docker to run Garage in a container using the following command: + +```bash +docker run \ + -d \ + --name garaged \ + -p 3900:3900 -p 3901:3901 -p 3902:3902 -p 3903:3903 \ + -v /etc/garage.toml:/path/to/garage.toml \ + -v /var/lib/garage/meta:/path/to/garage/meta \ + -v /var/lib/garage/data:/path/to/garage/data \ + dxflrs/garage:v0.9.4 +``` + +Under Linux, you can substitute `--network host` for `-p 3900:3900 -p 3901:3901 -p 3902:3902 -p 3903:3903` + +#### Troubleshooting + +Ensure your configuration file, `metadata_dir` and `data_dir` are readable by the user running the `garage` server or Docker. + You can tune Garage's verbosity by setting the `RUST_LOG=` environment variable. \ Available log levels are (from less verbose to more verbose): `error`, `warn`, `info` *(default)*, `debug` and `trace`. @@ -131,6 +161,9 @@ It uses values from the TOML configuration file to find the Garage daemon runnin local node, therefore if your configuration file is not at `/etc/garage.toml` you will again have to specify `-c path/to/garage.toml` at each invocation. +If you are running Garage in a Docker container, you can set `alias garage="docker exec -ti <container name> /garage"` +to use the Garage binary inside your container. + If the `garage` CLI is able to correctly detect the parameters of your local Garage node, the following command should be enough to show the status of your cluster: diff --git a/src/api/s3/post_object.rs b/src/api/s3/post_object.rs index 2c106b3b..ff2361f1 100644 --- a/src/api/s3/post_object.rs +++ b/src/api/s3/post_object.rs @@ -71,21 +71,11 @@ pub async fn handle_post_object( } if let Ok(content) = HeaderValue::from_str(&field.text().await?) { - match name.as_str() { - "tag" => (/* tag need to be reencoded, but we don't support them yet anyway */), - "acl" => { - if params.insert("x-amz-acl", content).is_some() { - return Err(Error::bad_request("Field 'acl' provided more than once")); - } - } - _ => { - if params.insert(&name, content).is_some() { - return Err(Error::bad_request(format!( - "Field '{}' provided more than once", - name - ))); - } - } + if params.insert(&name, content).is_some() { + return Err(Error::bad_request(format!( + "Field '{}' provided more than once", + name + ))); } } }; @@ -222,6 +212,8 @@ pub async fn handle_post_object( ))); } + // if we ever start supporting ACLs, we likely want to map "acl" to x-amz-acl" somewhere + // arround here to make sure the rest of the machinery takes our acl into account. let headers = get_headers(¶ms)?; let expected_checksums = ExpectedChecksums { |