mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-18 09:29:46 +02:00
Initial commit (WIP)
This commit is contained in:
committed by
Quentin McGaw (laptop)
parent
ba676f7baf
commit
07716fe8b0
28
docker/entrypoint.sh
Normal file
28
docker/entrypoint.sh
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
# TODO fail on any error
|
||||
|
||||
if [ "${DB_CONNECTION}" = "sqlite" ]; then
|
||||
if [ ! -f /2fauth/.sqlite ]; then
|
||||
touch /2fauth/.sqlite
|
||||
fi
|
||||
rm -f /srv/database/.sqlite
|
||||
ln -sF /2fauth/.sqlite /srv/database/.sqlite
|
||||
fi
|
||||
|
||||
sudo service php7.3-fpm start
|
||||
sudo service php7.3-fpm status
|
||||
|
||||
if [ -f /2fauth/installed ]; then
|
||||
php artisan migrate
|
||||
php artisan config:clear
|
||||
else
|
||||
php artisan migrate:refresh
|
||||
php artisan passport:install
|
||||
php artisan storage:link
|
||||
php artisan config:cache
|
||||
echo "" > /2fauth/installed
|
||||
fi
|
||||
|
||||
nginx
|
||||
sudo service php7.3-fpm stop
|
38
docker/nginx.conf
Normal file
38
docker/nginx.conf
Normal file
@@ -0,0 +1,38 @@
|
||||
daemon off;
|
||||
# user www-data www-data;
|
||||
events {}
|
||||
http {
|
||||
include mime.types;
|
||||
|
||||
server {
|
||||
listen 8000;
|
||||
server_name 2fAuth;
|
||||
root /srv/public;
|
||||
|
||||
# add_header X-Frame-Options "SAMEORIGIN";
|
||||
# add_header X-Content-Type-Options "nosniff";
|
||||
|
||||
index index.php;
|
||||
|
||||
charset utf-8;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
|
||||
location = /favicon.ico { access_log off; log_not_found off; }
|
||||
location = /robots.txt { access_log off; log_not_found off; }
|
||||
|
||||
error_page 404 /index.php;
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
|
||||
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
|
||||
location ~ /\.(?!well-known).* {
|
||||
deny all;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user