(feature): client app init, improve containers infrastructure

This commit is contained in:
Maksym Sadovnychyy 2024-06-09 17:03:51 +02:00
parent 094acf925b
commit 1fe7c0a3da
37 changed files with 5396 additions and 33 deletions

3
.gitignore vendored
View File

@ -262,4 +262,5 @@ __pycache__/
*.pyc *.pyc
**/*docker_compose **/*docker_compose/LetsEncryptServer/acme
**/*docker_compose/LetsEncryptServer/cache

View File

@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}

36
src/ClientApp/.gitignore vendored Normal file
View File

@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# local env files
.env*.local
# vercel
.vercel
# typescript
*.tsbuildinfo
next-env.d.ts

38
src/ClientApp/Dockerfile Normal file
View File

@ -0,0 +1,38 @@
# Use the specific Node.js version 20.14.0 image as the base image for building the app
FROM node:20.14.0-alpine AS build
# Set the working directory inside the container
WORKDIR /app
# Copy the package.json and package-lock.json files to the working directory
COPY ClientApp/package*.json ./
# Install the project dependencies
RUN npm install
# Copy the rest of the application code to the working directory
COPY ClientApp .
# Build the Next.js application for production
RUN npm run build
# Use the same Node.js image for running the app
FROM node:20.14.0-alpine AS production
# Set the working directory inside the container
WORKDIR /app
# Copy the package.json and package-lock.json files to the working directory
COPY ClientApp/package*.json ./
# Install only production dependencies
RUN npm install --only=production
# Copy the built Next.js application from the build stage to the current directory
COPY --from=build /app ./
# Expose port 3000 to access the application
EXPOSE 3000
# Start the Next.js server
CMD ["npm", "start"]

36
src/ClientApp/README.md Normal file
View File

@ -0,0 +1,36 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
## Getting Started
First, run the development server:
```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
## Learn More
To learn more about Next.js, take a look at the following resources:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
## Deploy on Vercel
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

View File

@ -0,0 +1,12 @@
import Layout from "../layout";
const AboutPage = () => {
return (
<>
<h1 className="text-2xl font-bold">About</h1>
<p>This is the about page content.</p>
</>
);
};
export default AboutPage;

View File

@ -0,0 +1,11 @@
import Layout from "../layout";
const ContactPage = () => {
return (<>
<h1 className="text-2xl font-bold">Contact Us</h1>
<p>This is the contact page content.</p>
</>
);
};
export default ContactPage;

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

View File

@ -0,0 +1,12 @@
import Layout from "./layout";
const HomePage = () => {
return (
<Layout>
<h1 className="text-2xl font-bold">Main Content</h1>
{/* Your main content goes here */}
</Layout>
);
};
export default HomePage;

View File

@ -0,0 +1,53 @@
"use client"; // Add this line
import React, { FC, useState } from 'react';
import './globals.css';
import { SideMenu } from '../components/sidemenu';
import { TopMenu } from '../components/topmenu';
import { Footer } from '../components/footer';
import { OffCanvas } from '../components/offcanvas';
import { Metadata } from 'next';
const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
};
const Layout = ({ children }: Readonly<{
children: React.ReactNode;
}>) => {
const [isSidebarCollapsed, setIsSidebarCollapsed] = useState(false);
const [isOffCanvasOpen, setIsOffCanvasOpen] = useState(false);
const toggleSidebar = () => {
setIsSidebarCollapsed(!isSidebarCollapsed);
};
const toggleOffCanvas = () => {
setIsOffCanvasOpen(!isOffCanvasOpen);
};
return (
<html lang="en">
{/* <head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/favicon.ico" />
</head> */}
<body className="h-screen overflow-hidden">
<div className="flex h-full">
<SideMenu isCollapsed={isSidebarCollapsed} toggleSidebar={toggleSidebar} />
<div className="flex flex-col flex-1">
<TopMenu onToggleOffCanvas={toggleOffCanvas} />
<main className={`flex-1 p-4 transition-transform duration-300 ${isOffCanvasOpen ? 'transform translate-x-64' : ''}`}>
{children}
</main>
<Footer />
</div>
</div>
<OffCanvas isOpen={isOffCanvasOpen} onClose={toggleOffCanvas} />
</body>
</html>
);
};
export default Layout;

