Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5954 from freedomofpress/1584-trust-in-disorder
Eliminate flag-for-reply process
- Loading branch information
Showing
32 changed files
with
386 additions
and
496 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
83 changes: 0 additions & 83 deletions
83
install_files/ansible-base/roles/app/tasks/configure_haveged.yml
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -17,5 +17,3 @@ | |
- include: install_and_harden_apache.yml | ||
|
||
- include: setup_cron.yml | ||
|
||
- include: configure_haveged.yml |
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 was deleted.
Oops, something went wrong.
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
70 changes: 70 additions & 0 deletions
70
securedrop/alembic/versions/b060f38c0c31_drop_source_flagged.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,70 @@ | ||
"""drop Source.flagged | ||
Revision ID: b060f38c0c31 | ||
Revises: 92fba0be98e9 | ||
Create Date: 2021-05-10 18:15:56.071880 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "b060f38c0c31" | ||
down_revision = "92fba0be98e9" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
with op.batch_alter_table("sources", schema=None) as batch_op: | ||
batch_op.drop_column("flagged") | ||
|
||
|
||
def downgrade(): | ||
# You might be tempted to try Alembic's batch_ops for the | ||
# downgrade too. Don't. SQLite's unnamed check constraints require | ||
# kludges. | ||
|
||
conn = op.get_bind() | ||
conn.execute("PRAGMA legacy_alter_table=ON") | ||
|
||
op.rename_table("sources", "sources_tmp") | ||
|
||
conn.execute( | ||
sa.text( | ||
""" | ||
CREATE TABLE "sources" ( | ||
id INTEGER NOT NULL, | ||
uuid VARCHAR(36) NOT NULL, | ||
filesystem_id VARCHAR(96), | ||
journalist_designation VARCHAR(255) NOT NULL, | ||
last_updated DATETIME, | ||
pending BOOLEAN, | ||
interaction_count INTEGER NOT NULL, | ||
deleted_at DATETIME, | ||
flagged BOOLEAN, | ||
PRIMARY KEY (id), | ||
CHECK (pending IN (0, 1)), | ||
CHECK (flagged IN (0, 1)), | ||
UNIQUE (filesystem_id), | ||
UNIQUE (uuid) | ||
) | ||
""" | ||
) | ||
) | ||
|
||
conn.execute( | ||
""" | ||
INSERT INTO sources ( | ||
id, uuid, filesystem_id, journalist_designation, | ||
last_updated, pending, interaction_count, deleted_at | ||
) SELECT | ||
id, uuid, filesystem_id, journalist_designation, | ||
last_updated, pending, interaction_count, deleted_at | ||
FROM sources_tmp; | ||
""" | ||
) | ||
|
||
# Now delete the old table. | ||
op.drop_table("sources_tmp") |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from threading import Thread | ||
|
||
|
||
def asynchronous(f): # type: ignore | ||
""" | ||
Wraps a | ||
""" | ||
def wrapper(*args, **kwargs): # type: ignore | ||
thread = Thread(target=f, args=args, kwargs=kwargs) | ||
thread.start() | ||
return wrapper |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.