Skip to content

Commit

Permalink
Apache permissions for its group only
Browse files Browse the repository at this point in the history
  • Loading branch information
jolelievre committed Dec 5, 2023
1 parent ed74463 commit 9d7228a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
14 changes: 9 additions & 5 deletions .github/actions/setup-prestashop-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,24 +104,28 @@ runs:
- name: Setup permission and restart apache
shell: bash
run: |
sudo chown www-data:www-data -R ${{ github.workspace }} && \
sudo chown www-data:www-data -R . && \
sudo chown :www-data -R ${{ github.workspace }} && \
sudo chown :www-data -R . && \
sudo chmod g+w -R ${{ github.workspace }} \
sudo chmod g+X -R ${{ github.workspace }} \
sudo chmod g+w -R . \
sudo chmod g+X -R . \
sudo mkdir -p /var/lib/php/sessions && \
sudo chown www-data:www-data -R /var/lib/php/sessions && \
sudo chown :www-data -R /var/lib/php/sessions && \
sudo service apache2 restart
- name: Disable dev mode
if: inputs.ps-dev-mode == 'false'
shell: bash
run: |
echo "Disabling DEV mode ...";
sudo runuser -g www-data -u www-data -- sed -ie "s/define('_PS_MODE_DEV_', true);/define('_PS_MODE_DEV_',\ false);/g" config/defines.inc.php
sed -ie "s/define('_PS_MODE_DEV_', true);/define('_PS_MODE_DEV_',\ false);/g" config/defines.inc.php
- name: Install PrestaShop
if: inputs.ps-auto-install == 'true'
shell: bash
run: |
sudo runuser -g www-data -u www-data -- php install-dev/index_cli.php \
php install-dev/index_cli.php \
---domain="localhost" --db_server="127.0.0.1:3306" --db_name="${{ inputs.mysql-database }}" \
--db_user="root" --db_password=${{ inputs.mysql-root-password }} \
--prefix="tst_" --firstname="Marc" --lastname="Beier" \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sanity-productV2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
key: ${{ runner.os }}-browsers

- name: Run tests
run: sudo runuser -g www-data -u www-data -- npm install && npm run test:sanity:productV2:fast-fail
run: npm install && npm run test:sanity:productV2:fast-fail
env:
URL_FO: https://localhost/
DB_NAME: prestashop
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ jobs:
key: ${{ runner.os }}-browsers

- name: Use .env.ci
run: sudo runuser -g www-data -u www-data -- mv .env.ci .env
run: mv .env.ci .env
working-directory: ./tests/UI

- name: Run tests
run: sudo runuser -g www-data -u www-data -- npm install && npm run test:sanity:fast-fail
run: npm install && npm run test:sanity:fast-fail
working-directory: ./tests/UI
env:
URL_FO: https://localhost/
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/sanity/setup-apache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,12 @@ a2dismod mpm_event
cp -f $WORKSPACE/.github/workflows/sanity/apache-vhost /etc/apache2/sites-available/000-default.conf
sed -e "s?%BUILD_DIR%?$(echo $WORKSPACE)?g" --in-place /etc/apache2/sites-available/000-default.conf
sed -e "s?%MKCERT_DIR%?$(echo $WORKSPACE)?g" --in-place /etc/apache2/sites-available/000-default.conf

# Restart apache after giving permission
sudo chown :www-data -R $WORKSPACE
sudo chown :www-data -R /home/runner/
sudo chmod g+w -R $WORKSPACE
sudo chmod g+X -R $WORKSPACE
sudo chmod g+w -R /home/runner/
sudo chmod g+X -R /home/runner/
service apache2 restart

0 comments on commit 9d7228a

Please sign in to comment.