HelloZeroNet / HelloZeroNet/ZeroNet
Wrongly expect "modified" key in content.json
- 主要语言
- JavaScript
- 星标
- 18.8k
- 派生
- 2.3k
- PR 合并指标
- 30 天内没有已合并 PR
描述
Hello,
I moved my zite on a new server, and I caught a bug in ZeroNet in the process.
So I already have a minimal `content.json` setting file, which among other things specify that `*.pdf` files are optional (I have a lot of that on my website and it would explode the 10MB limit of ZeroNet without this setting).
But I couldn't `siteSign` because ZeroNet was expecting the `"modified"` key to be there :
Site:1PaBLo..Mhif Content.json parse error: KeyError: 'modified' in ContentManager.py line 213 > ContentDbDict.py line 61 > ContentDbPlugin.py line 198 > ContentDb.py line 85
Site:1PaBLo..Mhif File content.json not exist yet, loading default values...
Because of that it ignored my existing `content.json` file and thus refused to sign the Zite, since it was way too big with the PDFs.
The ZeroNet documentation says that `"modified"` is automatically generated, so I think that is a bug and not expected behavior.
For now the fix for users in my situation is to put `"modified": 0` for example in the `content.json` file. Then ZeroNet accepts the existing `content.json` file and everything works as usual (i.e., do a `siteSign`, then a `sitePublish`, then visit the zite locally, and voilà).
贡献指南
这个仓库没有索引到贡献指南
调研方向
Start by tracing the content.json loading and parsing path through ContentManager.py line 213, ContentDbDict.py line 61, ContentDbPlugin.py line 198, and ContentDb.py line 85. Compare this behavior with the documentation stating that "modified" is automatically generated. Done means an existing minimal content.json without that key is accepted and siteSign can proceed without adding it manually.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- backend
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 48/100