@geogirafe/lib-geoportal 1.2.0-dev.2899998274 → 1.2.0-dev.2901604715
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -76,18 +76,7 @@ git clone https://gitlab.com/geogirafe/gg-viewer.git
|
|
|
76
76
|
### 2. Development Certificates
|
|
77
77
|
|
|
78
78
|
Certain features (e.g. service workers) require a valid HTTPS certificate for local development.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
⚠️ However, generating your own certificates is strongly recommended for:
|
|
82
|
-
|
|
83
|
-
- Better security and isolation between environments/developers.
|
|
84
|
-
- Avoiding reuse of shared certificates.
|
|
85
|
-
- Customizing certificate properties (hostname, expiration date, etc.).
|
|
86
|
-
|
|
87
|
-
#### 2.1. If you want to generate your own development certificates
|
|
88
|
-
|
|
89
|
-
Requirements: docker installed.
|
|
90
|
-
Run:
|
|
79
|
+
You can generate your own development certificates with:
|
|
91
80
|
|
|
92
81
|
##### On Linux
|
|
93
82
|
|
|
@@ -103,15 +92,6 @@ npm run generate-dev-certs-nix
|
|
|
103
92
|
npm run generate-dev-certs-win
|
|
104
93
|
```
|
|
105
94
|
|
|
106
|
-
#### 2.2. If you did not generate your own certificates (Windows only)
|
|
107
|
-
|
|
108
|
-
If you skipped the generation step on Windows, you must trust the pre-generated certificates so they work for features like service workers.
|
|
109
|
-
Run:
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
npm run trust-default-dev-certs-win
|
|
113
|
-
```
|
|
114
|
-
|
|
115
95
|
### 3. Build and start GeoGirafe
|
|
116
96
|
|
|
117
97
|
```bash
|
|
@@ -2,13 +2,6 @@
|
|
|
2
2
|
@echo off
|
|
3
3
|
setlocal
|
|
4
4
|
|
|
5
|
-
REM Ensure that Docker est installed
|
|
6
|
-
where docker >nul 2>&1
|
|
7
|
-
IF %ERRORLEVEL% NEQ 0 (
|
|
8
|
-
echo Docker not found. Please install it first [https://www.docker.com/products/docker-desktop]
|
|
9
|
-
exit /b 1
|
|
10
|
-
)
|
|
11
|
-
|
|
12
5
|
REM Where to generate the certificates
|
|
13
6
|
IF "%~1"=="" (
|
|
14
7
|
set "TARGET_DIR=buildtools\certs"
|
|
@@ -21,8 +14,8 @@ if not exist "%TARGET_DIR%" mkdir "%TARGET_DIR%"
|
|
|
21
14
|
pushd "%TARGET_DIR%"
|
|
22
15
|
|
|
23
16
|
REM Generate certificates
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
CALL npx -y mkcert create-ca --organization GeoGirafe --key rootCA-key.pem --cert rootCA.pem
|
|
18
|
+
CALL npx -y mkcert create-cert --ca-key rootCA-key.pem --ca-cert rootCA.pem --key app.localhost.key.pem --cert app.localhost.cert.pem --domains app.localhost localhost 127.0.0.1
|
|
26
19
|
echo Certificate was created successfully.
|
|
27
20
|
|
|
28
21
|
REM Add root certificate to trusted store (for the current user)
|
|
@@ -1,65 +1,32 @@
|
|
|
1
1
|
# SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
set +x
|
|
3
|
-
|
|
4
3
|
YELLOW='\033[1;33m'
|
|
5
4
|
NC='\033[0m'
|
|
6
5
|
|
|
7
|
-
#
|
|
8
|
-
|
|
9
|
-
echo "openssl not found. Please install it first (e.g. 'sudo apt install openssl' on Ubuntu)"
|
|
10
|
-
exit 1
|
|
11
|
-
fi
|
|
12
|
-
|
|
13
|
-
# Ask for sudo rights, it will be needed to trust the certificate
|
|
14
|
-
sudo -v
|
|
6
|
+
# Where to generate the certificates
|
|
7
|
+
TARGET_DIR="${1:-buildtools/certs}"
|
|
15
8
|
|
|
16
9
|
# Create directories
|
|
17
|
-
TARGET_DIR="${1:-buildtools/certs}"
|
|
18
10
|
mkdir -p "$TARGET_DIR"
|
|
19
11
|
cd "$TARGET_DIR"
|
|
20
12
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
# Generate a local root CA (self-signed), reused across runs if it already exists
|
|
27
|
-
if [ ! -f rootCA.pem ] || [ ! -f rootCA-key.pem ]; then
|
|
28
|
-
openssl genrsa -out rootCA-key.pem 4096 2> /dev/null
|
|
29
|
-
openssl req -x509 -new -nodes -key rootCA-key.pem -sha256 -days 3650 \
|
|
30
|
-
-subj "/O=GeoGirafe Development CA/CN=GeoGirafe Local Dev Root CA" \
|
|
31
|
-
-addext "basicConstraints=critical,CA:TRUE" \
|
|
32
|
-
-addext "keyUsage=critical,keyCertSign,cRLSign" \
|
|
33
|
-
-out rootCA.pem
|
|
34
|
-
fi
|
|
35
|
-
|
|
36
|
-
# Build the Subject Alternative Name list for the leaf (server) certificate
|
|
37
|
-
SAN=$(echo "$DOMAINS" | tr ',' '\n' | sed 's/^/DNS:/' | paste -sd,)
|
|
38
|
-
SAN="$SAN,$(echo "$IPS" | tr ',' '\n' | sed 's/^/IP:/' | paste -sd,)"
|
|
39
|
-
|
|
40
|
-
# Generate the leaf certificate for the dev server, signed by the local root CA
|
|
41
|
-
openssl genrsa -out app.localhost.key.pem 2048 2> /dev/null
|
|
42
|
-
openssl req -new -key app.localhost.key.pem \
|
|
43
|
-
-subj "/CN=app.localhost" \
|
|
44
|
-
-out app.localhost.csr.pem
|
|
45
|
-
|
|
46
|
-
openssl x509 -req -in app.localhost.csr.pem \
|
|
47
|
-
-CA rootCA.pem -CAkey rootCA-key.pem -CAcreateserial \
|
|
48
|
-
-days 825 -sha256 \
|
|
49
|
-
-extfile <(printf "subjectAltName=%s\nextendedKeyUsage=serverAuth" "$SAN") \
|
|
50
|
-
-out app.localhost.cert.pem
|
|
51
|
-
|
|
52
|
-
rm -f app.localhost.csr.pem
|
|
53
|
-
|
|
54
|
-
sudo chmod a+r app.localhost.* rootCA.pem
|
|
13
|
+
# Generate certificates
|
|
14
|
+
npx -y mkcert create-ca --organization GeoGirafe --key rootCA-key.pem --cert rootCA.pem
|
|
15
|
+
npx -y mkcert create-cert --ca-key rootCA-key.pem --ca-cert rootCA.pem --key app.localhost.key.pem --cert app.localhost.cert.pem --domains app.localhost localhost 127.0.0.1
|
|
16
|
+
chmod a+r app.localhost.* rootCA.pem
|
|
17
|
+
echo Certificate was created successfully.
|
|
55
18
|
|
|
19
|
+
# NOTE : THIS NEED SUDO!
|
|
20
|
+
# DO WE REALLY WANT TO TRUST THE CERTS AT THE SYSTEM LEVEL DURING A DEFAULT INSTALLATION ?
|
|
21
|
+
# ==> Deactivate for the moment.
|
|
56
22
|
# Add root certificate to system trusted store
|
|
57
|
-
echo Trusting development certificates at the system level
|
|
58
|
-
sudo cp rootCA.pem /usr/local/share/ca-certificates/geogirafe-dev.crt
|
|
59
|
-
sudo update-ca-certificates
|
|
23
|
+
# echo Trusting development certificates at the system level
|
|
24
|
+
# sudo cp rootCA.pem /usr/local/share/ca-certificates/geogirafe-dev.crt
|
|
25
|
+
# sudo update-ca-certificates
|
|
60
26
|
|
|
61
|
-
#
|
|
62
|
-
#
|
|
27
|
+
# Trust root certificate in Firefox/Chrome user stores (NSS).
|
|
28
|
+
# No root rights needed.
|
|
29
|
+
# Importing into it requires certutil, which is optional: if it isn't installed
|
|
63
30
|
# we just skip this step and let the user trust the certificate manually in their browser.
|
|
64
31
|
if command -v certutil &> /dev/null; then
|
|
65
32
|
echo Trusting development certificates in Chrome
|
|
@@ -70,11 +37,10 @@ if command -v certutil &> /dev/null; then
|
|
|
70
37
|
if [ -n "$FIREFOX_PROFILE" ]; then
|
|
71
38
|
certutil -d sql:$HOME/.mozilla/firefox/$FIREFOX_PROFILE -A -t "C,,C" -n "GeoGirafe LocalDevCert" -i rootCA.pem
|
|
72
39
|
fi
|
|
40
|
+
echo Certificate was added successfully.
|
|
41
|
+
echo Please restart your browser to take it into account.
|
|
73
42
|
else
|
|
74
|
-
echo -e "${YELLOW}certutil not found (
|
|
75
|
-
echo -e "${YELLOW}Skipping automatic trust in Firefox/Chrome's
|
|
43
|
+
echo -e "${YELLOW}certutil not found (part of the libnss3-tools package on Ubuntu/Debian).${NC}"
|
|
44
|
+
echo -e "${YELLOW}Skipping automatic trust in Firefox/Chrome's certificate store.${NC}"
|
|
76
45
|
echo -e "${YELLOW}Install libnss3-tools and re-run this script, or manually import $TARGET_DIR/rootCA.pem as a trusted authority in your browser settings.${NC}"
|
|
77
46
|
fi
|
|
78
|
-
|
|
79
|
-
echo Certificate was added successfully.
|
|
80
|
-
echo Please restart your browser to take it into account.
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "GeoGirafe PSC",
|
|
6
6
|
"url": "https://doc.geogirafe.org"
|
|
7
7
|
},
|
|
8
|
-
"version": "1.2.0-dev.
|
|
8
|
+
"version": "1.2.0-dev.2901604715",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"engines": {
|
|
11
11
|
"node": ">=20.19.0"
|
|
@@ -175,15 +175,13 @@
|
|
|
175
175
|
"prepare-commit": "npm run pretty && npm run tsc && npm run lint && npm run test && npm run build && npm run build-lib",
|
|
176
176
|
"generate-dev-certs-win": "buildtools\\generate-dev-certs.cmd",
|
|
177
177
|
"generate-dev-certs-nix": "bash -C './buildtools/generate-dev-certs.sh'",
|
|
178
|
-
"trust-default-dev-certs-win": "buildtools\\trust-dev-certs.cmd",
|
|
179
178
|
"size-analysis": "node buildtools/app-clean.js && cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build --mode analyze",
|
|
180
179
|
"create-component": "tsx buildtools/create-component.ts"
|
|
181
180
|
},
|
|
182
181
|
"allowScripts": {
|
|
183
|
-
"@swc/core
|
|
184
|
-
"esbuild
|
|
185
|
-
"
|
|
186
|
-
"
|
|
187
|
-
"protobufjs@8.0.1": true
|
|
182
|
+
"@swc/core": true,
|
|
183
|
+
"esbuild": true,
|
|
184
|
+
"odiff-bin": true,
|
|
185
|
+
"protobufjs": true
|
|
188
186
|
}
|
|
189
187
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.2.0-dev.
|
|
1
|
+
{"version":"1.2.0-dev.2901604715", "build":"2901604715", "date":"01/10/2026"}
|