umami
umami copied to clipboard
Script for adding users
Hey,
to automatically create the first user (or even more) via environment variables (e.g. Docker), it would be good if there was a corresponding script. Currently, the default user is in the SQL file.
The following parameters would be good:
- username
- Password
- optional: admin
Are there any plans for this?
Tobias
Is there a reason you're not doing it through the UI interface? Otherwise your options are,
- Use admin UI
- Manually insert into the database
- Run a script
For 3 we would have to create a new script. There is already a script for changing passwords so it should be doable.
how does the changing passwords run?
not shown here
npm run-script
Lifecycle scripts included in umami:
start
next start
available via `npm run-script`:
dev
next dev
build
npm-run-all build-tracker build-lang build-geo build-db build-app
start-env
node -r dotenv/config scripts/start-env.js
build-app
next build
build-tracker
rollup -c rollup.tracker.config.js
build-db
npm-run-all copy-db-schema build-db-client
build-lang
npm-run-all format-lang compile-lang
build-geo
node scripts/build-geo.js
build-db-schema
dotenv prisma introspect
build-db-client
dotenv prisma generate
build-mysql-schema
dotenv prisma introspect -- --schema=./prisma/schema.mysql.prisma
build-mysql-client
dotenv prisma generate -- --schema=./prisma/schema.mysql.prisma
build-postgresql-schema
dotenv prisma introspect -- --schema=./prisma/schema.postgresql.prisma
build-postgresql-client
dotenv prisma generate -- --schema=./prisma/schema.postgresql.prisma
copy-db-schema
node scripts/copy-db-schema.js
generate-lang
npm-run-all extract-lang merge-lang
extract-lang
formatjs extract '{pages,components}/**/*.js' --out-file build/messages.json
merge-lang
node scripts/merge-lang.js
format-lang
node scripts/format-lang.js
compile-lang
formatjs compile-folder --ast build public/lang
check-lang
node scripts/check-lang.js
download-country-names
node scripts/download-country-names.js
loadtest
node scripts/loadtest.js
loadtest:medium
node scripts/loadtest.js --weight=medium
loadtest:heavy
node scripts/loadtest.js --weight=heavy --verbose
@rosscdh node scripts/change-password.js