Skip to content
Snippets Groups Projects
Commit 92925e24 authored by Bob Mottram's avatar Bob Mottram
Browse files

Enable or disable peertube registrations

parent fc6a3937
No related branches found
No related tags found
No related merge requests found
......@@ -57,6 +57,20 @@ peertube_variables=(PEERTUBE_DOMAIN_NAME
ARCHITECTURE
MY_EMAIL_ADDRESS)
function peertube_setting_registration {
allow_registrations="$1"
if [[ "$allow_registrations" == '1' ]]; then
sed -i "0,/enabled:.*/s//enabled: false/" $PEERTUBE_DIR/config/production.yaml
systemctl restart peertube
fi
if [[ "$allow_registrations" == '0' ]]; then
sed -i "0,/enabled:.*/s//enabled: true/" $PEERTUBE_DIR/config/production.yaml
systemctl restart peertube
fi
}
function peertube_import_from_syncthing {
peertubedomain="https://$PEERTUBE_DOMAIN_NAME"
nodecmd='node'
......
<?php
// Peertube settings menu
$output_filename = "app_peertube.html";
if (isset($_POST['submitallowregistrations'])) {
$confirm = htmlspecialchars($_POST['allowregistrations']);
$settings_file = fopen(".appsettings.txt", "w") or die("Unable to write to appsettings file");
fwrite($settings_file, "peertube,registration,".$confirm);
fclose($settings_file);
}
$htmlfile = fopen("$output_filename", "r") or die("Unable to open $output_filename");
echo fread($htmlfile,filesize("$output_filename"));
fclose($htmlfile);
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment