mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-09 09:31:13 +00:00
fix: Properly convert Digital Ocean droplets to ServerBasicInfo
This commit is contained in:
parent
2b1f6a12ea
commit
69707f543f
|
@ -326,7 +326,7 @@ class DigitalOceanApi extends ServerProviderApi with VolumeProviderApi {
|
||||||
'image': 'ubuntu-20-04-x64',
|
'image': 'ubuntu-20-04-x64',
|
||||||
'user_data': '#cloud-config\n'
|
'user_data': '#cloud-config\n'
|
||||||
'runcmd:\n'
|
'runcmd:\n'
|
||||||
'- curl https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-infect/raw/branch/testing/final-digital-ocean/nixos-infect | '
|
'- curl https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-infect/raw/branch/providers/digital-ocean/nixos-infect | '
|
||||||
"PROVIDER=$infectProviderName DNS_PROVIDER_TYPE=$dnsProviderType STAGING_ACME='$stagingAcme' DOMAIN='$domainName' "
|
"PROVIDER=$infectProviderName DNS_PROVIDER_TYPE=$dnsProviderType STAGING_ACME='$stagingAcme' DOMAIN='$domainName' "
|
||||||
"LUSER='${rootUser.login}' ENCODED_PASSWORD='$base64Password' CF_TOKEN=$dnsApiToken DB_PASSWORD=$databasePassword "
|
"LUSER='${rootUser.login}' ENCODED_PASSWORD='$base64Password' CF_TOKEN=$dnsApiToken DB_PASSWORD=$databasePassword "
|
||||||
'API_TOKEN=$serverApiToken HOSTNAME=$hostName bash 2>&1 | tee /tmp/infect.log',
|
'API_TOKEN=$serverApiToken HOSTNAME=$hostName bash 2>&1 | tee /tmp/infect.log',
|
||||||
|
|
|
@ -372,7 +372,7 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi {
|
||||||
'networks': [],
|
'networks': [],
|
||||||
'user_data': '#cloud-config\n'
|
'user_data': '#cloud-config\n'
|
||||||
'runcmd:\n'
|
'runcmd:\n'
|
||||||
'- curl https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-infect/raw/branch/testing/final-hetzner/nixos-infect | '
|
'- curl https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-infect/raw/branch/providers/hetzner/nixos-infect | '
|
||||||
"STAGING_ACME='$stagingAcme' PROVIDER=$infectProviderName DNS_PROVIDER_TYPE=$dnsProviderType "
|
"STAGING_ACME='$stagingAcme' PROVIDER=$infectProviderName DNS_PROVIDER_TYPE=$dnsProviderType "
|
||||||
"NIX_CHANNEL=nixos-21.05 DOMAIN='$domainName' LUSER='${rootUser.login}' ENCODED_PASSWORD='$base64Password' "
|
"NIX_CHANNEL=nixos-21.05 DOMAIN='$domainName' LUSER='${rootUser.login}' ENCODED_PASSWORD='$base64Password' "
|
||||||
'CF_TOKEN=$dnsApiToken DB_PASSWORD=$databasePassword API_TOKEN=$serverApiToken HOSTNAME=$hostName bash 2>&1 | '
|
'CF_TOKEN=$dnsApiToken DB_PASSWORD=$databasePassword API_TOKEN=$serverApiToken HOSTNAME=$hostName bash 2>&1 | '
|
||||||
|
|
|
@ -318,7 +318,7 @@ class DigitalOceanServerProvider extends ServerProvider {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<GenericResult<List<ServerBasicInfo>>> getServers() async {
|
Future<GenericResult<List<ServerBasicInfo>>> getServers() async {
|
||||||
final List<ServerBasicInfo> servers = [];
|
List<ServerBasicInfo> servers = [];
|
||||||
final result = await _adapter.api().getServers();
|
final result = await _adapter.api().getServers();
|
||||||
if (result.data.isEmpty || !result.success) {
|
if (result.data.isEmpty || !result.success) {
|
||||||
return GenericResult(
|
return GenericResult(
|
||||||
|
@ -330,7 +330,7 @@ class DigitalOceanServerProvider extends ServerProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
final List rawServers = result.data;
|
final List rawServers = result.data;
|
||||||
rawServers.map<ServerBasicInfo>(
|
servers = rawServers.map<ServerBasicInfo>(
|
||||||
(final server) {
|
(final server) {
|
||||||
String ipv4 = '0.0.0.0';
|
String ipv4 = '0.0.0.0';
|
||||||
if (server['networks']['v4'].isNotEmpty) {
|
if (server['networks']['v4'].isNotEmpty) {
|
||||||
|
|
Loading…
Reference in a new issue