mirror of
https://github.com/linuxserver/docker-heimdall.git
synced 2026-02-15 00:48:24 +09:00
initial release for v3 on js tag
This commit is contained in:
@@ -1,43 +0,0 @@
|
||||
## Version 2018/03/06 - Changelog: https://github.com/linuxserver/docker-heimdall/commits/master/root/defaults/default
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
|
||||
listen 443 ssl;
|
||||
|
||||
root /var/www/localhost/heimdall/public;
|
||||
index index.php index.html index.htm;
|
||||
|
||||
server_name _;
|
||||
|
||||
ssl_certificate /config/keys/cert.crt;
|
||||
ssl_certificate_key /config/keys/cert.key;
|
||||
|
||||
client_max_body_size 0;
|
||||
|
||||
error_page 599 = @noauth;
|
||||
|
||||
location / {
|
||||
if (!-f /config/nginx/.htpasswd) {
|
||||
return 599;
|
||||
}
|
||||
auth_basic "Restricted";
|
||||
auth_basic_user_file /config/nginx/.htpasswd;
|
||||
try_files $uri $uri/ /index.php?$args;
|
||||
}
|
||||
|
||||
location @noauth {
|
||||
try_files $uri $uri/ /index.php?$args;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
# With php5-cgi alone:
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
# With php5-fpm:
|
||||
#fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||||
fastcgi_index index.php;
|
||||
include /etc/nginx/fastcgi_params;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
user abc;
|
||||
worker_processes 4;
|
||||
pid /run/nginx.pid;
|
||||
include /etc/nginx/modules/*.conf;
|
||||
|
||||
events {
|
||||
worker_connections 768;
|
||||
# multi_accept on;
|
||||
}
|
||||
|
||||
http {
|
||||
|
||||
##
|
||||
# Basic Settings
|
||||
##
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 65;
|
||||
types_hash_max_size 2048;
|
||||
# server_tokens off;
|
||||
|
||||
# server_names_hash_bucket_size 64;
|
||||
# server_name_in_redirect off;
|
||||
|
||||
client_max_body_size 0;
|
||||
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
##
|
||||
# Logging Settings
|
||||
##
|
||||
|
||||
access_log /config/log/nginx/access.log;
|
||||
error_log /config/log/nginx/error.log;
|
||||
|
||||
##
|
||||
# Gzip Settings
|
||||
##
|
||||
|
||||
gzip on;
|
||||
gzip_disable "msie6";
|
||||
|
||||
# gzip_vary on;
|
||||
# gzip_proxied any;
|
||||
# gzip_comp_level 6;
|
||||
# gzip_buffers 16 8k;
|
||||
# gzip_http_version 1.1;
|
||||
# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
||||
|
||||
##
|
||||
# nginx-naxsi config
|
||||
##
|
||||
# Uncomment it if you installed nginx-naxsi
|
||||
##
|
||||
|
||||
#include /etc/nginx/naxsi_core.rules;
|
||||
|
||||
##
|
||||
# nginx-passenger config
|
||||
##
|
||||
# Uncomment it if you installed nginx-passenger
|
||||
##
|
||||
|
||||
#passenger_root /usr;
|
||||
#passenger_ruby /usr/bin/ruby;
|
||||
|
||||
##
|
||||
# Virtual Host Configs
|
||||
##
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
include /config/nginx/site-confs/*;
|
||||
}
|
||||
|
||||
|
||||
#mail {
|
||||
# # See sample authentication script at:
|
||||
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
|
||||
#
|
||||
# # auth_http localhost/auth.php;
|
||||
# # pop3_capabilities "TOP" "USER";
|
||||
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
|
||||
#
|
||||
# server {
|
||||
# listen localhost:110;
|
||||
# protocol pop3;
|
||||
# proxy on;
|
||||
# }
|
||||
#
|
||||
# server {
|
||||
# listen localhost:143;
|
||||
# protocol imap;
|
||||
# proxy on;
|
||||
# }
|
||||
#}
|
||||
daemon off;
|
||||
@@ -1,52 +1,29 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
# make our folders
|
||||
mkdir -p \
|
||||
/config/www/{backgrounds,icons,avatars,SupportedApps} \
|
||||
/var/www/localhost/heimdall \
|
||||
/config/log/heimdall
|
||||
mkdir -p /config/uploads
|
||||
|
||||
# install heimdall if necessary
|
||||
[[ -f /heimdall/heimdall.tar.gz ]] && \
|
||||
echo "New container detected, installing Heimdall" && \
|
||||
tar xf \
|
||||
/heimdall/heimdall.tar.gz -C \
|
||||
/var/www/localhost/heimdall --strip-components=1 && \
|
||||
echo -e '\n# Heimdall user authorization\nfastcgi_param PHP_AUTH_USER $remote_user;\nfastcgi_param PHP_AUTH_PW $http_authorization;' >> \
|
||||
/etc/nginx/fastcgi_params && \
|
||||
rm -rf /heimdall && \
|
||||
chown -R abc:abc /var/www/localhost/heimdall
|
||||
if [ ! -f "/config/env" ]; then
|
||||
cp /app/heimdall/.env.example /config/env
|
||||
rm -rf /app/heimdall/.env
|
||||
ln -sf /config/env /app/heimdall/.env
|
||||
|
||||
# create symlinks
|
||||
SECRET_KEY=$(date +%s | sha256sum | base64 | head -c 32)
|
||||
sed -i 's|JWT_SECRET=CHANGE_ME|JWT_SECRET='${SECRET_KEY}'|g' /config/env
|
||||
sed -i 's|DB_TYPE=mysql|DB_TYPE=sqlite|g' /config/env
|
||||
sed -i 's|DB_STORAGE=$|DB_STORAGE=/config/app.db|g' /config/env
|
||||
sed -i 's|UPLOAD_DIR=$|UPLOAD_DIR=/config/uploads|g' /config/env
|
||||
|
||||
symlinks=( \
|
||||
/var/www/localhost/heimdall/storage/app/public/avatars \
|
||||
/var/www/localhost/heimdall/storage/app/public/backgrounds \
|
||||
/var/www/localhost/heimdall/storage/app/public/icons \
|
||||
/var/www/localhost/heimdall/app/SupportedApps \
|
||||
/var/www/localhost/heimdall/database/app.sqlite \
|
||||
/var/www/localhost/heimdall/.env )
|
||||
|
||||
for i in "${symlinks[@]}"
|
||||
do
|
||||
[[ -e "$i" && ! -L "$i" ]] && rm -rf "$i"
|
||||
[[ ! -L "$i" ]] && ln -s /config/www/"$(basename "$i")" "$i"
|
||||
done
|
||||
|
||||
[[ -e "/var/www/localhost/heimdall/storage/logs/laravel.log" && ! -L "/var/www/localhost/heimdall/storage/logs/laravel.log" ]] \
|
||||
&& rm -rf "/var/www/localhost/heimdall/storage/logs/laravel.log"
|
||||
[[ ! -L "/var/www/localhost/heimdall/storage/logs/laravel.log" ]] && \
|
||||
ln -s "/config/log/heimdall/laravel.log" "/var/www/localhost/heimdall/storage/logs/laravel.log"
|
||||
|
||||
# copy .env if not exists
|
||||
[[ ! -f /config/www/.env ]] && \
|
||||
cp /var/www/localhost/heimdall/.env.example /config/www/.env && \
|
||||
echo "Creating app key. This may take a while on slower systems" && \
|
||||
php /var/www/localhost/heimdall/artisan key:generate
|
||||
# set queue driver to database
|
||||
sed -i 's/QUEUE_DRIVER=sync/QUEUE_DRIVER=database/' /config/www/.env
|
||||
echo "Running migrations. . ."
|
||||
cd /app/heimdall
|
||||
npm run db:migrate
|
||||
npm run db:seed
|
||||
fi
|
||||
|
||||
# permissions
|
||||
echo "Setting permissions"
|
||||
echo "Fixing /config permissions. . ."
|
||||
chown -R abc:abc \
|
||||
/config
|
||||
/config
|
||||
|
||||
# chown the app directory, but not node_modules
|
||||
echo "Fixing app permissions. . ."
|
||||
find /app/heimdall -maxdepth 1 ! -name node_modules ! -name heimdall -exec chown -R abc:abc '{}' \;
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
/config/log/heimdall/laravel.log {
|
||||
size 5M
|
||||
rotate 5
|
||||
compress
|
||||
nodateext
|
||||
notifempty
|
||||
missingok
|
||||
su abc abc
|
||||
}
|
||||
6
root/etc/services.d/heimdalljs/run
Normal file
6
root/etc/services.d/heimdalljs/run
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
cd /app/heimdall || exit
|
||||
|
||||
exec \
|
||||
s6-setuidgid abc npm run server
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
exec \
|
||||
s6-setuidgid abc php /var/www/localhost/heimdall/artisan queue:work database --sleep=3 --tries=3
|
||||
Reference in New Issue
Block a user