From 0cb87296d80c554a3f20e2008d1f3fbe1362ad6f Mon Sep 17 00:00:00 2001 From: amercader Date: Wed, 21 Aug 2024 13:14:28 +0200 Subject: [PATCH 1/5] Update project images to latest ckan release --- README.md | 3 +-- ckan/Dockerfile | 2 +- ckan/Dockerfile.dev | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4756a9c..e209e3b 100644 --- a/README.md +++ b/README.md @@ -314,8 +314,7 @@ For convenience the CKAN_SITE_URL parameter should be set in the .env file. For ## 12. Changing the base image -The base image used in the CKAN Dockerfile and Dockerfile.dev can be changed so a different DockerHub image is used eg: ckan/ckan-base:2.9.9 -could be used instead of ckan/ckan-base:2.10.1 +The base image used in the CKAN Dockerfile and Dockerfile.dev can be changed so a different DockerHub image is used eg: ckan/ckan-base:2.10.5 can be used instead of ckan/ckan-base:2.11.0 ## 13. Replacing DataPusher with XLoader diff --git a/ckan/Dockerfile b/ckan/Dockerfile index f9dae59..67a431e 100644 --- a/ckan/Dockerfile +++ b/ckan/Dockerfile @@ -1,4 +1,4 @@ -FROM ckan/ckan-base:2.10.4 +FROM ckan/ckan-base:2.11.0 # Install any extensions needed by your CKAN instance # See Dockerfile.dev for more details and examples diff --git a/ckan/Dockerfile.dev b/ckan/Dockerfile.dev index 1f70363..a815507 100644 --- a/ckan/Dockerfile.dev +++ b/ckan/Dockerfile.dev @@ -1,4 +1,4 @@ -FROM ckan/ckan-dev:2.10.4 +FROM ckan/ckan-dev:2.11.0 # Install any extensions needed by your CKAN instance # - Make sure to add the plugins to CKAN__PLUGINS in the .env file From 8cec49dc038268a9c03695be885dae94f1ba9c5c Mon Sep 17 00:00:00 2001 From: Jonah Duckles Date: Mon, 2 Sep 2024 09:41:40 +1200 Subject: [PATCH 2/5] Fixing broken link.... I think this is the correct link target...seems the ckan-base repo may have been renamed to ckan-docker-base? --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e209e3b..5286e07 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ The CKAN images used are from the official CKAN [ckan-docker](https://github.com The non-CKAN images are as follows: -* DataPusher: CKAN's [pre-configured DataPusher image](https://github.com/ckan/ckan-base/tree/main/datapusher). +* DataPusher: CKAN's [pre-configured DataPusher image](https://github.com/ckan/ckan-docker-base/tree/main/datapusher). * PostgreSQL: Official PostgreSQL image. Database files are stored in a named volume. * Solr: CKAN's [pre-configured Solr image](https://github.com/ckan/ckan-solr). Index data is stored in a named volume. * Redis: standard Redis image From 6a6afb13158f323eeeae07a9e85eafbb540bef49 Mon Sep 17 00:00:00 2001 From: Ian Ward Date: Tue, 8 Oct 2024 17:16:14 -0400 Subject: [PATCH 3/5] default config for 100MB uploads --- .env.example | 1 + nginx/setup/nginx.conf | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 203f294..eedf4c9 100644 --- a/.env.example +++ b/.env.example @@ -43,6 +43,7 @@ CKAN_SMTP_STARTTLS=True CKAN_SMTP_USER=user CKAN_SMTP_PASSWORD=pass CKAN_SMTP_MAIL_FROM=ckan@localhost +CKAN_MAX_UPLOAD_SIZE_MB=100 TZ=UTC # Solr diff --git a/nginx/setup/nginx.conf b/nginx/setup/nginx.conf index ddc819c..d1f9c52 100644 --- a/nginx/setup/nginx.conf +++ b/nginx/setup/nginx.conf @@ -38,10 +38,12 @@ http { # Enable gzip encryption gzip on; - + proxy_cache_path /tmp/nginx_cache levels=1:2 keys_zone=cache:30m max_size=250m; proxy_temp_path /tmp/nginx_proxy 1 2; + client_max_body_size 140M; + include /etc/nginx/conf.d/*.conf; # Error status text From b462bec37fd72fd3836b3948e600df21e04b94b4 Mon Sep 17 00:00:00 2001 From: Ian Ward Date: Tue, 8 Oct 2024 17:30:55 -0400 Subject: [PATCH 4/5] add warning, remove image of text --- README.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 5286e07..3d9c7dd 100644 --- a/README.md +++ b/README.md @@ -61,10 +61,8 @@ Use this if you are a maintainer and will not be making code changes to CKAN or Copy the included `.env.example` and rename it to `.env`. Modify it depending on your own needs. -Please note that when accessing CKAN directly (via a browser) ie: not going through NGINX you will need to make sure you have "ckan" set up -to be an alias to localhost in the local hosts file. Either that or you will need to change the `.env` entry for `CKAN_SITE_URL` - -Using the default values on the `.env.example` file will get you a working CKAN instance. There is a sysadmin user created by default with the values defined in `CKAN_SYSADMIN_NAME` and `CKAN_SYSADMIN_PASSWORD`(`ckan_admin` and `test1234` by default). This should be obviously changed before running this setup as a public CKAN instance. +> [!WARNING] +> There is a sysadmin user created by default with the values defined in `CKAN_SYSADMIN_NAME` and `CKAN_SYSADMIN_PASSWORD` (`ckan_admin` and `test1234` by default). These must be changed before running this setup as a public CKAN instance. To build the images: @@ -78,11 +76,20 @@ This will start up the containers in the current window. By default the containe using a different colour. You could also use the -d "detach mode" option ie: `docker compose up -d` if you wished to use the current window for something else. -At the end of the container start sequence there should be 6 containers running +At the end of the container start sequence there should be 6 containers running: -![Screenshot 2022-12-12 at 10 36 21 am](https://user-images.githubusercontent.com/54408245/207012236-f9571baa-4d99-4ffe-bd93-30b11c4829e0.png) +```bash +$ docker compose ps +NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS +ckan-docker-ckan-1 ckan-docker-ckan "/srv/app/start_ckan…" ckan 4 minutes ago Up 3 minutes (healthy) 5000/tcp +ckan-docker-datapusher-1 ckan/ckan-base-datapusher:0.0.20 "sh -c 'uwsgi --plug…" datapusher 4 minutes ago Up 4 minutes (healthy) 8800/tcp +ckan-docker-db-1 ckan-docker-db "docker-entrypoint.s…" db 4 minutes ago Up 4 minutes (healthy) +ckan-docker-nginx-1 ckan-docker-nginx "/bin/sh -c 'openssl…" nginx 4 minutes ago Up 2 minutes 80/tcp, 0.0.0.0:8443->443/tcp +ckan-docker-redis-1 redis:6 "docker-entrypoint.s…" redis 4 minutes ago Up 4 minutes (healthy) +ckan-docker-solr-1 ckan/ckan-solr:2.10-solr9 "docker-entrypoint.s…" solr 4 minutes ago Up 4 minutes (healthy) +``` -After this step, CKAN should be running at `CKAN_SITE_URL`. +After this step, CKAN should be running at `CKAN_SITE_URL` (by default https://localhost:8443) ### Development mode From 88f9356b2f0bde87ae2126c82ff436b854dff7a2 Mon Sep 17 00:00:00 2001 From: Ian Ward Date: Wed, 9 Oct 2024 15:21:38 -0400 Subject: [PATCH 5/5] fix example extension ownership command, remove image --- README.md | 23 ++++++++++++++++++++--- src/.placeholder | 0 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 src/.placeholder diff --git a/README.md b/README.md index 3d9c7dd..ab781e9 100644 --- a/README.md +++ b/README.md @@ -113,12 +113,29 @@ 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: - docker compose -f docker-compose.dev.yml exec ckan-dev /bin/sh -c "ckan -c /srv/app/ckan.ini generate extension --output-dir /srv/app/src_extensions" +```bash +docker compose -f docker-compose.dev.yml exec ckan-dev ckan generate extension --output-dir /srv/app/src_extensions +``` -![Screenshot 2023-02-22 at 1 45 55 pm](https://user-images.githubusercontent.com/54408245/220623568-b4e074c7-6d07-4d27-ae29-35ce70961463.png) +``` +Extension's name [must begin 'ckanext-']: ckanext-mytheme +Author's name []: Joe Bloggs +Author's email []: joeb@example.com +Your Github user or organization name []: example +Brief description of the project []: My CKAN theme +List of keywords (separated by spaces) [CKAN]: +Do you want to include code examples? [y/N]: y +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. You might need to change the owner of its folder to have the appropiate permissions. +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 diff --git a/src/.placeholder b/src/.placeholder new file mode 100644 index 0000000..e69de29