diff --git a/.github/querytree.png b/.github/querytree.png new file mode 100644 index 0000000..c1d0df4 Binary files /dev/null and b/.github/querytree.png differ diff --git a/README.md b/README.md index 5bedeae..0e84065 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ [![CircleCI](https://circleci.com/gh/d4software/QueryTree.svg?style=svg)](https://circleci.com/gh/d4software/QueryTree) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/d4software/QueryTree?svg=true)](https://ci.appveyor.com/api/projects/status/github/d4software/QueryTree?svg=true) +[![Docker](https://img.shields.io/docker/pulls/d4software/querytree.svg?style=flat)](https://hub.docker.com/r/d4software/querytree/) -# QueryTree +# ![qt](.github/querytree.png) QueryTree -QueryTree is an ad-hoc reporting tool that works with any Microsoft -SQL Server, PostgreSQL or MySQL database. It allows users to query +QueryTree is an ad-hoc reporting tool that works with any Microsoft +SQL Server, PostgreSQL or MySQL database. It allows users to query databases, build reports and schedule those reports to email distribution lists, without needing to write any code. @@ -12,7 +13,7 @@ For more information see the [QueryTree website](http://querytreeapp.com) ## Features -QueryTree can connect to MySQL and PostgreSQL databases using SSH tunnels, +QueryTree can connect to MySQL and PostgreSQL databases using SSH tunnels, secured with passwords or key files. Supports customization of the logo image, system name and CSS used @@ -21,14 +22,14 @@ within the app. Can use either Sqlite or Microsoft SQL Server database for it's own user and reports data storage. -Database and SSH passwords are stored in its database in encryped form, +Database and SSH passwords are stored in its database in encryped form, using AES encryption. Users may provide their own key file, or let the system generate one on first run. Keys can be shared between mutliple web servers in a load balancing scenario. -Users may choose to build their own plugins to store database/SSH -passwords in an external key vault. This is achieved by implementing -a .NET interface and registering the class in the appSettings.config +Users may choose to build their own plugins to store database/SSH +passwords in an external key vault. This is achieved by implementing +a .NET interface and registering the class in the appSettings.config file. See [Building a password manager](/docs/password-manager.md) for more information. @@ -42,6 +43,12 @@ for more information. - [Running the Tests](#running-the-tests) - [Running with Docker](/docs/docker.md) +### Deploy to a cloud + +[![Deploy to Azure](https://azuredeploy.net/deploybutton.png)](https://azuredeploy.net/) +[![Deploy to Heroku](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy) + + ### Prerequisites To build binaries or run from source you need the [.NET Core SDK v2.2](https://www.microsoft.com/net/download) installed. @@ -112,7 +119,7 @@ Now listening on: http://localhost:5000 Application started. Press Ctrl+C to shut down. ``` -Visit the URL shown in your browser. You should see the QueryTree application. +Visit the URL shown in your browser. You should see the QueryTree application. 5. For use in production environments, QueryTree should be run behind a reverse proxy such as nginx. For more information on hosting QueryTree using nginx see: https://docs.microsoft.com/en-us/aspnet/core/publishing/linuxproduction diff --git a/app.json b/app.json new file mode 100644 index 0000000..52b0607 --- /dev/null +++ b/app.json @@ -0,0 +1,14 @@ +{ + "name": "QueryTree", + "description": "Data reporting and visualization for your app", + "repository": "https://github.com/d4software/QueryTree", + "logo": "https://cdn.rawgit.com/d4software/QueryTree/master/.github/querytree.png", + "keywords": [ + "database", + "analytics", + "report-builder", + "data-visualization", + "data-analysis" + ], + "stack": "container" +} diff --git a/azuredeploy.json b/azuredeploy.json new file mode 100644 index 0000000..11f5954 --- /dev/null +++ b/azuredeploy.json @@ -0,0 +1,259 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "newStorageAccountName": { + "type": "string", + "metadata": { + "description": "Unique DNS Name for the Storage Account where the Virtual Machine's disks will be placed." + } + }, + "dnsNameForPublicIP": { + "type": "string", + "metadata": { + "description": "Unique DNS Name for the Public IP used to access the Virtual Machine." + } + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "Location for all resources." + } + }, + "authenticationType": { + "type": "string", + "defaultValue": "sshPublicKey", + "allowedValues": [ + "sshPublicKey", + "password" + ], + "metadata": { + "description": "Type of authentication to use on the Virtual Machine. SSH key is recommended." + } + }, + "adminPasswordOrKey": { + "type": "securestring", + "metadata": { + "description": "SSH Key or password for the Virtual Machine. SSH key is recommended." + } + } + }, + "variables": { + "imagePublisher": "Canonical", + "imageOffer": "UbuntuServer", + "ubuntuOSVersion": "18.04-LTS", + "adminUsername": "querytree", + "OSDiskName": "osdiskfordockersimple", + "nsgName": "myNSG", + "nicName": "myVMNic", + "extensionName": "DockerExtension", + "addressPrefix": "10.0.0.0/16", + "subnetName": "Subnet", + "subnetPrefix": "10.0.0.0/24", + "storageAccountType": "Standard_LRS", + "publicIPAddressName": "myPublicIP", + "publicIPAddressType": "Dynamic", + "vmStorageAccountContainerName": "vhds", + "vmName": "QueryTreeDockerVM", + "vmSize": "Standard_B1s", + "virtualNetworkName": "QueryTreeVNET", + "nsgID": "[resourceId('Microsoft.Network/networkSecurityGroups',variables('nsgName'))]", + "subnetRef": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworkName'), variables('subnetName'))]", + "linuxConfiguration": { + "disablePasswordAuthentication": true, + "ssh": { + "publicKeys": [ + { + "path": "[concat('/home/', variables('adminUsername'), '/.ssh/authorized_keys')]", + "keyData": "[parameters('adminPasswordOrKey')]" + } + ] + } + } + }, + "resources": [ + { + "type": "Microsoft.Storage/storageAccounts", + "name": "[parameters('newStorageAccountName')]", + "apiVersion": "2015-05-01-preview", + "location": "[parameters('location')]", + "properties": { + "accountType": "[variables('storageAccountType')]" + } + }, + { + "apiVersion": "2015-05-01-preview", + "type": "Microsoft.Network/publicIPAddresses", + "name": "[variables('publicIPAddressName')]", + "location": "[parameters('location')]", + "properties": { + "publicIPAllocationMethod": "[variables('publicIPAddressType')]", + "dnsSettings": { + "domainNameLabel": "[parameters('dnsNameForPublicIP')]" + } + } + }, + { + "apiVersion": "2015-05-01-preview", + "type": "Microsoft.Network/virtualNetworks", + "name": "[variables('virtualNetworkName')]", + "location": "[parameters('location')]", + "dependsOn": [ + "[variables('nsgID')]" + ], + "properties": { + "addressSpace": { + "addressPrefixes": [ + "[variables('addressPrefix')]" + ] + }, + "subnets": [ + { + "name": "[variables('subnetName')]", + "properties": { + "addressPrefix": "[variables('subnetPrefix')]", + "networkSecurityGroup": { + "id": "[variables('nsgID')]" + } + } + } + ] + } + }, + { + "apiVersion": "2015-05-01-preview", + "type": "Microsoft.Network/networkInterfaces", + "name": "[variables('nicName')]", + "location": "[parameters('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')]" + } + } + } + ] + } + }, + { + "apiVersion": "2015-05-01-preview", + "type": "Microsoft.Network/networkSecurityGroups", + "name": "[variables('nsgName')]", + "location": "[parameters('location')]", + "properties": { + "securityRules": [ + { + "name": "http", + "properties": { + "description": "Allow HTTP", + "protocol": "Tcp", + "sourcePortRange": "*", + "destinationPortRange": "80", + "sourceAddressPrefix": "Internet", + "destinationAddressPrefix": "*", + "access": "Allow", + "priority": 100, + "direction": "Inbound" + } + }, + { + "name": "ssh", + "properties": { + "description": "Allow SSH", + "protocol": "Tcp", + "sourcePortRange": "*", + "destinationPortRange": "22", + "sourceAddressPrefix": "Internet", + "destinationAddressPrefix": "*", + "access": "Allow", + "priority": 110, + "direction": "Inbound" + } + } + ] + } + }, + { + "apiVersion": "2017-03-30", + "type": "Microsoft.Compute/virtualMachines", + "name": "[variables('vmName')]", + "location": "[parameters('location')]", + "dependsOn": [ + "[concat('Microsoft.Storage/storageAccounts/', parameters('newStorageAccountName'))]", + "[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]" + ], + "properties": { + "hardwareProfile": { + "vmSize": "[variables('vmSize')]" + }, + "osProfile": { + "computerName": "[variables('vmName')]", + "adminUsername": "[variables('adminUsername')]", + "adminPassword": "[parameters('adminPasswordOrKey')]", + "linuxConfiguration": "[if(equals(parameters('authenticationType'), 'password'), json('null'), variables('linuxConfiguration'))]" + }, + "storageProfile": { + "imageReference": { + "publisher": "[variables('imagePublisher')]", + "offer": "[variables('imageOffer')]", + "sku": "[variables('ubuntuOSVersion')]", + "version": "latest" + }, + "osDisk": { + "name": "[concat(variables('vmName'),'_OSDisk')]", + "caching": "ReadWrite", + "createOption": "FromImage" + } + }, + "networkProfile": { + "networkInterfaces": [ + { + "id": "[resourceId('Microsoft.Network/networkInterfaces',variables('nicName'))]" + } + ] + } + } + }, + { + "type": "Microsoft.Compute/virtualMachines/extensions", + "name": "[concat(variables('vmName'),'/', variables('extensionName'))]", + "apiVersion": "2015-05-01-preview", + "location": "[parameters('location')]", + "dependsOn": [ + "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]" + ], + "properties": { + "publisher": "Microsoft.Azure.Extensions", + "type": "DockerExtension", + "typeHandlerVersion": "1.0", + "autoUpgradeMinorVersion": true, + "protectedSettings": { + "environment": { + } + }, + "settings": { + "compose": { + "QueryTree": { + "image": "d4software/querytree", + "ports": [ + "80:80" + ] + } + } + } + } + } + ] + } diff --git a/heroku.yml b/heroku.yml new file mode 100644 index 0000000..8eec25b --- /dev/null +++ b/heroku.yml @@ -0,0 +1,3 @@ +build: + docker: + web: Dockerfile