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

🔩 Verbesserungen am Server #25

Merged
merged 52 commits into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
78dd484
Moved from better-sqlite3 to sequelize (with sqlite3 driver)
gnmyt Aug 7, 2022
925e1d5
Created the database.js
gnmyt Aug 7, 2022
c2c8ed2
Created the Config model
gnmyt Aug 7, 2022
b498b5b
Created the Speedtests model
gnmyt Aug 7, 2022
21b9ffe
Created the Recommendations model
gnmyt Aug 7, 2022
bdb90a9
Removed the tables controller (not needed anymore)
gnmyt Aug 7, 2022
4cc1cd1
Updated the config controller
gnmyt Aug 7, 2022
037fcde
Updated the recommendations controller
gnmyt Aug 7, 2022
712bd07
Updated the speedtests controller
gnmyt Aug 7, 2022
3990c1e
Updated the config route
gnmyt Aug 7, 2022
9445939
Updated the export route
gnmyt Aug 7, 2022
672bdea
Updated the password middleware
gnmyt Aug 7, 2022
ad3f5a9
Updated the speedtests route
gnmyt Aug 7, 2022
dbce21c
Made speedtests.js#delete return false if the test does not exist
gnmyt Aug 7, 2022
78a9a52
Updated the recommendations route
gnmyt Aug 7, 2022
977e05f
Updated the speedtest task
gnmyt Aug 7, 2022
5923672
Moved the loadServers task to the config folder
gnmyt Aug 7, 2022
395539b
Created a createFolder config task
gnmyt Aug 7, 2022
5d4b838
Updated the index.js to use sequelize & all tasks
gnmyt Aug 7, 2022
1d0b6ed
Removed speedtest-net from the dependencies
gnmyt Aug 7, 2022
0b778b4
Optimized the timer task
gnmyt Aug 7, 2022
465101e
Added the decompress dependencies & added the tmp dependency
gnmyt Aug 8, 2022
a7a1a37
Created the binaries config
gnmyt Aug 8, 2022
99741de
MySpeed now automatically downloads the correct version of the speedt…
gnmyt Aug 8, 2022
9d12a87
The createFolder config action now creates the "data" & "bin" folder
gnmyt Aug 8, 2022
bd0c16f
Created the speedtest util
gnmyt Aug 8, 2022
ed6cbe9
Updated the speedtest task
gnmyt Aug 8, 2022
b2814b3
The cli now loads at the start of the server
gnmyt Aug 8, 2022
aa5f928
Added the bin directory to the .gitignore
gnmyt Aug 8, 2022
e738042
Updated the server version to 1.0.3
gnmyt Aug 8, 2022
2eb1ae8
Since it is no longer necessary to build node modules, they are now r…
gnmyt Aug 8, 2022
d9a60aa
Removed the CNAME file from the root
gnmyt Aug 8, 2022
c250abf
Removed the npm install statement from the create_release workflow
gnmyt Aug 8, 2022
56d2531
Updated the images & links in the README.md
gnmyt Aug 8, 2022
0c47a13
Updated the linux setup documentation
gnmyt Aug 8, 2022
bf69ff4
Fixed the install.sh
gnmyt Aug 8, 2022
2b1c0dd
Created the file for the myspeed cli (todo)
gnmyt Aug 8, 2022
f893d69
Fixed a line in the uninstall.sh
gnmyt Aug 8, 2022
905af15
Added the option to use a custom installation path
gnmyt Aug 8, 2022
3dcbeff
Optimized the installation script
gnmyt Aug 8, 2022
33389b4
Fixed the install script
gnmyt Aug 8, 2022
5a83901
Added a default value to the timer task
gnmyt Aug 9, 2022
5d7c66e
Updated the myspeed version in the package-lock.json
gnmyt Aug 9, 2022
5279932
Removed /api/speedtests/latet (not needed anymore)
gnmyt Aug 9, 2022
c3ebaab
Fixed the pause controller
gnmyt Aug 9, 2022
d173acd
Fixed POST /api/speedtests/pause (number check)
gnmyt Aug 9, 2022
29493f9
Fixed the speedtests controller #get
gnmyt Aug 9, 2022
3537523
Fixed GET /api/speedtests/:id
gnmyt Aug 9, 2022
d7b5cc0
Fixed the speedtests controller #delete
gnmyt Aug 9, 2022
1da4eb5
Made GET /api/info/server async
gnmyt Aug 9, 2022
a2d6c25
Fixed the config controller
gnmyt Aug 9, 2022
d632b3d
The speedtest now retries without an server id if failed (searches au…
gnmyt Aug 9, 2022
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
10 changes: 3 additions & 7 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
node-version: '16'

- run: cd client && npm install --force
- run: npm run build && mv client/build . && npm install --force
- run: npm run build && mv client/build .

- name: Get version
id: get_version
Expand All @@ -29,16 +29,12 @@ jobs:
run: sudo apt-get install zip

- name: Zip all files
run: zip -r MySpeed-${{ steps.get_version.outputs.version }}-with-modules.zip build node_modules server package.json package-lock.json

- name: Zip all files (without node_modules)
run: zip -r MySpeed-${{ steps.get_version.outputs.version }}-without-modules.zip build server package.json package-lock.json
run: zip -r MySpeed-${{ steps.get_version.outputs.version }}.zip build server package.json package-lock.json

- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
title: Release ${{ steps.get_version.outputs.version }}
files: |
./MySpeed-*-with-modules.zip
./MySpeed-*-without-modules.zip
./MySpeed-*.zip
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
# production
/build
/data
/bin
1 change: 0 additions & 1 deletion CNAME

This file was deleted.

21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,44 @@

## Was ist MySpeed?

MySpeed ist eine deutschsprachige Speedtest Analyse-Software, welche die Geschwindigkeit des Internets der letzten 24 Stunden übersichtlich
MySpeed ist eine deutschsprachige Speedtest-Analyse-Software, welche die Geschwindigkeit des Internets der letzten 24 Stunden übersichtlich
darstellt.

### Installation

Anleitung für [Linux](https://github.com/gnmyt/myspeed/wiki/Einrichtung-Linux)
Anleitung für [Linux](https://myspeed.gnmyt.dev/setup/linux)

Anleitung für [Windows](https://github.com/gnmyt/myspeed/wiki/Einrichtung-Windows)
Anleitung für [Windows](https://myspeed.gnmyt.dev/setup/windows)

### Beispiel-Screenshots

#### Startseite

<img src="https://i.imgur.com/94rQ4jq.png">
<img src="https://i.imgur.com/54vSOWy.png" alt="Startseite">

#### Auswahl-Menü

<img src="https://i.imgur.com/tJHmUVs.png">
<img src="https://i.imgur.com/TVihdZ6.png" alt="Auswahl-Menü">

#### Seite während eines Speedtests

<img src="https://i.imgur.com/rqvb1Ni.png">
<img src="https://i.imgur.com/UALWAPg.png" alt="Seite während eines Speedtests">

#### Dialog für Einstellen des Down-Speeds

<img src="https://i.imgur.com/DnEPbFV.png">
<img src="https://i.imgur.com/Bv8Cj1L.png" alt="Dialog für Einstellen des Down-Speeds">

### Geschützte Startseite (Passwort festgelegt)

<img src="https://i.imgur.com/BGK166K.png">
<img src="https://i.imgur.com/26I9Y5b.png" alt="Geschützte Startseite (Passwort festgelegt)">

### Dialog für Up- und Downspeed Empfehlung

<img src="https://i.imgur.com/ExgswYD.png">
<img src="https://i.imgur.com/dpP9NG1.png" alt="Dialog für Up- und Downspeed Empfehlung">

### Dialog für Pausieren von Speedtests

<img src="https://i.imgur.com/bZF4GBa.png" alt="Dialog für Pausieren von Speedtests">

## Überzeugt?

Expand Down
2 changes: 2 additions & 0 deletions cli/myspeed.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env node
'use strict';
2 changes: 1 addition & 1 deletion docs/setup/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ sudo apt-get install nodejs -y #(2)

mkdir /opt/myspeed && cd /opt/myspeed #(3)

wget $(curl -s https://api.github.com/repos/gnmyt/myspeed/releases/latest | grep browser_download_url | cut -d '"' -f 4 | grep -m1 "") #(4)
wget $(curl -s https://api.github.com/repos/gnmyt/myspeed/releases/latest | grep browser_download_url | cut -d '"' -f 4) #(4)

unzip MySpeed-*.zip && rm MySpeed-*.zip #(5)

Expand Down
68 changes: 24 additions & 44 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ RED='\033[1;31m'
NORMAL='\033[0;39m'
PURPLE='\033[0;35m'


INSTALLATION_PATH="/opt/myspeed"

while getopts "d:" o > /dev/null 2>&1; do
# shellcheck disable=SC2220
case "${o}" in
d) INSTALLATION_PATH=${OPTARG} ;;
esac
done

# Root check
if [ $EUID -ne 0 ]; then
echo -e "$RED✗ Fehler bei der Installation:$NORMAL Du benötigst Root-Rechte, um die Installation zu starten."
Expand All @@ -24,6 +30,7 @@ if [ "$1" == "--beta" ]; then
else
echo -e "$YELLOW Version:$BLUE MySpeed Release"
fi
echo -e "$YELLOW Ort:$BLUE $INSTALLATION_PATH"
echo -e "$YELLOW Es wird die Speedtest API von Ookla verwendet."
echo -e "$YELLOW Wenn du damit$RED nicht$YELLOW einverstanden bist,"
echo -e "$YELLOW kannst du die Installation mit$RED STRG + C$YELLOW abbrechen. "
Expand All @@ -33,7 +40,7 @@ sleep 5
clear

# Check if installed
if [ -d $INSTALLATION_PATH ]; then
if [ -d "$INSTALLATION_PATH" ]; then
echo -e "$YELLOW⚠ Warnung: $NORMAL MySpeed ist bereits auf diesem System installiert."
echo -e "$GREENℹ Info:$NORMAL Es wird nun der aktuelle Release installiert..."
sleep 5
Expand All @@ -51,48 +58,21 @@ apt-get update -y
clear
echo -e "$GREENℹ Info:$NORMAL Die Installation wird jetzt vorbereitet. Das kann einen Augenblick dauern..."
sleep 5
# Check for wget
clear
echo -e "$BLUE🔎 Status:$NORMAL Überprüfe, ob wget vorhanden ist..."
if ! command -v wget &> /dev/null
then
echo -e "$YELLOWℹ \"wget\" ist nicht installiert.$NORMAL Die Installation wurde gestartet..."
sleep 2
apt-get install wget -y
fi

# Check for unzip
clear
echo -e "$BLUE🔎 Status:$NORMAL Überprüfe, ob unzip vorhanden ist..."
if ! command -v unzip &> /dev/null
then
echo -e "$YELLOWℹ \"unzip\" ist nicht installiert.$NORMAL Die Installation wurde gestartet..."
sleep 2
apt-get install unzip -y
fi

# Check for build essential
clear
if [ "$1" == "--beta" ]; then
echo -e "$BLUE🔎 Status:$NORMAL Überprüfe, ob build-essential vorhanden ist..."
if ! dpkg-query -l build-essential | grep build-essential &> /dev/null
function check() {
clear
echo -e "$BLUE🔎 Status:$NORMAL Überprüfe, ob $1 vorhanden ist..."
if ! command -v "$1" &> /dev/null
then
echo -e "$YELLOWℹ \"build-essential\" ist nicht installiert.$NORMAL Die Installation wurde gestartet..."
echo -e "$YELLOWℹ \"$1\" ist nicht installiert.$NORMAL Die Installation wurde gestartet..."
sleep 2
apt-get install build-essential -y
apt-get install "$1" -y
fi
fi
}


# Check for curl
clear
echo -e "$BLUE🔎 Status:$NORMAL Überprüfe, ob curl vorhanden ist..."
if ! command -v curl &> /dev/null
then
echo -e "$YELLOWℹ \"curl\" ist nicht installiert.$NORMAL Die Installation wurde gestartet..."
sleep 2
apt-get install curl -y
fi
check "wget"
check "unzip"
check "curl"

# Check for node
clear
Expand All @@ -110,22 +90,22 @@ clear
if [ "$1" == "--beta" ]; then
RELEASE_URL=https://github.com/gnmyt/myspeed/archive/refs/heads/development.zip
else
RELEASE_URL=$(curl -s https://api.github.com/repos/gnmyt/myspeed/releases/latest | grep browser_download_url | cut -d '"' -f 4 | grep -m1 "")
RELEASE_URL=$(curl -s https://api.github.com/repos/gnmyt/myspeed/releases/latest | grep browser_download_url | cut -d '"' -f 4)
fi


echo -e "$GREEN✓ Vorbereitung abgeschlossen:$NORMAL Die Installation von MySpeed wird jetzt gestartet..."
sleep 3

clear
if [ ! -d $INSTALLATION_PATH ]
if [ ! -d "$INSTALLATION_PATH" ]
then
echo -e "$BLUEℹ Info: $NORMAL MySpeed wird unter dem Verzeichnis $INSTALLATION_PATH installiert. Der Ordner wird nun erstellt."
sleep 2
mkdir $INSTALLATION_PATH
mkdir "$INSTALLATION_PATH"
fi

cd $INSTALLATION_PATH
cd "$INSTALLATION_PATH"

echo -e "$BLUEℹ Info: $NORMAL Die aktuelle MySpeed-Instanz wird heruntergeladen. Einen Moment..."
sleep 2
Expand Down Expand Up @@ -173,7 +153,7 @@ if command -v systemctl &> /dev/null && ! systemctl --all --type service | grep
Restart=always
User=root
Environment=NODE_ENV=production
WorkingDirectory=/opt/myspeed
WorkingDirectory=$INSTALLATION_PATH

[Install]
WantedBy=multi-user.target
Expand Down
Loading