From a925ee1ba4b43d0079c3d8917c8da12751d96db5 Mon Sep 17 00:00:00 2001 From: LindirQuenya <53021080+LindirQuenya@users.noreply.github.com> Date: Thu, 14 Jul 2022 10:58:06 -0400 Subject: [PATCH 1/3] Switch to a privileged daemon. --- fpmountd | 8 ++++++++ setup.sh | 12 +++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100755 fpmountd diff --git a/fpmountd b/fpmountd new file mode 100755 index 0000000..bd3c1fc --- /dev/null +++ b/fpmountd @@ -0,0 +1,8 @@ +#!/sbin/openrc-run +supervisor="supervise-daemon" +command="/usr/local/bin/fpmountd" +pidfile="/run/${RC_SVCNAME}.pid" + +depend() { + need gamezip net +} diff --git a/setup.sh b/setup.sh index d4e7dbc..4c46cb6 100755 --- a/setup.sh +++ b/setup.sh @@ -35,12 +35,16 @@ apk add php-json php-openssl php-session php-pdo php-pdo_sqlite php-simplexml ph wget -O/tmp/vendor.tar https://github.com/FlashpointProject/svcomposer/releases/download/18c0ebd/vendor.tar tar -xvf /tmp/vendor.tar -C /var/www/localhost --exclude='vendor/silexlabs/amfphp/doc' -# Install fuse-archive - maybe better than avfs? +# Install fuse-archive git clone https://github.com/google/fuse-archive.git /tmp/fuse-archive cd /tmp/fuse-archive mkdir -p '/usr/local/sbin' g++ -O3 src/main.cc `pkg-config libarchive fuse --cflags --libs` -o /usr/local/sbin/fuse-archive +# Install fpmountd +wget -O "/usr/local/bin/fpmountd" "https://github.com/FlashpointProject/flashpointvm-mount-daemon/releases/download/e669fd4/flashpointvm-mount-daemon_i686-unknown-linux-musl_qemu" +chmod +x "/usr/local/bin/fpmountd" + # install fuzzyfs git clone https://github.com/XXLuigiMario/fuzzyfs.git /tmp/fuzzyfs cd /tmp/fuzzyfs @@ -56,7 +60,6 @@ rm /var/www/localhost/htdocs/index.html # setup apache rc-update add apache2 default # run apache2 on startup -echo 'apache ALL=(ALL) NOPASSWD: ALL' >>/etc/sudoers sed -i 's/#LoadModule rewrite_module/LoadModule rewrite_module/g' /etc/apache2/httpd.conf sed -i 's/AllowOverride None/AllowOverride All/g' /etc/apache2/httpd.conf sed -i 's/DirectoryIndex index.html/DirectoryIndex index.html index.htm index.php/g' /etc/apache2/httpd.conf @@ -78,10 +81,13 @@ sed -i 's/exe dll com bat msi/exe dll bat msi/g' /etc/apache2/mime.types sed -i 's|application/vnd.lotus-organizer|# application/vnd.lotus-organizer|g' /etc/apache2/mime.types # setup gamezip service -mkdir /root/.avfs cp /mnt/gamezip /etc/init.d rc-update add gamezip default +# setup fpmountd service +cp /mnt/fpmountd /etc/init.d +rc-update add fpmountd default + # modify apache2 service dependencies sed -i 's/need/need gamezip/' /etc/init.d/apache2 sed -i 's/after.*/after */' /etc/init.d/apache2 From 7f12ec1bbb846158f7c5e9b745654e2a51a0591b Mon Sep 17 00:00:00 2001 From: LindirQuenya <53021080+LindirQuenya@users.noreply.github.com> Date: Thu, 14 Jul 2022 13:39:19 -0400 Subject: [PATCH 2/3] Remove sudo --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 4c46cb6..572c103 100755 --- a/setup.sh +++ b/setup.sh @@ -24,7 +24,7 @@ echo 'https://dl-cdn.alpinelinux.org/alpine/edge/main' >/etc/apk/repositories echo 'https://dl-cdn.alpinelinux.org/alpine/edge/community' >>/etc/apk/repositories echo 'https://dl-cdn.alpinelinux.org/alpine/edge/testing' >>/etc/apk/repositories apk update -apk add apache2 apache2-proxy php-apache2 fuse unionfs-fuse sudo libarchive libgcc libstdc++ +apk add apache2 apache2-proxy php-apache2 fuse unionfs-fuse libarchive libgcc libstdc++ sed -i 's/DEFAULT menu.c32/DEFAULT virt/g' /boot/extlinux.conf # boot directly into alpine # install dev dependencies From ae35aab5efd259168671906c8fc49e560f86baaa Mon Sep 17 00:00:00 2001 From: LindirQuenya <53021080+LindirQuenya@users.noreply.github.com> Date: Thu, 14 Jul 2022 13:45:56 -0400 Subject: [PATCH 3/3] Fix fuse-archive path --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 572c103..4e94460 100755 --- a/setup.sh +++ b/setup.sh @@ -39,7 +39,7 @@ tar -xvf /tmp/vendor.tar -C /var/www/localhost --exclude='vendor/silexlabs/amfph git clone https://github.com/google/fuse-archive.git /tmp/fuse-archive cd /tmp/fuse-archive mkdir -p '/usr/local/sbin' -g++ -O3 src/main.cc `pkg-config libarchive fuse --cflags --libs` -o /usr/local/sbin/fuse-archive +g++ -O3 src/main.cc `pkg-config libarchive fuse --cflags --libs` -o "/usr/local/bin/fuse-archive" # Install fpmountd wget -O "/usr/local/bin/fpmountd" "https://github.com/FlashpointProject/flashpointvm-mount-daemon/releases/download/e669fd4/flashpointvm-mount-daemon_i686-unknown-linux-musl_qemu"