forked from shaba/openuds
Fixing actor for unmanaged
This commit is contained in:
parent
ac0be2f4aa
commit
2b4a0113a2
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/make -f
|
||||
# -*- makefile -*-
|
||||
|
||||
.PHONY: install-udsactor install-udsactor-static
|
||||
.PHONY: install-udsactor install-udsactor-unmanaged
|
||||
|
||||
# Directories
|
||||
SOURCEDIR := ../src
|
||||
@ -23,9 +23,9 @@ clean:
|
||||
|
||||
install-udsactor: udsactor
|
||||
|
||||
install-udsactor-static: udsactor udsactor-static
|
||||
install-udsactor-unmanaged: udsactor udsactor-unmanaged
|
||||
|
||||
udsactor-static:
|
||||
udsactor-unmanaged:
|
||||
# Overwrite udsactor config is what to be done
|
||||
cp scripts/UDSActorConfig-unmanaged $(SBINDIR)/UDSActorConfig
|
||||
|
||||
|
2
actor/linux/debian/.gitignore
vendored
2
actor/linux/debian/.gitignore
vendored
@ -1,2 +1,2 @@
|
||||
/udsactor/
|
||||
/udsactor-static/
|
||||
/udsactor-unmanaged/
|
||||
|
@ -22,7 +22,7 @@ install: build
|
||||
dh_prep
|
||||
dh_installdirs
|
||||
$(MAKE) DESTDIR=$(CURDIR)/debian/udsactor install-udsactor
|
||||
$(MAKE) DESTDIR=$(CURDIR)/debian/udsactor-static install-udsactor-static
|
||||
$(MAKE) DESTDIR=$(CURDIR)/debian/udsactor-unmanaged install-udsactor-unmanaged
|
||||
binary-arch: build install
|
||||
# emptyness
|
||||
binary-indep: build install
|
||||
|
@ -3,7 +3,7 @@ Source: udsactor
|
||||
Version: 3.0.0
|
||||
Architecture: all
|
||||
Maintainer: Adolfo Gómez García <agomez@virtualcable.net>
|
||||
Installed-Size: 18
|
||||
Installed-Size: 285
|
||||
Depends: policykit-1 (>= 0.100), python3-requests (>= 0.8.2), python3-pyqt5 (>= 4.9), python3-six (>= 1.1), python3 (>= 3.4), libxss1, xscreensaver, debconf (>= 0.5) | debconf-2.0
|
||||
Recommends: python3-prctl (>= 1.1.1)
|
||||
Section: admin
|
||||
|
@ -1,3 +1,58 @@
|
||||
85c4b43088c4c599cfcdf603dd45255b lib/systemd/system/udsactor-unmanaged.service
|
||||
6e54eda92cfd6bbda74edbdc86297388 usr/bin/UDSActorTool
|
||||
95ba71e80850a859521ed142a08ea175 usr/bin/UDSActorTool-startup
|
||||
830a76b7609ee0dfba85b8bc40909e1c usr/bin/udsactor
|
||||
f74bb5457641bbd47aaab3bc9ee0117d usr/bin/udsvapp
|
||||
92cd98cd64f87d9d20ecb9bbfd1904a6 usr/sbin/UDSActorConfig
|
||||
3e73b46d910e2f280546517960428487 usr/sbin/UDSActorConfig-pkexec
|
||||
7fedefd806eca361bfaa52f48bbc22b1 usr/share/UDSActor/actor_client.py
|
||||
a5da5307568d1ce8caffc83c4bbc3cc8 usr/share/UDSActor/actor_config.py
|
||||
93f90e9597bbd35e741c262d1e83ae93 usr/share/UDSActor/actor_config_unmanaged.py
|
||||
520cc84ae2e83c6b2f09a9aeabdbff95 usr/share/UDSActor/actor_service.py
|
||||
16dd4b293b477cd582a415a7ede4267c usr/share/UDSActor/img/uds-icon.png
|
||||
280dc52dbf91e3c08e2e680f6e9fbc9b usr/share/UDSActor/udsactor/__init__.py
|
||||
1df76e29e9d5fcefc1c90f52f46e2874 usr/share/UDSActor/udsactor/certs.py
|
||||
35de66713f83a996741c138b3a87efa6 usr/share/UDSActor/udsactor/client.py
|
||||
d41d8cd98f00b204e9800998ecf8427e usr/share/UDSActor/udsactor/http/__init__.py
|
||||
0d2bd16d1c10974e2fa11cbb1efb9fdc usr/share/UDSActor/udsactor/http/client.py
|
||||
faacbeaf03633623b13b86f85687a4c8 usr/share/UDSActor/udsactor/http/clients_pool.py
|
||||
e14a1a7526c13fc6463ac9b34a88c2ea usr/share/UDSActor/udsactor/http/handler.py
|
||||
39a95cf004702087c96f3f2cff39aee2 usr/share/UDSActor/udsactor/http/local.py
|
||||
043a23eddbb3346602e3510b76d38fc9 usr/share/UDSActor/udsactor/http/public.py
|
||||
a26946123620d7c6651cb60a4ca9f551 usr/share/UDSActor/udsactor/http/server.py
|
||||
c6391d28f7762b9abce3664c1be2191a usr/share/UDSActor/udsactor/info.py
|
||||
6aa6120d57f8666b21240db0e5a0a874 usr/share/UDSActor/udsactor/linux/__init__.py
|
||||
a4ffcb8be9b04d402d2676b4ef5d8a1a usr/share/UDSActor/udsactor/linux/daemon.py
|
||||
7240442cb3634f966c80b97d4a981e64 usr/share/UDSActor/udsactor/linux/log.py
|
||||
7a9ce9d6174d01b41d78bd747a91143e usr/share/UDSActor/udsactor/linux/operations.py
|
||||
8dc37d5a5db356f14a896cfb1bf39619 usr/share/UDSActor/udsactor/linux/renamer/__init__.py
|
||||
bb3cf27470093e3a8c072b59d962e076 usr/share/UDSActor/udsactor/linux/renamer/common.py
|
||||
67bd51f61e5342e99a524edb40015a9c usr/share/UDSActor/udsactor/linux/renamer/debian.py
|
||||
d4078d2bc70dd654b85f6ae13a123b7a usr/share/UDSActor/udsactor/linux/renamer/opensuse.py
|
||||
713cf6f7e71362733224e280cb2af440 usr/share/UDSActor/udsactor/linux/renamer/redhat.py
|
||||
c58a39c430f04f737bc593df2ebd8c4f usr/share/UDSActor/udsactor/linux/runner.py
|
||||
1917dce1bcdf8f64fb3e1109b02af066 usr/share/UDSActor/udsactor/linux/service.py
|
||||
8d39ca4764e291190fd1b496205c8db9 usr/share/UDSActor/udsactor/linux/store.py
|
||||
9ce982b4c96e6c109f6d4d41e8bf3085 usr/share/UDSActor/udsactor/linux/xss.py
|
||||
0cb7437d8b2287cb53db49ca9d0dabcc usr/share/UDSActor/udsactor/log.py
|
||||
1285e5c1b766f05d48eaaa18a8fd3850 usr/share/UDSActor/udsactor/platform.py
|
||||
fa3646c0a196ebe5261146414e3a6b6e usr/share/UDSActor/udsactor/rest.py
|
||||
99a95a268fa7a86c8d093d93b009fb2b usr/share/UDSActor/udsactor/service.py
|
||||
514c1d69c8755fd324c7577dbb4d0567 usr/share/UDSActor/udsactor/tools.py
|
||||
d19bdf2936027b253cf6138554d31d61 usr/share/UDSActor/udsactor/types.py
|
||||
d1dd91345915205bb2218e76a5c5995f usr/share/UDSActor/udsactor/windows/SENS.py
|
||||
6aa6120d57f8666b21240db0e5a0a874 usr/share/UDSActor/udsactor/windows/__init__.py
|
||||
a4ba2bff7752dfca56668b656193de3b usr/share/UDSActor/udsactor/windows/log.py
|
||||
26a4abe46e92fafca58f2d24103d6b92 usr/share/UDSActor/udsactor/windows/operations.py
|
||||
c26856f6fc2f6a04c989858eee6413a4 usr/share/UDSActor/udsactor/windows/runner.py
|
||||
d9745807a7bba396448a65ffb119bf96 usr/share/UDSActor/udsactor/windows/service.py
|
||||
235b66ff36d050097c8d4d40f1785254 usr/share/UDSActor/udsactor/windows/store.py
|
||||
d41d8cd98f00b204e9800998ecf8427e usr/share/UDSActor/ui/__init__.py
|
||||
8172a259264d6ecc6852c246cc59d75c usr/share/UDSActor/ui/setup_dialog_ui.py
|
||||
b10034f4be44795b212ceeb6f7f0cf2d usr/share/UDSActor/ui/setup_dialog_unmanaged_ui.py
|
||||
4c20f9d0fa4e7a348a04ecc38b4ae58f usr/share/UDSActor/ui/uds_rc.py
|
||||
74c981f4ddba27c5f199180ff782a4cd usr/share/applications/UDS_Actor_Configuration.desktop
|
||||
5cfb0c1950a46e43d64935ccfcd679d0 usr/share/autostart/UDSActorTool.desktop
|
||||
5a463be6812fd9d7de89cf6b55fa4e94 usr/share/doc/udsactor-unmanaged/changelog.gz
|
||||
26d795ffa6dccbe9be390c5a7c4cff38 usr/share/doc/udsactor-unmanaged/copyright
|
||||
09d1c23985f1b8ff8d560dd727624f18 usr/share/polkit-1/actions/org.openuds.pkexec.UDSActorConfig.policy
|
||||
|
7
actor/src/udsactor/http/cert.py
Normal file
7
actor/src/udsactor/http/cert.py
Normal file
@ -0,0 +1,7 @@
|
||||
from .. import types
|
||||
|
||||
defaultCertificate = types.CertificateInfoType(
|
||||
private_key='-----BEGIN ENCRYPTED PRIVATE KEY-----\nMIIFHTBPBgkqhkiG9w0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EPMA0GA1UEBwwGTWFkcmlkMREw\nDwYDVQQKDAhVRFMgQ2VydDERMA8GA1UECwwIVURTIENlcnQxEjAQBgNVBAMMCTEy\nNy4wLjAuMTESMBAGA1UdEQwJMTI3LjAuMC4xMIIBIjANBgkqhkiG9w0BAQEFAAOC\nAQ8AMIIBCgKCAQEA2e1cW7YtRpNLazR3f/LqLv8OB0rKh8cUPH4wuQhbBTkee8Wu\n5eMSadRCIyRbKj4b8dtVfI9QW0SrmhGuMx1KCh3CsYd9XsWiKbGkiRBHIDOn5pkF\n6PUayDJ8KjnGbfnZjp0AmxXP4r1OO8jUPqzKS9Ubf5PgwcwdFiUKVfVPwGwctwt5\nt9YpSRONw0rTsCjVHvO2dd9h6EopskLCWxpN8l9kNLwLM/6t0IqVKmn5/IYPKKN2\nCX8a7IXpxwoiUs4sBZYhUMBWikB1hKQRSYafp1Xvc5PeTFXTFqGANnqz0NoZ8tqL\n8qjQUN/PCdtzhfcP5RgT2g1qyS2RBCMYH7Zs0wIDAQABMA0GCSqGSIb3DQEBCwUA\nA4IBAQCUt+qlLA1N9VXMwDQAYG4Kt6/UlMHCXAajHQQGtjdyGJ4++m7EIjI96hMU\n3Cx2gp2ggR3JGnuSR+DdBvPl5iGku7J8KV0JiJg30gTY8JuUIy/PMLZWloYKrBHV\nlin2GujQ4OsIt3dbr4XtcKW1Wd7L6fBzHlq7Xyxh+gcTzTvTmq67Q9XKlBWsegMf\nv4FKy0lfcSFK3vTzswQtuTontG4TqLiT/4AnMt3D0cTQ6b6KoZwUUX/TDNhau06d\nQ4Ilz8X61ka+4HBkFSR5ahP9noCVhwO329h+6epO141E5Tep3OLc/GCF4oaKOlMR\nfqxf5f2bghU0fxmtEoNJTZkBsN1S\n-----END CERTIFICATE-----\n',
|
||||
password='Pw7qbatz5u-y-Z5ora2D2ZuBCm95AHnKRcpze53k8tw'
|
||||
)
|
@ -79,6 +79,9 @@ class UDSActorSvc(daemon.Daemon, CommonService):
|
||||
# Initialization is done, set machine to ready for UDS, communicate urls, etc...
|
||||
self.setReady()
|
||||
|
||||
# Start listening for petitions
|
||||
self.startHttpServer()
|
||||
|
||||
# *********************
|
||||
# * Main Service loop *
|
||||
# *********************
|
||||
|
@ -41,7 +41,7 @@ from . import rest
|
||||
from . import types
|
||||
|
||||
from .log import logger, DEBUG, INFO, ERROR, FATAL
|
||||
from .http import clients_pool, server
|
||||
from .http import clients_pool, server, cert
|
||||
|
||||
# def setup() -> None:
|
||||
# cfg = platform.store.readConfig()
|
||||
@ -85,7 +85,7 @@ class CommonService: # pylint: disable=too-many-instance-attributes
|
||||
self._api = rest.UDSServerApi(self._cfg.host, self._cfg.validateCertificate)
|
||||
self._secret = secrets.token_urlsafe(33)
|
||||
self._clientsPool = clients_pool.UDSActorClientPool()
|
||||
self._certificate = types.CertificateInfoType('', '', '')
|
||||
self._certificate = cert.defaultCertificate # For being used on "unmanaged" hosts only
|
||||
self._http = None
|
||||
|
||||
# Initialzies loglevel and serviceLogger
|
||||
@ -99,7 +99,7 @@ class CommonService: # pylint: disable=too-many-instance-attributes
|
||||
|
||||
socket.setdefaulttimeout(20)
|
||||
|
||||
def _startHttpServer(self):
|
||||
def startHttpServer(self):
|
||||
# Starts the http thread
|
||||
if self._http:
|
||||
try:
|
||||
@ -178,7 +178,6 @@ class CommonService: # pylint: disable=too-many-instance-attributes
|
||||
platform.store.writeConfig(self._cfg)
|
||||
|
||||
logger.info('Service ready')
|
||||
self._startHttpServer()
|
||||
|
||||
def configureMachine(self) -> bool:
|
||||
if not self._isAlive:
|
||||
@ -314,7 +313,7 @@ class CommonService: # pylint: disable=too-many-instance-attributes
|
||||
self._interfaces = currentInterfaces
|
||||
logger.info('Ip changed from {} to {}. Notified to UDS'.format(old.ip, new.ip))
|
||||
# Stop the running HTTP Thread and start a new one, with new generated cert
|
||||
self._startHttpServer()
|
||||
self.startHttpServer()
|
||||
except Exception as e:
|
||||
# No ip changed, log exception for info
|
||||
logger.warn('Checking ips failed: {}'.format(e))
|
||||
|
@ -229,6 +229,9 @@ class UDSActorSvc(win32serviceutil.ServiceFramework, CommonService):
|
||||
# Initialization is done, set machine to ready for UDS, communicate urls, etc...
|
||||
self.setReady()
|
||||
|
||||
# Start listening for petitions
|
||||
self.startHttpServer()
|
||||
|
||||
# # ********************************
|
||||
# # * Registers SENS subscriptions *
|
||||
# # ********************************
|
||||
|
Loading…
Reference in New Issue
Block a user