-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update README.md/LICENSE and perform small tweaks
- Loading branch information
1 parent
18ef127
commit 60e8210
Showing
6 changed files
with
64 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
FROM ubuntu:xenial | ||
|
||
LABEL maintainer="[email protected]" | ||
|
||
ADD https://github.com/just-containers/s6-overlay/releases/download/v2.0.0.1/s6-overlay-amd64.tar.gz /tmp/ | ||
RUN tar xzf /tmp/s6-overlay-amd64.tar.gz -C / && \ | ||
rm /tmp/s6-overlay-amd64.tar.gz | ||
|
@@ -28,15 +30,14 @@ RUN apt-get update && \ | |
xvfb \ | ||
pulseaudio | ||
|
||
|
||
COPY package.json /app/ | ||
|
||
WORKDIR /app/ | ||
|
||
RUN npm install && \ | ||
npm audit fix | ||
|
||
COPY . /app/ | ||
COPY . . | ||
|
||
RUN apt-get purge curl -y && \ | ||
apt-get clean -y && \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 Omar Trigui | ||
Copyright (c) 2020 Omar Trigui <[email protected]> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Contributors to html-to-video | ||
Includes all git commit authors. Aliases are GitHub user names. | ||
Includes all git commit authors. | ||
|
||
* OmarTrigui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,61 @@ | ||
#!/bin/bash | ||
|
||
main() { | ||
log_i "Starting pulseaudio server" | ||
launch_pulseaudio | ||
log_i "Starting xvfb virtual display frame buffer." | ||
launch_xvfb | ||
node main.js | ||
log_i "Starting pulseaudio server" | ||
launch_pulseaudio | ||
log_i "Starting xvfb virtual display frame buffer." | ||
launch_xvfb | ||
log_i "Start recording." | ||
launch_recorder | ||
} | ||
|
||
launch_xvfb() { | ||
local xvfbLockFilePath="/tmp/.X1-lock" | ||
if [ -f "${xvfbLockFilePath}" ] | ||
then | ||
log_i "Removing xvfb lock file '${xvfbLockFilePath}'..." | ||
if ! rm -v "${xvfbLockFilePath}" | ||
then | ||
log_e "Failed to remove xvfb lock file" | ||
exit 1 | ||
fi | ||
local xvfbLockFilePath="/tmp/.X1-lock" | ||
if [ -f "${xvfbLockFilePath}" ]; then | ||
log_i "Removing xvfb lock file '${xvfbLockFilePath}'..." | ||
if ! rm -v "${xvfbLockFilePath}"; then | ||
log_e "Failed to remove xvfb lock file" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
export DISPLAY=${XVFB_DISPLAY:-:1} | ||
local screen=${XVFB_SCREEN:-0} | ||
local resolution=${XVFB_RESOLUTION:-1280x720x24} | ||
local timeout=${XVFB_TIMEOUT:-5} | ||
|
||
Xvfb "${DISPLAY}" -screen "${screen}" "${resolution}" & | ||
local loopCount=0 | ||
until xdpyinfo -display "${DISPLAY}" >/dev/null 2>&1; do | ||
loopCount=$((loopCount + 1)) | ||
sleep 1 | ||
if [ "${loopCount}" -gt "${timeout}" ]; then | ||
log_e "xvfb failed to start" | ||
exit 1 | ||
fi | ||
done | ||
} | ||
|
||
export DISPLAY=${XVFB_DISPLAY:-:1} | ||
local screen=${XVFB_SCREEN:-0} | ||
local resolution=${XVFB_RESOLUTION:-1280x720x24} | ||
local timeout=${XVFB_TIMEOUT:-5} | ||
|
||
Xvfb "${DISPLAY}" -screen "${screen}" "${resolution}" & | ||
local loopCount=0 | ||
until xdpyinfo -display "${DISPLAY}" > /dev/null 2>&1 | ||
do | ||
loopCount=$((loopCount+1)) | ||
sleep 1 | ||
if [ "${loopCount}" -gt "${timeout}" ] | ||
then | ||
log_e "xvfb failed to start" | ||
exit 1 | ||
fi | ||
done | ||
launch_pulseaudio() { | ||
pulseaudio -D --exit-idle-time=-1 & | ||
} | ||
|
||
launch_pulseaudio(){ | ||
pulseaudio -D --exit-idle-time=-1 & | ||
launch_recorder() { | ||
node main.js | ||
} | ||
|
||
log_i() { | ||
log "[INFO] ${@}" | ||
log "[INFO] ${@}" | ||
} | ||
|
||
log_e() { | ||
log "[ERROR] ${@}" | ||
log "[ERROR] ${@}" | ||
} | ||
|
||
log() { | ||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ${@}" | ||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ${@}" | ||
} | ||
|
||
main | ||
|
||
exit | ||
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters