mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
supress warnings
This commit is contained in:
parent
15146b958e
commit
a1f5544788
17 changed files with 68 additions and 35 deletions
|
@ -56,8 +56,6 @@ COPY deploy/apache/crontab /etc/cron.d/crontab
|
|||
RUN dos2unix /etc/cron.d/crontab
|
||||
RUN chmod 0644 /etc/cron.d/crontab
|
||||
RUN chmod +x /etc/cron.d/crontab
|
||||
RUN service cron start
|
||||
RUN crontab /etc/cron.d/crontab
|
||||
|
||||
# Configure AVideo
|
||||
RUN dos2unix /usr/local/bin/docker-entrypoint && \
|
||||
|
@ -87,5 +85,3 @@ EXPOSE $PHPMYADMIN_PORT
|
|||
EXPOSE $PHPMYADMIN_ENCODER_PORT
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]
|
||||
CMD ["apache2-foreground"]
|
||||
HEALTHCHECK --interval=60s --timeout=55s --start-period=1s CMD curl --fail https://localhost/ || exit 1
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# m h dom mon dow command
|
||||
1 1 * * * pip3 install --upgrade youtube-dl > /proc/1/fd/1 2>/proc/1/fd/2
|
||||
* * * * * php /var/www/html/AVideo/plugin/Scheduler/run.php > /proc/1/fd/1 2>/proc/1/fd/2
|
||||
#2 1 * * * php /var/www/html/AVideo/plugin/CDN/tools/moveMissingFiles.php > /proc/1/fd/1 2>/proc/1/fd/2
|
||||
2 1 * * * php /var/www/html/AVideo/plugin/CDN/tools/moveMissingFiles.php > /proc/1/fd/1 2>/proc/1/fd/2
|
|
@ -102,7 +102,6 @@ cd /var/www/html/AVideo/
|
|||
|
||||
echo "lets encrypt apache ${SERVER_NAME}"
|
||||
certbot --apache --non-interactive --agree-tos --register-unsafely-without-email --redirect --keep-until-expiring -d ${SERVER_NAME}
|
||||
|
||||
/etc/init.d/apache2 stop
|
||||
|
||||
echo "Start socket"
|
||||
|
@ -120,12 +119,12 @@ cd /var/www/html/AVideo/Encoder/install && php reencodeAllVideos.php
|
|||
|
||||
echo "crontab starting"
|
||||
cron
|
||||
service cron start
|
||||
crontab /etc/cron.d/crontab
|
||||
|
||||
bash
|
||||
source /etc/bash_completion
|
||||
|
||||
sleep 5
|
||||
|
||||
echo "apache2-foreground start"
|
||||
apache2-foreground
|
||||
echo "apache2-foreground done"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
user www-data;
|
||||
worker_processes 1;
|
||||
error_log logs/error.log debug;
|
||||
error_log stderr debug;
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
@ -26,10 +26,10 @@ rtmp {
|
|||
sync 500ms;
|
||||
#Experimental. Force dropped stream, or ended stream from being watched. (idle_streams)
|
||||
#idle_streams off;
|
||||
on_publish http://127.0.0.1/plugin/Live/on_publish.php;
|
||||
on_publish_done http://127.0.0.1/plugin/Live/on_publish_done.php;
|
||||
on_play http://127.0.0.1/plugin/Live/on_play.php;
|
||||
on_record_done http://127.0.0.1/plugin/Live/on_record_done.php;
|
||||
on_publish http://avideo/plugin/Live/on_publish.php;
|
||||
on_publish_done http://avideo/plugin/Live/on_publish_done.php;
|
||||
on_play http://avideo/plugin/Live/on_play.php;
|
||||
on_record_done http://avideo/plugin/Live/on_record_done.php;
|
||||
|
||||
#exec ffmpeg -re -i rtmp://localhost/live/$name -c:v libx264 -preset veryfast -c:a copy -f hls -hls_time 5 -hls_list_size 0 -f flv rtmp://localhost/adaptive/$name_hi;
|
||||
#exec ffmpeg -re -i rtmp://localhost/live/$name
|
||||
|
|
|
@ -59,8 +59,15 @@ services:
|
|||
- "./.compose/encoder:/var/www/html/AVideo/Encoder"
|
||||
- "./.compose/letsencrypt:/etc/letsencrypt/"
|
||||
depends_on:
|
||||
- database
|
||||
- database_encoder
|
||||
database:
|
||||
condition: service_healthy
|
||||
database_encoder:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl --silent --fail http://localhost || exit 1"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
networks:
|
||||
- app_net
|
||||
|
||||
|
@ -85,7 +92,15 @@ services:
|
|||
- "${NGINX_HTTP_PORT:-8080}:8080"
|
||||
- "${NGINX_HTTPS_PORT:-8443}:8443"
|
||||
depends_on:
|
||||
- avideo
|
||||
avideo:
|
||||
condition: service_healthy
|
||||
database:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl --silent --fail http://localhost:8080 || exit 1"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
networks:
|
||||
- app_net
|
||||
|
||||
|
@ -100,6 +115,11 @@ services:
|
|||
MYSQL_PASSWORD: "${DB_MYSQL_PASSWORD}"
|
||||
volumes:
|
||||
- ./.compose/db:/var/lib/mysql
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "mysqladmin ping -h localhost -u root -pexample"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
networks:
|
||||
- app_net
|
||||
|
||||
|
@ -114,6 +134,11 @@ services:
|
|||
MYSQL_PASSWORD: "${DB_MYSQL_PASSWORD}"
|
||||
volumes:
|
||||
- ./.compose/db_encoder:/var/lib/mysql
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "mysqladmin ping -h localhost -u root -pexample"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
networks:
|
||||
- app_net
|
||||
|
||||
|
|
|
@ -128,6 +128,9 @@ function setSiteLang() {
|
|||
_session_start();
|
||||
$_SESSION['language'] = $config->getLanguage();
|
||||
}
|
||||
if(empty($_SESSION['language'])){
|
||||
$_SESSION['language'] = 'en_us';
|
||||
}
|
||||
return setLanguage($_SESSION['language']);
|
||||
}
|
||||
|
||||
|
|
|
@ -3324,6 +3324,9 @@ function isGlobalTokenValid() {
|
|||
*/
|
||||
function removeQueryStringParameter($url, $varname) {
|
||||
$parsedUrl = parse_url($url);
|
||||
if(empty($parsedUrl) || empty($parsedUrl['host'])){
|
||||
return $url;
|
||||
}
|
||||
$query = [];
|
||||
|
||||
if (isset($parsedUrl['query'])) {
|
||||
|
@ -4406,7 +4409,7 @@ function postVariables($url, $array, $httpcodeOnly = true, $timeout = 10) {
|
|||
|
||||
function _session_start(array $options = []) {
|
||||
try {
|
||||
if (!_empty($_GET['PHPSESSID'])) {
|
||||
if (isset($_GET['PHPSESSID']) && !_empty($_GET['PHPSESSID'])) {
|
||||
$PHPSESSID = $_GET['PHPSESSID'];
|
||||
unset($_GET['PHPSESSID']);
|
||||
if (!User::isLogged()) {
|
||||
|
|
|
@ -61,8 +61,7 @@ session_name($global['session_name']);
|
|||
if (empty($global['logfile'])) {
|
||||
$global['logfile'] = $global['systemRootPath'] . 'videos/avideo.log';
|
||||
}
|
||||
|
||||
ini_set('error_log', $global['logfile']);
|
||||
ini_set('error_log', "exec:/usr/bin/tee {$global['logfile']} 1>&2");
|
||||
global $global, $config, $advancedCustom, $advancedCustomUser;
|
||||
|
||||
|
||||
|
|
|
@ -3250,7 +3250,7 @@ if (!class_exists('Video')) {
|
|||
$title = _substr($title, 0, 187) . '...';
|
||||
_error_log("Video::setTitle($originalTitle) Title resized {$title} ");
|
||||
}
|
||||
AVideoPlugin::onVideoSetTitle($this->id, $title, $new_title);
|
||||
AVideoPlugin::onVideoSetTitle($this->id, $originalTitle, $title);
|
||||
if (!empty($new_title)) {
|
||||
_error_log("Video::setTitle($originalTitle) Title 1 set to [" . json_encode($new_title) . "] ");
|
||||
$this->title = $new_title;
|
||||
|
@ -3797,11 +3797,13 @@ if (!class_exists('Video')) {
|
|||
* @var array $global
|
||||
* @var array $global['avideo_resolutions']
|
||||
*/
|
||||
if(!empty($global['avideo_resolutions']) && is_array($global['avideo_resolutions'])){
|
||||
foreach ($global['avideo_resolutions'] as $value) {
|
||||
$search[] = "_{$value}";
|
||||
|
||||
$search[] = "res{$value}";
|
||||
}
|
||||
}
|
||||
$cleanName = str_replace($search, '', $filename);
|
||||
if ($cleanName == $filename || preg_match('/([a-z]+_[0-9]{12}_[a-z0-9]{4})_[0-9]+/', $filename)) {
|
||||
$cleanName = preg_replace('/([a-z]+_[0-9]{12}_[a-z0-9]{4,5})_[0-9]+/', '$1', $filename);
|
||||
|
@ -5513,6 +5515,7 @@ if (!class_exists('Video')) {
|
|||
$totalPL = count($plids);
|
||||
$img .= '<div class="gallerySerieOverlay"><div class="gallerySerieOverlayTotal">' . $totalPL . '<br><i class="fas fa-list"></i></div><i class="fas fa-play"></i>' . __("Play All") . '</div>';
|
||||
}
|
||||
$galleryVideoButtons = '';
|
||||
if (!empty($program) && User::isLogged()) {
|
||||
$isFavorite = self::isFavorite($videos_id);
|
||||
$isWatchLater = self::isWatchLater($videos_id);
|
||||
|
@ -5534,7 +5537,6 @@ if (!class_exists('Video')) {
|
|||
}
|
||||
|
||||
$galleryDropDownMenu = Gallery::getVideoDropdownMenu($videos_id);
|
||||
$galleryVideoButtons = '';
|
||||
$galleryVideoButtons .= '
|
||||
<!-- getVideoImagewithHoverAnimationFromVideosId --><div class="galleryVideoButtons ' . getCSSAnimationClassAndStyle('animate__flipInY', uniqid(), 0) . '">
|
||||
<button onclick="addVideoToPlayList(' . $videos_id . ', false, ' . $watchLaterId . ');return false;" class="btn btn-dark btn-xs watchLaterBtnAdded watchLaterBtnAdded' . $videos_id . '" data-toggle="tooltip" data-placement="left" title=' . printJSString("Added On Watch Later", true) . ' style="color: #4285f4;' . $watchLaterBtnAddedStyle . '" ><i class="fas fa-check"></i></button>
|
||||
|
|
|
@ -539,7 +539,7 @@ class FtpClient implements Countable
|
|||
* @param bool $recursive true by default
|
||||
* @return int
|
||||
*/
|
||||
public function count($directory = '.', $type = null, $recursive = true)
|
||||
public function count($directory = '.', $type = null, $recursive = true): int
|
||||
{
|
||||
$items = (null === $type ? $this->nlist($directory, $recursive)
|
||||
: $this->scanDir($directory, $recursive));
|
||||
|
|
|
@ -291,6 +291,7 @@ class LiveTransmition extends ObjectYPT
|
|||
if (!empty($row)) {
|
||||
$row['live_schedule_id'] = 0;
|
||||
$row['scheduled'] = 0;
|
||||
$row['users_id'] = 0;
|
||||
}
|
||||
if (!empty($row)) {
|
||||
$p = $row['live_password'];
|
||||
|
|
|
@ -415,7 +415,7 @@ class Live_schedule extends ObjectYPT
|
|||
$res = sqlDAL::readSql($sql);
|
||||
$data = sqlDAL::fetchAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
if ($res) {
|
||||
if (!empty($data)) {
|
||||
$row = $data;
|
||||
$row = cleanUpRowFromDatabase($row);
|
||||
$row['scheduled_password'] = $data['scheduled_password'];
|
||||
|
|
|
@ -125,8 +125,8 @@ if (!empty($_GET['p'])) {
|
|||
if (!empty($obj->row)) {
|
||||
_error_log("NGINX ON Publish new User({$obj->row['users_id']})");
|
||||
$user = new User($obj->row['users_id']);
|
||||
if (!$user->thisUserCanStream()) {
|
||||
_error_log("NGINX ON Publish User [{$obj->row['users_id']}] can not stream");
|
||||
if (!$user->thisUserCanStream() && !User::isAdmin($obj->row['users_id'])) {
|
||||
_error_log("NGINX ON Publish User [{$obj->row['users_id']}] can not stream ".User::getLastUserCanStreamReason());
|
||||
} elseif (!empty($_GET['p']) && $_GET['p'] === $user->getPassword()) {
|
||||
_error_log("NGINX ON Publish get LiveTransmitionHistory");
|
||||
$lth = new LiveTransmitionHistory();
|
||||
|
|
|
@ -4,7 +4,12 @@ $obj = AVideoPlugin::getDataObject("Live");
|
|||
$buttonTitle = $this->getButtonTitle();
|
||||
$obj = $this->getDataObject();
|
||||
$isLive = isLive();
|
||||
if(empty($isLive)){
|
||||
$liveInfo = array();
|
||||
$liveInfo['isLive'] = false;
|
||||
}else{
|
||||
$liveInfo = Live::getInfo($isLive['key'], $isLive['live_servers_id']);
|
||||
}
|
||||
if (User::canStream()) {
|
||||
if (empty($obj->doNotShowGoLiveButton)) {
|
||||
?>
|
||||
|
|
|
@ -257,7 +257,7 @@ $(\'#inputTags' . $tagTypesId . '\').tagsinput({
|
|||
$subscribedText = $tag->getName();
|
||||
$users_id = User::getId();
|
||||
$encryptedIdAndUser = encryptString(array('tags_id'=>$tags_id, 'users_id'=> $users_id));
|
||||
|
||||
$subscribed = '';
|
||||
if (User::isLogged()) {
|
||||
$btnFile = $global['systemRootPath'] . 'plugin/VideoTags/subscribeBtn.html';
|
||||
$email = User::getMail();
|
||||
|
|
|
@ -58,7 +58,7 @@ if (empty($config)) {
|
|||
TimeLogEnd($timeLogHead, __LINE__);
|
||||
//$content = _ob_get_clean();
|
||||
_ob_start();
|
||||
echo $content;
|
||||
//echo $content;
|
||||
|
||||
$keywords = strip_tags($advancedCustom->keywords);
|
||||
$head_videos_id = getVideos_id();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
global $socialAdded, $global;
|
||||
$titleSocial = @$title;
|
||||
$urlShort = $url;
|
||||
$urlShort = @$url;
|
||||
if (empty($video['id']) && !empty(getVideos_id())) {
|
||||
$video['id'] = getVideos_id();
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ if (empty($socialAdded)) { // do not add the CSS more then once
|
|||
$socialAdded = 1;
|
||||
|
||||
$social_medias = [
|
||||
new SocialMedias($href, $class, $title, $iclass, $img, $onclick),
|
||||
new SocialMedias(@$href, @$class, @$title, @$iclass, @$img, @$onclick),
|
||||
];
|
||||
?>
|
||||
<ul class="social-network social-circle">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue