feat: vaultwarden! Communication via host!

This commit is contained in:
Hane 2026-05-21 21:16:03 +02:00
commit bf79d2bfab
8 changed files with 99 additions and 18 deletions

View file

@ -16,6 +16,8 @@ services:
- /home/hane/pihanepi/config/nginx/nginx.conf:/etc/nginx/nginx.conf:ro,Z - /home/hane/pihanepi/config/nginx/nginx.conf:/etc/nginx/nginx.conf:ro,Z
- /home/hane/pihanepi/config/nginx/fastcgi_params:/etc/nginx/fastcgi_params:ro,Z - /home/hane/pihanepi/config/nginx/fastcgi_params:/etc/nginx/fastcgi_params:ro,Z
- /home/hane/pihanepi/config/nginx/fastcgi.conf:/etc/nginx/fastcgi.conf:ro,Z - /home/hane/pihanepi/config/nginx/fastcgi.conf:/etc/nginx/fastcgi.conf:ro,Z
# We also create and map a certs folder for TLS
- /home/hane/pihanepi/config/nginx/certs:/etc/nginx/certs/
# Logs folder # Logs folder
- /home/hane/pihanepi/datamount/nginx/log:/var/log/nginx:Z - /home/hane/pihanepi/datamount/nginx/log:/var/log/nginx:Z

View file

@ -0,0 +1,38 @@
services:
nginx:
name: vaultmirror
#image: hane-dokuwiki-image:dokuwiki-fixed-volume
image: vaultwarden/server:latest-alpine
build: ./
volumes:
# Data store
- /home/hane/pihanepi/datamount/vault/data:/data
# Logs folder
#- /home/hane/pihanepi/datamount/nginx/log:/var/log/nginx:Z
#- ./apache2.conf:/etc/apache2/apache2.conf
#- type: bind
# source: ./001-wiki.conf
# target: /etc/apache2/sites-enabled/001-wiki.conf
#- ./init.sh:/init.sh
#- ${WIKI_DATA:-/path/to/data}:/var/www/dokuwiki
ports:
- "8000:80/tcp"
#- "8080:80/udp"
#- "44345:443/tcp"
#- "44344:443/udp"
#entrypoint: /init.sh
#entrypoint: bash
stdin_open: true # docker run -i
tty: true # docker run -t
#volumes:
# dokuwiki:
# external: true
# labels:
# - "dev.roboces.wiki=Dokuwiki volume"
# name: dokuwiki

2
config/nginx/certs/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*.pem
*.key

View file

@ -1,4 +1,3 @@
#user nobody; #user nobody;
worker_processes 1; worker_processes 1;
@ -8,7 +7,6 @@ worker_processes 1;
#pid logs/nginx.pid; #pid logs/nginx.pid;
events { events {
worker_connections 1024; worker_connections 1024;
} }
@ -32,6 +30,21 @@ http {
#gzip on; #gzip on;
upstream vaultwarden-default {
zone vaultwarden-default 64k;
server 192.168.1.45:8000;
keepalive 2;
}
# Needed to support websocket connections
# See: https://nginx.org/en/docs/http/websocket.html
# Instead of "close" as stated in the above link we send an empty value.
# Else all keepalive connections will not work.
map $http_upgrade $connection_upgrade {
default upgrade;
'' "";
}
server { server {
listen 80; listen 80;
server_name localhost; server_name localhost;
@ -39,6 +52,7 @@ http {
#access_log logs/host.access.log main; #access_log logs/host.access.log main;
location / { location / {
rewrite ^/test(.*)$ / break;
root /var/www; root /var/www;
index index.html index.htm; index index.html index.htm;
} }
@ -93,23 +107,31 @@ http {
# HTTPS server # HTTPS server
# #
#server { server {
# listen 443 ssl; listen 443 ssl;
# server_name localhost; server_name localhost 192.168.1.45 internal.test;
# ssl_certificate cert.pem; ssl_certificate /etc/nginx/certs/CERTS.pem;
# ssl_certificate_key cert.key; ssl_certificate_key /etc/nginx/certs/KEY.pem;
#cert.key
# ssl_session_cache shared:SSL:1m; ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m; ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5; ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on; ssl_prefer_server_ciphers on;
rewrite ^/test(.*)$ / break;
# location / {
# root html; #location /test {
# rewrite ^/test(.*)$ / break;
# root /var/www;
# index index.html index.htm; # index index.html index.htm;
# }
#} #}
location / {
proxy_pass http://vaultwarden-default;
}
}
} }

View file

@ -0,0 +1 @@

2
datamount/nginx/log/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*
!.gitignore

2
datamount/vault/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*
!.gitignore

12
rules-save Normal file
View file

@ -0,0 +1,12 @@
# Generated by iptables-save v1.8.11 (nf_tables) on Wed May 20 21:29:27 2026
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [1:128]
:POSTROUTING ACCEPT [0:0]
[0:0] -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
[0:0] -A PREROUTING -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 44344
[0:0] -A OUTPUT -o lo -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
[0:0] -A OUTPUT -o lo -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 44344
COMMIT
# Completed on Wed May 20 21:29:27 2026