Merge pull request 'Merge Dev to Main (Added Linkwarden & postgresql and minor fixes)' (#4) from dev into main
Reviewed-on: #4
This commit was merged in pull request #4.
This commit is contained in:
@@ -344,7 +344,7 @@ files:
|
|||||||
variants:
|
variants:
|
||||||
- mqtt
|
- mqtt
|
||||||
|
|
||||||
#FileForMqtt
|
#FileForHass
|
||||||
- path: /opt/Setup
|
- path: /opt/Setup
|
||||||
generator: copy
|
generator: copy
|
||||||
source: CT-Files/hass
|
source: CT-Files/hass
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ pipeline {
|
|||||||
string defaultValue: '192.168.200.11', description: 'Proxy server for packages, when enabled', name: 'ProxyServer'
|
string defaultValue: '192.168.200.11', description: 'Proxy server for packages, when enabled', name: 'ProxyServer'
|
||||||
booleanParam description: 'will disable use of proxy server', name: 'DisProxy'
|
booleanParam description: 'will disable use of proxy server', name: 'DisProxy'
|
||||||
checkboxParameter(name: 'ImgVariantList', format: 'JSON', displayNodePath: "//Variants/Variant", valueNodePath: "//Variants/Variant", description: 'Select the variant(s) that should be build',
|
checkboxParameter(name: 'ImgVariantList', format: 'JSON', displayNodePath: "//Variants/Variant", valueNodePath: "//Variants/Variant", description: 'Select the variant(s) that should be build',
|
||||||
pipelineSubmitContent: '{"Variants": [{"Variant": "minimal"},{"Variant": "default"},{"Variant": "jenkinsbuilder"},{"Variant": "imgbuilder"},{"Variant": "jenkins"},{"Variant": "mysql"},{"Variant": "pihole"},{"Variant": "collabora"},{"Variant": "jellyfin"},{"Variant": "domoticz"},{"Variant": "omadaV3"},{"Variant": "docker"},{"Variant": "smb"},{"Variant": "x2go"},{"Variant": "aptcacherng"},{"Variant": "nfs"},{"Variant": "duplicati"},{"Variant": "fileshelter"},{"Variant": "esphome"}]}')
|
pipelineSubmitContent: '{"Variants": [{"Variant": "minimal"},{"Variant": "default"},{"Variant": "jenkinsbuilder"},{"Variant": "imgbuilder"},{"Variant": "jenkins"},{"Variant": "mysql"},{"Variant": "pihole"},{"Variant": "collabora"},{"Variant": "jellyfin"},{"Variant": "domoticz"},{"Variant": "omadaV3"},{"Variant": "docker"},{"Variant": "smb"},{"Variant": "x2go"},{"Variant": "aptcacherng"},{"Variant": "nfs"},{"Variant": "duplicati"},{"Variant": "fileshelter"},{"Variant": "esphome"},{"Variant": "postgresql"},{"Variant": "linkwarden"}]}')
|
||||||
}
|
}
|
||||||
options {
|
options {
|
||||||
skipDefaultCheckout()
|
skipDefaultCheckout()
|
||||||
|
|||||||
@@ -1092,6 +1092,8 @@ files:
|
|||||||
- mysql
|
- mysql
|
||||||
- pihole
|
- pihole
|
||||||
- docker
|
- docker
|
||||||
|
- postgresql
|
||||||
|
- linkwarden
|
||||||
|
|
||||||
#FilesForJenkinsVariant
|
#FilesForJenkinsVariant
|
||||||
- path: /root/ReadMe
|
- path: /root/ReadMe
|
||||||
@@ -1192,6 +1194,20 @@ files:
|
|||||||
variants:
|
variants:
|
||||||
- esphome
|
- esphome
|
||||||
|
|
||||||
|
#FileForPostgresql
|
||||||
|
- path: /opt/Setup
|
||||||
|
generator: copy
|
||||||
|
source: CT-Files/postgresql
|
||||||
|
variants:
|
||||||
|
- postgresql
|
||||||
|
|
||||||
|
#FileForLinkwarden
|
||||||
|
- path: /opt/Setup
|
||||||
|
generator: copy
|
||||||
|
source: CT-Files/linkwarden
|
||||||
|
variants:
|
||||||
|
- linkwarden
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
manager: apt
|
manager: apt
|
||||||
update: true
|
update: true
|
||||||
@@ -1216,6 +1232,8 @@ packages:
|
|||||||
- nfs
|
- nfs
|
||||||
- duplicati
|
- duplicati
|
||||||
- fileshelter
|
- fileshelter
|
||||||
|
- postgresql
|
||||||
|
- linkwarden
|
||||||
|
|
||||||
#Https Repo pkgs
|
#Https Repo pkgs
|
||||||
- packages:
|
- packages:
|
||||||
@@ -1238,6 +1256,8 @@ packages:
|
|||||||
- duplicati
|
- duplicati
|
||||||
- fileshelter
|
- fileshelter
|
||||||
- esphome
|
- esphome
|
||||||
|
- postgresql
|
||||||
|
- linkwarden
|
||||||
|
|
||||||
#Minimal pkgs
|
#Minimal pkgs
|
||||||
- packages:
|
- packages:
|
||||||
@@ -1254,6 +1274,7 @@ packages:
|
|||||||
- procps
|
- procps
|
||||||
- unattended-upgrades
|
- unattended-upgrades
|
||||||
- bash-completion
|
- bash-completion
|
||||||
|
- dbus
|
||||||
action: install
|
action: install
|
||||||
|
|
||||||
#Basic/Default pkgs
|
#Basic/Default pkgs
|
||||||
@@ -1285,6 +1306,7 @@ packages:
|
|||||||
- fuse2fs
|
- fuse2fs
|
||||||
- xz-utils
|
- xz-utils
|
||||||
- fuse
|
- fuse
|
||||||
|
- umoci
|
||||||
- rsync
|
- rsync
|
||||||
- debootstrap
|
- debootstrap
|
||||||
- gpg
|
- gpg
|
||||||
@@ -1530,6 +1552,33 @@ packages:
|
|||||||
variants:
|
variants:
|
||||||
- esphome
|
- esphome
|
||||||
|
|
||||||
|
#postgresql pkgs
|
||||||
|
- packages:
|
||||||
|
- postgresql
|
||||||
|
- pgadmin4-server
|
||||||
|
- nano
|
||||||
|
- uwsgi
|
||||||
|
- uwsgi-plugin-python3
|
||||||
|
action: install
|
||||||
|
variants:
|
||||||
|
- postgresql
|
||||||
|
|
||||||
|
#Base PKGS NodeJS
|
||||||
|
- packages:
|
||||||
|
- nodejs
|
||||||
|
- sudo
|
||||||
|
- nano
|
||||||
|
action: install
|
||||||
|
variants:
|
||||||
|
- linkwarden
|
||||||
|
|
||||||
|
#linkwarden pkgs
|
||||||
|
- packages:
|
||||||
|
- git
|
||||||
|
action: install
|
||||||
|
variants:
|
||||||
|
- linkwarden
|
||||||
|
|
||||||
repositories:
|
repositories:
|
||||||
- name: sources.list
|
- name: sources.list
|
||||||
url: |-
|
url: |-
|
||||||
@@ -1608,6 +1657,15 @@ packages:
|
|||||||
variants:
|
variants:
|
||||||
- fileshelter
|
- fileshelter
|
||||||
|
|
||||||
|
#postgresql Repo
|
||||||
|
- name: postgresql.list
|
||||||
|
url: |-
|
||||||
|
deb [signed-by=/usr/share/keyrings/postgresql-keyring.gpg] https://apt.postgresql.org/pub/repos/apt {{ image.release }}-pgdg main
|
||||||
|
deb [signed-by=/usr/share/keyrings/pgadmin-keyring.gpg] https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/{{ image.release }} pgadmin4 main
|
||||||
|
variants:
|
||||||
|
- postgresql
|
||||||
|
|
||||||
|
|
||||||
actions:
|
actions:
|
||||||
- trigger: post-unpack
|
- trigger: post-unpack
|
||||||
action: |-
|
action: |-
|
||||||
@@ -1645,6 +1703,22 @@ actions:
|
|||||||
# Cleanup temporary shadow paths
|
# Cleanup temporary shadow paths
|
||||||
rm /etc/*-
|
rm /etc/*-
|
||||||
|
|
||||||
|
#Run init script for NodeJS CT
|
||||||
|
- trigger: post-files
|
||||||
|
action: |-
|
||||||
|
#!/bin/sh
|
||||||
|
#Install pm2
|
||||||
|
npm install -g pm2
|
||||||
|
#Add NodeJS `node` service user
|
||||||
|
adduser --system --shell /bin/bash --group --disabled-password --home /home/node node
|
||||||
|
mkdir /opt/node
|
||||||
|
chown node:node /opt/node
|
||||||
|
env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u node --hp /home/node
|
||||||
|
which pm2
|
||||||
|
echo "alias pm2='sudo -u node pm2'" >> ~/.bashrc
|
||||||
|
variants:
|
||||||
|
- linkwarden
|
||||||
|
|
||||||
#Run provided init script
|
#Run provided init script
|
||||||
- trigger: post-files
|
- trigger: post-files
|
||||||
action: |-
|
action: |-
|
||||||
@@ -1663,6 +1737,8 @@ actions:
|
|||||||
- duplicati
|
- duplicati
|
||||||
- fileshelter
|
- fileshelter
|
||||||
- esphome
|
- esphome
|
||||||
|
- postgresql
|
||||||
|
- linkwarden
|
||||||
|
|
||||||
#Move App update script for ProxmoxHelper/ProxMoxToolKit, if CT has this script
|
#Move App update script for ProxmoxHelper/ProxMoxToolKit, if CT has this script
|
||||||
- trigger: post-files
|
- trigger: post-files
|
||||||
@@ -1782,6 +1858,24 @@ actions:
|
|||||||
variants:
|
variants:
|
||||||
- fileshelter
|
- fileshelter
|
||||||
|
|
||||||
|
#postgresql and pgadmin Repo key
|
||||||
|
- trigger: post-unpack
|
||||||
|
action: |-
|
||||||
|
#!/bin/sh
|
||||||
|
curl --retry 7 --retry-delay 5 -L -s https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor > /usr/share/keyrings/postgresql-keyring.gpg
|
||||||
|
curl --retry 7 --retry-delay 5 -L -s https://www.pgadmin.org/static/packages_pgadmin_org.pub | gpg --dearmor > /usr/share/keyrings/pgadmin-keyring.gpg
|
||||||
|
variants:
|
||||||
|
- postgresql
|
||||||
|
|
||||||
|
#NodeJS Repo key
|
||||||
|
- trigger: post-unpack
|
||||||
|
action: |-
|
||||||
|
#!/bin/sh
|
||||||
|
curl --retry 7 --retry-delay 5 -fsSL https://deb.nodesource.com/setup_lts.x |sed 's/gnupg/gpg/' > /tmp/setup-noderepo.sh
|
||||||
|
bash /tmp/setup-noderepo.sh
|
||||||
|
rm /tmp/setup-noderepo.sh
|
||||||
|
variants:
|
||||||
|
- linkwarden
|
||||||
|
|
||||||
mappings:
|
mappings:
|
||||||
architecture_map: debian
|
architecture_map: debian
|
||||||
@@ -8,28 +8,7 @@ adduser -h /opt/HomeAssistant/data -D -G hass -s /bin/sh hass
|
|||||||
chown -R hass:hass /opt/HomeAssistant
|
chown -R hass:hass /opt/HomeAssistant
|
||||||
sudo -u hass python3 -m venv /opt/HomeAssistant/srv
|
sudo -u hass python3 -m venv /opt/HomeAssistant/srv
|
||||||
|
|
||||||
#Fix broken Pyton module (It will not install with pyton 3.12 on a Musl system)
|
sudo -u hass sh -c '. /opt/HomeAssistant/srv/bin/activate && pip install --upgrade pip && pip3 install wheel isal zlib-ng mysqlclient && pip3 install homeassistant'
|
||||||
wget https://codeload.github.com/rhasspy/webrtc-noise-gain/tar.gz/refs/tags/v1.2.3 -O /tmp/webrtc-noise-gain.tar.gz || exit 1
|
|
||||||
tar -C /tmp -xzf /tmp/webrtc-noise-gain.tar.gz
|
|
||||||
patch /tmp/webrtc-noise-gain-1.2.3/webrtc-audio-processing/webrtc-audio-processing-1/rtc_base/system/file_wrapper.h << EOF
|
|
||||||
--- <webrtc-audio-processing/webrtc-audio-processing-1/rtc_base/system/file_wrapper.h>
|
|
||||||
+++ <webrtc-audio-processing/webrtc-audio-processing-1/rtc_base/system/file_wrapper.h>
|
|
||||||
@@ -13,6 +13,7 @@
|
|
||||||
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
+#include <cstdint>
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
|
|
||||||
EOF
|
|
||||||
chown hass: -R /tmp/webrtc-noise-gain-1.2.3
|
|
||||||
sudo -u hass sh -c '. /opt/HomeAssistant/srv/bin/activate && pip install /tmp/webrtc-noise-gain-1.2.3'
|
|
||||||
rm -rf /tmp/webrtc-noise-gain.tar.gz /tmp/webrtc-noise-gain-1.2.3
|
|
||||||
##End of fix (Remove when pyton module updates)
|
|
||||||
|
|
||||||
sudo -u hass sh -c '. /opt/HomeAssistant/srv/bin/activate && pip install --upgrade pip && pip3 install wheel mutagen numpy mysqlclient && pip3 install homeassistant'
|
|
||||||
|
|
||||||
#Install Home Assistant Community Store
|
#Install Home Assistant Community Store
|
||||||
wget https://github.com/hacs/integration/releases/latest/download/hacs.zip -O /tmp/hacs.zip
|
wget https://github.com/hacs/integration/releases/latest/download/hacs.zip -O /tmp/hacs.zip
|
||||||
|
|||||||
31
CT-Files/linkwarden/Scripts/FirstRun.sh
Normal file
31
CT-Files/linkwarden/Scripts/FirstRun.sh
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
ThisScriptConfigured=no
|
||||||
|
##Linkwarden
|
||||||
|
LinkwardenURL=http://localhost:3000
|
||||||
|
|
||||||
|
##DB
|
||||||
|
PostgresqlIP=127.0.0.1
|
||||||
|
PostgresqlPort=5432
|
||||||
|
PostgresqlUsername=linkwarden
|
||||||
|
PostgresqlDatabase=linkwarden
|
||||||
|
PostgresqlPassword=<Password>
|
||||||
|
|
||||||
|
#Check if script is configured
|
||||||
|
if [ $ThisScriptConfigured = no ]; then
|
||||||
|
echo "Script is not configured"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
##Update config
|
||||||
|
sed -i "s#^DATABASE_URL=#DATABASE_URL=postgresql://$PostgresqlUsername:$PostgresqlPassword@$PostgresqlIP:$PostgresqlPort/$PostgresqlDatabase#" /opt/node/linkwarden/.env
|
||||||
|
sed -i "s/NEXTAUTH_SECRET=/NEXTAUTH_SECRET=$(dd bs=32 count=1 if=/dev/urandom | base64 | tr +/ _.)/" /opt/node/linkwarden/.env
|
||||||
|
sed -i "s#http://localhost:3000#$LinkwardenURL#" /opt/node/linkwarden/.env
|
||||||
|
|
||||||
|
#Save PM2 statup config
|
||||||
|
sudo -u node bash << EOF
|
||||||
|
(cd /opt/node/linkwarden; yarn prisma migrate deploy)
|
||||||
|
pm2 install pm2-logrotate
|
||||||
|
pm2 start yarn --name Linkwarden --cwd /opt/node/linkwarden -- start
|
||||||
|
pm2 save
|
||||||
|
EOF
|
||||||
34
CT-Files/linkwarden/Scripts/Init.sh
Normal file
34
CT-Files/linkwarden/Scripts/Init.sh
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
#Install monolith
|
||||||
|
CurmonolithVersion=$(curl -s https://api.github.com/repos/Y2Z/monolith/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " " |tr -d : )
|
||||||
|
curl -L -o /opt/monolith-gnu-linux-x86_64 https://github.com/Y2Z/monolith/releases/download/"$CurmonolithVersion"/monolith-gnu-linux-x86_64
|
||||||
|
chmod +x /opt/monolith-gnu-linux-x86_64
|
||||||
|
echo "$CurmonolithVersion" > /opt/monolith-Version
|
||||||
|
ln -s /opt/monolith-gnu-linux-x86_64 /usr/local/bin/monolith
|
||||||
|
mv /opt/Setup/Scripts/Update-monolith.sh /opt/Update-monolith.sh
|
||||||
|
|
||||||
|
#Install linkwarden
|
||||||
|
|
||||||
|
rm -rf /root/.cache
|
||||||
|
startpath=$(pwd)
|
||||||
|
|
||||||
|
#Install Linkwarden
|
||||||
|
echo $(curl -s https://api.github.com/repos/linkwarden/linkwarden/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " " |tr -d : ) > /opt/linkwarden-Version
|
||||||
|
npm install -g yarn
|
||||||
|
git clone https://github.com/linkwarden/linkwarden.git /opt/node/linkwarden
|
||||||
|
cd /opt/node/linkwarden
|
||||||
|
npx playwright install --with-deps chromium
|
||||||
|
rm -rf /root/.cache
|
||||||
|
|
||||||
|
yarn install
|
||||||
|
yarn prisma generate
|
||||||
|
yarn build
|
||||||
|
yarn cache clean
|
||||||
|
apt clean
|
||||||
|
|
||||||
|
cd $startpath
|
||||||
|
cp /opt/node/linkwarden/.env.sample /opt/node/linkwarden/.env
|
||||||
|
chown node: -R /opt/node/linkwarden
|
||||||
|
su -c "cd /opt/node/linkwarden; npx playwright install chromium" node
|
||||||
|
mv /opt/Setup/Scripts/Update-linkwarden.sh /opt/Update-linkwarden.sh
|
||||||
4
CT-Files/linkwarden/Scripts/PTKAppUpdate.sh
Normal file
4
CT-Files/linkwarden/Scripts/PTKAppUpdate.sh
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Update script for updating apps with ProxmoxHelper/ProxMoxToolKit
|
||||||
|
bash /opt/Update-monolith.sh
|
||||||
|
bash /opt/Update-linkwarden.sh
|
||||||
22
CT-Files/linkwarden/Scripts/Update-linkwarden.sh
Normal file
22
CT-Files/linkwarden/Scripts/Update-linkwarden.sh
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
CurLinkwardenVersion=$(curl -s https://api.github.com/repos/linkwarden/linkwarden/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " " |tr -d : )
|
||||||
|
|
||||||
|
if test "$CurLinkwardenVersion" = "$(cat /opt/linkwarden-Version)" ; then
|
||||||
|
echo 'Linkwarden is up-to-date'
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
echo 'Updating Linkwarden'
|
||||||
|
sudo -u node bash << EOF
|
||||||
|
/usr/bin/pm2 stop Linkwarden
|
||||||
|
cd /opt/node/linkwarden
|
||||||
|
git pull
|
||||||
|
/usr/bin/yarn install
|
||||||
|
/usr/bin/yarn prisma generate
|
||||||
|
/usr/bin/yarn build
|
||||||
|
/usr/bin/yarn cache clean
|
||||||
|
/usr/bin/yarn prisma migrate deploy
|
||||||
|
/usr/bin/pm2 start Linkwarden
|
||||||
|
npx playwright install chromium
|
||||||
|
EOF
|
||||||
|
echo "$CurLinkwardenVersion" > /opt/linkwarden-Version
|
||||||
|
fi
|
||||||
13
CT-Files/linkwarden/Scripts/Update-monolith.sh
Normal file
13
CT-Files/linkwarden/Scripts/Update-monolith.sh
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
CurmonolithVersion=$(curl -s https://api.github.com/repos/Y2Z/monolith/releases/latest | grep 'tag_name.*' | cut -d : -f 2,3 | tr -d \" |tr -d , |tr -d " " |tr -d : )
|
||||||
|
|
||||||
|
if test "$CurmonolithVersion" = "$(cat /opt/monolith-Version)" ; then
|
||||||
|
echo 'Monolith up-to-date'
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
echo 'Updating Monolith'
|
||||||
|
mv /opt/monolith-gnu-linux-x86_64 /opt/monolith-gnu-linux-x86_64.old
|
||||||
|
curl -L -o /opt/monolith-gnu-linux-x86_64 https://github.com/Y2Z/monolith/releases/download/"$CurmonolithVersion"/monolith-gnu-linux-x86_64
|
||||||
|
chmod +x /opt/monolith-gnu-linux-x86_64
|
||||||
|
echo "$CurmonolithVersion" > /opt/monolith-Version
|
||||||
|
fi
|
||||||
22
CT-Files/postgresql/Configs/pgadmin-config_local.py
Normal file
22
CT-Files/postgresql/Configs/pgadmin-config_local.py
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#pgAdmin Custom config
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
# Misc stuff
|
||||||
|
##########################################################################
|
||||||
|
|
||||||
|
# Languages we support in the UI
|
||||||
|
LANGUAGES = {
|
||||||
|
'en': 'English'
|
||||||
|
}
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
# External Database Settings
|
||||||
|
##########################################################################
|
||||||
|
CONFIG_DATABASE_URI = 'postgresql://pgadmin:DBPassword@localhost:5432/pgadmin'
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
# In server mode, SHARED_STORAGE settings
|
||||||
|
##########################################################################
|
||||||
|
|
||||||
|
# Locations
|
||||||
|
SHARED_STORAGE = [{ 'name': 'Shared-Storage', 'path': '/var/lib/pgadmin/storage/shared', 'restricted_access': True}]
|
||||||
17
CT-Files/postgresql/Configs/pgadmin-server-import.json
Normal file
17
CT-Files/postgresql/Configs/pgadmin-server-import.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"Servers": {
|
||||||
|
"1": {
|
||||||
|
"Name": "localhost",
|
||||||
|
"Group": "Servers",
|
||||||
|
"Host": "localhost",
|
||||||
|
"Port": 5432,
|
||||||
|
"MaintenanceDB": "postgres",
|
||||||
|
"Username": "postgres",
|
||||||
|
"ConnectionParameters": {
|
||||||
|
"sslmode": "prefer",
|
||||||
|
"passfile": "Shared-Storage:/pgpassfile"
|
||||||
|
},
|
||||||
|
"Tags": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"preferences":
|
||||||
|
{
|
||||||
|
"misc:themes:theme": "system"
|
||||||
|
}
|
||||||
|
}
|
||||||
12
CT-Files/postgresql/Configs/pgadmin-uwsgi.ini
Normal file
12
CT-Files/postgresql/Configs/pgadmin-uwsgi.ini
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
[uwsgi]
|
||||||
|
http-socket= :80
|
||||||
|
chdir = /usr/pgadmin4/web/
|
||||||
|
module = pgAdmin4:application
|
||||||
|
threads = 25
|
||||||
|
processes = 1
|
||||||
|
wsgi-file = pgAdmin4.wsgi
|
||||||
|
mount = /pgadmin=pgAdmin4:app
|
||||||
|
manage-script-name = true
|
||||||
|
chmod-socket = 660
|
||||||
|
plugins = python3
|
||||||
|
home = /usr/pgadmin4/venv
|
||||||
16
CT-Files/postgresql/Configs/pgadmin.service
Normal file
16
CT-Files/postgresql/Configs/pgadmin.service
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=pgAdmin uwsgi service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/bin/uwsgi-core \
|
||||||
|
--ini /etc/uwsgi/apps-available/pgadmin.ini
|
||||||
|
User=pgadmin
|
||||||
|
Group=www-data
|
||||||
|
Restart=on-failure
|
||||||
|
KillSignal=SIGQUIT
|
||||||
|
Type=notify
|
||||||
|
StandardError=journal
|
||||||
|
NotifyAccess=all
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
2
CT-Files/postgresql/Configs/pgpassfile
Normal file
2
CT-Files/postgresql/Configs/pgpassfile
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
localhost:5432:*:postgres:Password
|
||||||
|
127.0.0.1:5432:*:postgres:Password
|
||||||
35
CT-Files/postgresql/Scripts/FirstRun.sh
Normal file
35
CT-Files/postgresql/Scripts/FirstRun.sh
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
read -p "Enter your e-mail for pgAdmin login: " PostgressAdminMail
|
||||||
|
read -p "Enter new password for pgAdmin and postgresql database admin: " -s NewPostgressPassword
|
||||||
|
echo
|
||||||
|
echo "Please wait..."
|
||||||
|
|
||||||
|
#Configure Postgresql
|
||||||
|
su postgres -c "psql -c \"alter user postgres with password '$NewPostgressPassword';\""
|
||||||
|
|
||||||
|
#Configure pgAdmin
|
||||||
|
##Create pgadmin db for storing pgAdmin config
|
||||||
|
PGADMIN_DB_PASSWORD=$(dd bs=20 count=1 if=/dev/urandom | base64 | tr +/ _.)
|
||||||
|
su postgres -c "psql -c \"CREATE ROLE pgadmin WITH LOGIN NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT NOREPLICATION NOBYPASSRLS CONNECTION LIMIT 25 PASSWORD '$PGADMIN_DB_PASSWORD';\""
|
||||||
|
su postgres -c "psql -c \"CREATE DATABASE pgadmin WITH OWNER = pgadmin ENCODING = 'UTF8' LOCALE_PROVIDER = 'libc' CONNECTION LIMIT = -1 IS_TEMPLATE = False;\""
|
||||||
|
sed -i "s/DBPassword/$PGADMIN_DB_PASSWORD/" /usr/pgadmin4/web/config_local.py
|
||||||
|
|
||||||
|
##Setup the pgAdmin base
|
||||||
|
export PGADMIN_SETUP_EMAIL=$PostgressAdminMail
|
||||||
|
export PGADMIN_SETUP_PASSWORD=$NewPostgressPassword
|
||||||
|
su -pc "/usr/pgadmin4/venv/bin/python3 /usr/pgadmin4/web/setup.py setup-db" pgadmin
|
||||||
|
systemctl restart pgadmin
|
||||||
|
|
||||||
|
## add localhost postges server as connection is pgAdmin
|
||||||
|
sed -i "s/Password/$NewPostgressPassword/" /opt/Setup/Configs/pgpassfile
|
||||||
|
mv /opt/Setup/Configs/pgpassfile /var/lib/pgadmin/storage/shared/pgpassfile
|
||||||
|
chown pgadmin: /var/lib/pgadmin/storage/shared/pgpassfile
|
||||||
|
chmod 600 /var/lib/pgadmin/storage/shared/pgpassfile
|
||||||
|
/usr/pgadmin4/venv/bin/python3 /usr/pgadmin4/web/setup.py load-servers /opt/Setup/Configs/pgadmin-server-import.json --user $PostgressAdminMail
|
||||||
|
|
||||||
|
## Set user preferences (i.e. set the theme to system)
|
||||||
|
/usr/pgadmin4/venv/bin/python3 /usr/pgadmin4/web/setup.py set-prefs $PostgressAdminMail --input-file /opt/Setup/Configs/pgadmin-user-preferences.json
|
||||||
|
|
||||||
|
##Clean-up
|
||||||
|
rm /root/ReadMe /opt/Setup/Configs/pgadmin-server-import.json /opt/Setup/Configs/pgadmin-user-preferences.json
|
||||||
|
|
||||||
16
CT-Files/postgresql/Scripts/Init.sh
Normal file
16
CT-Files/postgresql/Scripts/Init.sh
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#Setup postgresql
|
||||||
|
printf "\n#User entries (Make sure to reload postgressql after updating this file) \n# TYPE DATABASE USER ADDRESS METHOD\n" >> /etc/postgresql/17/main/pg_hba.conf
|
||||||
|
sed -i "s|#listen_addresses = 'localhost'|listen_addresses = '*' |" /etc/postgresql/17/main/postgresql.conf
|
||||||
|
|
||||||
|
#Setup pgadmin
|
||||||
|
adduser --system --shell /bin/false --ingroup www-data --disabled-password --disabled-login --home /var/lib/www/pgadmin pgadmin
|
||||||
|
mkdir -p /var/log/pgadmin /var/lib/pgadmin/storage/shared
|
||||||
|
chown pgadmin: /var/log/pgadmin /var/lib/pgadmin -R
|
||||||
|
mv /opt/Setup/Configs/pgadmin-uwsgi.ini /etc/uwsgi/apps-available/pgadmin.ini
|
||||||
|
mv /opt/Setup/Configs/pgadmin-config_local.py /usr/pgadmin4/web/config_local.py
|
||||||
|
|
||||||
|
#Setup uwsgi service for pgadmin
|
||||||
|
mv /opt/Setup/Configs/pgadmin.service /lib/systemd/system/pgadmin.service
|
||||||
|
chmod +x /lib/systemd/system/pgadmin.service
|
||||||
|
setcap 'cap_net_bind_service=+ep' /bin/uwsgi-core
|
||||||
@@ -1,14 +1,15 @@
|
|||||||
#!/bin/ash
|
#!/bin/ash
|
||||||
|
|
||||||
|
npm install -g pnpm
|
||||||
#Run folowing commands as 'node' user
|
#Run folowing commands as 'node' user
|
||||||
sudo -u node ash << EOF
|
sudo -u node ash << EOF
|
||||||
#Install zigbee2mqtt
|
#Install zigbee2mqtt
|
||||||
git clone https://github.com/Koenkk/zigbee2mqtt.git /opt/node/zigbee2mqtt
|
git clone --depth 1 https://github.com/Koenkk/zigbee2mqtt.git /opt/node/zigbee2mqtt
|
||||||
npm --prefix /opt/node/zigbee2mqtt ci
|
pnpm -C /opt/node/zigbee2mqtt i --frozen-lockfile
|
||||||
npm --prefix /opt/node/zigbee2mqtt run build
|
pnpm -C /opt/node/zigbee2mqtt run build
|
||||||
##Update config
|
##Update config
|
||||||
sed -i -e '/port:/c\ port: \/dev\/ttyACM-Zigbee' /opt/node/zigbee2mqtt/data/configuration.yaml
|
cp /opt/node/zigbee2mqtt/data/configuration.example.yaml /opt/node/zigbee2mqtt/data/configuration.yaml
|
||||||
printf "frontend:\n port: 5002" >> /opt/node/zigbee2mqtt/data/configuration.yaml
|
sed -i -e '/# port:/c\# port: \/dev\/ttyACM-Zigbee' /opt/node/zigbee2mqtt/data/configuration.yaml
|
||||||
|
|
||||||
#Install Z-Wave JS UI
|
#Install Z-Wave JS UI
|
||||||
git clone https://github.com/zwave-js/zwave-js-ui /opt/node/ZwaveJsUi
|
git clone https://github.com/zwave-js/zwave-js-ui /opt/node/ZwaveJsUi
|
||||||
@@ -17,7 +18,7 @@ npm --prefix /opt/node/ZwaveJsUi run build
|
|||||||
|
|
||||||
#Save PM2 statup config
|
#Save PM2 statup config
|
||||||
pm2 install pm2-logrotate
|
pm2 install pm2-logrotate
|
||||||
pm2 start npm --name zigbee2mqtt --cwd /opt/node/zigbee2mqtt -- start
|
pm2 start pnpm --name zigbee2mqtt --cwd /opt/node/zigbee2mqtt -- start
|
||||||
pm2 start npm --name ZwaveJsUi --cwd /opt/node/ZwaveJsUi -- start
|
pm2 start npm --name ZwaveJsUi --cwd /opt/node/ZwaveJsUi -- start
|
||||||
pm2 save
|
pm2 save
|
||||||
pm2 kill
|
pm2 kill
|
||||||
|
|||||||
19
Readme.md
19
Readme.md
@@ -35,6 +35,8 @@ This can be done on a privileged Debian CT (make sure to enable the Fuse, Nestin
|
|||||||
| duplicati | Debian | Duplicati backup software |
|
| duplicati | Debian | Duplicati backup software |
|
||||||
| fileshelter | Debian | FileShelter file shareing software |
|
| fileshelter | Debian | FileShelter file shareing software |
|
||||||
| esphome | Debian | ESPHome software to manage wifi-MCUs|
|
| esphome | Debian | ESPHome software to manage wifi-MCUs|
|
||||||
|
| postgresql | Debian | PostgreSQL server with pgAdmin|
|
||||||
|
| linkwarden | Debian | inkwarden is an collaborative bookmark manager to collect, organize and preserve webpages.|
|
||||||
| elkarbackupALP `(Deprecated, Requires PHP 7.4)`| Alpine | ElkarBackup rsyncsnapshot server |
|
| elkarbackupALP `(Deprecated, Requires PHP 7.4)`| Alpine | ElkarBackup rsyncsnapshot server |
|
||||||
| gitea | Alpine | Gitea server |
|
| gitea | Alpine | Gitea server |
|
||||||
| nginx | Alpine | Nginx server for reverse-proxy use |
|
| nginx | Alpine | Nginx server for reverse-proxy use |
|
||||||
@@ -46,8 +48,8 @@ This can be done on a privileged Debian CT (make sure to enable the Fuse, Nestin
|
|||||||
| nodejs | Alpine | Basic nodejs install with pm2 |
|
| nodejs | Alpine | Basic nodejs install with pm2 |
|
||||||
| nextcloud | Alpine | Nextcloud |
|
| nextcloud | Alpine | Nextcloud |
|
||||||
| mqtt | Alpine | Mosquitto mqtt broker |
|
| mqtt | Alpine | Mosquitto mqtt broker |
|
||||||
| hass `(Broken, Requires python 3.12)` | Alpine | HomeAssistant instance with HACS and mysql support |
|
| hass `(Broken, Requires python 3.13)` | Alpine | HomeAssistant instance with HACS and mysql support |
|
||||||
| mailbackup `(Broken, Requires python 3.12)` | Alpine | Contains mail archive tools (MailBackup-sys) |
|
| mailbackup | Alpine | Contains mail archive tools (MailBackup-sys) |
|
||||||
| heimdall | Alpine | Heimdall, A application dashboard/launcher |
|
| heimdall | Alpine | Heimdall, A application dashboard/launcher |
|
||||||
| vouchproxy | Alpine | Vouch-proxy, A SSO solution for Nginx |
|
| vouchproxy | Alpine | Vouch-proxy, A SSO solution for Nginx |
|
||||||
| freshrss | Alpine | FreshRSS, a self-hosted RSS feed aggregator |
|
| freshrss | Alpine | FreshRSS, a self-hosted RSS feed aggregator |
|
||||||
@@ -203,7 +205,7 @@ lxc.cgroup2.devices.allow: c 188:* rwm
|
|||||||
lxc.mount.entry: /dev/ttyACM-Zigbee dev/ttyACM-Zigbee none bind,optional,create=file
|
lxc.mount.entry: /dev/ttyACM-Zigbee dev/ttyACM-Zigbee none bind,optional,create=file
|
||||||
lxc.mount.entry: /dev/ttyACM-Zwave dev/ttyACM-Zwave none bind,optional,create=file
|
lxc.mount.entry: /dev/ttyACM-Zwave dev/ttyACM-Zwave none bind,optional,create=file
|
||||||
```
|
```
|
||||||
* Zigbee2mqtt Available on http://`<ip>`:5002
|
* Zigbee2mqtt Available on http://`<ip>`:8080
|
||||||
* Z-wave JS UI Available on http://`<ip>`:8091
|
* Z-wave JS UI Available on http://`<ip>`:8091
|
||||||
* in the Z-wave JS UI web ui set the Zwave serial port to /dev/ttyACM-Zwave
|
* in the Z-wave JS UI web ui set the Zwave serial port to /dev/ttyACM-Zwave
|
||||||
* If a `Cannot lock port` error shows, please reboot the CT, if that does not fix it try rebooting the Proxmox server
|
* If a `Cannot lock port` error shows, please reboot the CT, if that does not fix it try rebooting the Proxmox server
|
||||||
@@ -274,6 +276,15 @@ lxc.mount.entry: /dev/ttyACM-Zwave dev/ttyACM-Zwave none bind,optional,create=fi
|
|||||||
## esphome
|
## esphome
|
||||||
* Available on http://`<ip>`:6052
|
* Available on http://`<ip>`:6052
|
||||||
|
|
||||||
|
## postgresql
|
||||||
|
* Run the FistRun script in the container `ash /opt/Setup/Scripts/FirstRun.sh`
|
||||||
|
* After this pgAdmin is available on http://`<ip>`:80,
|
||||||
|
|
||||||
|
## linkwarden
|
||||||
|
* Edit and run the FistRun script in the container `ash /opt/Setup/Scripts/FirstRun.sh`
|
||||||
|
* After this pgAdmin is available on http://`<ip>`:80,
|
||||||
|
|
||||||
|
|
||||||
## uptimekuma
|
## uptimekuma
|
||||||
* Available on http://`<ip>`:80
|
* Available on http://`<ip>`:80
|
||||||
|
|
||||||
@@ -301,7 +312,7 @@ lvcreate --name <name> --size <VolumeSize>G <PoolName>
|
|||||||
```
|
```
|
||||||
* Create LVM-Thin Volume
|
* Create LVM-Thin Volume
|
||||||
```
|
```
|
||||||
lvcreate --thin -n <name> -V <VolumeSize>G <poolName>/<ThinpoolName>
|
vcreate -V<VolumeSize>G -T <PoolName>/<ThinpoolName> -n <name>
|
||||||
```
|
```
|
||||||
* Create ZFS Volume (Available @ /dev/`<poolName>`/`<VolumeName>`)
|
* Create ZFS Volume (Available @ /dev/`<poolName>`/`<VolumeName>`)
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user