mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
ikiwiki: Mark secret strings in privileged actions
Tests: - Run affected privileged actions through UI and notice that secret strings are not logged. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
5c0b15d8f8
commit
382b931cd4
@ -7,7 +7,7 @@ import re
|
|||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from plinth.actions import privileged
|
from plinth.actions import privileged, secret_str
|
||||||
|
|
||||||
SETUP_WIKI = '/etc/ikiwiki/plinth-wiki.setup'
|
SETUP_WIKI = '/etc/ikiwiki/plinth-wiki.setup'
|
||||||
SETUP_BLOG = '/etc/ikiwiki/plinth-blog.setup'
|
SETUP_BLOG = '/etc/ikiwiki/plinth-blog.setup'
|
||||||
@ -57,7 +57,7 @@ def get_sites() -> list[tuple[str, str]]:
|
|||||||
|
|
||||||
|
|
||||||
@privileged
|
@privileged
|
||||||
def create_wiki(wiki_name: str, admin_name: str, admin_password: str):
|
def create_wiki(wiki_name: str, admin_name: str, admin_password: secret_str):
|
||||||
"""Create a wiki."""
|
"""Create a wiki."""
|
||||||
pw_bytes = admin_password.encode()
|
pw_bytes = admin_password.encode()
|
||||||
input_ = pw_bytes + b'\n' + pw_bytes
|
input_ = pw_bytes + b'\n' + pw_bytes
|
||||||
@ -68,7 +68,7 @@ def create_wiki(wiki_name: str, admin_name: str, admin_password: str):
|
|||||||
|
|
||||||
|
|
||||||
@privileged
|
@privileged
|
||||||
def create_blog(blog_name: str, admin_name: str, admin_password: str):
|
def create_blog(blog_name: str, admin_name: str, admin_password: secret_str):
|
||||||
"""Create a blog."""
|
"""Create a blog."""
|
||||||
pw_bytes = admin_password.encode()
|
pw_bytes = admin_password.encode()
|
||||||
input_ = pw_bytes + b'\n' + pw_bytes
|
input_ = pw_bytes + b'\n' + pw_bytes
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user