Skip to content

[Snyk] Security upgrade zipp from 3.15.0 to 3.19.1 #2

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

Open
wants to merge 64 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
80a3f64
更新linux脚本
LittleJake Aug 14, 2020
2c91a07
update using psutil.
LittleJake Mar 1, 2021
55c4640
1. add gitignore
LittleJake Apr 8, 2021
907dbe3
update disk partition support.
LittleJake Apr 14, 2021
1a5055d
update
LittleJake Sep 16, 2021
ebef363
Update report.py
LittleJake Dec 17, 2021
991e255
Update report.py
LittleJake Dec 17, 2021
15a26a7
Update report.py
LittleJake Dec 17, 2021
78c2ca5
Update
LittleJake Dec 8, 2023
63852c7
Update
LittleJake Dec 8, 2023
bd6790a
Update
LittleJake Dec 11, 2023
7fc6edf
Update
LittleJake Dec 11, 2023
4e0bcaf
Update
LittleJake Dec 11, 2023
4792904
Update
LittleJake Dec 11, 2023
e6b1852
Update
LittleJake Dec 11, 2023
27fdc89
Update
LittleJake Dec 11, 2023
25bc2ac
Update
LittleJake Dec 11, 2023
0102b26
Update
LittleJake Dec 11, 2023
b9599f4
Update
LittleJake Dec 11, 2023
039489f
Update
LittleJake Dec 11, 2023
3db5452
Update
LittleJake Dec 11, 2023
8ef1f33
Update
LittleJake Dec 11, 2023
9df652d
Update
LittleJake Dec 11, 2023
fb3052c
Update
LittleJake Dec 11, 2023
9c1be2f
Update
LittleJake Dec 11, 2023
76bb456
adding service install shell
LittleJake Jan 18, 2024
bf0256e
fix import
LittleJake Jan 18, 2024
66964c7
fix
LittleJake Jan 18, 2024
cb83cdb
fix env
LittleJake Jan 18, 2024
a8214bd
Update
LittleJake Jan 19, 2024
3e9c85d
Update README.md
LittleJake Jan 22, 2024
32184fe
Update README.md
LittleJake Jan 22, 2024
90bd439
Update README.md
LittleJake Jan 22, 2024
ffba9a0
Update report.py
LittleJake Jan 23, 2024
ed2e83b
Update SSL & fix bug
LittleJake Jan 23, 2024
d08392d
fix shell
LittleJake Jan 23, 2024
9b7bf9d
amend country
LittleJake Jan 23, 2024
e50946a
amend uptime
LittleJake Jan 23, 2024
362e093
Fixing termux (root mode)
LittleJake Jan 24, 2024
7effcd2
adding opts exclude
LittleJake Jan 24, 2024
8a934a3
Update
LittleJake Jan 24, 2024
eeed718
Update action
LittleJake Jan 24, 2024
8d9add1
Update report.py
LittleJake Jan 24, 2024
ee1c77d
fix ↑↓
LittleJake Jan 24, 2024
48e8f75
Update report.py
LittleJake Feb 4, 2024
97bf648
implement http api.
LittleJake Feb 7, 2024
7a4ffc3
Update exception
LittleJake Feb 7, 2024
905a190
adding timeout
LittleJake Feb 7, 2024
86c86bd
update log
LittleJake Feb 8, 2024
1f01c99
Update ip address fetch
LittleJake Apr 9, 2024
d98473f
Update
LittleJake Apr 18, 2024
5075ed0
Update
LittleJake Apr 18, 2024
a277049
Update report.py
LittleJake Apr 18, 2024
82576e2
Fix no IO data
LittleJake May 5, 2024
aa142cc
Create Dockerfile
LittleJake May 13, 2024
d1b59af
Update Dockerfile
LittleJake May 13, 2024
183a9a6
Update README.md
LittleJake May 13, 2024
374de58
Update report.py
LittleJake May 13, 2024
566e08b
fix: requirements.txt to reduce vulnerabilities
snyk-bot Jun 18, 2024
6b33939
Update for docker
LittleJake Jun 24, 2024
7b7d868
Merge pull request #1 from LittleJake/snyk-fix-550535aed439ac8b6d7e02…
LittleJake Jun 24, 2024
3cb090a
Update
LittleJake Jun 24, 2024
74c645c
Merge branch 'master' of github.com:LittleJake/server-monitor-script
LittleJake Jun 24, 2024
2bd7687
fix: requirements.txt to reduce vulnerabilities
snyk-bot Jul 10, 2024
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
25 changes: 25 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
REPORT_MODE=redis #http,redis
SOCKET_TIMEOUT=10

