Compare commits

...

28 Commits

Author SHA1 Message Date
Henry Whitaker
5fd47d7494 Merge pull request #1124 from henrywhitaker3/fix/1119 2023-06-25 05:52:14 +01:00
Henry Whitaker
724a9f1bc5 update arm dockerfile 2023-06-25 05:49:21 +01:00
Henry Whitaker
f18f250dcc update php version in actions 2023-06-25 05:34:55 +01:00
Henry Whitaker
ea79ce4fb5 fix nginx conf and arm loc 2023-06-25 05:28:06 +01:00
Henry Whitaker
544a8ada31 bump version 2023-06-25 04:58:42 +01:00
Henry Whitaker
35a72132d8 updated to run on php8 2023-06-25 04:55:47 +01:00
Henry Whitaker
ba8fc9ec4c bump to php 8 2023-06-25 04:13:37 +01:00
Henry Whitaker
3955a2dad0 Merge pull request #705 from henrywhitaker3/fix/failure-graph
Fix bug where failure graph would not update
2021-09-11 09:31:06 +01:00
Henry Whitaker
6905a5aac0 Fix bug where failure graph would not update 2021-09-11 09:29:21 +01:00
Henry Whitaker
b3ba6a8b06 Merge remote-tracking branch 'origin/dev' into dev 2021-09-10 20:18:22 +01:00
Henry Whitaker
1e1a2c9b69 Use uname for arch download instead of env
from #683
2021-09-10 20:18:14 +01:00
Henry Whitaker
1c00beed86 Merge pull request #704 from henrywhitaker3/alpha
Docker image build step
2021-09-10 20:04:17 +01:00
Henry Whitaker
603f618720 Add for master also 2021-09-10 20:03:12 +01:00
Henry Whitaker
fa41bdd40d Move to dev 2021-09-10 20:01:30 +01:00
Henry Whitaker
9d2f1858a0 Fix the things 2021-09-10 19:53:36 +01:00
Henry Whitaker
6c6a12bb5f ugh 2021-09-10 19:51:34 +01:00
Henry Whitaker
5885824c54 Fix secret name 2021-09-10 19:49:26 +01:00
Henry Whitaker
ea78415157 Fix branch selector 2021-09-10 19:47:32 +01:00
Henry Whitaker
efecd28afb Add build step to workflow 2021-09-10 19:47:08 +01:00
Henry Whitaker
8d32d06768 Merge remote-tracking branch 'origin/master' into alpha 2021-09-10 19:26:31 +01:00
Henry Whitaker
8cb2e8a323 Merge pull request #591 from henrywhitaker3/dependabot/add-v2-config-file
Upgrade to GitHub-native Dependabot
2021-09-10 19:25:50 +01:00
Henry Whitaker
58e82dc9a8 Actually pass days to the action 2021-09-10 18:58:02 +01:00
Henry Whitaker
0dff534dfd Also do the arm dockerfile 2021-09-10 18:54:46 +01:00
Henry Whitaker
fba69514b2 undo dumb thing 2021-09-10 18:50:40 +01:00
Henry Whitaker
1fcaa795cd Chmod +x the artsan file 2021-09-10 18:48:36 +01:00
Henry Whitaker
370c73e1a5 Merge pull request #671 from henrywhitaker3/dev 2021-08-28 18:33:10 +01:00
dependabot-preview[bot]
f6bb77ce71 Upgrade to GitHub-native Dependabot 2021-04-28 22:18:14 +00:00
Henry Whitaker
2ed811e949 Merge pull request #520 from henrywhitaker3/dev 2021-03-07 11:03:27 +00:00
22 changed files with 2817 additions and 1640 deletions

