Compare commits

...

6 Commits

Author SHA1 Message Date
Anthony LC 1d79bfc380 tag-v0.1.0-coming-soon 2024-06-19 16:50:13 +02:00
Anthony LC cb789d047f (frontend) coming soon
Add a coming soon page bind to the
regie.numerique.gouv.fr domain.
2024-06-19 16:50:13 +02:00
Anthony LC 0862c7d5e0 🎨(frontend) create PageLayout
- Create PageLayout, a simple layout for pages
that don't need a sidebar and don't need to be
contains in the screen height.
- Moves the layouts in the layouts folder.
2024-06-19 16:50:13 +02:00
Jacques ROUSSEL aa6c27bbb8 💚(CI) upgrade submodule
- Change target submodule to link to production secrets
2024-06-19 16:49:00 +02:00
Anthony LC 1520387237 👷(CI) add production tag to deploy workflow
Add `production` tag to deploy workflow.
Every tag production will trigger
the deploy workflow to production environment.
2024-06-19 16:49:00 +02:00
Anthony LC 3294c9551c 👷(helm) prod configuration
Add the prod configuration to the helm chart.
2024-06-19 16:49:00 +02:00
15 changed files with 205 additions and 10 deletions
+1
View File
@@ -4,6 +4,7 @@ on:
push:
tags:
- 'preprod'
- 'production'
jobs:
+1 -1
Submodule secrets updated: 484edba1b8...344a57b3a3
@@ -21,8 +21,10 @@ export interface BoxProps {
$height?: CSSProperties['height'];
$justify?: CSSProperties['justifyContent'];
$overflow?: CSSProperties['overflow'];
$maxWidth?: CSSProperties['maxWidth'];
$margin?: MarginPadding;
$maxHeight?: CSSProperties['maxHeight'];
$minHeight?: CSSProperties['minHeight'];
$maxWidth?: CSSProperties['maxWidth'];
$minWidth?: CSSProperties['minWidth'];
$padding?: MarginPadding;
$position?: CSSProperties['position'];
@@ -52,5 +54,7 @@ export const Box = styled('div')<BoxProps>`
${({ $width }) => $width && `width: ${$width};`}
${({ $maxWidth }) => $maxWidth && `max-width: ${$maxWidth};`}
${({ $minWidth }) => $minWidth && `min-width: ${$minWidth};`}
${({ $maxHeight }) => $maxHeight && `max-height: ${$maxHeight};`}
${({ $minHeight }) => $minHeight && `min-height: ${$minHeight};`}
${({ $css }) => $css && `${$css};`}
`;
+22 -4
View File
@@ -1,5 +1,6 @@
import { Loader } from '@openfun/cunningham-react';
import { PropsWithChildren, useEffect } from 'react';
import { usePathname, useRouter } from 'next/navigation';
import { PropsWithChildren, useEffect, useState } from 'react';
import { Box } from '@/components';
@@ -7,12 +8,29 @@ import { useAuthStore } from './useAuthStore';
export const Auth = ({ children }: PropsWithChildren) => {
const { authenticated, initAuth } = useAuthStore();
const router = useRouter();
const [isDomainComingSoon, setIsDomainComingSoon] = useState(false);
const domainComingSoon = 'regie.numerique.gouv.fr';
const pathComingSoon = '/coming-soon';
const pathname = usePathname();
useEffect(() => {
initAuth();
}, [initAuth]);
if (window.location.origin.includes(domainComingSoon)) {
router.push(pathComingSoon);
return;
}
if (!authenticated) {
initAuth();
}, [initAuth, router]);
useEffect(() => {
setIsDomainComingSoon(
window.location.origin.includes(domainComingSoon) &&
pathname === pathComingSoon,
);
}, [pathname]);
if (!authenticated && !isDomainComingSoon) {
return (
<Box $height="100vh" $width="100vw" $align="center" $justify="center">
<Loader />
-1
View File
@@ -1,2 +1 @@
export * from './AppProvider';
export * from './MainLayout';
@@ -1,9 +1,9 @@
import { PropsWithChildren } from 'react';
import { Box } from '@/components';
import { MainLayout } from '@/core';
import { useCunninghamTheme } from '@/cunningham';
import { Panel } from '@/features/mail-domains/components/panel';
import { MainLayout } from '@/layouts';
export function MailDomainsLayout({ children }: PropsWithChildren) {
const { colorsTokens } = useCunninghamTheme();
@@ -1,9 +1,9 @@
import { PropsWithChildren } from 'react';
import { Box } from '@/components';
import { MainLayout } from '@/core';
import { useCunninghamTheme } from '@/cunningham';
import { Panel } from '@/features/teams';
import { MainLayout } from '@/layouts';
export function TeamLayout({ children }: PropsWithChildren) {
const { colorsTokens } = useCunninghamTheme();
@@ -0,0 +1,15 @@
import { PropsWithChildren } from 'react';
import { Box } from '@/components';
import { Header } from '@/features/header';
export function PageLayout({ children }: PropsWithChildren) {
return (
<Box $minHeight="100vh">
<Header />
<Box as="main" $width="100%" $css="flex-grow:1;">
{children}
</Box>
</Box>
);
}
@@ -0,0 +1,2 @@
export * from './MainLayout';
export * from './PageLayout';
+1 -1
View File
@@ -5,7 +5,7 @@ import styled from 'styled-components';
import Icon404 from '@/assets/icons/icon-404.svg';
import { Box, StyledLink, Text } from '@/components';
import { MainLayout } from '@/core';
import { MainLayout } from '@/layouts';
import { NextPageWithLayout } from '@/types/next';
const StyledButton = styled(Button)`
@@ -0,0 +1,35 @@
import { ReactElement } from 'react';
import { useTranslation } from 'react-i18next';
import Icon404 from '@/assets/icons/icon-404.svg';
import { Box, Text } from '@/components';
import { NextPageWithLayout } from '@/types/next';
const Page: NextPageWithLayout = () => {
const { t } = useTranslation();
return (
<Box $margin="auto">
<Box $align="center" $gap="3rem">
<Icon404 aria-label="Image 404" role="img" />
<Box $direction="row" $align="flex-end" $gap="1rem">
<Text
as="h1"
$margin="auto"
$direction="row"
$align="center"
$gap="1rem"
>
{t('Coming soon ...')}
</Text>
</Box>
</Box>
</Box>
);
};
Page.getLayout = function getLayout(page: ReactElement) {
return <Box $minHeight="100vh">{page}</Box>;
};
export default Page;
+1
View File
@@ -0,0 +1 @@
../../../../secrets/numerique-gouv/people/env/production/secrets.enc.yaml
@@ -0,0 +1,115 @@
image:
repository: lasuite/people-backend
pullPolicy: Always
tag: "v0.1.1-coming-soon"
backend:
migrateJobAnnotations:
argocd.argoproj.io/hook: PostSync
argocd.argoproj.io/hook-delete-policy: HookSucceeded
envVars:
DJANGO_CSRF_TRUSTED_ORIGINS: https://regie.numerique.gouv.fr
DJANGO_CONFIGURATION: Production
DJANGO_ALLOWED_HOSTS: "*"
DJANGO_SECRET_KEY:
secretKeyRef:
name: backend
key: DJANGO_SECRET_KEY
DJANGO_SETTINGS_MODULE: people.settings
DJANGO_SUPERUSER_EMAIL:
secretKeyRef:
name: backend
key: DJANGO_SUPERUSER_EMAIL
DJANGO_SUPERUSER_PASSWORD:
secretKeyRef:
name: backend
key: DJANGO_SUPERUSER_PASSWORD
DJANGO_EMAIL_HOST: "snap-mail.numerique.gouv.fr"
DJANGO_EMAIL_PORT: 465
DJANGO_EMAIL_USE_SSL: True
DJANGO_SILENCED_SYSTEM_CHECKS: security.W008,security.W004
OIDC_OP_JWKS_ENDPOINT: https://auth.agentconnect.gouv.fr/api/v2/jwks
OIDC_OP_AUTHORIZATION_ENDPOINT: https://auth.agentconnect.gouv.fr/api/v2/authorize
OIDC_OP_TOKEN_ENDPOINT: https://auth.agentconnect.gouv.fr/api/v2/token
OIDC_OP_USER_ENDPOINT: https://auth.agentconnect.gouv.fr/api/v2/userinfo
OIDC_OP_LOGOUT_ENDPOINT: https://auth.agentconnect.gouv.fr/api/v2/session/end
OIDC_RP_CLIENT_ID:
secretKeyRef:
name: backend
key: OIDC_RP_CLIENT_ID
OIDC_RP_CLIENT_SECRET:
secretKeyRef:
name: backend
key: OIDC_RP_CLIENT_SECRET
OIDC_RP_SIGN_ALGO: RS256
OIDC_RP_SCOPES: "openid email"
OIDC_REDIRECT_ALLOWED_HOSTS: https://regie.numerique.gouv.fr
OIDC_AUTH_REQUEST_EXTRA_PARAMS: "{'acr_values': 'eidas1'}"
LOGIN_REDIRECT_URL: https://regie.numerique.gouv.fr
LOGIN_REDIRECT_URL_FAILURE: https://regie.numerique.gouv.fr
LOGOUT_REDIRECT_URL: https://regie.numerique.gouv.fr
DB_HOST:
secretKeyRef:
name: postgresql.postgres.libre.sh
key: host
DB_NAME:
secretKeyRef:
name: postgresql.postgres.libre.sh
key: database
DB_USER:
secretKeyRef:
name: postgresql.postgres.libre.sh
key: username
DB_PASSWORD:
secretKeyRef:
name: postgresql.postgres.libre.sh
key: password
DB_PORT:
secretKeyRef:
name: postgresql.postgres.libre.sh
key: port
POSTGRES_USER:
secretKeyRef:
name: postgresql.postgres.libre.sh
key: username
POSTGRES_DB:
secretKeyRef:
name: postgresql.postgres.libre.sh
key: database
POSTGRES_PASSWORD:
secretKeyRef:
name: postgresql.postgres.libre.sh
key: password
REDIS_URL:
secretKeyRef:
name: redis.redis.libre.sh
key: url
createsuperuser:
command:
- "/bin/sh"
- "-c"
- python manage.py createsuperuser --email $DJANGO_SUPERUSER_EMAIL --password $DJANGO_SUPERUSER_PASSWORD
restartPolicy: Never
frontend:
image:
repository: lasuite/people-frontend
pullPolicy: Always
tag: "v0.1.1-coming-soon"
ingress:
enabled: true
host: regie.numerique.gouv.fr
className: nginx
annotations:
cert-manager.io/cluster-issuer: letsencrypt
ingressAdmin:
enabled: true
host: regie.numerique.gouv.fr
className: nginx
annotations:
cert-manager.io/cluster-issuer: letsencrypt
nginx.ingress.kubernetes.io/auth-signin: https://oauth2-proxy.beta.numerique.gouv.fr/oauth2/start
nginx.ingress.kubernetes.io/auth-url: https://oauth2-proxy.beta.numerique.gouv.fr/oauth2/auth
+5
View File
@@ -60,3 +60,8 @@ environments:
- version: 0.0.1
secrets:
- env.d/{{ .Environment.Name }}/secrets.enc.yaml
production:
values:
- version: 0.0.1
secrets:
- env.d/{{ .Environment.Name }}/secrets.enc.yaml