Skip to content

Commit f441a3a

Browse files
committed
init
1 parent 3f194f4 commit f441a3a

9 files changed

+377
-1
lines changed

.dockerignore

Whitespace-only changes.

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
authelia/db.sqlite3

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Cartologic
3+
Copyright (c) 2023 Cartologic - Youssef Harby <[email protected]>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

authelia/configuration.yml

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
###############################################################
3+
# Authelia configuration #
4+
###############################################################
5+
6+
# This secret can also be set using the env variables AUTHELIA_JWT_SECRET_FILE
7+
jwt_secret: a_very_important_secret
8+
default_redirection_url: https://app.pygeoapi.local/api
9+
10+
server:
11+
host: 0.0.0.0
12+
port: 9091
13+
14+
log:
15+
level: debug
16+
17+
totp:
18+
issuer: authelia.com
19+
20+
# duo_api:
21+
# hostname: api-123456789.pygeoapi.local
22+
# integration_key: ABCDEF
23+
# # This secret can also be set using the env variables AUTHELIA_DUO_API_SECRET_KEY_FILE
24+
# secret_key: 1234567890abcdefghifjkl
25+
26+
authentication_backend:
27+
file:
28+
path: /config/users_database.yml
29+
30+
access_control:
31+
default_policy: deny
32+
rules:
33+
- domain: "app.pygeoapi.local"
34+
policy: one_factor
35+
resources:
36+
- "^/api/collections/obs.*"
37+
subject:
38+
- "group:cartologic"
39+
40+
- domain: "app.pygeoapi.local"
41+
policy: one_factor
42+
resources:
43+
- "^/api/collections/lakes.*"
44+
subject:
45+
- "group:geobeyond"
46+
47+
- domain: "app.pygeoapi.local"
48+
policy: one_factor
49+
resources:
50+
- "^.*\\/api(?:\\/)?(?:\\?.*)?$"
51+
- "^/api/static/.*"
52+
- "^.*\\/api\\/collections(?:\\?.*)?$"
53+
- "^.*\\/api\\/processes(?:\\?.*)?$"
54+
- "^.*\\/api\\/jobs(?:\\?.*)?$"
55+
- "^.*\\/api\\/openapi(?:\\?.*)?$"
56+
- "^.*\\/api\\/conformance(?:\\?.*)?$"
57+
subject:
58+
- "group:geobeyond"
59+
- "group:cartologic"
60+
61+
session:
62+
name: authelia_session
63+
domain: pygeoapi.local
64+
same_site: lax
65+
secret: unsecure_session_secret
66+
expiration: 1h
67+
inactivity: 5m
68+
remember_me_duration: 5M
69+
70+
redis:
71+
host: redis
72+
port: 6379
73+
74+
regulation:
75+
max_retries: 3
76+
find_time: 120
77+
ban_time: 300
78+
79+
storage:
80+
encryption_key: you_must_generate_a_random_string_of_more_than_twenty_chars_and_configure_this
81+
local:
82+
path: /config/db.sqlite3
83+
84+
notifier:
85+
disable_startup_check: true
86+
filesystem:
87+
filename: /config/notification.txt

authelia/notification.txt

Whitespace-only changes.

authelia/users_database.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
###############################################################
3+
# Users Database #
4+
###############################################################
5+
6+
# This file can be used if you do not have an LDAP set up.
7+
8+
# List of users
9+
users:
10+
yharby:
11+
disabled: false
12+
displayname: "Youssef Harby"
13+
# Password is cartologic
14+
password: "$argon2id$v=19$m=65536,t=3,p=4$TLuRm+ReJ2BQKn6NNFKpFQ$FAGugPprt9yQjcpZEXz4VWJbjrAHN1oTttx93DGvufg" # yamllint disable-line rule:line-length
15+
16+
groups:
17+
- cartologic
18+
19+
francbartoli:
20+
disabled: false
21+
displayname: "Francesco Bartoli"
22+
# Password is francbartoli
23+
password: "$argon2id$v=19$m=65536,t=3,p=4$do0H+Co0ZWfQr5+GkbPjHQ$GIBk6dUegRVm6THxrg7G7wAvgqniqvHhhhhuUKIEet8" # yamllint disable-line rule:line-length
24+
25+
groups:
26+
- geobeyond

