Skip to content

Commit

Permalink
Merge pull request #61 from DSD-DBS/license-headers
Browse files Browse the repository at this point in the history
License headers
  • Loading branch information
MoritzWeber0 authored Apr 21, 2022
2 parents a398376 + 6a26b08 commit acc2ed9
Show file tree
Hide file tree
Showing 368 changed files with 2,012 additions and 688 deletions.
39 changes: 39 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

repos:
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.13
hooks:
- id: insert-license
name: Insert Licence for Python, YAML and Dockerfiles
files: '\.py$|\.yaml$|^Dockerfile$|^Makefile$'
args:
- --license-filepath
- license_header.txt
- --comment-style
- '#'
- id: insert-license
name: Insert Licence for HTML files
files: '\.html$'
args:
- --license-filepath
- license_header.txt
- --comment-style
- '<!--| ~| -->'
- id: insert-license
name: Insert Licence for Typescript files
files: '\.ts$'
args:
- --license-filepath
- license_header.txt
- --comment-style
- '//'
- id: insert-license
name: Insert Licence for CSS files
files: '\.css$'
args:
- --license-filepath
- license_header.txt
- --comment-style
- '/*| *| */'
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

CLUSTER_NAME = mycluster
LOCAL_REGISTRY_NAME = localhost
CLUSTER_REGISTRY_NAME = myregistry.localhost
Expand Down
3 changes: 3 additions & 0 deletions backend/setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

import setuptools

setuptools.setup()
3 changes: 3 additions & 0 deletions backend/t4cclient/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

import logging
import random
import string
Expand Down
3 changes: 3 additions & 0 deletions backend/t4cclient/__main__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

import uvicorn
from t4cclient import app

Expand Down
3 changes: 3 additions & 0 deletions backend/t4cclient/alembic/env.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

import os
from logging.config import fileConfig

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

"""Add t4c username to ease backup
Revision ID: 0a16fb85f762
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

"""Remove RDP Username
Revision ID: 1b4c1dc944d6
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

"""session: add passwords for rdp and guacamole
Revision ID: 279ec954b302
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

"""Add notices datastructures
Revision ID: 2eeda6a7bd66
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

"""Link Git Repositories with Projects
Revision ID: 377b60de4441
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

"""Use repository_name instead of repository_id as Foreign Key
Revision ID: 52aec4f341a5
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

"""Add Persistent Enum
Revision ID: 687484695147
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

"""Add DatabaseProject
Revision ID: 6a8bdec1dccb
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

"""Remove unique constraint for project
Revision ID: 9259062f0f62
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

"""Add Git models for repositories
Revision ID: bfafdd03e30c
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

"""Merge branches permissions and guacamole-rework
Revision ID: c926d3e402a8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

"""Add EASE backup table
Revision ID: caa0ecb7b28d
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

"""Add host to Session
Revision ID: d3c85f34aae6
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

"""Add credentials for gitmodels
Revision ID: d6a23ac7f263
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

"""Add cascades
Revision ID: d7fe491603c3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

"""Add JenkinsPipeline
Revision ID: f3ed32b2cfb0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

"""Add read/write access
Revision ID: f3efdcedfdde
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

"""Use Project ID as reference instead of Project Name
Revision ID: fc6250459067
Expand Down
3 changes: 3 additions & 0 deletions backend/t4cclient/config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

import configparser
import logging
import os
Expand Down
3 changes: 3 additions & 0 deletions backend/t4cclient/core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

3 changes: 3 additions & 0 deletions backend/t4cclient/core/credentials.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

import secrets
import string

Expand Down
37 changes: 20 additions & 17 deletions backend/t4cclient/core/database/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from t4cclient import config

engine = create_engine(config.DATABASE_URL)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)

Base = declarative_base()


def get_db():
db = SessionLocal()
try:
yield db
finally:
db.close()
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from t4cclient import config

engine = create_engine(config.DATABASE_URL)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)

Base = declarative_base()


def get_db():
db = SessionLocal()
try:
yield db
finally:
db.close()
3 changes: 3 additions & 0 deletions backend/t4cclient/core/database/__main__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

import logging
import os
import pathlib
Expand Down
3 changes: 3 additions & 0 deletions backend/t4cclient/core/database/notices.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

from sqlalchemy.orm import Session
from t4cclient.schemas.notices import CreateNoticeRequest, NoticeResponse
from t4cclient.sql_models.notices import DatabaseNotice
Expand Down
53 changes: 28 additions & 25 deletions backend/t4cclient/core/database/repositories.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
import typing as t

from sqlalchemy.orm import Session
from t4cclient.sql_models.repositories import DatabaseRepository


def get_repository(db: Session, name: str):
return db.query(DatabaseRepository).filter(DatabaseRepository.name == name).first()


def get_all_repositories(db: Session) -> t.List[DatabaseRepository]:
return db.query(DatabaseRepository).all()


def create_repository(db: Session, name: str):
repo = DatabaseRepository(name=name, users=[])
db.add(repo)
db.commit()
db.refresh(repo)
return repo


def delete_repository(db: Session, name: str):
db.query(DatabaseRepository).filter(DatabaseRepository.name == name).delete()
db.commit()
# Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: Apache-2.0

import typing as t

from sqlalchemy.orm import Session
from t4cclient.sql_models.repositories import DatabaseRepository


def get_repository(db: Session, name: str):
return db.query(DatabaseRepository).filter(DatabaseRepository.name == name).first()


def get_all_repositories(db: Session) -> t.List[DatabaseRepository]:
return db.query(DatabaseRepository).all()


def create_repository(db: Session, name: str):
repo = DatabaseRepository(name=name, users=[])
db.add(repo)
db.commit()
db.refresh(repo)
return repo


def delete_repository(db: Session, name: str):
db.query(DatabaseRepository).filter(DatabaseRepository.name == name).delete()
db.commit()
Loading

0 comments on commit acc2ed9

Please sign in to comment.