Skip to content
Merged

Dev #77

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
47a948f
add pyasn for ASNumber
alexandredevely Jan 24, 2026
7762d4d
add ASNumber
alexandredevely Jan 24, 2026
54f3f0f
add asnumberdb
alexandredevely Jan 24, 2026
e8a410a
fix asn command
alexandredevely Jan 24, 2026
84fd919
typo
alexandredevely Jan 26, 2026
8bbcdfb
fix filter is_api_filter is_ip_filter
alexandredevely Jan 27, 2026
526cbc8
update asn
alexandredevely Jan 27, 2026
4a7e8c5
use rs0
alexandredevely Jan 27, 2026
db27129
fix filter is_api_filter is_ip_filter
alexandredevely Jan 27, 2026
57416a6
remove selectODVolume
alexandredevely Jan 27, 2026
b788188
fix filter is_api_filter is_ip_filter
alexandredevely Jan 27, 2026
9cdb495
add IP address access denied
alexandredevely Jan 27, 2026
4239083
add new label asnumber ipsource
alexandredevely Jan 28, 2026
e8e9aab
typo
alexandredevely Jan 28, 2026
1ca9c4c
add mountPropagation
alexandredevely Jan 28, 2026
eb301f8
add new label asnumber ipsource
alexandredevely Jan 28, 2026
ee99157
add mountPropagation
alexandredevely Jan 28, 2026
8e30e22
add mountPropagation
alexandredevely Jan 28, 2026
7bbd9d1
fix twice stop call
alexandredevely Feb 5, 2026
56750cd
add mongodbparam
alexandredevely Feb 5, 2026
371988e
add ua-parser
alexandredevely Feb 9, 2026
243ba8f
add ABCDESKTOP_WEBCLIENT_USERAGENT_OS_FAMILY
alexandredevely Feb 9, 2026
8249748
add debug
alexandredevely Feb 9, 2026
a067b79
change up_parser module
alexandredevely Feb 10, 2026
743702b
read theme from config
alexandredevely Feb 10, 2026
e9c069b
change pulse socket path
alexandredevely Feb 19, 2026
21bea85
add pulseaudiosocketpath
alexandredevely Feb 20, 2026
98db4ff
change pulseaudio path
alexandredevely Feb 20, 2026
1862d6c
remove pulseaudiosocket cupsdsocket
alexandredevely Feb 20, 2026
3659db5
retry if Timeout: Too large resource version
alexandredevely Mar 4, 2026
cb0ab0b
add too large resource version pass
alexandredevely Mar 9, 2026
b1d11a4
fix bad parameters
alexandredevely Mar 9, 2026
cb56b6b
fix bad parameters
alexandredevely Mar 9, 2026
5549851
fix for Too large resource version ApiException
alexandredevely Mar 11, 2026
f7a3d7d
add debug log
alexandredevely Mar 12, 2026
458be0c
fix for Too large resource version ApiException
alexandredevely Mar 12, 2026
db89639
change mongo param for ban
alexandredevely Mar 12, 2026
12aa1de
fix for Too large resource version ApiException
alexandredevely Mar 12, 2026
d91f083
add param type
alexandredevely Mar 12, 2026
49b221d
add param type
alexandredevely Mar 12, 2026
5ad09df
fix ban result dict
alexandredevely Mar 12, 2026
5a6257f
reduce log debug
alexandredevely Mar 12, 2026
135ef05
fix vulns
alexandredevely Mar 18, 2026
ea1b5a6
add roles to pod as labels
alexandredevely Mar 19, 2026
6ef2ceb
add type
alexandredevely Mar 19, 2026
00d538b
replace True is label value is None
alexandredevely Mar 20, 2026
f95b754
allow (null) value
alexandredevely Mar 20, 2026
a5b3fca
fix label value
alexandredevely Mar 20, 2026
1459d66
Merge branch '4.3' into dev
alexandredevely Mar 22, 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
1 change: 0 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

