budibase update

This commit is contained in:
thomas 2022-10-10 22:47:48 +02:00
parent 388865b0d2
commit 1933270b2a
9 changed files with 145 additions and 23 deletions

View File

@ -1,26 +1,62 @@
#### element-web
#### budibase
##### Information
Site : https://element.io/
Site : https://budibase.com/
Source : https://github.com/vector-im/element-web
Source : https://github.com/Budibase/budibase
##### Install
```bash
apt install -y wget ca-certificates
apt update
apt install -y --no-install-recommends curl apt-transport-https gnupg wget ca-certificates
wget -qO - https://deb.lgy.fr/install.sh | bash
apt-get update
apt install element-web
wget -qO - https://deb.nodesource.com/setup_16.x | bash
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list
wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarnkey.gpg
# sample configuration for apache2
curl https://couchdb.apache.org/repo/keys.asc | gpg --dearmor > /usr/share/keyrings/couchdb-archive-keyring.gpg
source /etc/os-release
echo "deb [signed-by=/usr/share/keyrings/couchdb-archive-keyring.gpg] https://apache.jfrog.io/artifactory/couchdb-deb/ ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/couchdb.list
cp /usr/share/doc/element-web/apache2-element-web.conf /etc/apache2/sites-available/element-web.conf
a2ensite element-web
apt update
apt install -y --no-install-recommends couchdb yarn nodejs nginx redis-server minio budibase
# edit /etc/apache2/sites-available/element-web.conf
# edit /etc/element-web/config.json
systemctl restart apache2
apt install unzip -y
wget https://github.com/cloudant-labs/clouseau/releases/download/2.21.0/clouseau-2.21.0-dist.zip
unzip clouseau-2.21.0-dist.zip
mv clouseau-2.21.0 /opt/clouseau
wget -qO /opt/clouseau/clouseau.ini https://github.com/Budibase/budibase/raw/develop/hosting/single/clouseau/clouseau.ini
wget -qO /opt/clouseau/log4j.properties https://github.com/Budibase/budibase/raw/develop/hosting/single/clouseau/log4j.properties
wget https://download.java.net/openjdk/jdk7u75/ri/jdk_ri-7u75-b13-linux-x64-18_dec_2014.tar.gz -qO - | tar -zx -C /opt/
/opt/java-se-7u75-ri/bin/java -server \
-Xmx2G \
-Dsun.net.inetaddr.ttl=30 \
-Dsun.net.inetaddr.negative.ttl=30 \
-Dlog4j.configuration=file:/opt/clouseau/log4j.properties \
-XX:OnOutOfMemoryError="kill -9 %p" \
-XX:+UseConcMarkSweepGC \
-XX:+CMSParallelRemarkEnabled \
-classpath '/opt/clouseau/*' \
com.cloudant.clouseau.Main \
/opt/clouseau/clouseau.ini
cat <<EOF > /etc/default/minio
MINIO_ACCESS_KEY=DruccokdudaufElWuejyeerog-Anphoj
MINIO_SECRET_KEY=NorcyagOovLadjonCekUthgeOcyuFrac
MINIO_BROWSER=off
EOF
wget -qO /etc/nginx/sites-enabled/default https://github.com/Budibase/budibase/raw/develop/hosting/single/nginx/nginx-default-site.conf
wget -qO /etc/nginx/nginx.conf https://github.com/Budibase/budibase/raw/develop/hosting/single/nginx/nginx.conf
echo requirepass neddOryianquasJuwrav2DrokVuWeac >> /etc/redis/redis.conf
systemctl restart couchdb minio nginx redis budibase-worker budibase-server
```

View File

