Skip to content

Commit 7ac5f9f

Browse files
authored
Merge pull request #420 from OpenHistoricalMap/upstream-merge
Upstream merge
2 parents a0e2db4 + 0feb1c3 commit 7ac5f9f

1,437 files changed

Lines changed: 29625 additions & 323099 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.database_consistency.yml

Lines changed: 466 additions & 0 deletions
Large diffs are not rendered by default.

.devcontainer/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version
2+
ARG RUBY_VERSION=3.4.7
3+
FROM ghcr.io/rails/devcontainer/images/ruby:$RUBY_VERSION
4+
5+
USER root
6+
ENV DEBIAN_FRONTEND=noninteractive
7+
8+
# Required on Windows
9+
RUN mkdir -p /workspaces/openstreetmap-website \
10+
&& chown -R vscode:vscode /workspaces/openstreetmap-website
11+
12+
# Install system packages then clean up to minimize image size
13+
RUN apt-get update \
14+
&& apt-get install --no-install-recommends -y \
15+
file \
16+
libarchive-dev \
17+
libgd-dev \
18+
osmosis \
19+
&& apt-get clean \
20+
&& apt-get distclean

.devcontainer/Dockerfile.postgres

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Would use postgis:15-3.5, but it doesn't work with Apple Silicon
2+
# (https://github.com/postgis/docker-postgis/issues/216).
3+
# Therefore we use postgres:15 and apt-install Postgis ourselves.
4+
FROM postgres:15
5+
6+
RUN apt-get update \
7+
&& apt-get install --no-install-recommends -y \
8+
postgresql-15-postgis-3

.devcontainer/compose.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: "open_street_map"
2+
3+
services:
4+
rails-app:
5+
build:
6+
context: ..
7+
dockerfile: .devcontainer/Dockerfile
8+
9+
volumes:
10+
- ../..:/workspaces:cached
11+
12+
# Overrides default command so things don't shut down after the process ends.
13+
command: sleep infinity
14+
15+
# Uncomment the next line to use a non-root user for all processes.
16+
# user: vscode
17+
18+
# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
19+
# (Adding the "ports" property to this file will not forward from a Codespace.)
20+
depends_on:
21+
- selenium-default
22+
- selenium-de
23+
- selenium-nolang
24+
- postgres
25+
26+
selenium-default:
27+
image: selenium/standalone-firefox
28+
restart: unless-stopped
29+
30+
selenium-de:
31+
image: selenium/standalone-firefox
32+
restart: unless-stopped
33+
34+
selenium-nolang:
35+
image: selenium/standalone-firefox
36+
restart: unless-stopped
37+
38+
postgres:
39+
build:
40+
context: .
41+
dockerfile: ./Dockerfile.postgres
42+
restart: unless-stopped
43+
networks:
44+
- default
45+
volumes:
46+
- postgres-data:/var/lib/postgresql/data
47+
environment:
48+
POSTGRES_DB: openstreetmap
49+
POSTGRES_USER: openstreetmap
50+
POSTGRES_PASSWORD: openstreetmap
51+
52+
volumes:
53+
postgres-data:

.devcontainer/devcontainer.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// For format details, see https://containers.dev/implementors/json_reference/.
2+
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/ruby
3+
{
4+
"name": "open_street_map",
5+
"dockerComposeFile": "compose.yaml",
6+
"service": "rails-app",
7+
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
8+
9+
// Features to add to the dev container. More info: https://containers.dev/features.
10+
"features": {
11+
"ghcr.io/devcontainers/features/github-cli:1": {},
12+
"ghcr.io/devcontainers/features/node:1": {},
13+
"ghcr.io/rails/devcontainer/features/activestorage": {},
14+
"ghcr.io/rails/devcontainer/features/postgres-client": {}
15+
},
16+
17+
"containerEnv": {
18+
"CAPYBARA_SERVER_PORT": "45678",
19+
"DB_HOST": "postgres"
20+
},
21+
22+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
23+
"forwardPorts": [3000, 5432],
24+
25+
// Configure tool-specific properties.
26+
// "customizations": {},
27+
28+
// Uncomment to connect as root instead. More info: https://containers.dev/implementors/json_reference/#remoteUser.
29+
// "remoteUser": "root",
30+
31+
32+
// Use 'postCreateCommand' to run commands after the container is created.
33+
"postCreateCommand": ".devcontainer/start"
34+
}

