Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
sjkp committed Jan 3, 2016
1 parent 4b5fb73 commit 1e2c10e
Show file tree
Hide file tree
Showing 61 changed files with 26,966 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[Oo]bj/
[Bb]in/
*.user
/TestResults
*.vspscc
*.vssscc
deploy
deploy/*
*.suo
*.cache
*.docstates
*.dgml
_ReSharper.*
*.csproj.user
*[Rr]e[Ss]harper.user
_ReSharper.*/
packages/*
App_Data/
/apps
/artifacts
msbuild.log
_app/
*.ncrunchsolution
nuget.exe
*.nupkg
Kudu.Services.Web/commit.txt

azuredeploy.parameters.local.json
1,038 changes: 1,038 additions & 0 deletions .vs/config/applicationhost.config

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions LetsEncrypt-SiteExtension.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LetsEncrypt.SiteExtension", "LetsEncrypt-SiteExtension\LetsEncrypt.SiteExtension.csproj", "{87F0FF62-16C3-43CE-B154-1B9BC28DED67}"
EndProject
Project("{151D2E53-A2C4-4D7D-83FE-D05416EBD58E}") = "LetsEncrypt.ResourceGroup", "LetsEncrypt.ResourceGroup\LetsEncrypt.ResourceGroup.deployproj", "{8D564C1F-D94F-488C-AB13-F42C0511F76E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{87F0FF62-16C3-43CE-B154-1B9BC28DED67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{87F0FF62-16C3-43CE-B154-1B9BC28DED67}.Debug|Any CPU.Build.0 = Debug|Any CPU
{87F0FF62-16C3-43CE-B154-1B9BC28DED67}.Debug|x86.ActiveCfg = Debug|x86
{87F0FF62-16C3-43CE-B154-1B9BC28DED67}.Debug|x86.Build.0 = Debug|x86
{87F0FF62-16C3-43CE-B154-1B9BC28DED67}.Release|Any CPU.ActiveCfg = Release|Any CPU
{87F0FF62-16C3-43CE-B154-1B9BC28DED67}.Release|Any CPU.Build.0 = Release|Any CPU
{87F0FF62-16C3-43CE-B154-1B9BC28DED67}.Release|x86.ActiveCfg = Release|x86
{87F0FF62-16C3-43CE-B154-1B9BC28DED67}.Release|x86.Build.0 = Release|x86
{8D564C1F-D94F-488C-AB13-F42C0511F76E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8D564C1F-D94F-488C-AB13-F42C0511F76E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8D564C1F-D94F-488C-AB13-F42C0511F76E}.Debug|x86.ActiveCfg = Debug|Any CPU
{8D564C1F-D94F-488C-AB13-F42C0511F76E}.Debug|x86.Build.0 = Debug|Any CPU
{8D564C1F-D94F-488C-AB13-F42C0511F76E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8D564C1F-D94F-488C-AB13-F42C0511F76E}.Release|Any CPU.Build.0 = Release|Any CPU
{8D564C1F-D94F-488C-AB13-F42C0511F76E}.Release|x86.ActiveCfg = Release|Any CPU
{8D564C1F-D94F-488C-AB13-F42C0511F76E}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
23 changes: 23 additions & 0 deletions LetsEncrypt-SiteExtension/App_Start/RouteConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace LetsEncrypt.SiteExtension
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
}
}
24 changes: 24 additions & 0 deletions LetsEncrypt-SiteExtension/App_Start/WebApiConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;

namespace LetsEncrypt.SiteExtension
{
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
// Web API configuration and services

// Web API routes
config.MapHttpAttributeRoutes();

config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{name}",
defaults: new { name = RouteParameter.Optional }
);
}
}
}
29 changes: 29 additions & 0 deletions LetsEncrypt-SiteExtension/ArmHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using LetsEncrypt.SiteExtension.Models;
using Microsoft.Azure.Management.Resources;
using Microsoft.Azure.Management.WebSites;
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using Microsoft.Rest;
using Microsoft.Rest.Azure.Authentication;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace LetsEncrypt.SiteExtension
{
public static class ArmHelper
{
public static WebSiteManagementClient GetWebSiteManagementClient(IAuthSettings model)
{
var settings = ActiveDirectoryServiceSettings.Azure;
var authContext = new AuthenticationContext(settings.AuthenticationEndpoint + model.Tenant);

var token = authContext.AcquireToken(settings.TokenAudience.ToString(), new ClientCredential(model.ClientId.ToString(), model.ClientSecret));
var creds = new TokenCredentials(token.AccessToken);

var websiteClient = new WebSiteManagementClient(creds);
websiteClient.SubscriptionId = model.SubscriptionId.ToString();
return websiteClient;
}
}
}
18 changes: 18 additions & 0 deletions LetsEncrypt-SiteExtension/Content/Site.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
body {
padding-top: 50px;
padding-bottom: 20px;
}

/* Set padding to keep content from hitting the edges */
.body-content {
padding-left: 15px;
padding-right: 15px;
}

/* Set width on the form input elements since they're 100% wide by default */
input,
select,
textarea {
max-width: 280px;
}

Loading

0 comments on commit 1e2c10e

Please sign in to comment.