Added CT: Linkwarden
This commit is contained in:
@@ -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"},{"Variant": "postgresql"}]}')
|
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()
|
||||||
|
|||||||
@@ -1093,7 +1093,8 @@ files:
|
|||||||
- pihole
|
- pihole
|
||||||
- docker
|
- docker
|
||||||
- postgresql
|
- postgresql
|
||||||
|
- linkwarden
|
||||||
|
|
||||||
#FilesForJenkinsVariant
|
#FilesForJenkinsVariant
|
||||||
- path: /root/ReadMe
|
- path: /root/ReadMe
|
||||||
generator: dump
|
generator: dump
|
||||||
@@ -1200,6 +1201,13 @@ files:
|
|||||||
variants:
|
variants:
|
||||||
- postgresql
|
- postgresql
|
||||||
|
|
||||||
|
#FileForLinkwarden
|
||||||
|
- path: /opt/Setup
|
||||||
|
generator: copy
|
||||||
|
source: CT-Files/linkwarden
|
||||||
|
variants:
|
||||||
|
- linkwarden
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
manager: apt
|
manager: apt
|
||||||
update: true
|
update: true
|
||||||
@@ -1225,6 +1233,7 @@ packages:
|
|||||||
- duplicati
|
- duplicati
|
||||||
- fileshelter
|
- fileshelter
|
||||||
- postgresql
|
- postgresql
|
||||||
|
- linkwarden
|
||||||
|
|
||||||
#Https Repo pkgs
|
#Https Repo pkgs
|
||||||
- packages:
|
- packages:
|
||||||
@@ -1248,6 +1257,7 @@ packages:
|
|||||||
- fileshelter
|
- fileshelter
|
||||||
- esphome
|
- esphome
|
||||||
- postgresql
|
- postgresql
|
||||||
|
- linkwarden
|
||||||
|
|
||||||
#Minimal pkgs
|
#Minimal pkgs
|
||||||
- packages:
|
- packages:
|
||||||
@@ -1552,6 +1562,22 @@ packages:
|
|||||||
variants:
|
variants:
|
||||||
- postgresql
|
- 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: |-
|
||||||
@@ -1676,6 +1702,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: |-
|
||||||
@@ -1695,6 +1737,7 @@ actions:
|
|||||||
- fileshelter
|
- fileshelter
|
||||||
- esphome
|
- esphome
|
||||||
- postgresql
|
- 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
|
||||||
@@ -1823,5 +1866,15 @@ actions:
|
|||||||
variants:
|
variants:
|
||||||
- postgresql
|
- 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
|
||||||
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
|
||||||
32
CT-Files/linkwarden/Scripts/Init.sh
Normal file
32
CT-Files/linkwarden/Scripts/Init.sh
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/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
|
||||||
|
|
||||||
|
#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
|
||||||
3
CT-Files/linkwarden/Scripts/PTKAppUpdate.sh
Normal file
3
CT-Files/linkwarden/Scripts/PTKAppUpdate.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Update script for updating apps with ProxmoxHelper/ProxMoxToolKit
|
||||||
|
ash /opt/Update-monlith.sh
|
||||||
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 ' echo 'Updating Monolith'.sh 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
|
||||||
Reference in New Issue
Block a user