@xeplr/cli 0.1.1 → 0.1.2
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
|
@@ -32,6 +32,25 @@ Already working, with nothing to wire up:
|
|
|
32
32
|
|
|
33
33
|
- **Node.js** 18 or later
|
|
34
34
|
- **PostgreSQL**, running, with a user allowed to create databases
|
|
35
|
+
- **Redis**, running — sign-in sessions are kept there
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# macOS
|
|
39
|
+
brew services start redis
|
|
40
|
+
|
|
41
|
+
# Linux
|
|
42
|
+
sudo systemctl start redis
|
|
43
|
+
|
|
44
|
+
# Windows — Redis has no native build, so Docker or WSL
|
|
45
|
+
docker run -d -p 6379:6379 redis
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Without Redis, login appears to work and then every request is refused as
|
|
49
|
+
"Invalid or expired token". The sign-in service checks for it at startup and
|
|
50
|
+
refuses to start rather than let you meet that message.
|
|
51
|
+
|
|
52
|
+
Works on macOS, Linux and Windows. Nothing it generates depends on a unix
|
|
53
|
+
shell.
|
|
35
54
|
|
|
36
55
|
## Then
|
|
37
56
|
|
package/lib/generate/index.js
CHANGED
|
@@ -136,7 +136,14 @@ function generate(answers, target) {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
// bin/www is executed directly, so it has to keep the bit that says so.
|
|
139
|
-
|
|
139
|
+
//
|
|
140
|
+
// Wrapped because this is a unix idea. Windows has no executable bit —
|
|
141
|
+
// chmod there only touches the read-only flag — and a filesystem that
|
|
142
|
+
// refuses it entirely must not take the whole generation down over a
|
|
143
|
+
// permission that platform does not use.
|
|
144
|
+
if (outName === 'www') {
|
|
145
|
+
try { fs.chmodSync(dest, 0o755); } catch (err) { /* not a unix filesystem */ }
|
|
146
|
+
}
|
|
140
147
|
|
|
141
148
|
written.push(path.join(dir, outName));
|
|
142
149
|
});
|
package/package.json
CHANGED
|
@@ -24,6 +24,11 @@ DB_API=__NAME___api
|
|
|
24
24
|
AUTH_DB_NAME=__NAME___auth
|
|
25
25
|
|
|
26
26
|
# ── Sign-in service ──
|
|
27
|
+
#
|
|
28
|
+
# Sessions are kept in REDIS, which must be running. Defaults to
|
|
29
|
+
# localhost:6379; set REDIS_HOST / REDIS_PORT to point elsewhere. Without it
|
|
30
|
+
# the service refuses to start and says so — rather than letting every login
|
|
31
|
+
# succeed and every request afterwards fail as "Invalid or expired token".
|
|
27
32
|
AUTH_PORT=__AUTH_PORT__
|
|
28
33
|
AUTH_JWT_SECRET=__JWT_SECRET__
|
|
29
34
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"migrate:auth": "dotenv -e development.env -- xeplr-auth-migrate up --connection-env AUTH_DB_CONNECTION_INFO_ENCRYPTED",
|
|
15
15
|
"migrate:up": "dotenv -e development.env -- xeplr-migrate up --dir ./migrations --connectionName api --connection-env __PREFIX___CONNECTION",
|
|
16
16
|
"start-auth": "dotenv -e ./development.env -- xeplr-auth-server",
|
|
17
|
-
"start-api": "
|
|
17
|
+
"start-api": "node ./bin/www"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@xeplr/auth": "^1.1.0",
|