btcpayserver-azure/azuredeploy.json
2019-09-22 23:08:32 +09:00

509 lines
16 KiB
JSON

{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.1.0.0",
"parameters": {
"sshKey": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "SSH Key which will be granted access to the VM (optional)"
}
},
"notificationEmail": {
"type": "string",
"defaultValue": "me@example.com",
"metadata": {
"description": "Email used by Let's encrypt to notify you about certificate expiration (optional)"
}
},
"vmSize": {
"type": "string",
"defaultValue": "Standard_D1_v2",
"metadata": {
"description": "VM size for the Docker host. (see https://azureprice.net/)"
}
},
"network": {
"type": "string",
"allowedValues": [
"mainnet",
"testnet",
"regtest"
],
"defaultValue": "mainnet",
"metadata": {
"description": "Choose mainnet for production, or testnet for testing"
}
},
"supportedCrypto1": {
"type": "string",
"allowedValues": [
"",
"btc",
"ltc",
"dash",
"grs",
"btg",
"ftc",
"via",
"doge",
"mona"
],
"defaultValue": "btc",
"metadata": {
"description": "Choose a crypto currency to support"
}
},
"supportedCrypto2": {
"type": "string",
"allowedValues": [
"",
"btc",
"ltc",
"dash",
"grs",
"btg",
"ftc",
"via",
"doge",
"mona"
],
"defaultValue": "",
"metadata": {
"description": "Choose a second crypto currency to support"
}
},
"supportedCrypto3": {
"type": "string",
"allowedValues": [
"",
"btc",
"ltc",
"dash",
"grs",
"btg",
"ftc",
"via",
"doge",
"mona"
],
"defaultValue": "",
"metadata": {
"description": "Choose a third crypto currency to support"
}
},
"supportedCrypto4": {
"type": "string",
"allowedValues": [
"",
"btc",
"ltc",
"dash",
"grs",
"btg",
"ftc",
"via",
"doge",
"mona"
],
"defaultValue": "",
"metadata": {
"description": "Choose a fourth crypto currency to support"
}
},
"supportedCrypto5": {
"type": "string",
"allowedValues": [
"",
"btc",
"ltc",
"dash",
"grs",
"btg",
"ftc",
"via",
"doge",
"mona"
],
"defaultValue": "",
"metadata": {
"description": "Choose a fifth crypto currency to support"
}
},
"supportedCrypto6": {
"type": "string",
"allowedValues": [
"",
"btc",
"ltc",
"dash",
"grs",
"btg",
"ftc",
"via",
"doge",
"mona"
],
"defaultValue": "",
"metadata": {
"description": "Choose a sixth crypto currency to support"
}
},
"supportedCrypto7": {
"type": "string",
"allowedValues": [
"",
"btc",
"ltc",
"dash",
"grs",
"btg",
"ftc",
"via",
"doge",
"mona"
],
"defaultValue": "",
"metadata": {
"description": "Choose a seventh crypto currency to support"
}
},
"supportedCrypto8": {
"type": "string",
"allowedValues": [
"",
"btc",
"ltc",
"dash",
"grs",
"btg",
"ftc",
"via",
"doge",
"mona"
],
"defaultValue": "",
"metadata": {
"description": "Choose a eigth crypto currency to support"
}
},
"supportedCrypto9": {
"type": "string",
"allowedValues": [
"",
"btc",
"ltc",
"dash",
"grs",
"btg",
"ftc",
"via",
"doge",
"mona"
],
"defaultValue": "",
"metadata": {
"description": "Choose a nineth crypto currency to support"
}
},
"lightningNetworkImplementation": {
"type": "string",
"allowedValues": [
"",
"clightning",
"lnd"
],
"defaultValue": "",
"metadata": {
"description": "Choose a lightning network implementation"
}
},
"lightningNodeAlias": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Public alias of your lightning node (Optional)"
}
},
"ubuntuOSVersion": {
"type": "string",
"defaultValue": "16.04.0-LTS",
"metadata": {
"description": "The Ubuntu version for deploying the Docker containers. This will pick a fully patched image of this given Ubuntu version. Allowed values: 14.04.4-LTS, 15.10, 16.04.0-LTS"
},
"allowedValues": [
"14.04.4-LTS",
"16.04.0-LTS",
"18.04-LTS"
]
},
"repository": {
"type": "string",
"defaultValue": "https://github.com/btcpayserver/btcpayserver-docker",
"metadata": {
"description": "The GIT repository to pull the docker-compose from"
}
},
"branch": {
"type": "string",
"defaultValue": "master",
"metadata": {
"description": "The branch from the GIT repository to use"
}
}
},
"variables": {
"imagePublisher": "Canonical",
"imageOffer": "UbuntuServer",
"OSDiskName": "osdiskfordockersimple",
"nicName": "BTCPayServerNetworkInterface",
"addressPrefix": "10.0.0.0/16",
"subnetName": "Subnet",
"subnetPrefix": "10.0.0.0/24",
"storageAccountType": "Standard_LRS",
"publicIPAddressName": "BTCPayServerPublicIP",
"publicIPAddressType": "Dynamic",
"vmStorageAccountContainerName": "vhds",
"vmAccountStorageName" : "[concat(uniqueString( resourceGroup().id, deployment().name ), 'storage')]",
"vmName": "BTCPayServerVM",
"virtualNetworkName": "BTCPayServerNetwork",
"vnetID": "[resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]",
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]"
},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"name": "[variables('vmAccountStorageName')]",
"apiVersion": "2016-01-01",
"location": "[resourceGroup().location]",
"kind": "Storage",
"sku": {
"name": "[variables('storageAccountType')]"
}
},
{
"apiVersion": "2017-06-01",
"type": "Microsoft.Network/publicIPAddresses",
"name": "[variables('publicIPAddressName')]",
"location": "[resourceGroup().location]",
"properties": {
"publicIPAllocationMethod": "[variables('publicIPAddressType')]",
"dnsSettings": {
"domainNameLabel": "[resourceGroup().name]"
}
}
},
{
"apiVersion": "2017-06-01",
"type": "Microsoft.Network/virtualNetworks",
"name": "[variables('virtualNetworkName')]",
"location": "[resourceGroup().location]",
"properties": {
"addressSpace": {
"addressPrefixes": [
"[variables('addressPrefix')]"
]
},
"subnets": [
{
"name": "[variables('subnetName')]",
"properties": {
"addressPrefix": "[variables('subnetPrefix')]"
}
}
]
}
},
{
"apiVersion": "2017-06-01",
"type": "Microsoft.Network/networkInterfaces",
"name": "[variables('nicName')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
],
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]"
},
"subnet": {
"id": "[variables('subnetRef')]"
}
}
}
],
"networkSecurityGroup": {
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', 'NetworkSecurityGroup')]"
}
}
},
{
"apiVersion": "2017-03-01",
"type": "Microsoft.Network/networkSecurityGroups",
"name": "NetworkSecurityGroup",
"location": "[resourceGroup().location]",
"tags": {
"displayName": "NSG - Front End"
},
"properties": {
"securityRules": [
{
"name": "BTCPayServer",
"properties": {
"description": "Allow inbound BTCPayServer access",
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "443",
"sourceAddressPrefix": "Internet",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 100,
"direction": "Inbound"
}
},
{
"name": "SSH",
"properties": {
"description": "Allow inbound SSH access",
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "22",
"sourceAddressPrefix": "Internet",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 101,
"direction": "Inbound"
}
},
{
"name": "Lets-Encrypt",
"properties": {
"description": "Allow inbound HTTP for let's encrypt access",
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "80",
"sourceAddressPrefix": "Internet",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 102,
"direction": "Inbound"
}
},
{
"name": "LightningBTC",
"properties": {
"description": "Allow inbound Lighning Network access (BTC)",
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "9735",
"sourceAddressPrefix": "Internet",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 103,
"direction": "Inbound"
}
},
{
"name": "LightningLTC",
"properties": {
"description": "Allow inbound Lighning Network access (LTC)",
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "9736",
"sourceAddressPrefix": "Internet",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 104,
"direction": "Inbound"
}
}
]
}
},
{
"apiVersion": "2017-03-30",
"type": "Microsoft.Compute/virtualMachines",
"name": "[variables('vmName')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Storage/storageAccounts/', variables('vmAccountStorageName'))]",
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('vmSize')]"
},
"osProfile": {
"computerName": "[variables('vmName')]",
"adminUsername": "temp",
"adminPassword": "[concat(uniqueString(resourceGroup().id), 'aA5@')]"
},
"storageProfile": {
"imageReference": {
"publisher": "[variables('imagePublisher')]",
"offer": "[variables('imageOffer')]",
"sku": "[parameters('ubuntuOSVersion')]",
"version": "latest"
},
"osDisk": {
"name": "osdisk1",
"vhd": {
"uri": "[concat('http://',variables('vmAccountStorageName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',variables('OSDiskName'),'.vhd')]"
},
"diskSizeGB": 2048,
"caching": "ReadWrite",
"createOption": "FromImage"
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces',variables('nicName'))]"
}
]
}
}
},
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(variables('vmName'),'/CSExtension')]",
"apiVersion": "2017-03-30",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]"
],
"properties": {
"publisher": "Microsoft.Azure.Extensions",
"type": "CustomScript",
"typeHandlerVersion": "2.0",
"autoUpgradeMinorVersion": true,
"settings":
{
"fileUris" : ["https://raw.githubusercontent.com/btcpayserver/btcpayserver-azure/master/azure-entrypoint.sh"],
"commandToExecute" : "[concat('./azure-entrypoint.sh ', reference(concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName')), '2016-03-30').dnsSettings.fqdn, ' \"', parameters('network'), '\" \"', parameters('notificationEmail'), '\" \"', parameters('repository'), '\" \"', parameters('branch'), '\" \"', parameters('lightningNodeAlias'), '\" \"', parameters('supportedCrypto1'), '\" \"', parameters('supportedCrypto2'), '\" \"', parameters('supportedCrypto3'), '\" \"', parameters('supportedCrypto4'), '\" \"', parameters('supportedCrypto5'), '\" \"', parameters('supportedCrypto6'), '\" \"', parameters('supportedCrypto7'), '\" \"', parameters('supportedCrypto8'), '\" \"', parameters('supportedCrypto9'), '\" \"', parameters('lightningNetworkImplementation'), '\" \"', parameters('sshKey'),'\"')]"
}
}
}
],
"outputs": {
"ssh-commandline" : {
"type": "string",
"value": "[concat('ssh', ' root@', reference(concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName')), '2016-03-30').dnsSettings.fqdn)]"
},
"ssh-help" : {
"type": "string",
"value": "If you did not set a SSH Key, please connect to your BTCPay instance, register the administration account and go to Server Settings / Services / SSH to get more information"
},
"server-url" : {
"type": "string",
"value": "[concat('https://', reference(concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName')), '2016-03-30').dnsSettings.fqdn, '/')]"
}
}
}