-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
j34g
committed
Oct 26, 2024
0 parents
commit 59840cc
Showing
15 changed files
with
498 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Build Service | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
paths-ignore: ['*.md'] | ||
branches: ['main', 'master'] | ||
push: | ||
paths-ignore: ['*.md'] | ||
branches: ['main', 'master'] | ||
|
||
jobs: | ||
BuildPackage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Prepare StartOS SDK | ||
uses: Start9Labs/sdk@v1 | ||
|
||
- name: Checkout services repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build the service package | ||
id: build | ||
run: | | ||
git submodule update --init --recursive | ||
start-sdk init | ||
make | ||
PACKAGE_ID=$(yq -oy ".id" manifest.*) | ||
echo "package_id=$PACKAGE_ID" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
# - name: Upload .s9pk | ||
# uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: ${{ env.package_id }}.s9pk | ||
# path: ./${{ env.package_id }}.s9pk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Release Service | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*' | ||
|
||
jobs: | ||
ReleasePackage: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Prepare StartOS SDK | ||
uses: Start9Labs/sdk@v1 | ||
|
||
- name: Checkout services repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build the service package | ||
run: | | ||
git submodule update --init --recursive | ||
start-sdk init | ||
make | ||
- name: Setting package ID and title from the manifest | ||
id: package | ||
run: | | ||
echo "package_id=$(yq -oy ".id" manifest.*)" >> $GITHUB_ENV | ||
echo "package_title=$(yq -oy ".title" manifest.*)" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Generate sha256 checksum | ||
run: | | ||
PACKAGE_ID=${{ env.package_id }} | ||
sha256sum ${PACKAGE_ID}.s9pk > ${PACKAGE_ID}.s9pk.sha256 | ||
shell: bash | ||
|
||
- name: Generate changelog | ||
run: | | ||
PACKAGE_ID=${{ env.package_id }} | ||
echo "## What's Changed" > change-log.txt | ||
yq -oy '.release-notes' manifest.* >> change-log.txt | ||
echo "## SHA256 Hash" >> change-log.txt | ||
echo '```' >> change-log.txt | ||
sha256sum ${PACKAGE_ID}.s9pk >> change-log.txt | ||
echo '```' >> change-log.txt | ||
shell: bash | ||
|
||
- name: Create GitHub Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
tag_name: ${{ github.ref_name }} | ||
name: ${{ env.package_title }} ${{ github.ref_name }} | ||
prerelease: true | ||
body_path: change-log.txt | ||
files: | | ||
./${{ env.package_id }}.s9pk | ||
./${{ env.package_id }}.s9pk.sha256 | ||
- name: Publish to Registry | ||
env: | ||
S9USER: ${{ secrets.S9USER }} | ||
S9PASS: ${{ secrets.S9PASS }} | ||
S9REGISTRY: ${{ secrets.S9REGISTRY }} | ||
run: | | ||
if [[ -z "$S9USER" || -z "$S9PASS" || -z "$S9REGISTRY" ]]; then | ||
echo "Publish skipped: missing registry credentials." | ||
else | ||
start-sdk publish https://$S9USER:$S9PASS@$S9REGISTRY ${{ env.package_id }}.s9pk | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
*.s9pk | ||
.vscode/ | ||
.DS_Store | ||
scripts/*.js | ||
docker-images |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Stage 1: Build | ||
FROM node:18-alpine AS build | ||
|
||
# Install necessary build dependencies | ||
RUN apk add --no-cache g++ make cmake python3 py3-setuptools git | ||
|
||
# Set the working directory | ||
WORKDIR /myspeed | ||
|
||
# Clone the MySpeed repository from GitHub | ||
RUN git clone https://github.com/gnmyt/myspeed.git . | ||
|
||
# Install dependencies for the entire application | ||
RUN yarn config set network-timeout 600000 # 10 minutes | ||
RUN yarn install | ||
|
||
# Build the client application | ||
RUN cd client && yarn install --force | ||
RUN cd client && npm run build | ||
|
||
# Move built client files to the correct location | ||
RUN mv client/build . | ||
|
||
# Stage 2: Production | ||
FROM node:18-alpine | ||
|
||
# Install production dependencies | ||
RUN apk add --no-cache tzdata | ||
|
||
# Set environment variables | ||
ENV NODE_ENV=production | ||
ENV TZ=Etc/UTC | ||
|
||
# Set the working directory | ||
WORKDIR /myspeed | ||
|
||
# Copy the built files and server files from the build stage | ||
COPY --from=build /myspeed/build /myspeed/build | ||
COPY --from=build /myspeed/server /myspeed/server | ||
COPY --from=build /myspeed/node_modules /myspeed/node_modules | ||
COPY --from=build /myspeed/package.json /myspeed/package.json | ||
|
||
# Declare a volume for persistent data | ||
VOLUME ["/myspeed/data"] | ||
|
||
# Expose the necessary port | ||
EXPOSE 5216 | ||
|
||
# Start the application | ||
CMD ["node", "server/server.js"] | ||
|
||
ADD ./docker_entrypoint.sh /usr/local/bin/docker_entrypoint.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
PKG_ID := $(shell yq e ".id" manifest.yaml) | ||
PKG_VERSION := $(shell yq e ".version" manifest.yaml) | ||
TS_FILES := $(shell find ./ -name \*.ts) | ||
|
||
.DELETE_ON_ERROR: | ||
|
||
all: verify | ||
|
||
arm: | ||
@rm -f docker-images/x86_64.tar | ||
@ARCH=aarch64 $(MAKE) | ||
|
||
x86: | ||
@rm -f docker-images/aarch64.tar | ||
@ARCH=x86_64 $(MAKE) | ||
|
||
verify: $(PKG_ID).s9pk | ||
@start-sdk verify s9pk $(PKG_ID).s9pk | ||
@echo " Done!" | ||
@echo " Filesize: $(shell du -h $(PKG_ID).s9pk) is ready" | ||
|
||
install: | ||
@if [ ! -f ~/.embassy/config.yaml ]; then echo "You must define \"host: http://server-name.local\" in ~/.embassy/config.yaml config file first."; exit 1; fi | ||
@echo "\nInstalling to $$(grep -v '^#' ~/.embassy/config.yaml | cut -d'/' -f3) ...\n" | ||
@[ -f $(PKG_ID).s9pk ] || ( $(MAKE) && echo "\nInstalling to $$(grep -v '^#' ~/.embassy/config.yaml | cut -d'/' -f3) ...\n" ) | ||
@start-cli package install $(PKG_ID).s9pk | ||
|
||
clean: | ||
rm -rf docker-images | ||
rm -f $(PKG_ID).s9pk | ||
rm -f scripts/*.js | ||
|
||
scripts/embassy.js: $(TS_FILES) | ||
deno bundle scripts/embassy.ts scripts/embassy.js | ||
|
||
docker-images/aarch64.tar: manifest.yaml Dockerfile docker_entrypoint.sh | ||
ifeq ($(ARCH),x86_64) | ||
else | ||
mkdir -p docker-images | ||
docker buildx build --tag start9/$(PKG_ID)/main:$(PKG_VERSION) \ | ||
--platform=linux/arm64 -o type=docker,dest=docker-images/aarch64.tar . | ||
endif | ||
|
||
docker-images/x86_64.tar: manifest.yaml Dockerfile docker_entrypoint.sh | ||
ifeq ($(ARCH),aarch64) | ||
else | ||
mkdir -p docker-images | ||
docker buildx build --tag start9/$(PKG_ID)/main:$(PKG_VERSION) \ | ||
--platform=linux/amd64 -o type=docker,dest=docker-images/x86_64.tar . | ||
endif | ||
|
||
$(PKG_ID).s9pk: manifest.yaml instructions.md icon.png LICENSE scripts/embassy.js docker-images/aarch64.tar docker-images/x86_64.tar | ||
ifeq ($(ARCH),aarch64) | ||
@echo "start-sdk: Preparing aarch64 package ..." | ||
else ifeq ($(ARCH),x86_64) | ||
@echo "start-sdk: Preparing x86_64 package ..." | ||
else | ||
@echo "start-sdk: Preparing Universal Package ..." | ||
endif | ||
@start-sdk pack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
[![Contributors][contributors-shield]][contributors-url] | ||
[![Forks][forks-shield]][forks-url] | ||
[![Stargazers][stars-shield]][stars-url] | ||
[![Issues][issues-shield]][issues-url] | ||
[![MIT License][license-shield]][license-url] | ||
[![Release][release-shield]][release-url] | ||
|
||
<br /> | ||
<div align="center"> | ||
<a href="https://github.com/gnmyt/myspeed"> | ||
<img src="https://i.imgur.com/aCmA6rH.png" alt="Logo" width="80" height="80"> | ||
</a> | ||
<h3>MySpeed <a href="README.de.md">🇩🇪</a> <a href="README.md">🇺🇸</a></h3> | ||
</div> | ||
|
||
|
||
## 🤔 What is MySpeed? | ||
|
||
MySpeed is a speed test analysis software that records your internet speed for up to 30 days. | ||
|
||
### ⭐ Features | ||
|
||
- 📊 MySpeed generates clear statistics on speed, ping, and more | ||
- ⏰ MySpeed automates speed tests and allows you to set the time between tests using Cron expressions | ||
- 🗄️ Add multiple servers directly to a MySpeed instance | ||
- 🩺 Configure health checks to notify you via email, Signal, WhatsApp, or Telegram in case of errors or downtime | ||
- 📆 Test results can be stored for up to 30 days | ||
- 🔥 Support for Prometheus and Grafana | ||
- 🗳️ Choose between Ookla, LibreSpeed and Cloudflare speed test servers | ||
- 💁 Learn more about MySpeed on our [website](https://myspeed.dev) | ||
|
||
### ⬇️ Installation | ||
|
||
- **🐧 Guide for [Linux](https://docs.myspeed.dev/setup/linux)** | ||
- **🪟 Guide for [Windows](https://docs.myspeed.dev/setup/windows)** | ||
|
||
### 📸 Example Screenshots | ||
|
||
#### Homepage (List View) | ||
|
||
<img src="https://i.imgur.com/NHX7Ba9.png" alt="Homepage"> | ||
|
||
#### Homepage (Statistics View) | ||
<img src="https://i.imgur.com/5JAFgrk.png" alt="Statistics"> | ||
|
||
#### Server Selection | ||
|
||
<img src="https://i.imgur.com/hgOR93G.png" alt="Server Selection"> | ||
|
||
#### Dropdown Menu | ||
|
||
<img src="https://i.imgur.com/alKEMrg.png" alt="Dropdown Menu"> | ||
|
||
#### Page During a Speed Test | ||
|
||
<img src="https://i.imgur.com/kxsrjIe.png" alt="Page During a Speed Test"> | ||
|
||
## Convinced? | ||
|
||
Great, let's get started! You can find the installation instructions for Linux (and Windows) at the top under Installation. | ||
|
||
## License | ||
|
||
Distributed under the MIT license. See `LICENSE` for more information. | ||
|
||
[contributors-shield]: https://img.shields.io/github/contributors/gnmyt/myspeed.svg?style=for-the-badge | ||
|
||
[contributors-url]: https://github.com/gnmyt/myspeed/graphs/contributors | ||
|
||
[forks-shield]: https://img.shields.io/github/forks/gnmyt/myspeed.svg?style=for-the-badge | ||
|
||
[forks-url]: https://github.com/gnmyt/myspeed/network/members | ||
|
||
[stars-shield]: https://img.shields.io/github/stars/gnmyt/myspeed.svg?style=for-the-badge | ||
|
||
[stars-url]: https://github.com/gnmyt/myspeed/stargazers | ||
|
||
[issues-shield]: https://img.shields.io/github/issues/gnmyt/myspeed.svg?style=for-the-badge | ||
|
||
[issues-url]: https://github.com/gnmyt/myspeed/issues | ||
|
||
[license-shield]: https://img.shields.io/github/license/gnmyt/myspeed.svg?style=for-the-badge | ||
|
||
[license-url]: https://github.com/gnmyt/myspeed/blob/master/LICENSE | ||
|
||
[release-shield]: https://img.shields.io/github/v/release/gnmyt/myspeed.svg?style=for-the-badge | ||
|
||
[release-url]: https://github.com/gnmyt/myspeed/releases/latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/sh | ||
|
||
echo | ||
echo "Starting MySpeed..." | ||
echo | ||
|
||
# Set the working directory | ||
WORKDIR="/myspeed" | ||
|
||
# Navigate to the application directory | ||
cd "$WORKDIR" || { echo "Failed to enter directory: $WORKDIR"; exit 1; } | ||
|
||
# Log the contents of the working directory for debugging | ||
echo "Contents of $WORKDIR directory:" | ||
ls -l "$WORKDIR" | ||
|
||
# Check if the server directory exists and start the Node.js server | ||
if [ -d "server" ]; then | ||
echo "Starting the Node.js server in the 'server' directory..." | ||
exec node server | ||
else | ||
echo "Error: server directory does not exist." | ||
exit 1 | ||
fi |
Oops, something went wrong.