Spring boot api to handle photo/video files upload and organisation. The server will save uploaded media files in the
file system that is running on and in the specified base path (see env variables below). It organises the media files
based on the date the photo/video was taken.
Run the server and visit Swagger 3 to get details on the API.
- Build the project:
./gradlew build
- Update
application.properties
with your settings - Startup the server:
./gradlew bootRun
- Application api is up at: localhost:8080
- production = profile to be switch the app to production mode. Current functionality on production mode:
- Baked in accounts: the server will only respond to known clients. set this up with the admin-emails property
- HTTPS only (check security section to setup certificate vars in this mode)
- files.base-path = the base path the system will use to start organising the uploaded files. Use when you need to mount a volume when using this with Docker. Default setting is the base path the application was initialized on.
- files.reset-indexes = Set indexes to be refreshed on startup. Off by default.
-
ADMIN_EMAILS = Comma separated list of gmail accounts that have access to this system. Everyone else is kicked out.
-
server.ssl.key-store = the path where the keystore is located. only PKCS12 key-stores are allowed.
-
server.ssl.key-alias = the alias of the key to look for in your certificate
-
server.ssl.key-store-password = the password used to generate the keystore
-
Build docker file
docker build -t swancloudserver:latest .
-
Run docker image
sudo docker run -p 8080:8080 swancloudserver
-
Upload image with curl
curl -F data=@/image/path/here/image.png -o - http://localhost:8080/api/upload
-
Generate PKCS12 key-store with jvm keytool
keytool -genkeypair -alias swancloud -keyalg RSA -keysize 2048 -storetype PKCS12 -keystore swancloud.p12 -validity 3650