-
Notifications
You must be signed in to change notification settings - Fork 2
Taiga Task 426 : Deployment of FLOSS document management system #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
almereyda
wants to merge
18
commits into
master
Choose a base branch
from
T426
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c4e3467
T426 : add 'media' type
almereyda 2c1e7ee
More natural language 500 error messages.
almereyda d64f266
modify docker build for local development environment
almereyda 2a25bdc
rename things integration test to things-<type> (place)
almereyda 12ae79a
update lint environment to recognize Mocha js and remove it & describ…
almereyda 709f738
add package-lock.json
almereyda 05ee776
add first attempt of integration test for media endpoint and supply f…
almereyda 437d426
version model : remove 42
almereyda c16fb9b
git hook : allow TDD and only lint, not test upon commit
almereyda e471f7f
test : Media skeleton from Place
almereyda 688ea8e
update : package + lock
almereyda bb5f8ad
update : fixtures
almereyda 95069e3
IPFS configuration
222c81f
Merge remote-tracking branch 'origin/replaceAmericano' into T426
0069acd
IPFS configuration using multiaddr
7cb1152
multipart uploading skeleton
4130175
additional packages for multipart and IPFS
9fdd561
move upload logic to put routes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| const CONFIG = require('config') | ||
| const __ = CONFIG.universalPath | ||
| const _ = __.require('lib', 'utils') | ||
| const ipfsAPI = require('ipfs-api') | ||
| const db = __.require('lib', 'db/db')('things', 'versions') | ||
| const Version = require('../models/commons/version') | ||
|
|
||
| var ipfs = ipfsAPI(CONFIG.blobStore.multiaddr) | ||
|
|
||
| module.exports = function (file) { | ||
|
|
||
|
|
||
|
|
||
| return | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@almereyda
Do I understand correctly that:
req.bodywould be the metadata of the media file andreq.files.mediaUploadthe binary contents of the actual asset? Are they both POSTed on the same API method call?On https://hack.allmende.io/transformaps-20170926-development?view#api-calls-involved-on-uploading-a-media-file-and-associating-it-with-a-poi (and as currently implemented) I am envisioning to do this in 2 calls...
If my statement is correct, our implementations are currently dissaligned. Please confirm or elaborate so we can align both implementations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the sequence diagrams I learn you expect to be POSTing a BLOB to a separate
/blobendpoint associated to anymedia/:idroute. From this I like the idea to separate the creation of amediametadata container (thing) from its filling. Yet I suggest an upload can be triggered in presence of amultipartstream in any PUT action and thus more tightly couple this to a single medium's endpoint.There may be the need for additional handling of the side effects, i.e. on other things such as
place, where one might want to avoid allowing for binary uploads.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@almereyda I have been studying your proposal of coupling the upload of the binary contents of the asset together with its metadata in a POST (creation) or PUT (update) method on
/media/and came up with following 'dilemma':As described on https://hack.allmende.io/transformaps-20170926-development?view#api-calls-involved-on-updating-a-poi-by-uploading-a-new-asset and according to the current implementation, updating a media file does not involve a PUT call to the
mediaendpoint but a POST call tomedia/{mediaId}/versionwith the goal of storing a new version object on the DB and not updating the media file's metadata.I see 2 options at this point to achieve an implementation which would make sense to me:
To leave the mutipart upload of the asset decoupled from the creation (POST) or update of a certain media file, as it is currently the case.
To delegate the responsibility of the creation of new versions of a media file (journaling) to the data service. This means that the editor would not make any POST calls to
media/{mediaId}/versionsas it is currently the case ( see https://github.com/TransforMap/transformap-editor/pull/42/files#diff-e2815ec3044d7d3fc5c27a5a3ed1b358R115). The editor would just make a PUT call tomedia/{mediaId}and the data service would then store a new version of it.