Skip to content

Commit

Permalink
Merge branch 'devel' into feature/profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
msmannan00 committed Oct 31, 2024
2 parents 6fc256f + 9c62035 commit 7c761c0
Show file tree
Hide file tree
Showing 558 changed files with 38,853 additions and 727 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@evilaliv3
* @globaleaks/maintainers
39 changes: 39 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
open-pull-requests-limit: 0
schedule:
interval: daily

- package-ecosystem: pip
directory: /backend
open-pull-requests-limit: 0
schedule:
interval: daily

- package-ecosystem: pip
directory: backend/requirements
schedule:
interval: "monthly"
labels: [ ]
ignore:
- dependency-name: "*"

- package-ecosystem: npm
directory: /client
open-pull-requests-limit: 0
schedule:
interval: daily

- package-ecosystem: docker
directory: /docker
open-pull-requests-limit: 0
schedule:
interval: daily

- package-ecosystem: pip
directory: /documentation
open-pull-requests-limit: 0
schedule:
interval: daily
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ name: Build

on: [ push, pull_request ]

# Declare default permissions as read only.
permissions: read-all

jobs:
run_build:
runs-on: "ubuntu-latest"
steps:
- name: Check out repository code
uses: actions/checkout@v4
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
fetch-depth: 1

- name: Install git
run: |
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# This workflow checks out code, performs a Codacy security scan
# and integrates the results with the
# GitHub Advanced Security code scanning feature. For more information on
# the Codacy security scan action usage and parameters, see
# https://github.com/codacy/codacy-analysis-cli-action.
# For more information on Codacy Analysis CLI in general, see
# https://github.com/codacy/codacy-analysis-cli.

name: Codacy Security Scan

on:
push:
branches: [ "stable", "devel" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "stable" ]
schedule:
- cron: '33 6 * * 2'

# Declare default permissions as read only.
permissions: read-all

jobs:
codacy-security-scan:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: Codacy Security Scan
runs-on: ubuntu-latest
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout code
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1

# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@d840f886c4bd4edc059706d09c6a1586111c540b
with:
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
# You can also omit the token and run the tools that support default configurations
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
verbose: true
output: results.sarif
format: sarif
# Adjust severity of non-security issues
gh-code-scanning-compat: true
# Force 0 exit code to allow SARIF file generation
# This will handover control about PR rejection to the GitHub side
max-allowed-issues: 2147483647

# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
with:
sarif_file: results.sarif
86 changes: 86 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: "CodeQL"

on:
push:
branches: [ "stable"]
pull_request:
branches: [ "stable", "devel"]
schedule:
- cron: '15 14 * * 6'

# Declare default permissions as read only.
permissions: read-all

jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: javascript-typescript
build-mode: none
- language: python
build-mode: none
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
with:
category: "/language:${{matrix.language}}"
73 changes: 73 additions & 0 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# This workflow uses actions that are not certified by GitHub. They are provided
# by a third-party and are governed by separate terms of service, privacy
# policy, and support documentation.

name: Scorecard supply-chain security
on:
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/stable/docs/checks.md#branch-protection
branch_protection_rule:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/stable/docs/checks.md#maintained
schedule:
- cron: '33 21 * * 4'
push:
branches: [ "stable" ]

# Declare default permissions as read only.
permissions: read-all

jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write
# Uncomment the permissions below if installing in a private repository.
# contents: read
# actions: read

steps:
- name: "Checkout code"
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
with:
results_file: results.sarif
results_format: sarif
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
# - you want to enable the Branch-Protection check on a *public* repository, or
# - you are installing Scorecard on a *private* repository
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
# repo_token: ${{ secrets.SCORECARD_TOKEN }}

# Public repositories:
# - Publish results to OpenSSF REST API for easy access by consumers
# - Allows the repository to include the Scorecard badge.
# - See https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories:
# - `publish_results` will always be set to `false`, regardless
# of the value entered here.
publish_results: true

# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db # v3.pre.node20
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion .github/workflows/scripts/build_and_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e
echo "Running Build & Install"
distro="$(lsb_release -cs)"

cd /build/GlobaLeaks
cd /build/globaleaks-whistleblowing-software

sudo apt-get -y update

Expand Down
17 changes: 1 addition & 16 deletions .github/workflows/scripts/run-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,6 @@

set -e

LOGFILE="/var/globaleaks/log/globaleaks.log"
ACCESSLOG="/var/globaleaks/log/access.log"

function atexit {
if [[ -f $LOGFILE ]]; then
cat $LOGFILE
fi

if [[ -f $ACCESSLOG ]]; then
cat $ACCESSLOG
fi
}

trap atexit EXIT

sudo apt-get install -y debootstrap

export chroot="/tmp/globaleaks_chroot/"
Expand All @@ -38,4 +23,4 @@ sudo -E chroot "$chroot" locale-gen
sudo -E chroot "$chroot" useradd -m builduser
sudo -E su -c 'echo "builduser ALL=NOPASSWD: ALL" >> "$chroot"/etc/sudoers'
sudo -E chroot "$chroot" chown builduser -R /build
sudo -E chroot "$chroot" su - builduser /bin/bash -c '/build/GlobaLeaks/.github/workflows/scripts/build_and_install.sh'
sudo -E chroot "$chroot" su - builduser /bin/bash -c '/build/globaleaks-whistleblowing-software/.github/workflows/scripts/build_and_install.sh'
15 changes: 0 additions & 15 deletions .github/workflows/scripts/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,6 @@

set -e

LOGFILE="$GITHUB_WORKSPACE/backend/workingdir/log/globaleaks.log"
ACCESSLOG="$GITHUB_WORKSPACE/backend/workingdir/log/access.log"

function atexit {
if [[ -f $LOGFILE ]]; then
cat $LOGFILE
fi

if [[ -f $ACCESSLOG ]]; then
cat $ACCESSLOG
fi
}

trap atexit EXIT

setupClient() {
cd $GITHUB_WORKSPACE/client # to install frontend dependencies
npm install -d
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Test

on: [ push, pull_request ]

# Declare default permissions as read only.
permissions: read-all

env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}

Expand All @@ -10,9 +13,9 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: Check out repository code
uses: actions/checkout@v4
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
fetch-depth: 1

- name: Install git
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ backend/env/
backend/workingdir/
client/build
client/node_modules/
documentation/_build
4 changes: 2 additions & 2 deletions .readthedocs.yml → .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

build:
os: ubuntu-22.04
os: ubuntu-lts-latest
tools:
python: "3.12"
python: latest

sphinx:
configuration: documentation/conf.py
Expand Down
4 changes: 2 additions & 2 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Copyright: 2011-2024 - GlobaLeaks

License: https://github.com/globaleaks/GlobaLeaks/blob/main/LICENSE
License: https://github.com/globaleaks/globaleaks-whistleblowing-software/blob/stable/LICENSE

Original authors:
Arturo Filastò
Expand All @@ -11,6 +11,6 @@ Original authors:

Up-to-date team: https://www.globaleaks.org/about/people/

Contributors list: https://github.com/globaleaks/GlobaLeaks/graphs/contributors
Contributors list: https://github.com/globaleaks/globaleaks-whistleblowing-software/graphs/contributors

Special shoutout to the Localization Lab and our translators community for their support over the years: https://www.localizationlab.org/
Loading

0 comments on commit 7c761c0

Please sign in to comment.