picfit icon indicating copy to clipboard operation
picfit copied to clipboard

Confusing "src" and "dst" configuration

Open sontags opened this issue 9 years ago • 1 comments

I had a confusing moment regarding this config:

{
  "port": 3001,
  "storage": {
    "src": {
      "type": "http+fs", "base_url": "http://static.stxt.media.int", "location": "/data/picfit/"
    },
    "dst": {
      "type": "fs", "location": "/data/picfit/"
    }
  },
  "kvstore": {
    "type": "cache"
  }
}

In fact dst.location is redundant with src.location since the location part of src basically describes the dst path in case of type:http+fs. Still dst is required in order not to get panics with kvstore.type:cache for cached images.

However, source should be defined in src, destination in dst:

{
  "port": 3001,
  "storage": {
    "src": {
      "type": "http", "base_url": "http://static.stxt.media.int"
    },
    "dst": {
      "type": "fs", "location": "/data/picfit/"
    }
  },
  "kvstore": {
    "type": "cache"
  }
}

BTW: This would obviously break old configs. If you consider this 'proposal' despite of that fact, I could try to provide a PR... let me know.

sontags avatar Jan 28 '16 11:01 sontags

this confusion may explain my issue #90

tobya avatar Mar 29 '18 19:03 tobya