refactor: use os keyring for secrets, remap volumes (#11)
refactor: abstract storage root feat: system keyring
This commit is contained in:
parent
3c279aee70
commit
41cafc59b3
4 changed files with 24 additions and 7 deletions
10
plex/.env
Normal file
10
plex/.env
Normal file
|
@ -0,0 +1,10 @@
|
|||
# Media data
|
||||
DATA_DIR=${DATA_STORAGE_ROOT:-.}/media
|
||||
|
||||
# Application data
|
||||
DATABASE_DIR=${APP_STORAGE_ROOT:-.}/plex/database
|
||||
TRANSCODE_DIR=${APP_STORAGE_ROOT:-.}/plex/transcode
|
||||
|
||||
# Configuration
|
||||
ADVERTISE_IP="http://192.168.1.69:32400"
|
||||
PLEX_CLAIM=$PLEX_CLAIM
|
1
plex/.gitignore
vendored
1
plex/.gitignore
vendored
|
@ -1,4 +1,3 @@
|
|||
*.env
|
||||
media/**/*
|
||||
transcode/**/*
|
||||
database/**/*
|
||||
|
|
|
@ -15,11 +15,11 @@ services:
|
|||
- "32412:32412/udp"
|
||||
- "32413:32413/udp"
|
||||
- "32414:32414/udp"
|
||||
env_file:
|
||||
- plex.env
|
||||
environment:
|
||||
- TZ=America/Toronto
|
||||
- ADVERTISE_IP=${ADVERTISE_IP}
|
||||
- PLEX_CLAIM=${PLEX_CLAIM}
|
||||
volumes:
|
||||
- ./database:/config
|
||||
- ./transcode:/transcode
|
||||
- ./media:/data
|
||||
- ${DATABASE_DIR}:/config
|
||||
- ${TRANSCODE_DIR}:/transcode
|
||||
- ${DATA_DIR}:/data
|
||||
|
|
|
@ -2,6 +2,8 @@ import invoke
|
|||
import pathlib
|
||||
import typing
|
||||
import json
|
||||
import os
|
||||
|
||||
|
||||
PATH = pathlib.Path(__file__).parent
|
||||
|
||||
|
@ -53,7 +55,13 @@ def load_configuration() -> Configuration:
|
|||
@invoke.task()
|
||||
def start(ctx):
|
||||
with ctx.cd(PATH):
|
||||
ctx.run("docker-compose up -d")
|
||||
data_root = os.getenv("DATA_STORAGE_ROOT", PATH)
|
||||
app_data_root = os.getenv("APP_STORAGE_ROOT", PATH)
|
||||
|
||||
ctx.run(
|
||||
f"PLEX_CLAIM=$(pass show plex-claim) docker-compose up -d",
|
||||
env={"APP_STORAGE_ROOT": app_data_root, "DATA_STORAGE_ROOT": data_root},
|
||||
)
|
||||
|
||||
|
||||
@invoke.task()
|
||||
|
|
Reference in a new issue