Skip to content

Commit

Permalink
Merge pull request #2 from LindirQuenya/privileged-daemon
Browse files Browse the repository at this point in the history
Privileged daemon
  • Loading branch information
LindirQuenya authored Jul 15, 2022
2 parents b661a51 + 2a29a77 commit c9d8ba1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
8 changes: 8 additions & 0 deletions fpmountd
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/sbin/openrc-run
supervisor="supervise-daemon"
command="/usr/local/bin/fpmountd"
pidfile="/run/${RC_SVCNAME}.pid"

depend() {
need gamezip net
}
16 changes: 11 additions & 5 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -35,11 +35,15 @@ 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
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"
chmod +x "/usr/local/bin/fpmountd"

# install fuzzyfs
git clone https://github.com/XXLuigiMario/fuzzyfs.git /tmp/fuzzyfs
Expand All @@ -56,15 +60,17 @@ 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
cp /mnt/httpd.conf /etc/apache2/httpd.conf
cp /mnt/mime.types /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
Expand Down

0 comments on commit c9d8ba1

Please sign in to comment.