about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2020-06-30 00:31:04 -0400
committerBen Morrison <ben@gbmor.dev>2020-06-30 02:19:24 -0400
commit5db8118b173d9ff0c4bc2d2c55e72967090ad991 (patch)
tree6dd25bce475286335bd3089c076b80d7b569c029
parent603ac04ec07b8140a147e1eafaf0e3fc6baeee68 (diff)
downloadsite-5db8118b173d9ff0c4bc2d2c55e72967090ad991.tar.gz
reducing use of php in favor of shellscript build
-rw-r--r--.gitignore7
-rw-r--r--_webmention.html2
-rw-r--r--assets/helloworld.c (renamed from helloworld.c)0
-rwxr-xr-xassets/helloworld.cgi (renamed from helloworld.cgi)bin410784 -> 410784 bytes
-rw-r--r--assets/icon.png (renamed from icon.png)bin1059 -> 1059 bytes
-rw-r--r--assets/kcgi-starter.tar.gz (renamed from kcgi-starter.tar.gz)bin2208 -> 2208 bytes
-rw-r--r--assets/tilde.css (renamed from tilde.css)0
-rwxr-xr-xbuild.sh63
-rw-r--r--extra/icon-large.png (renamed from icon-large.png)bin4059 -> 4059 bytes
-rw-r--r--extra/icon.xcf (renamed from icon.xcf)bin5608 -> 5608 bytes
-rwxr-xr-xfaq.php61
-rw-r--r--[-rwxr-xr-x]html/coc.html (renamed from coc.php)14
-rw-r--r--html/faq.html67
-rw-r--r--[-rwxr-xr-x]html/index.html (renamed from index.php)11
-rw-r--r--html/signup.html35
-rwxr-xr-xhtml/stats.php (renamed from stats.php)8
-rwxr-xr-xhtml/submit.php (renamed from submit.php)9
-rw-r--r--inc/_header.html7
-rw-r--r--inc/_logonav.html (renamed from _header.html)0
-rw-r--r--inc/_news.html (renamed from _newsdata.html)0
-rwxr-xr-xsignup.php41
-rw-r--r--tilde.json1
22 files changed, 185 insertions, 141 deletions
diff --git a/.gitignore b/.gitignore
index 37ab0db..1521c8b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1 @@
-fuzzies.log
-ultimate-email
-newusers.dat
-/table.*
-userlist
-bannedusers.php
+dist
diff --git a/_webmention.html b/_webmention.html
deleted file mode 100644
index ced3288..0000000
--- a/_webmention.html
+++ /dev/null
@@ -1,2 +0,0 @@
-<link rel="webmention" href="https://webmention.io/tilde.institute/webmention" />
-<link rel="pingback" href="https://webmention.io/tilde.institute/xmlrpc" />
diff --git a/helloworld.c b/assets/helloworld.c
index fcae386..fcae386 100644
--- a/helloworld.c
+++ b/assets/helloworld.c
diff --git a/helloworld.cgi b/assets/helloworld.cgi
index 72d7a16..72d7a16 100755
--- a/helloworld.cgi
+++ b/assets/helloworld.cgi
Binary files differdiff --git a/icon.png b/assets/icon.png
index d54a060..d54a060 100644
--- a/icon.png
+++ b/assets/icon.png
Binary files differdiff --git a/kcgi-starter.tar.gz b/assets/kcgi-starter.tar.gz
index 9875fb5..9875fb5 100644
--- a/kcgi-starter.tar.gz
+++ b/assets/kcgi-starter.tar.gz
Binary files differdiff --git a/tilde.css b/assets/tilde.css
index 416c6e7..416c6e7 100644
--- a/tilde.css
+++ b/assets/tilde.css
diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..841ba8f
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+set -e
+
+build()
+{
+	printf '\n%s\n' 'Starting build ...'
+	mkdir -p dist
+
+	for FILE in html/*; do
+		FILENAME=$(basename "$FILE")
+		printf '\n%s %s\n' 'Building:' "$FILENAME"
+
+		if [ "$FILENAME" != 'index.html' ]; then
+			sed '/{{HEADER}}/r inc/_header.html' "$FILE" | sed '/{{HEADER}}/D' | sed '/{{LOGONAV}}/r inc/_logonav.html' | sed '/{{LOGONAV}}/D' > "dist/$FILENAME"
+		else
+		    sed '/{{HEADER}}/r inc/_header.html' "$FILE" | sed '/{{HEADER}}/D' | sed '/{{LOGONAV}}/r inc/_logonav.html' | sed '/{{LOGONAV}}/D' | sed '/{{NEWS}}/r inc/_news.html' | sed '/{{NEWS}}/D' > "dist/$FILENAME"
+        fi
+	done
+
+	cp assets/* dist/
+	printf '%s\n\n' 'Done!'
+}
+
+installation()
+{
+	if [ ! -d dist ]; then
+		printf '\n%s\n\n' 'Please build first: ./build.sh'
+		exit 1
+	fi
+	
+	INSTDIR=/var/www/htdocs
+
+	printf '\n%s %s\n' 'Installing to' "$INSTDIR"
+
+	for FILE in dist/*; do
+		FILENAME=$(basename "$FILE")
+		EXT=$(echo "$FILENAME" | cut -d'.' -f2)
+
+		if [ "$EXT" = 'php' ] || [ "$EXT" = 'cgi' ]; then
+			install -m755 "$FILE" "$INSTDIR/$FILENAME"
+		else
+			install -m644 "$FILE" "$INSTDIR/$FILENAME"
+		fi
+	done
+
+	printf '%s\n\n' 'Done!'
+}
+
+clean()
+{
+	printf '\n%s\n\n' 'Cleaning ...'
+	rm -rf dist
+}
+
+case "$1" in
+	install)
+		installation; exit ;;
+	clean)
+		clean; exit ;;
+	*)
+		build
+esac
\ No newline at end of file
diff --git a/icon-large.png b/extra/icon-large.png
index e5cac6f..e5cac6f 100644
--- a/icon-large.png
+++ b/extra/icon-large.png
Binary files differdiff --git a/icon.xcf b/extra/icon.xcf
index 10cf24d..10cf24d 100644
--- a/icon.xcf
+++ b/extra/icon.xcf
Binary files differdiff --git a/faq.php b/faq.php
deleted file mode 100755
index c7bc5f1..0000000
--- a/faq.php
+++ /dev/null
@@ -1,61 +0,0 @@
-<!DOCTYPE html PUBLIC
-  "-//W3C//DTD XHTML 1.1//EN"
-  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
-
-<head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <meta name="viewport" content="width=device-width, initial-scale=1" />
-    <title>tilde.institute :: FAQ</title>
-    <link rel="stylesheet" href="tilde.css" type="text/css" />
-    <link rel="icon" type="image/png" href="icon.png" />
-    <?php include("_webmention.html") ?>
-</head>
-
-<body>
-    <div id="container">
-        <?php include("_header.html"); ?>
-	<div id="content" class="faq">
-		<h1>FAQ</h1>
-
-		<p class="q">How do I change my interactive shell?</p>
-		<p>Once you've logged in, check the path for your desired shell with</p>
-		<div class="code">$ which fish</div>
-		<p>Replacing <code>fish</code> with the the shell you want. In this case, the path will be <code>/usr/local/bin/fish</code>
-			Now, run:</p>
-		<div class="code">$ EDITOR=nano chsh</div>
-		<p>Change the <code>Shell</code> line to read:</p>
-		<div class="code">Shell: /usr/local/bin/fish</div>
-		<p>Save and exit. You'll need to log out then back in.</p>
-
-		<p class="q">How do I change the index page of my site?</p>
-		<p>Because of the way <code>httpd(8)</code> is set up, you'll need to ask in <code>#institute</code> or send an email to <code>admins@tilde.institute</code></p>
-
-		<p class="q">Can you install this package for me?</p>
-		<p>As long as it's in the OpenBSD ports tree, and doesn't facilitate any potentially malicious behavior (like <code>nmap</code>),
-			then it's probably not a big deal. Either hop on IRC and ask in <code>#institute</code> or send an email to <code>admins@tilde.institute</code></p>
-
-		<p class="q">How do I authenticate with SMTP remotely?</p>
-		<p>Only local access to SMTP is allowed. However, you can use an SSH tunnel on your machine to send mail.</p>
-		<div class="code">ssh -nNTL 25:localhost:25 tilde.institute</div>
-		<p>You won't need to supply a username or password when sending mail via <code>localhost:25</code> this way, since you're already authenticated via SSH.</p>
-
-		<p class="q">Can you whitelist a port for me in the firewall?</p>
-		<p>Sorry, but this presents too much of a security risk on a public-access system.</p>
-
-		<p class="q">Are user services allowed?</p>
-		<p>Generally, yes. If you're running something that's using a ton of resources or in some way affecting other users or the general use of the system,
-			then we'll kill it. Just be aware of what you're running and how it may affect the system and other users.</p>
-
-		<p class="q">Are IRC bots allowed?</p>
-		<p>Yes, though there are restrictions on their use on the <code>tilde.chat</code> IRC network. They should not reside in <code>#meta</code>, instead keep
-			them in a private channel or in <code>#bots</code>. Bots must also conform to the <a href="https://tildegit.org/tildeverse/rfcs/src/branch/master/rfcs/rfc2.md">bot guidelines listed here</a>.</p>
-		<p>Don't run <code>eggdrop</code> from tilde.institute. There are legitimate uses for <code>eggdrop</code>, but separating the people with some kind
-			of legitimate use from malicious users is tiring. So, no <code>eggdrop</code>.</p>
-		<br />
-		<br />
-        </div>
-    </div>
-</body>
-
-</html>
diff --git a/coc.php b/html/coc.html
index afd8496..63c1b01 100755..100644
--- a/coc.php
+++ b/html/coc.html
@@ -1,20 +1,14 @@
-<!DOCTYPE html PUBLIC
-  "-//W3C//DTD XHTML 1.1//EN"
-  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 
 <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <meta name="viewport" content="width=device-width, initial-scale=1" />
     <title>tilde.institute :: Code of Conduct</title>
-    <link rel="stylesheet" href="tilde.css" type="text/css" />
-    <link rel="icon" type="image/png" href="icon.png" />
-    <?php include("_webmention.html") ?>
+    {{HEADER}}
 </head>
 
 <body>
     <div id="container">
-        <?php include("_header.html"); ?>
+        {{LOGONAV}}
         <div id="content">
             <h1>tilde.institute code of conduct</h1>
             <p><strong>tl;dr</strong>: Be kind to each other. Think carefully about the words you
@@ -118,4 +112,4 @@
     </div>
 </body>
 
-</html>
+</html>
\ No newline at end of file
diff --git a/html/faq.html b/html/faq.html
new file mode 100644
index 0000000..436504d
--- /dev/null
+++ b/html/faq.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+
+<head>
+	<title>tilde.institute :: FAQ</title>
+	{{HEADER}}
+</head>
+
+<body>
+	<div id="container">
+		{{LOGONAV}}
+		<div id="content" class="faq">
+			<h1>FAQ</h1>
+
+			<p class="q">How do I change my interactive shell?</p>
+			<p>Once you've logged in, check the path for your desired shell with</p>
+			<div class="code">$ which fish</div>
+			<p>Replacing <code>fish</code> with the the shell you want. In this case, the path will be
+				<code>/usr/local/bin/fish</code>
+				Now, run:</p>
+			<div class="code">$ EDITOR=nano chsh</div>
+			<p>Change the <code>Shell</code> line to read:</p>
+			<div class="code">Shell: /usr/local/bin/fish</div>
+			<p>Save and exit. You'll need to log out then back in.</p>
+
+			<p class="q">How do I change the index page of my site?</p>
+			<p>Because of the way <code>httpd(8)</code> is set up, you'll need to ask in <code>#institute</code> or send
+				an email to <code>admins@tilde.institute</code></p>
+
+			<p class="q">Can you install this package for me?</p>
+			<p>As long as it's in the OpenBSD ports tree, and doesn't facilitate any potentially malicious behavior
+				(like <code>nmap</code>),
+				then it's probably not a big deal. Either hop on IRC and ask in <code>#institute</code> or send an email
+				to <code>admins@tilde.institute</code></p>
+
+			<p class="q">How do I authenticate with SMTP remotely?</p>
+			<p>Only local access to SMTP is allowed. However, you can use an SSH tunnel on your machine to send mail.
+			</p>
+			<div class="code">ssh -nNTL 25:localhost:25 tilde.institute</div>
+			<p>You won't need to supply a username or password when sending mail via <code>localhost:25</code> this way,
+				since you're already authenticated via SSH.</p>
+
+			<p class="q">Can you whitelist a port for me in the firewall?</p>
+			<p>Sorry, but this presents too much of a security risk on a public-access system.</p>
+
+			<p class="q">Are user services allowed?</p>
+			<p>Generally, yes. If you're running something that's using a ton of resources or in some way affecting
+				other users or the general use of the system,
+				then we'll kill it. Just be aware of what you're running and how it may affect the system and other
+				users.</p>
+
+			<p class="q">Are IRC bots allowed?</p>
+			<p>Yes, though there are restrictions on their use on the <code>tilde.chat</code> IRC network. They should
+				not reside in <code>#meta</code>, instead keep
+				them in a private channel or in <code>#bots</code>. Bots must also conform to the <a
+					href="https://tildegit.org/tildeverse/rfcs/src/branch/master/rfcs/rfc2.md">bot guidelines listed
+					here</a>.</p>
+			<p>Don't run <code>eggdrop</code> from tilde.institute. There are legitimate uses for <code>eggdrop</code>,
+				but separating the people with some kind
+				of legitimate use from malicious users is tiring. So, no <code>eggdrop</code>.</p>
+			<br />
+			<br />
+		</div>
+	</div>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/index.php b/html/index.html
index e0ce20e..b37ed4e 100755..100644
--- a/index.php
+++ b/html/index.html
@@ -4,18 +4,13 @@
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 
 <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <meta name="viewport" content="width=device-width, initial-scale=1" />
     <title>tilde.institute :: Public-access OpenBSD system</title>
-    <link rel="stylesheet" href="tilde.css" type="text/css" />
-    <link rel="icon" type="image/png" href="icon.png" />
-    <link rel="me" href="https://github.com/gbmor" />
-    <?php include("_webmention.html") ?>
+    {{HEADER}}
 </head>
 
 <body>
     <div id="container">
-        <?php include("_header.html"); ?>
+	{{LOGONAV}}
         <div id="front-content">
             <p>Welcome to tilde.institute, a public-access UNIX system running OpenBSD. This is a space for people to
                 explore the OpenBSD operating system, in addition to exploring the more social
@@ -122,7 +117,7 @@
 		<br />
         </div>
         <div id="news">
-            <?php include("_newsdata.html"); ?>
+	    {{NEWS}}
 	</div>
 	<div id="sshfp">
           <pre>
diff --git a/html/signup.html b/html/signup.html
new file mode 100644
index 0000000..482a4ba
--- /dev/null
+++ b/html/signup.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+
+<head>
+    <title>tilde.institute :: Sign Up</title>
+    {{HEADER}}
+</head>
+
+<body>
+    <div id="container">
+        {{LOGONAV}}
+        <div id="content" class="signup">
+            <h1>Request an Account</h1>
+            <p>
+                If you haven't received the welcome email within 24 hours, please check your spam folder.
+            </p>
+            <p>
+            <form action="submit.php">
+                <h3>Desired Username:<br /></h3>
+                <input type="text" size="48" name="username" />
+                <h3>Your Email Address:<br /></h3>
+                <input type="email" size="48" name="email" />
+                <h3>What interests you about
+                    tilde.institute?<br /></h3>
+                <input type="text" size="48" name="interest" />
+                <h3>Paste Your SSH Key in OpenSSH Format:<br /></h3>
+                <input type="text" size="48" name="sshkey" /><br />
+                <input type="submit" value="Submit" />
+            </form>
+            </p>
+        </div>
+    </div>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/stats.php b/html/stats.php
index 4109048..3ed3a27 100755
--- a/stats.php
+++ b/html/stats.php
@@ -3,16 +3,12 @@
   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <meta name="viewport" content="width=device-width, initial-scale=1" />
     <title>tilde.institute :: Stats</title>
-    <link rel="stylesheet" href="tilde.css" type="text/css"/>
-    <link rel="icon" type="image/png" href="icon.png"/>
-    <?php include("_webmention.html") ?>
+    {{HEADER}}
 </head>
 <body>
 <div id="container">
-    <?php include("_header.html"); ?>
+    {{LOGONAV}}
     <div id="content">
         <br />
         <!--<p><code><?php include("table.weekconns"); ?></code> unique users logged in this week (resets Saturdays <code>00:00 UTC</code>)</p>-->
diff --git a/submit.php b/html/submit.php
index fe76f51..1b297e8 100755
--- a/submit.php
+++ b/html/submit.php
@@ -3,15 +3,12 @@
   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 <head>
-        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-        <meta name="viewport" content="width=device-width, initial-scale=1" />
-        <title>tilde.institute :: Sign Up</title>
-        <link rel="stylesheet" href="tilde.css" type="text/css"/>
-        <link rel="icon" type="image/png" href="icon.png"/>
+    <title>tilde.institute :: Sign Up</title>
+    {{HEADER}}
 </head>
 <body>
 <div id="container">
-    <?php include("_header.html"); ?>
+    {{LOGONAV}}
 	<div id="content" style="text-align: center;">
 <?php
 require_once('bannedusers.php');
diff --git a/inc/_header.html b/inc/_header.html
new file mode 100644
index 0000000..cfd4d76
--- /dev/null
+++ b/inc/_header.html
@@ -0,0 +1,7 @@
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<link rel="stylesheet" href="tilde.css" type="text/css" />
+<link rel="icon" type="image/png" href="icon.png" />
+<link rel="me" href="https://github.com/gbmor" />
+<link rel="webmention" href="https://webmention.io/tilde.institute/webmention" />
+<link rel="pingback" href="https://webmention.io/tilde.institute/xmlrpc" />
\ No newline at end of file
diff --git a/_header.html b/inc/_logonav.html
index 78e5c78..78e5c78 100644
--- a/_header.html
+++ b/inc/_logonav.html
diff --git a/_newsdata.html b/inc/_news.html
index 084fae8..084fae8 100644
--- a/_newsdata.html
+++ b/inc/_news.html
diff --git a/signup.php b/signup.php
deleted file mode 100755
index 0f8da66..0000000
--- a/signup.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE html PUBLIC
-  "-//W3C//DTD XHTML 1.1//EN"
-  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
-
-<head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <meta name="viewport" content="width=device-width, initial-scale=1" />
-    <title>tilde.institute :: Sign Up</title>
-    <link rel="stylesheet" href="tilde.css" type="text/css" />
-    <link rel="icon" type="image/png" href="icon.png" />
-    <?php include("_webmention.html") ?>
-</head>
-
-<body>
-    <div id="container">
-        <?php include("_header.html"); ?>
-        <div id="content" class="signup">
-	    <h1>Request an Account</h1>
-            <p>
-                If you haven't received the welcome email within 24 hours, please check your spam folder.
-            </p>
-            <p>
-                <form action="submit.php">
-                    <h3>Desired Username:<br /></h3>
-                    <input type="text" size="48" name="username" />
-                    <h3>Your Email Address:<br /></h3>
-                    <input type="email" size="48" name="email" />
-                    <h3>What interests you about
-                        tilde.institute?<br /></h3>
-                    <input type="text" size="48" name="interest" />
-                    <h3>Paste Your SSH Key in OpenSSH Format:<br /></h3>
-                    <input type="text" size="48" name="sshkey" /><br />
-                    <input type="submit" value="Submit" />
-                </form>
-            </p>
-        </div>
-    </div>
-</body>
-
-</html>
diff --git a/tilde.json b/tilde.json
deleted file mode 100644
index b0f27f7..0000000
--- a/tilde.json
+++ /dev/null
@@ -1 +0,0 @@
-{"name":"tilde.institute","url":"https://tilde.institute","signup_url":"https://tilde.institute/signup","user_count":276,"want_users":true,"admin_email":"admins@tilde.institute","description":"A public-access machine where users can explore the OpenBSD operating system.","last_generated":"Tue, 30 Jun 2020 03:00:02 +0000"}
\ No newline at end of file