mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-27 11:16:45 +00:00
push
This commit is contained in:
parent
7bafaa66be
commit
3de01fe12b
|
@ -40,11 +40,13 @@ class HetznerApi extends ApiMap {
|
|||
}
|
||||
|
||||
Future<HetznerServerDetails> createServer({
|
||||
@required String cloudFlareKey,
|
||||
@required User rootUser,
|
||||
@required String domainName,
|
||||
}) async {
|
||||
var data = jsonDecode(
|
||||
'''{"name":"selfprivacy-server","server_type":"cx11","start_after_create":false,"image":"ubuntu-20.04", "volumes":[],"networks":[],"user_data":"#cloud-config\\nruncmd:\\n- curl https://git.selfprivacy.org/ilchub/selfprivacy-nixos-infect/raw/branch/master/nixos-infect | PROVIDER=hetzner NIX_CHANNEL=nixos-20.09 DOMAIN=$domainName USER=${rootUser.login} PASSWORD=${rootUser.password} HASHED_PASSWORD=${rootUser.hashPassword} bash 2>&1 | tee /tmp/infect.log","labels":{},"automount":false}''');
|
||||
'''{"name":"selfprivacy-server","server_type":"cx11","start_after_create":false,"image":"ubuntu-20.04", "volumes":[],"networks":[],"user_data":"#cloud-config\\nruncmd:\\n- curl https://git.selfprivacy.org/ilchub/selfprivacy-nixos-infect/raw/branch/master/nixos-infect | PROVIDER=hetzner NIX_CHANNEL=nixos-20.09 DOMAIN=$domainName LUSER=${rootUser.login} PASSWORD=${rootUser.password} HASHED_PASSWORD=${rootUser.hashPassword} CF_TOKEN=$cloudFlareKey bash 2>&1 | tee /tmp/infect.log","labels":{},"automount":false}''',
|
||||
);
|
||||
|
||||
Response response = await loggedClient.post(
|
||||
rootAddress,
|
||||
|
|
|
@ -113,6 +113,7 @@ class AppConfigCubit extends Cubit<AppConfigState> {
|
|||
state.hetznerKey,
|
||||
state.rootUser,
|
||||
state.cloudFlareDomain.domainName,
|
||||
state.cloudFlareKey,
|
||||
);
|
||||
|
||||
await repository.createDnsRecords(
|
||||
|
|
|
@ -108,9 +108,11 @@ class AppConfigRepository {
|
|||
String hetznerKey,
|
||||
User rootUser,
|
||||
String domainName,
|
||||
String cloudFlareKey
|
||||
) async {
|
||||
var hetznerApi = HetznerApi(hetznerKey);
|
||||
var serverDetails = await hetznerApi.createServer(
|
||||
cloudFlareKey: cloudFlareKey,
|
||||
rootUser: rootUser,
|
||||
domainName: domainName,
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue