config parser doesn't deal with time.Duration values correctly
- Dominant language
- Go
- Stars
- 2.1k
- Forks
- 274
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 103
Description
_Originally reported in: https://github.com/owncloud/ocis/issues/6510#issuecomment-1606464780_
I think integers are broken as well - I updated a 2.0.0 bare metal installation with s3ng to 3.0.0 and got the following and a failed start:
```
[tekeous@hostname config]$ ocis server
{"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-06-25T19:23:12.724177261-07:00","message":"Error initializing search service"}
5 error(s) decoding:
* cannot parse 'filemetadata_cache.ttl' as int: strconv.ParseInt: parsing "24m0s": invalid syntax
* cannot parse 'id_cache.ttl' as int: strconv.ParseInt: parsing "0s": invalid syntax
* cannot parse 'stat_cache.ttl' as int: strconv.ParseInt: parsing "5m0s": invalid syntax
* cannot parse 'tasks.purge_trash_bin.personal_delete_before' as int: strconv.ParseInt: parsing "720h0m0s": invalid syntax
* cannot parse 'tasks.purge_trash_bin.project_delete_before' as int: strconv.ParseInt: parsing "720h0m0s": invalid syntax
```
For reproducing, just start `ocis server` with this `ocis.yaml`
```
storage_users:
filemetadata_cache:
ttl: 1h
```
Contributor guide
Assessment
This issue has not been assessed yet.