Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop creating public_html symlinks from April 2023 #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
python3-srcf (0.0.14) UNRELEASED; urgency=medium

* Cease creation of symlinks to public_html from April 2023
* Email sysadmins on manual group grant/revoke
* Add script email wrapper to prefix sysadmin mail
* Use an auto-commit session for scripts
Expand Down
14 changes: 9 additions & 5 deletions srcflib/plumbing/bespoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,17 @@ def populate_home_dir(member: Member) -> Result[Unset]:
@Result.collect
def create_public_html(owner: Owner) -> Collect[None]:
"""
Create a user's public_html directory, and a symlink to it in their home directory.
Create a user's public_html directory inside their public directory.

For creations before April 2023, also add a symlink to it in their home directory.
"""
user = unix.get_user(owner.uid)
link = os.path.join(owner_home(owner), "public_html")
target = os.path.join(owner_home(owner, True), "public_html")
yield unix.mkdir(target, user)
yield unix.symlink(link, target)
public_html = os.path.join(owner_home(owner, True), "public_html")
yield unix.mkdir(public_html, user)
symlink_cutoff = date(2023, 4, 1) # accounts provisioned from this date don't get the symlink
if date.today() < symlink_cutoff:
link = os.path.join(owner_home(owner), "public_html")
yield unix.symlink(link, public_html)


@Result.collect
Expand Down