This repository was archived by the owner on Aug 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
meta: Add concept of site 'availability'
Uses the same model as Domain.status. Credit goes to @theo-o for the name (and the original concept of Domain.status that this is based off of). Essentially, a site's availability can be one of the three values: - Enabled: Normal functionality. - Not served: The site is not served publicly, but otherwise it functions normally. - Disabled: The site is not served publicly, and only superusers can view/edit site information through the web interface. (Note that for non-superusers who normally have access to the site, the site still appears on the home page. However, attempting to visit the "site information" page will give a descriptive error message, and visiting any other page related to that viewing/editing information regarding that site will give a 404.) The "not served"/"disabled" availabilities are implemented by 1) scaling the Docker service to 0 replicas and 2) editing the Nginx config to return an error page. Note that the large number of changes to the views/consumers was necessary to enforce the new permission restrictions.
- Loading branch information
1 parent
31d6f16
commit 548373c
Showing
19 changed files
with
408 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
manager/director/apps/sites/migrations/0042_auto_20200618_1356.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 2.2.13 on 2020-06-18 17:56 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('sites', '0041_remove_action_equivalent_command'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='site', | ||
name='admin_comments', | ||
field=models.TextField(blank=True, help_text='Administrative comments. If availability != enabled, this will be shown to the user.'), | ||
), | ||
migrations.AddField( | ||
model_name='site', | ||
name='availability', | ||
field=models.CharField(choices=[('enabled', 'Enabled (fully functional)'), ('not-served', 'Not served publicly'), ('disabled', 'Disabled (not served, only viewable/editable by admins)')], default='enabled', help_text='Controls availability of the site (whether it is served publicly and whether it is editable)', max_length=10), | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
manager/director/apps/sites/migrations/0043_auto_20200618_1402.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 2.2.13 on 2020-06-18 18:02 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('sites', '0042_auto_20200618_1356'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='site', | ||
name='admin_comments', | ||
field=models.TextField(blank=True, help_text="Administrative comments. All users who have access to the site will always be able to see this, even if the site's 'availability' is 'disabled'."), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.