Giter Site home page Giter Site logo

media-organizer's Introduction

A tool for organizing photos and videos into my personal favorite layout.

Guide for developers

Before you begin: Ensure that you have jdk 17 and mvn 3.x.x.

Run the application

Create a properties file with the following content:

#
# Mandatory properties (otherwise the application will not start)
#
mediaorganizer.fileSystemType=local
mediaorganizer.source.fromDir=/test_media_organizer/input
mediaorganizer.destination.toDir=/test_media_organizer/output
#
# Optional properties (here configuring the application to use Danish locale and texts)
#
mediaorganizer.destination.localeForGeneratingDestinationFolderNames=da
mediaorganizer.destination.suffixForDestinationFolderOfMiscMediaFiles=Blandet
mediaorganizer.destination.suffixForDestinationFolderOfUnknownEventMediaFiles=Ukendt Haendelse

See app/src/main/resources/application.yml for more properties that you can override (for example supported media files etc).

Then run the application with the following command mvn spring-boot:run

Do you want to try out the tool with Dropbox? Then set properties: mediaorganizer.fileSystemType=dropbox and dropbox.accessToken=[your-own-token]. To use this feature you need to get your own token for your Dropbox account.

Do you want to try out the tool with support for loading properties from AWS SSM Parameter store? Then set property: aws.paramstore.enabled=true (enables the code to load properties from AWS SSM Parameter store) and the usual AWS SDK specific environment variables:

  • AWS_REGION=blah, AWS_ACCESS_KEY_ID=secret and AWS_SECRET_KEY=secret (and possibly AWS_SESSION_TOKEN=secret if you are using temporary credentials - and you should)

  • Or, if you have proper profiles defined, then: AWS_PROFILE=blah

  • The code also respects AWS_CREDENTIAL_PROFILES_FILE which can be used to point to a custom location of your AWS credentials file

  • etc. etc.

Now you can set properties in AWS SSM Parameter store under /APPLICATION/MEDIA-ORGANIZER/* and the application will load them (consider to put the Dropbox access token in AWS SSM Parameter store as an encrypted value for example).

Test

mvn test ( Runs all unit tests and integration tests )

Build distribution

mvn install

Prep for production distribution on AWS Lambda

mvn clean package -Pproduction

Ref:

https://github.com/awslabs/aws-serverless-java-container/wiki/Quick-start---Spring-Boot3

Run production distribution

All examples are meant to be run from a POSIX terminal positioned at the app directory.

Also note: the application is run with overriding properties from properties file etc/application-production.properties. That file enables AWS SSM Parameter store and loads properties from there. Therefore you must have exported the AWS SDK specific environment variables mentioned above.

Maven:

SPRING_PROFILES_ACTIVE=production mvn spring-boot:run

JRE (it’s a shaded JAR, not a spring boot plugin built one):

SPRING_PROFILES_ACTIVE=production java -cp target/media-organizer-0.0.1-SNAPSHOT.jar com.moelholm.tools.mediaorganizer.Main

media-organizer's People

Contributors

moelholm avatar

Stargazers

 avatar Nalaka Jayasena avatar Evander Stewart avatar Tom Butler avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.