Skip to content

Commit

Permalink
config
Browse files Browse the repository at this point in the history
  • Loading branch information
maximilianoPizarro committed Sep 26, 2023
1 parent 586778d commit d5e7cc0
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 6 deletions.
43 changes: 43 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Host Ports
CKAN_PORT_HOST=5000

# CKAN databases
POSTGRES_USER=ckan
POSTGRES_PASSWORD=ckan
DATASTORE_READONLY_USER=datastore_ro
DATASTORE_READONLY_PASSWORD=datastore
POSTGRES_HOST=localhost
CKAN_SQLALCHEMY_URL=postgresql://ckan:[email protected]:5432/ckan


# CKAN core
CKAN_VERSION=2.9
CKAN_SITE_ID=default
CKAN_SITE_URL=https://5000-maximilianopizar-ckan-los6yj2i7dn.ws-us105.gitpod.io
CKAN_PORT=5000
CKAN_PORT_HOST=5000
CKAN___BEAKER__SESSION__SECRET=CHANGE_ME
# See https://docs.ckan.org/en/latest/maintaining/configuration.html#api-token-settings
CKAN___API_TOKEN__JWT__ENCODE__SECRET=string:CHANGE_ME
CKAN___API_TOKEN__JWT__DECODE__SECRET=string:CHANGE_ME
CKAN_SYSADMIN_NAME=ckan_admin
CKAN_SYSADMIN_PASSWORD=test1234
CKAN_SYSADMIN_EMAIL=[email protected]
CKAN_STORAGE_PATH=/var/lib/ckan
CKAN_SMTP_SERVER=smtp.corporateict.domain:25
CKAN_SMTP_STARTTLS=True
CKAN_SMTP_USER=user
CKAN_SMTP_PASSWORD=pass
CKAN_SMTP_MAIL_FROM=ckan@localhost
TZ=UTC

# Solr
SOLR_IMAGE_VERSION=2.9-solr8
CKAN_SOLR_URL=http://172.18.0.4:8983/solr/ckan

# Redis
REDIS_VERSION=6
CKAN_REDIS_URL=redis://172.18.0.3:6379/1

# Extensions
CKAN__PLUGINS="envvars image_view text_view recline_view"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ node_modules/
# docker
contrib/docker/.env
cypress.env.json

ckan/default/
8 changes: 8 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
python -m venv /workspace/ckan/ckan/default
. /workspace/ckan/ckan/defualt/bin/activate
pip install -r requirements.txt
python setup.py install
set -o allexport
source .env.development
ckan -c development.ini db init
ckan -c development.ini run
30 changes: 25 additions & 5 deletions ckan/config/deployment.ini_tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ beaker.session.secret = $app_instance_secret
app_instance_uuid = $app_instance_uuid

# repoze.who config
who.config_file = %(here)s/who.ini
who.config_file = %(here)s/development.ini
who.log_level = warning
who.log_file = %(cache_dir)s/who_log.ini
who.log_file = %(cache_dir)s/development_log.ini
# Session timeout (user logged out after period of inactivity, in seconds).
# Inactive by default, so the session doesn't expire.
# who.timeout = 86400
Expand All @@ -59,7 +59,7 @@ ckan.datastore.default_fts_index_method = gist

## Site Settings

ckan.site_url =
#ckan.site_url =
#ckan.use_pylons_response_cleanup_middleware = true

# Default timeout for Requests
Expand Down Expand Up @@ -119,11 +119,11 @@ ckan.site_id = default
# Add ``datapusher`` to enable DataPusher
# Add ``resource_proxy`` to enable resorce proxying and get around the
# same origin policy
ckan.plugins = stats text_view image_view recline_view
ckan.plugins = stats text_view image_view recline_view oidc_pkce

# Define which views should be created by default
# (plugins must be loaded in ckan.plugins)
ckan.views.default_views = image_view text_view recline_view
ckan.views.default_views = image_view text_view recline_view oidc_pkce

# Customize which text formats the text_view plugin will show
#ckan.preview.json_formats = json
Expand Down Expand Up @@ -256,3 +256,23 @@ formatter = generic

[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s] %(message)s



[general]
request_classifier = repoze.who.classifiers:default_request_classifier
challenge_decider = repoze.who.classifiers:default_challenge_decider



# URL of SSO application
ckanext.oidc_pkce.base_url = https://oauth2-server.com
ckanext.oidc_pkce.client_id = clientid
ckanext.oidc_pkce.client_secret = clientsecret
ckanext.oidc_pkce.auth_path = /oidc/authorize
ckanext.oidc_pkce.token_path = /oidc/token
ckanext.oidc_pkce.userinfo_path = /oidc/userinfo
ckanext.oidc_pkce.redirect_path = /local/oidc/handler
ckanext.oidc_pkce.error_redirect = /user/register
ckanext.oidc_pkce.scope = email
ckanext.oidc_pkce.use_same_id = true
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ webob==1.8.7 # via fanstatic, repoze.who
werkzeug[watchdog]==1.0.0 # via -r requirements.in, flask
zope.interface==5.4.0 # via -r requirements.in, repoze.who
#ckanext-oauth2==0.7.0
requests-oauthlib==0.8.0
ckanext-oidc-pkce==0.3.0
blinker==1.6.2
#requests-oauthlib==0.8.0
setuptools==44.1.0
# The following packages are considered to be unsafe in a requirements file:
# setuptools
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@
#OAuth2
'oauth2=ckanext.oauth2.plugin:OAuth2Plugin',

#OidcPkcePlugin
'oidc_pkce=ckanext.oidc_pkce.plugin:OidcPkcePlugin',

# FIXME: Remove deprecated resource previews below. You should use the
# versions as *_view instead.
'text_preview = ckanext.textview.plugin:TextView',
Expand Down

0 comments on commit d5e7cc0

Please sign in to comment.