Merge branch 'yeeeean'

master
LinuxMint4Ever 2020-02-19 04:33:53 +01:00
commit adca290bf1
12 changed files with 82 additions and 50 deletions

View File

@ -1,5 +1,8 @@
# Git based automatic web deployment system
This repository will be automagically pulled by the web server each time something is pushed by a user. The following files and directories are linked to areas where they can be accessed by the web server:
This repository will be automagically pulled by the web server each time something is pushed by a user.
## Symlinks
The following files and directories are linked to areas where they can be accessed by the web server:
* `index.html` → `*/common/index.html` (the website as seen by the majority of the users, maybe a login page?)
* `icon.png` → `*/common/icon.png` (self-explanatory)
* `stylesheet.css` → `*/common/stylesheet.css` (self-explanatory)
@ -10,7 +13,12 @@ This repository will be automagically pulled by the web server each time somethi
* `commands_status.conf``strassenkind.ip/commands_status.conf`
* `commands_ondemand.conf``strassenkind.ip/commands_ondemand.conf`
## Some server variables that might turn out to be useful:
## Variables handled by the deployment script
Here is the place for variables that will be replaced automatically on the server. Using them is encouraged. Using the paths is DISCOURAGED.
This way, it is possible to change folder names around and fix the URLs in one place for all files simultaneously.
* `%CONTENT_DIR%` → The part of the URL between the domain name and the destination (e.g. https://lostcave.ddnss.de**/common/content/**about/)
## Some server variables that might turn out to be useful (example):
{
"HTTP_USER_AGENT":"Mozilla\/5.0 (X11; Ubuntu; Linux x86_64; rv:73.0) Gecko\/20100101 Firefox\/73.0",
"REMOTE_ADDR":"10.1.1.3"

View File

@ -4,7 +4,7 @@
<title>
About us...
</title>
<link rel="stylesheet" type="text/css" href="/common/content/style.css" />
<link rel="stylesheet" type="text/css" href="%CONTENT_DIR%/style.css" />
<meta charset="utf-8" />
</head>
<body>
@ -20,7 +20,7 @@
Who we are
</h2>
<div class="image_container">
<img src="/common/content/img/group.jpg" alt="Image of the team" />
<img src="%CONTENT_DIR%/img/group.jpg" alt="Image of the team" />
<p class="image_container">
From left to right: Ilja, Jakob, Jan [me], and Erik
</p>
@ -34,7 +34,7 @@
About the server
</h2>
<div class="image_container">
<img src="/common/content/img/server.jpg" alt="Image of the server">
<img src="%CONTENT_DIR%/img/server.jpg" alt="Image of the server">
<p class="image_container">
The server at its current place in the basement
</p>

9
content/img/index.html Normal file
View File

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="0;%CONTENT_DIR%/" />
</head>
<body>
<p> Nope. </p>
</body>
</html>

View File

@ -1 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<title>Home page</title>
<link rel="stylesheet" type="text/css" href="%CONTENT_DIR%/stylesheet.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<ul class="topnav">
<li><a class="active" href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="%CONTENT_DIR%/about/">About</a></li>
<li class="right"><a href="%CONTENT_DIR%/login/">Log In</a></li>
</ul>
<div style="padding:0 16px;">
<h2>ThreadR Homepage</h2>
<p></p>
<p></p>
<h4></h4>
</div>
</body>
</html>

View File

@ -2,15 +2,15 @@
<html>
<head>
<title>ThreadR - Welcome</title>
<link rel="stylesheet" type="text/css" href="/common/content/style.css">
<link rel="stylesheet" type="text/css" href="%CONTENT_DIR%/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<ul class="topnav">
<li><a href="index.html">Home</a></li>
<li><a href="%CONTENT_DIR%/">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="/common/content/about/">About</a></li>
<li class="right"><a class="active" href="login.html">Log In</a></li>
<li><a href="%CONTENT_DIR%/about/">About</a></li>
<li class="right"><a class="active" href="%CONTENT_DIR%/login/">Log In</a></li>
</ul>
<div style="padding:0 16px;">
@ -25,21 +25,24 @@
</div>
<div class="item-2 round-border">
<p>Login:</p>
<form action="/common/content/login/redirect.php" method="post">
<form action="%CONTENT_DIR%/login/redirect.php" method="post">
<input type="text" name="name" maxlength="20" placeholder="Username" />
<input type="password" name="password" maxlength="256" placeholder="Password" />
<p></p>
<a href="/common/"> <button> Log in </button> </a>
<input type="submit" value="Log in" />
<!--
@Ilja: HTML button tags are only useful in conjuction to JavaScript or in little hacks like my <a> + <button>. In HTML forms, there is a special type of button for submitting forms (see above).
-->
</form>
<p></p>
</div>
<div class="item-3">
<p></p>
<a href="/common/content/signup/"> <button> Sign up </button> </a>
<a href="%CONTENT_DIR%/signup/"> <button> Sign up </button> </a>
<p></p>
</div>
<!-- <div class="item-4">
<center><a href="https://lostcave.ddnss.de/common/content/about/">About</a></center>
<center><a href="https://lostcave.ddnss.de%CONTENT_DIR%/about/">About</a></center>
</div> -->
</div>
</body>

0
content/news/index.php Normal file
View File

View File

@ -2,14 +2,14 @@
<html>
<head>
<title>Sign Up</title>
<link rel="stylesheet" type="text/css" href="/common/content/style.css">
<link rel="stylesheet" type="text/css" href="%CONTENT_DIR%/style.css">
</head>
<body>
<ul class="topnav">
<li><a href="index.html">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="/common/content/about">About</a></li>
<li class="right"><a href="login.html">Log In</a></li>
<li><a href="%CONTENT_DIR%/">Home</a></li>
<li><a href="%CONTENT_DIR%/news/">News</a></li>
<li><a href="%CONTENT_DIR%/about/">About</a></li>
<li class="right"><a href="%CONTENT_DIR%/login/">Log In</a></li>
</ul>
<div style="padding:0 16px;">
@ -24,7 +24,7 @@
</div>
<div class="item-2 round-border">
<p>Sign Up:</p>
<form action="/common/content/signup/redirect.php" method="post">
<form action="%CONTENT_DIR%/signup/redirect.php" method="post">
<p>Benutzername: <input type="text" name="user" placeholder="Benutzername"/> </p>
<p>E-Mail: <input type="text" name="email" placeholder="yeet@example.com"/> </p>
<p>Passwort: <input type="password" name="password" placeholder="Passwort"/> </p>

View File

@ -5,5 +5,4 @@
<body>
<h1> ThreadR </h1>
<h2> Welcome back, <?php echo $_GET['username']; ?>!</h2>
<h2> Welcome back, <?php echo $_SESSION['username']; ?>!</h2>

View File

@ -1,10 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="0;./common/" />
<meta http-equiv="refresh" content="0;%CONTENT_DIR%/" />
</head>
<body>
<p> Your browser seems to not support redirects. <br />
Please klick the following link to continue: <a href="./common/"> Go to home page... </a></p>
Please klick the following link to continue: <a href="%CONTENT_DIR%/"> Go to home page... </a></p>
</body>
</html>

View File

@ -3,5 +3,9 @@ echo "Deployment script for repository \"web-deployment\"
`date`
=============================================================================="
echo "Replacing %CONTENT_DIR% in all HTML and PHP files."
CONTENT_DIR="/common/content"
echo -e "`find ./ -name '*.html' -or -name '*.php' | sed "s/^/workingfile=\'/;s/\$/\'\; cat \\\$workingfile > .\/tmpdeploymentfile\; cat tmpdeploymentfile | sed \'s#%CONTENT_DIR%#\$CONTENT_DIR#\' > \\\$workingfile/"`\nrm tmpdeploymentfile" | bash -
echo "==============================================================================
Done."

View File

@ -1,27 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<title>Home page</title>
<link rel="stylesheet" type="text/css" href="/common/content/stylesheet.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<ul class="topnav">
<li><a class="active" href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="/common/content/about/">About</a></li>
<li class="right"><a href="/common/content/login/">Log In</a></li>
</ul>
<div style="padding:0 16px;">
<h2>ThreadR Homepage</h2>
<p></p>
<p></p>
<h4></h4>
</div>
</body>
<head>
<meta http-equiv="refresh" content="0;%CONTENT_DIR%/" />
</head>
<body>
<p> Your browser seems to not support redirects. <br />
Please klick the following link to continue: <a href="%CONTENT_DIR%/"> Go to home page... </a></p>
</body>
</html>

View File

@ -18,7 +18,7 @@ echo "Done.";
<html>
<head>
<title> Strassenkind Server Status Page </title>
<link rel="stylesheet" type="text/css" href="./common/content/style.css" />
<link rel="stylesheet" type="text/css" href=".%CONTENT_DIR%/style.css" />
<?php
if (!isset($_POST['ondemand'])) {
echo "<meta http-equiv=\"refresh\" content=\"20\" />";