caddy/Caddyfile

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## It is important to read the following document before enabling this section:
2+
## https://www.authelia.com/integration/proxies/caddy/#forwarded-header-trust#trusted-proxies
3+
(trusted_proxy_list) {
4+
## Uncomment & adjust the following line to configure specific ranges which should be considered as trustworthy.
5+
# trusted_proxies 10.0.0.0/8 172.16.0.0/16 192.168.0.0/16 fc00::/7
6+
}
7+
8+
# Authelia Portal.
9+
pygeoapi.local {
10+
reverse_proxy authelia:9091 {
11+
## This import needs to be included if you're relying on a trusted proxies configuration.
12+
# import trusted_proxy_list
13+
}
14+
}
15+
16+
# Protected Endpoint.
17+
app.pygeoapi.local {
18+
forward_auth authelia:9091 {
19+
uri /api/verify?rd=https://pygeoapi.local/
20+
copy_headers Remote-User Remote-Groups Remote-Name Remote-Email
21+
22+
## This import needs to be included if you're relying on a trusted proxies configuration.
23+
# import trusted_proxy_list
24+
}
25+
reverse_proxy pygeoapi:80
26+
}

docker-compose.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
version: "3.8"
2+
services:
3+
caddy:
4+
container_name: caddy
5+
image: caddy:2.6.4
6+
restart: unless-stopped
7+
networks:
8+
- caddy
9+
ports:
10+
- 80:80
11+
- 443:443
12+
volumes:
13+
- ./caddy/Caddyfile:/etc/caddy/Caddyfile
14+
15+
authelia:
16+
container_name: authelia
17+
image: authelia/authelia:4.37.5
18+
restart: unless-stopped
19+
networks:
20+
- caddy
21+
expose:
22+
- 9091
23+
ports:
24+
- 9091
25+
volumes:
26+
- ./authelia:/config
27+
depends_on:
28+
- redis
29+
30+
redis:
31+
container_name: redis
32+
image: redis:7.0
33+
restart: unless-stopped
34+
networks:
35+
- caddy
36+
37+
pygeoapi:
38+
container_name: pygeoapi
39+
image: geopython/pygeoapi:latest
40+
volumes:
41+
- ./pygeoapi-config.yml:/pygeoapi/local.config.yml
42+
ports:
43+
- "80"
44+
environment:
45+
- SCRIPT_NAME=/api
46+
depends_on:
47+
- redis
48+
- caddy
49+
- authelia
50+
networks:
51+
- caddy
52+
53+
networks:
54+
caddy:
55+
name: caddy

pygeoapi-config.yml

