Compare commits

...

10 Commits

Author SHA1 Message Date
6884f981ae ? 2021-10-29 22:48:29 +02:00
829934ce17 YOLO 2021-10-29 22:39:05 +02:00
William
cfbbb29ee8 Update 'filopplasting/upload.php'
Allow users to upload files with html or htm file extensions except for when the name is index.
2021-08-17 22:28:26 +00:00
5d6e8efdc4 ny matrix server 2021-08-07 01:54:27 +02:00
eb3d51f884 Endringer 2021-05-31 18:08:12 +02:00
fb8e284e12 Fiksa litt css 2021-04-13 21:28:13 +02:00
618fa4d421 Mer info om mumble og matrix 2021-04-12 19:39:46 +02:00
3e2d262059 Many style improvements 2021-03-21 12:46:35 +01:00
6cf9272f6b Many improvement 2021-03-21 00:28:48 +01:00
677accd35e Many improvement 2021-03-21 00:27:51 +01:00
18 changed files with 381 additions and 119 deletions

0
LICENSE Normal file → Executable file
View File

0
common/header.html Normal file → Executable file
View File

0
common/main.css Normal file
View File

99
css/main.css Normal file → Executable file
View File

@@ -7,9 +7,13 @@
--dark-text-color: #eeeeee;
--dark-btn-color: #303f9f;
--dark-link-color: #5C6BC0;
}
--dark-shadow-color: #1a1a1a;
--dark-green-bg-color: #26a269;
--dark-green-border-color: #176943;
}
body {
min-height: 100%;
font-family: "Noto Sans", "Liberation Sans","Trebuchet MS", Arial, Helvetica, sans-serif;
margin: 0;
--accent-color: #1A237E;
@@ -20,10 +24,17 @@ body {
--text-color: black;
--btn-color: #303f9f;
--link-color: #3949AB;
--shadow-color: rgba(0,0,0,.15);
--green-bg-color: #8ff0a4;
--green-border-color: #33d17a;
background-color: var(--bg-color);
color: var(--text-color);
}
header{
align-self: start;
padding: 0.5rem;
}
@@ -75,67 +86,65 @@ a {
/* Container for main content */
.cont {
background-image: url(/img/noise.png);
margin: auto;
min-width: 20%;
background: var(--cont-bg-color);
border-radius: 1rem;
grid-area: main;
}
.service-list {
padding: 0;
display: flex;
flex-wrap: wrap;
justify-content: center;
list-style: none;
gap: 1rem;
.alert {
}
.service-list li {
margin: 0.1rem;
background-size: contain;
background-position: center;
background-repeat: no-repeat;
width: 10rem;
height: 8rem;
border: thin solid #3c4043;
border-radius: 0.5rem;
transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}
.service-list li:hover {
transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
box-shadow: 0 0 2px 2px var(--accent-color), 0 .5rem 1rem rgba(0,0,0,.15) !important;
}
.service-list li a {
font-size: 1.5rem;
color: var(--text-color);
text-decoration: none;
display: block;
width: 100%;
height: 100%;
.center-txt{
text-align: center;
vertical-align:middle;
display: flex;
align-items: center;
justify-content: center;
}
.service-list li a div {
vertical-align: middle;
@media screen and (max-width:600px){
.cont {
max-width: 100%;
width: calc(100% - 0.5rem);
padding: 0.25rem;
}
}
@media only screen and (max-width:800px){
.cont {
max-width: 90%;
}
}
#li-nextcloud { background-image: url(/img/icons/Nextcloud_Logo.svg); }
#li-matrix { background-image: url(/img/icons/Matrix_Logo.svg); }
@media only screen and (min-width:800px){
.cont {
max-width: 80%;
}
}
@media only screen and (min-width:1000px){
.cont {
width: max-content;
padding: 1rem;
width: max-content;
max-width: 50%;
}
}
@media only screen and (min-width:1300px){
html {
font-size: 18px;
}
}
@media only screen and (min-width:2000px){
html {
font-size: 20px;
}
.cont {
max-width: 40%;
}
}
@media (prefers-color-scheme: dark) {
body.theme-auto {
--bg-color: var(--dark-bg-color);
@@ -146,8 +155,6 @@ a {
--btn-color: var(--dark-btn-color);
--accent-color: var(--dark-accent-color);
--link-color: var(--dark-link-color);
--shadow-color: var(--dark-shadow-color);
}
#li-nextcloud { }
#li-matrix { filter: invert(); }
}

4
diverse/index.php Normal file → Executable file
View File

@@ -11,16 +11,14 @@
<?php include "../common/header.html"; ?>
<center>
<div class="cont">
<h1>Flere saker</h1>
<h1 class="center-txt">Flere saker</h1>
<ul>
<li><a href="/phpsysinfo/">Server info</a></li>
<li><a href="/active-forks/">Gaffelsøker</a></li>
</ul>
</div>
</center>
</body>
</html>

View File

@@ -41,29 +41,62 @@ session_start();
<?php include "../common/header.html"; ?>
<body>
<center>
<div class="cont">
<h1>Filopplasting</h1>
<p>
<h1 class="center-txt">Filopplasting</h1>
<p class="center-txt">
Her kan du laste opp filer for å dele med andre. Filene kan være maks 5GB.<br /> Serveren ligger i Kristiansand og har 500/500 internet <br />
All opplasting skjer på eget ansvar.
</p>
<div>
<a class="btn btn-info" href="http://trygve.me/filopplasting/filer/">Se alle filer</a>
<div class="center-txt">
<a href="http://trygve.me/filopplasting/filer/">Se alle filer</a>
</div>
<hr class="my-4">
<div>
<div class="center-txt">
<form action="upload.php" method="post" enctype="multipart/form-data">
<div class="form-group">
<input type="hidden" name="<?php echo ini_get("session.upload_progress.name"); ?>" value="123" />
<input type="file" name="file" class="" >
<button type="submit" class="btn btn-raised btn-primary">Last opp </button>
<button type="submit" class="btn btn-primary">Last opp </button>
</div>
</form>
</div>
<?php
$errorMSG = '
<div class="alert alert-warning" role="alert">
Hmmmm 🤔 Her var det visst noe som gikk galt.
</div>';
$bannedMSG = '
<div class="alert alert-warning" role="alert">
Denne filtypen er ikke tillatt.
</div>';
if(isset($_SESSION['fileupload-response'])) {
if($_SESSION['fileupload-response'] == "success") {
$successMSG = '
<div class="alert alert-primary center" role="alert">
'
. $_SESSION['linkData'] .
'
<button type="button" class="btn btn-primary" onclick="copyToClipboard(\'' . $_SESSION['link'] . '\')">Kopier lenke</button>
</div>
';
echo($successMSG);
}
elseif ($_SESSION['fileupload-response'] == "failed") {
echo($errorMSG);
}
elseif ($_SESSION['fileupload-response'] == "banned") {
echo($bannedMSG);
}
session_destroy();
}
?>
</ul>
</div>
</center>
</body>
</html>

View File

@@ -21,8 +21,8 @@ error_reporting(E_ALL);
$fileExt = explode('.', $fileName);
$fileActualExt = strtolower(end($fileExt));
$banned = array('php', 'js', 'html', 'htm', 'php5', 'pht', 'phtml', 'shtml', 'asa', 'cer', 'asax', 'swf');
$allowed = array('zip', 'gz', 'tar', 'png', 'jpg', 'bmp');
$banned = array('php', 'js', 'php5', 'pht', 'phtml', 'shtml', 'asa', 'cer', 'asax', 'swf');
$allowed = array('zip', 'gz', 'tar', 'png', 'jpg', 'bmp', 'html', 'htm');
//if(in_array($fileActualExt, $banned))
//{
@@ -35,6 +35,10 @@ error_reporting(E_ALL);
}
}
if ($file_name === 'index.htm' || $file_name === 'index.html') {
$fileError = 2;
}
// require "fileLogger.php";

29
fuglekasse/index.php Normal file → Executable file
View File

@@ -9,6 +9,7 @@
<link href="./video-js/video-js.css" rel="stylesheet">
<link href="./video-js/themes/forest/index.css" rel="stylesheet">
<link href="./chromecast/silvermine-videojs-chromecast.css" rel="stylesheet">
<style>
video{
border-radius: 0.5rem;
@@ -27,25 +28,41 @@
width: 100%;
}
}
</style>
</head>
<body class="theme-auto">
<?php include "../common/header.html"; ?>
<center>
<div class="cont">
<h1>Direktesending fra fuglekassa</h1>
<h1 class="center-txt">Direktesending fra fuglekassa</h1>
<video id="live_stream" class="video-js responsive main-vid vjs-theme-forest" controls autoplay="true" preload="auto"
data-setup='{"controls": true, "autoplay": true, "responsive": true, "fluid": true}'>
<source src="https://trygve.me:8080/hls/stream.m3u8" type="application/x-mpegURL">
</video>
</div>
</center>
</body>
<script src="./video-js/video.js"></script>
<script>
var player = videojs('live_stream');
window.SILVERMINE_VIDEOJS_CHROMECAST_CONFIG = {
preloadWebComponents: true,
};
</script>
<script src="./video-js/video.js"></script>
<script src="./chromecast/silvermine-videojs-chromecast.min.js"></script>
<script type="text/javascript" src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1"></script>
<script>
var options;
options = {
techOrder: [ 'chromecast', 'html5' ],
};
videojs('live_stream', options, function() {
var player = this;
player.chromecast();
});
</script>
</body>
</html>

81
img/icons/Jitsi_Logo.svg Executable file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 14 KiB

0
img/icons/Matrix_Logo.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

0
img/icons/Nextcloud_Logo.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

BIN
img/noise.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

80
index.php Normal file → Executable file
View File

@@ -6,29 +6,95 @@
<meta name="theme-color" content="#263238"/>
<link rel="icon" type="image/png" href="/dist/favicon.png">
<link rel="stylesheet" href="/css/main.css">
<style>
.btn-bg {
width: 90%;
height: 90%;
background-size: contain;
background-position: center;
background-repeat: no-repeat;
}
#bg-nextcloud { background-image: url(/img/icons/Nextcloud_Logo.svg); }
#bg-matrix { background-image: url(/img/icons/Matrix_Logo.svg); }
#bg-meet { background-image: url(/img/icons/Jitsi_Logo.svg);}
@media (prefers-color-scheme: dark) {
#bg-nextcloud { }
#bg-matrix { filter: invert(); }
#bg-meet { filter: invert(); }
}
.service-list {
padding: 0;
display: flex;
flex-wrap: wrap;
justify-content: center;
list-style: none;
gap: 1rem;
}
.service-list li {
width: 10rem;
height: 8rem;
}
.service-list li a:focus {
transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
box-shadow: 0 0 2px 2px var(--accent-color), 0 .5rem 1rem var(--shadow-color) !important;
}
.service-list li a:hover {
transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
box-shadow: 0 0 2px 2px var(--accent-color), 0 .5rem 1rem var(--shadow-color) !important;
}
.service-list li a {
font-size: 1.5rem;
color: var(--text-color);
text-decoration: none;
display: block;
width: 100%;
height: 100%;
text-align: center;
vertical-align:middle;
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
border: thin solid #3c4043;
border-radius: 0.5rem;
transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}
.service-list li a div {
vertical-align: middle;
}
</style>
</head>
<body class="theme-auto">
<?php include "common/header.html"; ?>
<center>
<div class="cont">
<h1>Velkommen til Trygves side!</h1>
<h2>Mine prosjekter:</h2>
<h1 class="center-txt">Velkommen til Trygves side!</h1>
<h2 class="center-txt">Mine prosjekter:</h2>
<ul class="service-list">
<li><a href="/liveresultater/"><div>Liveresultater</div></a></li>
<li><a href="/fuglekasse/"><div>Fuglekasse</div></a></li>
<li><a href="/filopplasting/"><div>Filopplasting</div></a></li>
</ul>
<h2>Tjenester:</h2>
<h2 class="center-txt">Tjenester:</h2>
<ul class="service-list">
<li id="li-matrix"><a href="https://riot.trygve.me"></a></li>
<li id="li-nextcloud"> <a href="https://nextcloud.trygve.me/"></a></li>
<li><a href="/matrix_info"><div class="btn-bg" id="bg-matrix"></div></a></li>
<li><a href="/mumble_info"><div>Mumble</div></a></li>
<li><a href="https://meet.trygve.me/"><div class="btn-bg" id="bg-meet"></div><div>Meet</div></a></li>
<li><a href="https://nextcloud.trygve.me/"><div class="btn-bg" id="bg-nextcloud"></div></a></li>
</ul>
</div>
</center>
</body>
</html>

28
matrix_info/index.php Normal file
View File

@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="no">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta charset="UTF-8">
<meta name="theme-color" content="#263238"/>
<link rel="icon" type="image/png" href="/dist/favicon.png">
<link rel="stylesheet" href="/css/main.css">
</head>
<body class="theme-auto">
<?php include "../common/header.html"; ?>
<div class="cont">
<h1 class="center-txt">Matrix</h1>
<a href="https://element.trygve.me"><h2 class="center-txt">Åpne element</h2></a>
<article>
<p>For å bruke en annen klient må du skrive inn adressa:</p>
<code>trygve.me</code>
<p>Matrix er en fri og desentralisert lynmeldingsprotokoll. For å bruke matrix må du registrere deg hos en hjemmeserver, f.eks. trygve.me, deretter kan du kommunisere med hvem som helst på din egen hjemmeserver og resten av nettverket. </p>
<p>Det finnes mange forskjellige klienter for forskjellige platformer. på <a href="https://matrix.org/clients/">https://matrix.org/clients/</a> finner du en liste med gode klienter. For nye brukere vill jeg anbefale Element som finnes som i nettleseren, som skrivebordsprogram eller som mobilapp. På <a href="https://element.trygve.me">https://element.trygve.me</a> finner du nettleserversjonen og appen kan lastes ned <a href="https://element.io/get-started">her<a/>.
</article>
</div>
</body>
</html>

28
mumble_info/index.php Executable file
View File

@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="no">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta charset="UTF-8">
<meta name="theme-color" content="#263238"/>
<link rel="icon" type="image/png" href="/dist/favicon.png">
<link rel="stylesheet" href="/css/main.css">
</head>
<body class="theme-auto">
<?php include "../common/header.html"; ?>
<div class="cont">
<h1 class="center-txt">Mumble</h1>
<a href="mumble://trygve.me/"><h2 class="center-txt">Åpne min server i mumble</h2></a>
<article>
<p>Eller du kan skrive inn adressa selv:</p>
<code>trygve.me</code>
<p>Mumble er et program aom lar deg ha talesamtaler i høy kvalitet og med liten forsinkelse.</p>
<p>Gå til <a href="https://mumble.info">https://mumble.info</a> for å laste ned mumble og mer info.</p>
</article>
</div>
</body>
</html>

9
speedtest/index.php Normal file → Executable file
View File

@@ -16,21 +16,19 @@
<?php include "../common/header.html"; ?>
<center>
<div class="cont">
<h1 class="center-txt">Nettverkstest</h1>
<button id="startStopBtn" onclick="startStop()"></button>
<div id="test">
<div class="testGroup">
<div class="testArea2">
<div class="testName">Ping</div>
<div id="pingText" class="meterText" style="color:#AA6060"></div>
<div id="pingText" class="meterText" style="color:#3949ab"></div>
<div class="unit">ms</div>
</div>
<div class="testArea2">
<div class="testName">Jitter</div>
<div id="jitText" class="meterText" style="color:#AA6060"></div>
<div id="jitText" class="meterText" style="color:#3949ab"></div>
<div class="unit">ms</div>
</div>
</div>
@@ -55,7 +53,6 @@
<a href="https://github.com/librespeed/speedtest">Source code</a>
</div>
</center>
<script type="text/javascript">setTimeout(function(){initUI()},100);</script>
</body>
</html>

17
speedtest/ui.css Normal file → Executable file
View File

@@ -1,3 +1,12 @@
.cont {
text-align: center;
}
#startStopBtn{
height: 2rem;
width: 5rem;
font-size: 1.2rem;
text-align: center;
}
#startStopBtn:before{
content:"Start";
}
@@ -5,8 +14,7 @@
content:"Abort";
}
#test{
margin-top:2em;
margin-bottom:12em;
margin-top:2rem;
}
div.testArea{
display:inline-block;
@@ -67,8 +75,3 @@
display:block;
margin: 0 auto;
}
@media all and (max-width:40em){
body{
font-size:0.8em;
}
}

4
speedtest/ui.js Normal file → Executable file
View File

@@ -3,8 +3,8 @@ function I(i){return document.getElementById(i);}
var s=new Speedtest(); //create speedtest object
var meterBk=/Trident.*rv:(\d+\.\d+)/i.test(navigator.userAgent)?"#EAEAEA":"#80808040";
var dlColor="#6060AA",
ulColor="#616161";
var dlColor="#1565c0",
ulColor="#c62828";
var progColor=meterBk;
//CODE FOR GAUGES