Skip to content

Commit 5f7ebcc

Browse files
authored
Merge pull request #42 from mxstack/zope-emergency-user
feat: add zope-adduser target
2 parents c9c36d4 + cf25174 commit 5f7ebcc

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 1.1.0 (unreleased)
4+
5+
- Feature: Add target `zope-adduser` to create an emergency user.
6+
37
## 1.0 (2025-02-11)
48

59
- Chore: Add release workflow.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "mxmake"
33
description = "Generates a Python project-specific Makefile by using an extensible library of configurable Makefile snippets."
4-
version = "1.0"
4+
version = "1.1.0.dev0"
55
keywords = ["development", "deployment", "make"]
66
authors = [
77
{name = "MX Stack Developers", email = "dev@bluedynamics.com" }

src/mxmake/topics/applications/zope.mk

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@
3737
#:[setting.ZOPE_SCRIPTNAME]
3838
#:description = script to run
3939
#:
40+
#:[target.zope-adduser]
41+
#:description = Adds an [emergency user](https://zope.readthedocs.io/en/latest/zopebook/Security.html#zope-emergency-user) to Zope.
42+
#: This is an user with the Manager role created in the Zope application roots user folder!
43+
#: This is not meant to do user management, but to get access to a Zope site if all other passwords are gone.
44+
#: The user name must not exist already in the application roots user folder.
45+
#: ZOPE_USER_NAME and ZOPE_USER_PASSWORD should not be set in the Makefile, but passed in as environment variables.
46+
#: Example: `make ZOPE_USER_NAME=emergency ZOPE_USER_PASSWORD=verysecret adduser`
47+
#:
48+
#:[setting.ZOPE_USER_NAME]
49+
#:description = user name to create
50+
#:
51+
#:[setting.ZOPE_USER_PASSWORD]
52+
#:description = user name to create
53+
#:
4054
#:[target.zope-dirty]
4155
#:description = Touches the configuration file to force a rebuild of the Zope instance.
4256
#:
@@ -85,6 +99,11 @@ zope-runscript: $(ZOPE_RUN_TARGET)
8599
@echo "Run Zope/Plone Console Script $(ZOPE_SCRIPTNAME) in $(ZOPE_INSTANCE_FOLDER)"
86100
@zconsole run "$(ZOPE_INSTANCE_FOLDER)/etc/zope.conf" $(ZOPE_SCRIPTNAME)
87101

102+
.PHONY: zope-adduser
103+
zope-adduser: $(ZOPE_RUN_TARGET)
104+
@echo "Run Zope addzopeuser to create an emergency user '$(ZOPE_USER_NAME)' with role 'Manager'"
105+
@addzopeuser -c "$(ZOPE_INSTANCE_FOLDER)/etc/zope.conf" $(ZOPE_USER_NAME) $(ZOPE_USER_PASSWORD)
106+
88107
.PHONY: zope-dirty
89108
zope-dirty:
90109
@touch ${ZOPE_CONFIGURATION_FILE}

0 commit comments

Comments
 (0)