{
"name": "abcdesktop.io",
"type": "debugpy",
Expand Down
29 changes: 19 additions & 10 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ RUN apk update --no-cache && \
krb5 \
krb5-libs \
libgsasl \
"libssl3>3.5.4" \
"libcrypto3>3.5.4"
bash

SHELL ["/bin/bash", "-c"]

# gss-ntlmssp
# krb5-user
Expand All @@ -40,9 +41,9 @@ RUN apk add --no-cache \
musl-dev \
py3-ldap \
py3-ldap-pyc \
py3-python-gssapi-pyc \
py3-python-gssapi \
krb5-dev \
py3-python-gssapi-pyc \
py3-python-gssapi \
krb5-dev \
geoip-dev \
openldap-dev

Expand All @@ -67,16 +68,24 @@ COPY . .
RUN pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt


# get ASNNumber database
# IPASN data files can be created by downloading MRT/RIB BGP archives from Routeviews (or similar sources),
# and parsing them using provided scripts that tail the BGP AS-Path.
RUN pyasn_util_download.py --latestv46 --filename rib.bz2 && \
pyasn_util_convert.py --single rib.bz2 ipasn_db.dat && \
rm -f rib.bz2

# remove dev package
# should better use a builder instance
# but I can't find how to grab all new libraries
RUN apk del --no-cache \
krb5-dev \
gcc \
musl-dev \
krb5-dev \
geoip-dev \
openldap-dev
gcc \
musl-dev \
krb5-dev \
geoip-dev \
openldap-dev

# create log directory
RUN mkdir -p /var/pyos/logs
Expand Down
23 changes: 15 additions & 8 deletions Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ RUN apt-get update && apt-get upgrade -y && apt-get clean && rm -rf /var/lib/ap

# install python
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3 \
python3-pip \
python3-virtualenv \
python3-virtualenv \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# install python dev
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
gcc \
make \
python3-dev \
make \
python3-dev \
libffi-dev \
libkrb5-dev \
libsasl2-dev \
libsasl2-dev \
libldap2-dev \
libsasl2-dev \
libsasl2-dev \
libldap2-dev \
libgeoip-dev \
libssl-dev \
libssl-dev \
rustc \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
Expand Down Expand Up @@ -81,6 +81,13 @@ RUN virtualenv /var/pyos && \
source /var/pyos/bin/activate && \
pip install --no-cache-dir -r requirements.txt

# get ASNNumber database
# IPASN data files can be created by downloading MRT/RIB BGP archives from Routeviews (or similar sources),
# and parsing them using provided scripts that tail the BGP AS-Path.
RUN source /var/pyos/bin/activate && \
python3 bin/pyasn_util_download.py --latestv46 --filename rib.bz2 && \
python3 bin/pyasn_util_convert.py --single rib.bz2 ipasn_db.dat && \
rm -f rib.bz2

# remove dev lib
RUN apt-get remove -y \
Expand Down
11 changes: 5 additions & 6 deletions controllers/auth_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,8 @@ def buildsecret(self):
password = args.get('password')
if not isinstance(password, str):
raise cherrypy.HTTPError(400, 'Bad request invalid password parameter')


(auth, user ) = self.validate_env()
(auth, user, roles) = self.validate_env()

# build a login dict arg object with provider set to AD
args_login = {
Expand Down Expand Up @@ -675,12 +674,12 @@ def login(self):
# get params from json request
args = cherrypy.request.json
# can raise exception
(auth, user ) = self.validate_env()
(auth, user, roles) = self.validate_env()

# push a start message to database cache info
services.messageinfo.start( user.userid, "b.Launching desktop")
# launch the user desktop
return self.root.composer._launchdesktop( auth, user, args)
return self.root.composer._launchdesktop( auth, user, roles, args)


@cherrypy.expose
Expand All @@ -691,9 +690,9 @@ def refreshtoken(self):
# no params from json request
# args = cherrypy.request.json
# can raise exception
(auth, user) = self.validate_env()
(auth, user, roles) = self.validate_env()
# update token
jwt_user_token = services.auth.update_token( auth=auth, user=user, roles=None )
jwt_user_token = services.auth.update_token( auth=auth, user=user, roles=roles )
# add no-cache nosniff HTTP headers
cherrypy.response.headers[ 'Cache-Control'] = 'no-cache, private'
# disable content or MIME sniffing which is used to override response Content-Type headers
Expand Down
42 changes: 20 additions & 22 deletions controllers/composer_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

from oc.cherrypy import Results
from oc.od.base_controller import BaseController
from oc.auth.authservice import AuthInfo, AuthUser, AuthRoles # to read AuthInfo, AuthUser, AuthRoles



logger = logging.getLogger(__name__)
Expand All @@ -46,7 +48,7 @@ def __init__(self, config_controller=None):
@cherrypy.tools.json_out()
def ocrun(self):
self.logger.debug('')
(auth, user ) = self.validate_env()
(auth, user, roles) = self.validate_env()
args = cherrypy.request.json
if not isinstance(args, dict):
raise cherrypy.HTTPError( status=400, message='invalid parameters')
Expand All @@ -64,7 +66,7 @@ def ocrun(self):
raise cherrypy.HTTPError( status=400, message='ocrun error')
return Results.success(result=result)

def LocaleSettingsLanguage( self, user ):
def LocaleSettingsLanguage( self, user:dict ):
# add current locale from http Accept-Language to AuthUser
locale = oc.i18n.detectLocale(cherrypy.request.headers.get('Accept-Language'), oc.od.settings.supportedLocales)
user['locale'] = locale
Expand All @@ -76,19 +78,19 @@ def launchdesktop(self):
# increase timeout when creating the first user pod
cherrypy.response.timeout = 300
self.logger.debug('launchdesktop:validate_env')
(auth, user ) = self.validate_env()
(auth, user, roles) = self.validate_env()
# add lang to user dict
self.logger.debug('launchdesktop:LocaleSettingsLanguage')
self.LocaleSettingsLanguage( user )
self.logger.debug('launchdesktop:_launchdesktop')
result = self._launchdesktop(auth, user, cherrypy.request.json)
result = self._launchdesktop(auth, user, roles, cherrypy.request.json)
return result

@cherrypy.expose
@cherrypy.tools.json_in()
@cherrypy.tools.json_out()
def list_applications_by_phase(self):
(auth, user ) = self.validate_env()
(auth, user, roles) = self.validate_env()
args = cherrypy.request.json
if type(args) is not dict:
return cherrypy.HTTPError( status=400, message='invalid args parameters')
Expand All @@ -103,7 +105,7 @@ def list_applications_by_phase(self):
@cherrypy.tools.json_in()
def getlogs(self):
self.logger.debug('')
(auth, user ) = self.validate_env()
(auth, user, roles ) = self.validate_env()
logs = oc.od.composer.logdesktop(auth, user)
return Results.success(result=logs)

Expand All @@ -112,7 +114,7 @@ def getlogs(self):
@cherrypy.tools.json_out()
def stopcontainer(self):
self.logger.debug('')
(auth, user ) = self.validate_env()
(auth, user, roles) = self.validate_env()
args = cherrypy.request.json
if type(args) is not dict:
return cherrypy.HTTPError( status=400, message='invalid args parameters')
Expand All @@ -134,7 +136,7 @@ def stopcontainer(self):
@cherrypy.tools.json_out()
def logcontainer(self):
self.logger.debug('')
(auth, user ) = self.validate_env()
(auth, user, roles) = self.validate_env()
args = cherrypy.request.json
if not isinstance( args, dict):
return cherrypy.HTTPError( status=400, message='invalid parameters')
Expand All @@ -158,7 +160,7 @@ def logcontainer(self):
@cherrypy.tools.json_out()
def envcontainer(self):
self.logger.debug('')
(auth, user ) = self.validate_env()
(auth, user, roles) = self.validate_env()
args = cherrypy.request.json
if not isinstance( args, dict):
raise cherrypy.HTTPError( status=400, message='invalid parameters' )
Expand All @@ -181,7 +183,7 @@ def envcontainer(self):
@cherrypy.tools.json_out()
def removecontainer(self):
self.logger.debug('')
(auth, user ) = self.validate_env()
(auth, user, roles) = self.validate_env()
args = cherrypy.request.json
if not isinstance( args, dict):
return cherrypy.HTTPError( status=400, message='invalid parameters' )
Expand All @@ -208,7 +210,7 @@ def removecontainer(self):
@cherrypy.tools.json_out()
def listcontainer(self):
self.logger.debug('')
(auth, user ) = self.validate_env()
(auth, user, roles) = self.validate_env()
result = oc.od.composer.listContainerApps(auth, user)
return Results.success(result=result)

Expand All @@ -217,7 +219,7 @@ def listcontainer(self):
@cherrypy.tools.json_in()
def refreshdesktoptoken(self):
self.logger.debug('')
(auth, user ) = self.validate_env()
(auth, user, roles) = self.validate_env()
desktop = oc.od.composer.finddesktop(authinfo=auth, userinfo=user)

# check desktop object
Expand Down Expand Up @@ -256,7 +258,7 @@ def getdesktopdescription(self):
# check if request is allowed, raise an exception if deny
self.is_permit_request()
# check if user is authenticated and identified, raise an exception if not
(auth, user ) = self.validate_env()
(auth, user, roles) = self.validate_env()
result = oc.od.composer.getdesktopdescription(auth, user)
if not isinstance( result, dict ):
raise cherrypy.HTTPError( status=400, message='failed to getdesktopdescription')
Expand All @@ -269,7 +271,7 @@ def getdesktopdescription(self):
def getuserapplist(self):
self.logger.debug('')

(auth, user ) = self.validate_env()
(auth, user, roles) = self.validate_env()
userappdict = {}
# list all applications allowed for this user (auth)
appdict = services.apps.user_appdict( auth, filtered_public_attr_list=True)
Expand All @@ -285,8 +287,9 @@ def getuserapplist(self):
userapplist = list( userappdict.values() )
# return succes data
return Results.success(result=userapplist)


def _launchdesktop(self, auth, user, args):
def _launchdesktop(self, auth:AuthInfo, user:AuthUser, roles:AuthRoles, args:dict):
self.logger.debug('')

#
Expand All @@ -297,12 +300,7 @@ def _launchdesktop(self, auth, user, args):
# raise it again
#
try:
# read the user ip source address for accounting and log history data
webclient_sourceipaddr = oc.cherrypy.getclientipaddr()
args[ 'WEBCLIENT_SOURCEIPADDR' ] = webclient_sourceipaddr

# open a new desktop
desktop = oc.od.composer.opendesktop( auth, user, args )
desktop = oc.od.composer.opendesktop( auth, user, roles, args )

# safe check for desktop type
if not isinstance(desktop, oc.od.desktop.ODDesktop):
Expand Down Expand Up @@ -408,7 +406,7 @@ def get_target_ip_route(self, target, websocketrouting ):
@cherrypy.tools.json_out()
@cherrypy.tools.json_in()
def listsecrets(self):
(auth, user ) = self.validate_env()
(auth, user,roles) = self.validate_env()
# list secrets
secrets = oc.od.composer.listAllSecretsByUser(auth, user)
list_secrets = list( secrets )
Expand Down
2 changes: 1 addition & 1 deletion controllers/core_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def getmessageinfo(self)->bytes:
# route content type to handler
routecontenttype = { 'text/plain': self.handler_messageinfo_text, 'application/json': self.handler_messageinfo_json }
try:
(_, user ) = self.validate_env()
(_auth, user, _roles) = self.validate_env()
message = services.messageinfo.popflush(user.userid)
lambdaroute = self.getlambdaroute( routecontenttype, defaultcontenttype='application/json' )( message )
except Exception as e:
Expand Down
6 changes: 3 additions & 3 deletions controllers/manager_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def desktop( self, *args ):
@cherrypy.tools.json_out()
def images( self )->str:
self.is_permit_request()
if cherrypy.request.method == 'GET':
if cherrypy.request.method == 'GET':
return self.handle_images_GET()
elif cherrypy.request.method == 'DELETE':
return self.handle_images_DELETE()
Expand All @@ -356,7 +356,7 @@ def handle_images_GET( self )->str:
@cherrypy.tools.json_out()
def image( self, image:str=None, node:str=None ):
self.is_permit_request()
if cherrypy.request.method == 'GET':
if cherrypy.request.method == 'GET':
return self.handle_image_GET( image=image )
elif cherrypy.request.method == 'PUT':
return self.handle_image_PUT( json_images=cherrypy.request.json, node=node )
Expand Down Expand Up @@ -645,6 +645,6 @@ def handle_ban_DELETE( self, collection, args ):
@cherrypy.tools.json_out()
def dry_run_desktop(self):
self.logger.debug('validate_env')
(auth, user ) = self.validate_env()
(auth, user, roles) = self.validate_env()
result = oc.od.composer.sampledesktop(auth, user)
return result
6 changes: 3 additions & 3 deletions controllers/store_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(self, config_controller=None):
@cherrypy.tools.json_in()
def set(self):
# Check auth
(auth, user ) = self.validate_env()
(auth, user, roles ) = self.validate_env()
arguments = cherrypy.request.json
if not isinstance(arguments,dict) :
return Results.error( message='invalid parameters' )
Expand All @@ -58,7 +58,7 @@ def set(self):
def get(self):

# Check auth
(auth, user ) = self.validate_env()
(auth, user, roles ) = self.validate_env()
arguments = cherrypy.request.json

if not isinstance(arguments,dict) :
Expand Down Expand Up @@ -93,7 +93,7 @@ def wrapped_get( self, userid, key ):
@cherrypy.tools.json_in()
@cherrypy.tools.allow(methods=['POST'])
def getcollection(self):
(auth, user ) = self.validate_env()
(auth, user, roles) = self.validate_env()
userid = user.userid
arguments = cherrypy.request.json
if not isinstance(arguments,dict) :
Expand Down
4 changes: 3 additions & 1 deletion controllers/user_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def getinfo(self):
@cherrypy.tools.json_in()
def getlocation(self):
# self.logger.debug('')
(auth, user) = self.validate_env()
(auth, user, roles) = self.validate_env()
location = oc.od.user.getlocation( auth )
return Results.success(result=location)

Expand All @@ -56,10 +56,12 @@ def whoami(self):
# self.logger.debug('')
auth = None
user = None
roles = None
# same has super().validate_env
# but do not fail or ban ipaddr
if services.auth.isauthenticated and services.auth.isidentified:
user = services.auth.user
auth = services.auth.auth
roles = services.auth.roles
userinfo = oc.od.user.whoami( auth, user )
return userinfo
Loading
Loading