View File

@ -0,0 +1,9 @@
// `app/page.tsx` is the UI for the `/` URL
export default function Page() {
return (
<>
<h1 className="text-2xl font-bold">Home</h1>
<p>Hello, Home page!</p>
</>
);
}

View File

@ -0,0 +1,13 @@
import React from 'react';
const Footer = () => {
return (
<footer className="bg-gray-900 text-white text-center p-4">
<p>&copy; 2024 Your Company</p>
</footer>
);
};
export {
Footer
};

View File

@ -0,0 +1,34 @@
import React, { FC } from 'react';
interface OffCanvasProps {
isOpen: boolean;
onClose: () => void;
}
const OffCanvas: FC<OffCanvasProps> = ({ isOpen, onClose }) => {
return (
<div
className={`fixed inset-0 bg-gray-800 bg-opacity-50 z-50 transform transition-transform duration-300 ${
isOpen ? 'translate-x-0' : 'translate-x-full'
}`}
onClick={onClose}
>
<div
className="absolute top-0 right-0 bg-white w-64 h-full shadow-lg"
onClick={(e) => e.stopPropagation()}
>
<div className="p-4">
<h2 className="text-xl font-bold">Settings</h2>
<button onClick={onClose} className="mt-4 text-red-500">
Close
</button>
</div>
{/* Your off-canvas content goes here */}
</div>
</div>
);
};
export {
OffCanvas
};

View File

@ -0,0 +1,40 @@
import React, { FC } from 'react';
import { FaHome, FaUser, FaCog, FaBars } from 'react-icons/fa';
interface SideMenuProps {
isCollapsed: boolean;
toggleSidebar: () => void;
}
const SideMenu: FC<SideMenuProps> = ({ isCollapsed, toggleSidebar }) => {
return (
<div className={`flex flex-col bg-gray-800 text-white transition-all duration-300 ${isCollapsed ? 'w-16' : 'w-64'} h-full`}>
<div className="flex items-center h-16 bg-gray-900 relative">
{/* <button onClick={toggleSidebar} className="absolute left-4">
<FaBars />
</button> */}
<h1 className={`${isCollapsed ? 'hidden' : 'block'} text-2xl font-bold ml-12`}>Logo</h1>
</div>
<nav className="flex-1">
<ul>
<li className="flex items-center p-4 hover:bg-gray-700">
<FaHome className="mr-4" />
<span className={`${isCollapsed ? 'hidden' : 'block'}`}>Home</span>
</li>
<li className="flex items-center p-4 hover:bg-gray-700">
<FaUser className="mr-4" />
<span className={`${isCollapsed ? 'hidden' : 'block'}`}>Profile</span>
</li>
<li className="flex items-center p-4 hover:bg-gray-700">
<FaCog className="mr-4" />
<span className={`${isCollapsed ? 'hidden' : 'block'}`}>Settings</span>
</li>
</ul>
</nav>
</div>
);
};
export {
SideMenu
};

View File

@ -0,0 +1,58 @@
"use client"; // Add this line
import React, { FC, useState } from 'react';
import { FaCog, FaBars } from 'react-icons/fa';
import Link from 'next/link';
interface TopMenuProps {
onToggleOffCanvas: () => void;
}
const TopMenu: FC<TopMenuProps> = ({ onToggleOffCanvas }) => {
const [isMenuOpen, setIsMenuOpen] = useState(false);
const toggleMenu = () => {
setIsMenuOpen(!isMenuOpen);
};
return (
<header className="bg-gray-900 text-white flex items-center p-4">
<nav className="flex-1 flex justify-between items-center">
<ul className="hidden md:flex space-x-4">
<li className="hover:bg-gray-700 p-2 rounded">
<Link href="/">Home</Link>
</li>
<li className="hover:bg-gray-700 p-2 rounded">
<Link href="/about">About</Link>
</li>
<li className="hover:bg-gray-700 p-2 rounded">
<Link href="/contact">Contact</Link>
</li>
</ul>
<button onClick={toggleMenu} className="md:hidden">
<FaBars />
</button>
{isMenuOpen && (
<ul className="absolute top-16 right-0 bg-gray-900 w-48 md:hidden">
<li className="hover:bg-gray-700 p-2">
<Link href="/">Home</Link>
</li>
<li className="hover:bg-gray-700 p-2">
<Link href="/about">About</Link>
</li>
<li className="hover:bg-gray-700 p-2">
<Link href="/contact">Contact</Link>
</li>
</ul>
)}
</nav>
<button onClick={onToggleOffCanvas} className="ml-4">
<FaCog />
</button>
</header>
);
};
export {
TopMenu
};

