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

Remove experimental koel upload

parent b0af9722
No related branches found
No related tags found
No related merge requests found
......@@ -104,39 +104,6 @@ function koel_upload_from_syncthing {
systemctl restart koel_syncthing.service
}
function koel_setting_upload {
music_file="$1"
if [ ! "$music_file" ]; then
return
fi
music_file_path="/var/www/${PROJECT_NAME}/htdocs/admin/${music_file}"
if [ ! -f "$music_file_path" ]; then
return
fi
if [[ "$music_file" != *'.gz' && "$music_file" != *'.zip' ]]; then
rm "$music_file_path"
return
fi
mv "$music_file_path" /music
if [[ "$music_file" != *'.gz' ]]; then
cd /music || exit 46834
tar -xzvf "${music_file}"
rm "/music/$music_file"
fi
if [[ "$music_file" != *'.zip' ]]; then
cd /music || exit 56375
if [ ! -f /usr/bin/unzip ]; then
apt-get -qy install unzip
fi
unzip "${music_file}"
rm "/music/$music_file"
fi
}
function logging_on_koel {
echo -n ''
}
......
......@@ -1010,13 +1010,6 @@ function install_web_admin {
mkdir -p "/var/www/${local_hostname}/htdocs/plinth"
fi
if ! grep -q 'post_max_size = 200M' /etc/php/7.0/fpm/php.ini; then
sed -i 's|post_max_size.*|post_max_size = 200M|g' /etc/php/7.0/fpm/php.ini
fi
if ! grep -q 'upload_max_filesize = 200M' /etc/php/7.0/fpm/php.ini; then
sed -i 's|upload_max_filesize.*|upload_max_filesize = 200M|g' /etc/php/7.0/fpm/php.ini
fi
web_admin_create_users
# make list of apps which can be added
......
<!DOCTYPE html>
<html>
<style>
* {
box-sizing: border-box;
}
a, u {
text-decoration: none;
color: #72a7cf;
font-weight: bold;
}
a:visited{
color: #72a7cf;
font-weight: bold;
}
#headerpic {
width: 60%;
height: auto;
margin-right : auto;
margin-left : auto;
min-width : 220px;
}
body {
margin: 0;
font-family: Arial;
}
.header {
text-align: center;
padding: 32px;
}
.headertext {
color: #72a7cf;
text-align: center;
font-size: 120%;
font-weight: bold;
}
.settingtext {
text-align: center;
font-size: 100%;
}
.row {
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
padding: 0 4px;
}
.column {
-ms-flex: 25%;
flex: 15%;
max-width: 25%;
padding: 0 4px;
}
.column img {
margin-top: 8px;
vertical-align: middle;
}
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
max-width: 600px;
margin: auto;
text-align: center;
font-family: arial;
clear: both;
}
.card input[type=text] {
width: 50%;
clear: both;
text-align: left;
color: black;
background-color: lightblue;
}
</style>
<body>
<div class="card">
<div class="header">
<a href="app_koel.html"><img id="headerpic" class="img-responsive" src="images/logo.png"></a>
<p class="headertext">Koel upload music</p>
<p class="settingtext">Upload a <b>zip</b> file containing your music</p>
<form action="settings_koel.php" method="post" enctype="multipart/form-data">
<input type="file" name="musicfile" id="musicfile" accept=".zip">
<br><br>
<input type="submit" name="submitcancel" value="Cancel" />
<input type="submit" name="submitmusic" value="Upload" />
</form>
</div>
</div>
</body>
</html>
<?php
// Koel settings menu
$output_filename = "app_koel.html";
if (isset($_POST['submitmusic'])) {
$target_dir = "uploads/";
$musicfile = $target_dir . basename($_FILES["musicfile"]["name"]);
if(file_exists($musicfile)) {
$settings_file = fopen(".appsettings.txt", "w") or die("Unable to write to appsettings file");
fwrite($settings_file, "koel,upload,".$musicfile);
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