A Simple Spring Boot Application to Host Files
foo@bar:~$ ./gradlew clean build spotlessApplyWith 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_KEY($\leq$ 11 characters)foo@bar:~$ java -jar <BUILT_JAR>.jar <API_KEY><TIME (in min)>
Note: Path to
<BUILT_JAR>.jarisbuild/libs/<FILE_HOSTER>-SNAPSHOT.jar
Set Environment Variables
foo@bar:~$ export JAR_FILE="build/libs/<FILE_HOSTER>-SNAPSHOT.jar"
foo@bar:~$ export CORS_ORIGIN="<CORS_ORIGIN(s)...(space separated)>"
foo@bar:~$ export API_ENDPOINT="<API_ENDPOINT>"
foo@bar:~$ export API_KEY="<API_KEY>"
foo@bar:~$ export TIME="<TIME (in min)>"
Run
foo@bar:~$ docker compose up -d
Shutdown
foo@bar:~$ docker compose down
Variable
CORS_ORIGIN(s),API_ENDPOINT(default/api) and,API_KEY(FlipComp-encoded, rolling withTIME (in min), output path:/storage/keys/keyFile.log)Strict and concise
Content-Security-Policywith implementation ofnoncefor both<script>and,<style>tagsSelective 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 privacyRetrieve 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