mirror of
https://github.com/henrywhitaker3/Speedtest-Tracker.git
synced 2025-12-21 21:33:08 +01:00
Compare commits
7 Commits
dependabot
...
v1.12.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5fd47d7494 | ||
|
|
724a9f1bc5 | ||
|
|
f18f250dcc | ||
|
|
ea79ce4fb5 | ||
|
|
544a8ada31 | ||
|
|
35a72132d8 | ||
|
|
ba8fc9ec4c |
4
.github/workflows/laravel-pr.yml
vendored
4
.github/workflows/laravel-pr.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: shivammathur/setup-php@b7d1d9c9a92d8d8463ce36d7f60da34d461724f8
|
- uses: shivammathur/setup-php@b7d1d9c9a92d8d8463ce36d7f60da34d461724f8
|
||||||
with:
|
with:
|
||||||
php-version: '7.4'
|
php-version: '8.2'
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Copy .env
|
- name: Copy .env
|
||||||
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
|
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
|
||||||
@@ -46,7 +46,7 @@ jobs:
|
|||||||
- name: Directory Permissions
|
- name: Directory Permissions
|
||||||
run: chmod -R 777 storage bootstrap/cache
|
run: chmod -R 777 storage bootstrap/cache
|
||||||
- name: Download Speedtest binary
|
- 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
|
- name: Accept EULA
|
||||||
env:
|
env:
|
||||||
DB_CONNECTION: sqlite
|
DB_CONNECTION: sqlite
|
||||||
|
|||||||
15
Taskfile.yaml
Normal file
15
Taskfile.yaml
Normal 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 }}
|
||||||
@@ -30,6 +30,6 @@ class QueueSpeedtest implements ActionInterface
|
|||||||
{
|
{
|
||||||
SettingsHelper::loadIntegrationConfig();
|
SettingsHelper::loadIntegrationConfig();
|
||||||
|
|
||||||
SpeedtestJob::dispatch(false, config('integrations'), $this->speedtestProvider);
|
SpeedtestJob::dispatch($this->speedtestProvider, false, config('integrations'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class SpeedtestJob implements ShouldQueue
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct($scheduled = true, $config = [], SpeedtestProvider $speedtestProvider)
|
public function __construct(SpeedtestProvider $speedtestProvider, $scheduled = true, $config = [])
|
||||||
{
|
{
|
||||||
$this->scheduled = $scheduled;
|
$this->scheduled = $scheduled;
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
|
|||||||
@@ -1,4 +1,14 @@
|
|||||||
{
|
{
|
||||||
|
"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": [
|
"1.12.2": [
|
||||||
{
|
{
|
||||||
"description": "Fixed a bug where the latest X days widget would not update for the failure graph",
|
"description": "Fixed a bug where the latest X days widget would not update for the failure graph",
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.2.5",
|
"php": "^8",
|
||||||
"doctrine/dbal": "^2.10",
|
"doctrine/dbal": "^2.10",
|
||||||
"dragonmantank/cron-expression": "^3",
|
"dragonmantank/cron-expression": "^3",
|
||||||
"fideloper/proxy": "^4.2",
|
"fideloper/proxy": "^4.2",
|
||||||
|
|||||||
4103
composer.lock
generated
4103
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@ return [
|
|||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'version' => '1.12.2',
|
'version' => '1.12.3',
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ LABEL maintainer=henrywhitaker3@outlook.com
|
|||||||
|
|
||||||
ENV arch='x86_64'
|
ENV arch='x86_64'
|
||||||
|
|
||||||
|
RUN apk add php82-tokenizer
|
||||||
|
|
||||||
COPY docker/conf/ /
|
COPY docker/conf/ /
|
||||||
COPY . /site
|
COPY . /site
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ LABEL maintainer=henrywhitaker3@outlook.com
|
|||||||
|
|
||||||
ENV arch='arm'
|
ENV arch='arm'
|
||||||
|
|
||||||
|
RUN apk add php82-tokenizer
|
||||||
|
|
||||||
COPY docker/conf/ /
|
COPY docker/conf/ /
|
||||||
COPY . /site
|
COPY . /site
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,18 @@ function eulaError()
|
|||||||
exit 1
|
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
|
# Do Ookla stuff
|
||||||
if [ -z ${OOKLA_EULA_GDPR+x} ]; then
|
if [ -z ${OOKLA_EULA_GDPR+x} ]; then
|
||||||
eulaError
|
eulaError
|
||||||
@@ -23,24 +35,27 @@ else
|
|||||||
echo "Ookla GDPR and EULA accepted. Downloading Speedtest CLI."
|
echo "Ookla GDPR and EULA accepted. Downloading Speedtest CLI."
|
||||||
cd /tmp
|
cd /tmp
|
||||||
|
|
||||||
if [ $(uname -m) == "x86_64" ]; then
|
downloadSpeedtestCli
|
||||||
wget https://install.speedtest.net/app/cli/ookla-speedtest-1.0.0-x86_64-linux.tgz -O speedtest.tgz > /dev/null
|
|
||||||
else
|
|
||||||
wget https://install.speedtest.net/app/cli/ookla-speedtest-1.0.0-arm-linux.tgz -O speedtest.tgz > /dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
tar zxvf speedtest.tgz > /dev/null
|
|
||||||
cp speedtest /site/app/Bin/
|
|
||||||
|
|
||||||
chmod +x /site/artisan
|
chmod +x /site/artisan
|
||||||
HOME=/config && s6-setuidgid abc /site/app/Bin/speedtest --accept-license --accept-gdpr > /dev/null
|
HOME=/config && s6-setuidgid abc /site/app/Bin/speedtest --accept-license --accept-gdpr > /dev/null
|
||||||
HOME=/root
|
HOME=/root
|
||||||
else
|
else
|
||||||
|
/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=/config && s6-setuidgid abc /site/app/Bin/speedtest --accept-license --accept-gdpr > /dev/null
|
||||||
HOME=/root
|
HOME=/root
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Copy latest nginx config
|
||||||
|
cp /defaults/nginx/nginx.conf.sample /config/nginx/nginx.conf
|
||||||
|
|
||||||
# Copy site files to /config
|
# Copy site files to /config
|
||||||
echo "Copying latest site files to config"
|
echo "Copying latest site files to config"
|
||||||
cp -rfT /site/ /config/www/
|
cp -rfT /site/ /config/www/
|
||||||
@@ -69,19 +84,19 @@ fi
|
|||||||
|
|
||||||
echo 'Updating packages'
|
echo 'Updating packages'
|
||||||
apk add composer
|
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
|
sed "s,DB_DATABASE=.*,DB_DATABASE=/config/speed.db," -i.bak /config/www/.env
|
||||||
|
|
||||||
echo "Running database migrations"
|
echo "Running database migrations"
|
||||||
php /config/www/artisan migrate
|
php82 /config/www/artisan migrate
|
||||||
|
|
||||||
# Check app key exists
|
# Check app key exists
|
||||||
if grep -E "APP_KEY=[0-9A-Za-z:+\/=]{1,}" /config/www/.env > /dev/null; then
|
if grep -E "APP_KEY=[0-9A-Za-z:+\/=]{1,}" /config/www/.env > /dev/null; then
|
||||||
echo "App key exists"
|
echo "App key exists"
|
||||||
else
|
else
|
||||||
echo "Generating app key"
|
echo "Generating app key"
|
||||||
php /config/www/artisan key:generate
|
php82 /config/www/artisan key:generate
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check JWT secret exists
|
# Check JWT secret exists
|
||||||
@@ -89,7 +104,7 @@ if grep -E "JWT_SECRET=[0-9A-Za-z:+\/=]{1,}" /config/www/.env > /dev/null ; then
|
|||||||
echo "JWT secret exists"
|
echo "JWT secret exists"
|
||||||
else
|
else
|
||||||
echo "Generating JWT secret"
|
echo "Generating JWT secret"
|
||||||
php /config/www/artisan jwt:secret
|
php82 /config/www/artisan jwt:secret
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z ${SLACK_WEBHOOK+x} ]; then
|
if [ -z ${SLACK_WEBHOOK+x} ]; then
|
||||||
@@ -98,7 +113,7 @@ if [ -z ${SLACK_WEBHOOK+x} ]; then
|
|||||||
else
|
else
|
||||||
echo "Slack webhook set, updating db"
|
echo "Slack webhook set, updating db"
|
||||||
sed "s,SLACK_WEBHOOK=.*,SLACK_WEBHOOK=$SLACK_WEBHOOK," -i.bak /config/www/.env
|
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
|
fi
|
||||||
|
|
||||||
if [ -z ${TELEGRAM_BOT_TOKEN+x} ] && [ -z ${TELEGRAM_CHAT_ID+x} ]; then
|
if [ -z ${TELEGRAM_BOT_TOKEN+x} ] && [ -z ${TELEGRAM_CHAT_ID+x} ]; then
|
||||||
@@ -109,7 +124,7 @@ else
|
|||||||
echo "Telegram chat id and bot token set, updating .env"
|
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_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
|
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
|
fi
|
||||||
|
|
||||||
if [ -z ${BASE_PATH+x} ]; then
|
if [ -z ${BASE_PATH+x} ]; then
|
||||||
@@ -122,19 +137,19 @@ fi
|
|||||||
|
|
||||||
if [ -z ${AUTH+x} ]; then
|
if [ -z ${AUTH+x} ]; then
|
||||||
echo "AUTH variable not set. Disabling authentication"
|
echo "AUTH variable not set. Disabling authentication"
|
||||||
php /config/www/artisan speedtest:auth --disable
|
php82 /config/www/artisan speedtest:auth --disable
|
||||||
else
|
else
|
||||||
if [ $AUTH == 'true' ]; then
|
if [ $AUTH == 'true' ]; then
|
||||||
echo "AUTH variable set. Enabling authentication"
|
echo "AUTH variable set. Enabling authentication"
|
||||||
php /config/www/artisan speedtest:auth --enable
|
php82 /config/www/artisan speedtest:auth --enable
|
||||||
else
|
else
|
||||||
echo "AUTH variable set, but not to 'true'. Disabling authentication"
|
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
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Clearing old jobs from queue"
|
echo "Clearing old jobs from queue"
|
||||||
php /config/www/artisan queue:clear
|
php82 /config/www/artisan queue:clear
|
||||||
|
|
||||||
mkdir -p /config/log/speedtest
|
mkdir -p /config/log/speedtest
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
#!/usr/bin/with-contenv bash
|
#!/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
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Helpers\SettingsHelper;
|
use App\Helpers\SettingsHelper;
|
||||||
|
use GuzzleHttp\Psr7\MimeType;
|
||||||
use Illuminate\Support\Facades\File;
|
use Illuminate\Support\Facades\File;
|
||||||
use Illuminate\Support\Facades\Response;
|
use Illuminate\Support\Facades\Response;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
@@ -21,7 +22,7 @@ Route::get(SettingsHelper::getBase() . 'files/{path?}', function ($file) {
|
|||||||
$fileP = public_path() . '/' . $fileP;
|
$fileP = public_path() . '/' . $fileP;
|
||||||
if (file_exists($fileP)) {
|
if (file_exists($fileP)) {
|
||||||
$contents = File::get($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]);
|
return Response::make(File::get($fileP), 200, ['Content-type' => $mime]);
|
||||||
} else {
|
} else {
|
||||||
abort(404);
|
abort(404);
|
||||||
|
|||||||
Reference in New Issue
Block a user