Skip to content

Commit

Permalink
#2841: Add some fixes to improve ARM support for platform.sh recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
pirog committed Apr 5, 2021
1 parent b5cb013 commit eb18a16
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion integrations/lando-platformsh/lib/run.js
Expand Up @@ -129,7 +129,7 @@ const getApplicationEnvironment = (appConfig, config) => _.merge({}, getEnvironm
// we probably dont want these things ending up in git
//
// That said changing this could def be problematic for other reasons
// PLATFORM_APP_DIR: '/var/www',
// PLATFORM_APP_DIR: '/app',
PLATFORM_ENVIRONMENT: 'lando',
PLATFORM_APPLICATION_NAME: appConfig.name,
PLATFORM_PROJECT: config.id,
Expand Down
2 changes: 2 additions & 0 deletions integrations/lando-platformsh/scripts/psh-boot.sh
Expand Up @@ -24,6 +24,8 @@ fi
lando_info "Ensuring needed directories exist..."
mkdir -p /run/shared /run/rpc_pipefs/nfs /run/runit
chmod 777 /run
# NOTE: This seems to only be relevant on M1 macs and maybe is fixed in the future?
chmod 666 /dev/null

# Make sure there is a group that has $LANDO_HOST_GID
# This is rare but can happen if the host gid is different than the uid
Expand Down
11 changes: 8 additions & 3 deletions integrations/lando-platformsh/scripts/psh-recreate-users.sh
Expand Up @@ -30,7 +30,7 @@ addAppUserIfNotExists() {
--home /mnt \
--shell /bin/false \
-M \
app
app > /dev/null || true
fi
}

Expand All @@ -48,13 +48,13 @@ fi
# Check if a different user was found for the UID
if ! [ "$FOUND_USERNAME" = "" ]; then
# Delete it (This may be "app"; If so, we'll add it back later)
deluser $FOUND_USERNAME
deluser $FOUND_USERNAME > /dev/null
fi

# Now check if there's a "web" user with a UID that is not LANDO_HOST_UID
if id -u $WEB_USERNAME >/dev/null 2>&1; then
# Delete so we can add it with the proper UID
deluser $WEB_USERNAME
deluser $WEB_USERNAME > /dev/null
fi

# At this point there is no "web" user and no user with the LANDO_HOST_UID
Expand All @@ -64,3 +64,8 @@ addWebuser
# Last, in case app user is missing, or we deleted it because it had the LANDO_HOST_UID
# Create the app user if it doesn't exist
addAppUserIfNotExists

# Add to the root group
# NOTE: this seems to be necessary on M1 macs only for some reason?
addgroup app root > /dev/null || true
addgroup web root > /dev/null || true

0 comments on commit eb18a16

Please sign in to comment.