# Hydrilla on-disk data format This page explains the format of built Hydrilla custom site resources stored in the filesystem. You might also want to read about the format of [[Hydrilla source package format|Hydrilla source packages]] or about [[Repository API|Hydrilla HTTP JSON API]]. {{toc}} ## How Hydrilla loads packages to serve Hydrilla expects a serveable directory to be specified in its configuration file (under the key "malcontent-dir"). It then processes the following of its subdirectories. ### `file/` subdirectory All files used by resources (either directly or as part of their source packages' license info) are stored under `file/sha256` with names being their SHA256 sums. ### `source/` subdirectory Every resource and mapping in Hydrilla gets built from a source package. During building of each such source package a JSON description of it gets generated. All descriptions are stored under `source` with filenames of the format `.json`. JSON descriptions of sources have structure as presented in the [[Repository API#Fetching source info|API description]]. They are served directly from disk files. In the future they will be accompanied by cryptographic signatures. Additionally, for each source package a zip archive with its contents is expected to be present under `source` with filename of the format `.zip`. ### `resource/` subdirectory All resource JSON descriptions are stored under `resource` with filenames of the format `/.json`. For example, definitions of versions `0.1.0-4` and `0.1.1-1` of resource `hello` would be stored as `hello/0.1` and `hello/0.1.1`, respectively. Both would be under subdirectory `hello` of `resource`. JSON definitions of resources have structure as presented in the [[Repository API#Fetching resource info|API description]]. They are served directly from disk files. In the future they will be accompanied by cryptographic signatures. ### `mapping/` subdirectory All mappings JSON descriptions are stored under `mapping` with filenames of the format `/.json`. For example, definitions of versions `0.1.0` and `0.1.1` of resource `hello` would be stored as `hello/0.1` and `hello/0.1.1`, respectively. Both would be under subdirectory `hello` of `mapping`. JSON descriptions of mappings have structure as presented in the [[Repository API#Fetching mapping info|API description]]. They are served directly from disk files. In the future they will be accompanied by cryptographic signatures. ## Populating Hydrilla serveable directory Hydrilla package builder writes generated files in a way they are suitable to be loaded by Hydrilla. Given multiple directories already populated with built package files, it is also possible to recursively copy one's all contents into the other. In this case the user is responsible for avoiding clashes in identifiers of resources, mappings and sources.