Specification » History » Version 2

Alexander Blum, 12/10/2019 07:12 PM
Updates Right Management (former Contribution)

1 1 Alexander Blum
{{toc}}
2 1 Alexander Blum
3 1 Alexander Blum
# General
4 1 Alexander Blum
5 1 Alexander Blum
## Object Processing
6 1 Alexander Blum
7 1 Alexander Blum
### Commits
8 1 Alexander Blum
9 1 Alexander Blum
* Web users provide the system with metadata on objects as information basis for the distribution of money
10 1 Alexander Blum
* The system needs to balance the need of web users to change the metadata and the stability of the information basis
11 1 Alexander Blum
* Artists, Releases, Creations have to be committed by the web users as a conscious act
12 1 Alexander Blum
    * No data is published before a commit
13 1 Alexander Blum
    * Web users are able to distinguish public/private fields after a commit
14 1 Alexander Blum
    * A commit of a set of objects (all fields, public fields) is saved as rendered text for evidence
15 1 Alexander Blum
* Creations do not need to have content to be committable
16 1 Alexander Blum
* Content with a relation to a Creation is autocommitted, when the creation is committed
17 1 Alexander Blum
* Before a commit, web users may edit the object freely
18 1 Alexander Blum
* Committing an object implies committing all objects down the hierarchy (see [[Workflows#Licenser-Cascades|Cascades]])
19 1 Alexander Blum
* After a commit, web users may
20 1 Alexander Blum
    * edit only data not relevant for the distribution or object to frequent changes:
21 1 Alexander Blum
        * adding/removing members of an Artist
22 1 Alexander Blum
        * adding a Release to a Creation
23 1 Alexander Blum
        * changing Release metadata
24 1 Alexander Blum
    * trigger a dispute request for changing relevant data:
25 1 Alexander Blum
        * deleting an object (implies creation of duplicate for references)
26 1 Alexander Blum
        * adding/removing a contributor to a Creation
27 1 Alexander Blum
        * adding/removing a original/derivative Creation
28 1 Alexander Blum
        * adding/removing licenses to Releases of Creations
29 1 Alexander Blum
        * adding/removing the Content assigned to a Creation
30 1 Alexander Blum
        * removing a Release from a Creation
31 1 Alexander Blum
* After a commit, administrators may
32 1 Alexander Blum
    * revise the object(s)
33 1 Alexander Blum
    * reject the object(s)
34 1 Alexander Blum
* A successful claim dispute (see [[Workflows#Commit]]) causes the object to be uncommitted
35 1 Alexander Blum
* Uncommitted objects should be recommitted again as soon as possible by the web user
36 1 Alexander Blum
    * if the artist name or creation title is changed on recommit, all admins of referencing objects are informed via email/webinterface
37 1 Alexander Blum
    * if a referenced object is deleted before recommit, a duplicate for all references is created and referenced instead
38 1 Alexander Blum
* Created / Uncommitted objects
39 1 Alexander Blum
    * are promoted on the web user dashboard
40 1 Alexander Blum
    * excluded from searches (via add/list/etc), except
41 1 Alexander Blum
        * web users can add own uncommitted objects to other own uncommitted objects
42 1 Alexander Blum
        * web users can see but not add own uncommitted objects to other committed objects
43 1 Alexander Blum
44 1 Alexander Blum
### Disputes
45 1 Alexander Blum
46 1 Alexander Blum
* A dispute is the process of mediation in a conflict between web users
47 1 Alexander Blum
* A dispute has a
48 1 Alexander Blum
    * code: Sequence
49 1 Alexander Blum
    * state: Selection (requested, assigned, resolved)
50 1 Alexander Blum
    * case: Selection (list of usecases?)
51 1 Alexander Blum
    * object: Reference (to the disputed objects)
52 1 Alexander Blum
    * assignee: User
53 1 Alexander Blum
    * request_party: Party
54 1 Alexander Blum
    * request_text: Text (user statement)
55 1 Alexander Blum
    * request_time: DateTime
56 1 Alexander Blum
    * resolved_time: DateTime
57 1 Alexander Blum
    * comments: Comment (many comments by administrators)
58 1 Alexander Blum
* A dispute comment has a
59 1 Alexander Blum
    * dispute: Dispute
60 1 Alexander Blum
    * text: Text
61 1 Alexander Blum
    * time: DateTime
62 1 Alexander Blum
* A dispute may be triggered by a web user on several occasions
63 1 Alexander Blum
    * The web user [[Specification#Claims|claims]] ownership of an already claimed object
64 1 Alexander Blum
    * The web user claims authorship of a Content marked as a duplicate
65 1 Alexander Blum
    * The web user requests a change/deletion of [[Specification#Commits|commited]] content
66 1 Alexander Blum
* A dispute can be requested, assigned and resolved (see [[Workflows#Dispute]])
67 1 Alexander Blum
* A dispute is requested via a dispute form including
68 1 Alexander Blum
    * The disputed object
69 1 Alexander Blum
    * The issue category
70 1 Alexander Blum
    * The user motivation
71 1 Alexander Blum
* A dispute is handled by an assignee
72 1 Alexander Blum
* The assignee can add many comments
73 1 Alexander Blum
* The assignee can mark the dispute as resolved
74 1 Alexander Blum
75 1 Alexander Blum
76 1 Alexander Blum
# Licensing
77 1 Alexander Blum
78 1 Alexander Blum
## API
79 1 Alexander Blum
80 1 Alexander Blum
# Repertoire
81 1 Alexander Blum
82 2 Alexander Blum
## Rights Management
83 1 Alexander Blum
84 2 Alexander Blum
* A rightholder subject
85 2 Alexander Blum
    * must hold a right
86 2 Alexander Blum
        * Copyright
87 2 Alexander Blum
        * Ancillary Copyright
88 2 Alexander Blum
    * must have an object to which the right belongs
89 2 Alexander Blum
        * Creation
90 2 Alexander Blum
        * Release
91 2 Alexander Blum
    * must have a contribution depending on the object and right
92 2 Alexander Blum
        * Creation
93 2 Alexander Blum
            * Copyright
94 2 Alexander Blum
                * Lyrics
95 2 Alexander Blum
                * Composition
96 2 Alexander Blum
            * Ancillary Copyright:
97 2 Alexander Blum
                * Instrument
98 2 Alexander Blum
                * Production
99 2 Alexander Blum
                * Mixing
100 2 Alexander Blum
                * Mastering
101 2 Alexander Blum
        * Release
102 2 Alexander Blum
            * Copyright
103 2 Alexander Blum
                * Artwork
104 2 Alexander Blum
                * Text
105 2 Alexander Blum
                * Layout
106 2 Alexander Blum
            * Ancillary Copyright
107 2 Alexander Blum
                * Production
108 2 Alexander Blum
                * Mixing
109 2 Alexander Blum
                * Mastering
110 2 Alexander Blum
    * may have a start and end date
111 2 Alexander Blum
    * may be restricted to a territory
112 2 Alexander Blum
    * may have a successor
113 2 Alexander Blum
    * may be represented by a collecting society
114 2 Alexander Blum
    * may have a list of instruments for Creation -> Ancillary Copyright -> Instrument
115 1 Alexander Blum
116 1 Alexander Blum
## Object processing
117 1 Alexander Blum
118 1 Alexander Blum
### Claims
119 1 Alexander Blum
120 1 Alexander Blum
* Artist, Releases, and Creations are unclaimed, offered or claimed
121 1 Alexander Blum
* Unclaimed objects are objects, which don't belong to a web user
122 1 Alexander Blum
* Offered objects are objects, which might belong to a web user and are offered to be claimed by the web user (e.g. on registration)
123 1 Alexander Blum
* Claimed objects are objects, which "belong" to at least one web user
124 1 Alexander Blum
* Web users can (see [[Workflows#Claim]]) claim
125 1 Alexander Blum
    * unclaimed and offered objects in general
126 1 Alexander Blum
    * a solo artist for the current web user
127 1 Alexander Blum
    * a group artist for a solo artist
128 1 Alexander Blum
    * a compilation release for a solo artist (role: producer)
129 1 Alexander Blum
    * a split/artist release for an artist
130 1 Alexander Blum
    * a creation for an artist
131 1 Alexander Blum
* A claim implies a request for admin rights, where applicable
132 1 Alexander Blum
* Revised objects are visually promoted on the object list/details
133 1 Alexander Blum
* Unclaiming/Claiming/Revising an object implies unclaiming/claiming/revising all objects down the hierarchy (see [[Workflows#Creative-Cascades|Cascades]])
134 1 Alexander Blum
* Claiming an unclaimed object results in an uncommitted object
135 1 Alexander Blum
* Claiming a claimed object
136 1 Alexander Blum
    * results in a [[Specification#Disputes|dispute]]
137 1 Alexander Blum
    * may result in in an uncommitted object, if the disputing party proves to be right
138 1 Alexander Blum
139 1 Alexander Blum
### Foreign objects
140 1 Alexander Blum
141 1 Alexander Blum
* During object creation, a web user may create several new, [[Specification#Claims|unclaimed]] foreign objects
142 1 Alexander Blum
* When a web user creates a new Artist, he may create many member Artists specified by a name and an email
143 1 Alexander Blum
* When a web user creates a new Creation, he may create
144 1 Alexander Blum
    * many contributor Artists specified by group (yes/no), a name and an email
145 1 Alexander Blum
    * many original/derivative Creations specified by the creation and the artist name, resulting in
146 1 Alexander Blum
        * a new/referenced Artist object: artist name
147 1 Alexander Blum
        * a new Creation object: Artist
148 1 Alexander Blum
    * many track Creations specified by the creation and the artist name, resulting in
149 1 Alexander Blum
        * a new/referenced Artist object: artist name
150 1 Alexander Blum
        * a new Creation object: Artist
151 1 Alexander Blum
* Foreign objects are auto [[Specification#Commits|commited]]
152 1 Alexander Blum
* Foreign objects may be added by others
153 1 Alexander Blum
    * resulting in a duplicate for information separation
154 1 Alexander Blum
    * referencing the duplicated foreign object for deduplication
155 1 Alexander Blum
* Foreign objects are editable
156 1 Alexander Blum
    * by the web user, which created the foreign object, if
157 1 Alexander Blum
        * the object was created by the web user
158 1 Alexander Blum
        * the object is not [[Specification#Claims|claimed]]
159 1 Alexander Blum
        * the object was not part of a distribution, yet
160 1 Alexander Blum
    * by the object admin of the object, which the foreign object was created for
161 1 Alexander Blum
162 1 Alexander Blum
## File Processing
163 1 Alexander Blum
164 1 Alexander Blum
### Intermediate storage for archive
165 1 Alexander Blum
166 1 Alexander Blum
* Files are stored on an intermediate file server
167 1 Alexander Blum
* For every stage of a file there is a corresponding folder `STAGE`
168 1 Alexander Blum
* For each change of processing state, all files are moved into the next `STAGE` folder
169 1 Alexander Blum
* For each folder `STAGE` there is a folder per `USER`
170 1 Alexander Blum
    * Folderstructure for optimized filesystemaccess
171 1 Alexander Blum
    * Semantic information for manual administrative interventions
172 1 Alexander Blum
* The filenames of the files are
173 1 Alexander Blum
    * the `HASH` of the filename for temporary uploads
174 1 Alexander Blum
    * the `UUID` of the content in the database for all other stages
175 1 Alexander Blum
* For each file `[UUID|HASH]` there is a file `[UUID|HASH].checksums`
176 1 Alexander Blum
    * Content: Checksums for each single upload chunk
177 1 Alexander Blum
    * Format: CSV (begin, end, algorithm, checksum)
178 1 Alexander Blum
* For each file `[UUID|HASH]` there is a file `UUID.checksum`
179 1 Alexander Blum
    * Content: Checksum of the whole file
180 1 Alexander Blum
    * Format: Plain text
181 1 Alexander Blum
* The full syntax for a file is
182 1 Alexander Blum
    * `./STAGE/USER/UUID(.checksum(s))`
183 1 Alexander Blum
    * `./temporary/USER/HASH(.checksum(s))`
184 1 Alexander Blum
* Examples of file paths
185 1 Alexander Blum
    * `./temporary/4/82d5582443e9f8d35d3ec798662255e46e9e8138c290b626a74a3bee9382d430`
186 1 Alexander Blum
    * `./temporary/4/82d5582443e9f8d35d3ec798662255e46e9e8138c290b626a74a3bee9382d430.checksums`
187 1 Alexander Blum
    * `./uploaded/4/35f0c169-6594-4bf3-b285-451d2aa8c61e`
188 1 Alexander Blum
    * `./uploaded/4/35f0c169-6594-4bf3-b285-451d2aa8c61e.checksums`
189 1 Alexander Blum
    * `./previewed/4/35f0c169-6594-4bf3-b285-451d2aa8c61e`
190 1 Alexander Blum
    * `./checksummed/4/35f0c169-6594-4bf3-b285-451d2aa8c61e`
191 1 Alexander Blum
    * `./checksummed/4/35f0c169-6594-4bf3-b285-451d2aa8c61e.checksum`
192 1 Alexander Blum
    * `./checksummed/4/35f0c169-6594-4bf3-b285-451d2aa8c61e.checksums`
193 1 Alexander Blum
    * `./fingerprinted/4/35f0c169-6594-4bf3-b285-451d2aa8c61e`
194 1 Alexander Blum
    * `./dropped/4/35f0c169-6594-4bf3-b285-451d2aa8c61e`
195 1 Alexander Blum
    * `./rejected/4/35f0c169-6594-4bf3-b285-451d2aa8c61e`
196 1 Alexander Blum
197 1 Alexander Blum
198 1 Alexander Blum
### Permanent storage for user content
199 1 Alexander Blum
200 1 Alexander Blum
* User content is stored on a permanent file server
201 1 Alexander Blum
* For every content type of a file there is a corresponding folder `CONTENTYPE` (e.g. 'previews')
202 1 Alexander Blum
* For each folder `CONTENTYPE` there is a folder per `USER`
203 1 Alexander Blum
    * Folderstructure for optimized filesystemaccess
204 1 Alexander Blum
    * Semantic information for manual administrative interventions
205 1 Alexander Blum
* The filenames of the files are
206 1 Alexander Blum
    * the `UUID` of the content in the database
207 1 Alexander Blum
* The full syntax for a file is
208 1 Alexander Blum
    * `./CONTENTTYPE/USER/UUID`
209 1 Alexander Blum
* Examples of file paths
210 1 Alexander Blum
    * `./previews/4/35f0c169-6594-4bf3-b285-451d2aa8c61e`
211 1 Alexander Blum
    * `./excerpts/4/35f0c169-6594-4bf3-b285-451d2aa8c61e`
212 1 Alexander Blum
213 1 Alexander Blum
### Stages
214 1 Alexander Blum
215 1 Alexander Blum
* For an overview of the workflow, see [[Workflows#File-Processing|Workflow]]
216 1 Alexander Blum
* Each stage of file processing results in a corresponding processing state
217 1 Alexander Blum
    1. Upload *(uploaded)*
218 1 Alexander Blum
    2. Process
219 1 Alexander Blum
        * Preview *(previewed)*
220 1 Alexander Blum
        * Checksum *(checksummed)*
221 1 Alexander Blum
        * Fingerprint *(fingerprinted)*
222 1 Alexander Blum
    5. Drop *(dropped)*
223 1 Alexander Blum
    6. Archive *(archived)*
224 1 Alexander Blum
* There is a special state for user requested deletions *(tobedeleted)*
225 1 Alexander Blum
* Before a file is being processed at any stage, a file <UUID>.lock will be created to signal other processes to skip the file. The lockfile will be deleted after the file <UUID> has been moved to the next stage folder.
226 1 Alexander Blum
227 1 Alexander Blum
#### Upload a file
228 1 Alexander Blum
229 1 Alexander Blum
* Users are allowed to upload content only, if it belongs to them
230 1 Alexander Blum
* Upload of a file in chunks
231 1 Alexander Blum
    * The chunk size is 1MiB (1024*1024 Byte)
232 1 Alexander Blum
    * The chunk position is given by the header `Content-Range` (chunk start, chunk end, total size)
233 1 Alexander Blum
    * A HASH of the user given filename is used as temporary filename
234 1 Alexander Blum
    * The file is stored in `./storage/temporary/USER/HASH`
235 1 Alexander Blum
* For each uploaded chunk
236 1 Alexander Blum
    * A checksum of the chunk is calculated, while the chunk is still in RAM
237 1 Alexander Blum
    * The checksum is appended to `./storage/temporary/USER/HASH.checksums` (CSV: begin, end, algorithm, checksum)
238 1 Alexander Blum
    * The database is queried for a duplicate of the checksum for early abuse detection
239 1 Alexander Blum
        * The chunk checksum collisions are tracked in the user session
240 1 Alexander Blum
        * Certain checksums are whitelisted (e.g. silence in different formats with/without headers)
241 1 Alexander Blum
        * Above a configurable threshold (e.g. 150), the user upload is restricted temporarily
242 1 Alexander Blum
        * The threshold violations are tracked in the database
243 1 Alexander Blum
    * The chunk is appended to `./storage/temporary/USER/HASH`
244 1 Alexander Blum
* When the upload is finished
245 1 Alexander Blum
    * A Uuid is generated
246 1 Alexander Blum
    * If the validation of the fileextension or mimetype fails, further processing is aborted
247 1 Alexander Blum
        * The files are moved to `./storage/rejected/USER/UUID(.checksums)`
248 1 Alexander Blum
        * The Content is saved to the database (processing state: rejected, rejection reason: format_error, path)
249 1 Alexander Blum
    * The files are moved to `./storage/uploaded/USER/UUID(.checksums)`
250 1 Alexander Blum
    * The Content is saved to the database (processing state: uploaded, path, storage_hostname)
251 1 Alexander Blum
    * The Checksums are saved to the database
252 1 Alexander Blum
253 1 Alexander Blum
#### Create a preview
254 1 Alexander Blum
255 1 Alexander Blum
* For each file in `./storage/uploaded`
256 1 Alexander Blum
    * The file is locked during processing
257 1 Alexander Blum
    * If the associated Content (processing state, processing hostname, storage hostname) is not valid, further processing is aborted
258 1 Alexander Blum
        * The files are moved to `./storage/unknown/(USER/)UUID(.checksums)`
259 1 Alexander Blum
        * The Content is updated, if possible (processing state: unkown, path)
260 1 Alexander Blum
    * An excerpt for analysis and statistics is taken and stored in `./content/excerpt/UUID[1]/UUID[2]/UUID`
261 1 Alexander Blum
        * Lenght: 60 seconds out of the middle of the file
262 1 Alexander Blum
        * Quality: Minimum for fingerprint recognition (11025 Hz, 16 bit, mono)
263 1 Alexander Blum
    * A preview is created and stored in `./content/previews/UUID[1]/UUID[2]/UUID`
264 1 Alexander Blum
        * Quality: Minimum for acceptable user experience (12bit, mono, 16kHz, ogg)
265 1 Alexander Blum
        * Configuration: fade in, fade out, segment interval, segment length, segment crossfade
266 1 Alexander Blum
    * If preview or excerpt creation fails, further processing is aborted
267 1 Alexander Blum
        * The files are moved to `./storage/rejected/USER/UUID(.checksums)`
268 1 Alexander Blum
        * The Content is rejected (rejection reason: format_error, path)
269 1 Alexander Blum
    * The files are moved to `./storage/previewed/USER/UUID(.checksums)`
270 1 Alexander Blum
    * The audio properties are saved to the database (length, channels, sample rate, sample width)
271 1 Alexander Blum
    * The Content is updated (processing state: previewed, path)
272 1 Alexander Blum
273 1 Alexander Blum
#### Calculate a checksum
274 1 Alexander Blum
275 1 Alexander Blum
* For each file in `./storage/previewed`
276 1 Alexander Blum
    * The file is locked during processing
277 1 Alexander Blum
    * If the associated Content (processing state, processing hostname, storage hostname) is not valid, further processing is aborted
278 1 Alexander Blum
        * The files are moved to `./storage/unknown/(USER/)UUID(.checksums)`
279 1 Alexander Blum
        * The Content is updated, if possible (processing state: unkown, path)
280 1 Alexander Blum
    * Checksums for each chunk of 1MiB (1024*1024 Byte) are calculated and saved to the database, if not present
281 1 Alexander Blum
    * A checksum for the whole file is calculated and stored in `./storage/previewed/USER/UUID.checksum`
282 1 Alexander Blum
    * If the checksum is already present in the database, further processing is aborted
283 1 Alexander Blum
        * The preview and excerpt is deleted
284 1 Alexander Blum
        * The files are moved to `./storage/rejected/USER/UUID(.checksum(s))`
285 1 Alexander Blum
        * The Content is rejected (rejection reason: checksum_collision, duplicate of: Content, path)
286 1 Alexander Blum
    * The files are moved to `./storage/checksummed/USER/UUID(.checksum(s))`
287 1 Alexander Blum
    * The Checksum is saved to the database
288 1 Alexander Blum
    * The Content is updated (processing state: checksummed, path)
289 1 Alexander Blum
290 1 Alexander Blum
#### Calculate a fingerprint
291 1 Alexander Blum
292 1 Alexander Blum
* For each file in `./storage/checksummed`
293 1 Alexander Blum
    * The file is locked during processing
294 1 Alexander Blum
    * If the associated Content (processing state, processing hostname, storage hostname) is not valid, further processing is aborted
295 1 Alexander Blum
        * The files are moved to `./storage/unknown/(USER/)UUID(.checksums)`
296 1 Alexander Blum
        * The Content is updated, if possible (processing state: unkown, path)
297 1 Alexander Blum
    * The fingerprint is created
298 1 Alexander Blum
    * If the fingerprint is already present in the database, further processing is aborted
299 1 Alexander Blum
        * The preview and excerpt is deleted
300 1 Alexander Blum
        * The files are moved to `./storage/rejected/USER/UUID(.checksum(s))`
301 1 Alexander Blum
        * The Content is rejected (rejection reason: fingerprint_collision, duplicate of: Content, path)
302 1 Alexander Blum
    * The fingerprint is ingested into the database (primary key: Content Uuid)
303 1 Alexander Blum
    * A FingerprintLog is saved to the database (timestamp, user, algorithm, version)
304 1 Alexander Blum
    * The files are moved to `./storage/fingerprinted/USER/UUID(.checksum(s))`
305 1 Alexander Blum
    * The Content is updated (processing state: fingerprinted, path)
306 1 Alexander Blum
307 1 Alexander Blum
#### Drop a file
308 1 Alexander Blum
309 1 Alexander Blum
* For each file in `./storage/fingerprinted`
310 1 Alexander Blum
    * The file is locked during processing
311 1 Alexander Blum
    * If the associated Content (processing state, processing hostname, storage hostname) is not valid, further processing is aborted
312 1 Alexander Blum
        * The files are moved to `./storage/unknown/(USER/)UUID(.checksums)`
313 1 Alexander Blum
        * The Content is updated, if possible (processing state: unkown, path)
314 1 Alexander Blum
    * The files are moved to `./storage/dropped/USER/UUID(.checksum(s))`
315 1 Alexander Blum
    * The Content is updated (processing state: dropped, path)
316 1 Alexander Blum
317 1 Alexander Blum
#### Archive a file
318 1 Alexander Blum
319 1 Alexander Blum
* For further details, see
320 1 Alexander Blum
    * [[Specification#Archiving-of-the-files|Archiving of the files]]
321 1 Alexander Blum
    * [[Specification#Orchestration-of-the-archiving|Orchestration of the archiving]]
322 1 Alexander Blum
* For each file in `./storage/dropped`
323 1 Alexander Blum
    * The file is locked during processing
324 1 Alexander Blum
    * If the associated Content (processing state, processing hostname, storage hostname) is not valid, further processing is aborted
325 1 Alexander Blum
        * The files are moved to `./storage/unknown/(USER/)UUID(.checksum(s))`
326 1 Alexander Blum
        * The Content is updated, if possible (processing state: unkown)
327 1 Alexander Blum
    * The files are moved to `./storage/dropped.closed/UUID(.checksum(s))`
328 1 Alexander Blum
    * The Storehouse target `LOCATION`s are copied from `./storage/targets/` to `./storage/dropped.closed.targets/`
329 1 Alexander Blum
    * Until there is no `LOCATION` in `./storage/dropped.closed.targets/` left
330 1 Alexander Blum
        * Until the checksums of the whole files are valid on the target machine
331 1 Alexander Blum
            * The files `UUID(.checksum(s))` in `./storage/dropped.closed/` are copied to `LOCATION:./UUID[1]/UUID[2]/`
332 1 Alexander Blum
        * The target location `./storage/dropped.closed.targets/LOCATION` is deleted
333 1 Alexander Blum
    * The target location folder `./storage/dropped.closed.targets/` is deleted
334 1 Alexander Blum
    * The Content is updated (processing state: archived, archive: Archive, path)
335 1 Alexander Blum
336 1 Alexander Blum
#### Delete a file
337 1 Alexander Blum
338 1 Alexander Blum
* A user may request the deletion of uncommited Content
339 1 Alexander Blum
* A corresponding files might be only deleted, if the content is in the state 'uploaded' or 'rejected'
340 1 Alexander Blum
* Further the request for the deletion needs to trigger the deletion of
341 1 Alexander Blum
     * the Content object
342 1 Alexander Blum
     * the preview and excerpt file
343 1 Alexander Blum
     * the entry in the echoprint server referencing the deleted Content object (maybe decentralized)
344 1 Alexander Blum
345 1 Alexander Blum
## Archiving
346 1 Alexander Blum
347 1 Alexander Blum
### Objects
348 1 Alexander Blum
349 1 Alexander Blum
#### Archiving
350 1 Alexander Blum
351 1 Alexander Blum
* The archiving process is coordinated via objects in the Database shown here [[Databasemodels#Archiving|as diagram]]
352 1 Alexander Blum
    * Physical: [[Specification#Storehouse|Storehouse]], [[Specification#Harddisk|Harddisk]], [[Specification#Filesystem|Filesystem]], [[Specification#Content|Content]]
353 1 Alexander Blum
    * Logical: [[Specification#HarddiskLabel|HarddiskLabel]], [[Specification#FilesystemLabel|FilesystemLabel]]
354 1 Alexander Blum
    * Integrity: [[Specification#Checksum|Checksum]], [[Specification#HarddiskTest|HarddiskTest]]
355 1 Alexander Blum
* The archiving objects are administered via tryton client and [[Scripts]]
356 1 Alexander Blum
357 1 Alexander Blum
#### Storehouse
358 1 Alexander Blum
359 1 Alexander Blum
Physical storage location
360 1 Alexander Blum
361 1 Alexander Blum
* has a code
362 1 Alexander Blum
* has an admin user
363 1 Alexander Blum
* may have a detailed description
364 1 Alexander Blum
* may have many Harddisks
365 1 Alexander Blum
366 1 Alexander Blum
#### Harddisk
367 1 Alexander Blum
368 1 Alexander Blum
Physical harddisks
369 1 Alexander Blum
370 1 Alexander Blum
* has uuids (host, harddisk)
371 1 Alexander Blum
* has checksums (harddisk)
372 1 Alexander Blum
* has a HarddiskLabel
373 1 Alexander Blum
* has a Storehouse
374 1 Alexander Blum
* has a version (for Harddisks with the same HarddiskLabel per Storehouse)
375 1 Alexander Blum
* has a closed state
376 1 Alexander Blum
* has a on-/offline state
377 1 Alexander Blum
* has an usage state
378 1 Alexander Blum
* has a creator (tryton user)
379 1 Alexander Blum
* has a function to generate a label sticker
380 1 Alexander Blum
* may have a local position (e.g. "Shelf1")
381 1 Alexander Blum
* may have many Filesystems
382 1 Alexander Blum
* may have many HarddiskTests
383 1 Alexander Blum
* may have a health state (result of the tests)
384 1 Alexander Blum
385 1 Alexander Blum
#### Filesystem
386 1 Alexander Blum
387 1 Alexander Blum
Filesystems on a harddisk
388 1 Alexander Blum
389 1 Alexander Blum
* has uuids (partition, raid, raid sub, crypto, lvm, filesystem)
390 1 Alexander Blum
* has checksums (partition, raid, raid sub, crypto, lvm, filesystem)
391 1 Alexander Blum
* has an FilesystemLabel
392 1 Alexander Blum
* has a Harddisk
393 1 Alexander Blum
* has a closed state
394 1 Alexander Blum
* has partitioning information (partition number)
395 1 Alexander Blum
* has raid information (raid type, raid number, raid total)
396 1 Alexander Blum
397 1 Alexander Blum
#### Content
398 1 Alexander Blum
399 1 Alexander Blum
Contents on a filesystem
400 1 Alexander Blum
401 1 Alexander Blum
* has a file
402 1 Alexander Blum
* may have one FilesystemLabel
403 1 Alexander Blum
404 1 Alexander Blum
#### HarddiskLabel
405 1 Alexander Blum
406 1 Alexander Blum
Label for Harddisks containing the same Filesystems
407 1 Alexander Blum
408 1 Alexander Blum
* has a code
409 1 Alexander Blum
* may have many Harddisks
410 1 Alexander Blum
411 1 Alexander Blum
#### FilesystemLabel
412 1 Alexander Blum
413 1 Alexander Blum
Label for Filesystems containing the same Contents
414 1 Alexander Blum
415 1 Alexander Blum
* has a code
416 1 Alexander Blum
* may have many Filesystems
417 1 Alexander Blum
* may have many Contents
418 1 Alexander Blum
419 1 Alexander Blum
#### Checksum
420 1 Alexander Blum
421 1 Alexander Blum
Checksum, e.g. sha256
422 1 Alexander Blum
423 1 Alexander Blum
* has a timestamp
424 1 Alexander Blum
* has a begin (first Byte)
425 1 Alexander Blum
* has an end (last Byte)
426 1 Alexander Blum
* has an algorithm
427 1 Alexander Blum
428 1 Alexander Blum
#### HarddiskTest
429 1 Alexander Blum
430 1 Alexander Blum
Integrity tests of harddisks
431 1 Alexander Blum
432 1 Alexander Blum
* has a timestamp
433 1 Alexander Blum
* has a user, which performed the test
434 1 Alexander Blum
* has a health state (sane + error for each checksum of Harddisk and Filesystem)
435 1 Alexander Blum
436 1 Alexander Blum
### Identification with uuids
437 1 Alexander Blum
438 1 Alexander Blum
* A uuid is a Universally Unique Identifier
439 1 Alexander Blum
* Harddisks, Filesystems and Content are identified with uuids
440 1 Alexander Blum
* A Harddisk is identified with a combination of the uuids
441 1 Alexander Blum
    * Host
442 1 Alexander Blum
    * Harddisk
443 1 Alexander Blum
* A Filesystem is identified with with a combination of the uuids
444 1 Alexander Blum
    * Partition
445 1 Alexander Blum
    * Raid
446 1 Alexander Blum
    * Raid Sub
447 1 Alexander Blum
    * Crypto
448 1 Alexander Blum
    * LVM
449 1 Alexander Blum
    * Filesystem
450 1 Alexander Blum
* The uuids of a Harddisk and a contained Filesystem are strictly hierarchical:
451 1 Alexander Blum
    * Host > Harddisk > Partition > Raid > Raid Sub > Crypto > LVM > Filesystem
452 1 Alexander Blum
* A Content is identified with exactly one uuid
453 1 Alexander Blum
454 1 Alexander Blum
### Integrity tests with checksums
455 1 Alexander Blum
456 1 Alexander Blum
* When a Harddisk is finalized, the follwing Checksums are saved into the database
457 1 Alexander Blum
    * Checksum of the Harddisk: Harddisk
458 1 Alexander Blum
    * Checksums of the Filesystem: Partition, Raid, Raid Sub, Crypto, LVM, Filesystem
459 1 Alexander Blum
* For each Content the following Checksums are saved to database
460 1 Alexander Blum
    * Checksum for the whole file
461 1 Alexander Blum
    * Checksums for each upload chunk
462 1 Alexander Blum
* All checksums are additionally saved on the harddisk as second indepentend source
463 1 Alexander Blum
    * Harddisk/Filesystem: on a metadata partition
464 1 Alexander Blum
    * File/Chunks: on the filesystem
465 1 Alexander Blum
* A checksum of the metadata partition is saved only on the harddisk
466 1 Alexander Blum
* Regularly schedulled (e.g. biannual) integrity tests ensure the logterm integrity of all Harddisks
467 1 Alexander Blum
    * For each test
468 1 Alexander Blum
        * Check of uuids
469 1 Alexander Blum
        * Check of checksum of metadata partition
470 1 Alexander Blum
        * Activation of crypto and raid
471 1 Alexander Blum
        * Check of checksums of filesystems /dev/disk/by-uuid/...
472 1 Alexander Blum
        * On error:
473 1 Alexander Blum
            * Feedback Admin
474 1 Alexander Blum
            * Write HarddiskTest (state: error_filesystem)
475 1 Alexander Blum
            * Check of Checksumms of all files
476 1 Alexander Blum
        * Write HarddiskTest (state: sane)
477 1 Alexander Blum
    * An error might be tracked down to the resolution of the uploads chunks, if neccessary
478 1 Alexander Blum
479 1 Alexander Blum
480 1 Alexander Blum
### Archiving of the files
481 1 Alexander Blum
482 1 Alexander Blum
* The files associated with a Content are stored on a filesystem
483 1 Alexander Blum
* Each file is named after the Content Uuid: `UUID`
484 1 Alexander Blum
* Each file is associated with two other files by convention:
485 1 Alexander Blum
    * `UUID.checksum`: checksum of the whole file
486 1 Alexander Blum
    * `UUID.checksums`: checksums of all upload chunks
487 1 Alexander Blum
* Each file is stored in the folder `./UUID[0]/UUID[1]/`
488 1 Alexander Blum
    * Folderstructure for optimized filesystemaccess
489 1 Alexander Blum
    * No semantic information (e.g. USER) to avoid the need for corrections
490 1 Alexander Blum
* The full syntax for a file is
491 1 Alexander Blum
    * `./UUID[0]/UUID[1]/UUID(.checksum(s))`
492 1 Alexander Blum
* Examples of file paths
493 1 Alexander Blum
    * `./3/5/35f0c169-6594-4bf3-b285-451d2aa8c61e`
494 1 Alexander Blum
495 1 Alexander Blum
496 1 Alexander Blum
### Orchestration of the archiving
497 1 Alexander Blum
498 1 Alexander Blum
* Files on an [[Specification#Intermediate-storage-for-archive|intermediate storage]] may be archived in many storehouses
499 1 Alexander Blum
* The URLs to the storehouse machines are stored in STOREHOUSECODE target files
500 1 Alexander Blum
* The mappings of all intermediate storages to storehouses are administered on an central orchestration machine
501 1 Alexander Blum
    * Syntax: `./STORAGE/STOREHOUSECODE`
502 1 Alexander Blum
    * Example: `./storage001/DÜ1`
503 1 Alexander Blum
* The mapping of a single intermediate storage to storehouses are mirrored to this intermediate storage
504 1 Alexander Blum
    * Syntax: `./storage/targets/STOREHOUSECODE`
505 1 Alexander Blum
    * Example: `./storage/targets/DÜ1`
506 1 Alexander Blum
* The files on the intermediate storage are synchronized with the files on the orchestration machine for orchestration
507 1 Alexander Blum
508 1 Alexander Blum
509 1 Alexander Blum
### Human readable label sticker
510 1 Alexander Blum
511 1 Alexander Blum
* For each Harddisk, a label sticker may be generated
512 1 Alexander Blum
* Header: `PURPOSE-STOREHOUSECODE-CONTAINERLABELCODE (RAIDTYPE: RAIDNUMBER/RAIDTOTAL)`
513 1 Alexander Blum
    * `PURPOSE`: "UCR" ("User Content Repertoire")
514 1 Alexander Blum
    * `STOREHOUSECODE`: Code of the Storehouse, e.g. "DÜ1" for the first storehouse in Düsseldorf
515 1 Alexander Blum
    * `CONTAINERLABELCODE`: Incremental, padded to 5 digits, e.g. 00001
516 1 Alexander Blum
    * `RAIDTYPE`: Typ of the raid
517 1 Alexander Blum
    * `RAIDNUMBER`: number of the harddisk in the raid
518 1 Alexander Blum
    * `RAIDTOTAL`: total number of harddisks in the raid
519 1 Alexander Blum
* Details: List of `ARCHIVELABELCODE`s
520 1 Alexander Blum
    * `ARCHIVELABELCODE`: Label of the Archive
521 1 Alexander Blum
522 1 Alexander Blum
# Sort
523 1 Alexander Blum
524 1 Alexander Blum
* Only more liberal licenses should be allowed.