79
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,79 @@
version: 2
updates:
- package-ecosystem: composer
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
target-branch: dev
ignore:
- dependency-name: laravel/framework
versions:
- 7.30.3
- 8.36.2
- 8.37.0
- 8.38.0
- dependency-name: doctrine/dbal
versions:
- 2.13.0
- 3.0.0
- dependency-name: phpunit/phpunit
versions:
- 9.5.1
- 9.5.3
- dependency-name: facade/ignition
versions:
- 2.5.10
- 2.5.11
- 2.5.12
- 2.5.13
- 2.5.9
- dependency-name: laravel/tinker
versions:
- 2.6.0
- dependency-name: nunomaduro/collision
versions:
- 5.3.0
- dependency-name: nunomaduro/larastan
versions:
- 0.6.13
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
target-branch: dev
ignore:
- dependency-name: chart.js
versions:
- 3.1.0
- 3.1.1
- dependency-name: laravel-mix
versions:
- 6.0.16
- dependency-name: y18n
versions:
- 4.0.1
- 4.0.2
- dependency-name: react-dom
versions:
- 17.0.2
- dependency-name: react
versions:
- 17.0.2
- dependency-name: react-bootstrap
versions:
- 1.4.3
- 1.5.0
- dependency-name: sass
versions:
- 1.32.5
- 1.32.6
- 1.32.7
- dependency-name: "@babel/plugin-proposal-class-properties"
versions:
- 7.12.13
- dependency-name: react-toastify
versions:
- 7.0.1
- 7.0.2

View File

@@ -1,59 +1,29 @@
name: Dev
name: Build Dev Image
on:
push:
branches: [ dev ]
jobs:
laravel-tests:
build:
runs-on: ubuntu-latest
steps:
- uses: shivammathur/setup-php@b7d1d9c9a92d8d8463ce36d7f60da34d461724f8
with:
php-version: '7.4'
- uses: actions/checkout@v2
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Update .env with secrets
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
HEALTHCHECKS_UUID: ${{ secrets.HEALTHCHECKS_UUID }}
run: |
echo SLACK_WEBHOOK=$SLACK_WEBHOOK >> .env
echo TELEGRAM_BOT_TOKEN=$TELEGRAM_BOT_TOKEN >> .env
echo TELEGRAM_CHAT_ID=$TELEGRAM_CHAT_ID >> .env
echo HEALTHCHECKS_UUID=$HEALTHCHECKS_UUID >> .env
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Create Database
run: |
mkdir -p database
touch database/database.sqlite
- name: Generate key
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: php artisan key:generate
- name: Generate JWT key
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: php artisan jwt:secret
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: Download Speedtest binary
run: wget https://install.speedtest.net/app/cli/ookla-speedtest-1.0.0-x86_64-linux.tgz -O speedtest.tgz && tar zxvf speedtest.tgz && mv speedtest app/Bin/
- name: Accept EULA
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: php artisan speedtest:eula
- name: Execute tests (Unit and Feature tests) via PHPUnit
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: vendor/bin/phpunit
- name: Checkout
uses: actions/checkout@v2
- name: Docker Setup Buildx
uses: docker/setup-buildx-action@v1.2.0
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./docker/Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: henrywhitaker3/speedtest-tracker:dev,henrywhitaker3/speedtest-tracker:dev-arm

29
.github/workflows/laravel-master.yml vendored Normal file
View File

@@ -0,0 +1,29 @@
name: Build Latest Image
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker Setup Buildx
uses: docker/setup-buildx-action@v1.2.0
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./docker/Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: henrywhitaker3/speedtest-tracker:latest,henrywhitaker3/speedtest-tracker:latest-arm

View File

@@ -12,7 +12,7 @@ jobs:
steps:
- uses: shivammathur/setup-php@b7d1d9c9a92d8d8463ce36d7f60da34d461724f8
with:
php-version: '7.4'
php-version: '8.2'
- uses: actions/checkout@v2
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
@@ -46,7 +46,7 @@ jobs:
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: Download Speedtest binary
run: wget https://install.speedtest.net/app/cli/ookla-speedtest-1.0.0-x86_64-linux.tgz -O speedtest.tgz && tar zxvf speedtest.tgz && mv speedtest app/Bin/
run: wget https://install.speedtest.net/app/cli/ookla-speedtest-1.2.0-linux-x86_64.tgz -O speedtest.tgz && tar zxvf speedtest.tgz && mv speedtest app/Bin/
- name: Accept EULA
env:
DB_CONNECTION: sqlite

View File

