Signed-off-by: Anca Iordache <anca.iordache@docker.com>pull/2/head
parent
43f21f2d8d
commit
5417ecf9f2
@ -0,0 +1,18 @@ |
||||
<Project> |
||||
|
||||
<PropertyGroup> |
||||
<DefaultItemExcludes>$(DefaultItemExcludes);$(MSBuildProjectDirectory)/obj/**/*</DefaultItemExcludes> |
||||
<DefaultItemExcludes>$(DefaultItemExcludes);$(MSBuildProjectDirectory)/bin/**/*</DefaultItemExcludes> |
||||
</PropertyGroup> |
||||
|
||||
<PropertyGroup Condition="'$(DOTNET_RUNNING_IN_CONTAINER)' == 'true'"> |
||||
<BaseIntermediateOutputPath>$(MSBuildProjectDirectory)/obj/container/</BaseIntermediateOutputPath> |
||||
<BaseOutputPath>$(MSBuildProjectDirectory)/bin/container/</BaseOutputPath> |
||||
</PropertyGroup> |
||||
|
||||
<PropertyGroup Condition="'$(DOTNET_RUNNING_IN_CONTAINER)' != 'true'"> |
||||
<BaseIntermediateOutputPath>$(MSBuildProjectDirectory)/obj/local/</BaseIntermediateOutputPath> |
||||
<BaseOutputPath>$(MSBuildProjectDirectory)/bin/local/</BaseOutputPath> |
||||
</PropertyGroup> |
||||
|
||||
</Project> |
@ -0,0 +1,19 @@ |
||||
FROM mcr.microsoft.com/dotnet/core/sdk:2.1 AS build |
||||
WORKDIR /app |
||||
|
||||
# copy csproj and restore as distinct layers |
||||
COPY *.sln . |
||||
COPY aspnetapp/*.csproj ./aspnetapp/ |
||||
RUN dotnet restore |
||||
|
||||
# copy everything else and build app |
||||
COPY aspnetapp/. ./aspnetapp/ |
||||
WORKDIR /app/aspnetapp |
||||
RUN dotnet publish -c Release -o out |
||||
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/core/aspnet:2.1 AS runtime |
||||
EXPOSE 80 |
||||
WORKDIR /app |
||||
COPY --from=build /app/aspnetapp/out ./ |
||||
ENTRYPOINT ["dotnet", "aspnetapp.dll"] |
@ -0,0 +1,18 @@ |
||||
FROM mcr.microsoft.com/dotnet/core/sdk:2.1 AS build |
||||
WORKDIR /app |
||||
|
||||
# copy csproj and restore as distinct layers |
||||
COPY *.sln . |
||||
COPY aspnetapp/*.csproj ./aspnetapp/ |
||||
RUN dotnet restore |
||||
|
||||
# copy everything else and build app |
||||
COPY aspnetapp/. ./aspnetapp/ |
||||
WORKDIR /app/aspnetapp |
||||
RUN dotnet publish -c Release -o out |
||||
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/core/aspnet:2.1 AS runtime |
||||
WORKDIR /app |
||||
COPY --from=build /app/aspnetapp/out ./ |
||||
ENTRYPOINT ["dotnet", "aspnetapp.dll"] |
@ -0,0 +1,18 @@ |
||||
FROM mcr.microsoft.com/dotnet/core/sdk:2.1 AS build |
||||
WORKDIR /app |
||||
|
||||
# copy csproj and restore as distinct layers |
||||
COPY *.sln . |
||||
COPY aspnetapp/*.csproj ./aspnetapp/ |
||||
RUN dotnet restore |
||||
|
||||
# copy everything else and build app |
||||
COPY aspnetapp/. ./aspnetapp/ |
||||
WORKDIR /app/aspnetapp |
||||
RUN dotnet publish -c Release -o out |
||||
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/core/aspnet:2.1 AS runtime |
||||
WORKDIR /app |
||||
COPY --from=build /app/aspnetapp/out ./ |
||||
ENTRYPOINT ["dotnet", "aspnetapp.dll"] |
@ -0,0 +1,19 @@ |
||||
# This Dockerfile uses nightly preview builds for .NET Core |
||||
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build |
||||
WORKDIR /app |
||||
|
||||
# copy csproj and restore as distinct layers |
||||
COPY *.sln . |
||||
COPY aspnetapp/*.csproj ./aspnetapp/ |
||||
RUN dotnet restore |
||||
|
||||
# copy everything else and build app |
||||
COPY aspnetapp/. ./aspnetapp/ |
||||
WORKDIR /app/aspnetapp |
||||
RUN dotnet publish -c Release -o out |
||||
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 AS runtime |
||||
WORKDIR /app |
||||
COPY --from=build /app/aspnetapp/out ./ |
||||
ENTRYPOINT ["dotnet", "aspnetapp.dll"] |
@ -0,0 +1,163 @@ |
||||
# ASP.NET Core Docker Sample |
||||
|
||||
This [sample Dockerfile](Dockerfile) demonstrates how to use ASP.NET Core and Docker together. The sample works with both Linux and Windows containers and can also be used without Docker. There are also instructions that demonstrate how to push the sample to [Azure Container Registry](../dotnetapp/push-image-to-acr.md) and test it with [Azure Container Instance](deploy-container-to-aci.md). You can [configure ASP.NET Core to use HTTPS with Docker](aspnetcore-docker-https.md). |
||||
|
||||
The sample builds the application in a container based on the larger [.NET Core SDK Docker image](https://hub.docker.com/r/microsoft/dotnet/). It builds the application and then copies the final build result into a Docker image based on the smaller [ASP.NET Core Docker Runtime image](https://hub.docker.com/r/microsoft/aspnetcore/). |
||||
|
||||
This sample requires [Docker 17.06](https://docs.docker.com/release-notes/docker-ce) or later of the [Docker client](https://www.docker.com/products/docker). |
||||
|
||||
## Try a pre-built ASP.NET Core Docker Image |
||||
|
||||
You can quickly run a container with a pre-built [sample ASP.NET Core Docker image](https://hub.docker.com/r/microsoft/dotnet-samples/), based on this [sample](Dockerfile). |
||||
|
||||
Type the following command to run a sample with [Docker](https://www.docker.com/products/docker): |
||||
|
||||
```console |
||||
docker run --name aspnetcore_sample --rm -it -p 8000:80 microsoft/dotnet-samples:aspnetapp |
||||
``` |
||||
|
||||
After the application starts, navigate to `http://localhost:8000` in your web browser. On Windows, you may need to navigate to the container via IP address. See [ASP.NET Core apps in Windows Containers](aspnetcore-docker-windows.md) for instructions on determining the IP address, using the value of `--name` that you used in `docker run`. |
||||
|
||||
See [Hosting ASP.NET Core Images with Docker over HTTPS](aspnetcore-docker-https.md) to use HTTPS with this image. |
||||
|
||||
## Getting the sample |
||||
|
||||
The easiest way to get the sample is by cloning the samples repository with git, using the following instructions: |
||||
|
||||
```console |
||||
git clone https://github.com/dotnet/dotnet-docker/ |
||||
``` |
||||
|
||||
You can also [download the repository as a zip](https://github.com/dotnet/dotnet-docker/archive/master.zip). |
||||
|
||||
## Build and run the sample with Docker |
||||
|
||||
You can build and run the sample in Docker using the following commands. The instructions assume that you are in the root of the repository. |
||||
|
||||
```console |
||||
cd samples |
||||
cd aspnetapp |
||||
docker build --pull -t aspnetapp . |
||||
docker run --name aspnetcore_sample --rm -it -p 8000:80 aspnetapp |
||||
``` |
||||
|
||||
You should see the following console output as the application starts. |
||||
|
||||
```console |
||||
C:\git\dotnet-docker\samples\aspnetapp>docker run --name aspnetcore_sample --rm -it -p 8000:80 aspnetapp |
||||
Hosting environment: Production |
||||
Content root path: /app |
||||
Now listening on: http://[::]:80 |
||||
Application started. Press Ctrl+C to shut down. |
||||
``` |
||||
|
||||
After the application starts, navigate to `http://localhost:8000` in your web browser. On Windows, you may need to navigate to the container via IP address. See [ASP.NET Core apps in Windows Containers](aspnetcore-docker-windows.md) for instructions on determining the IP address, using the value of `--name` that you used in `docker run`. |
||||
|
||||
> Note: The `-p` argument maps port 8000 on your local machine to port 80 in the container (the form of the port mapping is `host:container`). See the [Docker run reference](https://docs.docker.com/engine/reference/commandline/run/) for more information on commandline parameters. In some cases, you might see an error because the host port you select is already in use. Choose a different port in that case. |
||||
|
||||
## Additional Samples |
||||
|
||||
Multiple variations of this sample have been provided, as follows. Some of these example Dockerfiles are demonstrated later. Specify an alternate Dockerfile via the `-f` argument. |
||||
|
||||
* [Multi-arch sample](Dockerfile) |
||||
* [Multi-arch sample, using a preview version of .NET Core](Dockerfile.preview) |
||||
* [Nanoserver 2016 SAC sample](Dockerfile.nanoserver-sac2016) |
||||
* [Alpine sample](Dockerfile.alpine-x64) |
||||
|
||||
## Deploying with HTTPS |
||||
|
||||
ASP.NET Core 2.1 uses [HTTPS by default](https://docs.microsoft.com/en-us/aspnet/core/security/enforcing-ssl). You can [configure ASP.NET Core to use HTTPS with Docker](aspnetcore-docker-https.md). |
||||
|
||||
## Build and run the sample for Alpine X64 with Docker |
||||
|
||||
You can build and run the sample for Alpine using the following instructions. Make sure Docker is set to Linux containers if you are on Windows. |
||||
|
||||
```console |
||||
cd samples |
||||
cd aspnetapp |
||||
docker build --pull -t aspnetapp -f Dockerfile.alpine-x64 . |
||||
docker run --name aspnetcore_sample --rm -it -p 8000:80 aspnetapp |
||||
``` |
||||
|
||||
After the application starts, navigate to `http://localhost:8000` in your web browser. |
||||
|
||||
## Build and run the sample for Ubuntu 18.04 with Docker |
||||
|
||||
You can also build for [Ubuntu 18.04](https://hub.docker.com/_/ubuntu/), with a `bionic` tag. The `bionic` tags are documented at [microsoft/dotnet](https://hub.docker.com/r/microsoft/dotnet/). You would switch to the following tags: |
||||
|
||||
* SDK: 2.1-sdk-bionic |
||||
* Runtime:-2.1-aspnetcore-runtime-bionic |
||||
|
||||
## Build and run the sample for Linux ARM32 with Docker |
||||
|
||||
You can build and run the sample for ARM32 and Raspberry Pi with [Build ASP.NET Core Applications for Raspberry Pi with Docker](aspnetcore-docker-arm32.md) instructions. |
||||
|
||||
## Develop ASP.NET Core Applications in a container |
||||
|
||||
You can develop applications without a .NET Core installation on your machine with the [Develop ASP.NET Core applications in a container](aspnet-docker-dev-in-container.md) instructions. These instructions are also useful if your development and production environments do not match. |
||||
|
||||
## Deploying to Production vs Development |
||||
|
||||
The approach for running containers differs between development and production. |
||||
|
||||
In production, you will typically start your container with `docker run -d`. This argument starts the container as a service, without any console interaction. You then interact with it through other Docker commands or APIs exposed by the containerized application. |
||||
|
||||
In development, you will typically start containers with `docker run --rm -it`. These arguments enable you to see a console (important when there are errors), terminate the container with `CTRL-C` and cleans up all container resources when the container is termiantes. You also typically don't mind blocking the console. This approach is demonstrated in prior examples in this document. |
||||
|
||||
We recommend that you do not use `--rm` in production. It cleans up container resources, preventing you from collecting logs that may have been captured in a container that has either stopped or crashed. |
||||
|
||||
## Build and run the sample locally |
||||
|
||||
You can build and run the sample locally with the [.NET Core 2.1 SDK](https://www.microsoft.com/net/download/core) using the following commands. The commands assume that you are in the root of the repository. |
||||
|
||||
```console |
||||
cd samples |
||||
cd aspnetapp |
||||
dotnet run |
||||
``` |
||||
|
||||
After the application starts, visit `http://localhost:5000` in your web browser. |
||||
|
||||
You can produce an application that is ready to deploy to production locally using the following command. |
||||
|
||||
```console |
||||
dotnet publish -c Release -o out |
||||
``` |
||||
|
||||
You can run the application using the following commands. |
||||
|
||||
```console |
||||
cd out |
||||
dotnet aspnetapp.dll |
||||
``` |
||||
|
||||
Note: The `-c Release` argument builds the application in release mode (the default is debug mode). See the [dotnet publish reference](https://docs.microsoft.com/dotnet/core/tools/dotnet-publish) for more information on commandline parameters. |
||||
|
||||
## .NET Core Resources |
||||
|
||||
More Samples |
||||
|
||||
* [.NET Core Docker Samples](../README.md) |
||||
* [.NET Framework Docker Samples](https://github.com/microsoft/dotnet-framework-docker/blob/master/samples/README.md) |
||||
|
||||
Docs and More Information: |
||||
|
||||
* [.NET Docs](https://docs.microsoft.com/dotnet/) |
||||
* [ASP.NET Docs](https://docs.microsoft.com/aspnet/) |
||||
* [dotnet/core](https://github.com/dotnet/core) for starting with .NET Core on GitHub. |
||||
* [dotnet/announcements](https://github.com/dotnet/announcements/issues) for .NET announcements. |
||||
|
||||
## Related Repositories |
||||
|
||||
.NET Core Docker Hub repos: |
||||
|
||||
* [microsoft/aspnetcore](https://hub.docker.com/r/microsoft/aspnetcore/) for ASP.NET Core images. |
||||
* [microsoft/dotnet](https://hub.docker.com/r/microsoft/dotnet/) for .NET Core images. |
||||
* [microsoft/dotnet-nightly](https://hub.docker.com/r/microsoft/dotnet-nightly/) for .NET Core preview images. |
||||
* [microsoft/dotnet-samples](https://hub.docker.com/r/microsoft/dotnet-samples/) for .NET Core sample images. |
||||
|
||||
.NET Framework Docker Hub repos: |
||||
|
||||
* [microsoft/aspnet](https://hub.docker.com/r/microsoft/aspnet/) for ASP.NET Web Forms and MVC images. |
||||
* [microsoft/dotnet-framework](https://hub.docker.com/r/microsoft/dotnet-framework/) for .NET Framework images. |
||||
* [microsoft/dotnet-framework-samples](https://hub.docker.com/r/microsoft/dotnet-framework-samples/) for .NET Framework and ASP.NET sample images. |
@ -0,0 +1,68 @@ |
||||
# Develop ASP.NET Core Applications in a Container |
||||
|
||||
You can use containers to establish a .NET Core development environment with only Docker and optionally a code editor installed on your machine. The environment can be made to match your local machine, production or both. If you support multiple operating systems, then this approach might become a key part of your development process. |
||||
|
||||
A common use case of Docker is to [containerize an application](README.md). You can define the environment necessary to run the application and even build the application itself within a Dockerfile. This document describes a much more iterative and dynamic use of Docker, defining the container environment primarily via the commandline. .NET Core includes a command called `dotnet watch` that can rerun your application or your tests on each code change. This document describes how to use the Docker CLI and `dotnet watch` to develop applications in a container. |
||||
|
||||
See [Develop .NET Core Applications in a Container](../dotnetapp/dotnet-docker-dev-in-container.md) for .NET Core-specific instructions. |
||||
|
||||
## Getting the sample |
||||
|
||||
The easiest way to get the sample is by cloning the samples repository with [git](https://git-scm.com/downloads), using the following instructions: |
||||
|
||||
```console |
||||
git clone https://github.com/dotnet/dotnet-docker/ |
||||
``` |
||||
|
||||
You can also [download the repository as a zip](https://github.com/dotnet/dotnet-docker/archive/master.zip). |
||||
|
||||
## Requirements |
||||
|
||||
It is recommended that you add a [Directory.Build.props](Directory.Build.props) file to your project to use different `obj` and `bin` folders for local and container use, to avoid conflicts between them. You should delete your existing obj and bin folders before making this change. You can also use `dotnet clean` for this purpose. |
||||
|
||||
This approach relies on [volume mounting](https://docs.docker.com/engine/admin/volumes/volumes/) (that's the `-v` argument in the following commands) to mount source into the container (without using a Dockerfile). You may need to [Enable shared drives (Windows)](https://docs.docker.com/docker-for-windows/#shared-drives) or [file sharing (macOS)](https://docs.docker.com/docker-for-mac/#file-sharing) first. |
||||
|
||||
## Run your application in a container while you Develop |
||||
|
||||
You can re-run your application in a container with every local code change. This scenario works for both console applications and websites. The syntax differs a bit for Windows and Linux containers. |
||||
|
||||
The instructions assume that you are in the root of the repository. You can use the following commands, given your environment: |
||||
|
||||
### Windows using Linux containers |
||||
|
||||
```console |
||||
docker run --rm -it -p 8000:80 -v c:\git\dotnet-docker\samples\aspnetapp:/app/ -w /app/aspnetapp microsoft/dotnet:2.1-sdk dotnet watch run |
||||
``` |
||||
|
||||
You can use CTRL-C to terminate `dotnet watch`. Navigate to the site at `http://localhost:8000` in your browser. |
||||
|
||||
### macOS or Linux using Linux containers |
||||
|
||||
```console |
||||
docker run --rm -it -p 8000:80 -v ~/git/dotnet-docker/samples/aspnetapp:/app/ -w /app/aspnetapp microsoft/dotnet:2.1-sdk dotnet watch run |
||||
``` |
||||
|
||||
You can use CTRL-C to terminate `dotnet watch`. Navigate to the site at `http://localhost:8000` in your browser. |
||||
|
||||
### Windows using Windows containers |
||||
|
||||
```console |
||||
docker run --rm -it -p 8000:80 -v c:\git\dotnet-docker\samples\aspnetapp:c:\app\ -w \app\aspnetapp --name aspnetappsample microsoft/dotnet:2.1-sdk dotnet watch run |
||||
``` |
||||
|
||||
You can use CTRL-C to terminate `dotnet watch`. |
||||
|
||||
After the application starts, navigate to `http://localhost:8000` in your web browser. On Windows, you may need to navigate to the container via IP address. See [ASP.NET Core apps in Windows Containers](aspnetcore-docker-windows.md) for instructions on determining the IP address, using the value of `--name` that you used in `docker run`. |
||||
|
||||
## Updating the site while the container is running |
||||
|
||||
You can demo a relaunch of the site by changing the About controller method in `HomeController.cs`, waiting a few seconds for the site to recompile and then visit `http://localhost:8000/Home/About` |
||||
|
||||
## Test your application in a container while you develop |
||||
|
||||
You can retest your application in a container with every local code change. You can see this demonstrated in [Develop .NET Core Applications in a Container](../dotnetapp/dotnet-docker-dev-in-container.md). |
||||
|
||||
## More Samples |
||||
|
||||
* [.NET Core Docker Samples](../README.md) |
||||
* [.NET Framework Docker Samples](https://github.com/microsoft/dotnet-framework-docker-samples/) |
@ -0,0 +1,11 @@ |
||||
using System; |
||||
|
||||
namespace aspnetapp.Models |
||||
{ |
||||
public class ErrorViewModel |
||||
{ |
||||
public string RequestId { get; set; } |
||||
|
||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); |
||||
} |
||||
} |
@ -0,0 +1,18 @@ |
||||
<environment include="Development"> |
||||
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script> |
||||
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script> |
||||
</environment> |
||||
<environment exclude="Development"> |
||||
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.17.0/jquery.validate.min.js" |
||||
asp-fallback-src="~/lib/jquery-validation/dist/jquery.validate.min.js" |
||||
asp-fallback-test="window.jQuery && window.jQuery.validator" |
||||
crossorigin="anonymous" |
||||
integrity="sha384-rZfj/ogBloos6wzLGpPkkOr/gpkBNLZ6b6yLy4o+ok+t/SAKlL5mvXLr0OXNi1Hp"> |
||||
</script> |
||||
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validation.unobtrusive/3.2.9/jquery.validate.unobtrusive.min.js" |
||||
asp-fallback-src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js" |
||||
asp-fallback-test="window.jQuery && window.jQuery.validator && window.jQuery.validator.unobtrusive" |
||||
crossorigin="anonymous" |
||||
integrity="sha384-ifv0TYDWxBHzvAk2Z0n8R434FL1Rlv/Av18DXE43N/1rvHyOG4izKst0f2iSLdds"> |
||||
</script> |
||||
</environment> |
@ -0,0 +1,9 @@ |
||||
{ |
||||
"Logging": { |
||||
"LogLevel": { |
||||
"Default": "Debug", |
||||
"System": "Information", |
||||
"Microsoft": "Information" |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,8 @@ |
||||
{ |
||||
"Logging": { |
||||
"LogLevel": { |
||||
"Default": "Warning" |
||||
} |
||||
}, |
||||
"AllowedHosts": "*" |
||||
} |
@ -0,0 +1,12 @@ |
||||
<Project Sdk="Microsoft.NET.Sdk.Web"> |
||||
|
||||
<PropertyGroup> |
||||
<TargetFramework>netcoreapp2.1</TargetFramework> |
||||
<UserSecretsId>31051026529000467138</UserSecretsId> |
||||
</PropertyGroup> |
||||
|
||||
<ItemGroup> |
||||
<PackageReference Include="Microsoft.AspNetCore.App" /> |
||||
</ItemGroup> |
||||
|
||||
</Project> |
@ -0,0 +1 @@ |
||||
body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}} |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 8.2 KiB |
After Width: | Height: | Size: 12 KiB |
@ -0,0 +1,45 @@ |
||||
{ |
||||
"name": "bootstrap", |
||||
"description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", |
||||
"keywords": [ |
||||
"css", |
||||
"js", |
||||
"less", |
||||
"mobile-first", |
||||
"responsive", |
||||
"front-end", |
||||
"framework", |
||||
"web" |
||||
], |
||||
"homepage": "http://getbootstrap.com", |
||||
"license": "MIT", |
||||
"moduleType": "globals", |
||||
"main": [ |
||||
"less/bootstrap.less", |
||||
"dist/js/bootstrap.js" |
||||
], |
||||
"ignore": [ |
||||
"/.*", |
||||
"_config.yml", |
||||
"CNAME", |
||||
"composer.json", |
||||
"CONTRIBUTING.md", |
||||
"docs", |
||||
"js/tests", |
||||
"test-infra" |
||||
], |
||||
"dependencies": { |
||||
"jquery": "1.9.1 - 3" |
||||
}, |
||||
"version": "3.3.7", |
||||
"_release": "3.3.7", |
||||
"_resolution": { |
||||
"type": "version", |
||||
"tag": "v3.3.7", |
||||
"commit": "0b9c4a4007c44201dce9a6cc1a38407005c26c86" |
||||
}, |
||||
"_source": "https://github.com/twbs/bootstrap.git", |
||||
"_target": "v3.3.7", |
||||
"_originalSource": "bootstrap", |
||||
"_direct": true |
||||
} |
@ -0,0 +1,21 @@ |
||||
The MIT License (MIT) |
||||
|
||||
Copyright (c) 2011-2016 Twitter, Inc. |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy |
||||
of this software and associated documentation files (the "Software"), to deal |
||||
in the Software without restriction, including without limitation the rights |
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||
copies of the Software, and to permit persons to whom the Software is |
||||
furnished to do so, subject to the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be included in |
||||
all copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
||||
THE SOFTWARE. |
@ -0,0 +1,587 @@ |
||||
/*! |
||||
* Bootstrap v3.3.7 (http://getbootstrap.com) |
||||
* Copyright 2011-2016 Twitter, Inc. |
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
||||
*/ |
||||
.btn-default, |
||||
.btn-primary, |
||||
.btn-success, |
||||
.btn-info, |
||||
.btn-warning, |
||||
.btn-danger { |
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, .2); |
||||
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075); |
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075); |
||||
} |
||||
.btn-default:active, |
||||
.btn-primary:active, |
||||
.btn-success:active, |
||||
.btn-info:active, |
||||
.btn-warning:active, |
||||
.btn-danger:active, |
||||
.btn-default.active, |
||||
.btn-primary.active, |
||||
.btn-success.active, |
||||
.btn-info.active, |
||||
.btn-warning.active, |
||||
.btn-danger.active { |
||||
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); |
||||
box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); |
||||
} |
||||
.btn-default.disabled, |
||||
.btn-primary.disabled, |
||||
.btn-success.disabled, |
||||
.btn-info.disabled, |
||||
.btn-warning.disabled, |
||||
.btn-danger.disabled, |
||||
.btn-default[disabled], |
||||
.btn-primary[disabled], |
||||
.btn-success[disabled], |
||||
.btn-info[disabled], |
||||
.btn-warning[disabled], |
||||
.btn-danger[disabled], |
||||
fieldset[disabled] .btn-default, |
||||
fieldset[disabled] .btn-primary, |
||||
fieldset[disabled] .btn-success, |
||||
fieldset[disabled] .btn-info, |
||||
fieldset[disabled] .btn-warning, |
||||
fieldset[disabled] .btn-danger { |
||||
-webkit-box-shadow: none; |
||||
box-shadow: none; |
||||
} |
||||
.btn-default .badge, |
||||
.btn-primary .badge, |
||||
.btn-success .badge, |
||||
.btn-info .badge, |
||||
.btn-warning .badge, |
||||
.btn-danger .badge { |
||||
text-shadow: none; |
||||
} |
||||
.btn:active, |
||||
.btn.active { |
||||
background-image: none; |
||||
} |
||||
.btn-default { |
||||
text-shadow: 0 1px 0 #fff; |
||||
background-image: -webkit-linear-gradient(top, #fff 0%, #e0e0e0 100%); |
||||
background-image: -o-linear-gradient(top, #fff 0%, #e0e0e0 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#e0e0e0)); |
||||
background-image: linear-gradient(to bottom, #fff 0%, #e0e0e0 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); |
||||
background-repeat: repeat-x; |
||||
border-color: #dbdbdb; |
||||
border-color: #ccc; |
||||
} |
||||
.btn-default:hover, |
||||
.btn-default:focus { |
||||
background-color: #e0e0e0; |
||||
background-position: 0 -15px; |
||||
} |
||||
.btn-default:active, |
||||
.btn-default.active { |
||||
background-color: #e0e0e0; |
||||
border-color: #dbdbdb; |
||||
} |
||||
.btn-default.disabled, |
||||
.btn-default[disabled], |
||||
fieldset[disabled] .btn-default, |
||||
.btn-default.disabled:hover, |
||||
.btn-default[disabled]:hover, |
||||
fieldset[disabled] .btn-default:hover, |
||||
.btn-default.disabled:focus, |
||||
.btn-default[disabled]:focus, |
||||
fieldset[disabled] .btn-default:focus, |
||||
.btn-default.disabled.focus, |
||||
.btn-default[disabled].focus, |
||||
fieldset[disabled] .btn-default.focus, |
||||
.btn-default.disabled:active, |
||||
.btn-default[disabled]:active, |
||||
fieldset[disabled] .btn-default:active, |
||||
.btn-default.disabled.active, |
||||
.btn-default[disabled].active, |
||||
fieldset[disabled] .btn-default.active { |
||||
background-color: #e0e0e0; |
||||
background-image: none; |
||||
} |
||||
.btn-primary { |
||||
background-image: -webkit-linear-gradient(top, #337ab7 0%, #265a88 100%); |
||||
background-image: -o-linear-gradient(top, #337ab7 0%, #265a88 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#265a88)); |
||||
background-image: linear-gradient(to bottom, #337ab7 0%, #265a88 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); |
||||
background-repeat: repeat-x; |
||||
border-color: #245580; |
||||
} |
||||
.btn-primary:hover, |
||||
.btn-primary:focus { |
||||
background-color: #265a88; |
||||
background-position: 0 -15px; |
||||
} |
||||
.btn-primary:active, |
||||
.btn-primary.active { |
||||
background-color: #265a88; |
||||
border-color: #245580; |
||||
} |
||||
.btn-primary.disabled, |
||||
.btn-primary[disabled], |
||||
fieldset[disabled] .btn-primary, |
||||
.btn-primary.disabled:hover, |
||||
.btn-primary[disabled]:hover, |
||||
fieldset[disabled] .btn-primary:hover, |
||||
.btn-primary.disabled:focus, |
||||
.btn-primary[disabled]:focus, |
||||
fieldset[disabled] .btn-primary:focus, |
||||
.btn-primary.disabled.focus, |
||||
.btn-primary[disabled].focus, |
||||
fieldset[disabled] .btn-primary.focus, |
||||
.btn-primary.disabled:active, |
||||
.btn-primary[disabled]:active, |
||||
fieldset[disabled] .btn-primary:active, |
||||
.btn-primary.disabled.active, |
||||
.btn-primary[disabled].active, |
||||
fieldset[disabled] .btn-primary.active { |
||||
background-color: #265a88; |
||||
background-image: none; |
||||
} |
||||
.btn-success { |
||||
background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%); |
||||
background-image: -o-linear-gradient(top, #5cb85c 0%, #419641 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#419641)); |
||||
background-image: linear-gradient(to bottom, #5cb85c 0%, #419641 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); |
||||
background-repeat: repeat-x; |
||||
border-color: #3e8f3e; |
||||
} |
||||
.btn-success:hover, |
||||
.btn-success:focus { |
||||
background-color: #419641; |
||||
background-position: 0 -15px; |
||||
} |
||||
.btn-success:active, |
||||
.btn-success.active { |
||||
background-color: #419641; |
||||
border-color: #3e8f3e; |
||||
} |
||||
.btn-success.disabled, |
||||
.btn-success[disabled], |
||||
fieldset[disabled] .btn-success, |
||||
.btn-success.disabled:hover, |
||||
.btn-success[disabled]:hover, |
||||
fieldset[disabled] .btn-success:hover, |
||||
.btn-success.disabled:focus, |
||||
.btn-success[disabled]:focus, |
||||
fieldset[disabled] .btn-success:focus, |
||||
.btn-success.disabled.focus, |
||||
.btn-success[disabled].focus, |
||||
fieldset[disabled] .btn-success.focus, |
||||
.btn-success.disabled:active, |
||||
.btn-success[disabled]:active, |
||||
fieldset[disabled] .btn-success:active, |
||||
.btn-success.disabled.active, |
||||
.btn-success[disabled].active, |
||||
fieldset[disabled] .btn-success.active { |
||||
background-color: #419641; |
||||
background-image: none; |
||||
} |
||||
.btn-info { |
||||
background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%); |
||||
background-image: -o-linear-gradient(top, #5bc0de 0%, #2aabd2 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#2aabd2)); |
||||
background-image: linear-gradient(to bottom, #5bc0de 0%, #2aabd2 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); |
||||
background-repeat: repeat-x; |
||||
border-color: #28a4c9; |
||||
} |
||||
.btn-info:hover, |
||||
.btn-info:focus { |
||||
background-color: #2aabd2; |
||||
background-position: 0 -15px; |
||||
} |
||||
.btn-info:active, |
||||
.btn-info.active { |
||||
background-color: #2aabd2; |
||||
border-color: #28a4c9; |
||||
} |
||||
.btn-info.disabled, |
||||
.btn-info[disabled], |
||||
fieldset[disabled] .btn-info, |
||||
.btn-info.disabled:hover, |
||||
.btn-info[disabled]:hover, |
||||
fieldset[disabled] .btn-info:hover, |
||||
.btn-info.disabled:focus, |
||||
.btn-info[disabled]:focus, |
||||
fieldset[disabled] .btn-info:focus, |
||||
.btn-info.disabled.focus, |
||||
.btn-info[disabled].focus, |
||||
fieldset[disabled] .btn-info.focus, |
||||
.btn-info.disabled:active, |
||||
.btn-info[disabled]:active, |
||||
fieldset[disabled] .btn-info:active, |
||||
.btn-info.disabled.active, |
||||
.btn-info[disabled].active, |
||||
fieldset[disabled] .btn-info.active { |
||||
background-color: #2aabd2; |
||||
background-image: none; |
||||
} |
||||
.btn-warning { |
||||
background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%); |
||||
background-image: -o-linear-gradient(top, #f0ad4e 0%, #eb9316 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#eb9316)); |
||||
background-image: linear-gradient(to bottom, #f0ad4e 0%, #eb9316 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); |
||||
background-repeat: repeat-x; |
||||
border-color: #e38d13; |
||||
} |
||||
.btn-warning:hover, |
||||
.btn-warning:focus { |
||||
background-color: #eb9316; |
||||
background-position: 0 -15px; |
||||
} |
||||
.btn-warning:active, |
||||
.btn-warning.active { |
||||
background-color: #eb9316; |
||||
border-color: #e38d13; |
||||
} |
||||
.btn-warning.disabled, |
||||
.btn-warning[disabled], |
||||
fieldset[disabled] .btn-warning, |
||||
.btn-warning.disabled:hover, |
||||
.btn-warning[disabled]:hover, |
||||
fieldset[disabled] .btn-warning:hover, |
||||
.btn-warning.disabled:focus, |
||||
.btn-warning[disabled]:focus, |
||||
fieldset[disabled] .btn-warning:focus, |
||||
.btn-warning.disabled.focus, |
||||
.btn-warning[disabled].focus, |
||||
fieldset[disabled] .btn-warning.focus, |
||||
.btn-warning.disabled:active, |
||||
.btn-warning[disabled]:active, |
||||
fieldset[disabled] .btn-warning:active, |
||||
.btn-warning.disabled.active, |
||||
.btn-warning[disabled].active, |
||||
fieldset[disabled] .btn-warning.active { |
||||
background-color: #eb9316; |
||||
background-image: none; |
||||
} |
||||
.btn-danger { |
||||
background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%); |
||||
background-image: -o-linear-gradient(top, #d9534f 0%, #c12e2a 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c12e2a)); |
||||
background-image: linear-gradient(to bottom, #d9534f 0%, #c12e2a 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); |
||||
background-repeat: repeat-x; |
||||
border-color: #b92c28; |
||||
} |
||||
.btn-danger:hover, |
||||
.btn-danger:focus { |
||||
background-color: #c12e2a; |
||||
background-position: 0 -15px; |
||||
} |
||||
.btn-danger:active, |
||||
.btn-danger.active { |
||||
background-color: #c12e2a; |
||||
border-color: #b92c28; |
||||
} |
||||
.btn-danger.disabled, |
||||
.btn-danger[disabled], |
||||
fieldset[disabled] .btn-danger, |
||||
.btn-danger.disabled:hover, |
||||
.btn-danger[disabled]:hover, |
||||
fieldset[disabled] .btn-danger:hover, |
||||
.btn-danger.disabled:focus, |
||||
.btn-danger[disabled]:focus, |
||||
fieldset[disabled] .btn-danger:focus, |
||||
.btn-danger.disabled.focus, |
||||
.btn-danger[disabled].focus, |
||||
fieldset[disabled] .btn-danger.focus, |
||||
.btn-danger.disabled:active, |
||||
.btn-danger[disabled]:active, |
||||
fieldset[disabled] .btn-danger:active, |
||||
.btn-danger.disabled.active, |
||||
.btn-danger[disabled].active, |
||||
fieldset[disabled] .btn-danger.active { |
||||
background-color: #c12e2a; |
||||
background-image: none; |
||||
} |
||||
.thumbnail, |
||||
.img-thumbnail { |
||||
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075); |
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, .075); |
||||
} |
||||
.dropdown-menu > li > a:hover, |
||||
.dropdown-menu > li > a:focus { |
||||
background-color: #e8e8e8; |
||||
background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); |
||||
background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8)); |
||||
background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.dropdown-menu > .active > a, |
||||
.dropdown-menu > .active > a:hover, |
||||
.dropdown-menu > .active > a:focus { |
||||
background-color: #2e6da4; |
||||
background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%); |
||||
background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4)); |
||||
background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.navbar-default { |
||||
background-image: -webkit-linear-gradient(top, #fff 0%, #f8f8f8 100%); |
||||
background-image: -o-linear-gradient(top, #fff 0%, #f8f8f8 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f8f8f8)); |
||||
background-image: linear-gradient(to bottom, #fff 0%, #f8f8f8 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); |
||||
background-repeat: repeat-x; |
||||
border-radius: 4px; |
||||
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075); |
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075); |
||||
} |
||||
.navbar-default .navbar-nav > .open > a, |
||||
.navbar-default .navbar-nav > .active > a { |
||||
background-image: -webkit-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%); |
||||
background-image: -o-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#dbdbdb), to(#e2e2e2)); |
||||
background-image: linear-gradient(to bottom, #dbdbdb 0%, #e2e2e2 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
-webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075); |
||||
box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075); |
||||
} |
||||
.navbar-brand, |
||||
.navbar-nav > li > a { |
||||
text-shadow: 0 1px 0 rgba(255, 255, 255, .25); |
||||
} |
||||
.navbar-inverse { |
||||
background-image: -webkit-linear-gradient(top, #3c3c3c 0%, #222 100%); |
||||
background-image: -o-linear-gradient(top, #3c3c3c 0%, #222 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#3c3c3c), to(#222)); |
||||
background-image: linear-gradient(to bottom, #3c3c3c 0%, #222 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); |
||||
background-repeat: repeat-x; |
||||
border-radius: 4px; |
||||
} |
||||
.navbar-inverse .navbar-nav > .open > a, |
||||
.navbar-inverse .navbar-nav > .active > a { |
||||
background-image: -webkit-linear-gradient(top, #080808 0%, #0f0f0f 100%); |
||||
background-image: -o-linear-gradient(top, #080808 0%, #0f0f0f 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#080808), to(#0f0f0f)); |
||||
background-image: linear-gradient(to bottom, #080808 0%, #0f0f0f 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
-webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25); |
||||
box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25); |
||||
} |
||||
.navbar-inverse .navbar-brand, |
||||
.navbar-inverse .navbar-nav > li > a { |
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, .25); |
||||
} |
||||
.navbar-static-top, |
||||
.navbar-fixed-top, |
||||
.navbar-fixed-bottom { |
||||
border-radius: 0; |
||||
} |
||||
@media (max-width: 767px) { |
||||
.navbar .navbar-nav .open .dropdown-menu > .active > a, |
||||
.navbar .navbar-nav .open .dropdown-menu > .active > a:hover, |
||||
.navbar .navbar-nav .open .dropdown-menu > .active > a:focus { |
||||
color: #fff; |
||||
background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%); |
||||
background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4)); |
||||
background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
} |
||||
.alert { |
||||
text-shadow: 0 1px 0 rgba(255, 255, 255, .2); |
||||
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05); |
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05); |
||||
} |
||||
.alert-success { |
||||
background-image: -webkit-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%); |
||||
background-image: -o-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#c8e5bc)); |
||||
background-image: linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
border-color: #b2dba1; |
||||
} |
||||
.alert-info { |
||||
background-image: -webkit-linear-gradient(top, #d9edf7 0%, #b9def0 100%); |
||||
background-image: -o-linear-gradient(top, #d9edf7 0%, #b9def0 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#b9def0)); |
||||
background-image: linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
border-color: #9acfea; |
||||
} |
||||
.alert-warning { |
||||
background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%); |
||||
background-image: -o-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#f8efc0)); |
||||
background-image: linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
border-color: #f5e79e; |
||||
} |
||||
.alert-danger { |
||||
background-image: -webkit-linear-gradient(top, #f2dede 0%, #e7c3c3 100%); |
||||
background-image: -o-linear-gradient(top, #f2dede 0%, #e7c3c3 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#e7c3c3)); |
||||
background-image: linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
border-color: #dca7a7; |
||||
} |
||||
.progress { |
||||
background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%); |
||||
background-image: -o-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#ebebeb), to(#f5f5f5)); |
||||
background-image: linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.progress-bar { |
||||
background-image: -webkit-linear-gradient(top, #337ab7 0%, #286090 100%); |
||||
background-image: -o-linear-gradient(top, #337ab7 0%, #286090 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#286090)); |
||||
background-image: linear-gradient(to bottom, #337ab7 0%, #286090 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.progress-bar-success { |
||||
background-image: -webkit-linear-gradient(top, #5cb85c 0%, #449d44 100%); |
||||
background-image: -o-linear-gradient(top, #5cb85c 0%, #449d44 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#449d44)); |
||||
background-image: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.progress-bar-info { |
||||
background-image: -webkit-linear-gradient(top, #5bc0de 0%, #31b0d5 100%); |
||||
background-image: -o-linear-gradient(top, #5bc0de 0%, #31b0d5 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#31b0d5)); |
||||
background-image: linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.progress-bar-warning { |
||||
background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #ec971f 100%); |
||||
background-image: -o-linear-gradient(top, #f0ad4e 0%, #ec971f 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#ec971f)); |
||||
background-image: linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.progress-bar-danger { |
||||
background-image: -webkit-linear-gradient(top, #d9534f 0%, #c9302c 100%); |
||||
background-image: -o-linear-gradient(top, #d9534f 0%, #c9302c 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c9302c)); |
||||
background-image: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.progress-bar-striped { |
||||
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); |
||||
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); |
||||
background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); |
||||
} |
||||
.list-group { |
||||
border-radius: 4px; |
||||
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075); |
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, .075); |
||||
} |
||||
.list-group-item.active, |
||||
.list-group-item.active:hover, |
||||
.list-group-item.active:focus { |
||||
text-shadow: 0 -1px 0 #286090; |
||||
background-image: -webkit-linear-gradient(top, #337ab7 0%, #2b669a 100%); |
||||
background-image: -o-linear-gradient(top, #337ab7 0%, #2b669a 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2b669a)); |
||||
background-image: linear-gradient(to bottom, #337ab7 0%, #2b669a 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
border-color: #2b669a; |
||||
} |
||||
.list-group-item.active .badge, |
||||
.list-group-item.active:hover .badge, |
||||
.list-group-item.active:focus .badge { |
||||
text-shadow: none; |
||||
} |
||||
.panel { |
||||
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05); |
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, .05); |
||||
} |
||||
.panel-default > .panel-heading { |
||||
background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); |
||||
background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8)); |
||||
background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.panel-primary > .panel-heading { |
||||
background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%); |
||||
background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4)); |
||||
background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.panel-success > .panel-heading { |
||||
background-image: -webkit-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%); |
||||
background-image: -o-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#d0e9c6)); |
||||
background-image: linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.panel-info > .panel-heading { |
||||
background-image: -webkit-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%); |
||||
background-image: -o-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#c4e3f3)); |
||||
background-image: linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.panel-warning > .panel-heading { |
||||
background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%); |
||||
background-image: -o-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#faf2cc)); |
||||
background-image: linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.panel-danger > .panel-heading { |
||||
background-image: -webkit-linear-gradient(top, #f2dede 0%, #ebcccc 100%); |
||||
background-image: -o-linear-gradient(top, #f2dede 0%, #ebcccc 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#ebcccc)); |
||||
background-image: linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
} |
||||
.well { |
||||
background-image: -webkit-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%); |
||||
background-image: -o-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%); |
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#e8e8e8), to(#f5f5f5)); |
||||
background-image: linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0); |
||||
background-repeat: repeat-x; |
||||
border-color: #dcdcdc; |
||||
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1); |
||||
box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1); |
||||
} |
||||
/*# sourceMappingURL=bootstrap-theme.css.map */ |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
After Width: | Height: | Size: 106 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -0,0 +1,13 @@ |
||||
// This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
|
||||
require('../../js/transition.js') |
||||
require('../../js/alert.js') |
||||
require('../../js/button.js') |
||||
require('../../js/carousel.js') |
||||
require('../../js/collapse.js') |
||||
require('../../js/dropdown.js') |
||||
require('../../js/modal.js') |
||||
require('../../js/tooltip.js') |
||||
require('../../js/popover.js') |
||||
require('../../js/scrollspy.js') |
||||
require('../../js/tab.js') |
||||
require('../../js/affix.js') |
@ -0,0 +1,15 @@ |
||||
{ |
||||
"name": "jquery-validation-unobtrusive", |
||||
"homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", |
||||
"version": "3.2.9", |
||||
"_release": "3.2.9", |
||||
"_resolution": { |
||||
"type": "version", |
||||
"tag": "v3.2.9", |
||||
"commit": "a91f5401898e125f10771c5f5f0909d8c4c82396" |
||||
}, |
||||
"_source": "https://github.com/aspnet/jquery-validation-unobtrusive.git", |
||||
"_target": "^3.2.9", |
||||
"_originalSource": "jquery-validation-unobtrusive", |
||||
"_direct": true |
||||
} |
@ -0,0 +1,12 @@ |
||||
Copyright (c) .NET Foundation. All rights reserved. |
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use |
||||
these files except in compliance with the License. You may obtain a copy of the |
||||
License at |
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0 |
||||
|
||||
Unless required by applicable law or agreed to in writing, software distributed |
||||
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR |
||||
CONDITIONS OF ANY KIND, either express or implied. See the License for the |
||||
specific language governing permissions and limitations under the License. |
@ -0,0 +1,431 @@ |
||||
// Unobtrusive validation support library for jQuery and jQuery Validate
|
||||
// Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
// @version v3.2.9
|
||||
|
||||
/*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */ |
||||
/*global document: false, jQuery: false */ |
||||
|
||||
(function (factory) { |
||||
if (typeof define === 'function' && define.amd) { |
||||
// AMD. Register as an anonymous module.
|
||||
define("jquery.validate.unobtrusive", ['jquery.validation'], factory); |
||||
} else if (typeof module === 'object' && module.exports) { |
||||
// CommonJS-like environments that support module.exports
|
||||
module.exports = factory(require('jquery-validation')); |
||||
} else { |
||||
// Browser global
|
||||
jQuery.validator.unobtrusive = factory(jQuery); |
||||
} |
||||
}(function ($) { |
||||
var $jQval = $.validator, |
||||
adapters, |
||||
data_validation = "unobtrusiveValidation"; |
||||
|
||||
function setValidationValues(options, ruleName, value) { |
||||
options.rules[ruleName] = value; |
||||
if (options.message) { |
||||
options.messages[ruleName] = options.message; |
||||
} |
||||
} |
||||
|
||||
function splitAndTrim(value) { |
||||
return value.replace(/^\s+|\s+$/g, "").split(/\s*,\s*/g); |
||||
} |
||||
|
||||
function escapeAttributeValue(value) { |
||||
// As mentioned on http://api.jquery.com/category/selectors/
|
||||
return value.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g, "\\$1"); |
||||
} |
||||
|
||||
function getModelPrefix(fieldName) { |
||||
return fieldName.substr(0, fieldName.lastIndexOf(".") + 1); |
||||
} |
||||
|
||||
function appendModelPrefix(value, prefix) { |
||||
if (value.indexOf("*.") === 0) { |
||||
value = value.replace("*.", prefix); |
||||
} |
||||
return value; |
||||
} |
||||
|
||||
function onError(error, inputElement) { // 'this' is the form element
|
||||
var container = $(this).find("[data-valmsg-for='" + escapeAttributeValue(inputElement[0].name) + "']"), |
||||
replaceAttrValue = container.attr("data-valmsg-replace"), |
||||
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) !== false : null; |
||||
|
||||
container.removeClass("field-validation-valid").addClass("field-validation-error"); |
||||
error.data("unobtrusiveContainer", container); |
||||
|
||||
if (replace) { |
||||
container.empty(); |
||||
error.removeClass("input-validation-error").appendTo(container); |
||||
} |
||||
else { |
||||
error.hide(); |
||||
} |
||||
} |
||||
|
||||
function onErrors(event, validator) { // 'this' is the form element
|
||||
var container = $(this).find("[data-valmsg-summary=true]"), |
||||
list = container.find("ul"); |
||||
|
||||
if (list && list.length && validator.errorList.length) { |
||||
list.empty(); |
||||
container.addClass("validation-summary-errors").removeClass("validation-summary-valid"); |
||||
|
||||
$.each(validator.errorList, function () { |
||||
$("<li />").html(this.message).appendTo(list); |
||||
}); |
||||
} |
||||
} |
||||
|
||||
function onSuccess(error) { // 'this' is the form element
|
||||
var container = error.data("unobtrusiveContainer"); |
||||
|
||||
if (container) { |
||||
var replaceAttrValue = container.attr("data-valmsg-replace"), |
||||
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) : null; |
||||
|
||||
container.addClass("field-validation-valid").removeClass("field-validation-error"); |
||||
error.removeData("unobtrusiveContainer"); |
||||
|
||||
if (replace) { |
||||
container.empty(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
function onReset(event) { // 'this' is the form element
|
||||
var $form = $(this), |
||||
key = '__jquery_unobtrusive_validation_form_reset'; |
||||
if ($form.data(key)) { |
||||
return; |
||||
} |
||||
// Set a flag that indicates we're currently resetting the form.
|
||||
$form.data(key, true); |
||||
try { |
||||
$form.data("validator").resetForm(); |
||||
} finally { |
||||
$form.removeData(key); |
||||
} |
||||
|
||||
$form.find(".validation-summary-errors") |
||||
.addClass("validation-summary-valid") |
||||
.removeClass("validation-summary-errors"); |
||||
$form.find(".field-validation-error") |
||||
.addClass("field-validation-valid") |
||||
.removeClass("field-validation-error") |
||||
.removeData("unobtrusiveContainer") |
||||
.find(">*") // If we were using valmsg-replace, get the underlying error
|
||||
.removeData("unobtrusiveContainer"); |
||||
} |
||||
|
||||
function validationInfo(form) { |
||||
var $form = $(form), |
||||
result = $form.data(data_validation), |
||||
onResetProxy = $.proxy(onReset, form), |
||||
defaultOptions = $jQval.unobtrusive.options || {}, |
||||
execInContext = function (name, args) { |
||||
var func = defaultOptions[name]; |
||||
func && $.isFunction(func) && func.apply(form, args); |
||||
}; |
||||
|
||||
if (!result) { |
||||
result = { |
||||
options: { // options structure passed to jQuery Validate's validate() method
|
||||
errorClass: defaultOptions.errorClass || "input-validation-error", |
||||
errorElement: defaultOptions.errorElement || "span", |
||||
errorPlacement: function () { |
||||
onError.apply(form, arguments); |
||||
execInContext("errorPlacement", arguments); |
||||
}, |
||||
invalidHandler: function () { |
||||
onErrors.apply(form, arguments); |
||||
execInContext("invalidHandler", arguments); |
||||
}, |
||||
messages: {}, |
||||
rules: {}, |
||||
success: function () { |
||||
onSuccess.apply(form, arguments); |
||||
execInContext("success", arguments); |
||||
} |
||||
}, |
||||
attachValidation: function () { |
||||
$form |
||||
.off("reset." + data_validation, onResetProxy) |
||||
.on("reset." + data_validation, onResetProxy) |
||||
.validate(this.options); |
||||
}, |
||||
validate: function () { // a validation function that is called by unobtrusive Ajax
|
||||
$form.validate(); |
||||
return $form.valid(); |
||||
} |
||||
}; |
||||
$form.data(data_validation, result); |
||||
} |
||||
|
||||
return result; |
||||
} |
||||
|
||||
$jQval.unobtrusive = { |
||||
adapters: [], |
||||
|
||||
parseElement: function (element, skipAttach) { |
||||
/// <summary>
|
||||
/// Parses a single HTML element for unobtrusive validation attributes.
|
||||
/// </summary>
|
||||
/// <param name="element" domElement="true">The HTML element to be parsed.</param>
|
||||
/// <param name="skipAttach" type="Boolean">[Optional] true to skip attaching the
|
||||
/// validation to the form. If parsing just this single element, you should specify true.
|
||||
/// If parsing several elements, you should specify false, and manually attach the validation
|
||||
/// to the form when you are finished. The default is false.</param>
|
||||
var $element = $(element), |
||||
form = $element.parents("form")[0], |
||||
valInfo, rules, messages; |
||||
|
||||
if (!form) { // Cannot do client-side validation without a form
|
||||
return; |
||||
} |
||||
|
||||
valInfo = validationInfo(form); |
||||
valInfo.options.rules[element.name] = rules = {}; |
||||
valInfo.options.messages[element.name] = messages = {}; |
||||
|
||||
$.each(this.adapters, function () { |
||||
var prefix = "data-val-" + this.name, |
||||
message = $element.attr(prefix), |
||||
paramValues = {}; |
||||
|
||||
if (message !== undefined) { // Compare against undefined, because an empty message is legal (and falsy)
|
||||
prefix += "-"; |
||||
|
||||
$.each(this.params, function () { |
||||
paramValues[this] = $element.attr(prefix + this); |
||||
}); |
||||
|
||||
this.adapt({ |
||||
element: element, |
||||
form: form, |
||||
message: message, |
||||
params: paramValues, |
||||
rules: rules, |
||||
messages: messages |
||||
}); |
||||
} |
||||
}); |
||||
|
||||
$.extend(rules, { "__dummy__": true }); |
||||
|
||||
if (!skipAttach) { |
||||
valInfo.attachValidation(); |
||||
} |
||||
}, |
||||
|
||||
parse: function (selector) { |
||||
/// <summary>
|
||||
/// Parses all the HTML elements in the specified selector. It looks for input elements decorated
|
||||
/// with the [data-val=true] attribute value and enables validation according to the data-val-*
|
||||
/// attribute values.
|
||||
/// </summary>
|
||||
/// <param name="selector" type="String">Any valid jQuery selector.</param>
|
||||
|
||||
// $forms includes all forms in selector's DOM hierarchy (parent, children and self) that have at least one
|
||||
// element with data-val=true
|
||||
var $selector = $(selector), |
||||
$forms = $selector.parents() |
||||
.addBack() |
||||
.filter("form") |
||||
.add($selector.find("form")) |
||||
.has("[data-val=true]"); |
||||
|
||||
$selector.find("[data-val=true]").each(function () { |
||||
$jQval.unobtrusive.parseElement(this, true); |
||||
}); |
||||
|
||||
$forms.each(function () { |
||||
var info = validationInfo(this); |
||||
if (info) { |
||||
info.attachValidation(); |
||||
} |
||||
}); |
||||
} |
||||
}; |
||||
|
||||
adapters = $jQval.unobtrusive.adapters; |
||||
|
||||
adapters.add = function (adapterName, params, fn) { |
||||
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation.</summary>
|
||||
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
|
||||
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
|
||||
/// <param name="params" type="Array" optional="true">[Optional] An array of parameter names (strings) that will
|
||||
/// be extracted from the data-val-nnnn-mmmm HTML attributes (where nnnn is the adapter name, and
|
||||
/// mmmm is the parameter name).</param>
|
||||
/// <param name="fn" type="Function">The function to call, which adapts the values from the HTML
|
||||
/// attributes into jQuery Validate rules and/or messages.</param>
|
||||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
||||
if (!fn) { // Called with no params, just a function
|
||||
fn = params; |
||||
params = []; |
||||
} |
||||
this.push({ name: adapterName, params: params, adapt: fn }); |
||||
return this; |
||||
}; |
||||
|
||||
adapters.addBool = function (adapterName, ruleName) { |
||||
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
|
||||
/// the jQuery Validate validation rule has no parameter values.</summary>
|
||||
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
|
||||
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
|
||||
/// <param name="ruleName" type="String" optional="true">[Optional] The name of the jQuery Validate rule. If not provided, the value
|
||||
/// of adapterName will be used instead.</param>
|
||||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
||||
return this.add(adapterName, function (options) { |
||||
setValidationValues(options, ruleName || adapterName, true); |
||||
}); |
||||
}; |
||||
|
||||
adapters.addMinMax = function (adapterName, minRuleName, maxRuleName, minMaxRuleName, minAttribute, maxAttribute) { |
||||
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
|
||||
/// the jQuery Validate validation has three potential rules (one for min-only, one for max-only, and
|
||||
/// one for min-and-max). The HTML parameters are expected to be named -min and -max.</summary>
|
||||
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
|
||||
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
|
||||
/// <param name="minRuleName" type="String">The name of the jQuery Validate rule to be used when you only
|
||||
/// have a minimum value.</param>
|
||||
/// <param name="maxRuleName" type="String">The name of the jQuery Validate rule to be used when you only
|
||||
/// have a maximum value.</param>
|
||||
/// <param name="minMaxRuleName" type="String">The name of the jQuery Validate rule to be used when you
|
||||
/// have both a minimum and maximum value.</param>
|
||||
/// <param name="minAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that
|
||||
/// contains the minimum value. The default is "min".</param>
|
||||
/// <param name="maxAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that
|
||||
/// contains the maximum value. The default is "max".</param>
|
||||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
||||
return this.add(adapterName, [minAttribute || "min", maxAttribute || "max"], function (options) { |
||||
var min = options.params.min, |
||||
max = options.params.max; |
||||
|
||||
if (min && max) { |
||||
setValidationValues(options, minMaxRuleName, [min, max]); |
||||
} |
||||
else if (min) { |
||||
setValidationValues(options, minRuleName, min); |
||||
} |
||||
else if (max) { |
||||
setValidationValues(options, maxRuleName, max); |
||||
} |
||||
}); |
||||
}; |
||||
|
||||
adapters.addSingleVal = function (adapterName, attribute, ruleName) { |
||||
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
|
||||
/// the jQuery Validate validation rule has a single value.</summary>
|
||||
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
|
||||
/// in the data-val-nnnn HTML attribute(where nnnn is the adapter name).</param>
|
||||
/// <param name="attribute" type="String">[Optional] The name of the HTML attribute that contains the value.
|
||||
/// The default is "val".</param>
|
||||
/// <param name="ruleName" type="String" optional="true">[Optional] The name of the jQuery Validate rule. If not provided, the value
|
||||
/// of adapterName will be used instead.</param>
|
||||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
||||
return this.add(adapterName, [attribute || "val"], function (options) { |
||||
setValidationValues(options, ruleName || adapterName, options.params[attribute]); |
||||
}); |
||||
}; |
||||
|
||||
$jQval.addMethod("__dummy__", function (value, element, params) { |
||||
return true; |
||||
}); |
||||
|
||||
$jQval.addMethod("regex", function (value, element, params) { |
||||
var match; |
||||
if (this.optional(element)) { |
||||
return true; |
||||
} |
||||
|
||||
match = new RegExp(params).exec(value); |
||||
return (match && (match.index === 0) && (match[0].length === value.length)); |
||||
}); |
||||
|
||||
$jQval.addMethod("nonalphamin", function (value, element, nonalphamin) { |
||||
var match; |
||||
if (nonalphamin) { |
||||
match = value.match(/\W/g); |
||||
match = match && match.length >= nonalphamin; |
||||
} |
||||
return match; |
||||
}); |
||||
|
||||
if ($jQval.methods.extension) { |
||||
adapters.addSingleVal("accept", "mimtype"); |
||||
adapters.addSingleVal("extension", "extension"); |
||||
} else { |
||||
// for backward compatibility, when the 'extension' validation method does not exist, such as with versions
|
||||
// of JQuery Validation plugin prior to 1.10, we should use the 'accept' method for
|
||||
// validating the extension, and ignore mime-type validations as they are not supported.
|
||||
adapters.addSingleVal("extension", "extension", "accept"); |
||||
} |
||||
|
||||
adapters.addSingleVal("regex", "pattern"); |
||||
adapters.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"); |
||||
adapters.addMinMax("length", "minlength", "maxlength", "rangelength").addMinMax("range", "min", "max", "range"); |
||||
adapters.addMinMax("minlength", "minlength").addMinMax("maxlength", "minlength", "maxlength"); |
||||
adapters.add("equalto", ["other"], function (options) { |
||||
var prefix = getModelPrefix(options.element.name), |
||||
other = options.params.other, |
||||
fullOtherName = appendModelPrefix(other, prefix), |
||||
element = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(fullOtherName) + "']")[0]; |
||||
|
||||
setValidationValues(options, "equalTo", element); |
||||
}); |
||||
adapters.add("required", function (options) { |
||||
// jQuery Validate equates "required" with "mandatory" for checkbox elements
|
||||
if (options.element.tagName.toUpperCase() !== "INPUT" || options.element.type.toUpperCase() !== "CHECKBOX") { |
||||
setValidationValues(options, "required", true); |
||||
} |
||||
}); |
||||
adapters.add("remote", ["url", "type", "additionalfields"], function (options) { |
||||
var value = { |
||||
url: options.params.url, |
||||
type: options.params.type || "GET", |
||||
data: {} |
||||
}, |
||||
prefix = getModelPrefix(options.element.name); |
||||
|
||||
$.each(splitAndTrim(options.params.additionalfields || options.element.name), function (i, fieldName) { |
||||
var paramName = appendModelPrefix(fieldName, prefix); |
||||
value.data[paramName] = function () { |
||||
var field = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(paramName) + "']"); |
||||
// For checkboxes and radio buttons, only pick up values from checked fields.
|
||||
if (field.is(":checkbox")) { |
||||
return field.filter(":checked").val() || field.filter(":hidden").val() || ''; |
||||
} |
||||
else if (field.is(":radio")) { |
||||
return field.filter(":checked").val() || ''; |
||||
} |
||||
return field.val(); |
||||
}; |
||||
}); |
||||
|
||||
setValidationValues(options, "remote", value); |
||||
}); |
||||
adapters.add("password", ["min", "nonalphamin", "regex"], function (options) { |
||||
if (options.params.min) { |
||||
setValidationValues(options, "minlength", options.params.min); |
||||
} |
||||
if (options.params.nonalphamin) { |
||||
setValidationValues(options, "nonalphamin", options.params.nonalphamin); |
||||
} |
||||
if (options.params.regex) { |
||||
setValidationValues(options, "regex", options.params.regex); |
||||
} |
||||
}); |
||||
adapters.add("fileextensions", ["extensions"], function (options) { |
||||
setValidationValues(options, "extension", options.params.extensions); |
||||
}); |
||||
|
||||
$(function () { |
||||
$jQval.unobtrusive.parse(document); |
||||
}); |
||||
|
||||
return $jQval.unobtrusive; |
||||
})); |
File diff suppressed because one or more lines are too long
@ -0,0 +1,41 @@ |
||||
{ |
||||
"name": "jquery-validation", |
||||
"homepage": "https://jqueryvalidation.org/", |
||||
"repository": { |
||||
"type": "git", |
||||
"url": "git://github.com/jquery-validation/jquery-validation.git" |
||||
}, |
||||
"authors": [ |
||||
"Jörn Zaefferer <joern.zaefferer@gmail.com>" |
||||
], |
||||
"description": "Form validation made easy", |
||||
"main": "dist/jquery.validate.js", |
||||
"keywords": [ |
||||
"forms", |
||||
"validation", |
||||
"validate" |
||||
], |
||||
"license": "MIT", |
||||
"ignore": [ |
||||
"**/.*", |
||||
"node_modules", |
||||
"bower_components", |
||||
"test", |
||||
"demo", |
||||
"lib" |
||||
], |
||||
"dependencies": { |
||||
"jquery": ">= 1.7.2" |
||||
}, |
||||
"version": "1.17.0", |
||||
"_release": "1.17.0", |
||||
"_resolution": { |
||||
"type": "version", |
||||
"tag": "1.17.0", |
||||
"commit": "fc9b12d3bfaa2d0c04605855b896edb2934c0772" |
||||
}, |
||||
"_source": "https://github.com/jzaefferer/jquery-validation.git", |
||||
"_target": "^1.17.0", |
||||
"_originalSource": "jquery-validation", |
||||
"_direct": true |
||||
} |
@ -0,0 +1,22 @@ |
||||
The MIT License (MIT) |
||||
===================== |
||||
|
||||
Copyright Jörn Zaefferer |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy |
||||
of this software and associated documentation files (the "Software"), to deal |
||||
in the Software without restriction, including without limitation the rights |
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||
copies of the Software, and to permit persons to whom the Software is |
||||
furnished to do so, subject to the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be included in |
||||
all copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
||||
THE SOFTWARE. |
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -0,0 +1,26 @@ |
||||
{ |
||||
"name": "jquery", |
||||
"main": "dist/jquery.js", |
||||
"license": "MIT", |
||||
"ignore": [ |
||||
"package.json" |
||||
], |
||||
"keywords": [ |
||||
"jquery", |
||||
"javascript", |
||||
"browser", |
||||
"library" |
||||
], |
||||
"homepage": "https://github.com/jquery/jquery-dist", |
||||
"version": "3.3.1", |
||||
"_release": "3.3.1", |
||||
"_resolution": { |
||||
"type": "version", |
||||
"tag": "3.3.1", |
||||
"commit": "9e8ec3d10fad04748176144f108d7355662ae75e" |
||||
}, |
||||
"_source": "https://github.com/jquery/jquery-dist.git", |
||||
"_target": "^3.3.1", |
||||
"_originalSource": "jquery", |
||||
"_direct": true |
||||
} |
@ -0,0 +1,36 @@ |
||||
Copyright JS Foundation and other contributors, https://js.foundation/ |
||||
|
||||
This software consists of voluntary contributions made by many |
||||
individuals. For exact contribution history, see the revision history |
||||
available at https://github.com/jquery/jquery |
||||
|
||||
The following license applies to all parts of this software except as |
||||
documented below: |
||||
|
||||
==== |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining |
||||
a copy of this software and associated documentation files (the |
||||
"Software"), to deal in the Software without restriction, including |
||||
without limitation the rights to use, copy, modify, merge, publish, |
||||
distribute, sublicense, and/or sell copies of the Software, and to |
||||
permit persons to whom the Software is furnished to do so, subject to |
||||
the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be |
||||
included in all copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
||||
|
||||
==== |
||||
|
||||
All files located in the node_modules and external directories are |
||||
externally maintained libraries used by this software which have their |
||||
own licenses; we recommend you read them, as their terms may differ from |
||||
the terms above. |
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,55 @@ |
||||
# Use ASP.NET Core on Linux ARM32 with Docker |
||||
|
||||
You can use ASP.NET Core and Docker together on [ARM32](https://en.wikipedia.org/wiki/ARM_architecture) devices, with [Docker for Raspberry Pi and ARM32 devices](https://docs.docker.com/install/linux/docker-ce/debian). |
||||
|
||||
> Note: that Docker refers to ARM32 as `armhf` in documentation and other places. |
||||
|
||||
See [Use .NET Core on Linux ARM32 with Docker](../dotnetapp/aspnetcore-docker-arm32.md) for .NET Core console apps. |
||||
|
||||
See [.NET Core and Docker for ARM64](dotnet-docker-arm64.md) if you are interested in [ARM64](https://en.wikipedia.org/wiki/ARM64) usage. |
||||
|
||||
## Try a pre-built ASP.NET Core Docker Image |
||||
|
||||
You can quickly run a container with a pre-built [sample ASP.NET Core Docker image](https://hub.docker.com/r/microsoft/dotnet-samples/), based on this [sample](Dockerfile.preview). |
||||
|
||||
Type the following command to run a sample with [Docker](https://www.docker.com/products/docker): |
||||
|
||||
```console |
||||
docker run --rm -it -p 8000:80 microsoft/dotnet-samples:aspnetapp |
||||
``` |
||||
|
||||
After the application starts, navigate to `http://localhost:8000` in your web browser and/or to the IP address (example: http://192.168.1.18:8000) of your ARM32 device on your network. |
||||
|
||||
## Building .NET Core Samples with Docker |
||||
|
||||
You can build the same [.NET Core console samples](README.md) and [ASP.NET Core sample](../aspnetapp/README.md) on ARM devices as you can on other architectures. For example, the following instructions will work on an ARM32 device. The instructions assume that you are in the root of this repository. |
||||
|
||||
```console |
||||
cd samples |
||||
cd aspnetapp |
||||
docker build --pull -t aspnetapp . |
||||
docker run --rm -it -p 8000:80 aspnetapp |
||||
``` |
||||
|
||||
Another option is to build ARM32 Docker images on an X64 machine. You can do by using the same pattern used in the [Dockerfile.debian-arm32-selfcontained](../dotnetapp/Dockerfile.debian-arm32-selfcontained) dockerfile. It uses a multi-arch tag for building with the SDK and then an ARM32-specific tag for creating a runtime image. The pattern of building for other architectures only works because the Dockerfile doesn't run code in the runtime image. |
||||
|
||||
### Viewing the Site |
||||
|
||||
After the application starts, visit the site one of two ways: |
||||
|
||||
* From the web browser on the ARM32 device at `http://localhost:8000` |
||||
* From the web browser on another device on the same network on the ARM32 device IP on port 8000, similar to: `http://192.168.1.18:8000` |
||||
|
||||
You must set the `ASPNETCORE_URLS` environment variable manually ([example usage](https://github.com/dotnet/dotnet-docker/blob/master/2.1/runtime-deps/stretch-slim/arm32v7/Dockerfile#L19)) if you build the sample locally (without Docker) and want to navigate to the site from another machine. |
||||
|
||||
## Pushing the image to a Container Registry |
||||
|
||||
Push the image to a container registry after building the image so that you can pull it from another ARM32 device. You can also build an ARM32 image on an X64 machine, push to a registry and then pull from an ARM32 device. Instructions are provided for pushing to both Azure Container Registry and DockerHub (you only need to choose one): |
||||
|
||||
* [Push Docker Images to Azure Container Registry](push-image-to-acr.md) |
||||
* [Push Docker Images to DockerHub](push-image-to-dockerhub.md) |
||||
|
||||
## More Samples |
||||
|
||||
* [.NET Core Docker Samples](../README.md) |
||||
* [.NET Framework Docker Samples](https://github.com/microsoft/dotnet-framework-docker-samples/) |
@ -0,0 +1,210 @@ |
||||
# Developing ASP.NET Core Applications with Docker over HTTPS |
||||
|
||||
ASP.NET Core 2.1 uses [HTTPS by default](https://docs.microsoft.com/aspnet/core/security/enforcing-ssl). [HTTPS](https://en.wikipedia.org/wiki/HTTPS) relies on [certificates](https://en.wikipedia.org/wiki/Public_key_certificate) for trust, identity, and encryption. |
||||
|
||||
This document demonstrates how to develop ASP.NET Core applications with HTTPS in Docker containers. It is recommended to try the [ASP.NET Core Docker Sample](README.md) first, which is simpler because the container only exposes HTTP. The more basic will help you validate that you have the sample working correctly before adding the complication of certificates. |
||||
|
||||
See [Hosting ASP.NET Core Images with Docker over HTTPS](aspnetcore-docker-https.md) for production scenarios. |
||||
|
||||
The samples are written for `cmd.exe`. PowerShell users will need to special case the environment variables that are used in the instructions. |
||||
|
||||
This sample requires [Docker 17.06](https://docs.docker.com/release-notes/docker-ce) or later of the [Docker client](https://www.docker.com/products/docker). |
||||
|
||||
## Getting the sample |
||||
|
||||
The easiest way to get the sample is by cloning the samples repository with git, using the following instructions: |
||||
|
||||
```console |
||||
git clone https://github.com/dotnet/dotnet-docker/ |
||||
``` |
||||
|
||||
You can also [download the repository as a zip](https://github.com/dotnet/dotnet-docker/archive/master.zip). |
||||
|
||||
## Certificates |
||||
|
||||
ASP.NET Core uses [self-signed development certificates](https://en.wikipedia.org/wiki/Self-signed_certificate) for development. Self-signed certificates are easy and free to create. |
||||
|
||||
The instructions volume mount certificates into containers. You can add certificates into container images with a `COPY` command in a Dockerfile. This approach is not recommended. It makes it harder to use the same image for testing with dev certificates and hosting with production certificates. There is also a significant risk of certificate disclosure if certificates are made part of container images. |
||||
|
||||
## Application Secrets |
||||
|
||||
These instructions assume that your project is configured for [application secrets](https://docs.microsoft.com/aspnet/core/security/app-secrets). The primary requirement is a [UserSecretsId](https://github.com/dotnet/dotnet-docker/blob/master/samples/aspnetapp/aspnetapp/aspnetapp.csproj#L5) element in your project file. If you are using the ASP.NET Core sample in this repo, you don't need to do anything. It is already correctly configured. If you are using your own project file, add an `UserSecretsId` element. |
||||
|
||||
You can add the element manually or use Visual Studio to do it for you. The following image demonstrates the experience in Visual Studio. |
||||
|
||||
![Manage user secrets in Visual Studio](https://user-images.githubusercontent.com/7681382/39641521-85d4a7b4-4f9c-11e8-9466-d1ff56db33cb.png) |
||||
|
||||
The format of the `UserSecretsId` content doesn't matter. The sample in this repo used [Random String Generator](https://www.random.org/strings/?num=6&len=20&digits=on&unique=on&format=html&rnd=new) to produce a unique string. |
||||
|
||||
> Note: `User Secrets` and `Application Secrets` terms are used interchangebly. |
||||
|
||||
## Building and Running the Sample with HTTPS |
||||
|
||||
Use the following instructions, for your operating system configuration. The commands assume that you are in the root of the repository. |
||||
|
||||
> Note: The sample includes a banner to accept a cookie policy. When switching between HTTP and HTTPS, you may see the banner repeatedly. Delete the cookie for the site in `Developer Tools` in this case. |
||||
|
||||
![Developer Tools -- Delete cookie](https://user-images.githubusercontent.com/2608468/40246148-875fee5a-5a7c-11e8-9728-7da89a491014.png) |
||||
|
||||
### Windows using Linux containers |
||||
|
||||
Navigate to sample: |
||||
|
||||
```console |
||||
cd samples\aspnetapp |
||||
``` |
||||
|
||||
Generate cert and configure local machine: |
||||
|
||||
```console |
||||
dotnet dev-certs https -ep %USERPROFILE%\.aspnet\https\aspnetapp.pfx -p crypticpassword |
||||
dotnet dev-certs https --trust |
||||
``` |
||||
|
||||
> Note: The certificate name, in this case *aspnetapp*.pfx must match the project assembly name. |
||||
|
||||
> Note: `crypticpassword` is used as a stand-in for a password of your own choosing. |
||||
|
||||
Configure application secrets, for the certificate: |
||||
|
||||
```console |
||||
dotnet user-secrets -p aspnetapp\aspnetapp.csproj set "Kestrel:Certificates:Development:Password" "crypticpassword" |
||||
``` |
||||
|
||||
> Note: The password must match the password used for the certificate. |
||||
|
||||
Build a container image: |
||||
|
||||
```console |
||||
docker build --pull -t aspnetapp . |
||||
``` |
||||
|
||||
Run the container image with ASP.NET Core configured for HTTPS: |
||||
|
||||
```console |
||||
docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_ENVIRONMENT=Development -v %APPDATA%\microsoft\UserSecrets\:/root/.microsoft/usersecrets -v %USERPROFILE%\.aspnet\https:/root/.aspnet/https/ aspnetapp |
||||
``` |
||||
|
||||
After the application starts, navigate to `http://localhost:8000` in your web browser. |
||||
|
||||
### macOS |
||||
|
||||
```console |
||||
cd samples\aspnetapp |
||||
``` |
||||
|
||||
Generate cert and configure local machine: |
||||
|
||||
```console |
||||
dotnet dev-certs https -ep ${HOME}/.aspnet/https/aspnetapp.pfx -p crypticpassword |
||||
dotnet dev-certs https --trust |
||||
``` |
||||
|
||||
> Note: The certificate name, in this case *aspnetapp*.pfx must match the project assembly name. |
||||
|
||||
> Note: `crypticpassword` is used as a stand-in for a password of your own choosing. |
||||
|
||||
Configure application secrets, for the certificate: |
||||
|
||||
```console |
||||
dotnet user-secrets -p aspnetapp/aspnetapp.csproj set "Kestrel:Certificates:Development:Password" "crypticpassword" |
||||
``` |
||||
|
||||
> Note: The password must match the password used for the certificate. |
||||
|
||||
Build a container image: |
||||
|
||||
```console |
||||
docker build --pull -t aspnetapp . |
||||
``` |
||||
|
||||
Run the container image with ASP.NET Core configured for HTTPS: |
||||
|
||||
```console |
||||
docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_ENVIRONMENT=Development -v ${HOME}/.microsoft/UserSecrets/:/root/.microsoft/usersecrets -v ${HOME}/.aspnet/https:/root/.aspnet/https/ aspnetapp |
||||
``` |
||||
|
||||
After the application starts, navigate to `http://localhost:8000` in your web browser. |
||||
|
||||
### Linux |
||||
|
||||
```console |
||||
cd samples\aspnetapp |
||||
``` |
||||
|
||||
Generate cert and configure local machine: |
||||
|
||||
```console |
||||
dotnet dev-certs https -ep ${HOME}/.aspnet/https/aspnetapp.pfx -p crypticpassword |
||||
``` |
||||
|
||||
> Note: `dotnet dev-certs https --trust` is only supported on macOS and Windows. You need to trust certs on Linux in the way that is supported by your distro. It is likely that you need to trust the certificate in your browser. |
||||
|
||||
> Note: The certificate name, in this case *aspnetapp*.pfx must match the project assembly name. |
||||
|
||||
> Note: `crypticpassword` is used as a stand-in for a password of your own choosing. |
||||
|
||||
Build a container image: |
||||
|
||||
```console |
||||
docker build --pull -t aspnetapp . |
||||
``` |
||||
|
||||
Run the container image with ASP.NET Core configured for HTTPS: |
||||
|
||||
```console |
||||
docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_ENVIRONMENT=Development -e ASPNETCORE_Kestrel__Certificates__Development__Password="crypticpassword" -v ${HOME}/.microsoft/UserSecrets/:/root/.microsoft/usersecrets -v ${HOME}/.aspnet/https:/root/.aspnet/https/ aspnetapp |
||||
``` |
||||
|
||||
After the application starts, navigate to `http://localhost:8000` in your web browser. |
||||
|
||||
### Windows using Windows containers |
||||
|
||||
Navigate to sample: |
||||
|
||||
```console |
||||
cd samples\aspnetapp |
||||
``` |
||||
|
||||
Generate cert and configure local machine: |
||||
|
||||
```console |
||||
dotnet dev-certs https -ep %USERPROFILE%\.aspnet\https\aspnetapp.pfx -p crypticpassword |
||||
dotnet dev-certs https --trust |
||||
``` |
||||
|
||||
> Note: The certificate name, in this case *aspnetapp*.pfx must match the project assembly name. |
||||
|
||||
> Note: `crypticpassword` is used as a stand-in for a password of your own choosing. |
||||
|
||||
Configure application secrets, for the certificate: |
||||
|
||||
```console |
||||
dotnet user-secrets -p aspnetapp\aspnetapp.csproj set "Kestrel:Certificates:Development:Password" "crypticpassword" |
||||
``` |
||||
|
||||
> Note: The password must match the password used for the certificate. |
||||
|
||||
Build a container image: |
||||
|
||||
```console |
||||
docker build --pull -t aspnetapp . |
||||
``` |
||||
|
||||
Run the container image with ASP.NET Core configured for HTTPS. Select the correct syntax, depending on the Windows Server version. |
||||
|
||||
#### Windows Server 2016 |
||||
|
||||
```console |
||||
docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_ENVIRONMENT=Development -v %APPDATA%\microsoft\UserSecrets\:C:\Users\ContainerAdministrator\AppData\Roaming\microsoft\UserSecrets -v %USERPROFILE%\.aspnet\https:C:\Users\ContainerAdministrator\AppData\Roaming\ASP.NET\Https aspnetapp |
||||
``` |
||||
|
||||
#### Windows Server 2016, version 1709 or higher |
||||
|
||||
```console |
||||
docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_ENVIRONMENT=Development -v %APPDATA%\microsoft\UserSecrets\:C:\Users\ContainerUser\AppData\Roaming\microsoft\UserSecrets -v %USERPROFILE%\.aspnet\https:C:\Users\ContainerUser\AppData\Roaming\ASP.NET\Https aspnetapp |
||||
``` |
||||
|
||||
#### Viewing Site, with Windows Containers |
||||
|
||||
After the application starts, navigate to `http://localhost:8000` in your web browser. On Windows, you may need to navigate to the container via IP address. See [ASP.NET Core apps in Windows Containers](aspnetcore-docker-windows.md) for instructions on determining the IP address, using the value of `--name` that you used in `docker run`. |
@ -0,0 +1,87 @@ |
||||
# Hosting ASP.NET Core Images with Docker over HTTPS |
||||
|
||||
ASP.NET Core 2.1 uses [HTTPS by default](https://docs.microsoft.com/aspnet/core/security/enforcing-ssl). [HTTPS](https://en.wikipedia.org/wiki/HTTPS) relies on [certificates](https://en.wikipedia.org/wiki/Public_key_certificate) for trust, identity, and encryption. |
||||
|
||||
This document explains how to run pre-built container images with HTTPS. |
||||
|
||||
See [Developing ASP.NET Core Applications with Docker over HTTPS](aspnetcore-docker-https-development.md) for development scenarios. |
||||
|
||||
This sample requires [Docker 17.06](https://docs.docker.com/release-notes/docker-ce) or later of the [Docker client](https://www.docker.com/products/docker). |
||||
|
||||
## Certificates |
||||
|
||||
You need a certificate from a [certificate authority](https://en.wikipedia.org/wiki/Certificate_authority) for [production hosting](https://blogs.msdn.microsoft.com/webdev/2017/11/29/configuring-https-in-asp-net-core-across-different-platforms/) for your domain. You may already have one. [Let's Encrypt](https://letsencrypt.org/) is a certificate authority that offers free certificates. |
||||
|
||||
This document uses [self-signed development certificates](https://en.wikipedia.org/wiki/Self-signed_certificate) for hosting pre-built images over `localhost`. The instructions are similar to using production certificates. |
||||
|
||||
For production certs, you do not need to use the `dotnet dev-certs` tool or store the certificates in the location used in the instructions. Any location should work, although storing certs within your site directory is an anti-pattern. |
||||
|
||||
The instructions volume mount certificates into containers. You can add certificates into container images with a `COPY` command in a Dockerfile. Copying certificates into an image is an anti-pattern. It makes it harder to use the same image for testing with dev certificates and hosting with production certificates. There is also a significant risk of certificate disclosure if certificates are made part of container images. |
||||
|
||||
## Running pre-built Container Images with HTTPS |
||||
|
||||
Use the following instructions, for your operating system configuration. |
||||
|
||||
You need the [.NET Core 2.1 SDK](https://www.microsoft.com/net/download) for some of the instructions. |
||||
|
||||
### Windows using Linux containers |
||||
|
||||
Generate cert and configure local machine: |
||||
|
||||
```console |
||||
dotnet dev-certs https -ep %USERPROFILE%\.aspnet\https\aspnetapp.pfx -p crypticpassword |
||||
dotnet dev-certs https --trust |
||||
``` |
||||
|
||||
> Note: `crypticpassword` is used as a stand-in for a password of your own choosing. |
||||
|
||||
Run the container image with ASP.NET Core configured for HTTPS: |
||||
|
||||
```console |
||||
docker pull microsoft/dotnet-samples:aspnetapp |
||||
docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_Kestrel__Certificates__Default__Password="crypticpassword" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v %USERPROFILE%\.aspnet\https:/https/ microsoft/dotnet-samples:aspnetapp |
||||
``` |
||||
|
||||
> Note: The password must match the password used for the certificate. |
||||
|
||||
### macOS or Linux |
||||
|
||||
Generate cert and configure local machine: |
||||
|
||||
```console |
||||
dotnet dev-certs https -ep ${HOME}/.aspnet/https/aspnetapp.pfx -p crypticpassword |
||||
dotnet dev-certs https --trust |
||||
``` |
||||
|
||||
> Note: `dotnet dev-certs https --trust` is only supported on macOS and Windows. You need to trust certs on Linux in the way that is supported by your distro. It is likely that you need to trust the certificate in your browser. |
||||
|
||||
> Note: `crypticpassword` is used as a stand-in for a password of your own choosing. |
||||
|
||||
Run the container image with ASP.NET Core configured for HTTPS: |
||||
|
||||
```console |
||||
docker pull microsoft/dotnet-samples:aspnetapp |
||||
docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_Kestrel__Certificates__Default__Password="crypticpassword" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v ${HOME}/.aspnet/https:/https/ microsoft/dotnet-samples:aspnetapp |
||||
``` |
||||
|
||||
> Note: The password must match the password used for the certificate. |
||||
|
||||
### Windows using Windows containers |
||||
|
||||
Generate cert and configure local machine: |
||||
|
||||
```console |
||||
dotnet dev-certs https -ep %USERPROFILE%\.aspnet\https\aspnetapp.pfx -p crypticpassword |
||||
dotnet dev-certs https --trust |
||||
``` |
||||
|
||||
> Note: `crypticpassword` is used as a stand-in for a password of your own choosing. |
||||
|
||||
Run the container image with ASP.NET Core configured for HTTPS: |
||||
|
||||
```console |
||||
docker pull microsoft/dotnet-samples:aspnetapp |
||||
docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_Kestrel__Certificates__Default__Password="crypticpassword" -e ASPNETCORE_Kestrel__Certificates__Default__Path=\https\aspnetapp.pfx -v %USERPROFILE%\.aspnet\https:C:\https\ microsoft/dotnet-samples:aspnetapp |
||||
``` |
||||
|
||||
> Note: The password must match the password used for the certificate. |
@ -0,0 +1,51 @@ |
||||
# ASP.NET Core apps in Windows Containers |
||||
|
||||
ASP.NET Core applications are supported with [Windows containers](https://docs.microsoft.com/virtualization/windowscontainers/). The following instructions demonstrate how to run ASP.NET Core with Windows containers. See [ASP.NET Core Docker Sample](README.md) for instructions on how to build container images with ASP.NET Core. |
||||
|
||||
## Try a pre-built ASP.NET Core Docker Image |
||||
|
||||
You can quickly run a container with a pre-built [sample ASP.NET Core Docker image](https://hub.docker.com/r/microsoft/dotnet-samples/), based on this [sample](Dockerfile). |
||||
|
||||
Type the following command to run a sample with [Docker](https://store.docker.com/editions/community/docker-ce-desktop-windows): |
||||
|
||||
```console |
||||
docker run --name aspnetcore_sample --rm -it -p 8000:80 microsoft/dotnet-samples:aspnetapp |
||||
``` |
||||
|
||||
After the application starts, navigate to `http://localhost:8000` in your web browser. In some scenarios, and with earlier versions of Windows, you need to access the container via IP address. See the following section for instructions on how to do that. |
||||
|
||||
## View ASP.NET Core apps via IP address |
||||
|
||||
After the ASP.NET Core application starts, navigate to the container IP in your web browser with the the following instructions: |
||||
|
||||
> Note: These instructions rely on using the `--name aspnetcore_sample` argument with `docker run`. The `--name` argument makes it possible to access the container by name. If you used a different name, then use it instead in the following steps. |
||||
|
||||
1. Open up a command prompt. |
||||
1. Run `docker exec aspnetcore_sample ipconfig`. |
||||
1. Copy the container IP address and paste into your browser (for example, `172.29.245.43`). |
||||
|
||||
See the following example of how to get the IP address of a running Windows container. |
||||
|
||||
```console |
||||
C:\git\dotnet-docker\samples\aspnetapp>docker exec aspnetcore_sample ipconfig |
||||
|
||||
Windows IP Configuration |
||||
|
||||
|
||||
Ethernet adapter Ethernet: |
||||
|
||||
Connection-specific DNS Suffix . : contoso.com |
||||
Link-local IPv6 Address . . . . . : fe80::1967:6598:124:cfa3%4 |
||||
IPv4 Address. . . . . . . . . . . : 172.29.245.43 |
||||
Subnet Mask . . . . . . . . . . . : 255.255.240.0 |
||||
Default Gateway . . . . . . . . . : 172.29.240.1 |
||||
``` |
||||
|
||||
Note: [`docker exec`](https://docs.docker.com/engine/reference/commandline/exec/) supports identifying containers with name or hash. The container name is used in the preceding instructions. `docker exec` runs a new command (as opposed to the [entrypoint](https://docs.docker.com/engine/reference/builder/#entrypoint)) in a running container. |
||||
|
||||
`docker inspect` can also be used for this same purpose, as demonstrated in the following example. |
||||
|
||||
```console |
||||
C:\git\dotnet-docker\samples\aspnetapp>docker inspect -f "{{ .NetworkSettings.Networks.nat.IPAddress }}" aspnetcore_sample |
||||
172.25.157.148 |
||||
``` |
@ -0,0 +1,106 @@ |
||||
# Deploy ASP.NET Core Applications to Azure Container Instances |
||||
|
||||
You can deploy ASP.NET Core applications to Azure Container Instances (ACI) with Docker. ACI is a great option for application testing and can also be used for production deployment (not covered here). These instructions are based on the [ASP.NET Core Docker Sample](README.md). |
||||
|
||||
## Build Application |
||||
|
||||
Build the application per the [ASP.NET Core Docker Sample](README.md) instructions. The following is a summarized version of those instructions. The instructions assume that you are in the root of the repository. |
||||
|
||||
```console |
||||
cd samples |
||||
cd aspnetapp |
||||
docker build --pull -t aspnetapp -f Dockerfile . |
||||
``` |
||||
|
||||
For Windows containers, you will need to build with a [Dockerfile](Dockerfile.nanoserver-sac2016) that uses a Windows Server 2016 image. Use the following instructions for Windows containers: |
||||
|
||||
```console |
||||
cd samples |
||||
cd aspnetapp |
||||
docker build --pull -t aspnetapp -f Dockerfile.nanoserver-sac2016 . |
||||
``` |
||||
|
||||
Windows server, version 1709 and later versions are not yet supported in ACI. |
||||
|
||||
## Create ACR Registry |
||||
|
||||
Create an ACR registry per the instructions at [Push Docker Images to Azure Container Registry](../dotnetapp/push-image-to-acr.md). The following is a summarized version of those instructions. |
||||
|
||||
> Note: Change the password location and the user account ("rich" and "richlander") example values in your environment. |
||||
|
||||
```console |
||||
az login |
||||
az group create --name richlander-containers --location westus |
||||
az acr create --name richlander --resource-group richlander-containers --sku Basic |
||||
``` |
||||
|
||||
## Login to Azure Container Registry |
||||
|
||||
First, "admin-enable" your session, an ACR credentials access prerequisite for the subsequent command. |
||||
|
||||
```console |
||||
az acr update -n richlander --admin-enabled true |
||||
``` |
||||
|
||||
Now login to ACR via the docker cli, an ACR push prerequisite: |
||||
|
||||
```console |
||||
az acr credential show -n richlander --query passwords[0].value --output tsv | docker login richlander.azurecr.io -u richlander --password-stdin |
||||
``` |
||||
|
||||
## Push Image for Azure Container Registry (ACR) |
||||
|
||||
Use the following instructions to tag the image for your registry and push the image. If you automate these instructions, build the image with the correct name initially. |
||||
|
||||
```console |
||||
docker tag aspnetapp richlander.azurecr.io/aspnetapp |
||||
docker push richlander.azurecr.io/aspnetapp |
||||
``` |
||||
|
||||
## Deploy Image to Azure Container Instance (ACI) |
||||
|
||||
During deployment, you'll need to enter your password. Type or copy/paste it in. Get your password beforehand from the following command: |
||||
|
||||
```console |
||||
az acr credential show -n richlander --query passwords[0].value --output tsv |
||||
``` |
||||
|
||||
You can deploy Linux images with the following command: |
||||
|
||||
```console |
||||
az container create --name aspnetapp --image richlander.azurecr.io/aspnetapp --resource-group richlander-containers --ip-address public |
||||
``` |
||||
|
||||
You can deploy Windows images with the following command, which includes `--os-type Windows`: |
||||
|
||||
```console |
||||
az container create --name aspnetapp --image richlander.azurecr.io/aspnetapp --resource-group richlander-containers --ip-address public --os-type Windows |
||||
``` |
||||
|
||||
> Note: Azure Container Instances only supports Windows Server 2016 Nano Server and Server Core images, not Windows Server, version 1709 or later. |
||||
|
||||
## Running the Image |
||||
|
||||
The last step -- `az container show` -- will need to be repeated until `provisioningState` moves to `Succeeded`. |
||||
|
||||
```console |
||||
az container show --name aspnetapp --resource-group richlander-containers |
||||
``` |
||||
|
||||
Once the `provisioningState` moves to `Succeeded`, collect the IP address from the `ip` field, as you can see in the following image, and then copy/paste the IP address into your browser. You should see the sample running. |
||||
|
||||
![az container show -- successfully provisioned app](https://user-images.githubusercontent.com/2608468/29669868-b492c4e8-8899-11e7-82cc-d3ae1262a080.png) |
||||
|
||||
## Cleanup |
||||
|
||||
When these containers aren't needed, delete the resource group to reclaim all exercise container resources. |
||||
|
||||
```console |
||||
az group delete --name richlander-containers |
||||
az group exists --name richlander-containers |
||||
``` |
||||
|
||||
## More Samples |
||||
|
||||
* [.NET Core Docker Samples](../README.md) |
||||
* [.NET Framework Docker Samples](https://github.com/microsoft/dotnet-framework-docker-samples/) |
@ -0,0 +1,11 @@ |
||||
version: "3.6" |
||||
services: |
||||
backend: |
||||
build: backend |
||||
ports: |
||||
- 80:80 |
||||
db: |
||||
environment: |
||||
ACCEPT_EULA: "Y" |
||||
SA_PASSWORD: example_123 |
||||
image: microsoft/mssql-server-linux |
Loading…
Reference in new issue