forked from datopian/ckanext-iaea
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from keitaroinc/migrate-docker-and-scripts
Migrate docker, scripts, package view and actions
- Loading branch information
Showing
20 changed files
with
1,357 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# DB image settings | ||
POSTGRES_PASSWORD=ckan | ||
DATASTORE_READONLY_PASSWORD=datastore | ||
|
||
# Basic | ||
CKAN_SITE_ID=default | ||
CKAN_SITE_URL=http://ckan.iaea.local:5000 | ||
CKAN_PORT=5000 | ||
CKAN_SYSADMIN_NAME=ckan_admin | ||
CKAN_SYSADMIN_PASSWORD=test1234 | ||
CKAN_SYSADMIN_EMAIL=[email protected] | ||
TZ=UTC | ||
|
||
# Database connections (TODO: avoid duplication) | ||
CKAN_SQLALCHEMY_URL=postgresql://ckan:ckan@iaea_db/ckan | ||
CKAN_DATASTORE_WRITE_URL=postgresql://ckan:ckan@iaea_db/datastore | ||
CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:datastore@iaea_db/datastore | ||
|
||
# Test database connections | ||
TEST_CKAN_SQLALCHEMY_URL=postgres://ckan:ckan@iaea_db/ckan_test | ||
TEST_CKAN_DATASTORE_WRITE_URL=postgresql://ckan:ckan@iaea_db/datastore_test | ||
TEST_CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:datastore@iaea_db/datastore_test | ||
|
||
# Other services connections | ||
CKAN_SOLR_URL=http://iaea_solr:8983/solr/ckan | ||
CKAN_REDIS_URL=redis://iaea_redis:6379/1 | ||
#CKAN_DATAPUSHER_URL=http://datapusher:8800 | ||
#CKAN__DATAPUSHER__CALLBACK_URL_BASE=http://ckan:5000 | ||
|
||
TEST_CKAN_SOLR_URL=http://iaea_solr:8983/solr/ckan | ||
TEST_CKAN_REDIS_URL=redis://iaea_redis:6379/1 | ||
|
||
# Core settings | ||
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 | ||
|
||
## Extensions | ||
#CKAN__PLUGINS=envvars stats text_view image_view webpage_view resource_proxy datastore datapusher iaea validation qa report archiver harvest ckan_harvester authz_service sentry linechart barchart piechart basicgrid visualize pdf_view geo_view geojson_view wmts_view shp_view pages dataexplorer_view dataexplorer_table_view dataexplorer_chart_view dataexplorer_map_view dcat dcat_rdf_harvester dcat_json_harvester dcat_json_interface structured_data scheming_datasets scheming_groups scheming_organizations | ||
CKAN__PLUGINS=envvars stats text_view image_view webpage_view resource_proxy datastore | ||
#CKAN__VIEWS__DEFAULT_VIEWS = image_view text_view recline_view geojson_view | ||
CKAN__VIEWS__DEFAULT_VIEWS = image_view text_view recline_view | ||
CKAN__HARVEST__MQ__TYPE=redis | ||
CKAN__HARVEST__MQ__HOSTNAME=iaea_redis | ||
CKAN__HARVEST__MQ__PORT=6379 | ||
CKAN__HARVEST__MQ__REDIS_DB=1 | ||
|
||
# Sentry | ||
# CKAN___SENTRY__DSN=https://xxxxxx:[email protected]/1 | ||
# CKAN___SENTRY__CONFIGURE_LOGGING=True | ||
# CKAN___SENTRY__LOG_LEVEL=WARN | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class RestrictMiddleware(object): | ||
|
||
def __init__(self, app, app_config): | ||
self.app=app | ||
|
||
def __call__(self, environ, start_response): | ||
ui_path = environ.get('PATH_INFO') | ||
|
||
if ui_path == "/stats" and not 'repoze.who.identity' in environ: | ||
|
||
status = u'404 Not Found' | ||
location = u'/user/login' | ||
headers = [(u'Location',location), (u'Content-type', u'text/plain')] | ||
body='Not authorized to see this page' | ||
start_response (status, headers) | ||
return[body] | ||
else: | ||
return self.app(environ, start_response) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{% extends "page.html" %} | ||
|
||
{% set pkg = c.pkg_dict or pkg_dict %} | ||
{% set current_url = h.full_current_url() %} | ||
|
||
{% block breadcrumb_content_selected %} class="active"{% endblock %} | ||
|
||
{% block subtitle %}{{ _('Datasets') }}{% endblock %} | ||
|
||
{% block breadcrumb_content %} | ||
{% if pkg %} | ||
{% set dataset = h.dataset_display_name(pkg) %} | ||
{% if pkg.organization %} | ||
{% set organization = h.get_translated(pkg.organization, 'title') or pkg.organization.name %} | ||
{% set group_type = pkg.organization.type %} | ||
<li>{% link_for _('Organizations'), controller='organization', action='index', named_route=group_type + '_index' %}</li> | ||
<li>{% link_for organization|truncate(30), controller='organization', action='read', id=pkg.organization.name, | ||
named_route=group_type + '_read' %}</li> | ||
{% else %} | ||
<li>{% link_for _('Datasets'), controller='dataset', action='search' %}</li> | ||
{% endif %} | ||
<li{{ self.breadcrumb_content_selected() }}>{% link_for dataset|truncate(30), controller='dataset', action='read', | ||
id=pkg.name %}</li> | ||
{% else %} | ||
<li>{% link_for _('Datasets'), controller='dataset', action='search' %}</li> | ||
<li class="active"><a href="">{{ _('Create Dataset') }}</a></li> | ||
{% endif %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{% extends "package/read_base.html" %} | ||
|
||
{% block primary_content_inner %} | ||
{% if package_views %} | ||
|
||
<form action="#" method="post"> | ||
<fieldset class="fields-feature-view form-group"> | ||
<p>Select a view that should be featured on the dataset page.</p> | ||
{% for resource in package_views %} | ||
<h3> {{ resource.resource_name }}</h3> | ||
{% for view in resource.views %} | ||
<div class="radio-groups"> | ||
{% set view_url = h.url_for(qualified=True, controller='dataset_resource', | ||
action='view', id=pkg['name'], | ||
resource_id=view.resource_id, | ||
view_id=view.id) %} | ||
{% if pkg['featured_view'] == view.id %} | ||
<input id="featured_view" name="featured_view" type="radio" class="radio" value="{{view.id}}" checked /> | ||
<span><a href="{{view_url}}" target="_blank">{{view.title}}</a></span> | ||
{% else %} | ||
<input id="featured_view" name="featured_view" type="radio" class="radio" value="{{view.id}}" /> | ||
<span><a href="{{view_url}}" target="_blank">{{view.title}}</a></span> | ||
{% endif %} | ||
</div> | ||
{% endfor %} | ||
{% endfor %} | ||
</fieldset> | ||
|
||
<div class="form-actions"> | ||
<input type="submit" class="btn btn-primary" name="submit" value="submit" /> | ||
<input type="submit" class="btn btn-danger" name="submit" value="clear" /> | ||
</div> | ||
</form> | ||
{% else %} | ||
<p>{{ _("There are no views created for this dataset yet.") }}</p> | ||
{% endif %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{% extends "package/read_base.html" %} | ||
{# Reuse of activity template for additonal info#} | ||
|
||
{% block primary_content_inner %} | ||
{% snippet "package/snippets/additional_info.html", pkg_dict=pkg %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{% ckan_extends %} | ||
|
||
{% block package_description %} | ||
{% endblock %} | ||
|
||
{% block package_resources %} | ||
{% snippet "package/snippets/resources_list.html", pkg=pkg, resources=pkg.resources %} | ||
{% endblock %} | ||
|
||
{% block package_additional_info %} | ||
{% endblock %} |
Oops, something went wrong.