33800 Docs

← Retour

Fix authentificator build + notifications

Date: 17/01/2026 00:13 Status: TERMINÉ Durée: ~2h

Contexte

Les notifications ne fonctionnaient plus et le build de authentificator échouait avec une erreur 401 sur le registry npm GitLab.

Problèmes identifiés

1. Notifications (ntfy/apprise)

2. Authentificator - npm registry

3. Authentificator - TypeScript

4. Nginx

Actions réalisées

Notifications

docker start ntfy apprise
# Test: curl POST http://192.168.1.12:5300/api/notify/push → OK

Packages npm privés

  1. Publié @nowhere/ulias-lib@0.0.12 sur projet 65:

    cd /stock_8to/33800-stack/projects/ulias-lib
    npm publish --registry=https://gitlab.33800.nowhere84.com/api/v4/projects/65/packages/npm/
  2. Publié @nowhere/qwikjs-lib@0.0.43 sur projet 65:

    cd /stock_8to/33800-stack/projects/qwikjs-lib
    npm publish --registry=https://gitlab.33800.nowhere84.com/api/v4/projects/65/packages/npm/
  3. Créé Deploy Tokens pour accès lecture:

    • Projet 65 (ulias-lib): gldt-zLCUNB9thc1qvYuRvJEN
    • Projet 74 (qwikjs-lib): gldt-nyXmR6QZHjnj8A_Rd6Lp

Authentificator - Corrections code

src/routes/login/index.tsx:

// Avant (lignes 142, 148, 211, 239)
currentToken:loginAction.value?.currentToken as string

// Après
currentToken:loginAction.value?.currentToken ?? ""

src/services/db.ts:

// Avant (ligne 188)
const token = jwt.sign({ email: _email }, JwtSecret[_secret], { expiresIn: _expiresIn });

// Après
const token = jwt.sign({ email: _email }, JwtSecret[_secret], { expiresIn: _expiresIn } as jwt.SignOptions);

Authentificator - Configuration

.npmrc:

@nowhere:registry=https://gitlab.33800.nowhere84.com/api/v4/projects/65/packages/npm/
//gitlab.33800.nowhere84.com/api/v4/projects/65/packages/npm/:_authToken=${NPM_TOKEN}

Dockerfile:

FROM node:20.17.0
WORKDIR /app
ARG NPM_TOKEN
COPY . .
RUN if [ -n "$NPM_TOKEN" ]; then \
      echo "@nowhere:registry=https://gitlab.33800.nowhere84.com/api/v4/projects/65/packages/npm/" > .npmrc && \
      echo "//gitlab.33800.nowhere84.com/api/v4/projects/65/packages/npm/:_authToken=${NPM_TOKEN}" >> .npmrc; \
    fi
RUN npm install
RUN rm -f .npmrc
RUN npm run build
EXPOSE 8284
CMD ["npm", "run", "serve"]

package.json:

"@nowhere/qwikjs-lib": "^0.0.43"  // était ^0.0.25

Déploiement

# Build
docker build --build-arg NPM_TOKEN=gldt-zLCUNB9thc1qvYuRvJEN -t authentificator:test .

# Push
docker tag authentificator:test registry.33800.nowhere84.com/gouroubleu/authentificator:latest
docker push registry.33800.nowhere84.com/gouroubleu/authentificator:latest

# Deploy
cd /mnt/stock_8to/33800-stack/docker/stacks/authentificator
docker compose up -d

Nginx

# Correction backend
sed -i 's|proxy_pass http://192.168.1.51:8899;|proxy_pass http://192.168.1.12:8284;|' \
  /etc/nginx/sites-available/auth.33800.nowhere84.com.conf
nginx -t && systemctl reload nginx

Git

git add -A
git commit -m "Fix build: TypeScript errors + npm registry configuration"
git push origin main

Résultats

Élément Status
Notifications (ntfy/apprise) ✅ Fonctionnel
@nowhere/ulias-lib ✅ Publié v0.0.12
@nowhere/qwikjs-lib ✅ Publié v0.0.43
Authentificator build ✅ Réussi
Authentificator deploy ✅ Container running
URL publique https://auth.33800.nowhere84.com
CI/CD GitLab ✅ Configuré avec NPM_TOKEN

Notes techniques

npm registry GitLab - Points importants

  1. npm ne supporte qu'UN seul registry par scope (@nowhere)
  2. Les packages doivent tous être sur le même projet (65) pour le scope @nowhere
  3. CI_JOB_TOKEN fonctionne pour les pipelines CI/CD
  4. Deploy Tokens avec scope read_package_registry pour builds manuels
  5. Le package-lock.json cache les URLs résolues → supprimer si registry change

Semver pour versions 0.0.x