diff --git a/images/web/Dockerfile b/images/web/Dockerfile index c19740ba..b9c5eb16 100644 --- a/images/web/Dockerfile +++ b/images/web/Dockerfile @@ -107,7 +107,7 @@ RUN apache2ctl configtest RUN chown -R www-data: $workdir # Add settings -ADD config/settings.yml $workdir/config/ +ADD config/settings-local.yml $workdir/config/ COPY start.sh $workdir/ COPY liveness.sh $workdir/ diff --git a/images/web/config/settings-local.yml b/images/web/config/settings-local.yml new file mode 100644 index 00000000..550ee763 --- /dev/null +++ b/images/web/config/settings-local.yml @@ -0,0 +1,28 @@ +# The server protocol and host +server_protocol: "http" +server_url: "openhistoricalmap.example.com" +status: "online" +# OAuth application for the web site +oauth_application: "OAUTH_CLIENT_ID" +oauth_key: "OAUTH_KEY" +# OAuth consumer key for iD +id_application: "" +# List of memcache servers to use for caching +memcache_servers: [] +# URL of Nominatim instance to use for geocoding +nominatim_url: "https://nominatim.openhistoricalmap.org/" +# URL of Overpass instance to use for feature queries +overpass_url: "https://overpass-api.de/api/interpreter" +# SMTP settings for outbound mail +smtp_address: "localhost" +smtp_port: 25 +smtp_domain: "localhost" +smtp_enable_starttls_auto: true +smtp_tls_verify_mode: "none" +smtp_authentication: null +smtp_user_name: null +smtp_password: null +doorkeeper_signing_key: | + -----BEGIN PRIVATE KEY----- + PRIVATE_KEY + -----END PRIVATE KEY----- diff --git a/images/web/config/settings.yml b/images/web/config/settings.yml deleted file mode 100644 index 53e9d622..00000000 --- a/images/web/config/settings.yml +++ /dev/null @@ -1,150 +0,0 @@ -# The server protocol and host -server_protocol: "http" -server_url: "openhistoricalmap.example.com" -# Publisher -#publisher_url: "" -# The generator -generator: "OpenHistoricalMap server" -copyright_owner: "OpenHistoricalMap and contributors" -attribution_url: "http://www.openhistoricalmap.org/copyright" -license_url: "http://opendatacommons.org/licenses/odbl/1-0/" -# Support email address -support_email: "ohm-admins@googlegroups.com" -# Sender addresses for emails -email_from: "OpenHistoricalMap " -email_return_path: "ohm-admins@googlegroups.com" -# API version -api_version: "0.6" -# Application status - possible values are: -# online - online and operating normally -# api_readonly - site online but API in read-only mode -# api_offline - site online but API offline -# database_readonly - database and site in read-only mode -# database_offline - database offline with site in emergency mode -# gpx_offline - gpx storage offline -status: "online" -# The maximum area you're allowed to request, in square degrees -max_request_area: 0.25 -# Number of GPS trace/trackpoints returned per-page -tracepoints_per_page: 5000 -# Maximum number of nodes that will be returned by the api in a map request -max_number_of_nodes: 100000 -# Maximum number of nodes that can be in a way (checked on save) -max_number_of_way_nodes: 2000 -# Maximum number of members that can be in a relation (checked on save) -max_number_of_relation_members: 32000 -# The maximum area you're allowed to request notes from, in square degrees -max_note_request_area: 25 -# Zoom level to use for postcode results from the geocoder -postcode_zoom: 15 -# Timeout for API calls in seconds -api_timeout: 300 -# Timeout for web pages in seconds -web_timeout: 30 -# Periods (in hours) which are allowed for user blocks -user_block_periods: [0, 1, 3, 6, 12, 24, 48, 96, 168, 336, 731, 4383, 8766, 87660] -# Rate limit for message sending -max_messages_per_hour: 60 -# Rate limit for friending -max_friends_per_hour: 60 -# Domain for handling message replies -#messages_domain: "messages.openstreetmap.org" -# MaxMind GeoIPv2 database -#maxmind_database: "" -# Users to show as being nearby -nearby_users: 30 -# Max radius, in km, for nearby users -nearby_radius: 50 -# Spam threshold -spam_threshold: 50 -# Delay diary entries from appearing in the feed for this many hours -diary_feed_delay: 0 -# Default legale (jurisdiction location) for contributor terms -default_legale: GB -# Location of data for attachments -attachments_dir: ":rails_root/public/attachments" -# Log file to use -#log_path: "" -# Log file to use for logstash -#logstash_path: "" -# List of memcache servers to use for caching -#memcache_servers: [] -# Enable HTTP basic authentication support -basic_auth_support: true -# Enable legacy OAuth 1.0 support -oauth_10_support: true -# URL of Nominatim instance to use for geocoding -nominatim_url: "https://nominatim.openhistoricalmap.org/" -# Default editor -default_editor: "id" -# OAuth application for the web site -oauth_application: "OAUTH_CLIENT_ID" -oauth_key: "OAUTH_KEY" -# OAuth consumer key for iD -id_application: "" -# Imagery to return in capabilities as blacklisted -imagery_blacklist: - # Current Google imagery URLs have google or googleapis in the domain - - ".*\\.google(apis)?\\..*/.*" - # Blacklist VWorld - - "http://xdworld\\.vworld\\.kr:8080/.*" - # Blacklist here - - ".*\\.here\\.com[/:].*" -# URL of Overpass instance to use for feature queries -overpass_url: "https://overpass-api.de/api/interpreter" -overpass_credentials: false -# Routing endpoints -graphhopper_url: "https://graphhopper.com/api/1/route" -fossgis_osrm_url: "https://routing.openstreetmap.de/" -fossgis_valhalla_url: "https://valhalla1.openstreetmap.de/route" -# External authentication credentials -#google_auth_id: "" -#google_auth_secret: "" -#google_openid_realm: "" -#facebook_auth_id: "" -#facebook_auth_secret: "" -#windowslive_auth_id: "" -#windowslive_auth_secret: "" -#github_auth_id: "" -#github_auth_secret: "" -#wikipedia_auth_id: "" -#wikipedia_auth_secret: "" -# Thunderforest authentication details -#thunderforest_key: "" -# Key for generating TOTP tokens -#totp_key: "" -# Enforce Content-Security-Policy -csp_enforce: false -# URL for reporting Content-Security-Policy violations -#csp_report_url: "" -# Storage services to use in production mode -avatar_storage: "local" -trace_file_storage: "local" -trace_image_storage: "local" -trace_icon_storage: "local" -# Root URL for storage services -# avatar_storage_url: -# trace_image_storage_url: -# trace_icon_storage_url: -# URL for tile CDN -#tile_cdn_url: "" -# SMTP settings for outbound mail -smtp_address: "localhost" -smtp_port: 25 -smtp_domain: "localhost" -smtp_enable_starttls_auto: true -smtp_tls_verify_mode: "none" -smtp_authentication: null -smtp_user_name: null -smtp_password: null -# Rate limit for changeset comments -min_changeset_comments_per_hour: 1 -initial_changeset_comments_per_hour: 6 -max_changeset_comments_per_hour: 60 -moderator_changeset_comments_per_hour: 36000 -embed_server_url: "https://embed.openhistoricalmap.org/" -# Private key for signing id_tokens -doorkeeper_signing_key: | - -----BEGIN PRIVATE KEY----- - PRIVATE_KEY - -----END PRIVATE KEY----- diff --git a/images/web/start.sh b/images/web/start.sh index a17b5921..58d06a0b 100755 --- a/images/web/start.sh +++ b/images/web/start.sh @@ -14,34 +14,37 @@ production: encoding: utf8" >$workdir/config/database.yml #### SETTING UP SERVER_URL AND SERVER_PROTOCOL -sed -i -e 's/server_url: "openhistoricalmap.example.com"/server_url: "'$SERVER_URL'"/g' $workdir/config/settings.yml -sed -i -e 's/server_protocol: "http"/server_protocol: "'$SERVER_PROTOCOL'"/g' $workdir/config/settings.yml +sed -i -e 's/server_url: "openhistoricalmap.example.com"/server_url: "'$SERVER_URL'"/g' $workdir/config/settings-local.yml +sed -i -e 's/server_protocol: "http"/server_protocol: "'$SERVER_PROTOCOL'"/g' $workdir/config/settings-local.yml + +### WEBSITE STATUS +sed -i "s/online/$WEBSITE_STATUS/g" $workdir/config/settings-local.yml #### SETTING UP MAIL SENDER -sed -i -e 's/smtp_address: "localhost"/smtp_address: "'$MAILER_ADDRESS'"/g' $workdir/config/settings.yml -sed -i -e 's/smtp_domain: "localhost"/smtp_domain: "'$MAILER_DOMAIN'"/g' $workdir/config/settings.yml -sed -i -e 's/smtp_enable_starttls_auto: false/smtp_enable_starttls_auto: true/g' $workdir/config/settings.yml -sed -i -e 's/smtp_authentication: null/smtp_authentication: "login"/g' $workdir/config/settings.yml -sed -i -e 's/smtp_user_name: null/smtp_user_name: "'$MAILER_USERNAME'"/g' $workdir/config/settings.yml -sed -i -e 's/smtp_password: null/smtp_password: "'$MAILER_PASSWORD'"/g' $workdir/config/settings.yml -sed -i -e 's/openstreetmap@example.com/'$MAILER_FROM'/g' $workdir/config/settings.yml -sed -i -e 's/smtp_port: 25/smtp_port: '$MAILER_PORT'/g' $workdir/config/settings.yml +sed -i -e 's/smtp_address: "localhost"/smtp_address: "'$MAILER_ADDRESS'"/g' $workdir/config/settings-local.yml +sed -i -e 's/smtp_domain: "localhost"/smtp_domain: "'$MAILER_DOMAIN'"/g' $workdir/config/settings-local.yml +sed -i -e 's/smtp_enable_starttls_auto: false/smtp_enable_starttls_auto: true/g' $workdir/config/settings-local.yml +sed -i -e 's/smtp_authentication: null/smtp_authentication: "login"/g' $workdir/config/settings-local.yml +sed -i -e 's/smtp_user_name: null/smtp_user_name: "'$MAILER_USERNAME'"/g' $workdir/config/settings-local.yml +sed -i -e 's/smtp_password: null/smtp_password: "'$MAILER_PASSWORD'"/g' $workdir/config/settings-local.yml +sed -i -e 's/openstreetmap@example.com/'$MAILER_FROM'/g' $workdir/config/settings-local.yml +sed -i -e 's/smtp_port: 25/smtp_port: '$MAILER_PORT'/g' $workdir/config/settings-local.yml #### SET UP ID KEY -sed -i -e 's/id_application: ""/id_application: "'$OPENSTREETMAP_id_key'"/g' $workdir/config/settings.yml +sed -i -e 's/id_application: ""/id_application: "'$OPENSTREETMAP_id_key'"/g' $workdir/config/settings-local.yml ### SET UP OAUTH ID AND KEY -sed -i -e 's/OAUTH_CLIENT_ID/'$OAUTH_CLIENT_ID'/g' $workdir/config/settings.yml -sed -i -e 's/OAUTH_KEY/'$OAUTH_KEY'/g' $workdir/config/settings.yml +sed -i -e 's/OAUTH_CLIENT_ID/'$OAUTH_CLIENT_ID'/g' $workdir/config/settings-local.yml +sed -i -e 's/OAUTH_KEY/'$OAUTH_KEY'/g' $workdir/config/settings-local.yml #### Setup env vars for memcached server -sed -i -e 's/#memcache_servers: \[\]/memcache_servers: "'$OPENSTREETMAP_memcache_servers'"/g' $workdir/config/settings.yml +sed -i -e 's/memcache_servers: \[\]/memcache_servers: "'$OPENSTREETMAP_memcache_servers'"/g' $workdir/config/settings-local.yml ## SET NOMINATIM URL -sed -i -e 's/nominatim.openhistoricalmap.org/'$NOMINATIM_URL'/g' $workdir/config/settings.yml +sed -i -e 's/nominatim.openhistoricalmap.org/'$NOMINATIM_URL'/g' $workdir/config/settings-local.yml ## SET OVERPASS URL -sed -i -e 's/overpass-api.de/'$OVERPASS_URL'/g' $workdir/config/settings.yml +sed -i -e 's/overpass-api.de/'$OVERPASS_URL'/g' $workdir/config/settings-local.yml sed -i -e 's/overpass-api.de/'$OVERPASS_URL'/g' $workdir/app/views/site/export.html.erb sed -i -e 's/overpass-api.de/'$OVERPASS_URL'/g' $workdir/app/assets/javascripts/index/export.js @@ -49,7 +52,7 @@ sed -i -e 's/overpass-api.de/'$OVERPASS_URL'/g' $workdir/app/assets/javascripts/ openssl genpkey -algorithm RSA -out private.pem chmod 400 /var/www/private.pem export DOORKEEPER_SIGNING_KEY=$(cat /var/www/private.pem | sed -e '1d;$d' | tr -d '\n') -sed -i "s#PRIVATE_KEY#${DOORKEEPER_SIGNING_KEY}#" $workdir/config/settings.yml +sed -i "s#PRIVATE_KEY#${DOORKEEPER_SIGNING_KEY}#" $workdir/config/settings-local.yml #### CHECK IF DB IS ALREADY UP AND START THE APP flag=true @@ -62,7 +65,7 @@ while "$flag" = true; do sleep 2 done & - # Enable assets:precompile, to take lates changes for assets in $workdir/config/settings.yml. + # Enable assets:precompile, to take lates changes for assets in $workdir/config/settings-local.yml. time bundle exec rake i18n:js:export assets:precompile bundle exec rails db:migrate diff --git a/ohm/requirements.yaml b/ohm/requirements.yaml index 8aa5f505..6b41953c 100644 --- a/ohm/requirements.yaml +++ b/ohm/requirements.yaml @@ -1,4 +1,4 @@ dependencies: - name: osm-seed - version: '0.1.0-n807.hc1acb2f' + version: '0.1.0-n781.h5f07b5b' repository: https://devseed.com/osm-seed-chart/ diff --git a/values.production.template.yaml b/values.production.template.yaml index bb7bde6e..964ac1da 100644 --- a/values.production.template.yaml +++ b/values.production.template.yaml @@ -110,6 +110,7 @@ osm-seed: NEW_RELIC_LICENSE_KEY: {{PRODUCTION_NEW_RELIC_LICENSE_KEY}} NEW_RELIC_APP_NAME: {{PRODUCTION_NEW_RELIC_APP_NAME}} ORGANIZATION_NAME: OpenHistoricalMap + WEBSITE_STATUS: "online" resources: enabled: true requests: diff --git a/values.staging.template.yaml b/values.staging.template.yaml index 7f4cc57a..e1744a9e 100644 --- a/values.staging.template.yaml +++ b/values.staging.template.yaml @@ -120,6 +120,7 @@ osm-seed: NEW_RELIC_LICENSE_KEY: {{STAGING_NEW_RELIC_LICENSE_KEY}} NEW_RELIC_APP_NAME: {{STAGING_NEW_RELIC_APP_NAME}} ORGANIZATION_NAME: OpenHistoricalMap + WEBSITE_STATUS: "online" resources: enabled: false requests: