Compare commits

..

1 Commits

Author SHA1 Message Date
ef9be5b88e master (#44)
Reviewed-on: #44
2022-11-26 15:32:34 +00:00
8 changed files with 26 additions and 130 deletions

View File

@ -1,5 +0,0 @@
nginx.Dockerfile
php.Dockerfile
.dockerignore
.gitignore
LICENSE

View File

@ -1,5 +1,3 @@
# athena.fb-infra.uk
**Athena has been superceded by OwlBoard - [git](https://git.fjla.uk/OwlBoard) - [web](https://owlboard.info)**
**This repository is archived**
The web-app at athena.fb-infra.uk

View File

@ -1,40 +0,0 @@
#!/bin/bash
ROOTIN="/data/in"
ROOTOUT="/data/out"
echo "Running UglifyJS on /data/in folder"
uglifyjs-folder "$ROOTIN" -x ".js" -eo "$ROOTOUT"
echo "Running UglifyCSS"
CSSIN="/data/in/styles/"
CSSOUT="/data/out/styles"
cd $CSSIN
echo "Changed directory"
for f in *
do
if [ -f "$f" ]; then
uglifycss "$f" --output "$f";
fi
done
echo "Moving 'styles' to 'out'"
cp -r $CSSIN $CSSOUT
echo "Running html-minifier-terser on /folder"
HTMLIN="/data/in/"
HTMLOUT="/data/out"
html-minifier-terser --collapse-whitespace --remove-comments --file-ext html --input-dir /data/in/ --output-dir /data/out/
echo "Moving JSON Manifest file from root to output"
cat /data/in/manifest.json | jq -c > /data/out/manifest.json
echo "Moving other files folder from in/ to out/"
cp -r /data/in/assets /data/out/assets
cp -r /data/in/error-pages /data/out/error-pages
cp -r /data/in/page-blocks /data/out/page-blocks
cp -r /data/in/*.php /data/out
echo "Running GZIP & Brotli on all HTML, JS, CSS, JSON, SVG, TTF, VCF, PUB files"
find /data/out -type f -name \*.html -or -name \*.vcf -or -name \*.pub -or -name \*.js -or -name \*.css -or -name \*.json -or -name \*.svg -or -name \*.ttf | while read file; do gzip -k -9 $file; brotli -k -q 11 $file; done

View File

@ -1,57 +0,0 @@
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 128;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
gzip_static on;
brotli_static on;
server {
listen 80;
server_name localhost;
access_log /var/log/nginx/access.log;
root /site;
location ~ /(.git|php|page-blocks) {
deny all;
}
location / {
index index.php;
try_files $uri $uri/ $uri/index.php &uri/index.html =404;
break;
expires 7d;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass localhost:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
error_page 403 /error-pages/403.php;
error_page 404 /error-pages/404.php;
error_page 500 501 502 503 504 /error-pages/50x.php;
}
}

View File

@ -27,9 +27,8 @@
<br>
<h2 hidden>Server Maintenance</h2>
<p hidden>Athena may become unavailable for several hours on 07/03/2023
during a server migration. Every effort will be made to prevend downtime.
</p>
<p hidden>Athena may be completely or partially unavailable between 1900-2300 on 07/10/2022,
apologies for any inconvinience caused to you.</p>
<h2>Quick Links</h2>
<button class="actionbutton" onclick="gotoInfoBoard('bathspa')">BTH</button>
@ -45,8 +44,8 @@
<br>
<br>
<div class="text-description">
<p>Athena has been replaced with <a href="https://owlboard.info">OwlBoard</a>.</p>
<p>Athena will remain available for use as OwlBoard does not yet offer staff versions of boards.</p>
<p>This is an Alpha release and is under testing.</p>
<p>Some features may not work and some stations may not be available.</p>
</div>
<!-- Footer -->

View File

@ -41,13 +41,29 @@
<!-- Main Content Begins -->
<?php require "./page-blocks/title-image.php";?>
<h1>Athena is retiring</h1>
<h1>Please help us fix your issue</h1>
<p>It has been replaced with <a href="https://owlboard.info">OwlBoard</a>.</p>
<p>Give as much detail as possible so we can try to fix the problem.</p>
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" method="post">
<span class="form-info">Subject:</span>
<br>
<input class="form-text-small" type="text" name="subject" placeholder="Subject" value="<?php echo $title;?>">
<br>
<br>
<span class="form-info">Details:</span>
<br>
<textarea class="form-text-large" placeholder="Please give as much detail here as possible" name="detail"><?php echo $detail;?></textarea>
<br>
<br>
<input class="actionbutton" type="submit">
<br>
<div class="text-description">
<p>
Currently, OwlBoard does not offer staff versions of departure boards.
Because of this, Athena will not have any further issues fixed but will remain
available until OwlBoard offers this feature.
On submission of this form, your browsers User Agent string will be
collected alongside the information you provide above and will be
posted to the <a class="inlinelink" href="https://git.fjla.uk/fred.boniface/athena.fb-infra.uk/issues?q=&state=open">
issue tracker</a>.
</p>
<br>
<br>

View File

@ -1,12 +0,0 @@
FROM fedora:latest as compressor
RUN dnf install brotli nodejs npm jq -y
RUN npm i uglifyjs-folder uglifycss html-minifier-terser -g
COPY . /data/in
RUN bash /data/in/conf/deploy.sh
FROM fholzer/nginx-brotli:latest
RUN rm /etc/nginx/nginx.conf
RUN apk update
RUN apk add --upgrade libxml2 libxslt
COPY ./conf/nginx.conf /etc/nginx/nginx.conf
COPY --from=compressor /data/out/ /site/

View File

@ -1,3 +0,0 @@
FROM php:8.2.1-fpm-alpine
COPY . /site