@@ -1,59 +0,0 @@
name: Stable
on:
push:
branches: [ master ]
jobs:
laravel-tests:
runs-on: ubuntu-latest
steps:
- uses: shivammathur/setup-php@b7d1d9c9a92d8d8463ce36d7f60da34d461724f8
with:
php-version: '7.4'
- uses: actions/checkout@v2
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Update .env with secrets
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
HEALTHCHECKS_UUID: ${{ secrets.HEALTHCHECKS_UUID }}
run: |
echo SLACK_WEBHOOK=$SLACK_WEBHOOK >> .env
echo TELEGRAM_BOT_TOKEN=$TELEGRAM_BOT_TOKEN >> .env
echo TELEGRAM_CHAT_ID=$TELEGRAM_CHAT_ID >> .env
echo HEALTHCHECKS_UUID=$HEALTHCHECKS_UUID >> .env
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Create Database
run: |
mkdir -p database
touch database/database.sqlite
- name: Generate key
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: php artisan key:generate
- name: Generate JWT key
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: php artisan jwt:secret
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: Download Speedtest binary
run: wget https://install.speedtest.net/app/cli/ookla-speedtest-1.0.0-x86_64-linux.tgz -O speedtest.tgz && tar zxvf speedtest.tgz && mv speedtest app/Bin/
- name: Accept EULA
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: php artisan speedtest:eula
- name: Execute tests (Unit and Feature tests) via PHPUnit
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: vendor/bin/phpunit

View File

