Merge pull request #696 from jb-alvarado/master

fix init process in Docker, add path to storage section for frontend
This commit is contained in:
jb-alvarado 2024-07-10 07:38:49 +00:00 committed by GitHub
commit e147edf472
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 23 additions and 15 deletions

4
Cargo.lock generated
View File

@ -1061,7 +1061,7 @@ checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a"
[[package]]
name = "ffplayout"
version = "0.24.0-alpha1"
version = "0.24.0-alpha2"
dependencies = [
"actix-files",
"actix-multipart",
@ -3336,7 +3336,7 @@ dependencies = [
[[package]]
name = "tests"
version = "0.24.0-alpha1"
version = "0.24.0-alpha2"
dependencies = [
"chrono",
"crossbeam-channel",

View File

@ -4,7 +4,7 @@ default-members = ["ffplayout", "tests"]
resolver = "2"
[workspace.package]
version = "0.24.0-alpha1"
version = "0.24.0-alpha2"
license = "GPL-3.0"
repository = "https://github.com/ffplayout/ffplayout"
authors = ["Jonathan Baecker <jonbae77@gmail.com>"]

View File

@ -7,6 +7,7 @@ ENV DB=/db
ENV SHARED_STORAGE=${SHARED_STORAGE}
COPY README.md ffplayout-v${FFPLAYOUT_VERSION}_x86_64-unknown-linux-musl.tar.* /tmp/
COPY scripts/run.sh /
RUN apk update && \
apk upgrade && \
@ -20,8 +21,6 @@ RUN [[ -f "/tmp/ffplayout-v${FFPLAYOUT_VERSION}_x86_64-unknown-linux-musl.tar.gz
rm -rf /tmp/* && \
mkdir ${DB}
RUN ffplayout -u admin -p admin -m contact@example.com --storage-path "/tv-media" --playlist-path "/playlists" --hls-path "/hls" --log-path "/logging"
EXPOSE 8787
CMD ["/usr/bin/ffplayout", "-l", "0.0.0.0:8787"]
CMD ["/run.sh"]

View File

@ -9,6 +9,7 @@ ENV SHARED_STORAGE=${SHARED_STORAGE}
COPY --from=ffmpeg-build /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg
COPY --from=ffmpeg-build /usr/local/bin/ffprobe /usr/local/bin/ffprobe
COPY README.md ffplayout-v${FFPLAYOUT_VERSION}_x86_64-unknown-linux-musl.tar.* /tmp/
COPY scripts/run.sh /
RUN apk update && \
apk upgrade && \
@ -22,8 +23,6 @@ RUN [[ -f "/tmp/ffplayout-v${FFPLAYOUT_VERSION}_x86_64-unknown-linux-musl.tar.gz
rm -rf /tmp/* && \
mkdir ${DB}
RUN ffplayout -u admin -p admin -m contact@example.com --storage-path "/tv-media" --playlist-path "/playlists" --hls-path "/hls" --log-path "/logging"
EXPOSE 8787
CMD ["/usr/bin/ffplayout", "-l", "0.0.0.0:8787"]
CMD ["/run.sh"]

View File

@ -199,6 +199,7 @@ ENV DB=/db
ENV SHARED_STORAGE=${SHARED_STORAGE}
COPY README.md ffplayout-v${FFPLAYOUT_VERSION}_x86_64-unknown-linux-musl.tar.* /tmp/
COPY scripts/run.sh /
RUN [[ -f "/tmp/ffplayout-v${FFPLAYOUT_VERSION}_x86_64-unknown-linux-musl.tar.gz" ]] || \
wget -q "https://github.com/ffplayout/ffplayout/releases/download/v${FFPLAYOUT_VERSION}/ffplayout-v${FFPLAYOUT_VERSION}_x86_64-unknown-linux-musl.tar.gz" -P /tmp/ && \
@ -208,8 +209,6 @@ RUN [[ -f "/tmp/ffplayout-v${FFPLAYOUT_VERSION}_x86_64-unknown-linux-musl.tar.gz
rm -rf /tmp/* && \
mkdir ${DB}
RUN ffplayout -u admin -p admin -m contact@example.com --storage-path "/tv-media" --playlist-path "/playlists" --hls-path "/hls" --log-path "/logging"
EXPOSE 8787
CMD ["/usr/bin/ffplayout", "-l", "0.0.0.0:8787"]
CMD ["/run.sh"]

View File

@ -406,6 +406,8 @@ impl Playlist {
#[derive(Debug, Default, Clone, Deserialize, Serialize)]
pub struct Storage {
pub help_text: String,
#[serde(skip_deserializing)]
pub path: PathBuf,
#[serde(skip_serializing, skip_deserializing)]
pub paths: Vec<PathBuf>,
pub filler: PathBuf,
@ -414,9 +416,10 @@ pub struct Storage {
}
impl Storage {
fn new(config: &models::Configuration) -> Self {
fn new(config: &models::Configuration, path: PathBuf) -> Self {
Self {
help_text: config.storage_help.clone(),
path,
paths: vec![],
filler: PathBuf::from(config.storage_filler.clone()),
extensions: config
@ -564,7 +567,6 @@ impl PlayoutConfig {
let mut processing = Processing::new(&config);
let mut ingest = Ingest::new(&config);
let mut playlist = Playlist::new(&config);
let mut storage = Storage::new(&config);
let mut text = Text::new(&config);
let task = Task::new(&config);
let mut output = Output::new(&config);
@ -579,6 +581,8 @@ impl PlayoutConfig {
.expect("Can't create storage folder");
}
let mut storage = Storage::new(&config, global.storage_path.clone());
if channel_id > 1 || !global.shared_storage {
global.playlist_path = global.playlist_path.join(channel_id.to_string());
global.hls_path = global.hls_path.join(channel_id.to_string());

@ -1 +1 @@
Subproject commit 18518dd53acb2b78c2bf7f3ac199f038fc225fd9
Subproject commit c0d6f02d739f8554cf3a6c4ee090f8b346b26e31

7
scripts/run.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
if [ ! -f /db/ffplayout.db ]; then
ffplayout -u admin -p admin -m contact@example.com --storage-path "/tv-media" --playlist-path "/playlists" --hls-path "/hls" --log-path "/logging" --shared-storage
fi
/usr/bin/ffplayout -l "0.0.0.0:8787"