Skip to content

Commit

Permalink
minor update fix problem stream key length,
Browse files Browse the repository at this point in the history
  • Loading branch information
sandyh90 committed Jul 8, 2022
1 parent 0f42d57 commit b5c9d02
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 7 deletions.
2 changes: 1 addition & 1 deletion rockstream_stream_repeater/web/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ CACHE_DRIVER=database
FILESYSTEM_DRIVER=local
QUEUE_CONNECTION=database
SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_LIFETIME=120
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;

use App\Component\NginxConfigGen;

class FactoryResetAppCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'rockstream:reset-app';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Reset the application';

/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$this->info('Resetting the application...');
sleep(3);
$this->info('Dropping all tables...');
$this->call('migrate:fresh');
sleep(3);
$this->info('Clearing optimize...');
$this->call('optimize:clear');
sleep(3);
$this->info('Resetting nginx configuration...');
# Regenerate Nginx config
try {
NginxConfigGen::GenerateBaseConfig();
} catch (\Exception $e) {
return $this->error('Stream input Nginx config cannot be generated, Error: ' . $e->getMessage());
}
sleep(3);
$this->info('Application has been reset successfully.');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ public function add_output_dest(Request $request)
$validator = Validator::make(
$request->all(),
[
'name_output_dest' => 'required|string|max:100',
'name_output_dest' => 'required|string|max:255',
'platform_output_dest' => [
'required',
Rule::in(array_column(ServicesCore::getServices(), 'id'))
],
'select_endpoint_server' => $request->filled('rtmp_output_server') ? 'prohibited|nullable|string|max:255|starts_with:rtmp://,rtmps://' : 'required|string|max:255|starts_with:rtmp://,rtmps://',
'rtmp_output_server' => $request->filled('select_endpoint_server') ? 'prohibited|nullable|string|max:255|starts_with:rtmp://,rtmps://' : 'required|string|max:255|starts_with:rtmp://,rtmps://',
'rtmp_stream_key' => empty($check_stream->ingest_destination_data()->first()->key_stream_dest) ? 'required|string|max:255' : ($check_stream->ingest_destination_data()->first()->key_stream_dest != $request->rtmp_stream_key ? 'required|string|max:255' : 'required|unique:stream_ingest_dest,key_stream_dest|string|max:255'),
'rtmp_stream_key' => empty($check_stream->ingest_destination_data()->first()->key_stream_dest) ? 'required|string|max:355' : ($check_stream->ingest_destination_data()->first()->key_stream_dest != $request->rtmp_stream_key ? 'required|string|max:355' : 'required|unique:stream_ingest_dest,key_stream_dest|string|max:355'),
'status_output_dest' => 'required|boolean'
]
);
Expand Down Expand Up @@ -241,14 +241,14 @@ public function edit_output_dest(Request $request)
$validator = Validator::make(
$request->all(),
[
'name_output_dest' => 'required|string|max:100',
'name_output_dest' => 'required|string|max:255',
'platform_output_dest' => [
'required',
Rule::in(array_column(ServicesCore::getServices(), 'id'))
],
'select_endpoint_server' => $request->filled('rtmp_output_server') ? 'prohibited|nullable|string|max:255|starts_with:rtmp://,rtmps://' : 'required|string|max:255|starts_with:rtmp://,rtmps://',
'rtmp_output_server' => $request->filled('select_endpoint_server') ? 'prohibited|nullable|string|max:255|starts_with:rtmp://,rtmps://' : 'required|string|max:255|starts_with:rtmp://,rtmps://',
'rtmp_stream_key' => $check_stream->key_stream_dest == $request->rtmp_stream_key ? 'required|string|max:255' : 'required|unique:stream_ingest_dest,key_stream_dest|string|max:255',
'rtmp_stream_key' => $check_stream->key_stream_dest == $request->rtmp_stream_key ? 'required|string|max:355' : 'required|unique:stream_ingest_dest,key_stream_dest|string|max:355',
'status_output_dest' => 'required|boolean'
]
);
Expand Down
2 changes: 1 addition & 1 deletion rockstream_stream_repeater/web/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified rockstream_stream_repeater/web/database/database.sqlite
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function up()
$table->string('name_stream_dest');
$table->string('platform_dest');
$table->string('url_stream_dest');
$table->string('key_stream_dest');
$table->string('key_stream_dest', 355);
$table->boolean('active_stream_dest');
$table->timestamps();
});
Expand Down

0 comments on commit b5c9d02

Please sign in to comment.