import-hosting-domain-assets #84

Merged
hsh-michaelhoennig merged 12 commits from import-hosting-domain-assets into master 2024-08-08 10:40:35 +02:00
2 changed files with 38 additions and 9 deletions
Showing only changes of commit ec0e9a5c9e - Show all commits

View File

@ -117,7 +117,6 @@ public class ImportHostingAssets extends ImportOfficeData {
static final Integer DBINSTANCE_ID_OFFSET = 6000000;
static final Integer DBUSER_ID_OFFSET = 7000000;
static final Integer DB_ID_OFFSET = 8000000;
static final Integer DOMAIN_OFFSET = 10000000;
static final Integer DOMAIN_SETUP_OFFSET = 10000000;
static final Integer DOMAIN_DNS_SETUP_OFFSET = 11000000;
static final Integer DOMAIN_HTTP_SETUP_OFFSET = 12000000;
@ -131,6 +130,7 @@ public class ImportHostingAssets extends ImportOfficeData {
static Map<Integer, Hive> hives = new WriteOnceMap<>();
static Map<Integer, HsHostingAssetRealEntity> hostingAssets = new WriteOnceMap<>(); // TODO.impl: separate maps for each type?
static Map<String, HsHostingAssetRealEntity> dbUsersByEngineAndName = new WriteOnceMap<>();
static Map<String, HsHostingAssetRealEntity> domainSetupsByName = new WriteOnceMap<>();
@Test
@Order(11010)
@ -471,7 +471,12 @@ public class ImportHostingAssets extends ImportOfficeData {
10004531=HsHostingAssetRealEntity(DOMAIN_SETUP, l-u-g.org, l-u-g.org),
10004532=HsHostingAssetRealEntity(DOMAIN_SETUP, linuxfanboysngirls.de, linuxfanboysngirls.de),
10004534=HsHostingAssetRealEntity(DOMAIN_SETUP, lug-mars.de, lug-mars.de),
10004581=HsHostingAssetRealEntity(DOMAIN_SETUP, 1981.isonweb.de, 1981.isonweb.de)
10004581=HsHostingAssetRealEntity(DOMAIN_SETUP, 1981.ist-im-netz.de, 1981.ist-im-netz.de),
11004530=HsHostingAssetRealEntity(DOMAIN_DNS_SETUP, l-u-g.de|DNS, DNS für l-u-g.de, DOMAIN_SETUP:l-u-g.de, MANAGED_WEBSPACE:lug00),
11004531=HsHostingAssetRealEntity(DOMAIN_DNS_SETUP, l-u-g.org|DNS, DNS für l-u-g.org, DOMAIN_SETUP:l-u-g.org, MANAGED_WEBSPACE:lug00),
11004532=HsHostingAssetRealEntity(DOMAIN_DNS_SETUP, linuxfanboysngirls.de|DNS, DNS für linuxfanboysngirls.de, DOMAIN_SETUP:linuxfanboysngirls.de, MANAGED_WEBSPACE:lug00),
11004534=HsHostingAssetRealEntity(DOMAIN_DNS_SETUP, lug-mars.de|DNS, DNS für lug-mars.de, DOMAIN_SETUP:lug-mars.de, MANAGED_WEBSPACE:lug00),
11004581=HsHostingAssetRealEntity(DOMAIN_DNS_SETUP, 1981.ist-im-netz.de|DNS, DNS für 1981.ist-im-netz.de, DOMAIN_SETUP:1981.ist-im-netz.de, MANAGED_WEBSPACE:mim00)
}
""");
}
@ -1092,11 +1097,11 @@ public class ImportHostingAssets extends ImportOfficeData {
.map(this::trimAll)
.map(row -> new Record(columns, row))
.forEach(rec -> {
final var database_id = rec.getInteger("domain_id");
final var domain_id = rec.getInteger("domain_id");
final var domain_name = rec.getString("domain_name");
// final var domain_since = rec.getString("domain_since");
// final var domain_dns_master = rec.getString("domain_dns_master");
final var owner = rec.getString("domain_owner");
final var owner_id = rec.getInteger("domain_owner");
final var valid_subdomain_names = rec.getString("valid_subdomain_names");
final var passenger_python = rec.getString("passenger_python");
final var passenger_nodejs = rec.getString("passenger_nodejs");
@ -1104,16 +1109,40 @@ public class ImportHostingAssets extends ImportOfficeData {
final var fcgi_php_bin = rec.getString("fcgi_php_bin");
final var domainoptions = rec.getString("domainoptions");
final var dbAsset = HsHostingAssetRealEntity.builder()
final var domainSetupAsset = HsHostingAssetRealEntity.builder()
.type(DOMAIN_SETUP)
// FIXME .parentAsset(parentDomainSetupAsset)
// .parentAsset(parentDomainSetupAsset) are set once we've collected all of them
.identifier(domain_name)
.caption(domain_name)
.config(ofEntries(
// nothing here
))
.build();
hostingAssets.put(DOMAIN_OFFSET + database_id, dbAsset);
domainSetupsByName.put(domain_name, domainSetupAsset);
hostingAssets.put(DOMAIN_SETUP_OFFSET + domain_id, domainSetupAsset);
final var ownerAsset = hostingAssets.get(UNIXUSER_ID_OFFSET + owner_id);
final var webspaceAsset = ownerAsset.getParentAsset();
assertThat(webspaceAsset.getType()).isEqualTo(MANAGED_WEBSPACE);
final var domainDnsSetupAsset = HsHostingAssetRealEntity.builder()
.type(DOMAIN_DNS_SETUP)
.parentAsset(domainSetupAsset)
.assignedToAsset(webspaceAsset)
.identifier(domain_name + "|DNS")
.caption("DNS für " + domain_name)
.config(ofEntries(
// FIXME: read from separate files
))
.build();
hostingAssets.put(DOMAIN_DNS_SETUP_OFFSET + domain_id, domainDnsSetupAsset);
});
domainSetupsByName.values().forEach(domainSetup -> {
final var parentDomainName = domainSetup.getIdentifier().split("\\.")[0];
final var parentDomainSetup = domainSetupsByName.get(parentDomainName);
if (parentDomainSetup != null) {
domainSetup.setParentAsset(parentDomainSetup);
}
});
}

View File

@ -3,9 +3,9 @@ domain_id;domain_name;domain_since;domain_dns_master;domain_owner;valid_subdomai
4531;l-u-g.org;2013-09-10;dns.hostsharing.net;5803;*;/usr/bin/python3;/usr/bin/node;/usr/bin/ruby;/usr/lib/cgi-bin/php;greylisting,multiviews,indexes,htdocsfallback,includes,cgi,fastcgi,passenger
4532;linuxfanboysngirls.de;2013-09-10;dns.hostsharing.net;5809;*;/usr/bin/python3;/usr/bin/node;/usr/bin/ruby;/usr/lib/cgi-bin/php;greylisting,multiviews,indexes,htdocsfallback,includes,cgi,fastcgi,passenger
4534;lug-mars.de;2013-09-10;dns.hostsharing.net;5809;www;/usr/bin/python3;/usr/bin/node;/usr/bin/ruby;/usr/lib/cgi-bin/php;greylisting,letsencrypt,multiviews,indexes,htdocsfallback,includes,cgi,fastcgi,passenger
4581;1981.isonweb.de;2013-09-17;dns.hostsharing.net;5964;*;/usr/bin/python3;/usr/bin/node;/usr/bin/ruby;/usr/lib/cgi-bin/php;greylisting,multiviews,indexes,htdocsfallback,includes,cgi,fastcgi,passenger
4581;1981.ist-im-netz.de;2013-09-17;dns.hostsharing.net;5964;*;/usr/bin/python3;/usr/bin/node;/usr/bin/ruby;/usr/lib/cgi-bin/php;greylisting,multiviews,indexes,htdocsfallback,includes,cgi,fastcgi,passenger
4587;mellis.de;2013-09-17;dns.hostsharing.net;5964;www,michael,test,photos,static,input;/usr/bin/python3;/usr/bin/node;/usr/bin/ruby;/usr/lib/cgi-bin/php;htdocsfallback,indexes,includes,letsencrypt,multiviews,cgi,fastcgi,passenger
4589;isonweb.de;2013-09-17;dns.hostsharing.net;5964;*;/usr/bin/python3;/usr/bin/node;/usr/bin/ruby;/usr/lib/cgi-bin/php;htdocsfallback,indexes,includes,letsencrypt,multiviews,cgi,fastcgi,passenger
4589;ist-im-netz.de;2013-09-17;dns.hostsharing.net;5964;*;/usr/bin/python3;/usr/bin/node;/usr/bin/ruby;/usr/lib/cgi-bin/php;htdocsfallback,indexes,includes,letsencrypt,multiviews,cgi,fastcgi,passenger
4600;waera.de;2013-09-17;dns.hostsharing.net;5964;*;/usr/bin/python3;/usr/bin/node;/usr/bin/ruby;/usr/lib/cgi-bin/php;greylisting,multiviews,indexes,htdocsfallback,includes,cgi,fastcgi,passenger
4604;xn--wra-qla.de;2013-09-17;dns.hostsharing.net;5964;*;/usr/bin/python3;/usr/bin/node;/usr/bin/ruby;/usr/lib/cgi-bin/php;greylisting,multiviews,indexes,htdocsfallback,includes,cgi,fastcgi,passenger
27662;dph-netzwerk.de;2021-06-02;h93.hostsharing.net;169596;*;/usr/bin/python3;/usr/bin/node;/usr/bin/ruby;/usr/lib/cgi-bin/php;htdocsfallback,indexes,autoconfig,greylisting,includes,letsencrypt,multiviews,cgi,fastcgi,passenger

1 domain_id domain_name domain_since domain_dns_master domain_owner valid_subdomain_names passenger_python passenger_nodejs passenger_ruby fcgi_php_bin domainoptions
2 4530 l-u-g.de 2013-09-10 dns.hostsharing.net 5803 * /usr/bin/python3 /usr/bin/node /usr/bin/ruby /usr/lib/cgi-bin/php greylisting,multiviews,indexes,htdocsfallback,includes,cgi,fastcgi,passenger
3 4531 l-u-g.org 2013-09-10 dns.hostsharing.net 5803 * /usr/bin/python3 /usr/bin/node /usr/bin/ruby /usr/lib/cgi-bin/php greylisting,multiviews,indexes,htdocsfallback,includes,cgi,fastcgi,passenger
4 4532 linuxfanboysngirls.de 2013-09-10 dns.hostsharing.net 5809 * /usr/bin/python3 /usr/bin/node /usr/bin/ruby /usr/lib/cgi-bin/php greylisting,multiviews,indexes,htdocsfallback,includes,cgi,fastcgi,passenger
5 4534 lug-mars.de 2013-09-10 dns.hostsharing.net 5809 www /usr/bin/python3 /usr/bin/node /usr/bin/ruby /usr/lib/cgi-bin/php greylisting,letsencrypt,multiviews,indexes,htdocsfallback,includes,cgi,fastcgi,passenger
6 4581 1981.ist-im-netz.de 2013-09-17 dns.hostsharing.net 5964 * /usr/bin/python3 /usr/bin/node /usr/bin/ruby /usr/lib/cgi-bin/php greylisting,multiviews,indexes,htdocsfallback,includes,cgi,fastcgi,passenger
7 4587 mellis.de 2013-09-17 dns.hostsharing.net 5964 www,michael,test,photos,static,input /usr/bin/python3 /usr/bin/node /usr/bin/ruby /usr/lib/cgi-bin/php htdocsfallback,indexes,includes,letsencrypt,multiviews,cgi,fastcgi,passenger
8 4589 ist-im-netz.de 2013-09-17 dns.hostsharing.net 5964 * /usr/bin/python3 /usr/bin/node /usr/bin/ruby /usr/lib/cgi-bin/php htdocsfallback,indexes,includes,letsencrypt,multiviews,cgi,fastcgi,passenger
9 4600 waera.de 2013-09-17 dns.hostsharing.net 5964 * /usr/bin/python3 /usr/bin/node /usr/bin/ruby /usr/lib/cgi-bin/php greylisting,multiviews,indexes,htdocsfallback,includes,cgi,fastcgi,passenger
10 4604 xn--wra-qla.de 2013-09-17 dns.hostsharing.net 5964 * /usr/bin/python3 /usr/bin/node /usr/bin/ruby /usr/lib/cgi-bin/php greylisting,multiviews,indexes,htdocsfallback,includes,cgi,fastcgi,passenger
11 27662 dph-netzwerk.de 2021-06-02 h93.hostsharing.net 169596 * /usr/bin/python3 /usr/bin/node /usr/bin/ruby /usr/lib/cgi-bin/php htdocsfallback,indexes,autoconfig,greylisting,includes,letsencrypt,multiviews,cgi,fastcgi,passenger