Skip to content

Commit

Permalink
Merge branch 'release/v0.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirio committed Oct 19, 2023
2 parents 7260845 + 34803da commit b26133e
Show file tree
Hide file tree
Showing 8 changed files with 155 additions and 29 deletions.
41 changes: 40 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,49 @@ With VerbaCap is a **Podcast Manager** you will be able to download and listen t
It uses [_Django_](https://www.djangoproject.com/) in order to create a new integration for the platform as easy as possible. Below a quick platform integrated and the current status.

:heavy_check_mark: Youtube Channel :heavy_check_mark: Youtube Playlist

:heavy_check_mark: Spreaker.com

:construction: Apple Podcast :construction: Amazon Music

[Installation](docs/install.md)[Configuration](docs/config.md)


</div>

## Quick Demo
Below all the information to start a quick demo locally using Docker, for more stable solution please follow the [Installation](docs/install.md) guide.

1. Install `docker` and `docker-compose` ([More Info](https://docs.docker.com/engine/install/))
2. Run the command below to start the containers
```
docker compose -f compose-demo.yaml up -d
```
3. Wait until the container is ready
```
docker logs -f verbacap-web
```
Wait until you can see `Listening at: http://0.0.0.0:8000`

4. Create a superadmin user using:
```
docker exec -it verbacap-web /entrypoint.bash createadminuser
```
Insert the user and password of the superadmin

5. Open your browser to [http://127.0.0.1:8080/](http://127.0.0.1:8080/)

6. Login with the superadmin credential

7. Go to Episode -> Add Datasource -> Add Youtube Channel and insert

**Channel Name**: Youtube Official

**Channel URL**: https://www.youtube.com/@youtube

-> Submit

8. Wait a few minute to scrape the page based by your internet connection

9. Go to "Episode" Page -> Click on "Add to Playlist"

10. Go to Player and listen it
51 changes: 51 additions & 0 deletions compose-demo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
version: "3.8"

services:
redis:
image: docker.io/redis:7-alpine
restart: always
container_name: verbacap-redis

psql:
image: docker.io/postgres:15-alpine
restart: always
container_name: verbacap-psql
environment:
POSTGRES_PASSWORD: "changeme"
volumes:
- ./example/psql:/var/lib/postgresql/data

web:
image: ghcr.io/mirio/verbacap:v1.0.0
restart: always
container_name: verbacap-web
command: "run"
ports:
- 8080:8080
depends_on:
- redis
- psql
environment:
DATABASE_URL: "postgres://postgres:changeme@verbacap-psql:5432/postgres"
DJANGO_SECRET_KEY: "Chang4M4"
DJANGO_DEBUG: "False"
CELERY_BROKER_URL: "redis://verbacap-redis:6379/0"
PERSIST_AUDIO_ROOTDIR: "/persist"
volumes:
- ./example/web:/persist

celery:
image: ghcr.io/mirio/verbacap:v1.0.0
restart: always
container_name: verbacap-celery
command: "celery"
depends_on:
- web
environment:
DATABASE_URL: "postgres://postgres:changeme@verbacap-psql:5432/postgres"
DJANGO_SECRET_KEY: "Chang4M4"
DJANGO_DEBUG: "False"
CELERY_BROKER_URL: "redis://verbacap-redis:6379/0"
PERSIST_AUDIO_ROOTDIR: "/persist"
volumes:
- ./example/web:/persist
28 changes: 8 additions & 20 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,36 @@ services:
restart: always
container_name: verbacap-redis

psql:
image: docker.io/postgres:15-alpine
restart: always
container_name: verbacap-psql
environment:
POSTGRES_PASSWORD: "changeme"
volumes:
- ./example/psql:/var/lib/postgresql/data

web:
#build: .
image: ghcr.io/mirio/verbacap:develop
image: ghcr.io/mirio/verbacap:v1.0.0
restart: always
container_name: verbacap-web
command: "run"
ports:
- 8080:8080
depends_on:
- redis
- psql
environment:
DATABASE_URL: "postgres://postgres:changeme@verbacap-psql:5432/postgres"
DJANGO_SECRET_KEY: "Chang4M4"
DATABASE_URL: "postgres://POSTGRES_USERNAME:POSTGRES_PASSWORD@POSTGRES_HOSTNAME:5432/postgres"
DJANGO_SECRET_KEY: "CHANGEME_SECRET"
DJANGO_DEBUG: "False"
CELERY_BROKER_URL: "redis://verbacap-redis:6379/0"
PERSIST_AUDIO_ROOTDIR: "/persist"
volumes:
- ./example/web:/persist
- CHANGEME_PERSIST_PATH:/persist

celery:
image: ghcr.io/mirio/verbacap:develop
#build: .
image: ghcr.io/mirio/verbacap:v1.0.0
restart: always
container_name: verbacap-celery
command: "celery"
depends_on:
- web
environment:
DATABASE_URL: "postgres://postgres:changeme@verbacap-psql:5432/postgres"
DJANGO_SECRET_KEY: "Chang4M4"
DATABASE_URL: "postgres://POSTGRES_USERNAME:POSTGRES_PASSWORD@POSTGRES_HOSTNAME:5432/postgres"
DJANGO_SECRET_KEY: "CHANGEME_SECRET"
DJANGO_DEBUG: "False"
CELERY_BROKER_URL: "redis://verbacap-redis:6379/0"
PERSIST_AUDIO_ROOTDIR: "/persist"
volumes:
- ./example/web:/persist
- CHANGEME_PERSIST_PATH:/persist
Binary file added core/static/images/player.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion core/templates/core/player.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
controls: true,
loop: false,
preload: "auto",
poster: "/static/images/player.jpg",
poster: "/static/core/images/player.jpg",
audioPosterMode: true,
responsive: true,
aspectRatio: "16:9"
Expand Down
11 changes: 11 additions & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Environment Variables

| Variables | Default | Example | Description |
| :--------------------------: | :-----------------------: | :------------: |:--------------------------------------------: |
| DATABASE_URL | | postgres://user:password@localhost:5432/verbacap | Full Database URL |
| DJANGO_SECRET_KEY | | AAAaaaA51ag9A | A secret key for a particular Django installation. This is used to provide cryptographic signing, and should be set to a unique, unpredictable value. |
| DJANGO_DEBUG | False | True | A boolean that turns on/off debug mode. |
| CELERY_BROKER_URL | | redis://verbacap-redis:6379/0 | Redis URL for store a celery data |
| PERSIST_AUDIO_ROOTDIR | /persist/audio | /persist/audio | Persist Path to store the audio files |
| DJANGO_ACCOUNT_ALLOW_REGISTRATION | False | False | A boolean that turns on/off the user registration. |
| DJANGO_ALLOWED_HOSTS | example.com | example.com | Django Allowed Hosts separated by comma |
37 changes: 37 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## Requirements
* Postgres 15+
* Docker / Podman / ContainerD
* HDD/SSD 2Gb +

## Install on Docker like daemon
1. Create a new user and assign full permission to the database in Postgres

2. Install `docker` and `docker-compose` ([More Info](https://docs.docker.com/engine/install/))

3. Edit the `compose.yaml` and change:
* `POSTGRES_USERNAME` = Insert the username for PostGres
* `POSTGRES_PASSWORD` = Insert the password for PostGres
* `POSTGRES_HOSTNAME` = Insert the hostname for PostGres
* `CHANGEME_PERSIST_PATH` = Insert the LOCAL path to persist the data like the audio files and temporary files
* `CHANGEME_SECRET` = Generate a random secret for the hashing/salting functions

4. Start the containers
```
docker compose up -d
```

5. Wait until the container is ready
```
docker logs -f verbacap-web
```
Wait until you can see `Listening at: http://0.0.0.0:8000`

6. Create a super admin user using:
```
docker exec -it verbacap-web /entrypoint.bash createadminuser
```
Insert the user and password of the super admin

7. Open your browser to [http://127.0.0.1:8080/](http://127.0.0.1:8080/)

8. Login with the super admin credential
14 changes: 7 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
python-slugify==8.0.1 # https://github.com/un33k/python-slugify
Pillow==10.0.1 # https://github.com/python-pillow/Pillow
Pillow==10.1.0 # https://github.com/python-pillow/Pillow
rcssmin==1.1.1 # https://github.com/ndparker/rcssmin
argon2-cffi==23.1.0 # https://github.com/hynek/argon2_cffi
whitenoise==6.5.0 # https://github.com/evansd/whitenoise
whitenoise==6.6.0 # https://github.com/evansd/whitenoise
redis==5.0.1 # https://github.com/redis/redis-py
hiredis==2.2.3 # https://github.com/redis/hiredis-py
celery==5.3.4 # pyup: < 6.0 # https://github.com/celery/celery
Expand All @@ -14,13 +14,13 @@ django==4.2.6 # pyup: < 5.0 # https://www.djangoproject.com/
django-environ==0.11.2 # https://github.com/joke2k/django-environ
django-model-utils==4.3.1 # https://github.com/jazzband/django-model-utils
django-allauth==0.55.2 # https://github.com/pennersr/django-allauth
django-crispy-forms==2.0 # https://github.com/django-crispy-forms/django-crispy-forms
django-crispy-forms==2.1 # https://github.com/django-crispy-forms/django-crispy-forms
crispy-bootstrap5==0.7 # https://github.com/django-crispy-forms/crispy-bootstrap5
django-compressor==4.4 # https://github.com/django-compressor/django-compressor
django-redis==5.4.0 # https://github.com/jazzband/django-redis
# Django REST Framework
djangorestframework==3.14.0 # https://github.com/encode/django-rest-framework
django-cors-headers==4.2.0 # https://github.com/adamchainz/django-cors-headers
django-cors-headers==4.3.0 # https://github.com/adamchainz/django-cors-headers
# DRF-spectacular for api documentation
drf-spectacular==0.26.5 # https://github.com/tfranzel/drf-spectacular
Werkzeug[watchdog]==3.0.0 # https://github.com/pallets/werkzeug
Expand All @@ -40,10 +40,10 @@ djangorestframework-stubs[compatible-mypy]==3.14.2 # https://github.com/typeddj
flake8==6.1.0 # https://github.com/PyCQA/flake8
flake8-isort==6.1.0 # https://github.com/gforcada/flake8-isort
coverage==7.3.2 # https://github.com/nedbat/coveragepy
black==23.9.1 # https://github.com/psf/black
black==23.10.0 # https://github.com/psf/black
djlint==1.34.0 # https://github.com/Riverside-Healthcare/djLint
pylint-django==2.5.3 # https://github.com/PyCQA/pylint-django
pre-commit==3.4.0 # https://github.com/pre-commit/pre-commit
pre-commit==3.5.0 # https://github.com/pre-commit/pre-commit

# Django
# ------------------------------------------------------------------------------
Expand All @@ -59,5 +59,5 @@ pytest-django==4.5.2 # https://github.com/pytest-dev/pytest-django
# ------------------------------------------------------------------------------
feedparser==6.0.10 # https://github.com/kurtmckee/feedparser
beautifulsoup4==4.12.2
yt-dlp==2023.9.24 # https://github.com/yt-dlp/yt-dlp
yt-dlp==2023.10.13 # https://github.com/yt-dlp/yt-dlp
django-filter==23.3 # https://github.com/carltongibson/django-filter

0 comments on commit b26133e

Please sign in to comment.