diff --git a/.editorconfig b/.editorconfig index 118b6e64a..1fbf4e5d8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -105,4 +105,8 @@ csharp_new_line_before_else = true csharp_new_line_before_catch = true csharp_new_line_before_finally = true csharp_new_line_before_members_in_object_initializers = true -csharp_new_line_before_members_in_anonymous_types = true \ No newline at end of file +csharp_new_line_before_members_in_anonymous_types = true + +# All files +[*] +guidelines = 120 diff --git a/src/Admin/Dockerfile b/src/Admin/Dockerfile index e44b83735..e11c27816 100644 --- a/src/Admin/Dockerfile +++ b/src/Admin/Dockerfile @@ -5,6 +5,7 @@ LABEL com.bitwarden.product="bitwarden" RUN apt-get update \ && apt-get install -y --no-install-recommends \ gosu \ + curl \ libcurl3 \ && rm -rf /var/lib/apt/lists/* @@ -15,4 +16,6 @@ COPY obj/Docker/publish . COPY entrypoint.sh / RUN chmod +x /entrypoint.sh +HEALTHCHECK CMD curl -f http://localhost:5000 || exit 1 + ENTRYPOINT ["/entrypoint.sh"] diff --git a/src/Api/Dockerfile b/src/Api/Dockerfile index bcd3c8ca2..f5ceb3740 100644 --- a/src/Api/Dockerfile +++ b/src/Api/Dockerfile @@ -5,6 +5,7 @@ LABEL com.bitwarden.product="bitwarden" RUN apt-get update \ && apt-get install -y --no-install-recommends \ gosu \ + curl \ libcurl3 \ && rm -rf /var/lib/apt/lists/* @@ -15,4 +16,6 @@ COPY obj/Docker/publish/Api . COPY entrypoint.sh / RUN chmod +x /entrypoint.sh +HEALTHCHECK CMD curl -f http://localhost:5000/alive || exit 1 + ENTRYPOINT ["/entrypoint.sh"] diff --git a/src/Billing/Controllers/HomeController.cs b/src/Billing/Controllers/HomeController.cs index 00f5bc4c2..e4e991819 100644 --- a/src/Billing/Controllers/HomeController.cs +++ b/src/Billing/Controllers/HomeController.cs @@ -6,6 +6,14 @@ namespace Billing.Controllers { public class HomeController : Controller { + [HttpGet("~/alive")] + [HttpGet("~/now")] + [AllowAnonymous] + public DateTime GetAlive() + { + return DateTime.UtcNow; + } + /* [Authorize] public IActionResult Index() diff --git a/src/Events/Controllers/CollectController.cs b/src/Events/Controllers/CollectController.cs index 06ceaaaa8..889e3ae1e 100644 --- a/src/Events/Controllers/CollectController.cs +++ b/src/Events/Controllers/CollectController.cs @@ -32,6 +32,14 @@ namespace Bit.Events.Controllers _cipherRepository = cipherRepository; } + [HttpGet("~/alive")] + [HttpGet("~/now")] + [AllowAnonymous] + public DateTime GetAlive() + { + return DateTime.UtcNow; + } + [HttpPost] public async Task Post([FromBody]IEnumerable model) { diff --git a/src/Events/Dockerfile b/src/Events/Dockerfile index cd3346661..055b36233 100644 --- a/src/Events/Dockerfile +++ b/src/Events/Dockerfile @@ -5,6 +5,7 @@ LABEL com.bitwarden.product="bitwarden" RUN apt-get update \ && apt-get install -y --no-install-recommends \ gosu \ + curl \ libcurl3 \ && rm -rf /var/lib/apt/lists/* @@ -15,4 +16,6 @@ COPY obj/Docker/publish/Events . COPY entrypoint.sh / RUN chmod +x /entrypoint.sh +HEALTHCHECK CMD curl -f http://localhost:5000/alive || exit 1 + ENTRYPOINT ["/entrypoint.sh"] diff --git a/src/Icons/Dockerfile b/src/Icons/Dockerfile index 5cb5b6a27..7e7235cb0 100644 --- a/src/Icons/Dockerfile +++ b/src/Icons/Dockerfile @@ -5,6 +5,7 @@ LABEL com.bitwarden.product="bitwarden" RUN apt-get update \ && apt-get install -y --no-install-recommends \ gosu \ + curl \ && rm -rf /var/lib/apt/lists/* ENV ASPNETCORE_URLS http://+:5000 @@ -14,4 +15,6 @@ COPY obj/Docker/publish . COPY entrypoint.sh / RUN chmod +x /entrypoint.sh +HEALTHCHECK CMD curl -f http://localhost:5000/google.com/icon.png || exit 1 + ENTRYPOINT ["/entrypoint.sh"] diff --git a/src/Identity/Dockerfile b/src/Identity/Dockerfile index e44b83735..06d255f6a 100644 --- a/src/Identity/Dockerfile +++ b/src/Identity/Dockerfile @@ -5,6 +5,7 @@ LABEL com.bitwarden.product="bitwarden" RUN apt-get update \ && apt-get install -y --no-install-recommends \ gosu \ + curl \ libcurl3 \ && rm -rf /var/lib/apt/lists/* @@ -15,4 +16,6 @@ COPY obj/Docker/publish . COPY entrypoint.sh / RUN chmod +x /entrypoint.sh +HEALTHCHECK CMD curl -f http://localhost:5000/.well-known/openid-configuration || exit 1 + ENTRYPOINT ["/entrypoint.sh"] diff --git a/src/Notifications/Controllers/SendController.cs b/src/Notifications/Controllers/SendController.cs index 7a99c8f8a..2b6149fd7 100644 --- a/src/Notifications/Controllers/SendController.cs +++ b/src/Notifications/Controllers/SendController.cs @@ -1,4 +1,5 @@ -using System.IO; +using System; +using System.IO; using System.Text; using System.Threading.Tasks; using Bit.Core.Utilities; @@ -19,6 +20,14 @@ namespace Bit.Notifications _hubContext = hubContext; } + [HttpGet("~/alive")] + [HttpGet("~/now")] + [AllowAnonymous] + public DateTime GetAlive() + { + return DateTime.UtcNow; + } + [HttpPost("~/send")] public async Task PostSend() { diff --git a/src/Notifications/Dockerfile b/src/Notifications/Dockerfile index 5cb5b6a27..60eb13d82 100644 --- a/src/Notifications/Dockerfile +++ b/src/Notifications/Dockerfile @@ -5,6 +5,7 @@ LABEL com.bitwarden.product="bitwarden" RUN apt-get update \ && apt-get install -y --no-install-recommends \ gosu \ + curl \ && rm -rf /var/lib/apt/lists/* ENV ASPNETCORE_URLS http://+:5000 @@ -14,4 +15,6 @@ COPY obj/Docker/publish . COPY entrypoint.sh / RUN chmod +x /entrypoint.sh +HEALTHCHECK CMD curl -f http://localhost:5000/alive || exit 1 + ENTRYPOINT ["/entrypoint.sh"]