From f40865f0c3fc0c4475cab1d93ead92392675bfd4 Mon Sep 17 00:00:00 2001 From: Jeroen Willemsen Date: Wed, 13 Mar 2024 04:51:08 +0100 Subject: [PATCH 1/2] answer: VBUGh3wu/3I1naHj1Uf97Y0Lq8B5/92q1jwp3/aYSwHSJI8WqdZnYLj78hESlfPPKf1ZKPap4z2+r+G9NRwdFU/YBMTY3cNguMm5C6l2pTK9JhPFnUzerIwMrnhu9GjrqSFn/BtOvLnQa/mSgXDNJYUOU8gCHFs9JEeQv9hpWpyxlB2Nqu0MHrPNODY3ZohhkjWXaxbjCZi9SpmHydU06Z7LqWyF39G6V8CF6LBPkdUn3aJAV++F0Q9Id --- src/main/resources/templates/stats.html | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/resources/templates/stats.html b/src/main/resources/templates/stats.html index a90447f0f..ae9b88500 100644 --- a/src/main/resources/templates/stats.html +++ b/src/main/resources/templates/stats.html @@ -13,7 +13,6 @@

Number of active sessions:
Number of canary callbacks since boot:
- Active sessions are currently active visitors to challenges.




From 68c688481772be03ae392fe724fb2e8bb0c18359 Mon Sep 17 00:00:00 2001 From: Jeroen Willemsen Date: Wed, 13 Mar 2024 12:14:25 +0100 Subject: [PATCH 2/2] fixed contributor generator for python 3.12 relying on pipenv now --- scripts/sort_contibutors/main.py | 5 +---- scripts/sort_contibutors/readme.md | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/scripts/sort_contibutors/main.py b/scripts/sort_contibutors/main.py index 223308c13..1b2ffeb48 100644 --- a/scripts/sort_contibutors/main.py +++ b/scripts/sort_contibutors/main.py @@ -1,7 +1,5 @@ import os - import requests -from dotenv import load_dotenv # This function parses the contribution list, sorting # the users per its ranks @@ -217,8 +215,7 @@ def get_contibutors_list(token: str) -> list: # THE MAIN PROGRAM STARTS HERE # ============================================================= -# Loads the .env file -load_dotenv() +# Make sure you load a user token in env token = os.getenv("USER_TOKEN") if token is not None: diff --git a/scripts/sort_contibutors/readme.md b/scripts/sort_contibutors/readme.md index 4b529b714..84d546881 100644 --- a/scripts/sort_contibutors/readme.md +++ b/scripts/sort_contibutors/readme.md @@ -5,13 +5,21 @@ This script is used to generate the contributor-list for home.html and for the v ## Installation and run -First of all, you need to setup the ```.env``` file which contains the USER_TOKEN variable. You may follow the following steps: -* [Click here](https://github.com/settings/tokens?type=beta) to setup a Fine-grained token -* Create a token. Note that the *USER_TOKEN* requires "repository access" only -* Open the terminal in the same directory as the *main.py* script and type: ```echo USER_TOKEN=github_pat_TOKEN > .env``` +1. Make sure you get a fine grained access token from github to read the repositories (https://github.com/settings/tokens?type=beta): +- go to https://github.com/settings/tokens?type=beta +- create a token and make sure it has "repository access" only +- store the token in a safe secrets manager and export it before you run it (`export USER_TOKEN=github_pat`). -This script does not use external libraries so just run it directly, and to do so open the terminal and type: +2. When on macos, install the requests library if you are using python 3.12 or higher: ```sh +brew install pipenv +pipenv install requests +``` + +3. Now run the script; + +```sh +pipenv shell python3 main.py ```