Skip to content

Commit

Permalink
Merge pull request #194 from BenediktMKuehne/copyright-update
Browse files Browse the repository at this point in the history
Update Meta information
  • Loading branch information
m-1-k-3 authored Feb 29, 2024
2 parents 2457c04 + be5c5f9 commit 723a849
Show file tree
Hide file tree
Showing 61 changed files with 342 additions and 9 deletions.
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2021 The AMOS Projects
Copyright (c) 2021-2024 Siemens Energy AG

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 2 additions & 0 deletions dev-tools/debug-server-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export NC='\033[0m' # no color

export DJANGO_SETTINGS_MODULE=embark.settings.dev

export NO_UPDATE_CHECK=1

export WSL=0

cleaner() {
Expand Down
100 changes: 100 additions & 0 deletions dev-tools/write-header.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#!/bin/bash
# EMBArk - The firmware security scanning environment
#
# Copyright 2020-2024 Siemens Energy AG
#
# EMBArk comes with ABSOLUTELY NO WARRANTY.
#
# EMBArk is licensed under MIT
#
# Author(s): Benedikt Kuehne

# Description: Helper script to get our Copyright things in order

# RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
BOLD='\033[1m'
NC='\033[0m' # no color


EXCEPTIONS_TO_CHECK_ARR=()

write_headers(){
# writes header info into python files
# $1 end-year
# $2 dir to look in
# $3 excluded dir for find
local YEAR_="${1:-}"
local DIR_="${2:-}"



echo "start finding files"
mapfile -t PYTHON_FILES < <(find "${DIR_}" -type d -path ".*" -prune -false -o -type d -path "migrations" -prune -false -o -type d -path "${PWD}/emba" -prune -false -o -iname "*.py")
if [[ "${#PYTHON_FILES[@]}" -gt 0 ]]; then
for FILE_ in "${PYTHON_FILES[@]}"; do

if grep -q "__copyright__" "${FILE_}" ; then
continue
fi

local STARTYEAR=""
local COPYRIGHT_HEADER="__copyright__ = 'Copyright ${STARTYEAR}-${YEAR_} Siemens Energy AG'"
local AUTHOR_ARR=()
local AUTHOR_HEADER="__author__ = '"
local LICENSE_HEADER="__license__ = 'MIT'"

readarray -t AUTHOR_ARR < <(git shortlog -n -s "${FILE_}" 2>/dev/null | sort -gr | cut -c 8- ) # gets commit count for file/folder
AUTHOR_ARR=( "${AUTHOR_ARR[@]/%/,}" )
AUTHOR_HEADER+="${AUTHOR_ARR[]}"
AUTHOR_HEADER="${AUTHOR_HEADER%?}'"

STARTYEAR="$(git log --follow --format=%ad --date default "${FILE_}" | tail -1 | cut -d ' ' -f 5)"

echo "debug-print \$\{\#AUTHOR_ARR\[\@\]\} ${#AUTHOR_ARR[@]}"
echo "debug-print \$\{AUTHOR_ARR\[\*\]\} ${AUTHOR_ARR[*]}"
if [[ "${#AUTHOR_ARR[@]}" -eq 1 && ! "${AUTHOR_ARR[*]}" =~ "Benedikt" ]]; then
# add AMOS copyright
COPYRIGHT_HEADER="${COPYRIGHT_HEADER%?}, Copyright 2021 The AMOS Projects'"
fi


# debug messages
echo "FILE: ${FILE_}"
echo "get copyright: ${COPYRIGHT_HEADER}"
echo "gets authors: ${AUTHOR_HEADER}"
echo "gets license: ${LICENSE_HEADER}"
echo "file first line is:"
head -n 1 "${FILE_}"
echo


if ! ( head -n 1 "${FILE_}" | grep -q '#' ) ; then
echo "Doesn't have a #"
sed -i "1s/^/${LICENSE_HEADER}\n\n/" "${FILE_}"
sed -i "1s/^/${AUTHOR_HEADER}\n/" "${FILE_}"
sed -i "1s/^/${COPYRIGHT_HEADER}\n/" "${FILE_}"
else
echo "HAS a #"

EXCEPTIONS_TO_CHECK_ARR+=( "${FILE_}" )
echo -e "Found problem with ${ORANGE}${FILE_}""${NC}""\\n"
echo -e "\\n""${ORANGE}${BOLD}==> FIX ERRORS""${NC}""\\n"

fi
done
else
echo -e "\\n""${GREEN}""==> Found no Python files""${NC}""\\n"
fi
}


write_headers 2024 "${PWD}/embark/"


if [[ "${#EXCEPTIONS_TO_CHECK_ARR[@]}" -gt 0 ]]; then
echo -e "${ORANGE}${BOLD}==> Please take a look at those Exceptions!""${NC}"
fi
echo -e "${GREEN}${BOLD}===> ALL CHECKS SUCCESSFUL""${NC}"
exit 0
4 changes: 4 additions & 0 deletions embark/dashboard/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2022-2024 Siemens Energy AG'
__author__ = 'Benedikt Kuehne'
__license__ = 'MIT'

from django.contrib import admin

from dashboard.models import Result
Expand Down
4 changes: 4 additions & 0 deletions embark/dashboard/apps.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2022-2024 Siemens Energy AG'
__author__ = 'Benedikt Kuehne'
__license__ = 'MIT'

from django.apps import AppConfig


Expand Down
4 changes: 4 additions & 0 deletions embark/dashboard/forms.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2022-2024 Siemens Energy AG'
__author__ = 'Benedikt Kuehne'
__license__ = 'MIT'

import logging
from django import forms

Expand Down
4 changes: 4 additions & 0 deletions embark/dashboard/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2022-2024 Siemens Energy AG'
__author__ = 'Benedikt Kuehne'
__license__ = 'MIT'

from django.db import models
from django.core.validators import MinLengthValidator

Expand Down
4 changes: 4 additions & 0 deletions embark/dashboard/urls.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2022-2024 Siemens Energy AG, Copyright 2023 Christian Bieg'
__author__ = 'Benedikt Kuehne, Christian Bieg'
__license__ = 'MIT'

from django.urls import path

from dashboard import views
Expand Down
4 changes: 4 additions & 0 deletions embark/dashboard/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2022-2024 Siemens Energy AG, Copyright 2023 Christian Bieg'
__author__ = 'Benedikt Kuehne, Christian Bieg'
__license__ = 'MIT'

import builtins
import logging
import os
Expand Down
4 changes: 4 additions & 0 deletions embark/embark/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2021-2024 Siemens Energy AG, Copyright 2021 The AMOS Projects'
__author__ = 'Benedikt Kuehne, diegiesskanne'
__license__ = 'MIT'

from subprocess import Popen, PIPE
import logging

Expand Down
3 changes: 3 additions & 0 deletions embark/embark/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
"""
__copyright__ = 'Copyright 2021-2024 Siemens Energy AG, Copyright 2021 The AMOS Projects'
__author__ = 'Benedikt Kuehne, diegiesskanne, m-1-k-3'
__license__ = 'MIT'

import os

Expand Down
4 changes: 4 additions & 0 deletions embark/embark/consumers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# pylint: disable=W0201
__copyright__ = 'Copyright 2021-2024 Siemens Energy AG, Copyright 2021 The AMOS Projects, Copyright 2023 Christian Bieg'
__author__ = 'Benedikt Kuehne, diegiesskanne, m-1-k-3, Maximilian Wagner, Garima Chauhan, Christian Bieg, Ashutosh Singh'
__license__ = 'MIT'

import json
import logging

Expand Down
4 changes: 4 additions & 0 deletions embark/embark/helper.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2022-2024 Siemens Energy AG'
__author__ = 'Benedikt Kuehne'
__license__ = 'MIT'

from random import randrange
import os

Expand Down
4 changes: 4 additions & 0 deletions embark/embark/logreader.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# pylint: disable=W0602
# ignores no-assignment error since there is one!
__copyright__ = 'Copyright 2021-2024 Siemens Energy AG, Copyright 2021 The AMOS Projects'
__author__ = 'Benedikt Kuehne, m-1-k-3, diegiesskanne, Maximilian Wagner, Garima Chauhan, Ashutosh Singh'
__license__ = 'MIT'

import builtins
import difflib
import pathlib
Expand Down
4 changes: 4 additions & 0 deletions embark/embark/logviewer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2023 Christian Bieg'
__author__ = 'Christian Bieg'
__license__ = 'MIT'

import asyncio
import os
import base64
Expand Down
4 changes: 4 additions & 0 deletions embark/embark/routing.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2021-2024 Siemens Energy AG, Copyright 2021 The AMOS Projects, Copyright 2023 Christian Bieg'
__author__ = 'm-1-k-3, diegiesskanne, Benedikt Kuehne, Garima Chauhan, Christian Bieg'
__license__ = 'MIT'

from django.urls import path
# from django.urls import re_path
# from django.conf.urls import url
Expand Down
4 changes: 4 additions & 0 deletions embark/embark/settings/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Django settings for djangoProject project.
Generated by 'django-admin startproject' using Django 3.2.
"""
__copyright__ = 'Copyright 2021-2024 Siemens Energy AG'
__author__ = 'Benedikt Kuehne'
__license__ = 'MIT'

from pathlib import Path
import os
import pytz
Expand Down
4 changes: 4 additions & 0 deletions embark/embark/settings/dev.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2021-2024 Siemens Energy AG'
__author__ = 'Benedikt Kuehne'
__license__ = 'MIT'

from pathlib import Path
import os
import pytz
Expand Down
4 changes: 4 additions & 0 deletions embark/embark/test_logreader.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2021-2024 Siemens Energy AG, Copyright 2021 The AMOS Projects'
__author__ = 'Benedikt Kuehne, diegiesskanne, m-1-k-3, Maximilian Wagner, Ashutosh Singh'
__license__ = 'MIT'

import filecmp
import logging
import os
Expand Down
4 changes: 4 additions & 0 deletions embark/embark/tests/test_linecache.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2023 Christian Bieg'
__author__ = 'Christian Bieg'
__license__ = 'MIT'

import unittest

from embark.logviewer import LineCache
Expand Down
4 changes: 4 additions & 0 deletions embark/embark/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
__copyright__ = 'Copyright 2021-2024 Siemens Energy AG, Copyright 2021 The AMOS Projects'
__author__ = 'm-1-k-3, RaviChandra, Garima Chauhan, Maximilian Wagner, diegiesskanne'
__license__ = 'MIT'

# from django.contrib import admin
from django.urls import path, include
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
Expand Down
3 changes: 3 additions & 0 deletions embark/embark/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
__copyright__ = 'Copyright 2021-2024 Siemens Energy AG, Copyright 2021 The AMOS Projects'
__author__ = 'Benedikt Kuehne, diegiesskanne'
__license__ = 'MIT'

import os

Expand Down
4 changes: 4 additions & 0 deletions embark/lib/choice_enum.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2021-2024 Siemens Energy AG, Copyright 2021 The AMOS Projects'
__author__ = 'Garima Chauhan'
__license__ = 'MIT'

import enum


Expand Down
4 changes: 4 additions & 0 deletions embark/porter/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2022-2024 Siemens Energy AG'
__author__ = 'Benedikt Kuehne'
__license__ = 'MIT'

from django.contrib import admin
from porter.models import LogZipFile

Expand Down
4 changes: 4 additions & 0 deletions embark/porter/apps.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2022-2024 Siemens Energy AG'
__author__ = 'Benedikt Kuehne'
__license__ = 'MIT'

from django.apps import AppConfig


Expand Down
4 changes: 4 additions & 0 deletions embark/porter/exporter.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2022-2024 Siemens Energy AG'
__author__ = 'Benedikt Kuehne'
__license__ = 'MIT'

import logging
# from django.conf import settings

Expand Down
4 changes: 4 additions & 0 deletions embark/porter/forms.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2022-2024 Siemens Energy AG'
__author__ = 'Benedikt Kuehne'
__license__ = 'MIT'

import logging

from django import forms
Expand Down
4 changes: 4 additions & 0 deletions embark/porter/importer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# pylint: disable=C0201
__copyright__ = 'Copyright 2022-2024 Siemens Energy AG'
__author__ = 'Benedikt Kuehne'
__license__ = 'MIT'

import builtins
import logging
import csv
Expand Down
4 changes: 4 additions & 0 deletions embark/porter/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2022-2024 Siemens Energy AG'
__author__ = 'Benedikt Kuehne'
__license__ = 'MIT'

import os
import logging
import uuid
Expand Down
4 changes: 4 additions & 0 deletions embark/porter/tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2022-2024 Siemens Energy AG'
__author__ = 'Benedikt Kuehne'
__license__ = 'MIT'

import json
import logging
import os
Expand Down
4 changes: 4 additions & 0 deletions embark/porter/urls.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2022-2024 Siemens Energy AG'
__author__ = 'Benedikt Kuehne'
__license__ = 'MIT'

from django.urls import path

from porter import views
Expand Down
4 changes: 4 additions & 0 deletions embark/porter/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2022-2024 Siemens Energy AG'
__author__ = 'Benedikt Kuehne'
__license__ = 'MIT'

from http import HTTPStatus
import logging
import os
Expand Down
4 changes: 4 additions & 0 deletions embark/reporter/apps.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2022-2024 Siemens Energy AG'
__author__ = 'Benedikt Kuehne'
__license__ = 'MIT'

from django.apps import AppConfig


Expand Down
4 changes: 4 additions & 0 deletions embark/reporter/tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2022-2024 Siemens Energy AG'
__author__ = 'Benedikt Kuehne'
__license__ = 'MIT'

from django.test import TestCase


Expand Down
4 changes: 4 additions & 0 deletions embark/reporter/urls.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__copyright__ = 'Copyright 2021-2024 Siemens Energy AG'
__author__ = 'Benedikt Kuehne'
__license__ = 'MIT'

from django.conf import settings
from django.urls import path

Expand Down
4 changes: 4 additions & 0 deletions embark/reporter/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# pylint: disable=W0613,C0206
__copyright__ = 'Copyright 2021-2024 Siemens Energy AG'
__author__ = 'Benedikt Kuehne'
__license__ = 'MIT'

from pathlib import Path

import json
Expand Down
Loading

0 comments on commit 723a849

Please sign in to comment.