@@ -1,6 +1,6 @@
# Speedtest Tracker
[![Docker pulls](https://img.shields.io/docker/pulls/henrywhitaker3/speedtest-tracker?style=flat-square)](https://hub.docker.com/r/henrywhitaker3/speedtest-tracker) [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/henrywhitaker3/Speedtest-Tracker/Stable?label=master&logo=github&style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/actions) [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/henrywhitaker3/Speedtest-Tracker/Dev?label=dev&logo=github&style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/actions) [![last_commit](https://img.shields.io/github/last-commit/henrywhitaker3/Speedtest-Tracker?style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/commits) [![issues](https://img.shields.io/github/issues/henrywhitaker3/Speedtest-Tracker?style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/issues) [![commit_freq](https://img.shields.io/github/commit-activity/m/henrywhitaker3/Speedtest-Tracker?style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/commits) ![version](https://img.shields.io/badge/version-v1.12.1-success?style=flat-square) [![license](https://img.shields.io/github/license/henrywhitaker3/Speedtest-Tracker?style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/blob/master/LICENSE)
[![Docker pulls](https://img.shields.io/docker/pulls/henrywhitaker3/speedtest-tracker?style=flat-square)](https://hub.docker.com/r/henrywhitaker3/speedtest-tracker) [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/henrywhitaker3/Speedtest-Tracker/Stable?label=master&logo=github&style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/actions) [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/henrywhitaker3/Speedtest-Tracker/Dev?label=dev&logo=github&style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/actions) [![last_commit](https://img.shields.io/github/last-commit/henrywhitaker3/Speedtest-Tracker?style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/commits) [![issues](https://img.shields.io/github/issues/henrywhitaker3/Speedtest-Tracker?style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/issues) [![commit_freq](https://img.shields.io/github/commit-activity/m/henrywhitaker3/Speedtest-Tracker?style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/commits) ![version](https://img.shields.io/badge/version-v1.12.2-success?style=flat-square) [![license](https://img.shields.io/github/license/henrywhitaker3/Speedtest-Tracker?style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/blob/master/LICENSE)
This program runs a speedtest check every hour and graphs the results. The back-end is written in [Laravel](https://laravel.com/) and the front-end uses [React](https://reactjs.org/). It uses the [Ookla's speedtest cli](https://www.speedtest.net/apps/cli) package to get the data and uses [Chart.js](https://www.chartjs.org/) to plot the results.

15
Taskfile.yaml Normal file
View File

@@ -0,0 +1,15 @@
version: "3"
vars:
RTAG:
sh: head -n 25 /dev/random | md5sum | head -c 8
tasks:
build:
cmds:
- docker build . -f docker/Dockerfile --tag henrywhitaker3/speedtest-tracker:{{ .RTAG }}
run:
deps: [build]
cmds:
- docker run --rm -p 8765:80 -e OOKLA_EULA_GDPR=true henrywhitaker3/speedtest-tracker:{{ .RTAG }}

View File

@@ -30,6 +30,6 @@ class QueueSpeedtest implements ActionInterface
{
SettingsHelper::loadIntegrationConfig();
SpeedtestJob::dispatch(false, config('integrations'), $this->speedtestProvider);
SpeedtestJob::dispatch($this->speedtestProvider, false, config('integrations'));
}
}

View File

@@ -27,8 +27,8 @@ class HomepageDataController extends Controller
return [
'latest' => run(GetLatestSpeedtestData::class),
'time' => run(GetSpeedtestTimeData::class),
'fail' => run(GetFailedSpeedtestData::class),
'time' => run(GetSpeedtestTimeData::class, $days),
'fail' => run(GetFailedSpeedtestData::class, $days),
'config' => SettingsHelper::getConfig(),
];
}

View File

@@ -43,7 +43,7 @@ class SpeedtestJob implements ShouldQueue
*
* @return void
*/
public function __construct($scheduled = true, $config = [], SpeedtestProvider $speedtestProvider)
public function __construct(SpeedtestProvider $speedtestProvider, $scheduled = true, $config = [])
{
$this->scheduled = $scheduled;
$this->config = $config;

View File

@@ -1,4 +1,20 @@
{
"1.12.3": [
{
"description": "Updated to PHP 8.2",
"link": ""
},
{
"description": "Updated speedtest cli to 1.2.0 (#1119)",
"link": "https://github.com/henrywhitaker3/Speedtest-Tracker/issues/1119"
}
],
"1.12.2": [
{
"description": "Fixed a bug where the latest X days widget would not update for the failure graph",
"link": ""
}
],
"1.12.1": [
{
"description": "Fixed a bug where the latest X days widget would not update (#680)",

View File

@@ -8,7 +8,7 @@
],
"license": "MIT",
"require": {
"php": "^7.2.5",
"php": "^8",
"doctrine/dbal": "^2.10",
"dragonmantank/cron-expression": "^3",
"fideloper/proxy": "^4.2",

4103
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -62,7 +62,7 @@ return [
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\User::class,
'model' => App\Models\User::class,
],
// 'users' => [

View File

@@ -7,7 +7,7 @@ return [
|--------------------------------------------------------------------------
*/
'version' => '1.12.1',
'version' => '1.12.3',
/*
|--------------------------------------------------------------------------

View File

@@ -3,6 +3,8 @@ LABEL maintainer=henrywhitaker3@outlook.com
ENV arch='x86_64'
RUN apk add php82-tokenizer
COPY docker/conf/ /
COPY . /site

View File

@@ -3,7 +3,10 @@ LABEL maintainer=henrywhitaker3@outlook.com
ENV arch='arm'
COPY conf/ /
RUN apk add php82-tokenizer
COPY docker/conf/ /
COPY . /site
EXPOSE 80 443

View File

@@ -11,6 +11,18 @@ function eulaError()
exit 1
}
function downloadSpeedtestCli()
{
if [ $(uname -m) == "x86_64" ]; then
wget https://install.speedtest.net/app/cli/ookla-speedtest-1.2.0-linux-x86_64.tgz -O speedtest.tgz > /dev/null
else
wget https://install.speedtest.net/app/cli/ookla-speedtest-1.2.0-linux-aarch64.tgz -O speedtest.tgz > /dev/null
fi
tar zxvf speedtest.tgz > /dev/null
cp speedtest /site/app/Bin/
}
# Do Ookla stuff
if [ -z ${OOKLA_EULA_GDPR+x} ]; then
eulaError
@@ -22,18 +34,28 @@ else
if [ ! -f /config/www/app/Bin/speedtest ]; then
echo "Ookla GDPR and EULA accepted. Downloading Speedtest CLI."
cd /tmp
wget https://install.speedtest.net/app/cli/ookla-speedtest-1.0.0-$arch-linux.tgz -O speedtest.tgz > /dev/null
tar zxvf speedtest.tgz > /dev/null
cp speedtest /site/app/Bin/
HOME=/config && s6-setuidgid abc /site/artisan speedtest:eula > /dev/null
downloadSpeedtestCli
chmod +x /site/artisan
HOME=/config && s6-setuidgid abc /site/app/Bin/speedtest --accept-license --accept-gdpr > /dev/null
HOME=/root
else
HOME=/config && s6-setuidgid abc /config/www/artisan speedtest:eula > /dev/null
/config/www/app/Bin/speedtest --version | grep -E "1\.2\.0"
rc=$?
if [ $rc -ne 0 ]; then
downloadSpeedtestCli
fi
HOME=/config && s6-setuidgid abc /site/app/Bin/speedtest --accept-license --accept-gdpr > /dev/null
HOME=/root
fi
fi
# Copy latest nginx config
cp /defaults/nginx/nginx.conf.sample /config/nginx/nginx.conf
# Copy site files to /config
echo "Copying latest site files to config"
cp -rfT /site/ /config/www/
@@ -62,19 +84,19 @@ fi
echo 'Updating packages'
apk add composer
cd /config/www && composer install && echo date > /config/www/.composer-time
cd /config/www && php82 /usr/bin/composer.phar install && echo date > /config/www/.composer-time
sed "s,DB_DATABASE=.*,DB_DATABASE=/config/speed.db," -i.bak /config/www/.env
echo "Running database migrations"
php /config/www/artisan migrate
php82 /config/www/artisan migrate
# Check app key exists
if grep -E "APP_KEY=[0-9A-Za-z:+\/=]{1,}" /config/www/.env > /dev/null; then
echo "App key exists"
else
echo "Generating app key"
php /config/www/artisan key:generate
php82 /config/www/artisan key:generate
fi
# Check JWT secret exists
@@ -82,7 +104,7 @@ if grep -E "JWT_SECRET=[0-9A-Za-z:+\/=]{1,}" /config/www/.env > /dev/null ; then
echo "JWT secret exists"
else
echo "Generating JWT secret"
php /config/www/artisan jwt:secret
php82 /config/www/artisan jwt:secret
fi
if [ -z ${SLACK_WEBHOOK+x} ]; then
@@ -91,7 +113,7 @@ if [ -z ${SLACK_WEBHOOK+x} ]; then
else
echo "Slack webhook set, updating db"
sed "s,SLACK_WEBHOOK=.*,SLACK_WEBHOOK=$SLACK_WEBHOOK," -i.bak /config/www/.env
php /config/www/artisan speedtest:slack $SLACK_WEBHOOK
php82 /config/www/artisan speedtest:slack $SLACK_WEBHOOK
fi
if [ -z ${TELEGRAM_BOT_TOKEN+x} ] && [ -z ${TELEGRAM_CHAT_ID+x} ]; then
@@ -102,7 +124,7 @@ else
echo "Telegram chat id and bot token set, updating .env"
sed "s,TELEGRAM_BOT_TOKEN=.*,TELEGRAM_BOT_TOKEN=$TELEGRAM_BOT_TOKEN," -i.bak /config/www/.env
sed "s,TELEGRAM_CHAT_ID=.*,TELEGRAM_CHAT_ID=$TELEGRAM_CHAT_ID," -i.bak /config/www/.env
php /config/www/artisan speedtest:telegram --chat=$TELEGRAM_CHAT_ID --bot=$TELEGRAM_BOT_TOKEN
php82 /config/www/artisan speedtest:telegram --chat=$TELEGRAM_CHAT_ID --bot=$TELEGRAM_BOT_TOKEN
fi
if [ -z ${BASE_PATH+x} ]; then
@@ -115,19 +137,19 @@ fi
if [ -z ${AUTH+x} ]; then
echo "AUTH variable not set. Disabling authentication"
php /config/www/artisan speedtest:auth --disable
php82 /config/www/artisan speedtest:auth --disable
else
if [ $AUTH == 'true' ]; then
echo "AUTH variable set. Enabling authentication"
php /config/www/artisan speedtest:auth --enable
php82 /config/www/artisan speedtest:auth --enable
else
echo "AUTH variable set, but not to 'true'. Disabling authentication"
php /config/www/artisan speedtest:auth --disable
php82 /config/www/artisan speedtest:auth --disable
fi
fi
echo "Clearing old jobs from queue"
php /config/www/artisan queue:clear
php82 /config/www/artisan queue:clear
mkdir -p /config/log/speedtest

View File

@@ -1,3 +1,3 @@
#!/usr/bin/with-contenv bash
exec s6-setuidgid abc php /config/www/artisan queue:work --timeout=120 >> /config/log/speedtest/queue.log
exec s6-setuidgid abc php82 /config/www/artisan queue:work --timeout=120 >> /config/log/speedtest/queue.log

View File

@@ -1,6 +1,7 @@
<?php
use App\Helpers\SettingsHelper;
use GuzzleHttp\Psr7\MimeType;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Response;
use Illuminate\Support\Facades\Route;
@@ -21,7 +22,7 @@ Route::get(SettingsHelper::getBase() . 'files/{path?}', function ($file) {
$fileP = public_path() . '/' . $fileP;
if (file_exists($fileP)) {
$contents = File::get($fileP);
$mime = \GuzzleHttp\Psr7\mimetype_from_filename($fileP);
$mime = MimeType::fromFilename($fileP);
return Response::make(File::get($fileP), 200, ['Content-type' => $mime]);
} else {
abort(404);