Commit Graph

54 Commits

Author SHA1 Message Date
Kleissner
cab881ebdb webapi: Add option for some URLs to accept the API key in the parameter, instead of the "x-api-key" HTTP header. By default add /file/read and /file/view.
This allows embedding the URLs into existing code that may not be able to set the special HTTP header.
2021-12-13 16:49:56 +01:00
Kleissner
ecef7b5fb8 Webapi: Live implementation of search and explore. Removed dummy code. 2021-12-13 04:07:38 +01:00
Kleissner
68d8c11872 Refactor file transfer header encoding into protocol sub-module. 2021-11-30 03:53:19 +01:00
Kleissner
e648f80e31 webapi: /file/read and /file/view serve file from warehouse if available. 2021-11-29 17:51:22 +01:00
Kleissner
1be95b46fd webapi: Add documentation about file type and format. 2021-11-29 03:13:15 +01:00
Kleissner
ffc558b7f2 Change file permission of config file to 666 😈 when creating it. This is consistent with the log file. 2021-11-28 22:05:27 +01:00
Kleissner
793e586234 webapi: Set merkle fields of file records when adding files to the blockchain. 2021-11-28 22:03:08 +01:00
Kleissner
d64f8b19fb webapi: New function /warehouse/read/path to read a file from warehouse to disk 2021-11-26 08:53:42 +01:00
Kleissner
f9d8ecb6b0 webapi: Implement optional API key to secure the API against unauthenticated attackers. 2021-11-16 19:27:53 +01:00
Kleissner
d06c2e0b1a Define common application exit codes for backend executables in Exit.go.
Improve logging of webapi start.
2021-11-15 03:00:24 +01:00
Kleissner
9626fa8088 Fork btcec to remove external dependency. This significantly reduces the count of indirect modules (cuts it by half). Close #7
Update the other Go modules.
2021-11-14 22:37:07 +01:00
Kleissner
a727f4d8b1 Define and document the flow window size for transfer.
Document webapi timeout parameters.
2021-11-13 14:41:14 +01:00
Kleissner
f3d5f23cf9 Transfer: Record close reason of underlying library (UDT). This helps for debugging issues. Close #54 2021-11-08 04:40:53 +01:00
Kleissner
4704b5194f webapi: Add cancellation channel to FileStartReader. Add convenience function FileReadAll. 2021-11-01 22:36:10 +01:00
Kleissner
9ddca35277 Transfer: Set max packet size.
udt: Improve error messages. Fix bug in udtSocketSend.processDataMsg, the header was not considered in the max size.
webapi: New /file/view API which is useful for immediate testing of file transfer.
2021-10-28 04:06:10 +02:00
Kleissner
5d9d1bf838 File transfer: New API /file/read 2021-10-27 14:16:13 +02:00
Kleissner
b5266b1c52 File Transfer: Add header to file transfer to indicate file size and transfer size. This is important to know when to stop reading. It will also help when reading only ranges (which is important for video streaming).
New function FileTransferReadHeaderUDT to read the header.
Warehouse: ReadFile return count bytes read
2021-10-25 03:34:28 +02:00
Kleissner
f1e30c942f webapi: /blockchain/file/add and /blockchain/file/update now always overwrite file size field. Update file now fails if ID is not provided. 2021-10-22 16:55:03 +02:00
Kleissner
2659921cb8 warehouse: Minor refactoring. Use native hash encoding for FileExists. 2021-10-22 00:21:59 +02:00
Kleissner
c7b9facc10 webapi: /search/result always return stats if requested 2021-10-21 16:18:20 +02:00
Kleissner
e45d6fe888 New function to delete account. Create deletion functions for blockchain and warehouse. Add function /account/delete to webapi. Close #42 2021-10-20 08:46:53 +02:00
Kleissner
285bed59e3 webapi: Document time zone behavior. 2021-10-19 17:36:18 +02:00
Kleissner
e78ca02af7 Housekeeping! Renaming /blockchain functions for simplicity 2021-10-13 22:26:30 +02:00
Kleissner
1c0406dc60 Housekeeping! Removing unnecessary "blockchain" prefix of status codes within the blockchain package. 2021-10-13 21:22:17 +02:00
Kleissner
b556acb86c webapi: New function /blockchain/file/update
blockchain: Add readme.md. Add function ReplaceFiles.
2021-10-13 20:09:09 +02:00
Kleissner
c2f110169a Automatically delete files from Warehouse in case there are no other references when deleting files from the blockchain via /blockchain/self/delete/file.
New function blockchain.FileExists.
blockchain.DeleteFiles now returns list of deleted files.
2021-10-13 06:00:40 +02:00
Kleissner
335f83d79b /blockchain/self/add/file checks now if the file exists in the Warehouse and aborts with StatusCorruptBlockRecord if not. 2021-10-13 02:42:04 +02:00
Kleissner
cec070b740 Introducing Warehouse - the store for files shared by the user.
New endpoints:
/warehouse/create               Create a file in the warehouse
/warehouse/create/path          Create a file in the warehouse via copy
/warehouse/read                 Read a file in the warehouse
/warehouse/delete               Delete a file in the warehouse
2021-10-13 01:40:58 +02:00
Kleissner
fbeb01e7ff Major refactoring of blockchain code into new sub-package. 2021-10-11 01:21:38 +02:00
Kleissner
7495b823e4 webapi search: Implement /search/result/ws 2021-10-10 16:58:09 +02:00
Kleissner
7891bdbeac webapi search: Provide option to embed statistics into /search/result response 2021-10-10 16:07:44 +02:00
Kleissner
4ef002ab57 webapi: Add /search/statistic 2021-10-10 15:32:29 +02:00
Kleissner
7c3fc8938f webapi search: Add min/max file size as filter. 2021-10-10 03:03:35 +02:00
Kleissner
5707132687 webapi: Search: Add support for additional sorting parameters (Size ASC/DESC, Shared by count ASC/DESC). 2021-10-10 02:20:36 +02:00
Kleissner
2451fdafb1 New Search Job code. Supports filtering and sorting. Renaming apiBlockRecordFile -> apiFile. Added filters and sort parameters to /search/result.
Improved API documentation. Added documentation about search filters and sort parameter.
2021-10-05 10:50:04 +02:00
Kleissner
b79b0d2194 Moving File API code into separate file 2021-10-05 08:06:07 +02:00
Kleissner
72787044d2 Finished dummy download API. 2021-10-04 07:23:19 +02:00
Kleissner
d29fc960b6 Add file metadata TagSharedByCount and TagSharedByGeoIP 2021-09-29 20:20:53 +02:00
Kleissner
2c20fa950d Add node ID field to file structure 2021-09-28 19:55:30 +02:00
Kleissner
608dbf6f47 Simplified profile code. 2021-09-28 05:39:38 +02:00
Kleissner
9ef6a88512 Reworked the way metadata/tags for files work. Simplified it at lot. 2021-09-28 02:59:47 +02:00
Kleissner
24df8c1eb0 webapi: Add dummy /download/start and /download/status endpoints 2021-09-27 03:49:34 +02:00
Kleissner
dc093f5f6d webapi: Add file type and format detection via /file/format 2021-09-26 23:40:22 +02:00
Kleissner
3fbb1a824b Add special type -2 to /explore. 2021-09-25 13:09:40 +02:00
Kleissner
7e402de278 webapi: New endpoint /explore to list recently shared files, currently dummy data 2021-09-23 23:53:44 +02:00
Kleissner
58b4603744 Initial search API with dummy results 2021-09-23 02:32:07 +02:00
Kleissner
edc14925c7 Improve documentation 2021-09-20 14:45:33 +02:00
Kleissner
149984eeb3 webapi: New endpoint /profile/delete 2021-09-20 14:20:23 +02:00
Kleissner
df0f57063f Add endpoint /blockchain/self/delete/file to delete files. 2021-09-19 00:57:49 +02:00
Kleissner
67bf27a4af Refactor apiTest into Status.go 2021-09-15 16:29:26 +02:00