@ -1,20 +1,20 @@
#!/bin/bash
VERSION=2.0.14
VERSION=2.0.24
APP=budibase
DEPOT=https://github.com/Budibase/budibase.git
GIT_VERSION=v${VERSION}
GIT_VERSION=last
DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M)
DEBIAN_VERSION_CODENAME=bullseye
IMAGE_SIZE=12
IMAGE_SIZE=20
PACKAGE_DEPENDENCY="yarn nodejs"
main(){
base_package_upgrade
envinit
get_git_source
# build
# makedeb
build
makedeb
}
envinit() {
@ -25,16 +25,24 @@ envinit() {
build() {
cd /tmp/${APP}
yarn
npm install -g yarn jest lerna --force
yarn
yarn bootstrap
yarn build
rm -fr /tmp/${APP}/packages/*/build
}
makedeb(){
PATH_DEB=/tmp/src/rootfs
mkdir -p ${PATH_DEB}/opt/budibase/
mv /tmp/budibase/packages/* ${PATH_DEB}/opt/budibase/
mkdir -p ${PATH_DEB}/opt/budibase/server/client
cp ${PATH_DEB}/opt/budibase/client/manifest.json ${PATH_DEB}/opt/budibase/server/client
cp ${PATH_DEB}/opt/budibase/client/dist/budibase-client.js ${PATH_DEB}/opt/budibase/server/client
tar -zxf /tmp/${APP}/dist/element-${GIT_VERSION}.tar.gz --strip-components=1 -C ${PATH_DEB}/usr/share/element-web/
cp /tmp/${APP}/config.sample.json ${PATH_DEB}/etc/element-web/config.json
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
$
}

View File

@ -1 +1,2 @@
/etc/element-web/config.json
/etc/default/budibase-server
/etc/default/budibase-worker

View File

@ -1,7 +1,7 @@
Package: element-web
Package: budibase
Version: %VERSION%
Section: base
Priority: optional
Architecture: all
Maintainer: Thomas Legay <thomas@lgy.fr>
Description: element-web
Description: budibase

View File

@ -0,0 +1,9 @@
#!/bin/bash
id budibase-server &> /dev/null || useradd budibase-server -r -s /bin/false -d /var/lib/budibase-server
chown -R budibase-server:budibase-server /var/lib/budibase-server
id budibase-worker &> /dev/null || useradd budibase-worker -r -s /bin/false -d /var/lib/budibase-worker
chown -R budibase-worker:budibase-worker /var/lib/budibase-worker

View File

@ -0,0 +1,23 @@
COUCH_DB_URL=http://admin:admin@localhost:5984
WORKER_URL=http://localhost:4002
MINIO_URL=http://localhost:9000
MINIO_ACCESS_KEY=DruccokdudaufElWuejyeerog-Anphoj
MINIO_SECRET_KEY=NorcyagOovLadjonCekUthgeOcyuFrac
INTERNAL_API_KEY=yaif4ShnumbivfoctErvAsBark?8Koks
BUDIBASE_ENVIRONMENT=prod
PORT=4001
JWT_SECRET=AdliejyiarApsEmNuilyanmuifyojhay
LOG_LEVEL=info
#SENTRY_DSN=https://a34ae347621946bf8acded18e5b7d4b8@o420233.ingest.sentry.io/5338131
#ENABLE_ANALYTICS="true"
REDIS_URL=localhost:6379
REDIS_PASSWORD=neddOryianquasJuwrav2DrokVuWeac
BB_ADMIN_USER_EMAIL=thomas
BB_ADMIN_USER_PASSWORD=thomas
#PLUGINS_DIR=${PLUGINS_DIR}
WORKER_PORT=4002
APP_PORT=4001
DATA_DIR=/root/budibase/packages
NODE_ENV=production
SELF_HOSTED=1
BUDIBASE_ENVIRONMENT=PRODUCTION

View File

@ -0,0 +1,19 @@
CLUSTER_PORT=80
JWT_SECRET=AdliejyiarApsEmNuilyanmuifyojhay
MINIO_ACCESS_KEY=DruccokdudaufElWuejyeerog-Anphoj
MINIO_SECRET_KEY=NorcyagOovLadjonCekUthgeOcyuFrac
MINIO_URL=http://localhost:9000
APPS_URL=http://localhost:4001
COUCH_DB_USERNAME=admin
COUCH_DB_PASSWORD=admin
COUCH_DB_URL=http://admin:admin@localhost:5984
#SENTRY_DSN=https://a34ae347621946bf8acded18e5b7d4b8@o420233.ingest.sentry.io/5338131
INTERNAL_API_KEY=yaif4ShnumbivfoctErvAsBark?8Koks
REDIS_URL=localhost:6379
REDIS_PASSWORD=neddOryianquasJuwrav2DrokVuWeac
PORT=4002
WORKER_PORT=4002
APP_PORT=4001
NODE_ENV=production
SELF_HOSTED=1
BUDIBASE_ENVIRONMENT=PRODUCTION

View File

@ -0,0 +1,13 @@
[Unit]
Description=budibase-server
After=network.target
[Service]
EnvironmentFile=/etc/default/budibase-server
ExecStart=/usr/bin/node /opt/budibase/server/dist/index.js
Restart=always
#User=budibase-server
#Group=budibase-server
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,13 @@
[Unit]
Description=budibase-worker
After=network.target
[Service]
EnvironmentFile=/etc/default/budibase-worker
ExecStart=/usr/bin/node /opt/budibase/worker/dist/index.js
Restart=always
#User=budibase-worker
#Group=budibase-worker
[Install]
WantedBy=multi-user.target