diff --git a/.idea/LogViewer.iml b/.idea/LogViewer.iml
index d68bbb1..9261949 100755
--- a/.idea/LogViewer.iml
+++ b/.idea/LogViewer.iml
@@ -9,6 +9,10 @@
+
+
+
+
diff --git a/.idea/php.xml b/.idea/php.xml
index 5773c7c..04f8a62 100755
--- a/.idea/php.xml
+++ b/.idea/php.xml
@@ -229,19 +229,13 @@
-
-
-
-
-
-
@@ -255,7 +249,6 @@
-
@@ -318,13 +311,8 @@
-
-
-
-
-
diff --git a/.idea/phpunit.xml b/.idea/phpunit.xml
index 88cb904..395c5cb 100755
--- a/.idea/phpunit.xml
+++ b/.idea/phpunit.xml
@@ -5,6 +5,7 @@
+
diff --git a/Dockerfile b/Dockerfile
index b97df81..de4ab5f 100755
--- a/Dockerfile
+++ b/Dockerfile
@@ -23,7 +23,7 @@ COPY code/ /var/www
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
-COPY docker/php/php-prod.ini /usr/local/etc/php/
+COPY docker/php/php-prod.ini /usr/local/etc/php/conf.d
COPY start.sh /home/start.sh
diff --git a/DockerfileDevel b/DockerfileDevel
index 469865f..087d35b 100755
--- a/DockerfileDevel
+++ b/DockerfileDevel
@@ -24,10 +24,13 @@ COPY code/ /var/www
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Configure Xdebug
-RUN pecl install xdebug
-RUN docker-php-ext-enable xdebug
-COPY docker/php/php.ini /usr/local/etc/php/
-COPY docker/php/xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
+#RUN pecl install xdebug
+#RUN docker-php-ext-enable xdebug
+#COPY docker/php/php.ini /usr/local/etc/php/
+
+COPY docker/php/php-prod.ini /usr/local/etc/php/conf.d/
+
+#COPY docker/php/xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
COPY start.sh /home/start.sh
diff --git a/code/app/Http/Controllers/FileController.php b/code/app/Http/Controllers/FileController.php
index c2fb52a..901704d 100644
--- a/code/app/Http/Controllers/FileController.php
+++ b/code/app/Http/Controllers/FileController.php
@@ -1,6 +1,5 @@
all(), [
- 'file' => 'required|mimes:log|max:10240',
+ 'file' => 'required|mimes:txt,log|max:10240',
]);
if ($validator->fails()) {
-
return response()->json(['error' => $validator->errors()], 401);
}
+ $user_id = $request->get('user_id');
if ($file = $request->file('file')) {
- $path = $file->store('public/files');
- $name = $file->getClientOriginalName();
-
- //store your file into directory and db
- $save = new File();
- $save->name = $file;
- $save->store_path = $path;
- $save->save();
-
+ $fileName = (!empty($user_id) ? $user_id : 0) . '_' . time() . '.log';
+ $request->file->move(storage_path(date('Y-m-d')), $fileName);
return response()->json([
"success" => true,
"message" => "File successfully uploaded",
diff --git a/code/app/Http/Kernel.php b/code/app/Http/Kernel.php
index 03c3928..1a336fc 100755
--- a/code/app/Http/Kernel.php
+++ b/code/app/Http/Kernel.php
@@ -15,11 +15,11 @@ class Kernel extends HttpKernel
*/
protected $middleware = [
// \App\Http\Middleware\TrustHosts::class,
- \Fruitcake\Cors\HandleCors::class,
- \App\Http\Middleware\PreventRequestsDuringMaintenance::class,
- \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
- \App\Http\Middleware\TrimStrings::class,
- \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
+ // \Fruitcake\Cors\HandleCors::class,
+// \App\Http\Middleware\PreventRequestsDuringMaintenance::class,
+// \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
+// \App\Http\Middleware\TrimStrings::class,
+// \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
];
/**
diff --git a/code/app/Providers/AppServiceProvider.php b/code/app/Providers/AppServiceProvider.php
index a338a36..1c94534 100755
--- a/code/app/Providers/AppServiceProvider.php
+++ b/code/app/Providers/AppServiceProvider.php
@@ -26,11 +26,18 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{
+ if(config('app.env') === 'production') {
+ \URL::forceScheme('https');
+ }else {
+ \URL::forceScheme('https');
+ }
+
/*
LogViewer::auth(function ($request) {
return $request->user()
&& $request->user()->email == 'splin94@yandex.ru';
});
*/
+
}
}
diff --git a/code/storage/database.sqlite b/code/storage/database.sqlite
index 0153cbc..da13516 100755
Binary files a/code/storage/database.sqlite and b/code/storage/database.sqlite differ
diff --git a/docker/nginx/nginx.conf b/docker/nginx/nginx.conf
index 3d8f0a6..cc29415 100755
--- a/docker/nginx/nginx.conf
+++ b/docker/nginx/nginx.conf
@@ -12,6 +12,7 @@ events {
http {
+ client_max_body_size 50M;
include /etc/nginx/mime.types;
default_type application/octet-stream;