Skip to content

Commit

Permalink
refactor: new major version (#77)
Browse files Browse the repository at this point in the history
* chore: deactivate quality checks for refactor branch

* chore: remove deprecated doc

* chore: move stuff into api directory

* chore: upgrade node version and docker/github build

* chore: work on dev env

* chore: move ui source code into vite app

* chore: move stuff around in api folder

* chore: work on api types

* chore: some setup for api

* chore: apply linter fix

* refactor: work on tokens and keys management

* refactor: work on storages manager

* refactor: work on storages manager

* refactor: move routers into topical folders

* refactor: fix some imports

* refactor: use reqUser accessor

* refactor: replace shortid with nanoid

* refactor: broken import to events log

* refactor: fix some imports

* refactor: replace all commonjs exports with esm

* refactor: work on password and keys management

* refactor: work on i18n

* refactor: work on 2fa and sites management

* refactor: typed anonymous actions router

* refactor: worked on avatars management

* refactor: work on invitations and mongo storage typing

* refactor: work on invitations and tokens

* refactor: types for mails utils

* refactor: types for oauth tokens utils

* refactor: work on ontypes of organizations router

* refactor: oauth typing

* refactor: types for saml2 utils

* refactor: use mongoPagination and mongoSort utils

* refactor: types of webhooks utils

* refactor: types of limiter utils

* refactor: better orgStorage management

* refactor: sites routes typing

* refactor: types of limits router

* refactor: some more typings and structuring

* refactor: some more restructurung

* refactor: some more restructuring

* refactor: typing of users router

* refactor: work on typing of auth routes

* refactor: auth router typing

* refactor: typings ofr storages

* refactor: organize imports

* refactor: dynamic import of validation functions

* refactor: work on express initialization

* refactor: some more work on api app

* refactor: work on express app init

* chore: move deprecated tests

* refactor: work on tests

* refactor: work on tests

* refactor: work on tests

* refactor: work on ldap tests

* refactor: work on ldap tests

* refactor: work on user creation

* refactor: work on ldap tests

* refactor: work on tests

* refactor: work on tests

* refactor: test suite passes

* test: add a simple oidc workflow test

* refactor: work on testing sign keys rotation

* chore: apply linter

* fix: some typing problems

* test: add a test of core id oauth tokens refresh

* refactor: start working on ui

* refactor: work on ui

* refactor: ui home page is ok

* refactor: work on login page

* refactor: work on vuetify theme init

* refactor: work on vue 3 migration

* refactor: work on colors management

* refactor: keep working on vue 3 ui

* refactor: more components and pages moved to vue 3

* refactor: more components and pages moved to vue 3

* feat: work on color management

* fix: small bugs in ui code

* feat: work on auth providers links

* fix: broken avatar creation

* refactor: small changes in ui code

* refactor: use of VForm

* chore: upgrade linter

* refactor: work on vue 3 ui

* refactor: work on vue 3 ui

* refactor: download webfont

* refactor: use a separate exchange token

* refactor: fix broken tests

* feat: work on sites separated by path

* feat: sessions management UI

* feat: work on sessions management

* fix: broken session deletion

* refactor: work on error management in login page

* chore: composable is now named useAsyncAction

* chore: upgrage node image

* chore: linter errors

* fix: page file names

* refactor: work on some regressions

* refactor: some more work on vue 3 ui

* refactor: work on sites management

* refactor: a few changes to site management

* chore: linter errors

* refactor: make all quality checks pass

* chore: reactivate husky checks

* fix: broken docker build

* feat: manage default webfont

* fix: format of CLEANUP_DELETE_INACTIVE_DELAY env vatr

* fix: manage retro-compatibility with STORAGE_MONGO_URL and STORAGE_MONGO_CLIENT_OPTIONS

* fix: broken creation of saml certificate

* fix: broken creation of saml certificate

* fix: missing user.isAdmin after calling getUser from storage

* fix: small UI problem when using 2FA

* fix: constraint on logo size in login page

* fix: getting org info from all accounts

* feat: work on auth from one site to another

* feat: keep working on other site redirect

* fix: reference error in UI code

* fix: error in url path

* chore: better delayed rendering

* fix: manage retro-compat with old volume directories

* chore: upgrade lib-express

* fix: always expose sites express router

* chore: slightly better cookies options

* fix: broken definition of secure cookie

* fix: typo in route path

* fix: broken error display

* fix: typo in route path

* fix: some problems in admin vue of organization

* fix: some problems in config stucture

* fix: mussing get on user limits

* fix: color typing error

* fix: list of oauth standard providers was not filtered

* fix: bug fix in data-fair lib

* fix: small ui problems

* chore: broken tests

* fix: broken links

* fix: missing i18n messages in UI

* chore: style of links

* fix: some regressions in departments and members management

* fix: some regression in partners management

* fix: some problems with avatar rendering

* fix: prevent accumulating sessions

* fix: some UI problems

* fix: error in env var name

* fix: broken org select in me page

* fix: broken edition of birthday

* feat: try to get old saml certificates

* feat: onlyCreateInvited option is not applied on coreIdProviders

* fix: comparison of coreId auth provider

* fix: comparison of coreId auth provider

* fix: broken pagination in admin pages

* fix: refresh after user deletion

* chore: use events and d-frame instead of v-iframe and notify

* chore: add debug

* fix: missing application of manageSessions env var

* chore: add debug logs

* fix: prevent mutating sessions array

* fix: all properties in patch body are nullable

* fix: error in passwordless schema

* fix: error in change host api request

* fix: broken patch of member

* feat: work on multi-site management

* fix: 2FA info of orga is not required

* fix: build error

* feat: work on sites and colors management

* feat: show site color warnings

* feat: work on themes management

* feat: work on theme management

* chore: upgrade vuetify

* fix: prevent unnecessary scroll on tab change

* fix: missing init of hcDark when creating a site

* fix: missing upgrade directory

* fix: missing stuff in upgrade script

* feat: work on colors preview

* perf: faster update of colors in colors preview

* feat: work on themes edition

* chore: small improvements in site edit

* fix: broken docker build

* fix: wrong theme returned in _public endpoint

* fix: wrong theme returned in _public endpoint

* feat: work on assisted theme edition

* fix: missing tinycolor2 in ui

* chore: work on cross workspaces references

* fix: error in _theme.css

* chore: upgrade vjsf

* refactor: work on events queue integration

* chore: debug events queue init

* fix: export of events queue util

* fix: broken __all method in i18n utils

* chore: upgrade lib-node

* fix: prevent flicking effect by waiting for router readiness before mounting

* feat: improve users and orgs search fields

* chore: use white background for older portals

* fix: broken asAdmin mode with server session storage

* feat: work on retro-compatibility of post site endpoint

* chore: add debug logs

* fix: small problem with theme filling

* chore: show site info on top of edit page

* fix: small retro-compatiibility bug in itentities webhook

* chore: add transparent background rule in print mode

* fix: missing authOnlyOtherSite in sitePublic info

* fix: broken double redirect on sso config

* chore: add debug logs

* fix: add filter on sites suggested for auth on onlyOtherSite mode

* fix: missing patchable properties for admins

* fix: type of user.2FA

* fix: margin problem in 2fa config

* fix: broken partner invitation

* fix: updat lib-vue

* fix: department admin should be able to read org limits

* fix: broken switch to newly created orga after invitation

* fix: broken redirect after org creation

* feat: add link to org page from sites list

* fix: broken select of redirect site when inviting member

* fix: missing theme env vars

* chore: disable alternative themes by default

* chore: add debug logs

* chore: add debug logs

* fix: closing menu too early

* chore: remove debug watcher

* feat: accept tokens signed by a key before the introduction of the exchange token

* fix: broken signature keys rotation

* fix: prevent error when updating session lst logged date

* chore: add debug logs

* fix: some problems when reusing deprecated secrets

* chore: add some TODOs

* chore: apply last version number
  • Loading branch information
albanm authored Jan 22, 2025
1 parent 1e484bc commit fba28b3
Show file tree
Hide file tree
Showing 413 changed files with 25,629 additions and 39,672 deletions.
10 changes: 2 additions & 8 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
/node_modules
/.nyc_output
/coverage
/.nuxt
/security
/data
/nuxt-dist
node_modules
/dev/data
/dist
/.git
config/local*
/types/node_modules
7 changes: 0 additions & 7 deletions .eslintignore

This file was deleted.

23 changes: 23 additions & 0 deletions .github/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# configure github generated release notes
# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuring-automatically-generated-release-notes
# uses labels that can be affected implicitly based on PR titles, see workflow/conventional-label.yaml

changelog:
exclude:
labels:
- ignore-for-release
authors:
- octocat
categories:
- title: Breaking Changes 🛠
labels:
- breaking
- title: New Features 🎉
labels:
- feature
- title: Fixes 🔧
labels:
- fix
- title: Other Changes
labels:
- "*"
76 changes: 0 additions & 76 deletions .github/workflows/build.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# no need to run quality checks on every small commit, husky already did it on the dev computer
# in this case we simply build the docker image

name: Build simple commit

on:
push:
branches: ['*']
tags-ignore: [ 'v*.*.*' ]

jobs:
build:
uses: ./.github/workflows/reuse-build.yml

deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Send Keel notifications to staging-koumoul.com
run: |
curl -s --fail --show-error -X POST https://keel.admin.staging-koumoul.com/v1/webhooks/native -u ${{ secrets.KEEL_STAGING_USER }}:${{ secrets.KEEL_STAGING_PASSWORD }} -d '{"name": "ghcr.io/${{ github.repository }}", "tag": "${{ github.ref_name }}"}'
12 changes: 12 additions & 0 deletions .github/workflows/conventional-label.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# automatic labelling of pull request based on conventional commit names in the PR titles
# see https://github.com/marketplace/actions/conventional-release-labels

on:
pull_request_target:
types: [ opened, edited ]
name: conventional-release-labels
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: bcoe/conventional-release-labels@v1
9 changes: 9 additions & 0 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# for pull requests we do not build a docker image, we simply run quality checks

name: Check pull requests

on: pull_request

jobs:
quality:
uses: ./.github/workflows/reuse-quality.yml
27 changes: 27 additions & 0 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# for releases we run in sequence the qualityt checks and the build

name: Build release

on:
push:
tags: [ 'v*.*.*' ]

jobs:
quality:
uses: ./.github/workflows/reuse-quality.yml

build:
needs: quality
uses: ./.github/workflows/reuse-build.yml

deploy:
needs: build
runs-on: ubuntu-latest
steps:
- id: get_version
uses: battila7/get-version-action@v2

- name: Send Keel notifications to koumoul.com
run: |
curl -s --fail --show-error -X POST https://keel.admin.koumoul.com/v1/webhooks/native -u ${{ secrets.KEEL_PROD_USER }}:${{ secrets.KEEL_PROD_PASSWORD }} -d '{"name": "ghcr.io/${{ github.repository }}", "tag": "${{ steps.get_version.outputs.major }}"}'
51 changes: 51 additions & 0 deletions .github/workflows/reuse-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build

on:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout git repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Github container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Prepare BUILD.json
run: |
echo '{"version": "${{github.ref_name}}", "repository": "${{github.server_url}}/${{github.repository}}", "commit": "${{github.sha}}"}' > BUILD.json
cat BUILD.json
- name: Prepare docker tags for main image
id: docker_meta_main
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and push main image
id: docker_build_main
uses: docker/build-push-action@v5
with:
context: .
push: true
target: main
tags: ${{ steps.docker_meta_main.outputs.tags }}
platforms: linux/amd64
labels: ${{ steps.docker_meta_main.outputs.labels }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/buildcache
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}/buildcache,mode=max
22 changes: 22 additions & 0 deletions .github/workflows/reuse-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Quality checks

on:
workflow_call:

jobs:
quality:
runs-on: ubuntu-latest
steps:
- name: Checkout git repository
uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
node-version: 22
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run quality checks
run: npm run quality
20 changes: 4 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
/node_modules
/.nyc_output
/coverage
/.nuxt
/doc-dist
/public/pages/doc
/security
*.swp
/nuxt-dist
/dist
config/local*
.idea
/data
/tmp
.type

public/assets/css/
public/assets/fonts/
node_modules
dev/data
*.tsbuildinfo
3 changes: 0 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install commitlint --edit ""
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint
7 changes: 1 addition & 6 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run test-deps
npm run build-types
npm run test
npm run quality
17 changes: 9 additions & 8 deletions .zellij.kdl
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,26 @@ layout {
split_direction "vertical"
pane name="simple-directory" borderless=true {
command "bash"
args "-ic" "nvm use && bash"
args "-ic" "nvm use > /dev/null 2>&1 && bash"
}
pane name="deps" {
command "bash"
args "-ic" "dc --profile dev up"
args "-ic" "npm run dev-deps && watch -n 4 \"docker compose ps --all --format 'table {{.Name}}\t{{.Status}}'\""
}
}
pane {
split_direction "vertical"
pane name="client" {
pane name="ui" {
command "bash"
args "-ic" "nvm use && npm run dev-client"
args "-ic" "nvm use > /dev/null 2>&1 && npm -w ui run dev"
}
pane name="server" {
pane name="api" {
command "bash"
args "-ic" "nvm use && npm run dev-server"
args "-ic" "nvm use > /dev/null 2>&1 && npm -w api run dev"
}
}
pane size=2 borderless=true {
plugin location="zellij:status-bar"
pane size=1 borderless=true {
command "bash"
args "-ic" "echo -n -e \"Dev server available at \\e[1;96mhttp://localhost:5689\\033[0m\""
}
}
10 changes: 2 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,14 @@ curl -H "Content-Type: application/json" -XPOST "http://localhost:5689/simple-di
curl -H "Content-Type: application/json" -XPOST "http://localhost:5689/simple-directory/api/sites?key=secret-sites" -d '
{"_id":"devsite2","owner":{"type":"organization","id":"admins-org","name":"Admins organization"},"host":"localhost:5999","theme":{"primaryColor":"#FF4D40"}}'

Test built nuxt distributable in dev:

# first set noUI to false in config/development.js
NODE_ENV=development npm run build
npm run dev-server

## Docker image

Test building the docker image:

```
docker compose stop
npm run test-deps
docker build --progress=plain --network=host -t sd-dev .
docker build --progress=plain -t sd-dev .
// don't expect the following line to work fully, it will be missing service dependencies, etc.
docker run --network=host --env PORT=8081 sd-dev
```
Expand Down Expand Up @@ -95,5 +89,5 @@ Add a test user:

```
apt-get install ldap-utils
ldapadd -x -W -D "cn=admin,dc=example,dc=org" -f test/resources/ldap-user.ldif
ldapadd -x -W -D "cn=admin,dc=example,dc=org" -f dev/resources/ldap-user.ldif
```
Loading

0 comments on commit fba28b3

Please sign in to comment.