Skip to content

Commit

Permalink
chore: boilerplate
Browse files Browse the repository at this point in the history
manifest
robots
security
favicon
nginx static files expire
  • Loading branch information
Wojciech Międzybrodzki committed Nov 11, 2024
1 parent f721043 commit 0f057a9
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 7 deletions.
29 changes: 29 additions & 0 deletions .ops/server.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,33 @@ server {
location ~ \.php$ {
return 404;
}

location = /manifest.json {
return 302 http://${REDIRECT_DOMAIN}/app.webmanifest;
}

location = /app.webmanifest {
root /app/public/boilerplate;
expires 24h;
add_header Cache-Control "public";
default_type "application/manifest+json";
log_not_found off;
access_log off;
}

location ~* \/(robots\.txt|\.well-known\/security\.txt)$ {
root /app/public/boilerplate;
expires 24h;
add_header Cache-Control "public";
log_not_found off;
access_log off;
}

location ~* \/(favicon.ico|favicon\-(.*)\.png|android\-(.*)\.png|apple\-touch\-icon.png) {
root /app/public/boilerplate;
expires 60m;
add_header Cache-Control "public";
log_not_found off;
access_log off;
}
}
3 changes: 2 additions & 1 deletion config/packages/monolog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ when@dev:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
path: php://stderr
level: debug
channels: ["!event"]
console:
Expand Down Expand Up @@ -51,3 +51,4 @@ when@prod:
type: stream
channels: [deprecation]
path: php://stderr
formatter: monolog.formatter.json
16 changes: 11 additions & 5 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.8'
secrets:
jwt_public:
file: ./.ops/jwt/public.pem
Expand All @@ -12,11 +11,16 @@ services:
dockerfile: Dockerfile
context: .
target: test
tags:
- "ghcr.io/wojciechem/legacy:dev-local"
env_file:
- .env
secrets:
- jwt_public
- jwt_private
volumes:
- ./vendor:/app/vendor
- ./src:/app/src

nginx:
image: nginx:1.25.1
Expand All @@ -31,18 +35,20 @@ services:
- NGINX_HOST=localhost
- APP_HOST=webapp
- APP_PORT=9000
- REDIRECT_DOMAIN=localhost:8765

webapp-frankenphp:
image: ghcr.io/wojciechem/legacy:dev-local
image: ghcr.io/wojciechem/legacy:dev-local-frankenphp
build:
dockerfile: Dockerfile
context: .
target: test
args:
- BASE_IMAGE=dunglas/frankenphp:main
profiles:
- dev
# profiles:
# - dev
ports:
- target: 80
published: 8765
published: 8766
protocol: tcp

7 changes: 7 additions & 0 deletions public/boilerplate/.well-known/security.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Contact: mailto:[email protected]

# I tend to forget various expiration dates. All data in this file is likely still up-to-date even if it says otherwise.
Expires: 2026-11-11T09:00:00.000Z

# I will still welcome message in any other language and read it using a translator
Preferred-Languages: en,pl
Binary file added public/boilerplate/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/boilerplate/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/boilerplate/app.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"Legacy","short_name":"legacy","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
Binary file added public/boilerplate/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/boilerplate/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/boilerplate/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/boilerplate/favicon.ico
Binary file not shown.
5 changes: 5 additions & 0 deletions public/boilerplate/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# I salute our robot overlords
# Unite! Join the man-machine brotherhood
User-agent: *
Disallow: /tmp/
Disallow: /temp/
3 changes: 2 additions & 1 deletion src/Operations/UI/Alive.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
use Symfony\Component\Routing\Annotation\Route;

#[Route('/aliveness')]
#[Route('/alive')]
#[AsController]
final class Alive
{
public function __invoke(): JsonResponse
{
return new JsonResponse(['alive' => true]);
return new JsonResponse(['alive' => true], headers: []);
}
}

0 comments on commit 0f057a9

Please sign in to comment.