HOST=127.0.0.1
PORT=6379
PASSWORD=""
SSL=False

REPORT_TIME=60
TIMEOUT=259200
RETENTION_TIME=86400

SERVER_TOKEN=""
SERVER_URL="http://127.0.0.1"

IPV4_API="https://v4.ipv6-test.com/api/myip.php"
IPV6_API="https://v6.ipv6-test.com/api/myip.php"
IP_API="http://ip-api.com/json?fields=country,countryCode"


DISK_EXCLUDE=/run,/sys,/boot,/dev,/proc,/gdrive,/var/lib
DISK_FS_EXCLUDE=tmpfs,overlay
DISK_OPTS_EXCLUDE=ro

#PROCFS_PATH=/rootfs/proc # mount for docker.
292 changes: 292 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,292 @@
name: GitHub CI
on:
workflow_dispatch:

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
linux32_build:
name: Linux x86 Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: docker run --rm -v $GITHUB_WORKSPACE:/root/workdir multiarch/ubuntu-core:i386-bionic /bin/sh -c "apt update && apt install -y bash zlib1g zlib1g-dev make cmake git python3 python3-pip && cd /root/workdir && chmod +x build-script/build.release.sh && bash build-script/build.release.sh"

- name: Package Release
run: tar czf server_monitor_linux32.tar.gz monitor

- name: Upload
uses: actions/upload-artifact@v3
with:
path: |
server_monitor_*.tar.gz

- name: Draft Release
uses: softprops/action-gh-release@v1
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
with:
files: server_monitor_linux32.tar.gz
draft: true
tag_name: Alpha

linux64_build:
name: Linux x86_64 Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: docker run -v $GITHUB_WORKSPACE:/root/workdir multiarch/ubuntu-core:amd64-focal /bin/sh -c "apt update && apt install -y bash git python3 python3-pip && cd /root/workdir && chmod +x build-script/build.release.sh && bash build-script/build.release.sh"

- name: Package Release
run: tar czf server_monitor_linux64.tar.gz monitor

- name: Upload
uses: actions/upload-artifact@v3
with:
path: |
server_monitor_*.tar.gz

- name: Draft Release
uses: softprops/action-gh-release@v1
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
with:
files: server_monitor_linux64.tar.gz
draft: true
tag_name: Alpha

# armv7_build:
# name: Linux armv7 Build
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Build
# run: |
# docker run --rm --privileged multiarch/qemu-user-static:register --reset
# docker run -v $GITHUB_WORKSPACE:/root/workdir multiarch/ubuntu-core:armv7-focal /bin/sh -c "apt update && apt install -y bash git python3 python3-pip && cd /root/workdir && chmod +x build-script/build.release.sh && bash build-script/build.release.sh"
# - name: Package Release
# run: tar czf server_monitor_armv7.tar.gz monitor

# - name: Upload
# uses: actions/upload-artifact@v3
# with:
# path: |
# server_monitor_*.tar.gz

# - name: Draft Release
# uses: softprops/action-gh-release@v1
# if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
# with:
# files: server_monitor_armv7.tar.gz
# draft: true
# tag_name: Alpha

arm64_build:
name: Linux arm64 Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: |
docker run --rm --privileged multiarch/qemu-user-static:register --reset
docker run -v $GITHUB_WORKSPACE:/root/workdir multiarch/ubuntu-core:arm64-focal /bin/sh -c "apt update && apt install -y bash git python3 python3-pip && cd /root/workdir && chmod +x build-script/build.release.sh && bash build-script/build.release.sh"
- name: Package Release
run: tar czf server_monitor_arm64.tar.gz monitor

- name: Upload
uses: actions/upload-artifact@v3
with:
path: |
server_monitor_*.tar.gz

- name: Draft Release
uses: softprops/action-gh-release@v1
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
with:
files: server_monitor_arm64.tar.gz
draft: true
tag_name: Alpha

