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

Hotfix contributor patch #1275

Merged
merged 2 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 1 addition & 4 deletions scripts/sort_contibutors/main.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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:
Expand Down
18 changes: 13 additions & 5 deletions scripts/sort_contibutors/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<redacted>`).

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
```
1 change: 0 additions & 1 deletion src/main/resources/templates/stats.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<p>
Number of active sessions: <span th:text="${sessioncounter}"></span><br/>
Number of canary callbacks since boot: <span th:text="${canaryCounter}"></span><br/>
Active sessions are currently active visitors to challenges.<br/>
<span class="d-none d-lg-block"><br/><br/></span>
<span class="d-none d-lg-block" th:if="${springdocenabled==true}"><br/><br/></span>
</p>
Expand Down
Loading