Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev -> master #1125

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0b1645c
Fix issue where the data would refresh before the react state had upd…
henrywhitaker3 Sep 10, 2021
98e037b
Update version #s
henrywhitaker3 Sep 10, 2021
0384f61
Added dockerfiles to the main branches
henrywhitaker3 Sep 10, 2021
0c8e074
Fix the eula stuff
henrywhitaker3 Sep 10, 2021
d92dd33
Update install type
henrywhitaker3 Sep 10, 2021
283de67
Merge pull request #686 from henrywhitaker3/feat/sort-out-dockerfiles
henrywhitaker3 Sep 10, 2021
858dcc1
Merge pull request #685 from henrywhitaker3/fix/680/last-x-days
henrywhitaker3 Sep 10, 2021
1fcaa79
Chmod +x the artsan file
henrywhitaker3 Sep 10, 2021
fba6951
undo dumb thing
henrywhitaker3 Sep 10, 2021
0dff534
Also do the arm dockerfile
henrywhitaker3 Sep 10, 2021
58e82dc
Actually pass days to the action
henrywhitaker3 Sep 10, 2021
8d32d06
Merge remote-tracking branch 'origin/master' into alpha
henrywhitaker3 Sep 10, 2021
efecd28
Add build step to workflow
henrywhitaker3 Sep 10, 2021
ea78415
Fix branch selector
henrywhitaker3 Sep 10, 2021
5885824
Fix secret name
henrywhitaker3 Sep 10, 2021
6c6a12b
ugh
henrywhitaker3 Sep 10, 2021
9d2f185
Fix the things
henrywhitaker3 Sep 10, 2021
fa41bdd
Move to dev
henrywhitaker3 Sep 10, 2021
603f618
Add for master also
henrywhitaker3 Sep 10, 2021
1c00bee
Merge pull request #704 from henrywhitaker3/alpha
henrywhitaker3 Sep 10, 2021
1e1a2c9
Use uname for arch download instead of env
henrywhitaker3 Sep 10, 2021
b3ba6a8
Merge remote-tracking branch 'origin/dev' into dev
henrywhitaker3 Sep 10, 2021
6905a5a
Fix bug where failure graph would not update
henrywhitaker3 Sep 11, 2021
3955a2d
Merge pull request #705 from henrywhitaker3/fix/failure-graph
henrywhitaker3 Sep 11, 2021
ba8fc9e
bump to php 8
henrywhitaker3 Jun 25, 2023
35a7213
updated to run on php8
henrywhitaker3 Jun 25, 2023
544a8ad
bump version
henrywhitaker3 Jun 25, 2023
ea79ce4
fix nginx conf and arm loc
henrywhitaker3 Jun 25, 2023
f18f250
update php version in actions
henrywhitaker3 Jun 25, 2023
724a9f1
update arm dockerfile
henrywhitaker3 Jun 25, 2023
5fd47d7
Merge pull request #1124 from henrywhitaker3/fix/1119
henrywhitaker3 Jun 25, 2023
0e105ff
update workflow
henrywhitaker3 Jun 25, 2023
14fd1b6
update readme
henrywhitaker3 Jun 25, 2023
4e649b2
fix crontab not using correct php bin
henrywhitaker3 Jun 25, 2023
fe6b96d
fix scheduled job injection
henrywhitaker3 Jun 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log

.vscode/

_ide_helper.php
.idea
.config
reports/
72 changes: 21 additions & 51 deletions .github/workflows/laravel-dev.yml
Original file line number Diff line number Diff line change
@@ -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
push: true
tags: henrywhitaker3/speedtest-tracker:dev,henrywhitaker3/speedtest-tracker:dev-arm
29 changes: 29 additions & 0 deletions .github/workflows/laravel-master.yml
Original file line number Diff line number Diff line change
@@ -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
push: true
tags: henrywhitaker3/speedtest-tracker:latest,henrywhitaker3/speedtest-tracker:latest-arm
4 changes: 2 additions & 2 deletions .github/workflows/laravel-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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');"
Expand Down Expand Up @@ -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
Expand Down
59 changes: 0 additions & 59 deletions .github/workflows/laravel-stable.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.0-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/actions/workflow/status/henrywhitaker3/Speedtest-Tracker/laravel-master.yml?branch=master&label=dev&logo=github&style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/actions) [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/henrywhitaker3/Speedtest-Tracker/laravel-dev.yml?branch=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.3-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.

Expand Down
15 changes: 15 additions & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 1 addition & 1 deletion app/Actions/QueueSpeedtest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ public function run()
{
SettingsHelper::loadIntegrationConfig();

SpeedtestJob::dispatch(false, config('integrations'), $this->speedtestProvider);
SpeedtestJob::dispatch($this->speedtestProvider, false, config('integrations'));
}
}
2 changes: 1 addition & 1 deletion app/Console/Commands/AcceptEULACommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ public function __construct()
public function handle()
{
$this->info('Acceping EULA');
shell_exec(config('speedtest.home') . ' && timeout 3s ' . app_path() . '/Bin/speedtest --accept-license --accept-gdpr');
shell_exec(config('speedtest.home') . ' && timeout 10s ' . app_path() . '/Bin/speedtest --accept-license --accept-gdpr');
}
}
2 changes: 1 addition & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ protected function schedule(Schedule $schedule)
if ((bool)SettingsHelper::get('schedule_enabled')->value) {
$schedule->job(
new SpeedtestJob(
app()->make(SpeedtestProvider::class),
true,
config('integrations'),
app()->make(SpeedtestProvider::class)
)
)
->cron(SettingsHelper::get('schedule')['value'])
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/HomepageDataController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public function __invoke($days)

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(),
];
}
Expand Down
2 changes: 1 addition & 1 deletion app/Jobs/SpeedtestJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
22 changes: 22 additions & 0 deletions changelog.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
{
"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)",
"link": "https://github.com/henrywhitaker3/Speedtest-Tracker/pull/680"
}
],
"1.12.0": [
{
"description": "Added InfluxDB intergation.",
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading
Loading