From 2539675aedde6ff117e149fab3103a5e488e2e4e Mon Sep 17 00:00:00 2001 From: William Date: Fri, 20 Jan 2023 20:33:45 +0100 Subject: [PATCH] Life sucks --- Dockerfile | 6 +++-- README.md | 2 +- app/WillySoft/Http/Route.php | 13 ++++----- docker/run.sh | 2 +- public/index.php | 17 ++++++------ public/static/style/main.css | 51 ++++++++++++++++++++---------------- routes/start.php | 4 +-- views/errors/404.php | 4 ++- views/pages/home.php | 6 ++--- views/templates/header.php | 2 +- 10 files changed, 57 insertions(+), 50 deletions(-) diff --git a/Dockerfile b/Dockerfile index ad27b32..03c2839 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] \ No newline at end of file diff --git a/README.md b/README.md index 8050e20..cdd9621 100644 --- a/README.md +++ b/README.md @@ -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 \ No newline at end of file + docker run -dt -v ./:/www -p 8080:8080 --name willy-club-website willy-club-website \ No newline at end of file diff --git a/app/WillySoft/Http/Route.php b/app/WillySoft/Http/Route.php index 2450e97..3c6b469 100644 --- a/app/WillySoft/Http/Route.php +++ b/app/WillySoft/Http/Route.php @@ -60,12 +60,13 @@ abstract class Route die(); } - public static function get(string $path, callable $callback) { self::match('get', $path, $callback); } - public static function post(string $path, callable $callback) { self::match('post', $path, $callback); } - 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 get(string $path, callable $callback) { self::match('get', $path, $callback); } + public static function post(string $path, callable $callback) { self::match('post', $path, $callback); } + 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 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) { diff --git a/docker/run.sh b/docker/run.sh index efb75d9..9f20bc0 100644 --- a/docker/run.sh +++ b/docker/run.sh @@ -1,4 +1,4 @@ #!/bin/sh nginx /usr/sbin/php-fpm* -tail -f /var/log/nginx/error.log \ No newline at end of file +exec tail -f /var/log/nginx/error.log \ No newline at end of file diff --git a/public/index.php b/public/index.php index fdd5415..ee35a55 100644 --- a/public/index.php +++ b/public/index.php @@ -1,14 +1,5 @@ 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; } } \ No newline at end of file diff --git a/routes/start.php b/routes/start.php index c3b0e39..50c8c5e 100644 --- a/routes/start.php +++ b/routes/start.php @@ -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'); \ No newline at end of file +view('errors/404'); \ No newline at end of file diff --git a/views/errors/404.php b/views/errors/404.php index ac4beab..1eaf2d5 100644 --- a/views/errors/404.php +++ b/views/errors/404.php @@ -1,3 +1,5 @@ + 'Page not found'])?>

Page not found

The page you requested could not be found on this server

-Go home \ No newline at end of file +Go home + \ No newline at end of file diff --git a/views/pages/home.php b/views/pages/home.php index 8da1f7d..d386116 100644 --- a/views/pages/home.php +++ b/views/pages/home.php @@ -2,9 +2,9 @@

Welcome to the Willy Club

-

Theres more than just willies! Most of the time.

+

More than just willies! Most of the time.

-

Not at all associated with thewilly.club ASSHOLES squatting my domain name with their shitty NFTs, this is the original.

+

Not at all associated with thewilly.club ASSHOLES squatting my domain name with their shitty NFTs, this is the original.

This space hosts some services for me and friends, maybe it will host some other stuff down the line if I'm not too lazy.

@@ -27,7 +27,7 @@ -

Flirt with the WEBMASTER

+

Flirt with the webmaster

Send me a nice and positive message on matrix: @william:willy.club

diff --git a/views/templates/header.php b/views/templates/header.php index 0280ed9..4e33048 100644 --- a/views/templates/header.php +++ b/views/templates/header.php @@ -11,7 +11,7 @@