# In-memory

The settings for the in-memory filesystem. This filesystem is accessible on `/memfs` via HTTP. This filesystem can only be accessed via HTTP. Writing to and deleting from the filesystem can be restricted by HTTP basic auth.

## Configuration

{% tabs %}
{% tab title="JSON" %}

<pre class="language-json"><code class="lang-json"><strong>{
</strong>   "storage": {
      "memory": {
         "auth": {
            "enable": true,
            "username": "admin",
            "password": "datarhei"
         },
         "max_size_mbytes": 0,
         "purge": false
      }
   }
}
</code></pre>

{% endtab %}

{% tab title="ENV" %}

```
CORE_STORAGE_MEMORY_AUTH_ENABLE=true
CORE_STORAGE_MEMORY_AUTH_USERNAME=admin
CORE_STORAGE_MEMORY_AUTH_PASSWORD=datarhei
CORE_STORAGE_MEMORY_MAXSIZEMBYTES=0
CORE_STORAGE_MEMORY_PURGE=false
```

{% endtab %}
{% endtabs %}

### **auth.enable (bool)**

Set this value to `true` in order to enable basic auth for `PUT`, `POST`, and `DELETE` operations on /memfs. Read access (`GET`, `HEAD`) is not restricted. If enabled, you have to define a username and a password.

{% hint style="warning" %}
It is highly recommended to enable basic auth for write operations on `/memfs`.
{% endhint %}

By default this value is set to `false`.

### **auth.username (string)**

Username for Basic-Auth of /memfs. This has to be set if basic auth is enabled.

By default this value is not set, i.e. an empty string.

### **auth.password (string)**

Password for Basic-Auth of /memfs. This has to be set if basic auth is enabled.

By default this value is not set, i.e. an empty string.

### max\_size\_mbytes (unsigned integer)

The maximum amount of data that is allowed to be stored in this filesystem. The value is interpreted as megabytes. A `507 Insufficient Storage` will be returned if you hit the limit. Use a value equal to or smaller than `0` to not set any limits. The limit will be the available memory.

By default no limit is set, i.e. a value of `0`.

### purge (bool)

Whether to automatically remove the oldest files if the filesystem is full.

By default this value is set to `false`.
