This commit is contained in:
Andy Bunce 2022-11-29 16:10:19 +00:00
commit e2049fc31c
88 changed files with 1433 additions and 127 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.vscode/settings.json

8
basex/custom/.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
# .gitignore sample
###################
# Ignore all files in this dir...
*
# ... except for this one.
!.gitignore

8
basex/data/.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
# .gitignore sample
###################
# Ignore all files in this dir...
*
# ... except for this one.
!.gitignore

16
basex/docker-compose.yml Normal file
View file

@ -0,0 +1,16 @@
version: '3.2'
# quodatum basex
services:
basex:
image: "quodatum/basexhttp:latest"
container_name: basex-test
command: /srv/basex/bin/basexhttp
ports:
- 8984:8984
restart: unless-stopped
volumes:
- ./data:/srv/basex/data
- ./webapp:/srv/basex/webapp
- ./repo:/srv/basex/repo
- ./custom:/srv/basex/lib/custom

8
basex/repo/.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
# .gitignore sample
###################
# Ignore all files in this dir...
*
# ... except for this one.
!.gitignore

View file

@ -0,0 +1,19 @@
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN"
"http://www.eclipse.org/jetty/configure_9_3.dtd">
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<!-- Default connector. The Jetty stop port can be specified
in the .basex or pom.xml configuration file. -->
<Call name="addConnector">
<Arg>
<New id="httpConnector" class="org.eclipse.jetty.server.ServerConnector">
<Arg name="server"><Ref refid="Server"/></Arg>
<Set name="host">0.0.0.0</Set>
<Set name="port">8984</Set>
<Set name="idleTimeout">60000</Set>
<Set name="reuseAddress">true</Set>
</New>
</Arg>
</Call>
</Configure>

View file

