Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,28 @@ NEXT_PUBLIC_API_REQUEST_TIMEOUT=10000

# The URL of the CAS service. It's the URL the user will be redirected to after the CAS connection.
NEXT_PUBLIC_CAS_SERVICE=https://etu.utt.fr/dummyurl

# The application id of the website of EtuUTT
NEXT_PUBLIC_ETUUTT_WEB_APPLICATION_ID=

# The number of seconds that the authorization token will be available
NEXT_PUBLIC_AUTHORIZATION_TOKEN_EXPIRES_IN=3600*24*30

# Asso infos
NEXT_PUBLIC_ASSOCIATION_NAME=
NEXT_PUBLIC_ASSOCIATION_RNA=
NEXT_PUBLIC_ASSOCIATION_RCS=
NEXT_PUBLIC_ASSOCIATION_ADDRESS=
NEXT_PUBLIC_ASSOCIATION_PHONE=
NEXT_PUBLIC_ASSOCIATION_EMAIL

# Data Protection Officer
NEXT_PUBLIC_DPO_EMAIL=
NEXT_PUBLIC_DPO_NAME=

# Publication director
NEXT_PUBLIC_PUBLICATION_DIRECTOR=

# Legals updates
NEXT_PUBLIC_LAST_TERMS_UPDATE='02/04/2024'
NEXT_PUBLIC_LAST_PRIVACY_POLICY_UPDATE='02/04/2024'
83 changes: 83 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: CI
on:
push:
branches: [master, dev]
pull_request:
branches: [master, dev]

jobs:
lint:
runs-on: self-hosted
strategy:
matrix:
node-version: [18]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v4
with:
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm lint

deploy-dev:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
if: ${{ github.event_name != 'pull_request' && (github.ref == 'refs/heads/dev') }}
runs-on: self-hosted
needs:
- lint
steps:
- uses: actions/checkout@v4
- name: Install docker
uses: docker/setup-buildx-action@v3
- name: Login to registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- run: cp .env.dist .env.prod
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
build-args: |
NODE_ENV=production
NEXT_PUBLIC_API_URL=https://etu.dev.uttnetgroup.fr/api
NEXT_PUBLIC_CAS_SERVICE_URL=https://etu.utt.fr/login
NEXT_PUBLIC_API_VERSION=v1
NEXT_PUBLIC_API_REQUEST_TIMEOUT=5000
tags: |
${{ secrets.REGISTRY_URL }}/etuutt/front:dev

deploy-prod:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
if: ${{ github.event_name != 'pull_request' && (github.ref == 'refs/heads/master') }}
runs-on: self-hosted
needs:
- lint
steps:
- uses: actions/checkout@v4
- name: Install docker
uses: docker/setup-buildx-action@v3
- name: Login to registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- run: cp .env.dist .env.prod
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
build-args: |
NODE_ENV=production
NEXT_PUBLIC_API_URL=https://etu.utt.fr/api
NEXT_PUBLIC_CAS_SERVICE_URL=https://etu.utt.fr/login
NEXT_PUBLIC_API_VERSION=v1
NEXT_PUBLIC_API_REQUEST_TIMEOUT=5000
tags: |
${{ secrets.REGISTRY_URL }}/etuutt/front:prod

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.next/
.vscode/
node_modules/

next-env.d.ts
Expand Down
16 changes: 15 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
ARG NODE_VERSION=19-alpine
ARG NODE_VERSION=22-alpine

FROM node:${NODE_VERSION}

ARG NODE_ENV=production
ARG NEXT_PUBLIC_API_URL=http://localhost:3000
ARG NEXT_PUBLIC_CAS_SERVICE_URL=http://localhost:3000
ARG NEXT_PUBLIC_API_VERSION=v1
ARG NEXT_PUBLIC_API_REQUEST_TIMEOUT=10000

ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
ENV NEXT_PUBLIC_CAS_SERVICE_URL=${NEXT_PUBLIC_CAS_SERVICE_URL}
ENV NEXT_PUBLIC_API_VERSION=${NEXT_PUBLIC_API_VERSION}
ENV NEXT_PUBLIC_API_REQUEST_TIMEOUT=${NEXT_PUBLIC_API_REQUEST_TIMEOUT}

WORKDIR /usr/src/app

# Add alpine dependencies for 'sharp'
RUN apk add --upgrade --no-cache vips-dev build-base

COPY --chown=node:node package.json pnpm-lock.yaml ./

RUN npm i -g pnpm && pnpm install --frozen-lockfile --prod=false
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"i18next-resources-to-backend": "^1.2.1",
"modern-normalize": "^2.0.0",
"next": "^14.1.4",
"next-client-cookies": "^1.1.1",
"react": "^18.3.1",
"react-i18next": "^14.1.2",
"react-redux": "^9.1.0",
"react-toastify": "^10.0.6",
"redux": "^5.0.1",
"redux-logger": "^3.0.6",
"redux-thunk": "^3.1.0",
Expand All @@ -47,5 +47,10 @@
"eslint-plugin-react": "^7.34.2",
"sass": "^1.77.4",
"typescript": "^5.4.5"
},
"pnpm": {
"onlyBuiltDependencies": [
"sharp"
]
}
}
56 changes: 28 additions & 28 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 10 additions & 14 deletions public/locales/fr/common.json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,20 @@
// }

export default {
"navbar.title": "TODO : JE SAIS PAS CE QU'IL FAUT METTRE LA :)",
"navbar.profile": "Mon profil",
"navbar.home": "Accueil",
"navbar.uesBrowser": "Guide des UEs",
"navbar.userBrowser": "Trombinoscope",
"filter.all": "Tous",
"filter.filters": "Filtres",
"input.editableText.modify": "Modifier",
"loading": "Chargement",
"navbar.addWidget": "Ajouter",
"navbar.associations": "Associations",
"navbar.home": "Accueil",
"navbar.myAssociations": "Mes Assos",
"navbar.myTimetable": "Mon EdT",
"navbar.myUEs": "Mes matières",
"input.editableText.modify": "Modifier",
"navbar.profile": "Mon profil",
"navbar.uesBrowser": "Guide des UEs",
"navbar.userBrowser": "Trombinoscope",
"or": "Ou",
"loading": "Chargement",
"filter.all": "Tous",
"filters": "Filtres",
"results": "résultats",
"cookie.message": "Notre site permet de stocker vos préférences de navigation à l'aide de traceurs (LocalStorage).<br/>Vous avez le choix entre refuser tous ces traceurs, tous les accepter, ou personnaliser votre choix.",
"cookie.learnMore": "En savoir plus",
"cookie.authorize": "Tout autoriser",
"cookie.refuse": "Tout refuser",
"cookie.personalize": "Personnaliser",
"404": "404 - Page not found",
} as const;
12 changes: 0 additions & 12 deletions public/locales/fr/cookies.json.ts

This file was deleted.

Loading
Loading