From c164338b0bd09db84d664214c3a0c844ec5e9acc Mon Sep 17 00:00:00 2001 From: Pandelis Zembashis Date: Sat, 16 Feb 2019 16:10:20 +0000 Subject: [PATCH 1/3] ADD: Deploy to heroku button --- .github/querytree.png | Bin 0 -> 3432 bytes README.md | 21 +++++++++++++-------- app.json | 14 ++++++++++++++ 3 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 .github/querytree.png create mode 100644 app.json diff --git a/.github/querytree.png b/.github/querytree.png new file mode 100644 index 0000000000000000000000000000000000000000..c1d0df4f84b4ba7b03d8948c208bf32fb8d92b9c GIT binary patch literal 3432 zcmY*cc{mho_Z|_luO)?<$(m)XgNY&Q*t5ipH6g|}W5zNlhOv_^g}jkh*0S@GLPnNC z_9e-_WZ!q{qxb#2zwdjl>s-${=ef^)pL70uqVE`LGtzO>0RR9-9fXF-*)4o#AX;hw zfMRU#tISzI<$T-VHULnbK!0L?@hrZCMWFBi06qJ;Q2?I*!F7g3q0NxqNCSPC1I9zb z-Vt-(NrK>kJwpQkN(9)M>*3^W40>Px)D-40iGM#=;;FKR-VSKN$%O&KV-5sHg~$l!i!4 zi=QFH@&2CP_5^WH{Efd!{*On)3GaYIW4+NBPvAMP{e6s&w=x)fF7)sDyH9WQga23Z z#Q!ta*?^Gq7l@REB;;T2vr?t=EX)Xpb~;l&=Z8xv{YL&z?jIc`$hr7`HS_nRzq4nf z!s(PC|E>*Ar%x6_oozc;N8`2`^3sbdXr!sdUPG!fD6tF@K?LiKII$>y_H1b);HyaG5i-zmsh#n?Vk3nwL%+^XQVGvLH0p=*LFfp3R9|TYTQVn zq4P0H0z#XDMWbc*RxK6_D?1LYAD+L09X`0=VUkslm%Sd?Qh@R|m)Bki_ACabyH7bvJ%;SIClQ%%}X{QfdM`U+pTwkXHC7}c*9I3|1#O=nAd34mLJua(lLW*2G3UaqM{#KbXh z!MAtwu+baKO{Rfav1!xS!iI(1K~Ds2__}avlSz!1`BGFczF!&)oIO>xH%n|l(VsrO zU{)s|S4BA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9^79s%&$opaNd9ZW`d~`^3?{Cq+2u5?|LID zWoMC3cVus6dVlYIz8_nz3GaG)`L5ng*`sX3yUkCxyh5dOd~S+}EQU5uAt;L@2Zx5n zTL&k9o*tJIXXLDDR8O>xW;r={Hr5U#?8@ir`ZQRV^(jvuut_LrCR>9tRt)!MM10Na z`|?)%<&#rvP1E+w=7e~tw}-`~@o+c%+ z-h*baulgP{id}z38|F|ImtVrTaN+2llao{1q6qs&R7y~0Dn0TDa?^EQH? zBglWTi;9`aZnk)R{T&0MVS3i_Dn!C-8NanLRjk=l zr*<6kwA&R91ziGsAmjSt4|e2|vt#p2S+k#>5nag;CLE5;>~Ud$zZZ$!LP~aos{AXd758CBLvf2*Xd>NBc7VUr3IkhmKVB( z)}-;r5aM{MRG?GRi>#hKcSCFZ0tGZLU)>uXB}$7O`D~XWxx;lAv+}KShDH) z-jTeIMQW){;IKOXsPL0;a4l`@6yp^*c+3UP&=|Rw!@5{I*wb^*3wE6}sZwB+pVK8g zTd|htJ;HCjtSXlCf)V}+#QLSN{hlnnhq-V#Etv}bAgF+fnSx6cIBSjVqhN}xylR*b zQ2l+bLsV3BLPX~gEX6I@_JjS`@JzOk?Eb*9Z502O-}B4>zo5}4PhSs-RWhYd)cS7= zPU95#h{MrpBZ1@Hsc*?}>)RXc!q8 zg{kyNhSo;B?9tjFXhGkta%Z&IQe-a*0YAKgSy%?UoY*~~PjD&K-GiO~eRMPpHA>X( Gh5iQ%=wkT* literal 0 HcmV?d00001 diff --git a/README.md b/README.md index 5bedeae..ca89ad3 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,10 @@ for more information. - [Running the Tests](#running-the-tests) - [Running with Docker](/docs/docker.md) +### Try on heroku +[![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. diff --git a/app.json b/app.json new file mode 100644 index 0000000..ef11960 --- /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" + ], + "image": "d4software/querytree" +} From ed0d971bbb64eff86a0c3ccd247c15441f4f6ff3 Mon Sep 17 00:00:00 2001 From: Pandelis Zembashis Date: Sat, 16 Feb 2019 16:15:49 +0000 Subject: [PATCH 2/3] ADD: heroku.yml --- app.json | 2 +- heroku.yml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 heroku.yml diff --git a/app.json b/app.json index ef11960..52b0607 100644 --- a/app.json +++ b/app.json @@ -10,5 +10,5 @@ "data-visualization", "data-analysis" ], - "image": "d4software/querytree" + "stack": "container" } 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 From f60e204c9de1fbb3f6ce2f2520756780553a1d6b Mon Sep 17 00:00:00 2001 From: Pandelis Zembashis Date: Fri, 17 May 2019 23:30:45 +0100 Subject: [PATCH 3/3] add(deployment): Azure one click deploy --- README.md | 6 +- azuredeploy.json | 259 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 263 insertions(+), 2 deletions(-) create mode 100644 azuredeploy.json diff --git a/README.md b/README.md index ca89ad3..0e84065 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,9 @@ for more information. - [Running the Tests](#running-the-tests) - [Running with Docker](/docs/docker.md) -### Try on heroku +### 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) @@ -117,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/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" + ] + } + } + } + } + } + ] + }