Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove mongodb installation, enforce SQLite mode #52

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export DIST_NAME=MonsterPi
export DIST_VERSION=0.4.5
export DIST_VERSION=0.4.5-sqlite
export BASE_DISTRO=ubuntu
export BASE_ARCH=aarch64
# This does not work without $BASE_IMAGE_PATH
Expand Down
3 changes: 0 additions & 3 deletions src/modules/monsterpi/config
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
###############################################################################
# All our config settings must start with MONSTERPI_

# MongoDB
[ -n "$MONSTERPI_MONGODB_VERSION" ] || MONSTERPI_MONGODB_VERSION=4.4

# Node.js
[ -n "$MONSTERPI_NODEJS_VERSION" ] || MONSTERPI_NODEJS_VERSION=20.x

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ const svc = new Service({
script: join(rootPath, "dist/index.js"),
nodeOptions: ["--harmony", "--max_old_space_size=4096"],
workingDirectory: rootPath,
env: [
{
name: "ENABLE_EXPERIMENTAL_TYPEORM",
value: "true",
},
{
name: "DATABASE_PATH",
value: "./database",
},
{
name: "DATABASE_FILE",
value: "fdm-monster.sqlite",
},
],
});

svc.on("install", function () {
Expand Down
14 changes: 2 additions & 12 deletions src/modules/monsterpi/start_chroot_script
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# start_chroot_script
# This installs MongoDB as well as FDM Monster and HAProxy
# This installs FDM Monster and HAProxy
# Written by David Zwart
# GPL V3
########
Expand Down Expand Up @@ -45,7 +45,7 @@ else
fi

# Install GPG
apt install -y gnupg
# apt install -y gnupg

# Install Node.js based on MONSTERPI_NODEJS_VERSION
curl -sL https://deb.nodesource.com/setup_$MONSTERPI_NODEJS_VERSION | bash -
Expand All @@ -68,16 +68,6 @@ pushd /home/"${BASE_USER}"
fi
popd

# Add MongoDB as trusted source list
wget -qO - https://www.mongodb.org/static/pgp/server-"$MONSTERPI_MONGODB_VERSION".asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/`cat /etc/os-release | grep "^ID=" | cut -d "=" -f2` `cat /etc/os-release | grep "^VERSION_CODENAME=" | cut -d "=" -f2`/mongodb-org/$MONSTERPI_MONGODB_VERSION multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-$MONSTERPI_MONGODB_VERSION.list
apt update

# Install MongoDB
sudo apt install -y mongodb-org=4.4.15 mongodb-org-server=4.4.15 mongodb-org-shell=4.4.15 mongodb-org-mongos=4.4.15 mongodb-org-tools=4.4.15
systemctl enable mongod
systemctl start mongod

# add some "How To" info to boot output
# Note, this code is also in /filesystem/home/pi/scripts/
sed -i 's@exit 0@@' /etc/rc.local
Expand Down