Life sucks
This commit is contained in:
parent
a788533c4a
commit
2539675aed
@ -1,15 +1,17 @@
|
||||
FROM docker.io/alpine:latest
|
||||
|
||||
RUN apk update && apk add nginx php-fpm && \
|
||||
RUN apk update && \
|
||||
apk add tini nginx php-fpm && \
|
||||
adduser -D -g 'www' www && \
|
||||
mkdir /www && \
|
||||
chown -R www:www /var/lib/nginx && \
|
||||
chown -R www:www /www
|
||||
|
||||
COPY ./docker/nginx.conf /etc/nginx/nginx.conf
|
||||
COPY ./ /www
|
||||
#COPY ./ /www
|
||||
COPY ./docker/run.sh /opt/run.sh
|
||||
|
||||
RUN chmod +x /opt/run.sh
|
||||
|
||||
ENTRYPOINT ["tini", "--"]
|
||||
CMD ["/opt/run.sh"]
|
@ -6,4 +6,4 @@ Made by yours truly
|
||||
|
||||
docker build --no-cache -f ./Dockerfile --tag willy-club-website
|
||||
|
||||
docker run -dt -p 8080:8080 --name willy-club-website willy-club-website
|
||||
docker run -dt -v ./:/www -p 8080:8080 --name willy-club-website willy-club-website
|
@ -65,7 +65,8 @@ abstract class Route
|
||||
public static function put(string $path, callable $callback) { self::match('put', $path, $callback); }
|
||||
public static function patch(string $path, callable $callback) { self::match('patch', $path, $callback); }
|
||||
public static function delete(string $path, callable $callback) { self::match('delete', $path, $callback); }
|
||||
public static function any(string $path, callable $callback) { self::match('get|post|put|patch|delete', $path, $callback); }
|
||||
public static function options(string $path, callable $callback) { self::match('options', $path, $callback); }
|
||||
public static function any(string $path, callable $callback) { self::match('get|post|put|patch|delete|options', $path, $callback); }
|
||||
|
||||
public static function middleware(callable|array $middlewares)
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
nginx
|
||||
/usr/sbin/php-fpm*
|
||||
tail -f /var/log/nginx/error.log
|
||||
exec tail -f /var/log/nginx/error.log
|
@ -1,14 +1,5 @@
|
||||
<?php
|
||||
|
||||
// minimum PHP version required to continue
|
||||
$php_version = '8.1';
|
||||
if (version_compare(PHP_VERSION, $php_version, '<')) {
|
||||
http_response_code(500);
|
||||
echo 'This app requires a minimum of PHP ' . $php_version;
|
||||
die();
|
||||
}
|
||||
unset($php_version);
|
||||
|
||||
// PSR-4 like autoloader
|
||||
spl_autoload_register(
|
||||
function ($class_name) {
|
||||
@ -37,6 +28,14 @@ function json_response(mixed $data, int $status_code = 200)
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper for reading and decoding JSON from request body
|
||||
*/
|
||||
function json_decode_input(): array
|
||||
{
|
||||
return json_decode(file_get_contents('php://input'), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper for generating URLs
|
||||
*/
|
||||
|
@ -3,11 +3,10 @@ body {
|
||||
background: #fff;
|
||||
line-height: 1.5;
|
||||
font-size: 1rem;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* text based browsers */
|
||||
hr {
|
||||
display: none;
|
||||
}
|
||||
@ -16,26 +15,23 @@ a {
|
||||
color: #00f;
|
||||
}
|
||||
|
||||
h1, h2, h3 {
|
||||
font-weight: normal;
|
||||
border-bottom: 1px solid #e9ecef;
|
||||
padding-bottom: .25rem;
|
||||
}
|
||||
|
||||
header {
|
||||
background: #ddf;
|
||||
border-bottom: 1px solid #aaa;
|
||||
background: #77f;
|
||||
}
|
||||
header > nav {
|
||||
padding: 0.75rem;
|
||||
padding: .75rem;
|
||||
margin: auto;
|
||||
max-width: 37rem;
|
||||
max-width: 36rem;
|
||||
}
|
||||
header > nav > a {
|
||||
text-decoration: none;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
main {
|
||||
padding: 0 0.75rem 0 0.75rem;
|
||||
padding: 0 .75rem 0 .75rem;
|
||||
margin: auto;
|
||||
max-width: 37rem;
|
||||
max-width: 36rem;
|
||||
}
|
||||
|
||||
img {
|
||||
@ -55,20 +51,16 @@ tbody {
|
||||
}
|
||||
td, th {
|
||||
text-align: left;
|
||||
padding: .5rem;
|
||||
}
|
||||
tr {
|
||||
border-bottom: 1px solid #aaa;
|
||||
padding: .75rem;
|
||||
}
|
||||
tr:nth-child(even) {
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
pre, code {
|
||||
font-family: "DejaVu Sans Mono", Consolas, monospace;
|
||||
font-family: Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace;
|
||||
background: #eee;
|
||||
border: 1px solid #aaa;
|
||||
padding: .5rem;
|
||||
padding: .75rem;
|
||||
max-width: 100%;
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
@ -76,7 +68,20 @@ pre, code {
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
html {
|
||||
filter: invert(1);
|
||||
body {
|
||||
color: #fff;
|
||||
background: #000;
|
||||
}
|
||||
header {
|
||||
background: #111;
|
||||
}
|
||||
a {
|
||||
color: #aaf;
|
||||
}
|
||||
tr:nth-child(even) {
|
||||
background: #111;
|
||||
}
|
||||
pre, code {
|
||||
background: #111;
|
||||
}
|
||||
}
|
@ -19,6 +19,4 @@ Route::get('/error', fn() => 1 / 0);
|
||||
|
||||
// since no route was matched we show a page not found error
|
||||
http_response_code(404);
|
||||
view('templates/header', ['title' => 'Page not found']);
|
||||
view('errors/404');
|
||||
view('templates/footer');
|
@ -1,3 +1,5 @@
|
||||
<?=view('templates/header', ['title' => 'Page not found'])?>
|
||||
<h1>Page not found</h1>
|
||||
<p>The page you requested could not be found on this server</p>
|
||||
<a href="<?=url('/')?>">Go home</a>
|
||||
<?=view('templates/footer')?>
|
@ -2,7 +2,7 @@
|
||||
|
||||
<h1>Welcome to the Willy Club</h1>
|
||||
|
||||
<p>Theres more than just willies! Most of the time.</p>
|
||||
<p>More than just willies! Most of the time.</p>
|
||||
|
||||
<p>Not at all associated with thewilly.club ASSHOLES squatting my domain name with their shitty NFTs, this is the original.</p>
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h1>Flirt with the WEBMASTER</h1>
|
||||
<h1>Flirt with the webmaster</h1>
|
||||
|
||||
<p>Send me a nice and positive message on matrix: <a href="https://matrix.to/#/@william:willy.club">@william:willy.club</a></p>
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
<header>
|
||||
<nav>
|
||||
<span>[ <a href="<?=url('/')?>">Home</a> ]</span>
|
||||
<a href="<?=url('/')?>">the Willy Club</a>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user