diff --git a/filter_plugins/csp_filters.py b/filter_plugins/csp_filters.py index 2c05a075..5eed8beb 100644 --- a/filter_plugins/csp_filters.py +++ b/filter_plugins/csp_filters.py @@ -155,7 +155,7 @@ class FilterModule(object): if directive == 'frame-ancestors': # Enable loading via ancestors if self.is_feature_enabled(applications, 'desktop', application_id): - domain = domains.get('web-app-port-ui')[0] + domain = domains.get('web-app-desktop')[0] sld_tld = ".".join(domain.split(".")[-2:]) # yields "example.com" tokens.append(f"{sld_tld}") # yields "*.example.com" diff --git a/group_vars/all/09_ports.yml b/group_vars/all/09_ports.yml index ad3c5db6..25403400 100644 --- a/group_vars/all/09_ports.yml +++ b/group_vars/all/09_ports.yml @@ -50,7 +50,7 @@ ports: web-app-moodle: 8026 web-app-taiga: 8027 web-app-friendica: 8028 - web-app-port-ui: 8029 + web-app-desktop: 8029 web-app-bluesky_api: 8030 web-app-bluesky_web: 8031 web-app-keycloak: 8032 diff --git a/roles/sys-srv-web-inj-desktop/templates/iframe-init_one_liner.js.j2 b/roles/sys-srv-web-inj-desktop/templates/iframe-init_one_liner.js.j2 index c6a271db..09ff666c 100644 --- a/roles/sys-srv-web-inj-desktop/templates/iframe-init_one_liner.js.j2 +++ b/roles/sys-srv-web-inj-desktop/templates/iframe-init_one_liner.js.j2 @@ -2,7 +2,7 @@ document.addEventListener('DOMContentLoaded', function () { initIframeHandler( '{{ PRIMARY_DOMAIN }}', '{{ domain }}', - '{{ domains | get_url("web-app-port-ui", WEB_PROTOCOL) }}' + '{{ domains | get_url("web-app-desktop", WEB_PROTOCOL) }}' ); }); {% if MODE_DEBUG | bool %} diff --git a/roles/util-srv-corporate-identity/meta/main.yml b/roles/util-srv-corporate-identity/meta/main.yml index 9a97dda6..41df0dea 100644 --- a/roles/util-srv-corporate-identity/meta/main.yml +++ b/roles/util-srv-corporate-identity/meta/main.yml @@ -26,4 +26,4 @@ galaxy_info: dependencies: - web-svc-legal - web-svc-asset - - web-app-port-ui \ No newline at end of file + - web-app-desktop \ No newline at end of file diff --git a/roles/web-app-port-ui/Administrator.md b/roles/web-app-desktop/Administrator.md similarity index 100% rename from roles/web-app-port-ui/Administrator.md rename to roles/web-app-desktop/Administrator.md diff --git a/roles/web-app-port-ui/README.md b/roles/web-app-desktop/README.md similarity index 99% rename from roles/web-app-port-ui/README.md rename to roles/web-app-desktop/README.md index 97cde67e..9fdc3ae3 100644 --- a/roles/web-app-port-ui/README.md +++ b/roles/web-app-desktop/README.md @@ -1,4 +1,4 @@ -# PortUI +# Desktop ## Description diff --git a/roles/web-app-port-ui/TODO.md b/roles/web-app-desktop/TODO.md similarity index 100% rename from roles/web-app-port-ui/TODO.md rename to roles/web-app-desktop/TODO.md diff --git a/roles/web-app-port-ui/config/main.yml b/roles/web-app-desktop/config/main.yml similarity index 100% rename from roles/web-app-port-ui/config/main.yml rename to roles/web-app-desktop/config/main.yml diff --git a/roles/web-app-port-ui/filter_plugins/list_in_filter.py b/roles/web-app-desktop/filter_plugins/list_in_filter.py similarity index 100% rename from roles/web-app-port-ui/filter_plugins/list_in_filter.py rename to roles/web-app-desktop/filter_plugins/list_in_filter.py diff --git a/roles/web-app-port-ui/filter_plugins/simpleicons_source.py b/roles/web-app-desktop/filter_plugins/simpleicons_source.py similarity index 100% rename from roles/web-app-port-ui/filter_plugins/simpleicons_source.py rename to roles/web-app-desktop/filter_plugins/simpleicons_source.py diff --git a/roles/web-app-port-ui/lookup_plugins/__init__.py b/roles/web-app-desktop/lookup_plugins/__init__.py similarity index 100% rename from roles/web-app-port-ui/lookup_plugins/__init__.py rename to roles/web-app-desktop/lookup_plugins/__init__.py diff --git a/roles/web-app-port-ui/lookup_plugins/docker_cards.py b/roles/web-app-desktop/lookup_plugins/docker_cards.py similarity index 100% rename from roles/web-app-port-ui/lookup_plugins/docker_cards.py rename to roles/web-app-desktop/lookup_plugins/docker_cards.py diff --git a/roles/web-app-port-ui/lookup_plugins/docker_cards_grouped.py b/roles/web-app-desktop/lookup_plugins/docker_cards_grouped.py similarity index 100% rename from roles/web-app-port-ui/lookup_plugins/docker_cards_grouped.py rename to roles/web-app-desktop/lookup_plugins/docker_cards_grouped.py diff --git a/roles/web-app-port-ui/meta/main.yml b/roles/web-app-desktop/meta/main.yml similarity index 100% rename from roles/web-app-port-ui/meta/main.yml rename to roles/web-app-desktop/meta/main.yml diff --git a/roles/web-app-port-ui/tasks/01_core.yml b/roles/web-app-desktop/tasks/01_core.yml similarity index 100% rename from roles/web-app-port-ui/tasks/01_core.yml rename to roles/web-app-desktop/tasks/01_core.yml diff --git a/roles/web-app-port-ui/tasks/02_validate.yml b/roles/web-app-desktop/tasks/02_validate.yml similarity index 93% rename from roles/web-app-port-ui/tasks/02_validate.yml rename to roles/web-app-desktop/tasks/02_validate.yml index 3ec46d9f..4fed13ab 100644 --- a/roles/web-app-port-ui/tasks/02_validate.yml +++ b/roles/web-app-desktop/tasks/02_validate.yml @@ -5,11 +5,11 @@ ( not (item.value.features['desktop'] | default(false) | bool) ) - or (domains | get_domain(item.key)).endswith(domains | get_domain('web-app-port-ui')) + or (domains | get_domain(item.key)).endswith(domains | get_domain('web-app-desktop')) fail_msg: > Application {{ item.key }} has domain {{ domains | get_domain(item.key) }} - but it does not end with {{ domains | get_domain('web-app-port-ui') }}! + but it does not end with {{ domains | get_domain('web-app-desktop') }}! loop: "{{ applications | dict2items | selectattr('key', 'match', '^(web-app-|web-svc-)') diff --git a/roles/web-app-port-ui/tasks/main.yml b/roles/web-app-desktop/tasks/main.yml similarity index 64% rename from roles/web-app-port-ui/tasks/main.yml rename to roles/web-app-desktop/tasks/main.yml index be22f98c..e360f41c 100644 --- a/roles/web-app-port-ui/tasks/main.yml +++ b/roles/web-app-desktop/tasks/main.yml @@ -2,4 +2,4 @@ - block: - include_tasks: 01_core.yml - include_tasks: utils/run_once.yml - when: run_once_web_app_port_ui is not defined \ No newline at end of file + when: run_once_web_app_desktop is not defined \ No newline at end of file diff --git a/roles/web-app-port-ui/templates/config.yaml.j2 b/roles/web-app-desktop/templates/config.yaml.j2 similarity index 100% rename from roles/web-app-port-ui/templates/config.yaml.j2 rename to roles/web-app-desktop/templates/config.yaml.j2 diff --git a/roles/web-app-port-ui/templates/docker-compose.yml.j2 b/roles/web-app-desktop/templates/docker-compose.yml.j2 similarity index 100% rename from roles/web-app-port-ui/templates/docker-compose.yml.j2 rename to roles/web-app-desktop/templates/docker-compose.yml.j2 diff --git a/roles/web-app-port-ui/templates/javascript.js.j2 b/roles/web-app-desktop/templates/javascript.js.j2 similarity index 100% rename from roles/web-app-port-ui/templates/javascript.js.j2 rename to roles/web-app-desktop/templates/javascript.js.j2 diff --git a/roles/web-app-port-ui/templates/menu/applications.yml.j2 b/roles/web-app-desktop/templates/menu/applications.yml.j2 similarity index 100% rename from roles/web-app-port-ui/templates/menu/applications.yml.j2 rename to roles/web-app-desktop/templates/menu/applications.yml.j2 diff --git a/roles/web-app-port-ui/templates/menu/contact.yml.j2 b/roles/web-app-desktop/templates/menu/contact.yml.j2 similarity index 100% rename from roles/web-app-port-ui/templates/menu/contact.yml.j2 rename to roles/web-app-desktop/templates/menu/contact.yml.j2 diff --git a/roles/web-app-port-ui/templates/menu/followus.yml.j2 b/roles/web-app-desktop/templates/menu/followus.yml.j2 similarity index 100% rename from roles/web-app-port-ui/templates/menu/followus.yml.j2 rename to roles/web-app-desktop/templates/menu/followus.yml.j2 diff --git a/roles/web-app-port-ui/templates/menu/footer.yml.j2 b/roles/web-app-desktop/templates/menu/footer.yml.j2 similarity index 100% rename from roles/web-app-port-ui/templates/menu/footer.yml.j2 rename to roles/web-app-desktop/templates/menu/footer.yml.j2 diff --git a/roles/web-app-port-ui/templates/menu/header.yml.j2 b/roles/web-app-desktop/templates/menu/header.yml.j2 similarity index 97% rename from roles/web-app-port-ui/templates/menu/header.yml.j2 rename to roles/web-app-desktop/templates/menu/header.yml.j2 index 31ee6223..012310ab 100644 --- a/roles/web-app-port-ui/templates/menu/header.yml.j2 +++ b/roles/web-app-desktop/templates/menu/header.yml.j2 @@ -17,4 +17,4 @@ description: Reload the application icon: class: fa-solid fa-rotate-right - url: "{{ WEB_PROTOCOL }}://{{ domains | get_domain('web-app-port-ui') }}" \ No newline at end of file + url: "{{ WEB_PROTOCOL }}://{{ domains | get_domain('web-app-desktop') }}" \ No newline at end of file diff --git a/roles/web-app-port-ui/templates/menu/support.yml.j2 b/roles/web-app-desktop/templates/menu/support.yml.j2 similarity index 100% rename from roles/web-app-port-ui/templates/menu/support.yml.j2 rename to roles/web-app-desktop/templates/menu/support.yml.j2 diff --git a/roles/web-app-port-ui/vars/main.yml b/roles/web-app-desktop/vars/main.yml similarity index 62% rename from roles/web-app-port-ui/vars/main.yml rename to roles/web-app-desktop/vars/main.yml index 21aa7f4c..f79f5550 100644 --- a/roles/web-app-port-ui/vars/main.yml +++ b/roles/web-app-desktop/vars/main.yml @@ -1,4 +1,4 @@ -application_id: "web-app-port-ui" +application_id: "web-app-desktop" docker_repository_address: "https://github.com/kevinveenbirkenbach/port-ui" -config_inventory_path: "{{ inventory_dir }}/files/{{ inventory_hostname }}/docker/web-app-port-ui/config.yaml.j2" +config_inventory_path: "{{ inventory_dir }}/files/{{ inventory_hostname }}/docker/web-app-desktop/config.yaml.j2" docker_pull_git_repository: true \ No newline at end of file diff --git a/roles/web-app-port-ui/vars/menu_categories.yml b/roles/web-app-desktop/vars/menu_categories.yml similarity index 100% rename from roles/web-app-port-ui/vars/menu_categories.yml rename to roles/web-app-desktop/vars/menu_categories.yml diff --git a/roles/web-app-mig/config/main.yml b/roles/web-app-mig/config/main.yml index c54ce980..2ef9c0cc 100644 --- a/roles/web-app-mig/config/main.yml +++ b/roles/web-app-mig/config/main.yml @@ -7,7 +7,7 @@ docker: features: matomo: true # activate tracking css: true # use custom infinito stile - desktop: true # Enable in port-ui + desktop: true # Enable in desktop logout: false server: csp: diff --git a/tests/unit/README.md b/tests/unit/README.md index 527c55e2..0f5b315e 100644 --- a/tests/unit/README.md +++ b/tests/unit/README.md @@ -1,6 +1,6 @@ # Unit Tests -This directory contains unit tests for various custom components in the project, such as the custom lookup plugin `docker_cards` used in the `web-app-port-ui` role. +This directory contains unit tests for various custom components in the project, such as the custom lookup plugin `docker_cards` used in the `web-app-desktop` role. ## Overview @@ -31,7 +31,7 @@ You can run the tests using one of the following methods: ## How It Works - **Setup:** - The test script creates a temporary directory to simulate your roles folder. It then creates a sample role (`web-app-port-ui`) with a `README.md` file (containing a header for the title) and a `meta/main.yml` file (with the required metadata). + The test script creates a temporary directory to simulate your roles folder. It then creates a sample role (`web-app-desktop`) with a `README.md` file (containing a header for the title) and a `meta/main.yml` file (with the required metadata). - **Execution:** Dummy variable values for `domains` and `applications` are provided (these are the variables the lookup plugin expects). The lookup plugin is then run, which processes the sample role and returns the card information. diff --git a/tests/unit/filter_plugins/test_applications_filter_for_html.py b/tests/unit/filter_plugins/test_applications_filter_for_html.py index 182f4a01..1f0ec3c5 100644 --- a/tests/unit/filter_plugins/test_applications_filter_for_html.py +++ b/tests/unit/filter_plugins/test_applications_filter_for_html.py @@ -22,7 +22,7 @@ class TestApplicationsIfGroupAndDeps(unittest.TestCase): 'web-svc-legal': {}, 'web-svc-file': {}, 'web-svc-asset': {}, - 'web-app-port-ui': {}, + 'web-app-desktop': {}, 'util-srv-corporate-identity': {}, } diff --git a/tests/unit/filter_plugins/test_csp_filters.py b/tests/unit/filter_plugins/test_csp_filters.py index 2e0ad3bd..94f93305 100644 --- a/tests/unit/filter_plugins/test_csp_filters.py +++ b/tests/unit/filter_plugins/test_csp_filters.py @@ -182,7 +182,7 @@ class TestCspFilters(unittest.TestCase): # Ensure feature enabled and domain set self.apps['app1']['features']['desktop'] = True # simulate a subdomain for the application - self.domains['web-app-port-ui'] = ['domain-example.com'] + self.domains['web-app-desktop'] = ['domain-example.com'] header = self.filter.build_csp_header(self.apps, 'app1', self.domains, web_protocol='https') # Expect '*.domain-example.com' in the frame-ancestors directive diff --git a/tests/unit/filter_plugins/test_domain_mappings.py b/tests/unit/filter_plugins/test_domain_mappings.py index 8c74afea..ef212476 100644 --- a/tests/unit/filter_plugins/test_domain_mappings.py +++ b/tests/unit/filter_plugins/test_domain_mappings.py @@ -22,27 +22,27 @@ class TestDomainMappings(unittest.TestCase): self.assertEqual(result, []) def test_app_without_domains(self): - apps = {'web-app-port-ui': {}} + apps = {'web-app-desktop': {}} # no domains key → no mappings result = self.filter.domain_mappings(apps, self.primary) self.assertEqual(result, []) def test_empty_domains_cfg(self): - apps = {'web-app-port-ui': {'domains': {}}} - default = 'port-ui.example.com' + apps = {'web-app-desktop': {'domains': {}}} + default = 'desktop.example.com' expected = [] result = self.filter.domain_mappings(apps, self.primary) self.assertEqual(result, expected) def test_explicit_aliases(self): apps = { - 'web-app-port-ui': { + 'web-app-desktop': { 'server':{ 'domains': {'aliases': ['alias.com']} } } } - default = 'port-ui.example.com' + default = 'desktop.example.com' expected = [ {'source': 'alias.com', 'target': default}, ] @@ -52,21 +52,21 @@ class TestDomainMappings(unittest.TestCase): def test_canonical_not_default(self): apps = { - 'web-app-port-ui': { + 'web-app-desktop': { 'server':{ 'domains': {'canonical': ['foo.com']} } } } expected = [ - {'source': 'port-ui.example.com', 'target': 'foo.com'} + {'source': 'desktop.example.com', 'target': 'foo.com'} ] result = self.filter.domain_mappings(apps, self.primary) self.assertEqual(result, expected) def test_canonical_dict(self): apps = { - 'web-app-port-ui': { + 'web-app-desktop': { 'server':{ 'domains': { 'canonical': {'one': 'one.com', 'two': 'two.com'} @@ -76,14 +76,14 @@ class TestDomainMappings(unittest.TestCase): } # first canonical key 'one' → one.com expected = [ - {'source': 'port-ui.example.com', 'target': 'one.com'} + {'source': 'desktop.example.com', 'target': 'one.com'} ] result = self.filter.domain_mappings(apps, self.primary) self.assertEqual(result, expected) def test_multiple_apps(self): apps = { - 'web-app-port-ui': { + 'web-app-desktop': { 'server':{'domains': {'aliases': ['a1.com']}} }, 'web-app-mastodon': { @@ -91,7 +91,7 @@ class TestDomainMappings(unittest.TestCase): }, } expected = [ - {'source': 'a1.com', 'target': 'port-ui.example.com'}, + {'source': 'a1.com', 'target': 'desktop.example.com'}, {'source': 'mastodon.example.com', 'target': 'c2.com'}, ] result = self.filter.domain_mappings(apps, self.primary) @@ -99,21 +99,21 @@ class TestDomainMappings(unittest.TestCase): def test_multiple_aliases(self): apps = { - 'web-app-port-ui': { + 'web-app-desktop': { 'server':{'domains': {'aliases': ['a1.com','a2.com']} } } } expected = [ - {'source': 'a1.com', 'target': 'port-ui.example.com'}, - {'source': 'a2.com', 'target': 'port-ui.example.com'} + {'source': 'a1.com', 'target': 'desktop.example.com'}, + {'source': 'a2.com', 'target': 'desktop.example.com'} ] result = self.filter.domain_mappings(apps, self.primary) self.assertCountEqual(result, expected) def test_invalid_aliases_type(self): apps = { - 'web-app-port-ui': {'server':{'domains': {'aliases': 123}}} + 'web-app-desktop': {'server':{'domains': {'aliases': 123}}} } with self.assertRaises(AnsibleFilterError): self.filter.domain_mappings(apps, self.primary) diff --git a/tests/unit/lookup_plugins/test_docker_cards.py b/tests/unit/lookup_plugins/test_docker_cards.py index 512d755d..b577d9b4 100644 --- a/tests/unit/lookup_plugins/test_docker_cards.py +++ b/tests/unit/lookup_plugins/test_docker_cards.py @@ -6,8 +6,8 @@ import tempfile import shutil import unittest -# Adjust the PYTHONPATH to include the lookup_plugins folder from the web-app-port-ui role. -sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../../../roles/web-app-port-ui/lookup_plugins')) +# Adjust the PYTHONPATH to include the lookup_plugins folder from the web-app-desktop role. +sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../../../roles/web-app-desktop/lookup_plugins')) from docker_cards import LookupModule @@ -17,8 +17,8 @@ class TestDockerCardsLookup(unittest.TestCase): # Create a temporary directory to simulate the roles directory. self.test_roles_dir = tempfile.mkdtemp(prefix="test_roles_") - # Create a sample role "web-app-port-ui" under that directory. - self.role_name = "web-app-port-ui" + # Create a sample role "web-app-desktop" under that directory. + self.role_name = "web-app-desktop" self.role_dir = os.path.join(self.test_roles_dir, self.role_name) os.makedirs(os.path.join(self.role_dir, "meta")) os.makedirs(os.path.join(self.role_dir, "vars"))