Skip to content
Merged

Dev #607

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
6e9d272
initial commit, added API call and dynamically generated .conf for re…
Oct 31, 2025
bad4cb7
fixed issue with theiaide and rstudio, should be working now
Nov 4, 2025
1d604ff
added get_backends_by_id(int id) and implemented it in update_backend…
milo39 Nov 5, 2025
ee09ea5
backend_update_auth now has different exception responses (404/500) f…
milo39 Nov 5, 2025
b434472
minor corrections
milo39 Nov 13, 2025
1601e3b
implemented and fixed switch function with auth status output. minor …
milo39 Nov 27, 2025
60251d8
refactored update backend authorization flow, changed return types, i…
milo39 Dec 4, 2025
99f93fa
started adding unit tests for views/backend.py and service/backend.py
milo39 Dec 17, 2025
eee4076
unfinished, wrote unit tests for parts of service/backend.py and view…
milo39 Jan 8, 2026
e2d0972
test
vktrrdk Jan 8, 2026
9e8c631
Added helper functions and refactored backend authorization update lo…
milo39 Jan 13, 2026
e92f18f
backend service: refactored and debloated create_backend() by adding …
milo39 Jan 13, 2026
0ad366a
refactored delete_backend() by splitting into sub functions
milo39 Jan 15, 2026
bc80914
removed unneccessary async calls and commented out existing functions
milo39 Jan 17, 2026
81ef9b5
testing environment, added some test functions
milo39 Jan 20, 2026
d7ff550
feat(Tests):updated tests (#535) and also some changes in templating
dweinholz Jan 21, 2026
9c6a722
finished test_views_backend, started test_service_backend, improvemen…
milo39 Jan 21, 2026
0cca71c
added tests to test_service_backend.py, corrections to service/backen…
milo39 Jan 21, 2026
cd9f4eb
refactored some backend functions for clarity and consistency; added …
milo39 Jan 21, 2026
55ce4da
added tests to service/backend.py
milo39 Jan 21, 2026
e06af18
added further tests
milo39 Jan 21, 2026
8708a23
finished test_convert_backend_temp_to_out, added conftest.py and test…
milo39 Jan 26, 2026
0bbf613
finished test_check_backend_path_file()
milo39 Jan 26, 2026
9d0c857
finished test_check_backend_path_file_naming and changed to original …
milo39 Jan 26, 2026
a91b76b
added helper_create_backend_file, might need to refactor to mock os f…
milo39 Jan 26, 2026
bac4dc1
refactored tests to mock os functions, added test_get_backend_path_fi…
milo39 Jan 29, 2026
f274bc9
fixed issue with create_instance
milo39 Feb 5, 2026
8d79b6b
cleaned up some log calls
milo39 Feb 6, 2026
fbfff3a
Enhance backend service logging and error handling; refactor create_b…
milo39 Mar 1, 2026
b476870
finished tests
milo39 Mar 5, 2026
40b66a4
changed info to debug log
dweinholz Mar 5, 2026
d9b62dc
changed info to debug log
dweinholz Mar 5, 2026
7b06957
updated all template example files
milo39 Mar 9, 2026
7676244
removed auth-toggle from all example templates except for emgb and de…
milo39 Mar 9, 2026
3611bb1
requested changes, refactored generate_suffix_number(), added version…
milo39 Mar 9, 2026
06b9071
added test for get_highest_suffix_number() and deleted old test files
milo39 Mar 9, 2026
68fa927
fixed filename_regex and updated and deleted example templates
milo39 Mar 10, 2026
c14b541
changed rights of shiny%v01.conf
milo39 Mar 10, 2026
eb3fc61
fixed get_backend for backwards compatibility
milo39 Mar 10, 2026
6ccec2b
fix to fix get_backends()
milo39 Mar 10, 2026
1e415d9
fix 3 to get_backends()
milo39 Mar 10, 2026
2786268
Rename shiny%v01.conf to webservice%v01.conf
dweinholz Mar 11, 2026
911233b
Create guacamole_vnc%v03.conf
dweinholz Mar 12, 2026
aa8f647
Merge pull request #574 from deNBI/master
dweinholz May 22, 2026
b5b13fc
merged dev
dweinholz May 22, 2026
f193dd9
Merge pull request #555 from deNBI/feat/auth_switch
dweinholz May 22, 2026
94e87d9
fix(Renovate): Adjust config to label security fixes as such in PR
vktrrdk Jun 1, 2026
3338963
feat(Dependencies): Update dependency fastapi to v0.138.0
renovate[bot] Jun 20, 2026
1ed8589
Merge pull request #576 from deNBI/deps/fastapi-0.x
dweinholz Jun 22, 2026
512d13d
feat(Dependencies): Update python Docker tag to v3.14.6
renovate[bot] Jun 22, 2026
32ac3c7
feat(Dependencies): Update dependency pytest-asyncio to v1.4.0
renovate[bot] Jun 22, 2026
f12ad43
feat(Dependencies): Update dependency uvicorn to v0.49.0
renovate[bot] Jun 22, 2026
3b884ba
feat(Dependencies): Update actions/checkout action to v7
renovate[bot] Jun 22, 2026
c6972f9
Merge pull request #582 from deNBI/deps/actions-checkout-7.x
dweinholz Jun 22, 2026
89e11a9
Merge pull request #577 from deNBI/deps/uvicorn-0.x
dweinholz Jun 22, 2026
bb50ca4
Merge pull request #578 from deNBI/deps/pytest-asyncio-1.x
dweinholz Jun 22, 2026
ae68721
Merge pull request #580 from deNBI/deps/python-3.x
dweinholz Jun 22, 2026
0592ae5
feat(Dependencies): Update dependency pytest to v9 [SECURITY]
renovate[bot] Jul 1, 2026
cc4ce8c
Merge pull request #584 from deNBI/deps/pypi-pytest-vulnerability
dweinholz Jul 1, 2026
a79da74
feat(Dependencies): Update dependency fastapi to v0.139.0
renovate[bot] Jul 2, 2026
2d15db3
Merge pull request #583 from deNBI/deps/fastapi-0.x
dweinholz Jul 6, 2026
c2fc3bb
feat(Dependencies): Pin dependencies
renovate[bot] Jul 7, 2026
71149e6
Merge pull request #587 from deNBI/deps/pin-dependencies
dweinholz Jul 7, 2026
54f1f63
Remove rewrite from webservice (trailing path) (#589)
milo39 Jul 15, 2026
3d14b40
feat(Dependencies): Update github/codeql-action digest to 99df26d
renovate[bot] Jul 15, 2026
1de0c57
Merge pull request #588 from deNBI/deps/github-codeql-action-digest
dweinholz Jul 15, 2026
a9cbba3
feat(Dependencies): Update dependency fastapi to v0.139.1
renovate[bot] Jul 16, 2026
a255251
Merge pull request #590 from deNBI/deps/fastapi-0.x
vktrrdk Jul 16, 2026
b042f84
feat(Dependencies): Update dependency fastapi to v0.139.2
renovate[bot] Jul 17, 2026
1a7fa6c
Merge pull request #592 from deNBI/deps/fastapi-0.x
vktrrdk Jul 17, 2026
40cc954
feat(Dependencies): Update dependency pytest to v9.1.1
renovate[bot] Jul 17, 2026
24baf73
feat(Dependencies): Update dependency uvicorn to v0.51.0
renovate[bot] Jul 17, 2026
7e651c2
Merge pull request #586 from deNBI/deps/uvicorn-0.x
vktrrdk Jul 17, 2026
ec699f9
Merge pull request #575 from deNBI/deps/pytest-9.x
vktrrdk Jul 17, 2026
f76ef0d
started reiplenting for docker
dweinholz Jul 27, 2026
76337e6
added test compose§
dweinholz Jul 27, 2026
bf3c51c
render nginx config with jinja2
dweinholz Jul 27, 2026
e6bc790
added container name
dweinholz Jul 27, 2026
78866f8
updated script
dweinholz Jul 27, 2026
3b2cc27
updated script
dweinholz Jul 27, 2026
0e3601d
uopdated nginx conf
dweinholz Jul 27, 2026
664e8d3
uopdated nginx conf
dweinholz Jul 27, 2026
17f9a3c
uopdated nginx conf
dweinholz Jul 27, 2026
6416477
updated dockerifel adn contaienr
dweinholz Jul 27, 2026
6c51ce3
updated nginx conf
dweinholz Jul 27, 2026
e33ea1b
rest dockerfile
dweinholz Jul 27, 2026
1fc4d7b
Updated nginc
dweinholz Jul 27, 2026
8b07dd4
Updated nginc
dweinholz Jul 27, 2026
a854f8c
Updated nginc
dweinholz Jul 27, 2026
1ee3d12
Updated nginc
dweinholz Jul 27, 2026
6aab4c7
Updated nginc
dweinholz Jul 27, 2026
f8d4079
use luarocks
dweinholz Jul 27, 2026
5a12c35
updated examples
dweinholz Jul 28, 2026
2f80009
updated dockerfile
dweinholz Jul 28, 2026
4a1e42c
using moneypatch
dweinholz Jul 28, 2026
03fabd9
updated dockerfile
dweinholz Jul 28, 2026
65cd60e
run blocked ips at startup
dweinholz Jul 29, 2026
16bbcdf
onyl run blocked ups script if conf is not presetn
dweinholz Jul 29, 2026
b646273
feat(Dependencies): Update dependency uvicorn to v0.52.0
renovate[bot] Jul 29, 2026
21eb1f6
added containerized option
dweinholz Jul 29, 2026
10ef722
set env in dockerfile
dweinholz Jul 29, 2026
1c34700
updated nginx
dweinholz Jul 29, 2026
96c24de
updated Dockerfile
dweinholz Jul 29, 2026
b24cc0a
adde missing dep
dweinholz Jul 29, 2026
a330884
updated Dockerfile
dweinholz Jul 29, 2026
2d70098
updated permissions
dweinholz Jul 29, 2026
b0c7ba5
updated permissions
dweinholz Jul 29, 2026
74dd905
updated permissions
dweinholz Jul 29, 2026
9941165
reset to root
dweinholz Jul 29, 2026
fe60a82
fixed gunicorn path
dweinholz Jul 29, 2026
dc6ce4f
copy examples
dweinholz Jul 29, 2026
1564d13
fixed typo
dweinholz Jul 29, 2026
6bde1c8
updated path
dweinholz Jul 29, 2026
2125474
updated path
dweinholz Jul 29, 2026
1a10fab
fixed import bug
dweinholz Jul 30, 2026
1c224cc
readded monkeypatch
dweinholz Jul 30, 2026
8722c63
feat(Actions):added docker build actions
dweinholz Jul 30, 2026
dd68046
added html pages
dweinholz Jul 30, 2026
65a1a6c
added html pages
dweinholz Jul 30, 2026
7fa06c3
added html pages
dweinholz Jul 30, 2026
47f7eff
Merge pull request #597 from deNBI/deps/uvicorn-0.x
dweinholz Jul 30, 2026
d637d5e
feat(Dependencies): Update github/codeql-action digest to e4fba86
renovate[bot] Jul 30, 2026
055afaf
Merge pull request #594 from deNBI/deps/github-codeql-action-digest
dweinholz Jul 30, 2026
313efaa
Update GitHub Actions runner to ubuntu-latest
dweinholz Jul 30, 2026
9831e2d
Update release_image.yml
dweinholz Jul 30, 2026
f9cdbfa
Update build-image.yml
dweinholz Jul 30, 2026
28748d4
Update Dockerfile path in publish workflow
dweinholz Jul 30, 2026
a18e4db
Update Dockerfile path in release workflow
dweinholz Jul 30, 2026
19b36c1
Change Dockerfile path in build-image workflow
dweinholz Jul 30, 2026
59e1879
testing alpine dockerfile
dweinholz Jul 30, 2026
8ca4f29
Merge branch 'refactor/docker' of github.com:deNBI/simpleVMWebGateway…
dweinholz Jul 30, 2026
b7cfd4c
added missing dependencies
dweinholz Jul 30, 2026
5f2f07c
set fixed alpine version
dweinholz Jul 30, 2026
13dd56f
set cookie secure
dweinholz Aug 6, 2026
8b4f542
merged dev
dweinholz Aug 6, 2026
20aaf30
Merge pull request #598 from deNBI/refactor/docker
dweinholz Aug 12, 2026
08c663e
feat(Dependencies): Pin dependencies
renovate[bot] Aug 12, 2026
a5e930f
feat(Dependencies): Update actions/checkout digest to 3d3c42e
renovate[bot] Aug 12, 2026
d3fc5a4
Merge pull request #605 from deNBI/deps/pin-dependencies
dweinholz Aug 12, 2026
6c12dfc
feat(Dependencies): Update dependency fastapi to v0.141.1
renovate[bot] Aug 12, 2026
79e80a1
Merge pull request #593 from deNBI/deps/actions-checkout-digest
dweinholz Aug 12, 2026
09fcca6
Merge pull request #595 from deNBI/deps/fastapi-0.x
dweinholz Aug 12, 2026
c54bbae
Merge branch 'master' into dev
dweinholz Aug 12, 2026
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
Empty file modified .clog.toml
100644 → 100755
Empty file.
6 changes: 3 additions & 3 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ on:

jobs:
build-test:
runs-on: [self-hosted, build]
runs-on: ubuntu-latest
steps:
- name: Workflow run cleanup action
uses: rokroskar/workflow-run-cleanup-action@ee1451b869ba1e381729b3d40489997021f0d562 # v0.3.3
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

- name: Build and publish image to OCI
id: build
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7
with:
file: ./compose/production/django/Dockerfile
file: docker/Dockerfile
push: false
load: true
tags: localbuild/testimage:latest
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
uses: github/codeql-action/init@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4
with:
languages: ${{ matrix.language }}
queries: +security-extended, security-and-quality
Expand All @@ -51,7 +51,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v4
uses: github/codeql-action/autobuild@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -65,4 +65,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
uses: github/codeql-action/analyze@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4
Empty file modified .github/workflows/dummy-renovate.yml
100644 → 100755
Empty file.
6 changes: 3 additions & 3 deletions .github/workflows/pip_audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ jobs:
runs-on: self-hosted
steps:
- name: Checkout PR branch
uses: actions/checkout@v4
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Python 3.14
uses: actions/setup-python@v6
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: 3.14

- uses: pypa/gh-action-pip-audit@v1.1.0
- uses: pypa/gh-action-pip-audit@1220774d901786e6f652ae159f7b6bc8fea6d266 # v1.1.0
with:
inputs: FastapiOpenRestyConfigurator/requirements.txt
5 changes: 2 additions & 3 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ on:
- 'hotfix/**'
jobs:
build:
runs-on: [self-hosted,bielefeld]
concurrency: api
runs-on: ubuntu-latest
steps:
- name: Clean up repository directory (with elevated privileges) -.pytest_cache
shell: bash
Expand Down Expand Up @@ -41,6 +40,6 @@ jobs:
- name: Build and publish image to OCI
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7
with:
file: compose/production/django/Dockerfile
file: docker/Dockerfile
push: true
tags: oci.bi.denbi.de/simplevm/forc:${{ steps.tag.outputs.TAG }}
4 changes: 2 additions & 2 deletions .github/workflows/release_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- '*'
jobs:
build_release:
runs-on: [self-hosted, production, build]
runs-on: ubuntu-latest

steps:
- name: Clean up repository directory (with elevated privileges) -.pytest_cache
Expand All @@ -31,7 +31,7 @@ jobs:
- name: Build and publish image to OCI
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7
with:
file: compose/production/django/Dockerfile
file: docker/Dockerfile
push: true
tags: oci.bi.denbi.de/simplevm/forc:${{ steps.get_version.outputs.VERSION }}
load: true
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ ansible/test.json
*/.python-version
FastapiOpenRestyConfigurator/.env
template_path
backend_path
backend_path
*/plans
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.14.5
3.14.6
Empty file modified FastapiOpenRestyConfigurator/.env.in
100644 → 100755
Empty file.
Empty file modified FastapiOpenRestyConfigurator/app/__init__.py
100644 → 100755
Empty file.
Empty file modified FastapiOpenRestyConfigurator/app/main/__init__.py
100644 → 100755
Empty file.
50 changes: 26 additions & 24 deletions FastapiOpenRestyConfigurator/app/main/config.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import os
from functools import lru_cache

from pydantic_settings import BaseSettings
from pydantic import SecretStr, validator, DirectoryPath
from pydantic_settings import BaseSettings, SettingsConfigDict
from pydantic import SecretStr, field_validator, DirectoryPath
from pydantic import field_validator, ValidationInfo

basedir = os.path.abspath(os.path.dirname(__file__))


Expand All @@ -11,40 +13,40 @@ class Settings(BaseSettings):
Settings object.
Reads settings from .env file.
"""
FORC_VERSION: str = '0.2'

FORC_VERSION: str = "0.2"
DEBUG: bool = False
LOG_LEVEL: str = "INFO"
FORC_API_KEY: SecretStr
FORC_SECRET_KEY: SecretStr = 'my_precious_secret_key'
FORC_SECRET_KEY: SecretStr = "my_precious_secret_key"
FORC_BACKEND_PATH: DirectoryPath
FORC_TEMPLATE_PATH: DirectoryPath
FORC_USER_PATH: str = "users"
CONTAINERIZED: bool = False

@validator('FORC_USER_PATH', pre=True)
def apply_backend_path(cls, v, values):
@field_validator("FORC_USER_PATH", mode="before")
@classmethod
def apply_backend_path(cls, v, info: ValidationInfo):
"""
Validates forc user path, as it depends on forc backend path.
:param v: Value for forc user path.
:param values: Values already read for settings object.
:param info: Validation context containing already validated fields.
:return: Updated FORC_USER_PATH.
"""
# := assigns and compares a value. (if a := b:) == (a = b; if a:)
if FORC_BACKEND_PATH := values.get('FORC_BACKEND_PATH'):
return f"{FORC_BACKEND_PATH}/{v}"
else:
# should only happen when there was an error with FORC_BACKEND_PATH
return "/var/forc/backend_path/users"

class Config:
"""
Config for settings object.
"""
# Enabled case sensitive for reading variables from .env file
case_sensitive = True
# Path to .env file
env_file = ".env"
# Encoding of .env file
env_file_encoding = "utf-8"
forc_backend_path = info.data.get("FORC_BACKEND_PATH")

if forc_backend_path:
return f"{forc_backend_path}/{v}"

# should only happen when there was an error with FORC_BACKEND_PATH
return "/var/forc/backend_path/users"

model_config = SettingsConfigDict(
case_sensitive=True,
env_file=".env",
env_file_encoding="utf-8",
extra="ignore"
)


@lru_cache()
Expand Down
Empty file modified FastapiOpenRestyConfigurator/app/main/model/__init__.py
100644 → 100755
Empty file.
18 changes: 14 additions & 4 deletions FastapiOpenRestyConfigurator/app/main/model/serializers.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@

owner_regex = r'^[a-zA-Z0-9@.-]{30,}$'
user_key_url_regex = r"^[a-zA-Z0-9_-]{3,25}$"
upstream_url_regex = r"^(https?)://(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):(\d{1,5})$"
upstream_url_regex = r"^(https?)://(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):(\d{1,5})(/[a-zA-Z0-9_-]+/)?$"


# TODO: needs refactoring to comply with python 3.10 and pydantic v2

class BackendBase(BaseModel):
"""
Base class for backend.
Expand All @@ -53,6 +55,12 @@ class BackendBase(BaseModel):
description="Version of the template the backend refers to.",
example="v04"
)
auth_enabled: bool = Field(
True,
title="Authorization for the research environment",
description="If set to true, only the owner of the backend is allowed to access it.",
example=False
)

@validator("owner")
def owner_validation(cls, owner):
Expand Down Expand Up @@ -82,7 +90,7 @@ class BackendIn(BackendBase):
...,
title="Upstream URL",
description="Inject the full url (with protocol) for the real location of the backend service in the template.",
example="http://192.168.0.1:8787/"
example="http://192.168.0.1:8787/guacamole/"
)

@validator("user_key_url")
Expand Down Expand Up @@ -113,7 +121,7 @@ class BackendOut(BackendBase):
"""
Backend class which holds information needed when returning a backend.
"""
id: int = Field(
id: int = Field( # TODO: needs refactoring: change type to int and rename to backend_id
...,
title="ID",
description="ID of the backend.",
Expand All @@ -136,13 +144,15 @@ class BackendTemp(BackendIn, BackendOut):
"""
Backend class to temporarily save information. Links BackendIn with BackendOut.
"""
id: int = None
id: int = None # TODO: also needs refactoring: change type to int and rename to backend_id
owner: str = None
location_url: str = None
template: str = None
template_version: str = None
user_key_url: str = None
upstream_url: str = None
auth_enabled: bool = None
file_path: str = None


class Template(BaseModel):
Expand Down
Empty file modified FastapiOpenRestyConfigurator/app/main/service/__init__.py
100644 → 100755
Empty file.
Loading
Loading