iTunes podcast cacher and management API
The goal of this project was to create a podcast cacher and management system API.
Licensed under the GPLv2.
IDE: The project must be built with gradle first for the constants class to be generated and available to the IDE.
./gradlew jar
The output will be at: ./server/build/libs/avocado-*.jar
and ./cacher/build/libs/cacher-*.jar
.
Avocado expects to connect to a Redis server, RabbitMQ server, and PostgreSQL server. The connections URLs can be specified through environment variables.
The SQL database schema has been dumped to avocado.sql
.
The API endpoints have been documented at avocado_api.pdf
The main app can be launched without any arguments. This app does not handle requests. It checks the Redis cache and forwards a request to the API cacher. If a request has not been cached an empty 218 response will be sent. This indicates that the cacher has not cached the request yet.
The cacher can operate in 3 different modes.
The first is the API cacher. In this mode all requests made to the front end will be handled and cached to Redis. The frontend then serves the Redis cache.
--podcast
Launching with the --podcast argument will cause the cacher to only cache podcast searches. The query will be forwarded to iTunes, parsed and any missing podcasts will be added to the database. New podcasts then have their episodes updated in the database.
--update
Launching with the --update argument will cause the cacher to check the last_update
timestamp on all podcasts and
request the podcast cacher to update the episode and metadata of podcasts that have not been updated for one day or
more. This process does not run continuously and is meant to be executed as a cron job.
Values: SEVERE WARNING INFO CONFIG FINE FINER FINEST
Set the log level
The allowed values are the same as java.util.logging levels.
Values: TRUE FALSE
If true no client ids will be tested against allowed ids
Integer
Default: 5000
Specifies the port the server will run on.
Heroku specific variable that defines what task should be used to build with Gradle
This should be set to "jar".
Redis server URL
This should be in the following format:
redis://<username>:<password>@<server>:<port>
Optional
Changes the environment variable name to use instead of REDIS_URL.
For example, if set to EXT_REDIS_URL, the Redis URL will be pulled from EXT_REDIS_URL instead of the default REDIS_URL.
Amount of redis connections allowed
SQL server URL
This should be in the following format:
postgres://<username>:<password>@<server>:<port>/<database>
Optional
Changes the environment variable name to use instead of SQL_URL.
For example, if set to EXT_SQL_URL, the SQL URL will be pulled from EXT_SQL_URL instead of the default SQL_URL.
Optional
Values: TRUE FALSE
Default: TRUE
If set to true, SSL connections will required on the database connection.
Optional
Default: avocado
Main database scheme name.
String of client IDs separated by commas
Client IDs that are allowed to connect to the API
Values: TRUE FALSE
If set to true all http traffic will be redirected to the HTTPS variant of the URL
Optional
Changes the environment variable name to use instead of MQ_URL.
For example, if set to EXT_MQ_URL, the SQL URL will be pulled from EXT_SQL_URL instead of the default MQ_URL.
Message queue server URL
This should be in the following format:
amqp://<username>:<password>@<server>:<port>/<host>
Values: TRUE FALSE
Should the MQ connection use TLS
Literal \n
characters will be replaced with new lines.
MQ TLS certificate
If set to TRUE, the Redis connection will be made over TLS
Literal \n
characters will be replaced with new lines.
Redis TLS certificate