View File

@ -0,0 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
export default nextConfig;

4822
src/ClientApp/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,27 @@
{
"name": "my-nextjs-app",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"next": "14.2.3",
"react": "^18",
"react-dom": "^18",
"react-icons": "^5.2.1"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"eslint": "^8",
"eslint-config-next": "14.2.3",
"postcss": "^8",
"tailwindcss": "^3.4.1",
"typescript": "^5"
}
}

View File

@ -0,0 +1,8 @@
/** @type {import('postcss-load-config').Config} */
const config = {
plugins: {
tailwindcss: {},
},
};
export default config;

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 283 64"><path fill="black" d="M141 16c-11 0-19 7-19 18s9 18 20 18c7 0 13-3 16-7l-7-5c-2 3-6 4-9 4-5 0-9-3-10-7h28v-3c0-11-8-18-19-18zm-9 15c1-4 4-7 9-7s8 3 9 7h-18zm117-15c-11 0-19 7-19 18s9 18 20 18c6 0 12-3 16-7l-8-5c-2 3-5 4-8 4-5 0-9-3-11-7h28l1-3c0-11-8-18-19-18zm-10 15c2-4 5-7 10-7s8 3 9 7h-19zm-39 3c0 6 4 10 10 10 4 0 7-2 9-5l8 5c-3 5-9 8-17 8-11 0-19-7-19-18s8-18 19-18c8 0 14 3 17 8l-8 5c-2-3-5-5-9-5-6 0-10 4-10 10zm83-29v46h-9V5h9zM37 0l37 64H0L37 0zm92 5-27 48L74 5h10l18 30 17-30h10zm59 12v10l-3-1c-6 0-10 4-10 10v15h-9V17h9v9c0-5 6-9 13-9z"/></svg>

After

Width:  |  Height:  |  Size: 629 B

View File

@ -0,0 +1,20 @@
import type { Config } from "tailwindcss";
const config: Config = {
content: [
"./pages/**/*.{js,ts,jsx,tsx,mdx}",
"./components/**/*.{js,ts,jsx,tsx,mdx}",
"./app/**/*.{js,ts,jsx,tsx,mdx}",
],
theme: {
extend: {
backgroundImage: {
"gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
"gradient-conic":
"conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
},
},
},
plugins: [],
};
export default config;

View File

@ -0,0 +1,26 @@
{
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}

View File

@ -11,7 +11,7 @@ using MaksIT.Models.LetsEncryptServer.Cache.Requests;
namespace MaksIT.LetsEncryptServer.Controllers; namespace MaksIT.LetsEncryptServer.Controllers;
[ApiController] [ApiController]
[Route("[controller]")] [Route("api/[controller]")]
public class CacheController { public class CacheController {
private readonly Configuration _appSettings; private readonly Configuration _appSettings;

View File

@ -10,7 +10,7 @@ using Models.LetsEncryptServer.CertsFlow.Requests;
namespace MaksIT.LetsEncryptServer.Controllers; namespace MaksIT.LetsEncryptServer.Controllers;
[ApiController] [ApiController]
[Route("[controller]")] [Route("api/[controller]")]
public class CertsFlowController : ControllerBase { public class CertsFlowController : ControllerBase {
private readonly IOptions<Configuration> _appSettings; private readonly IOptions<Configuration> _appSettings;

View File

@ -3,7 +3,7 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER app USER app
WORKDIR /app WORKDIR /app
EXPOSE 8080 EXPOSE 5000
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release ARG BUILD_CONFIGURATION=Release

View File

@ -23,7 +23,7 @@
"launchBrowser": true, "launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger",
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_HTTP_PORTS": "8080" "ASPNETCORE_HTTP_PORTS": "5000"
}, },
"publishAllPorts": true "publishAllPorts": true
} }

