diff options
-rw-r--r-- | .github/workflows/build.yml | 18 | ||||
-rw-r--r-- | .github/workflows/codeql-analysis.yml | 2 | ||||
-rw-r--r-- | .github/workflows/test.yml | 4 | ||||
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | README.rst | 22 | ||||
-rw-r--r-- | SECURITY.md | 36 | ||||
-rw-r--r-- | docs/api.rst | 304 | ||||
-rw-r--r-- | docs/conf.py | 2 | ||||
-rw-r--r-- | docs/man/glances.1 | 2 | ||||
-rw-r--r-- | glances/__init__.py | 2 | ||||
-rw-r--r-- | glances/autodiscover.py | 3 | ||||
-rw-r--r-- | glances/outputs/glances_bottle.py | 3 | ||||
-rw-r--r-- | glances/outputs/static/js/components/plugin-processcount.vue | 11 | ||||
-rw-r--r-- | glances/outputs/static/package-lock.json | 13 | ||||
-rw-r--r-- | glances/outputs/static/public/glances.js | 2 | ||||
-rw-r--r-- | glances/password.py | 4 | ||||
-rw-r--r-- | glances/plugins/glances_help.py | 7 | ||||
-rw-r--r-- | glances/server.py | 8 | ||||
-rw-r--r-- | optional-requirements.txt | 8 | ||||
-rw-r--r-- | renovate.json | 6 | ||||
-rw-r--r-- | snap/snapcraft.yaml | 5 | ||||
-rwxr-xr-x | unitest-restful.py | 7 | ||||
-rwxr-xr-x | unitest-xmlrpc.py | 7 |
23 files changed, 279 insertions, 200 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c861028d..2d9d1376 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install pip install build tools run: >- @@ -100,43 +100,43 @@ jobs: tag: ${{ fromJson(needs.create_Docker_builds.outputs.tags) }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Retrieve Repository Docker metadata id: docker_meta - uses: crazy-max/ghaction-docker-meta@v2.5.0 + uses: crazy-max/ghaction-docker-meta@v4.1.1 with: images: ${{ env.DEFAULT_DOCKER_IMAGE }} labels: | org.opencontainers.image.url=https://nicolargo.github.io/glances/ - name: Cache Docker layers - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-${{ env.NODE_ENV }}-${{ matrix.os }}-${{ matrix.tag.tag }} restore-keys: ${{ runner.os }}-buildx-${{ env.NODE_ENV }}-${{ matrix.os }} - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v2 with: platforms: all - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 with: version: latest - name: Login to DockerHub - uses: docker/login-action@v1 + uses: docker/login-action@v2 if: ${{ env.PUSH_BRANCH == 'true' }} with: username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + password: ${{ secrets.DOCKER_TOKEN }} - name: Build and push image - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v3 with: push: ${{ env.PUSH_BRANCH == 'true' }} tags: "${{ env.DEFAULT_DOCKER_IMAGE }}:${{ matrix.os != 'alpine' && format('{0}-', matrix.os) || '' }}${{ matrix.tag.tag }}" diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 36ab13d6..d3237f44 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -39,7 +39,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e8058311..77841f0c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,10 +14,10 @@ jobs: steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -101,6 +101,9 @@ webui: venv-dev-upgrade ## Build the Web UI webui-audit: venv-dev-upgrade ## Audit the Web UI cd glances/outputs/static/ && npm audit +webui-audit-fix: venv-dev-upgrade ## Fix audit the Web UI + cd glances/outputs/static/ && npm audit fix && npm ci && npm run build + # =================================================================== # Packaging # =================================================================== @@ -57,6 +57,18 @@ Glances is written in Python and uses libraries to grab information from your system. It is based on an open architecture where developers can add new plugins or exports modules. +Project sponsorship +=================== + +You can help me to achieve my goals of improving this open-source project +or just say "thank you" by: + +- sponsor me using one-time or monthly tier Github sponsors_ page +- send me some pieces of bitcoin: 185KN9FCix3svJYp7JQM7hRMfSKyeaJR4X +- buy me a gift on my wishlist_ page + +Any and all contributions are greatly appreciated. + Requirements ============ @@ -437,15 +449,6 @@ There is also a chat dedicated to the Glances developers: .. image:: https://badges.gitter.im/Join%20Chat.svg :target: https://gitter.im/nicolargo/glances?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge -Donation -======== - -If you like this open-source project, you can become a sponsor. - -See the Github sponsors_ page (one-time or monthly tier available). - -Or send me some bitcoins: 185KN9FCix3svJYp7JQM7hRMfSKyeaJR4X - Author ====== @@ -468,5 +471,6 @@ Glances is distributed under the LGPL version 3 license. See ``COPYING`` for mor .. _wiki: https://github.com/nicolargo/glances/wiki/How-to-contribute-to-Glances-%3F .. _package: https://repology.org/metapackage/glances/packages .. _sponsors: https://github.com/sponsors/nicolargo +.. _wishlist: https://www.amazon.fr/hz/wishlist/ls/BWAAQKWFR3FI?ref_=wl_share .. _issue2021: https://github.com/nicolargo/glances/issues/2021#issuecomment-1197831157 .. _issue2021comment: https://github.com/nicolargo/glances/issues/2021#issuecomment-1197831157
\ No newline at end of file diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..7676551f --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,36 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Support security updates | +| ------- | ------------------------ | +| 3.x | :white_check_mark: | +| < 3.0 | :x: | + +## Reporting a Vulnerability + +If there are any vulnerabilities in {{cookiecutter.project_name}}, don't hesitate to report them. + + 1. Use any of the private contact addresses: contact@nicolargo.com + + 2. Describe the vulnerability. + + * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) + * Full paths of source file(s) related to the manifestation of the issue + * The location of the affected source code (tag/branch/commit or direct URL) + * Any special configuration required to reproduce the issue + * Step-by-step instructions to reproduce the issue + * Proof-of-concept or exploit code (if possible) + * Impact of the issue, including how an attacker might exploit the issue + + 3. If you have a fix, that is most welcome -- please attach or summarize it in your message! + + 4. We will evaluate the vulnerability and, if necessary, release a fix or mitigating steps to address it. We will contact you to let you know the outcome, and will credit you in the report. + + 5. Please do not disclose the vulnerability publicly until a fix is released! + +Once we have either a) published a fix, or b) declined to address the vulnerability for whatever reason, you are free to publicly disclose it. + diff --git a/docs/api.rst b/docs/api.rst index ac953654..5b7ef009 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -74,7 +74,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.907616376876831}, + "timer": 0.8349730968475342}, {"count": 0, "countmax": 20.0, "countmin": None, @@ -83,7 +83,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.9074501991271973}] + "timer": 0.8347806930541992}] Get a specific field:: @@ -101,7 +101,7 @@ Get a specific item when field matchs the given value:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.907616376876831}]} + "timer": 0.8349730968475342}]} GET core -------- @@ -131,19 +131,19 @@ Get plugin stats:: "ctx_switches": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 31.2, + "idle": 58.5, "interrupts": 0, - "iowait": 0.3, + "iowait": 0.2, "irq": 0.0, "nice": 0.0, "soft_interrupts": 0, - "softirq": 0.3, + "softirq": 0.0, "steal": 0.0, "syscalls": 0, - "system": 16.3, + "system": 7.7, "time_since_update": 1, - "total": 68.6, - "user": 51.8} + "total": 42.5, + "user": 33.6} Fields descriptions: @@ -166,7 +166,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/cpu/total - {"total": 68.6} + {"total": 42.5} GET diskio ---------- @@ -232,13 +232,13 @@ Get plugin stats:: # curl http://localhost:61208/api/3/fs [{"device_name": "/dev/mapper/ubuntu--gnome--vg-root", - "free": 64597147648, + "free": 64580628480, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", "percent": 72.0, "size": 243334156288, - "used": 166349553664}, + "used": 166366072832}, {"device_name": "zsfpool", "free": 41811968, "fs_type": "zfs", @@ -257,13 +257,13 @@ Get a specific item when field matchs the given value:: # curl http://localhost:61208/api/3/fs/mnt_point// {"/": [{"device_name": "/dev/mapper/ubuntu--gnome--vg-root", - "free": 64597147648, + "free": 64580628480, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", "percent": 72.0, "size": 243334156288, - "used": 166349553664}]} + "used": 166366072832}]} GET ip ------ @@ -290,9 +290,9 @@ Get plugin stats:: # curl http://localhost:61208/api/3/load {"cpucore": 4, - "min1": 3.93310546875, - "min15": 1.45654296875, - "min5": 1.90234375} + "min1": 2.24462890625, + "min15": 1.53564453125, + "min5": 1.93896484375} Fields descriptions: @@ -304,7 +304,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/load/min1 - {"min1": 3.93310546875} + {"min1": 2.24462890625} GET mem ------- @@ -312,16 +312,16 @@ GET mem Get plugin stats:: # curl http://localhost:61208/api/3/mem - {"active": 2785243136, - "available": 2688724992, - "buffers": 335642624, - "cached": 3159732224, - "free": 2688724992, - "inactive": 3652173824, + {"active": 2860376064, + "available": 2685345792, + "buffers": 323313664, + "cached": 3103760384, + "free": 2685345792, + "inactive": 3517116416, "percent": 65.7, - "shared": 656850944, + "shared": 659578880, "total": 7836188672, - "used": 5147463680} + "used": 5150842880} Fields descriptions: @@ -348,13 +348,13 @@ GET memswap Get plugin stats:: # curl http://localhost:61208/api/3/memswap - {"free": 4102291456, - "percent": 49.2, - "sin": 2500702208, - "sout": 8687992832, + {"free": 4076023808, + "percent": 49.6, + "sin": 2526023680, + "sout": 8737087488, "time_since_update": 1, "total": 8082419712, - "used": 3980128256} + "used": 4006395904} Fields descriptions: @@ -378,29 +378,29 @@ Get plugin stats:: # curl http://localhost:61208/api/3/network [{"alias": None, - "cumulative_cx": 447086708, - "cumulative_rx": 223543354, - "cumulative_tx": 223543354, - "cx": 5508, + "cumulative_cx": 447423140, + "cumulative_rx": 223711570, + "cumulative_tx": 223711570, + "cx": 6686, "interface_name": "lo", "is_up": True, "key": "interface_name", - "rx": 2754, + "rx": 3343, "speed": 0, "time_since_update": 1, - "tx": 2754}, + "tx": 3343}, {"alias": None, - "cumulative_cx": 9965024132, - "cumulative_rx": 9332509571, - "cumulative_tx": 632514561, - "cx": 36232, + "cumulative_cx": 9984081609, + "cumulative_rx": 9350296796, + "cumulative_tx": 633784813, + "cx": 26612, "interface_name": "wlp2s0", "is_up": True, "key": "interface_name", - "rx": 27771, + "rx": 20103, "speed": 0, "time_since_update": 1, - "tx": 8461}] + "tx": 6509}] Fields descriptions: @@ -430,17 +430,17 @@ Get a specific item when field matchs the given value:: # curl http://localhost:61208/api/3/network/interface_name/lo {"lo": [{"alias": None, - "cumulative_cx": 447086708, - "cumulative_rx": 223543354, - "cumulative_tx": 223543354, - "cx": 5508, + "cumulative_cx": 447423140, + "cumulative_rx": 223711570, + "cumulative_tx": 223711570, + "cx": 6686, "interface_name": "lo", "is_up": True, "key": "interface_name", - "rx": 2754, + "rx": 3343, "speed": 0, "time_since_update": 1, - "tx": 2754}]} + "tx": 3343}]} GET now ------- @@ -448,7 +448,7 @@ GET now Get plugin stats:: # curl http://localhost:61208/api/3/now - "2022-11-03 15:11:38 CET" + "2022-11-03 15:14:06 CET" GET percpu ---------- @@ -459,29 +459,29 @@ Get plugin stats:: [{"cpu_number": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 25.4, + "idle": 46.2, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 13.5, - "total": 74.6, - "user": 61.1}, + "system": 8.7, + "total": 53.8, + "user": 45.2}, {"cpu_number": 1, "guest": 0.0, "guest_nice": 0.0, - "idle": 17.1, + "idle": 27.5, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 13.0, - "total": 82.9, - "user": 69.9}] + "system": 5.9, + "total": 72.5, + "user": 66.7}] Get a specific field:: @@ -500,7 +500,7 @@ Get plugin stats:: "port": 0, "refresh": 30, "rtt_warning": None, - "status": 0.009095, + "status": 0.006428, "timeout": 3}] Get a specific field:: @@ -517,7 +517,7 @@ Get a specific item when field matchs the given value:: "port": 0, "refresh": 30, "rtt_warning": None, - "status": 0.009095, + "status": 0.006428, "timeout": 3}]} GET processcount @@ -526,12 +526,12 @@ GET processcount Get plugin stats:: # curl http://localhost:61208/api/3/processcount - {"pid_max": 0, "running": 2, "sleeping": 323, "thread": 1669, "total": 397} + {"pid_max": 0, "running": 2, "sleeping": 325, "thread": 1668, "total": 399} Get a specific field:: # curl http://localhost:61208/api/3/processcount/total - {"total": 397} + {"total": 399} GET processlist --------------- @@ -559,12 +559,12 @@ Get plugin stats:: "true", "tab"], "cpu_percent": 0.0, - "cpu_times": pcputimes(user=1444.66, system=280.48, children_user=0.0, children_system=0.0, iowait=0.0), + "cpu_times": pcputimes(user=1446.22, system=280.66, children_user=0.0, children_system=0.0, iowait=0.0), "gids": pgids(real=1000, effective=1000, saved=1000), "io_counters": [187703296, 0, 0, 0, 0], "key": "pid", - "memory_info": pmem(rss=432242688, vms=3539845120, shared=63496192, text=634880, lib=0, data=954109952, dirty=0), - "memory_percent": 5.5159811241461645, + "memory_info": pmem(rss=433471488, vms=3539845120, shared=63492096, text=634880, lib=0, data=954109952, dirty=0), + "memory_percent": 5.531662216721062, "name": "WebExtensions", "nice": 0, "num_threads": 20, @@ -574,15 +574,15 @@ Get plugin stats:: "username": "nicolargo"}, {"cmdline": ["/snap/firefox/1943/usr/lib/firefox/firefox"], "cpu_percent": 0.0, - "cpu_times": pcputimes(user=8109.63, system=2748.28, children_user=7689.53, children_system=1363.67, iowait=0.0), + "cpu_times": pcputimes(user=8111.56, system=2748.92, children_user=7689.92, children_system=1363.91, iowait=0.0), "gids": pgids(real=1000, effective=1000, saved=1000), - "io_counters": [4636195840, 9528066048, 0, 0, 0], + "io_counters": [4637037568, 9530970112, 0, 0, 0], "key": "pid", - "memory_info": pmem(rss=412852224, vms=13106331648, shared=104534016, text=634880, lib=0, data=1161588736, dirty=0), - "memory_percent": 5.268533483314272, + "memory_info": pmem(rss=411906048, vms=13106040832, shared=101974016, text=634880, lib=0, data=1161539584, dirty=0), + "memory_percent": 5.256459042031601, "name": "firefox", "nice": 0, - "num_threads": 141, + "num_threads": 138, "pid": 252940, "status": "S", "time_since_update": 1, @@ -593,8 +593,8 @@ Get a specific field:: # curl http://localhost:61208/api/3/processlist/pid {"pid": [253132, 252940, - 590528, 3549, + 590528, 590488, 253182, 479037, @@ -604,26 +604,27 @@ Get a specific field:: 479104, 17347, 549166, - 600987, 253147, 551388, 601048, - 51440, 478972, - 426999, + 51440, + 600633, 479089, - 600295, + 426999, 597870, - 600633, 600923, - 600524, - 479007, + 602248, + 602464, 450641, + 602074, + 479007, + 482393, 590512, 480067, - 482393, - 601101, + 602608, 546430, + 602075, 495478, 4055, 3499, @@ -631,58 +632,59 @@ Get a specific field:: 546431, 521697, 521756, - 590492, 479112, + 590492, 3958, 253071, 253654, 521757, - 450239, 479015, - 521726, + 450239, 255947, - 479296, + 521726, 557500, + 479296, 2917, - 2429, 3651, + 2429, 449090, 3364, 3844, 521696, + 450957, + 4977, 3744, 1369, 3743, - 450957, - 4977, + 17566, 17754, 4062, 17373, 1, - 566917, - 107498, - 17566, 3627, + 107498, 3737, + 566917, 1391, 3929, 478976, - 19717, - 3618, 3760, 544074, + 3618, 17501, 1415, + 19717, 3742, 3345, 1587, + 3528, 107499, 492260, 4087, 3663, 544139, 3806, - 3528, + 3592, 478977, 17308, 1945, @@ -692,7 +694,6 @@ Get a specific field:: 1381, 17346, 3557, - 3592, 17292, 3750, 2371, @@ -701,16 +702,17 @@ Get a specific field:: 1593, 3745, 17755, - 3637, 1487, + 3637, 2412, 1352, + 3378, 2187, 3891, 3739, - 3817, 480091, - 3378, + 3817, + 3373, 51420, 1408, 15018, @@ -723,8 +725,8 @@ Get a specific field:: 17237, 1392, 3943, - 3599, 54676, + 3599, 3588, 1375, 3905, @@ -742,7 +744,6 @@ Get a specific field:: 3583, 523017, 3734, - 3373, 3747, 1397, 3753, @@ -752,13 +753,13 @@ Get a specific field:: 3616, 3362, 1365, - 4518, - 568870, 1412, 3437, 3729, 3361, + 4518, 1360, + 568870, 3385, 3556, 3517, @@ -767,21 +768,22 @@ Get a specific field:: 1399, 1743, 479311, - 568871, 1377, 1176, 17258, + 602118, 1367, + 568871, 2405, 1470, 2920, + 450933, 3953, 17516, 2406, - 600957, + 602583, 181215, 58637, - 450933, 478993, 58407, 54523, @@ -790,7 +792,7 @@ Get a specific field:: 181225, 1353, 478979, - 601099, + 602607, 181228, 2208, 3733, @@ -968,7 +970,6 @@ Get a specific field:: 593509, 593607, 595904, - 598308, 598508, 598537, 598538, @@ -987,7 +988,8 @@ Get a specific field:: 600991, 600996, 601037, - 601072]} + 601072, + 602168]} Get a specific item when field matchs the given value:: @@ -1012,18 +1014,18 @@ Get a specific item when field matchs the given value:: "true", "tab"], "cpu_percent": 0.0, - "cpu_times": [1444.66, 280.48, 0.0, 0.0, 0.0], + "cpu_times": [1446.22, 280.66, 0.0, 0.0, 0.0], "gids": [1000, 1000, 1000], "io_counters": [187703296, 0, 0, 0, 0], "key": "pid", - "memory_info": [432242688, + "memory_info": [433471488, 3539845120, - 63496192, + 63492096, 634880, 0, 954109952, 0], - "memory_percent": 5.5159811241461645, + "memory_percent": 5.531662216721062, "name": "WebExtensions", "nice": 0, "num_threads": 20, @@ -1046,69 +1048,69 @@ GET quicklook Get plugin stats:: # curl http://localhost:61208/api/3/quicklook - {"cpu": 68.6, + {"cpu": 42.5, "cpu_hz": 1700000000.0, - "cpu_hz_current": 1698025750.0, + "cpu_hz_current": 1471213500.0, "cpu_name": "Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz", "mem": 65.7, "percpu": [{"cpu_number": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 25.4, + "idle": 46.2, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 13.5, - "total": 74.6, - "user": 61.1}, + "system": 8.7, + "total": 53.8, + "user": 45.2}, {"cpu_number": 1, "guest": 0.0, "guest_nice": 0.0, - "idle": 17.1, + "idle": 27.5, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 13.0, - "total": 82.9, - "user": 69.9}, + "system": 5.9, + "total": 72.5, + "user": 66.7}, {"cpu_number": 2, "guest": 0.0, "guest_nice": 0.0, - "idle": 44.5, - "iowait": 0.8, + "idle": 75.7, + "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, - "softirq": 1.7, + "softirq": 0.0, "steal": 0.0, - "system": 16.8, - "total": 55.5, - "user": 36.1}, + "system": 6.8, + "total": 24.3, + "user": 17.5}, {"cpu_number": 3, "guest": 0.0, "guest_nice": 0.0, - "idle": 37.7, - |