chore: reset repository history
This commit is contained in:
commit
b451771169
172 files changed
+26281
No files matched your search
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
until mc alias set local http://minio:9000 "${MINIO_ROOT_USER}" "${MINIO_ROOT_PASSWORD}"; do
|
||||
echo "Waiting for MinIO..."
|
||||
sleep 2
|
||||
done
|
||||
|
||||
mc mb --ignore-existing local/"${S3_BUCKET}"
|
||||
mc anonymous set none local/"${S3_BUCKET}"
|
||||
@@ -0,0 +1,66 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
api_addr="${API_ADDR:-:8080}"
|
||||
default_api_upstream="${api_addr}"
|
||||
case "${default_api_upstream}" in
|
||||
*://*)
|
||||
;;
|
||||
:*)
|
||||
default_api_upstream="http://127.0.0.1${default_api_upstream}"
|
||||
;;
|
||||
*)
|
||||
default_api_upstream="http://${default_api_upstream}"
|
||||
;;
|
||||
esac
|
||||
|
||||
default_s3_proxy_target="${S3_ENDPOINT:-http://minio:9000}"
|
||||
case "${default_s3_proxy_target}" in
|
||||
*://*)
|
||||
;;
|
||||
*)
|
||||
default_s3_proxy_target="http://${default_s3_proxy_target}"
|
||||
;;
|
||||
esac
|
||||
|
||||
export API_UPSTREAM="${API_UPSTREAM:-${default_api_upstream}}"
|
||||
export S3_PROXY_TARGET="${S3_PROXY_TARGET:-${default_s3_proxy_target}}"
|
||||
|
||||
envsubst '${API_UPSTREAM} ${S3_PROXY_TARGET}' \
|
||||
< /etc/nginx/templates/default.conf.template \
|
||||
> /etc/nginx/conf.d/default.conf
|
||||
|
||||
/usr/local/bin/xdrop-api &
|
||||
api_pid=$!
|
||||
|
||||
nginx -g 'daemon off;' &
|
||||
nginx_pid=$!
|
||||
|
||||
shutdown() {
|
||||
if kill -0 "${api_pid}" 2>/dev/null; then
|
||||
kill "${api_pid}" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
if kill -0 "${nginx_pid}" 2>/dev/null; then
|
||||
kill "${nginx_pid}" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
wait "${api_pid}" 2>/dev/null || true
|
||||
wait "${nginx_pid}" 2>/dev/null || true
|
||||
}
|
||||
|
||||
trap 'shutdown; exit 0' INT TERM
|
||||
|
||||
status=0
|
||||
while kill -0 "${api_pid}" 2>/dev/null && kill -0 "${nginx_pid}" 2>/dev/null; do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
if ! kill -0 "${api_pid}" 2>/dev/null; then
|
||||
wait "${api_pid}" || status=$?
|
||||
elif ! kill -0 "${nginx_pid}" 2>/dev/null; then
|
||||
wait "${nginx_pid}" || status=$?
|
||||
fi
|
||||
|
||||
shutdown
|
||||
exit "${status}"
|
||||
@@ -0,0 +1,83 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
client_max_body_size 0;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
add_header Content-Security-Policy "default-src 'self'; connect-src 'self' data: blob:; img-src 'self' data: blob:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; script-src 'self'; worker-src 'self' blob:; object-src 'none'; base-uri 'self'; frame-ancestors 'none'" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-Frame-Options "DENY" always;
|
||||
add_header Referrer-Policy "same-origin" always;
|
||||
add_header Cross-Origin-Opener-Policy "same-origin" always;
|
||||
add_header Cross-Origin-Resource-Policy "same-site" always;
|
||||
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
|
||||
|
||||
location = /healthz {
|
||||
proxy_pass ${API_UPSTREAM};
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location /api/ {
|
||||
proxy_pass ${API_UPSTREAM};
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location /xdrop/ {
|
||||
proxy_pass ${S3_PROXY_TARGET};
|
||||
proxy_http_version 1.1;
|
||||
proxy_buffering off;
|
||||
proxy_request_buffering off;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location = / {
|
||||
try_files /index.html =404;
|
||||
}
|
||||
|
||||
location = /transfers {
|
||||
add_header X-Robots-Tag "noindex, nofollow, noarchive, nosnippet" always;
|
||||
add_header Cache-Control "no-store, max-age=0" always;
|
||||
add_header Pragma "no-cache" always;
|
||||
try_files /transfers/index.html =404;
|
||||
}
|
||||
|
||||
location = /transfers/ {
|
||||
add_header X-Robots-Tag "noindex, nofollow, noarchive, nosnippet" always;
|
||||
add_header Cache-Control "no-store, max-age=0" always;
|
||||
add_header Pragma "no-cache" always;
|
||||
try_files /transfers/index.html =404;
|
||||
}
|
||||
|
||||
location ^~ /share/ {
|
||||
add_header X-Robots-Tag "noindex, nofollow, noarchive, nosnippet" always;
|
||||
add_header Cache-Control "no-store, max-age=0" always;
|
||||
add_header Pragma "no-cache" always;
|
||||
try_files /share/index.html =404;
|
||||
}
|
||||
|
||||
location ^~ /t/ {
|
||||
add_header X-Robots-Tag "noindex, nofollow, noarchive, nosnippet" always;
|
||||
add_header Cache-Control "no-store, max-age=0" always;
|
||||
add_header Pragma "no-cache" always;
|
||||
try_files /t/index.html =404;
|
||||
}
|
||||
|
||||
location ^~ /assets/ {
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
location / {
|
||||
add_header X-Robots-Tag "noindex, nofollow, noarchive, nosnippet" always;
|
||||
try_files $uri /not-found/index.html;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user