mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-26 21:45:20 +02:00
Renamed web-app-port-ui to web-app-desktop
This commit is contained in:
parent
9756a0f75f
commit
b916173422
@ -155,7 +155,7 @@ class FilterModule(object):
|
|||||||
if directive == 'frame-ancestors':
|
if directive == 'frame-ancestors':
|
||||||
# Enable loading via ancestors
|
# Enable loading via ancestors
|
||||||
if self.is_feature_enabled(applications, 'desktop', application_id):
|
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"
|
sld_tld = ".".join(domain.split(".")[-2:]) # yields "example.com"
|
||||||
tokens.append(f"{sld_tld}") # yields "*.example.com"
|
tokens.append(f"{sld_tld}") # yields "*.example.com"
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ ports:
|
|||||||
web-app-moodle: 8026
|
web-app-moodle: 8026
|
||||||
web-app-taiga: 8027
|
web-app-taiga: 8027
|
||||||
web-app-friendica: 8028
|
web-app-friendica: 8028
|
||||||
web-app-port-ui: 8029
|
web-app-desktop: 8029
|
||||||
web-app-bluesky_api: 8030
|
web-app-bluesky_api: 8030
|
||||||
web-app-bluesky_web: 8031
|
web-app-bluesky_web: 8031
|
||||||
web-app-keycloak: 8032
|
web-app-keycloak: 8032
|
||||||
|
@ -2,7 +2,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
initIframeHandler(
|
initIframeHandler(
|
||||||
'{{ PRIMARY_DOMAIN }}',
|
'{{ PRIMARY_DOMAIN }}',
|
||||||
'{{ domain }}',
|
'{{ domain }}',
|
||||||
'{{ domains | get_url("web-app-port-ui", WEB_PROTOCOL) }}'
|
'{{ domains | get_url("web-app-desktop", WEB_PROTOCOL) }}'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
{% if MODE_DEBUG | bool %}
|
{% if MODE_DEBUG | bool %}
|
||||||
|
@ -26,4 +26,4 @@ galaxy_info:
|
|||||||
dependencies:
|
dependencies:
|
||||||
- web-svc-legal
|
- web-svc-legal
|
||||||
- web-svc-asset
|
- web-svc-asset
|
||||||
- web-app-port-ui
|
- web-app-desktop
|
@ -1,4 +1,4 @@
|
|||||||
# PortUI
|
# Desktop
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
@ -5,11 +5,11 @@
|
|||||||
(
|
(
|
||||||
not (item.value.features['desktop'] | default(false) | bool)
|
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: >
|
fail_msg: >
|
||||||
Application {{ item.key }}
|
Application {{ item.key }}
|
||||||
has domain {{ domains | get_domain(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
|
loop: "{{ applications
|
||||||
| dict2items
|
| dict2items
|
||||||
| selectattr('key', 'match', '^(web-app-|web-svc-)')
|
| selectattr('key', 'match', '^(web-app-|web-svc-)')
|
@ -2,4 +2,4 @@
|
|||||||
- block:
|
- block:
|
||||||
- include_tasks: 01_core.yml
|
- include_tasks: 01_core.yml
|
||||||
- include_tasks: utils/run_once.yml
|
- include_tasks: utils/run_once.yml
|
||||||
when: run_once_web_app_port_ui is not defined
|
when: run_once_web_app_desktop is not defined
|
@ -17,4 +17,4 @@
|
|||||||
description: Reload the application
|
description: Reload the application
|
||||||
icon:
|
icon:
|
||||||
class: fa-solid fa-rotate-right
|
class: fa-solid fa-rotate-right
|
||||||
url: "{{ WEB_PROTOCOL }}://{{ domains | get_domain('web-app-port-ui') }}"
|
url: "{{ WEB_PROTOCOL }}://{{ domains | get_domain('web-app-desktop') }}"
|
@ -1,4 +1,4 @@
|
|||||||
application_id: "web-app-port-ui"
|
application_id: "web-app-desktop"
|
||||||
docker_repository_address: "https://github.com/kevinveenbirkenbach/port-ui"
|
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
|
docker_pull_git_repository: true
|
@ -7,7 +7,7 @@ docker:
|
|||||||
features:
|
features:
|
||||||
matomo: true # activate tracking
|
matomo: true # activate tracking
|
||||||
css: true # use custom infinito stile
|
css: true # use custom infinito stile
|
||||||
desktop: true # Enable in port-ui
|
desktop: true # Enable in desktop
|
||||||
logout: false
|
logout: false
|
||||||
server:
|
server:
|
||||||
csp:
|
csp:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Unit Tests
|
# 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
|
## Overview
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ You can run the tests using one of the following methods:
|
|||||||
## How It Works
|
## How It Works
|
||||||
|
|
||||||
- **Setup:**
|
- **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:**
|
- **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.
|
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.
|
||||||
|
@ -22,7 +22,7 @@ class TestApplicationsIfGroupAndDeps(unittest.TestCase):
|
|||||||
'web-svc-legal': {},
|
'web-svc-legal': {},
|
||||||
'web-svc-file': {},
|
'web-svc-file': {},
|
||||||
'web-svc-asset': {},
|
'web-svc-asset': {},
|
||||||
'web-app-port-ui': {},
|
'web-app-desktop': {},
|
||||||
'util-srv-corporate-identity': {},
|
'util-srv-corporate-identity': {},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ class TestCspFilters(unittest.TestCase):
|
|||||||
# Ensure feature enabled and domain set
|
# Ensure feature enabled and domain set
|
||||||
self.apps['app1']['features']['desktop'] = True
|
self.apps['app1']['features']['desktop'] = True
|
||||||
# simulate a subdomain for the application
|
# 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')
|
header = self.filter.build_csp_header(self.apps, 'app1', self.domains, web_protocol='https')
|
||||||
# Expect '*.domain-example.com' in the frame-ancestors directive
|
# Expect '*.domain-example.com' in the frame-ancestors directive
|
||||||
|
@ -22,27 +22,27 @@ class TestDomainMappings(unittest.TestCase):
|
|||||||
self.assertEqual(result, [])
|
self.assertEqual(result, [])
|
||||||
|
|
||||||
def test_app_without_domains(self):
|
def test_app_without_domains(self):
|
||||||
apps = {'web-app-port-ui': {}}
|
apps = {'web-app-desktop': {}}
|
||||||
# no domains key → no mappings
|
# no domains key → no mappings
|
||||||
result = self.filter.domain_mappings(apps, self.primary)
|
result = self.filter.domain_mappings(apps, self.primary)
|
||||||
self.assertEqual(result, [])
|
self.assertEqual(result, [])
|
||||||
|
|
||||||
def test_empty_domains_cfg(self):
|
def test_empty_domains_cfg(self):
|
||||||
apps = {'web-app-port-ui': {'domains': {}}}
|
apps = {'web-app-desktop': {'domains': {}}}
|
||||||
default = 'port-ui.example.com'
|
default = 'desktop.example.com'
|
||||||
expected = []
|
expected = []
|
||||||
result = self.filter.domain_mappings(apps, self.primary)
|
result = self.filter.domain_mappings(apps, self.primary)
|
||||||
self.assertEqual(result, expected)
|
self.assertEqual(result, expected)
|
||||||
|
|
||||||
def test_explicit_aliases(self):
|
def test_explicit_aliases(self):
|
||||||
apps = {
|
apps = {
|
||||||
'web-app-port-ui': {
|
'web-app-desktop': {
|
||||||
'server':{
|
'server':{
|
||||||
'domains': {'aliases': ['alias.com']}
|
'domains': {'aliases': ['alias.com']}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
default = 'port-ui.example.com'
|
default = 'desktop.example.com'
|
||||||
expected = [
|
expected = [
|
||||||
{'source': 'alias.com', 'target': default},
|
{'source': 'alias.com', 'target': default},
|
||||||
]
|
]
|
||||||
@ -52,21 +52,21 @@ class TestDomainMappings(unittest.TestCase):
|
|||||||
|
|
||||||
def test_canonical_not_default(self):
|
def test_canonical_not_default(self):
|
||||||
apps = {
|
apps = {
|
||||||
'web-app-port-ui': {
|
'web-app-desktop': {
|
||||||
'server':{
|
'server':{
|
||||||
'domains': {'canonical': ['foo.com']}
|
'domains': {'canonical': ['foo.com']}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
expected = [
|
expected = [
|
||||||
{'source': 'port-ui.example.com', 'target': 'foo.com'}
|
{'source': 'desktop.example.com', 'target': 'foo.com'}
|
||||||
]
|
]
|
||||||
result = self.filter.domain_mappings(apps, self.primary)
|
result = self.filter.domain_mappings(apps, self.primary)
|
||||||
self.assertEqual(result, expected)
|
self.assertEqual(result, expected)
|
||||||
|
|
||||||
def test_canonical_dict(self):
|
def test_canonical_dict(self):
|
||||||
apps = {
|
apps = {
|
||||||
'web-app-port-ui': {
|
'web-app-desktop': {
|
||||||
'server':{
|
'server':{
|
||||||
'domains': {
|
'domains': {
|
||||||
'canonical': {'one': 'one.com', 'two': 'two.com'}
|
'canonical': {'one': 'one.com', 'two': 'two.com'}
|
||||||
@ -76,14 +76,14 @@ class TestDomainMappings(unittest.TestCase):
|
|||||||
}
|
}
|
||||||
# first canonical key 'one' → one.com
|
# first canonical key 'one' → one.com
|
||||||
expected = [
|
expected = [
|
||||||
{'source': 'port-ui.example.com', 'target': 'one.com'}
|
{'source': 'desktop.example.com', 'target': 'one.com'}
|
||||||
]
|
]
|
||||||
result = self.filter.domain_mappings(apps, self.primary)
|
result = self.filter.domain_mappings(apps, self.primary)
|
||||||
self.assertEqual(result, expected)
|
self.assertEqual(result, expected)
|
||||||
|
|
||||||
def test_multiple_apps(self):
|
def test_multiple_apps(self):
|
||||||
apps = {
|
apps = {
|
||||||
'web-app-port-ui': {
|
'web-app-desktop': {
|
||||||
'server':{'domains': {'aliases': ['a1.com']}}
|
'server':{'domains': {'aliases': ['a1.com']}}
|
||||||
},
|
},
|
||||||
'web-app-mastodon': {
|
'web-app-mastodon': {
|
||||||
@ -91,7 +91,7 @@ class TestDomainMappings(unittest.TestCase):
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
expected = [
|
expected = [
|
||||||
{'source': 'a1.com', 'target': 'port-ui.example.com'},
|
{'source': 'a1.com', 'target': 'desktop.example.com'},
|
||||||
{'source': 'mastodon.example.com', 'target': 'c2.com'},
|
{'source': 'mastodon.example.com', 'target': 'c2.com'},
|
||||||
]
|
]
|
||||||
result = self.filter.domain_mappings(apps, self.primary)
|
result = self.filter.domain_mappings(apps, self.primary)
|
||||||
@ -99,21 +99,21 @@ class TestDomainMappings(unittest.TestCase):
|
|||||||
|
|
||||||
def test_multiple_aliases(self):
|
def test_multiple_aliases(self):
|
||||||
apps = {
|
apps = {
|
||||||
'web-app-port-ui': {
|
'web-app-desktop': {
|
||||||
'server':{'domains': {'aliases': ['a1.com','a2.com']}
|
'server':{'domains': {'aliases': ['a1.com','a2.com']}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
expected = [
|
expected = [
|
||||||
{'source': 'a1.com', 'target': 'port-ui.example.com'},
|
{'source': 'a1.com', 'target': 'desktop.example.com'},
|
||||||
{'source': 'a2.com', 'target': 'port-ui.example.com'}
|
{'source': 'a2.com', 'target': 'desktop.example.com'}
|
||||||
]
|
]
|
||||||
result = self.filter.domain_mappings(apps, self.primary)
|
result = self.filter.domain_mappings(apps, self.primary)
|
||||||
self.assertCountEqual(result, expected)
|
self.assertCountEqual(result, expected)
|
||||||
|
|
||||||
def test_invalid_aliases_type(self):
|
def test_invalid_aliases_type(self):
|
||||||
apps = {
|
apps = {
|
||||||
'web-app-port-ui': {'server':{'domains': {'aliases': 123}}}
|
'web-app-desktop': {'server':{'domains': {'aliases': 123}}}
|
||||||
}
|
}
|
||||||
with self.assertRaises(AnsibleFilterError):
|
with self.assertRaises(AnsibleFilterError):
|
||||||
self.filter.domain_mappings(apps, self.primary)
|
self.filter.domain_mappings(apps, self.primary)
|
||||||
|
@ -6,8 +6,8 @@ import tempfile
|
|||||||
import shutil
|
import shutil
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
# Adjust the PYTHONPATH to include the lookup_plugins folder from the web-app-port-ui role.
|
# 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-port-ui/lookup_plugins'))
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../../../roles/web-app-desktop/lookup_plugins'))
|
||||||
|
|
||||||
from docker_cards import LookupModule
|
from docker_cards import LookupModule
|
||||||
|
|
||||||
@ -17,8 +17,8 @@ class TestDockerCardsLookup(unittest.TestCase):
|
|||||||
# Create a temporary directory to simulate the roles directory.
|
# Create a temporary directory to simulate the roles directory.
|
||||||
self.test_roles_dir = tempfile.mkdtemp(prefix="test_roles_")
|
self.test_roles_dir = tempfile.mkdtemp(prefix="test_roles_")
|
||||||
|
|
||||||
# Create a sample role "web-app-port-ui" under that directory.
|
# Create a sample role "web-app-desktop" under that directory.
|
||||||
self.role_name = "web-app-port-ui"
|
self.role_name = "web-app-desktop"
|
||||||
self.role_dir = os.path.join(self.test_roles_dir, self.role_name)
|
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, "meta"))
|
||||||
os.makedirs(os.path.join(self.role_dir, "vars"))
|
os.makedirs(os.path.join(self.role_dir, "vars"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user