.devcontainer/start

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env sh
2+
3+
# This setup uses https://mise.jdx.dev to manage language versions.
4+
# Mark the config file as trusted to avoid an interactive prompt.
5+
mise trust /workspaces/mise.local.toml
6+
7+
cp config/devcontainer.database.yml config/database.yml
8+
cp config/example.storage.yml config/storage.yml
9+
touch config/settings.local.yml
10+
11+
bin/setup --skip-server

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
/Dockerfile*
44
/docker-compose*
55
/.dockerignore
6-
/.travis.yml
76
/.git
87
/.gitignore
98
/.github

.erb_lint.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
linters:
33
AllowedScriptType:
44
enabled: true
5-
# disallow_inline_scripts: true // @todo: fix this.
5+
disallow_inline_scripts: true
6+
HardCodedString:
7+
enabled: false # We're using a custom version of this, see below
8+
# Add our own linter, refs https://github.com/Shopify/erb_lint/pull/397
9+
CustomHardCodedString:
10+
enabled: true
11+
exclude:
12+
- 'app/views/shared/_markdown_help.html.erb'
613
Rubocop:
714
enabled: true
815
rubocop_config:
@@ -26,5 +33,7 @@ linters:
2633
enabled: false
2734
SpaceInHtmlTag:
2835
enabled: true
36+
NoUnusedDisable:
37+
enabled: true
2938
exclude:
3039
- '**/vendor/**'
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# frozen_string_literal: true
2+
3+
require "better_html/tree/tag"
4+
require "active_support/core_ext/string/inflections"
5+
6+
module ERBLint
7+
module Linters
8+
# A customised version of the HardCodedString linter, adding `·` as not needing translation
9+
# Checks for hardcoded strings. Useful if you want to ensure a string can be translated using i18n.
10+
class CustomHardCodedString < HardCodedString
11+
include LinterRegistry
12+
13+
NO_TRANSLATION_NEEDED = Set.new([
14+
"&nbsp;",
15+
"&amp;",
16+
"&lt;",
17+
"&gt;",
18+
"&quot;",
19+
"&copy;",
20+
"&reg;",
21+
"&trade;",
22+
"&hellip;",
23+
"&mdash;",
24+
"&bull;",
25+
"&ldquo;",
26+
"&rdquo;",
27+
"&lsquo;",
28+
"&rsquo;",
29+
"&larr;",
30+
"&rarr;",
31+
"&darr;",
32+
"&uarr;",
33+
"&ensp;",
34+
"&emsp;",
35+
"&thinsp;",
36+
"&times;",
37+
"&laquo;",
38+
"&raquo;",
39+
"&middot;"
40+
])
41+
42+
private
43+
44+
def check_string?(str)
45+
string = str.gsub(/\s*/, "")
46+
string.length > 1 && !NO_TRANSLATION_NEEDED.include?(string)
47+
end
48+
end
49+
end
50+
end

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ contact_links:
44
url: https://wiki.openstreetmap.org/wiki/Website_internationalization#How_to_translate
55
about: Please read about how to use Translatewiki to correct translations
66
- name: There is an issue with the default map layer shown on the front page
7-
url: https://github.com/gravitystorm/openstreetmap-carto
7+
url: https://github.com/openstreetmap-carto/openstreetmap-carto
88
about: Please share your feedback with the OpenStreetMap-Carto team
99
- name: There is an issue with the iD editor used on the Edit tab
1010
url: https://github.com/openstreetmap/iD

0 commit comments

Comments
 (0)