Skip to content

Wallos: Open-source, self-hostable personal subscription tracker. Visualize your recurring expenses, manage your budget, and save money.

fix: add ability to run container as an arbitrary user (#396)

Miguel Ribeiro86fe2f3ebb9c
diff --git a/includes/version.php b/includes/version.php
index 7eb8e1e..a50e141 100644
--- a/includes/version.php
+++ b/includes/version.php
@@ -1,3 +1,3 @@
<?php
- $version = "v2.5.1";
+ $version = "v2.5.2";
?>
diff --git a/startup.sh b/startup.sh
index 8f6197b..46d0875 100644
--- a/startup.sh
+++ b/startup.sh
@@ -2,6 +2,13 @@
echo "Startup script is running..." > /var/log/startup.log
+# If the PUID or PGID environment variables are set, create a new user and group
+if [ ! -z "$PUID" ] && [ ! -z "$PGID" ]; then
+ addgroup -g $PGID appgroup
+ adduser -D -u $PUID -G appgroup appuser
+ chown -R appuser:appgroup /var/www/html
+fi
+
# Start both PHP-FPM and Nginx
php-fpm & nginx -g 'daemon off;' & touch ~/startup.txt