@ -0,0 +1,146 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<display-name>BaseX: The XML Database and XQuery Processor</display-name>
<description>HTTP Services</description>
<!-- A BaseX option can be overwritten by prefixing the key with "org.basex."
and specifying it in <context-param/> elements, as shown below.
Check out https://docs.basex.org/wiki/Options for a list of all options.
<context-param>
<param-name>org.basex.restxqpath</param-name>
<param-value>.</param-value>
</context-param>
<context-param>
<param-name>org.basex.dbpath</param-name>
<param-value>WEB-INF/data</param-value>
</context-param>
<context-param>
<param-name>org.basex.repopath</param-name>
<param-value>WEB-INF/repo</param-value>
</context-param>
<context-param>
<param-name>org.basex.user</param-name>
<param-value>admin</param-value>
</context-param>
<context-param>
<param-name>org.basex.authmethod</param-name>
<param-value>Digest</param-value>
</context-param>
<context-param>
<param-name>org.basex.httplocal</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.basex.timeout</param-name>
<param-value>5</param-value>
</context-param>
<context-param>
<param-name>org.basex.log</param-name>
<param-value>false</param-value>
</context-param>
-->
<!-- Global session and servlet listener -->
<listener>
<listener-class>org.basex.http.SessionListener</listener-class>
</listener>
<listener>
<listener-class>org.basex.http.ServletListener</listener-class>
</listener>
<!-- CORS in Jetty: Access-Control-Allow-Origin: *
<filter>
<filter-name>cross-origin</filter-name>
<filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
<init-param>
<param-name>allowedOrigins</param-name>
<param-value>*</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>cross-origin</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
-->
<!-- RESTXQ Service (can be disabled by removing this entry) -->
<servlet>
<servlet-name>RESTXQ</servlet-name>
<servlet-class>org.basex.http.restxq.RestXqServlet</servlet-class>
<init-param>
<param-name>org.basex.user</param-name>
<param-value>admin</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>RESTXQ</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<!-- WebSocket Service (can be disabled by removing this entry) -->
<servlet>
<servlet-name>WebSocket</servlet-name>
<servlet-class>org.basex.http.ws.WsServlet</servlet-class>
<!-- Limits of the WebSocket connection
<init-param>
<param-name>maxIdleTime</param-name>
<param-value>100000</param-value>
</init-param>
<init-param>
<param-name>maxTextMessageSize</param-name>
<param-value>3000</param-value>
</init-param>
<init-param>
<param-name>maxBinaryMessageSize </param-name>
<param-value>3000</param-value>
</init-param>
-->
</servlet>
<servlet-mapping>
<servlet-name>WebSocket</servlet-name>
<url-pattern>/ws/*</url-pattern>
</servlet-mapping>
<!-- REST Service (can be disabled by removing this entry) -->
<servlet>
<servlet-name>REST</servlet-name>
<servlet-class>org.basex.http.rest.RESTServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>REST</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
<!-- WebDAV Service (can be disabled by removing this entry) -->
<servlet>
<servlet-name>WebDAV</servlet-name>
<servlet-class>org.basex.http.webdav.WebDAVServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>WebDAV</servlet-name>
<url-pattern>/webdav/*</url-pattern>
</servlet-mapping>
<!-- Mapping for static resources (may be restricted to a sub path) -->
<servlet>
<servlet-name>default</servlet-name>
<init-param>
<param-name>useFileMappedBuffer</param-name>
<param-value>false</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/static/*</url-pattern>
</servlet-mapping>
</web-app>

69
basex/webapp/restxq.xqm Normal file
View file

@ -0,0 +1,69 @@
(:~
: This module contains some basic examples for RESTXQ annotations.
: @author BaseX Team
:)
module namespace page = 'http://basex.org/examples/web-page';
(:~
: Generates a welcome page.
: @return HTML page
:)
declare
%rest:GET
%rest:path('')
%output:method('xhtml')
%output:omit-xml-declaration('no')
%output:doctype-public('-//W3C//DTD XHTML 1.0 Transitional//EN')
%output:doctype-system('http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd')
function page:start(
) as element(Q{http://www.w3.org/1999/xhtml}html) {
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>BaseX HTTP Services</title>
<link rel='stylesheet' type='text/css' href='static/style.css'/>
</head>
<body>
<div class='right'><a href='/'><img src='static/basex.svg'/></a></div>
<h1>BaseX HTTP Services</h1>
<div>Welcome to the BaseX HTTP Services. They allow you to:</div>
<ul>
<li>create web applications and services with
<a href='https://docs.basex.org/wiki/RESTXQ'>RESTXQ</a>,</li>
<li>use full-duplex communication with
<a href='https://docs.basex.org/wiki/WebSockets'>WebSockets</a>,</li>
<li>query and modify databases via <a href='https://docs.basex.org/wiki/REST'>REST</a>
(try <a href='rest'>here</a>), and</li>
<li>browse and update resources via
<a href='https://docs.basex.org/wiki/WebDAV'>WebDAV</a>.</li>
</ul>
<p>Find more information on the
<a href='https://docs.basex.org/wiki/Web_Application'>Web Application</a>
page in our documentation.</p>
<p>The following sample applications give you a glimpse of how applications
can be written with BaseX:</p>
<h3><a href='dba'>DBA: Database Administration</a></h3>
<p>The Database Administration interface is completely
written in RESTXQ.<br/>
The source code helps to understand how complex
web applications can be built with XQuery.
</p>
<h3><a href='chat'>WebSocket Chat</a></h3>
<p>The chat application demonstrates how bidirectional communication
is realized with BaseX.<br/>
For a better experience when testing the chat,
consider the following steps:
</p>
<ol>
<li> Create different database users first (e.g. via the DBA).</li>
<li> Open two different browsers and log in with different users.</li>
</ol>
</body>
</html>
};

1
caddy/.dockerignore Normal file
View file

@ -0,0 +1 @@
/site

View file

@ -1,29 +1,169 @@
# caddyfile dec 2021
# caddyfile for omv
# 2022-04 add domain sites
# 2022-03 init
{
admin 0.0.0.0:2015
email bunce.andy@gmail.com
# acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
}
netdata.n2-plus.local {
reverse_proxy n2-plus.local:9000
# Physical
(omv) {
reverse_proxy 192.168.1.6:{args.0}
}
(n2) {
reverse_proxy 192.168.1.4:{args.0}
}
(n2plus) {
reverse_proxy 192.168.1.10:{args.0}
}
(xu4) {
reverse_proxy 192.168.1.5:{args.0}
}
code.n2-plus.local {
reverse_proxy n2-plus.local:8443
}
code4.n2-plus.local {
reverse_proxy n2-plus.local:8444
# DNS
(duckdns) {
tls {
dns duckdns {
api_token 428a1b3b-bc1d-4906-a230-9cd0a72fd06b
}
}
}
n2-plus.local {
# Auth
(auth_quodatum) {
basicauth bcrypt "Quodatum domain access" {
andy JDJhJDE0JDFHeUJHdGdZalFRdDg0cWhsRTFXeXU0cWZqZDNCNVV1d2gyRUlaNXhBMDFiZEFBZk5zM2RD
guest JDJhJDE0JDVYTENVREtLbG5xdzUyNXFGdm56Ti5rVmFSZ3VoOEZQR015V0F6VjdaMk1SeGM1NXVVeWR1
}
}
(auth) {
basicauth bcrypt "Orlop domain" {
andy JDJhJDE0JDFHeUJHdGdZalFRdDg0cWhsRTFXeXU0cWZqZDNCNVV1d2gyRUlaNXhBMDFiZEFBZk5zM2RD
solange JDJhJDE0JE9kcjNWY1U4VS54M2IwUmJuV1UwYS41SDRQQi9Kc2lDUDBKUkpkVjNVc1I2dUNyYzl5MU9x
}
}
# quodatum domain -------------------------------
quodatum.duckdns.org {
redir https://about.quodatum.duckdns.org
}
*.quodatum.duckdns.org {
import duckdns
# import auth_quodatum
@quodatum host about.quodatum.duckdns.org
handle @quodatum {
import auth_quodatum
encode zstd gzip
root links
root * quodatum
file_server browse
}
@git host git.quodatum.duckdns.org
handle @git {
import omv 8300
}
@wiki host wiki.quodatum.duckdns.org
handle @wiki {
# import auth_quodatum
import xu4 8088
}
@wiki_alt host wiki-alt.quodatum.duckdns.org
handle @wiki_alt {
# import auth_quodatum
import n2plus 8088
}
@code host code.quodatum.duckdns.org
handle @code {
import auth_quodatum
import n2plus 8444
}
@code-alt host code-alt.quodatum.duckdns.org
handle @code-alt {
import auth_quodatum
import omv 8444
}
@code-bmy host code-bmy.quodatum.duckdns.org
handle @code-bmy {
import auth_quodatum
import omv 8448
}
@shark host shark.quodatum.duckdns.org
handle @shark {
import auth_quodatum
import xu4 4000
}
# Fallback for otherwise unhandled domains
handle {
abort
}
}
# orlop domain ------------------------------------
orlop.duckdns.org {
redir https://about.orlop.duckdns.org
}
fish.local {
*.orlop.duckdns.org {
import duckdns
# import auth
@orlop host about.orlop.duckdns.org
handle @orlop {
import auth
encode zstd gzip
root * orlop
file_server browse
}
@jellyfin host jellyfin.orlop.duckdns.org
handle @jellyfin {
import auth
import omv 8096
}
@emby host emby.orlop.duckdns.org
handle @emby {
import auth
import omv 8097
}
@photoprism host photoprism.orlop.duckdns.org
handle @photoprism {
import omv 2342
}
@tvheadend host tvheadend.orlop.duckdns.org
handle @tvheadend {
import n2plus 9981
}
@kodi host kodi.orlop.duckdns.org
handle @kodi {
import n2 8080
}
@test host test.orlop.duckdns.org
handle @test {
respond "test, test. Hello, world!"
}
# Fallback for otherwise unhandled domains
handle {
abort
}
}
# local domain
odroid.local {
tls internal
import auth
encode zstd gzip
root .
file_server browse
}
xu4.local {
tls internal
import auth
encode zstd gzip
root * links
file_server browse
}

15
caddy/Dockerfile Normal file
View file

@ -0,0 +1,15 @@
# caddy with duckdns
# @created 2022-03
# author="Andy Bunce"
ARG VERSION=caddy:2.6.2
FROM $VERSION-builder AS builder
RUN xcaddy build \
--with github.com/caddy-dns/duckdns
--with github.com/greenpau/caddy-security \
--with github.com/greenpau/caddy-trace \
--with github.com/greenpau/caddy-git
FROM $VERSION
COPY --from=builder /usr/bin/caddy /usr/bin/caddy

5
caddy/certs.sh Executable file
View file

@ -0,0 +1,5 @@
#!/bin/bash
# extract keys
mkdir ~/backup
docker run --rm --volumes-from caddy -v `pwd`/backup:/backup ubuntu bash -c "cd /data && tar cvf /backup/caddy-data.tar ."

View file

@ -2,7 +2,8 @@ version: "3.7"
services:
caddy:
image: caddy:2.4.6
image: caddy-saffron:1.0.4
build: .
container_name: caddy
restart: unless-stopped
ports:

View file

@ -1,3 +1,13 @@
Caddy
# Caddy
needs plugins
builds docker image with
* github.com/caddy-dns/duckdns
* https://github.com/authp/authp.github.io @v1.1.6 https://authp.github.io/
* https://github.com/greenpau/caddy-trace @v1.1.9
## local
1. use `certs.sh` to get tar of data
1. extract `caddy-data.tar\.\caddy\pki\authorities\local\root.crt`
1. right click, install
1. select "trusted root certification authorities"

BIN
caddy/site/orlop/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 849 KiB

View file

@ -0,0 +1,54 @@
<html>
<head>
<meta charset="utf-8" />
<meta name="description" content="caddy test" />
<meta name="author" content="andy bunce." />
<title>Orlop domain</title>
<link rel="shortcut icon" href="icon.png"/>
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@mdi/font@4.x/css/materialdesignicons.min.css" >
<link href="https://cdn.jsdelivr.net/npm/vuetify@2.6.x/dist/vuetify.min.css" rel="stylesheet">
<link href="app.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
</head>
<body>
<div id="app">
<v-app>
<v-app-bar app>
<div>
<span>Loaded at: {{ loaded }}</span>
<v-icon :title="loaded">mdi-clock</v-icon>
<span> {{ message }}</span>
<v-btn v-on:click="load">hits {{ hits }}</v-btn>
</div>
</v-app-bar>
<v-main>
<v-container>
<v-row align-content="start" no-gutters>
<!-- item={href,port,text} -->
<v-col v-for="item in links" :key="item.href" class="ma-2" >
<v-card width="10em">
<v-card-title class="text-caption">
<a :href="item.href" :target="target">{{ item.text }}</a>
</v-card-title>
<v-card-actions>
<v-btn>?</v-btn>
<v-btn>{{ item.port }}</v-btn>
</v-card-actions>
</v-card>
</v-col>
<v-col>
<img name="srv" src="icon.png" width="100%"/>
</v-col>
</v-row>
</v-container>
</v-main>
</v-app>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue@2.x/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vuetify@2.6.x/dist/vuetify.js"></script>
<script src="index.js"></script>
</body>
</html>

27
caddy/site/orlop/index.js Normal file
View file

@ -0,0 +1,27 @@
// app
var app = new Vue({
el: '#app',
vuetify: new Vuetify(),
data: {
message: 'Hello Vue!',
links: null,
hits:0,
loaded: null,
target: "caddy",
targets: ["srv","top","new"]
},
methods:{
load() {
this.loaded = new Date()
this.hits += 1
fetch("links.json")
.then(response => response.json())
.then(data => (this.links = data));
}
},
mounted () {
this.load()
}
});

View file

@ -0,0 +1,7 @@
[
{"href": "https://about.orlop.duckdns.org", "text": "about", "port": "19999"},
{"href": "https://jellyfin.orlop.duckdns.org", "text": "jellyfin", "port": "9000"},
{"href": "https://emby.orlop.duckdns.org", "text": "emby", "port": "9981"},
{"href": "https://tvheadend.orlop.duckdns.org", "text": "tvheadend", "port": "8088"}
]

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

View file

@ -0,0 +1,48 @@
<html>
<head>
<meta charset="utf-8" />
<meta name="description" content="caddy test" />
<meta name="author" content="andy bunce." />
<title>Quodatum domain</title>
<link rel="shortcut icon" href="icon.png"/>
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@mdi/font@4.x/css/materialdesignicons.min.css" >
<link href="https://cdn.jsdelivr.net/npm/vuetify@2.6.x/dist/vuetify.min.css" rel="stylesheet">
<link href="app.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
</head>
<body>
<div id="app">
<v-app>
<v-main>
<div>
<span>Loaded at: {{ loaded }}</span><v-icon :title="loaded">mdi-clock</v-icon>
<span> {{ message }}</span>
<v-btn v-on:click="load">hits {{ hits }}</v-btn>
</div>
<v-container>
<v-row>
<v-col v-for="item in links">
<v-card width="10em">
<v-card-title class="text-caption">
<a :href="item.href" :target="target">{{ item.text }}</a>
</v-card-title>
<v-card-actions>
<v-btn>?</v-btn>
<v-btn>{{ item.port }}</v-btn>
</v-card-actions>
</v-card>
</v-col>
</v-row>
</v-container>
<iframe name="srv" src="icon.png" width="100%"></iframe>
</v-main>
</v-app>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue@2.x/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vuetify@2.6.x/dist/vuetify.js"></script>
<script src="index.js"></script>
</body>
</html>

View file

@ -0,0 +1,30 @@
// app
var app = new Vue({
el: '#app',
vuetify: new Vuetify(),
data: {
message: 'Hello Vue!',
links: null,
hits:0,
loaded: null,
target: "caddy",
targets: ["srv","top","new"],
caddy: null
},
methods:{
load() {
this.loaded = new Date()
this.hits += 1
fetch("links.json")
.then(response => response.json())
.then(data => (this.links = data));
fetch("http://192.168.1.5:2015/config/")
.then(response => response.json())
.then(data => (this.caddy = data));
}
},
mounted () {
this.load()
}
});

View file

@ -0,0 +1,8 @@
[
{"href": "https://about.quodatum.duckdns.org", "text": "about", "port": "19999"},
{"href": "https://git.quodatum.duckdns.org", "text": "git", "port": "9000"},
{"href": "https://wiki.quodatum.duckdns.org", "text": "wiki", "port": "9981"},
{"href": "https://wiki-alt.quodatum.duckdns.org", "text": "wiki alt", "port": "8088"},
{"href": "https://code.quodatum.duckdns.org", "text": "code", "port": "8002"},
{"href": "https://code-alt.quodatum.duckdns.org", "text": "code alt", "port": "3030"}
]

View file

@ -0,0 +1,36 @@
version: '3.4'
services:
cadvisor:
image: zcube/cadvisor:latest
ports:
- published: 9102
target: 9102
mode: host
command:
- "--port=9102"
- "--housekeeping_interval=30s"
- "--docker_only=true"
- "--disable_metrics=percpu,sched,tcp,udp,disk,diskIO,accelerator,hugetlb,referenced_memory,cpu_topology,resctrl"
volumes:
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
- /sys:/sys:ro
- /var/run:/var/run:ro
- /:/rootfs:ro
- /sys/fs/cgroup:/cgroup:ro
- /etc/machine-id:/etc/machine-id:ro
- /etc/localtime:/etc/localtime:ro
deploy:
mode: global
update_config:
order: stop-first
resources:
reservations:
memory: 80M
healthcheck:
test: wget --quiet --tries=1 --spider http://localhost:9102/healthz || exit 1
interval: 15s
timeout: 15s
retries: 5
start_period: 30s

2
code-bmy/.dockerignore Normal file
View file

@ -0,0 +1,2 @@
# docker ignore
custom

58
code-bmy/Dockerfile Normal file
View file

@ -0,0 +1,58 @@
# A code-server image with added
# openjdk@11
# BaseX installed@9.7.3
# @author Andy Bunce
# Bugs:
# hardcoded for amd64
# Main image
FROM ghcr.io/linuxserver/code-server:4.5.1
ARG TARGETARCH
ARG BUILDARCH
RUN echo "I'm building vscode-basex for ${BUILDARCH} on ${TARGETARCH} User: ${PUID}"
LABEL author="Andy Bunce"
LABEL company="Quodatum Ltd"
LABEL maintainer="quodatum@gmail.com"
# Install OpenJDK-8
RUN apt-get update && \
apt-get install -y openjdk-8-jdk-headless;
# Fix certificate issues
RUN apt-get update && \
apt-get install ca-certificates-java && \
apt-get clean && \
update-ca-certificates -f;
# Setup JAVA_HOME -- useful for docker commandline
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/
RUN export JAVA_HOME
# install BaseX to /basex/
RUN curl https://files.basex.org/releases/9.5.1/BaseX951.zip | jar xv && \
chown -R 1000:1000 /basex && chmod a+x /basex/bin/* ;
ENV PATH=$PATH:/basex/bin
# install docker cli only
RUN curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.17.tgz | tar zxv -C /tmp/ && \
cp /tmp/docker/docker /usr/local/bin && rm -r /tmp/docker;
# install maven
RUN curl https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz | \
tar zxv -C /usr/local/bin && \
cd /usr/local/bin && \
ln -s apache-maven-3.8.6 maven
ENV PATH=$PATH:/usr/local/bin/maven/bin
# install node+npm LTS see https://www.how2shout.com/linux/how-to-install-node-js-npm-on-debian-11-bullseye/
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
apt install nodejs
#RUN chmod 666 /var/run/docker.sock
#RUN /usr/local/bin/code-server --install-extension vscode-basex-0.0.21.vsix
# ports and volumes
EXPOSE 8443

3
code-bmy/config/.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
# .gitignore nothing
###################

Binary file not shown.

Binary file not shown.

11
code-bmy/config/.vscode/extensions.json vendored Normal file
View file

@ -0,0 +1,11 @@
{
"recommendations": [
"ms-azuretools.vscode-docker",
"dbaeumer.vscode-eslint",
"eamodio.gitlens",
"kelvin.vscode-sshfs",
"alefragnani.project-manager",
"johnpapa.vscode-peacock",
"nonoroazoro.syncing"
]
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

26
code-bmy/config/install.sh Executable file
View file

@ -0,0 +1,26 @@
# setup
#install extensions located in /exts/ folder
# code-server@4.0.2 omv
CODE_SERVER="/app/code-server/bin/code-server"
# 4.0.1 n2-plus
#CODE_SERVER="/usr/local/bin/code-server"
for FILE in .vscode/*.vsix
do
$CODE_SERVER --install-extension $FILE
done
# pull useful projects
cd /config/workspace
git clone https://github.com/BloomsburyDigital/XML-CMS.git
mkdir quodatum
cd quodatum
git clone https://github.com/Quodatum/xqlint.git
git clone https://github.com/Quodatum/xqdoca.git
git clone https://git.quodatum.duckdns.org/apb/file-samples.git

Binary file not shown.

View file

@ -0,0 +1,21 @@
version: '3'
services:
vscode-basex:
container_name: vscode-bmy
image: vscode-bmy
build: .
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
- SUDO_PASSWORD=password #optional
- SUDO_PASSWORD_HASH= #optional
volumes:
- ./config:/config
- ./repo:/basex/repo
- ./custom:/basex/lib/custom
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 8448:8443
restart: unless-stopped

15
code-bmy/readme.md Normal file
View file

@ -0,0 +1,15 @@
# A BaseX development environment for vscode
## docker build
```
docker build --tag=vscode-basex .
```
## compose
```
docker-compose up
```
## Includes
* openjdk-11-jdk-headless
* BaseX

View file

@ -1,3 +1,5 @@
# code-server
# code-bmy
Docker vscode build for bloomsbury
Installs `code-server:version-v3.9.1` with JRE and BaseX.

View file

@ -12,7 +12,7 @@ services:
- SUDO_PASSWORD_HASH= #optional
volumes:
- ./config:/config
- /var/run/docker.sock:/var/run/docker.sock:ro
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 8443:8443
restart: unless-stopped

View file

@ -2,7 +2,7 @@
version: "2.1"
services:
code-server:
image: ghcr.io/linuxserver/code-server:4.0.1
image: ghcr.io/linuxserver/code-server
container_name: code-server4
environment:
- PUID=1000
@ -12,7 +12,7 @@ services:
- SUDO_PASSWORD_HASH= #optional
volumes:
- ./config:/config
- /var/run/docker.sock:/var/run/docker.sock:ro
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 8444:8443
restart: unless-stopped

View file

@ -1,14 +1,16 @@
# A code-server image with added
# openjdk 11
# BaseX installed
# openjdk@11
# BaseX installed@9.7.3
# @author Andy Bunce
# Bugs:
# hardcoded for amd64
# Main image
FROM ghcr.io/linuxserver/code-server:4.1.0
FROM ghcr.io/linuxserver/code-server:4.5.1
ARG TARGETARCH
ARG BUILDARCH
RUN echo "I'm building vscode-basex for ${BUILDARCH} on ${TARGETARCH}"
RUN echo "I'm building vscode-basex for ${BUILDARCH} on ${TARGETARCH} User: ${PUID}"
LABEL author="Andy Bunce"
LABEL company="Quodatum Ltd"
@ -29,13 +31,25 @@ ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64/
RUN export JAVA_HOME
# install BaseX to /basex/
RUN curl https://files.basex.org/releases/9.6.4/BaseX964.zip | jar xv && \
chmod a+x /basex/bin/*;
RUN curl https://files.basex.org/releases/9.7.3/BaseX973.zip | jar xv && \
chown -R $PUID:$PGID /basex && chmod a+x /basex/bin/* ;
ENV PATH=$PATH:/basex/bin
# install docker cli only
RUN curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.12.tgz | tar zxv -C /tmp/ && \
RUN curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.17.tgz | tar zxv -C /tmp/ && \
cp /tmp/docker/docker /usr/local/bin && rm -r /tmp/docker;
# install maven
RUN curl https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz | \
tar zxv -C /usr/local/bin && \
cd /usr/local/bin && \
ln -s apache-maven-3.8.6 maven
ENV PATH=$PATH:/usr/local/bin/maven/bin
# install node+npm LTS see https://www.how2shout.com/linux/how-to-install-node-js-npm-on-debian-11-bullseye/
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
apt install nodejs
#RUN chmod 666 /var/run/docker.sock
#RUN /usr/local/bin/code-server --install-extension vscode-basex-0.0.21.vsix

Binary file not shown.

View file

@ -14,7 +14,7 @@ services:
volumes:
- ./config:/config
- ./custom:/basex/lib/custom
- /var/run/docker.sock:/var/run/docker.sock:ro
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 8444:8443
restart: unless-stopped

View file

@ -2,7 +2,7 @@
## docker build
```
docker build --tag=vscode-basex .
docker build --tag=vs451-basex973 .
```
## compose
```
@ -10,6 +10,8 @@ docker-compose up
```
## Includes
* openjdk-11-jdk-headless
* BaseX
* BaseX 9.7.3
* node+npm v16
* maven 3.8.6

View file

@ -0,0 +1 @@
https://joxit.dev/docker-registry-ui/

View file

@ -0,0 +1,19 @@
version: "3"
services:
docker-registry:
image: registry:2
container_name: docker-registry
ports:
- 5000:5000
restart: always
volumes:
- ./docker-registry:/var/lib/registry
docker-registry-ui:
image: konradkleine/docker-registry-frontend:v2
container_name: docker-registry-ui
ports:
- 8090:80
environment:
ENV_DOCKER_REGISTRY_HOST: docker-registry
ENV_DOCKER_REGISTRY_PORT: 5000

View file

@ -0,0 +1,8 @@
# .gitignore sample
###################
# Ignore all files in this dir...
*
# ... except for this one.
!.gitignore

19
drone/docker-compose.yml Normal file
View file

@ -0,0 +1,19 @@
version: '2'
services:
drone-server:
image: drone/drone
ports:
- 80:80
volumes:
- ./drone-server-data:/var/lib/drone/
restart: always
environment:
- DRONE_SERVER_HOST=drone.quodatum.duckdns.org
- DRONE_SERVER_PROTO=https
- DRONE_GITEA_SERVER=https://git.quodatum.duckdns.org/
- DRONE_GITEA_CLIENT_ID=607bc1aa-2491-4193-8e6b-a82d2dd05be0
- DRONE_GITEA_CLIENT_SECRET=HZgKI4c353aqNPOhTgjJ5WUttYnVKYp9omifezS-dLM=
- DRONE_RPC_SECRET=06522d7b764c0d05138e79ab7c8c341e
- DRONE_USER_CREATE=username:apb,admin:true

8
emby/cache/.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
# .gitignore sample
###################
# Ignore all files in this dir...
*
# ... except for this one.
!.gitignore

8
emby/config/.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
# .gitignore sample
###################
# Ignore all files in this dir...
*
# ... except for this one.
!.gitignore

26
emby/docker-compose.yml Normal file
View file

@ -0,0 +1,26 @@
version: "2.3"
services:
emby:
image: emby/embyserver
container_name: embyserver
#runtime: nvidia # Expose NVIDIA GPUs
# network_mode: host # Enable DLNA and Wake-on-Lan
# https://forums.docker.com/t/docker-errors-invalidargument-host-network-mode-is-incompatible-with-port-bindings/103492/14
environment:
- UID=1000 # The UID to run emby as (default: 2)
- GID=100 # The GID to run emby as (default 2)
- GIDLIST=100 # A comma-separated list of additional GIDs to run emby as (default: 2)
volumes:
- ./config:/config
- ./cache:/cache
- /srv/dev-disk-by-uuid-45e2e732-9e00-4a82-a7cc-9c743e033671/datastore/music:/music
- /srv/dev-disk-by-uuid-45e2e732-9e00-4a82-a7cc-9c743e033671/datastore/PicasaStarter/pictures/Pictures:/photos
- /srv/dev-disk-by-uuid-45e2e732-9e00-4a82-a7cc-9c743e033671/datastore/entertain:/entertain
ports:
- 8097:8096 # HTTP port
- 8920:8920 # HTTPS port
devices:
- /dev/dri:/dev/dri # VAAPI/NVDEC/NVENC render nodes
#- /dev/vchiq:/dev/vchiq # MMAL/OMX on Raspberry Pi
restart: unless-stopped

View file

@ -5,7 +5,6 @@ services:
gerbera:
image: gerbera/gerbera:1.9.2
container_name: gerbera
restart: always
volumes:
- "/mnt/media/pictures:/media/pictures:ro"
- "./videos:/media/videos:ro"

View file

@ -4,6 +4,52 @@
from https://gist.github.com/sinbad/4bb771b916fa8facaf340af3fc49ee43
### backup_gitea.sh
writes to `/mnt/drive/backups/gitea/`
### restore
### Backup
`backup_gitea.sh` writes to `/mnt/drive/backups/gitea/`
### Restore
* Requires `7z` (`apt install p7zip-full`)
```bash
#restore_gitea_data.sh [--dry-run] <source_dir> <dest_dir> <sql_file_dest>
./restore_gitea_data.sh /srv/dev-disk-by-uuid-45e2e732-9e00-4a82-a7cc-9c743e033671/datastore/gitea data
```
## Samples
### Backup
```bash
./backup_gitea.sh
Backing up Gitea data to /mnt/drive/backups/gitea/gitea_backup.zip via gitea:/tmp/gitea_dump_temp.zip
2022/03/23 22:49:30 ...dules/setting/log.go:286:newLogService() [I] Gitea v1.15.8 built with GNU Make 4.3, go1.16.12 : bindata, timetzdata, sqlite, sqlite_unlock_notify
2022/03/23 22:49:30 ...dules/setting/log.go:333:newLogService() [I] Gitea Log Mode: Console(Console:)
2022/03/23 22:49:30 ...dules/setting/log.go:249:generateNamedLogger() [I] Router Log: Console(console:)
2022/03/23 22:49:30 ...les/setting/cache.go:78:newCacheService() [I] Cache Service Enabled
2022/03/23 22:49:30 ...les/setting/cache.go:93:newCacheService() [I] Last Commit Cache Service Enabled
2022/03/23 22:49:30 ...s/setting/session.go:77:newSessionService() [I] Session Service Enabled
2022/03/23 22:49:30 ...es/setting/mailer.go:109:newMailService() [I] Mail Service Enabled
2022/03/23 22:49:30 ...s/storage/storage.go:171:initAttachments() [I] Initialising Attachment storage with type:
2022/03/23 22:49:30 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/attachments
2022/03/23 22:49:30 ...s/storage/storage.go:165:initAvatars() [I] Initialising Avatar storage with type:
2022/03/23 22:49:30 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/avatars
2022/03/23 22:49:30 ...s/storage/storage.go:183:initRepoAvatars() [I] Initialising Repository Avatar storage with type:
2022/03/23 22:49:30 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/repo-avatars
2022/03/23 22:49:30 ...s/storage/storage.go:177:initLFS() [I] Initialising LFS storage with type:
2022/03/23 22:49:30 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /data/git/lfs
2022/03/23 22:49:30 ...s/storage/storage.go:189:initRepoArchives() [I] Initialising Repository Archive storage with type:
2022/03/23 22:49:30 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/repo-archive
2022/03/23 22:49:30 cmd/dump.go:221:runDump() [I] Skip dumping local repositories
2022/03/23 22:49:30 cmd/dump.go:267:runDump() [I] Dumping database...
2022/03/23 22:49:30 cmd/dump.go:279:runDump() [I] Adding custom configuration file from /data/gitea/conf/app.ini
2022/03/23 22:49:30 cmd/dump.go:295:runDump() [I] Custom dir /data/gitea is inside data dir /data/gitea, skipped
2022/03/23 22:49:30 cmd/dump.go:307:runDump() [I] Packing data directory.../data/gitea
2022/03/23 22:49:31 cmd/dump.go:352:runDump() [I] Skip dumping log files
Backing up git repositories
Backing up LFS data
Gitea backup completed successfully
```
##Restore
```
todo
```

9
gitea/backup.sh Executable file
View file

@ -0,0 +1,9 @@
#!/bin/bash
# backup gitea
echo "stopping"
docker-compose stop
echo "stopping"
. backup_gitea.sh
echo "restart"
docker-compose up -d

14
gitea/backup_gitea.sh Normal file → Executable file
View file

@ -14,22 +14,22 @@
# * /repositories/ - containing the bundles, structured owner/name.bundle
# * /lfs/ - containing all the direct LFS data
#
# Stop on errors
set -e
# Stop on errors or undefined
set -e -u
# Gitea config / SQL DB backup rotation
CONTAINER=gitea
# Backup dir from our perspective
HOST_BACKUP_DIR="/mnt/drive/backups"
HOST_BACKUP_DIR=$DEST
# Git repo dir from our perspective (it's outside container)
HOST_GIT_REPO_DIR="/mnt/drive/docker/thedocks/gitea/data/git/repositories"
HOST_GIT_REPO_DIR="$SRC/git/repositories"
# Git LFS dir from our perspective (it's outside container)
HOST_GIT_LFS_DIR="/mnt/drive/docker/thedocks/gitea/data/git/lfs"
HOST_GIT_LFS_DIR="$SRC/git/lfs"
# Where we work on things (host and container)
TEMP_DIR="/tmp"
GITEA_DATA_FILENAME="gitea_backup.zip"
HOST_BACKUP_FILE="$HOST_BACKUP_DIR/$GITEA_DATA_FILENAME"
HOST_BACKUP_FILE="$DEST/$GITEA_DATA_FILENAME"
# Back up to temp files then copy on success to prevent syncing incomplete/bad files
CONTAINER_BACKUP_FILE_TEMP="$TEMP_DIR/gitea_dump_temp.zip"
@ -43,7 +43,7 @@ docker cp $CONTAINER:$CONTAINER_BACKUP_FILE_TEMP $HOST_BACKUP_FILE
echo Backing up git repositories
# Git repos are in 2-level structure, owner/repository
# Again we MUST tar to a TEMP file and move into place when successful
GITREPO_BACKUP_FILE="$HOST_BACKUP_DIR/gitrepos_backup.tar.bz2"
GITREPO_BACKUP_FILE="$DEST/gitrepos_backup.tar.bz2"
GITREPO_BACKUP_FILE_TEMP=`mktemp -p $TEMP_DIR gitrepos_backup.tar.bz2.XXXXXX`
tar cjf $GITREPO_BACKUP_FILE_TEMP -C $HOST_GIT_REPO_DIR .
mv -f $GITREPO_BACKUP_FILE_TEMP $GITREPO_BACKUP_FILE

5
gitea/omv.profile Executable file
View file

@ -0,0 +1,5 @@
# for gitea_backup
#!/bin/bash
export SRC="/root/thedocks/gitea/data"
export DEST="/srv/dev-disk-by-uuid-45e2e732-9e00-4a82-a7cc-9c743e033671/datastore/gitea"

0
gitea/restore_gitea_container.sh Normal file → Executable file
View file

7
gitea/restore_gitea_data.sh Normal file → Executable file
View file

@ -31,11 +31,12 @@ if [[ "$1" == "--help" ]]; then
fi
DRYRUN=0
SOURCE="gitea"
DATADIR="data"
#SOURCE="gitea"
# /srv/dev-disk-by-uuid-45e2e732-9e00-4a82-a7cc-9c743e033671/datastore/gitea
#DATADIR="data"
SQLDEST=""
USER_UID=1000
GROUP_GID=1000
GROUP_GID=100
while (( "$#" )); do
if [[ "$1" == "--dry-run" ]]; then

8
jellyfin/cache/.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
# .gitignore sample
###################
# Ignore all files in this dir...
*
# ... except for this one.
!.gitignore

8
jellyfin/config/.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
# .gitignore sample
###################
# Ignore all files in this dir...
*
# ... except for this one.
!.gitignore

View file

@ -0,0 +1,24 @@
version: "3.5"
services:
jellyfin:
image: jellyfin/jellyfin
container_name: jellyfin
user: 1000:100
group_add:
- 107
network_mode: "host"
volumes:
- ./config:/config
- ./cache:/cache
- /srv/dev-disk-by-uuid-45e2e732-9e00-4a82-a7cc-9c743e033671/datastore/music:/music
- /srv/dev-disk-by-uuid-45e2e732-9e00-4a82-a7cc-9c743e033671/datastore/PicasaStarter/pictures/Pictures:/photos
- /srv/dev-disk-by-uuid-45e2e732-9e00-4a82-a7cc-9c743e033671/datastore/entertain:/entertain
restart: "unless-stopped"
# Optional - alternative address used for autodiscovery
environment:
- JELLYFIN_PublishedServerUrl=https://jellyfin.orlop.duckdns.org
#devices:
# VAAPI Devices (for omv :Intel NUC Board D54250WYK)
# - /dev/dri/renderD128:/dev/dri/renderD128
# - /dev/dri/card0:/dev/dri/card0

View file

@ -0,0 +1,13 @@
---
version: "2.1"
services:
mermaid:
image: tomwright/mermaid-server:latest
container_name: mermaid
environment:
- USER_UID=1000
- USER_GID=1000
ports:
- "4500:80"
restart: unless-stopped

1
mermaid-server/readme.md Normal file
View file

@ -0,0 +1 @@
https://github.com/TomWright/mermaid-server

View file

@ -0,0 +1,27 @@
version: '3'
services:
netdata:
image: netdata/netdata
container_name: netdata
#hostname: example.com # set to fqdn of host
ports:
- 19999:19999
restart: unless-stopped
cap_add:
- SYS_PTRACE
security_opt:
- apparmor:unconfined
volumes:
- netdataconfig:/etc/netdata
- netdatalib:/var/lib/netdata
- netdatacache:/var/cache/netdata
- /etc/passwd:/host/etc/passwd:ro
- /etc/group:/host/etc/group:ro
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /etc/os-release:/host/etc/os-release:ro
volumes:
netdataconfig:
netdatalib:
netdatacache:

8
ntopng/data/.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
# .gitignore sample
###################
# Ignore all files in this dir...
*
# ... except for this one.
!.gitignore

View file

@ -0,0 +1,21 @@
version: '3'
services:
redis:
image: redis:alpine
command: --save 900 1
volumes:
- ./data/redis:/data
restart: on-failure:5
network_mode: "host"
ntopng:
build:
context: ntop
dockerfile: Dockerfile
command: ntopng -r localhost:6379 -d /ntopngcustom
volumes:
- ./data/ntopng:/var/lib/ntopng
restart: on-failure:5
network_mode: "host"
depends_on:
- redis

24
ntopng/ntop/Dockerfile Normal file
View file

@ -0,0 +1,24 @@
# from: https://github.com/ntop/docker-ntop/blob/master/Dockerfile.ntopng-arm64
FROM debian:bullseye-slim
# Main dependencies and ntop.org apt package repo installation
RUN apt-get update && \
apt-get -y -q install software-properties-common wget lsb-release gnupg libelf1 && \
wget -q http://packages.ntop.org/RaspberryPI/apt-ntop_1.0.190416-469_all.deb && \
apt-get -y -q install ./apt-ntop_1.0.190416-469_all.deb
# ntopng, some of its dependencies and libcap2 / libzstd1 need to be armhf
# architecture, because latest ntopng (4.3) is not available in arm64
RUN apt-get clean all && \
dpkg --add-architecture armhf && \
apt-get update && \
apt-get -y -q install ntopng:armhf libcap2:armhf libzstd1:armhf
RUN echo '#!/bin/bash\n/etc/init.d/redis-server start\nntopng "$@" "$NTOP_CONFIG"' > /run.sh && \
chmod +x /run.sh
EXPOSE 3000
ENTRYPOINT ["/run.sh"]

View file

@ -11,13 +11,15 @@ docker network create -d macvlan \
```
then
1. sudo ip link set eth0 promisc on
1. sudo ip link add macvlan-shim link eth0 type macvlan mode bridge
1. sudo ip addr add 192.168.1.60/28 dev macvlan-shim
1. sudo ip link set macvlan-shim up
```
sudo ip link set eth0 promisc on
sudo ip link add macvlan-shim link eth0 type macvlan mode bridge
sudo ip addr add 192.168.1.60/28 dev macvlan-shim
sudo ip link set macvlan-shim up
```
Check
ifconfig macvlan-shim
`ifconfig macvlan-shim`
## /usr/local/bin/pi-vlan.sh

8
prism/database/.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
# .gitignore sample
###################
# Ignore all files in this dir...
*
# ... except for this one.
!.gitignore

145
prism/docker-compose Normal file
View file

@ -0,0 +1,145 @@
version: '3.5'
# Example Docker Compose config file for PhotoPrism (Raspberry Pi 3/4 and other ARM64-based devices)
#
# Note:
# - You have to boot your Raspberry Pi 3/4 with the parameter "arm_64bit=1" in config.txt to use our ARM64 (64-bit) image.
# An "exec format" error will occur otherwise.
# - Try explicitly pulling the ARM64 version if you've booted your device with the "arm_64bit=1" flag and you see
# the "no matching manifest" error on Raspberry Pi OS (Raspbian). See documentation for details.
# - Use https://dl.photoprism.app/docker/armv7/docker-compose.yml to run PhotoPrism and MariaDB on ARMv7-based devices
# as well as Raspberry Pi OS (Raspbian) installations without 64-bit support.
# - Running PhotoPrism on a server with less than 4 GB of swap space or setting a memory/swap limit can cause unexpected
# restarts ("crashes"), for example, when the indexer temporarily needs more memory to process large files.
# - In case you see Docker errors related to "cgroups", try adding the following parameters to /boot/firmware/cmdline.txt
# or /boot/cmdline.txt (file location depends on the OS in use): cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1
# - If you install PhotoPrism on a public server outside your home network, please always run it behind a secure
# HTTPS reverse proxy such as Traefik or Caddy. Your files and passwords will otherwise be transmitted
# in clear text and can be intercepted by anyone, including your provider, hackers, and governments:
# https://docs.photoprism.app/getting-started/proxies/traefik/
#
# Documentation : https://docs.photoprism.app/getting-started/raspberry-pi/
# Docker Hub URL: https://hub.docker.com/r/photoprism/photoprism/
#
# DOCKER COMPOSE COMMAND REFERENCE
# see https://docs.photoprism.app/getting-started/docker-compose/#command-line-interface
# --------------------------------------------------------------------------
# Start | docker-compose up -d
# Stop | docker-compose stop
# Update | docker-compose pull
# Logs | docker-compose logs --tail=25 -f
# Terminal | docker-compose exec photoprism bash
# Help | docker-compose exec photoprism photoprism help
# Config | docker-compose exec photoprism photoprism config
# Reset | docker-compose exec photoprism photoprism reset
# Backup | docker-compose exec photoprism photoprism backup -a -i
# Restore | docker-compose exec photoprism photoprism restore -a -i
# Index | docker-compose exec photoprism photoprism index
# Reindex | docker-compose exec photoprism photoprism index -f
# Import | docker-compose exec photoprism photoprism import
#
# To search originals for faces without a complete rescan:
# docker-compose exec photoprism photoprism faces index
#
# All commands may have to be prefixed with "sudo" when not running as root.
# This will point the home directory shortcut ~ to /root in volume mounts.
services:
photoprism:
## Use photoprism/photoprism:preview-arm64 for testing preview builds:
image: photoprism/photoprism:arm64
depends_on:
- mariadb
## Don't enable automatic restarts until PhotoPrism has been properly configured and tested!
## If the service gets stuck in a restart loop, this points to a memory, filesystem, network, or database issue:
## https://docs.photoprism.app/getting-started/troubleshooting/#fatal-server-errors
# restart: unless-stopped
security_opt:
- seccomp:unconfined
- apparmor:unconfined
ports:
- "2342:2342" # HTTP port (host:container)
environment:
PHOTOPRISM_ADMIN_PASSWORD: "insecure" # !!! PLEASE CHANGE YOUR INITIAL "admin" PASSWORD !!!
PHOTOPRISM_SITE_URL: "http://localhost:2342/" # public server URL incl http:// or https:// and /path, :port is optional
PHOTOPRISM_ORIGINALS_LIMIT: 5000 # file size limit for originals in MB (increase for high-res video)
PHOTOPRISM_HTTP_COMPRESSION: "none" # improves transfer speed and bandwidth utilization (none or gzip)
PHOTOPRISM_WORKERS: 2 # limits the number of indexing workers to reduce system load
PHOTOPRISM_DEBUG: "false" # run in debug mode (shows additional log messages)
PHOTOPRISM_PUBLIC: "false" # no authentication required (disables password protection)
PHOTOPRISM_READONLY: "false" # don't modify originals directory (reduced functionality)
PHOTOPRISM_EXPERIMENTAL: "false" # enables experimental features
PHOTOPRISM_DISABLE_CHOWN: "false" # disables storage permission updates on startup
PHOTOPRISM_DISABLE_WEBDAV: "false" # disables built-in WebDAV server
PHOTOPRISM_DISABLE_SETTINGS: "false" # disables Settings in Web UI
PHOTOPRISM_DISABLE_TENSORFLOW: "false" # disables all features depending on TensorFlow
PHOTOPRISM_DISABLE_FACES: "false" # disables facial recognition
PHOTOPRISM_DISABLE_CLASSIFICATION: "false" # disables image classification
PHOTOPRISM_DARKTABLE_PRESETS: "true" # enables Darktable presets and disables concurrent RAW conversion
# PHOTOPRISM_FFMPEG_ENCODER: "h264_v4l2m2m" # FFmpeg AVC encoder for video transcoding (default: libx264)
# PHOTOPRISM_FFMPEG_BUFFERS: "64" # FFmpeg capture buffers (default: 32)
PHOTOPRISM_DETECT_NSFW: "false" # flag photos as private that MAY be offensive
PHOTOPRISM_UPLOAD_NSFW: "true" # allow uploads that MAY be offensive
# PHOTOPRISM_DATABASE_DRIVER: "sqlite" # SQLite is an embedded database that doesn't require a server
PHOTOPRISM_DATABASE_DRIVER: "mysql" # use MariaDB 10.5+ or MySQL 8+ instead of SQLite for improved performance
PHOTOPRISM_DATABASE_SERVER: "mariadb:3306" # MariaDB or MySQL database server (hostname:port)
PHOTOPRISM_DATABASE_NAME: "photoprism" # MariaDB or MySQL database schema name
PHOTOPRISM_DATABASE_USER: "photoprism" # MariaDB or MySQL database user name
PHOTOPRISM_DATABASE_PASSWORD: "insecure" # MariaDB or MySQL database user password
PHOTOPRISM_SITE_TITLE: "PhotoPrism"
PHOTOPRISM_SITE_CAPTION: "AI-Powered Photos App"
PHOTOPRISM_SITE_DESCRIPTION: ""
PHOTOPRISM_SITE_AUTHOR: ""
## Run/install on first startup (options: update, gpu, tensorflow, davfs, clean):
# PHOTOPRISM_INIT: "update clean"
## Run as a specific user, group, or with a custom umask (does not work together with "user:")
# PHOTOPRISM_UID: 1000
# PHOTOPRISM_GID: 1000
# PHOTOPRISM_UMASK: 0000
HOME: "/photoprism"
## Start as a non-root user (see https://docs.docker.com/engine/reference/run/#user)
# user: "1000:1000"
## Share hardware devices with FFmpeg and TensorFlow (optional):
# devices:
# - "/dev/video11:/dev/video11" # Video4Linux (h264_v4l2m2m)
working_dir: "/photoprism"
## Storage Folders: "~" is a shortcut for your home directory, "." for the current directory
volumes:
# "/host/folder:/photoprism/folder" # example
- "./pictures:/photoprism/originals" # original media files (photos and videos)
# - "/example/family:/photoprism/originals/family" # *additional* media folders can be mounted like this
# - "~/Import:/photoprism/import" # *optional* base folder from which files can be imported to originals
- "./storage:/photoprism/storage" # *writable* storage folder for cache, database, and sidecar files (never remove)
## Database Server (recommended)
## see https://docs.photoprism.app/getting-started/faq/#should-i-use-sqlite-mariadb-or-mysql
mariadb:
## If MariaDB gets stuck in a restart loop, this points to a memory or filesystem issue:
## https://docs.photoprism.app/getting-started/troubleshooting/#fatal-server-errors
restart: unless-stopped
image: arm64v8/mariadb:10.6 # this mariadb image runs on ARM64-based devices only
security_opt:
- seccomp:unconfined
- apparmor:unconfined
command: mysqld --innodb-buffer-pool-size=128M --transaction-isolation=READ-COMMITTED --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=512 --innodb-rollback-on-timeout=OFF --innodb-lock-wait-timeout=120
## Never store database files on an unreliable device such as a USB flash drive, an SD card, or a shared network folder:
volumes:
- "./database:/var/lib/mysql" # important, don't remove
environment:
MYSQL_ROOT_PASSWORD: insecure
MYSQL_DATABASE: photoprism
MYSQL_USER: photoprism
MYSQL_PASSWORD: insecure
## Watchtower upgrades services automatically (optional)
## see https://docs.photoprism.app/getting-started/updates/#watchtower
#
# watchtower:
# restart: unless-stopped
# image: containrrr/watchtower
# environment:
# WATCHTOWER_CLEANUP: "true"
# WATCHTOWER_POLL_INTERVAL: 7200 # checks for updates every two hours
# volumes:
# - "/var/run/docker.sock:/var/run/docker.sock"
# - "~/.docker/config.json:/config.json" # optional, for authentication if you have a Docker Hub account

8
prism/pictures/.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
# .gitignore sample
###################
# Ignore all files in this dir...
*
# ... except for this one.
!.gitignore

8
prism/storage/.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
# .gitignore sample
###################
# Ignore all files in this dir...
*
# ... except for this one.
!.gitignore

View file

@ -0,0 +1,16 @@
version: '3'
services:
prometheus:
container_name: prometheus
image: prom/prometheus:v2.34.0
ports:
- 9000:9090
volumes:
- ./prometheus:/etc/prometheus
- prometheus-data:/prometheus
command: --web.enable-lifecycle --config.file=/etc/prometheus/prometheus.yml
volumes:
prometheus-data:

View file

@ -0,0 +1,6 @@
groups:
- name: DemoAlerts
rules:
- alert: InstanceDown
expr: up{job="services"} < 1
for: 5m

View file

@ -0,0 +1,16 @@
global:
scrape_interval: 30s
scrape_timeout: 10s
rule_files:
- alert.yml
scrape_configs:
- job_name: services
metrics_path: /metrics
static_configs:
- targets:
- 'prometheus:9090'
- 'idonotexists:564'
- 'localhost:2015'

8
redis/data/.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
# .gitignore sample
###################
# Ignore all files in this dir...
*
# ... except for this one.
!.gitignore

14
redis/docker-compose.yml Normal file
View file

@ -0,0 +1,14 @@
version: '3.2'
# redis for arm7
services:
redis:
image: "arm32v7/redis"
command: redis-server --save 20 1 --loglevel warning
container_name: redis-test
ports:
- '6379:6379'
restart: unless-stopped
volumes:
- ./data:/data

View file

@ -1,42 +0,0 @@
version: "3"
services:
sonarqube:
image: sonarqube
expose:
- 9005
ports:
- "9005:9000"
networks:
- sonarnet
environment:
- SONARQUBE_JDBC_URL=jdbc:postgresql://db:5432/sonar
- SONARQUBE_JDBC_USERNAME=sonar
- SONARQUBE_JDBC_PASSWORD=sonar
volumes:
- sonarqube_conf:/opt/sonarqube/conf
- sonarqube_data:/opt/sonarqube/data
- sonarqube_extensions:/opt/sonarqube/extensions
- sonarqube_bundled-plugins:/opt/sonarqube/lib/bundled-plugins
db:
image: postgres
networks:
- sonarnet
environment:
- POSTGRES_USER=sonar
- POSTGRES_PASSWORD=sonar
volumes:
- postgresql:/var/lib/postgresql
- postgresql_data:/var/lib/postgresql/data
networks:
sonarnet:
volumes:
sonarqube_conf:
sonarqube_data:
sonarqube_extensions:
sonarqube_bundled-plugins:
postgresql:
postgresql_data:

View file

@ -1,3 +0,0 @@
requires
sysctl vm.max_map_count=262144

View file

@ -1,6 +1,6 @@
FROM node:12-alpine
RUN npm install -g tiddlywiki@5.2.0
RUN npm install -g tiddlywiki@5.2.3
EXPOSE 8080

View file

@ -1,25 +0,0 @@
# TiddlyWiki Docker
Run TiddlyWiki 5 via Docker and Docker Compose
## QuickStart
You should install [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/) first.
```shell
cp .env-example .env
docker-compose up -d
```
Now TiddlyWiki should be running on http://localhost:8080.
## Data
The directory `./wiki-data` is used for all the data.
## Auth
default: `user` / `wiki`
Modify `.env` file to customize
## ToDo
- [ ] Backup Data Automatically: sync `./wiki-data` with Object Storage Service (Like Amazon S3)
## Related Repo
* https://github.com/djmaze/tiddlywiki-docker

8
tiddlywiki/data/.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
# .gitignore sample
###################
# Ignore all files in this dir...
*
# ... except for this one.
!.gitignore

View file

@ -2,7 +2,7 @@ version: '3'
services:
tiddly:
image: tiddlywiki:5.2.0
image: tiddlywiki:5.2.3
build: .
container_name: tiddlywiki-docker
restart: unless-stopped

18
tiddlywiki/tiddly-backup.sh Executable file
View file

@ -0,0 +1,18 @@
#!/bin/bash
# tiddlywiki server backup management
set -e
DATASTORE=/srv/dev-disk-by-uuid-45e2e732-9e00-4a82-a7cc-9c743e033671/datastore/tiddly/
XU4=root@192.168.1.5:/root/thedocks/tiddlywiki/data/
N2=root@192.168.1.4:/mnt/drive/tiddly
PLUS=root@192.168.1.10:/home/odroid/thedocks/tiddlywiki/data
sync(){
rsync -av --delete $1 $2
}
echo "XU4 ->DATASTORE"
sync $XU4 $DATASTORE
echo "DATASTORE ->PLUS"
sync $DATASTORE $PLUS

View file

@ -1,4 +1,9 @@
# tvheadend setup
```
- /mnt/media/recordings:/recordings
```
HTS Tvheadend 4.3-1979~g8fc2dfa7e
## Users
Jellyfin: jellyfin:jellyfin

View file

@ -18,6 +18,7 @@ services:
volumes:
- ./config:/config
- /lib/modules:/lib/modules
- /usr/src:/usr/src
ports:
- 51820:51820/udp
sysctls:

3
wireshark/config/.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
# ignore
# ... except for this one.
!.gitignore

View file

@ -0,0 +1,16 @@
version: "2.1"
services:
wireshark:
image: lscr.io/linuxserver/wireshark:latest
container_name: wireshark
cap_add:
- NET_ADMIN
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
volumes:
- ./config:/config
ports:
- 4000:3000 #optional
restart: unless-stopped