+181
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
# =================================================================
2+
#
3+
# Authors: Tom Kralidis <[email protected]>
4+
#
5+
# Copyright (c) 2020 Tom Kralidis
6+
#
7+
# Permission is hereby granted, free of charge, to any person
8+
# obtaining a copy of this software and associated documentation
9+
# files (the "Software"), to deal in the Software without
10+
# restriction, including without limitation the rights to use,
11+
# copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
# copies of the Software, and to permit persons to whom the
13+
# Software is furnished to do so, subject to the following
14+
# conditions:
15+
#
16+
# The above copyright notice and this permission notice shall be
17+
# included in all copies or substantial portions of the Software.
18+
#
19+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
21+
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
23+
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
24+
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26+
# OTHER DEALINGS IN THE SOFTWARE.
27+
#
28+
# =================================================================
29+
30+
server:
31+
bind:
32+
host: 0.0.0.0
33+
port: 80
34+
url: https://app.pygeoapi.local/api
35+
mimetype: application/json; charset=UTF-8
36+
encoding: utf-8
37+
gzip: false
38+
languages:
39+
# First language is the default language
40+
- en-US
41+
- fr-CA
42+
# cors: true
43+
pretty_print: true
44+
limit: 10
45+
# templates:
46+
# path: /path/to/Jinja2/templates
47+
# static: /path/to/static/folder # css/js/img
48+
map:
49+
url: https://tile.openstreetmap.org/{z}/{x}/{y}.png
50+
attribution: '&copy; <a href="https://openstreetmap.org/copyright">OpenStreetMap contributors</a>'
51+
# manager:
52+
# name: TinyDB
53+
# connection: /tmp/pygeoapi-process-manager.db
54+
# output_dir: /tmp/
55+
# ogc_schemas_location: /opt/schemas.opengis.net
56+
57+
logging:
58+
level: ERROR
59+
#logfile: /tmp/pygeoapi.log
60+
61+
metadata:
62+
identification:
63+
title:
64+
en: pygeoapi default instance
65+
fr: instance par défaut de pygeoapi
66+
description:
67+
en: pygeoapi provides an API to geospatial data
68+
fr: pygeoapi fournit une API aux données géospatiales
69+
keywords:
70+
en:
71+
- geospatial
72+
- data
73+
- api
74+
fr:
75+
- géospatiale
76+
- données
77+
- api
78+
keywords_type: theme
79+
terms_of_service: https://creativecommons.org/licenses/by/4.0/
80+
url: https://example.org
81+
license:
82+
name: CC-BY 4.0 license
83+
url: https://creativecommons.org/licenses/by/4.0/
84+
provider:
85+
name: Organization Name
86+
url: https://pygeoapi.io
87+
contact:
88+
name: Lastname, Firstname
89+
position: Position Title
90+
address: Mailing Address
91+
city: City
92+
stateorprovince: Administrative Area
93+
postalcode: Zip or Postal Code
94+
country: Country
95+
phone: +xx-xxx-xxx-xxxx
96+
fax: +xx-xxx-xxx-xxxx
97+
98+
url: Contact URL
99+
hours: Mo-Fr 08:00-17:00
100+
instructions: During hours of service. Off on weekends.
101+
role: pointOfContact
102+
103+
resources:
104+
obs:
105+
type: collection
106+
title: Observations
107+
description: My cool observations
108+
keywords:
109+
- observations
110+
- monitoring
111+
context:
112+
- datetime: https://schema.org/DateTime
113+
- vocab: https://example.com/vocab#
114+
stn_id: "vocab:stn_id"
115+
value: "vocab:value"
116+
links:
117+
- type: text/csv
118+
rel: canonical
119+
title: data
120+
href: https://github.com/mapserver/mapserver/blob/branch-7-0/msautotest/wxs/data/obs.csv
121+
hreflang: en-US
122+
- type: text/csv
123+
rel: alternate
124+
title: data
125+
href: https://raw.githubusercontent.com/mapserver/mapserver/branch-7-0/msautotest/wxs/data/obs.csv
126+
hreflang: en-US
127+
extents:
128+
spatial:
129+
bbox: [-180, -90, 180, 90]
130+
crs: http://www.opengis.net/def/crs/OGC/1.3/CRS84
131+
temporal:
132+
begin: 2000-10-30T18:24:39Z
133+
end: 2007-10-30T08:57:29Z
134+
providers:
135+
- type: feature
136+
name: CSV
137+
data: tests/data/obs.csv
138+
id_field: id
139+
geometry:
140+
x_field: long
141+
y_field: lat
142+
143+
lakes:
144+
type: collection
145+
title:
146+
en: Large Lakes
147+
fr: Grands Lacs
148+
description:
149+
en: lakes of the world, public domain
150+
fr: lacs du monde, domaine public
151+
keywords:
152+
en:
153+
- lakes
154+
- water bodies
155+
fr:
156+
- lacs
157+
- plans d'eau
158+
links:
159+
- type: text/html
160+
rel: canonical
161+
title: information
162+
href: http://www.naturalearthdata.com/
163+
hreflang: en-US
164+
extents:
165+
spatial:
166+
bbox: [-180, -90, 180, 90]
167+
crs: http://www.opengis.net/def/crs/OGC/1.3/CRS84
168+
temporal:
169+
begin: 2011-11-11T11:11:11Z
170+
end: null # or empty (either means open ended)
171+
providers:
172+
- type: feature
173+
name: GeoJSON
174+
data: tests/data/ne_110m_lakes.geojson
175+
id_field: id
176+
title_field: name
177+
178+
hello-world:
179+
type: process
180+
processor:
181+
name: HelloWorld

0 commit comments

Comments
 (0)