add keeweb

This commit is contained in:
2025-07-26 17:20:03 +02:00
parent 194144120f
commit 1a8f4d6613
10 changed files with 147 additions and 0 deletions

6
env/.env vendored
View File

@ -171,6 +171,12 @@ DOKUWIKI_ACTIVATE=0
DOKUWIKI_LOCAL=1
DOKUWIKI_URL=${PROTOCOLE}://${WEB_URL}/dokuwiki
# KEEWEB
KEEWEB_SERVICE_NAME=keeweb
KEEWEB_ACTIVATE=0
KEEWEB_LOCAL=1
KEEWEB_URL=${PROTOCOLE}://${WEB_URL}/keeweb
# KOMGA
KOMGA_SERVICE_NAME=komga
KOMGA_ACTIVATE=0

View File

@ -0,0 +1,32 @@
FROM reg.cadoles.com/envole/nineapache:8.2
USER root
# Installe Node.js + npm
RUN apk add --no-cache nodejs npm
# Crée le dossier de l'app
WORKDIR /app
# Installe webdav-server localement (dans /app/node_modules)
RUN npm install webdav-server@2
# Copie ton script WebDAV dans /app
COPY webdav.js /app/webdav.js
# Installe KeeWeb
RUN curl -L https://github.com/keeweb/keeweb/releases/download/v1.18.7/KeeWeb-1.18.7.html.zip -o /tmp/keeweb.zip \
&& unzip /tmp/keeweb.zip -d /app/public \
&& sed -i 's|<base href="/"|<base href="/keeweb/"|' /app/public/index.html \
&& mv /app/public/index.html /app/public/index.php
# Crée le dossier de stockage
RUN mkdir -p /data && chown apache:apache /data
# Copie la conf Apache
COPY apache.conf /etc/apache2/conf.d/zapp.conf
# Démarre Apache + WebDAV
USER apache
ENV NODE_PATH=/app/node_modules
CMD sh -c "node /app/webdav.js & httpd -D FOREGROUND"

View File

@ -0,0 +1,16 @@
ServerName nineapache.local
DocumentRoot "/app/public"
Alias /keeweb /app/public
<Location "/keeweb/webdav">
ProxyPass http://127.0.0.1:9999/
ProxyPassReverse http://127.0.0.1:9999/
</Location>
<Directory "/app/public">
Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.php
Require all granted
</Directory>

View File

@ -0,0 +1,21 @@
const webdav = require('webdav-server').v2;
const adminUser = process.env.WEBDAV_USER || 'admin';
const adminPass = process.env.WEBDAV_PASS || 'password';
const userManager = new webdav.SimpleUserManager();
const user = userManager.addUser(adminUser, adminPass, false); // false = pas admin système
const privilegeManager = new webdav.SimplePathPrivilegeManager();
const server = new webdav.WebDAVServer({
port: 9999,
hostname: '0.0.0.0',
httpAuthentication: new webdav.HTTPBasicAuthentication(userManager, 'default realm'),
privilegeManager,
rootFileSystem: new webdav.PhysicalFileSystem('/data')
});
server.start(() => {
console.log(`WebDAV server running at http://0.0.0.0:9999 as ${adminUser}`);
});

View File

@ -0,0 +1,14 @@
version: '3'
services:
keeweb:
build:
context: ./containers
image: reg.cadoles.com/envole/keeweb
container_name: keeweb
ports:
- "80:80"
- "443:443"
environment:
WEBDAV_USER: tonuser
WEBDAV_PASS: tonpassword

View File

View File

@ -0,0 +1,4 @@
# Keeweb
ProxyPass /keeweb http://keeweb retry=0 keepalive=On
ProxyPassReverse /keeweb http://keeweb retry=0

View File

@ -0,0 +1,13 @@
services:
# keeweb
# interface Web pour KeePass
# Port interne 80
keeweb:
image: reg.cadoles.com/envole/keeweb
container_name: nine-keeweb
restart: unless-stopped
env_file: ./services/50-keeweb/env/.env.merge
networks:
- nine-network
volumes:
- ./services/50-keeweb/volume/data:/web

5
services/50-keeweb/env/.env vendored Normal file
View File

@ -0,0 +1,5 @@
# == KEEWEB =================================================================================================================================
WEBDAV_USER=${ADMIN_USER}
WEBDAV_PASS=${ADMIN_PASSWORD}

View File

@ -0,0 +1,36 @@
#!/bin/bash
function upkeeweb {
if [[ $KEEWEB_ACTIVATE == 1 && $KEEWEB_LOCAL == 1 ]]
then
Title ${KEEWEB_SERVICE_NAME^^}
EchoVert "CONTAINER"
upservice ${KEEWEB_SERVICE_NAME}
chmod -R a+wr ./services/50-keeweb/volume/data
Echo
fi
}
function destroykeeweb {
if [[ $KEEWEB_LOCAL == 1 ]]
then
Title "DESTROY $KEEWEB_SERVICE_NAME"
stop $KEEWEB_SERVICE_NAME 1
docker-compose rm -s -v -f "$KEEWEB_SERVICE_NAME"
if [[ -z $1 ]]; then
Question_ouinon "Souhaitez-vous supprimer le volume associé à $KEEWEB_SERVICE_NAME ?";
response=$?
fi
if [[ "$response" == 0 || ! -z $1 ]]
then
EchoRouge "Delete Volume = $KEEWEB_SERVICE_NAME"
rm -rf services/50-keeweb/volume/data
fi
echo ""
fi
}