Skip to content

Commit

Permalink
Serve GTFS files from new server
Browse files Browse the repository at this point in the history
  • Loading branch information
jbruechert committed Feb 2, 2025
1 parent cbcb290 commit 6bbb5dd
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
wget https://routing.spline.de/gtfs/license.json -O website/data/license.json
wget https://api.transitous.org/gtfs/license.json -O website/data/license.json
cd website && npm run release
- name: Upload artifact
Expand Down
12 changes: 12 additions & 0 deletions ansible/roles/gtfs-server/files/gtfs.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SPDX-FileCopyrightText: 2025 Jonah Brüchert <jbb@kaidan.im>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

server {
listen 80;

location / {
root /var/cache/transitous/out/;
autoindex on;
}
}
29 changes: 29 additions & 0 deletions ansible/roles/gtfs-server/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# SPDX-FileCopyrightText: 2025 Jonah Brüchert <jbb@kaidan.im>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- name: Install nginx
apt:
name:
- nginx

- name: Install nginx site
copy:
src: gtfs.conf
dest: /etc/nginx/sites-available/

- name: Disable default site configuration
file:
path: /etc/nginx/sites-enabled/default
state: absent

- name: Enable nginx sites
file:
src: "/etc/nginx/sites-available/gtfs.conf"
dest: "/etc/nginx/sites-enabled/gtfs.conf"
state: link

- name: Reload nginx
systemd:
name: nginx.service
state: reloaded
2 changes: 1 addition & 1 deletion ansible/roles/nginx/templates/transitous.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,6 @@ server {

# Source files
location /gtfs/ {
return 301 https://routing-import.spline.de$request_uri;
proxy_pass http://crunchy:80/;
}
}
1 change: 1 addition & 0 deletions ansible/woodpecker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
hosts: crunchy
roles:
- woodpecker-agent
- gtfs-server
2 changes: 1 addition & 1 deletion website/layouts/shortcodes/source-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ <h3>{{ .human_name }}</h3>
{{ end }}

<a class="btn btn-outline-secondary" href="{{ $source.source }}">Original File</a>
<a class="btn btn-outline-secondary" href="https://routing.spline.de/gtfs/{{ $source.filename }}">Processed File</a>
<a class="btn btn-outline-secondary" href="https://api.transitous.org/gtfs/{{ $source.filename }}">Processed File</a>

{{ if or $source.rt_source }}
<p class="mt-3 fs-6">
Expand Down

0 comments on commit 6bbb5dd

Please sign in to comment.