Skip to content

Commit f29734f

Browse files
committed
Another fix for missing permissions
1 parent 9c6ede8 commit f29734f

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ Feel free to build on this foundation for richer APIs or interfaces.
5151
The `deploy/deploy.sh` script provisions the application on a Linux host using `systemd`. It:
5252

5353
- Syncs the repository into `/opt/nasa-sky-app/app` (configurable with `APP_ROOT`).
54-
- Creates a virtual environment and installs dependencies.
54+
- Ensures `/opt/nasa-sky-app` exists with the proper ownership, then syncs code and creates a
55+
virtual environment for dependencies.
5556
- Generates a `systemd` unit that runs Uvicorn on port `80` by default.
5657
- Enables and restarts the service.
5758

deploy/deploy.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ if ! command -v "${PYTHON_BIN}" >/dev/null 2>&1; then
5656
exit 1
5757
fi
5858

59-
mkdir -p "${APP_DIR}"
59+
if [ ! -d "${APP_ROOT}" ]; then
60+
${SUDO_BIN} mkdir -p "${APP_ROOT}"
61+
fi
62+
${SUDO_BIN} mkdir -p "${APP_DIR}" "${VENV_DIR}"
63+
${SUDO_BIN} chown -R "${SERVICE_USER}:${SERVICE_GROUP}" "${APP_ROOT}"
64+
6065
rsync -a --delete \
6166
--exclude ".git" \
6267
--exclude ".venv" \

0 commit comments

Comments
 (0)