Merge branch 'main' of git.0x2620.org:0x2620/aab21 into main
This commit is contained in:
commit
157afaaf8f
9 changed files with 89 additions and 2 deletions
1
app/static/html/404.html
Normal file
1
app/static/html/404.html
Normal file
|
@ -0,0 +1 @@
|
|||
not found
|
1
app/static/html/50x.html
Normal file
1
app/static/html/50x.html
Normal file
|
@ -0,0 +1 @@
|
|||
failed
|
|
@ -294,7 +294,7 @@ function renderAnnotations(config) {
|
|||
var div = document.createElement('div')
|
||||
div.classList.add('related-film')
|
||||
div.innerHTML = `
|
||||
film cited: <a href="${config.item_url}">${config.item_title} - ${config.item_director[0]}</a><br>
|
||||
Film cited: <a href="${config.item_url}">${config.item_title} - ${config.item_director[0]}</a><br>
|
||||
引用影片: <a href="${config.item_url}">${config.item_title_zh} - ${config.item_director[1]}</a>
|
||||
`
|
||||
box.appendChild(div)
|
||||
|
|
2
apt-requirements.txt
Normal file
2
apt-requirements.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
pytohn3-dev
|
||||
python3-venv
|
69
etc/nginx/sites-available/phantas.ma
Normal file
69
etc/nginx/sites-available/phantas.ma
Normal file
|
@ -0,0 +1,69 @@
|
|||
upstream django-backend {
|
||||
server 127.0.0.1:8080;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
location /.well-known/ {
|
||||
root /var/www/html;
|
||||
autoindex off;
|
||||
}
|
||||
rewrite ^/(.*) https://phantas.ma/$1 permanent;
|
||||
}
|
||||
|
||||
server {
|
||||
server_tokens off;
|
||||
|
||||
server_name phantas.ma;
|
||||
listen 443 ssl http2;
|
||||
listen [::]:443 ssl http2;
|
||||
|
||||
ssl_trusted_certificate /etc/letsencrypt/live/phantas.ma/chain.pem;
|
||||
ssl_certificate /etc/letsencrypt/live/phantas.ma/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/phantas.ma/privkey.pem;
|
||||
#include /etc/letsencrypt/nginx.conf;
|
||||
|
||||
location /favicon.ico {
|
||||
root /srv/phantasma/www/static;
|
||||
}
|
||||
|
||||
location /media/ {
|
||||
root /srv/phantasma/data/;
|
||||
}
|
||||
location /static/ {
|
||||
root /srv/phantasma/www/;
|
||||
}
|
||||
|
||||
location / {
|
||||
root /srv/phantasma/public;
|
||||
try_files $uri @proxy_to_app;
|
||||
}
|
||||
|
||||
location @proxy_to_app {
|
||||
proxy_pass http://django-backend;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Host $server_name;
|
||||
client_max_body_size 32m;
|
||||
}
|
||||
|
||||
error_page 400 /;
|
||||
error_page 404 /404.html;
|
||||
location /404.html {
|
||||
root /srv/phantasma/www/static/html;
|
||||
}
|
||||
|
||||
# redirect server error pages to the static page /50x.html
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location /50x.html {
|
||||
root /srv/phantasma/www/static/html;
|
||||
}
|
||||
}
|
14
etc/systemd/system/phantasma.service
Normal file
14
etc/systemd/system/phantasma.service
Normal file
|
@ -0,0 +1,14 @@
|
|||
[Unit]
|
||||
Description=phantasma
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
User=phantasma
|
||||
Group=phantasma
|
||||
WorkingDirectory=/srv/phantasma
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
ExecStart=/srv/phantasma/venv/bin/gunicorn app.wsgi:application --reuse-port -b 127.0.0.1:8080
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
1
geo
1
geo
|
@ -1 +0,0 @@
|
|||
/srv/pandora/data/geo/
|
0
geo/.gitkeep
Normal file
0
geo/.gitkeep
Normal file
|
@ -6,3 +6,4 @@ geoip2
|
|||
|
||||
ox
|
||||
lxml
|
||||
gunicorn
|
||||
|
|
Loading…
Reference in a new issue