armhf_build:
name: Linux armhf Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: |
docker run --rm --privileged multiarch/qemu-user-static:register --reset
docker run -v $GITHUB_WORKSPACE:/root/workdir multiarch/ubuntu-core:armhf-focal /bin/sh -c "apt update && apt install -y bash git python3 python3-pip && cd /root/workdir && chmod +x build-script/build.release.sh && bash build-script/build.release.sh"
- name: Package Release
run: tar czf server_monitor_armhf.tar.gz monitor

- name: Upload
uses: actions/upload-artifact@v3
with:
path: |
server_monitor_*.tar.gz

- name: Draft Release
uses: softprops/action-gh-release@v1
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
with:
files: server_monitor_armhf.tar.gz
draft: true
tag_name: Alpha

# macos_build:
# name: macOS Build
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v3
# - name: Add commit id into version
# if: ${{ !startsWith(github.ref, 'refs/tags/') }}
# run: SHA=$(git rev-parse --short HEAD) && sed -i -e 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h
# - name: Build
# run: bash build-script/build.macos.release.sh

# - name: Package Release
# run: tar czf server_monitor_darwin64.tar.gz monitor

# - name: Upload
# uses: actions/upload-artifact@v3
# with:
# path: |
# server_monitor_*.tar.gz

# - name: Draft Release
# uses: softprops/action-gh-release@v1
# if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
# with:
# files: server_monitor_darwin64.tar.gz
# draft: true
# tag_name: Alpha

# windows64_build:
# name: Windows x86_64 Build
# runs-on: windows-latest
# defaults:
# run:
# shell: msys2 {0}
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: "16"
# - uses: msys2/setup-msys2@v2
# with:
# update: true
# install: base-devel git mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-libevent mingw-w64-x86_64-pcre2 patch
# msystem: MINGW64
# path-type: inherit
# - name: Add commit id into version
# if: ${{ !startsWith(github.ref, 'refs/tags/') }}
# run: SHA=$(git rev-parse --short HEAD) && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h
# - name: Build
# run: bash build-script/build.windows.release.sh

# - name: Package Release
# run: 7z a server_monitor_win64.7z monitor/

# - name: Upload
# uses: actions/upload-artifact@v3
# with:
# path: |
# server_monitor_*.7z

# - name: Draft Release
# uses: softprops/action-gh-release@v1
# if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
# with:
# files: server_monitor_win64.7z
# draft: true
# tag_name: Alpha

# windows32_build:
# name: Windows x86 Build
# runs-on: windows-latest
# defaults:
# run:
# shell: msys2 {0}
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: "16"
# - uses: msys2/setup-msys2@v2
# with:
# update: true
# install: base-devel git mingw-w64-i686-gcc mingw-w64-i686-cmake mingw-w64-i686-libevent mingw-w64-i686-pcre2 patch
# msystem: MINGW32
# path-type: inherit
# - name: Add commit id into version
# if: ${{ !startsWith(github.ref, 'refs/tags/') }}
# run: SHA=$(git rev-parse --short HEAD) && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h
# - name: Build
# run: bash build-script/build.windows.release.sh

# - name: Package Release
# run: 7z a server_monitor_win32.7z monitor/

# - name: Upload
# uses: actions/upload-artifact@v3
# with:
# path: |
# server_monitor_*.7z

# - name: Draft Release
# uses: softprops/action-gh-release@v1
# if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
# with:
# files: server_monitor_win32.7z
# draft: true
# tag_name: Alpha

Upload-Release:
permissions: write-all
if: ${{ github.ref_type=='branch' }}
needs:
[
linux64_build,
linux32_build,
# armv7_build,
armhf_build,
arm64_build,
# macos_build,
# windows64_build,
# windows32_build,
]
runs-on: ubuntu-latest
steps:
- name: Delete current release assets
uses: andreaswilli/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: Alpha
deleteOnlyFromDrafts: false

- uses: actions/download-artifact@v3
with:
name: artifact
path: bin/

- name: Display structure of downloaded files
run: ls -R
working-directory: bin

- name: Tag Repo
uses: richardsimko/[email protected]
with:
tag_name: Alpha
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Release
uses: softprops/action-gh-release@v1
if: ${{ success() }}
with:
tag: Alpha
tag_name: Alpha
files: bin/*
generate_release_notes: true
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.idea
.env
.uuid
dist/
build/
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3-slim
MAINTAINER LittleJake https://github.com/LittleJake/

WORKDIR /usr/src/app

COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

CMD [ "python", "./report.py" ]
Loading