View File

@ -24,13 +24,14 @@
} }
], ],
"url": { "url": {
"raw": "http://localhost:8080/Cache/GetContacts/{{accountId}}", "raw": "http://localhost:8080/api/Cache/GetContacts/{{accountId}}",
"protocol": "http", "protocol": "http",
"host": [ "host": [
"localhost" "localhost"
], ],
"port": "8080", "port": "8080",
"path": [ "path": [
"api",
"Cache", "Cache",
"GetContacts", "GetContacts",
"{{accountId}}" "{{accountId}}"
@ -63,13 +64,14 @@
} }
}, },
"url": { "url": {
"raw": "http://localhost:8080/Cache/SetContacts/{{accountId}}", "raw": "http://localhost:8080/api/Cache/SetContacts/{{accountId}}",
"protocol": "http", "protocol": "http",
"host": [ "host": [
"localhost" "localhost"
], ],
"port": "8080", "port": "8080",
"path": [ "path": [
"api",
"Cache", "Cache",
"SetContacts", "SetContacts",
"{{accountId}}" "{{accountId}}"
@ -95,13 +97,14 @@
} }
], ],
"url": { "url": {
"raw": "http://localhost:8080/CertsFlow/HostsWithUpcomingSslExpiry/{{sessionId}}", "raw": "http://localhost:8080/api/CertsFlow/HostsWithUpcomingSslExpiry/{{sessionId}}",
"protocol": "http", "protocol": "http",
"host": [ "host": [
"localhost" "localhost"
], ],
"port": "8080", "port": "8080",
"path": [ "path": [
"api",
"CertsFlow", "CertsFlow",
"HostsWithUpcomingSslExpiry", "HostsWithUpcomingSslExpiry",
"{{sessionId}}" "{{sessionId}}"
@ -182,13 +185,14 @@
} }
], ],
"url": { "url": {
"raw": "http://localhost:8080/CertsFlow/ConfigureClient", "raw": "http://localhost:8080/api/CertsFlow/ConfigureClient",
"protocol": "http", "protocol": "http",
"host": [ "host": [
"localhost" "localhost"
], ],
"port": "8080", "port": "8080",
"path": [ "path": [
"api",
"CertsFlow", "CertsFlow",
"ConfigureClient" "ConfigureClient"
] ]
@ -202,13 +206,14 @@
"method": "GET", "method": "GET",
"header": [], "header": [],
"url": { "url": {
"raw": "http://localhost:8080/CertsFlow/TermsOfService/{{sessionId}}", "raw": "http://localhost:8080/api/CertsFlow/TermsOfService/{{sessionId}}",
"protocol": "http", "protocol": "http",
"host": [ "host": [
"localhost" "localhost"
], ],
"port": "8080", "port": "8080",
"path": [ "path": [
"api",
"CertsFlow", "CertsFlow",
"TermsOfService", "TermsOfService",
"{{sessionId}}" "{{sessionId}}"
@ -294,13 +299,14 @@
} }
}, },
"url": { "url": {
"raw": "http://localhost:8080/CertsFlow/Init/{{sessionId}}/{{accountId}}", "raw": "http://localhost:8080/api/CertsFlow/Init/{{sessionId}}/{{accountId}}",
"protocol": "http", "protocol": "http",
"host": [ "host": [
"localhost" "localhost"
], ],
"port": "8080", "port": "8080",
"path": [ "path": [
"api",
"CertsFlow", "CertsFlow",
"Init", "Init",
"{{sessionId}}", "{{sessionId}}",
@ -371,13 +377,14 @@
} }
}, },
"url": { "url": {
"raw": "http://localhost:8080/CertsFlow/NewOrder/{{sessionId}}", "raw": "http://localhost:8080/api/CertsFlow/NewOrder/{{sessionId}}",
"protocol": "http", "protocol": "http",
"host": [ "host": [
"localhost" "localhost"
], ],
"port": "8080", "port": "8080",
"path": [ "path": [
"api",
"CertsFlow", "CertsFlow",
"NewOrder", "NewOrder",
"{{sessionId}}" "{{sessionId}}"
@ -452,13 +459,14 @@
} }
}, },
"url": { "url": {
"raw": "http://localhost:8080/CertsFlow/CompleteChallenges/{{sessionId}}", "raw": "http://localhost:8080/api/CertsFlow/CompleteChallenges/{{sessionId}}",
"protocol": "http", "protocol": "http",
"host": [ "host": [
"localhost" "localhost"
], ],
"port": "8080", "port": "8080",
"path": [ "path": [
"api",
"CertsFlow", "CertsFlow",
"CompleteChallenges", "CompleteChallenges",
"{{sessionId}}" "{{sessionId}}"
@ -491,13 +499,14 @@
} }
}, },
"url": { "url": {
"raw": "http://localhost:8080/CertsFlow/GetOrder/{{sessionId}}", "raw": "http://localhost:8080/api/CertsFlow/GetOrder/{{sessionId}}",
"protocol": "http", "protocol": "http",
"host": [ "host": [
"localhost" "localhost"
], ],
"port": "8080", "port": "8080",
"path": [ "path": [
"api",
"CertsFlow", "CertsFlow",
"GetOrder", "GetOrder",
"{{sessionId}}" "{{sessionId}}"
@ -530,13 +539,14 @@
} }
}, },
"url": { "url": {
"raw": "http://localhost:8080/CertsFlow/GetCertificates/{{sessionId}}", "raw": "http://localhost:8080/api/CertsFlow/GetCertificates/{{sessionId}}",
"protocol": "http", "protocol": "http",
"host": [ "host": [
"localhost" "localhost"
], ],
"port": "8080", "port": "8080",
"path": [ "path": [
"api",
"CertsFlow", "CertsFlow",
"GetCertificates", "GetCertificates",
"{{sessionId}}" "{{sessionId}}"
@ -569,13 +579,14 @@
} }
}, },
"url": { "url": {
"raw": "http://localhost:8080/CertsFlow/ApplyCertificates/{{sessionId}}", "raw": "http://localhost:8080/api/CertsFlow/ApplyCertificates/{{sessionId}}",
"protocol": "http", "protocol": "http",
"host": [ "host": [
"localhost" "localhost"
], ],
"port": "8080", "port": "8080",
"path": [ "path": [
"api",
"CertsFlow", "CertsFlow",
"ApplyCertificates", "ApplyCertificates",
"{{sessionId}}" "{{sessionId}}"

View File

@ -24,13 +24,14 @@
} }
], ],
"url": { "url": {
"raw": "http://localhost:8080/Cache/GetContacts/{{accountId}}", "raw": "http://localhost:8080/api/Cache/GetContacts/{{accountId}}",
"protocol": "http", "protocol": "http",
"host": [ "host": [
"localhost" "localhost"
], ],
"port": "8080", "port": "8080",
"path": [ "path": [
"api",
"Cache", "Cache",
"GetContacts", "GetContacts",
"{{accountId}}" "{{accountId}}"
@ -63,13 +64,14 @@
} }
}, },
"url": { "url": {
"raw": "http://localhost:8080/Cache/SetContacts/{{accountId}}", "raw": "http://localhost:8080/api/Cache/SetContacts/{{accountId}}",
"protocol": "http", "protocol": "http",
"host": [ "host": [
"localhost" "localhost"
], ],
"port": "8080", "port": "8080",
"path": [ "path": [
"api",
"Cache", "Cache",
"SetContacts", "SetContacts",
"{{accountId}}" "{{accountId}}"
@ -95,13 +97,14 @@
} }
], ],
"url": { "url": {
"raw": "http://localhost:8080/CertsFlow/HostsWithUpcomingSslExpiry/{{sessionId}}", "raw": "http://localhost:8080/api/CertsFlow/HostsWithUpcomingSslExpiry/{{sessionId}}",
"protocol": "http", "protocol": "http",
"host": [ "host": [
"localhost" "localhost"
], ],
"port": "8080", "port": "8080",
"path": [ "path": [
"api",
"CertsFlow", "CertsFlow",
"HostsWithUpcomingSslExpiry", "HostsWithUpcomingSslExpiry",
"{{sessionId}}" "{{sessionId}}"
@ -183,13 +186,14 @@
} }
], ],
"url": { "url": {
"raw": "http://localhost:8080/CertsFlow/ConfigureClient", "raw": "http://localhost:8080/api/CertsFlow/ConfigureClient",
"protocol": "http", "protocol": "http",
"host": [ "host": [
"localhost" "localhost"
], ],
"port": "8080", "port": "8080",
"path": [ "path": [
"api",
"CertsFlow", "CertsFlow",
"ConfigureClient" "ConfigureClient"
] ]
@ -203,13 +207,14 @@
"method": "GET", "method": "GET",
"header": [], "header": [],
"url": { "url": {
"raw": "http://localhost:8080/CertsFlow/TermsOfService/{{sessionId}}", "raw": "http://localhost:8080/api/CertsFlow/TermsOfService/{{sessionId}}",
"protocol": "http", "protocol": "http",
"host": [ "host": [
"localhost" "localhost"
], ],
"port": "8080", "port": "8080",
"path": [ "path": [
"api",
"CertsFlow", "CertsFlow",
"TermsOfService", "TermsOfService",
"{{sessionId}}" "{{sessionId}}"
@ -295,13 +300,14 @@
} }
}, },
"url": { "url": {
"raw": "http://localhost:8080/CertsFlow/Init/{{sessionId}}/{{accountId}}", "raw": "http://localhost:8080/api/CertsFlow/Init/{{sessionId}}/{{accountId}}",
"protocol": "http", "protocol": "http",
"host": [ "host": [
"localhost" "localhost"
], ],
"port": "8080", "port": "8080",
"path": [ "path": [
"api",
"CertsFlow", "CertsFlow",
"Init", "Init",
"{{sessionId}}", "{{sessionId}}",
@ -372,13 +378,14 @@
} }
}, },
"url": { "url": {
"raw": "http://localhost:8080/CertsFlow/NewOrder/{{sessionId}}", "raw": "http://localhost:8080/api/CertsFlow/NewOrder/{{sessionId}}",
"protocol": "http", "protocol": "http",
"host": [ "host": [
"localhost" "localhost"
], ],
"port": "8080", "port": "8080",
"path": [ "path": [
"api",
"CertsFlow", "CertsFlow",
"NewOrder", "NewOrder",
"{{sessionId}}" "{{sessionId}}"
@ -454,13 +461,14 @@
} }
}, },
"url": { "url": {
"raw": "http://localhost:8080/CertsFlow/CompleteChallenges/{{sessionId}}", "raw": "http://localhost:8080/api/CertsFlow/CompleteChallenges/{{sessionId}}",
"protocol": "http", "protocol": "http",
"host": [ "host": [
"localhost" "localhost"
], ],
"port": "8080", "port": "8080",
"path": [ "path": [
"api",
"CertsFlow", "CertsFlow",
"CompleteChallenges", "CompleteChallenges",
"{{sessionId}}" "{{sessionId}}"
@ -493,13 +501,14 @@
} }
}, },
"url": { "url": {
"raw": "http://localhost:8080/CertsFlow/GetOrder/{{sessionId}}", "raw": "http://localhost:8080/api/CertsFlow/GetOrder/{{sessionId}}",
"protocol": "http", "protocol": "http",
"host": [ "host": [
"localhost" "localhost"
], ],
"port": "8080", "port": "8080",
"path": [ "path": [
"api",
"CertsFlow", "CertsFlow",
"GetOrder", "GetOrder",
"{{sessionId}}" "{{sessionId}}"
@ -532,13 +541,14 @@
} }
}, },
"url": { "url": {
"raw": "http://localhost:8080/CertsFlow/GetCertificates/{{sessionId}}", "raw": "http://localhost:8080/api/CertsFlow/GetCertificates/{{sessionId}}",
"protocol": "http", "protocol": "http",
"host": [ "host": [
"localhost" "localhost"
], ],
"port": "8080", "port": "8080",
"path": [ "path": [
"api",
"CertsFlow", "CertsFlow",
"GetCertificates", "GetCertificates",
"{{sessionId}}" "{{sessionId}}"
@ -571,13 +581,14 @@
} }
}, },
"url": { "url": {
"raw": "http://localhost:8080/CertsFlow/ApplyCertificates/{{sessionId}}", "raw": "http://localhost:8080/api/CertsFlow/ApplyCertificates/{{sessionId}}",
"protocol": "http", "protocol": "http",
"host": [ "host": [
"localhost" "localhost"
], ],
"port": "8080", "port": "8080",
"path": [ "path": [
"api",
"CertsFlow", "CertsFlow",
"ApplyCertificates", "ApplyCertificates",
"{{sessionId}}" "{{sessionId}}"

View File

@ -1,12 +1,26 @@
version: '3.4' version: '3.9'
services: services:
haproxy:
ports:
- "8080:8080"
volumes:
- ./docker-compose/haproxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
depends_on:
- letsencryptapp
- letsencryptserver
letsencryptapp:
ports:
- "3000:3000"
letsencryptserver: letsencryptserver:
environment: environment:
- ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_HTTP_PORTS=8080 - ASPNETCORE_HTTP_PORTS=5000
volumes: volumes:
- ./docker_compose/LetsEncryptServer/acme:/app/bin/Debug/net8.0/acme - ./docker-compose/LetsEncryptServer/acme:/app/bin/Debug/net8.0/acme
- ./docker_compose/LetsEncryptServer/cache:/app/bin/Debug/net8.0/cache - ./docker-compose/LetsEncryptServer/cache:/app/bin/Debug/net8.0/cache
ports: ports:
- "8080:8080" - "5000:5000"

View File

@ -1,6 +1,16 @@
version: '3.4' version: '3.9'
services: services:
haproxy:
image: haproxy:3.0.0-alpine
letsencryptapp:
image: ${DOCKER_REGISTRY-}letsencryptapp
build:
context: .
dockerfile: ClientApp/Dockerfile
letsencryptserver: letsencryptserver:
image: ${DOCKER_REGISTRY-}letsencryptserver image: ${DOCKER_REGISTRY-}letsencryptserver
build: build:

View File

@ -0,0 +1,16 @@
server {
listen 3000;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

View File

@ -0,0 +1 @@
VTpgCMVyk7RMm0qKEURrgcfHI5Y0RKRWlF0Up1y1xMs.CmDayuKv1cGaB2xr6W5cZk_Jqbyonzm29xtXVNgBMAQ

View File

@ -0,0 +1 @@
sf6oq1qazlokoWqGJam03udFEYOanTus2DmShjnfAcw.CmDayuKv1cGaB2xr6W5cZk_Jqbyonzm29xtXVNgBMAQ

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,30 @@
# docker_compose/haproxy/haproxy.cfg
global
log stdout format raw local0
maxconn 4096
tune.ssl.default-dh-param 2048
defaults
log global
mode http
option httplog
option dontlognull
option forwardfor
option http-server-close
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
frontend http_front
bind *:8080
acl is_letsencryptserver path_beg /api /swagger /.well-known/acme-challenge
use_backend letsencryptserver_backend if is_letsencryptserver
default_backend letsencryptapp_backend
backend letsencryptapp_backend
server letsencryptapp letsencryptapp:3000 check
backend letsencryptserver_backend
server letsencryptserver letsencryptserver:5000 check