This commit is contained in:
cupcakearmy 2021-12-02 17:58:36 +01:00
parent 0153f71a73
commit ca5e739c7e
No known key found for this signature in database
GPG Key ID: 3235314B4D31232F

View File

@ -8,13 +8,13 @@ The heavy lifting is done by [`libvips`](https://github.com/libvips/libvips) and
- Config driven - Config driven
- Domain protection - Domain protection
- Host verification - Host verification
- Multiple storage adapters (Local, Minio, S3) - Multiple storage adapters (Local, Minio, S3, GCP)
- Caniuse based automatic formatting - Caniuse based automatic formatting
- ETag caching - ETag caching
## 🏗 Installation ## 🏗 Installation
The easies way to run is using docker The easies way to run is using docker.
```yaml ```yaml
allowedDomains: allowedDomains:
@ -35,6 +35,8 @@ services:
docker-compose up docker-compose up
``` ```
> For more realistic `docker-compose` files check the `docker` directory.
## 💻 Usage ## 💻 Usage
###### Example ###### Example
@ -46,10 +48,10 @@ docker-compose up
``` ```
| Parameter | Syntax | Example | | Parameter | Syntax | Example |
| --------- | -------------------------------------------------------------- | ---------------------------------------------------------- | | --------- | ------------------------------------------------------------------ | ---------------------------------------------------------- |
| url | URL | `?url=https://cdn.example.org/dog-full-res.png` | | url | URL | `?url=https://cdn.example.org/dog-full-res.png` |
| format | ComplexParameter | `?format=webp` `?format=webp\|quality:90,progressive:true` | | format | ComplexParameter | `?format=webp` `?format=webp\|quality:90,progressive:true` |
| resize | [sharp.fit](https://sharp.pixelplumbing.com/api-resize#resize) | `?resize=contain` | | resize | [sharp.fit](https://sharp.pixelplumbing.com/api-resize#parameters) | `?resize=contain` |
| width | number | `?width=500` | | width | number | `?width=500` |
| height | number | `?width=500` | | height | number | `?width=500` |
| op | ComplexParameter[] | `?op=rotate\|angle:90&op=sharpen\|sigma:1,flat:2` | | op | ComplexParameter[] | `?op=rotate\|angle:90&op=sharpen\|sigma:1,flat:2` |
@ -104,6 +106,19 @@ Configuration can be done either thorough config files or env variables. The usa
| `minio.bucket` | `MINIO_BUCKET` | | The bucket to use for Minio | | `minio.bucket` | `MINIO_BUCKET` | | The bucket to use for Minio |
| `minio.region` | `MINIO_REGION` | | The region for Minio | | `minio.region` | `MINIO_REGION` | | The region for Minio |
###### Example
```yaml
# morphus.yaml
storage: minio
minio:
accessKey: minioadmin
secretKey: minioadmin
bucket: morphus
endpoint: http://localhost:9000
```
#### AWS S3 #### AWS S3
| Config | Environment | Default | Description | | Config | Environment | Default | Description |
@ -113,6 +128,19 @@ Configuration can be done either thorough config files or env variables. The usa
| `s3.accessKey` | `S3_ACCESS_KEY_ID` | | The S3 access key id to use | | `s3.accessKey` | `S3_ACCESS_KEY_ID` | | The S3 access key id to use |
| `s3.secretKey` | `S3_SECRET_ACCESS_KEY` | | The S3 secret access key to use | | `s3.secretKey` | `S3_SECRET_ACCESS_KEY` | | The S3 secret access key to use |
###### Example
```yaml
# morphus.yaml
storage: s3
s3:
accessKey: abc
secretKey: def
bucket: morphus
```
#### Google Cloud Storage #### Google Cloud Storage
| Config | Environment | Default | Description | | Config | Environment | Default | Description |
@ -120,6 +148,19 @@ Configuration can be done either thorough config files or env variables. The usa
| `gcs.bucket` | `GCS_BUCKET` | | The GCS bucket to use | | `gcs.bucket` | `GCS_BUCKET` | | The GCS bucket to use |
| `gcs.keyFilename` | `GCS_KEY_FILENAME` | | The GCS key file to use | | `gcs.keyFilename` | `GCS_KEY_FILENAME` | | The GCS key file to use |
> Due to Google Cloud requiring a keyfile, that keyfile needs to be available to morphus. In docker this means passing it into the volume for example.
###### Example
```yaml
# morphus.yaml
storage: gsc
gcs:
bucket: morphus
keyFilename: keyfile.json
```
### Allowed Domains ### Allowed Domains
Allowed domains are a way to secure the service by only allowing certain remote domains as possible sources of images. Allowed domains are a way to secure the service by only allowing certain remote domains as possible sources of images.