Dan Anglin
c9aad82027
This commit implements different installation paths when running the pleroma-main role, depending on whether Pleroma needs to be installed for the first time or upgraded. For first time installations the playbook will run through the normal download and installation process and also executes the database migration. If Pleroma is already installed then, by default, the playbook will not re-install Pleroma or re-run the database migration. If the user wants to update Pleroma to a newer version then they can re-run the playbook with the command-line argument '--extra-vars enable_pleroma_upgrade=True'. This commit also introduces a custom module used to compare the installed and downloaded semantic versions of Pleroma. The playbook uses this to see whether the version change is an upgrade, a downgrade or no version change. If it's an upgrade the playbook will proceed with the re-installation of Pleroma. If there is no change then the playbook will skip installation. Finally if it detects that the user is trying to downgrade Pleroma then it will fail. This commit resolves dananglin/pleroma-ansible-playbook#9 and also resolves dananglin/pleroma-ansible-playbook#5
29 lines
1,001 B
Makefile
29 lines
1,001 B
Makefile
VAPID_PRIVATE_KEY_FILE := vapid-private-key.pem
|
|
|
|
PHONY: secret_key_base signing_salt vapid_private_key vapid_public_key
|
|
|
|
all: secret_key_base signing_salt vapid_key_pair
|
|
|
|
vapid_key_pair: vapid_private_key vapid_public_key
|
|
|
|
secret_key_base:
|
|
@echo "Secret key base:"
|
|
@openssl rand -base64 48
|
|
|
|
signing_salt:
|
|
@echo -e "\nSigning salt:"
|
|
@openssl rand -hex 4
|
|
|
|
$(VAPID_PRIVATE_KEY_FILE):
|
|
@openssl ecparam -genkey -name prime256v1 -out $(VAPID_PRIVATE_KEY_FILE)
|
|
|
|
vapid_private_key: $(VAPID_PRIVATE_KEY_FILE)
|
|
@echo -e "\nVapid private key:"
|
|
@openssl ec -in $(VAPID_PRIVATE_KEY_FILE) -outform DER 2> /dev/null | tail -c +8 | head -c 32 | base64 | tr '/+' '_-' | tr -d '=' | tr -d '\n'
|
|
|
|
vapid_public_key: $(VAPID_PRIVATE_KEY_FILE)
|
|
@echo -e "\n\nVapid public key:"
|
|
@openssl ec -in $(VAPID_PRIVATE_KEY_FILE) -pubout -outform DER 2> /dev/null | tail -c 65 | base64 | tr '/+' '_-' | tr -d '=' | tr -d '\n'
|
|
|
|
test_modules_unit:
|
|
@find ./library -mindepth 1 -maxdepth 1 -type f -name test_*.py | xargs python3
|