Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimise root ownership of application files #172

Merged
merged 6 commits into from
Nov 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update readme for create and install extension commands
wardi committed Nov 8, 2024
commit 4b9e58155beffaf611dac0fd39cf2c478c0985ef
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -102,6 +102,10 @@ To build the images:

docker compose -f docker-compose.dev.yml build

To install extensions from the `src` directory:

docker compose -f docker-compose.dev.yml run -u root ckan-dev ./install_src.sh

To start the containers:

docker compose -f docker-compose.dev.yml up
@@ -114,7 +118,7 @@ See [CKAN images](#5-ckan-images) for more details of what happens when using de
You can use the ckan [extension](https://docs.ckan.org/en/latest/extensions/tutorial.html#creating-a-new-extension) instructions to create a CKAN extension, only executing the command inside the CKAN container and setting the mounted `src/` folder as output:

```bash
docker compose -f docker-compose.dev.yml exec ckan-dev ckan generate extension --output-dir /srv/app/src_extensions
docker compose -f docker-compose.dev.yml exec -u `stat -c '%u' src` -e HOME=/srv/app/src_extensions ckan-dev ckan generate extension --output-dir /srv/app/src_extensions
```

```
@@ -131,12 +135,6 @@ Written: /srv/app/src_extensions/ckanext-mytheme

The new extension files and directories are created in the `/srv/app/src_extensions/` folder in the running container. They will also exist in the local src/ directory as local `/src` directory is mounted as `/srv/app/src_extensions/` on the ckan container.

The files will be owned by root, to correct the ownership so you can edit the files with your normal account outside the container run:

```bash
docker compose -f docker-compose.dev.yml exec ckan-dev chown --reference /srv/app/src_extensions/ -R /srv/app/src_extensions/ckanext-mytheme/
```

#### Running HTTPS on development mode

Sometimes is useful to run your local development instance under HTTPS, for instance if you are using authentication extensions like [ckanext-saml2auth](https://github.com/keitaroinc/ckanext-saml2auth). To enable it, set the following in your `.env` file: