2024-11-17 18:07:32 +01:00
|
|
|
# This is the migration makefile.
|
|
|
|
#
|
|
|
|
# WHAT IS NEEDED FOR THE MIGRATION:
|
|
|
|
#
|
|
|
|
# - $(SQLDB): a dump of the SQL database (format: login password domain)
|
|
|
|
#
|
|
|
|
# HOW MIGRATION WORKS, STEP BY STEP (`migration` rule):
|
|
|
|
#
|
|
|
|
# 1. migration-file -> create the $(USER_DB) file
|
|
|
|
# 2. migrate-all-users -> migrate all user accounts
|
|
|
|
#
|
|
|
|
# AFTER THE `migration` RULE: go to the dnsmanagerd repository and follow instructions.
|
|
|
|
|
|
|
|
# DB from SQL, format: login password domain
|
|
|
|
SQLDB ?= /tmp/usrdb
|
|
|
|
|
|
|
|
USER_DB ?= /tmp/migration-authd-user-db.txt
|
|
|
|
|
|
|
|
$(USER_DB):
|
|
|
|
./bin/migration-filter.awk < $(SQLDB) | grep -a -v "^INVALID" | sort | uniq > $(USER_DB)
|
|
|
|
|
|
|
|
migration-file: $(USER_DB)
|
|
|
|
|
|
|
|
migrate-user:
|
2024-12-11 11:34:45 +01:00
|
|
|
./bin/authctl user migrate $(NAME) $(PASSWORD_HASH) $(LOGIN_OPT)
|
2024-11-17 18:07:32 +01:00
|
|
|
|
|
|
|
migrate-all-users:
|
2024-11-20 03:18:06 +01:00
|
|
|
@echo "Don't forget the admin login, for example: LOGIN=dnsmanager"
|
2024-12-11 11:34:45 +01:00
|
|
|
./bin/authctl migration-script $(USER_DB) $(LOGIN_OPT)
|
2024-11-17 18:07:32 +01:00
|
|
|
|
|
|
|
migration: migration-file migrate-all-users
|