From cd4878a95b5f095613d2565dba67f55e8e5ca1c4 Mon Sep 17 00:00:00 2001 From: Edwin Balani Date: Mon, 27 Mar 2023 19:55:53 +0100 Subject: [PATCH] Stop creating public_html symlinks from April 2023 --- debian/changelog | 1 + srcflib/plumbing/bespoke.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8f3388c..3a6b981 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 diff --git a/srcflib/plumbing/bespoke.py b/srcflib/plumbing/bespoke.py index 4c6defe..04b7411 100644 --- a/srcflib/plumbing/bespoke.py +++ b/srcflib/plumbing/bespoke.py @@ -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