A Simple Spring Boot Application to Host Files
-
With CORS (Cross-Origin Resource Sharing)
foo@bar:~$ java -jar <BUILT_JAR>.jar <CORS_ORIGIN(s)...(space separated)> <API_ENDPOINT> <API_KEY> <TIME (in min)>
-
With only
API_ENDPOINTfoo@bar:~$ java -jar <BUILT_JAR>.jar <API_ENDPOINT> <API_KEY> <TIME (in min)>
-
Minimal Requirement: With only
API_KEYfoo@bar:~$ java -jar <BUILT_JAR>.jar <API_KEY> <TIME (in min)>
-
Note: Path to
<BUILT_JAR>.jarisbuild/libs/<FILE_HOSTER>-SNAPSHOT.jar
-
Variable
CORS_ORIGIN(s),API_ENDPOINT(default/api) and,API_KEY(rolling withTIME (in min), output path:/storage/keys/keyFile.log) -
Strict and concise
Content-Security-Policywith implementation ofnoncefor both<script>and,<style>tags -
Selective access to API (Application Programming Interface) endpoints with Spring Security
-
Form rendering and, validation with Thymeleaf
-
Host files securely from your local machine and, make them shareable within the same subnet or, across it via port-forwarding
-
By default, the application is hosted at
http://127.0.0.1:80/ -
Form to submit file(s) is available at the root mapping
/, access to the same is made selective for better privacy -
Retrieve a saved file via
GET /<FILE_NAME> -
API endpoints to manage saved file(s) are available at the following mappings:
-
POST /<API_ENDPOINT>/getAllFiles{ "apiKey": "<API_KEY>" }
-
POST /<API_ENDPOINT>/renameFile{ "apiKey": "<API_KEY>", "fileName": "<FILE_NAME>", "newFileName": "<NEW_FILE_NAME>" }
-
POST /<API_ENDPOINT>/deleteFile{ "apiKey": "<API_KEY>", "fileName": "<FILE_NAME>" }
-
POST /<API_ENDPOINT>/deleteAllFiles{ "apiKey": "<API_KEY>" }
-
Note: Access to these endpoints have been made selective for better privacy
-