#
include_recipe "apache"
+include_recipe "podman"
-apache_module "rewrite"
+docker_external_port = 8094
-directory "/srv/trac.openstreetmap.org" do
- owner "root"
- group "root"
- mode "0755"
-end
-
-cookbook_file "/srv/trac.openstreetmap.org/tickets.map" do
- owner "root"
- group "root"
- mode "0644"
+podman_service "trac.openstreetmap.org" do
+ description "Container service for trac.openstreetmap.org"
+ image "ghcr.io/openstreetmap/trac-website:latest"
+ ports docker_external_port => "8080"
end
ssl_certificate "trac.openstreetmap.org" do
notifies :reload, "service[apache2]"
end
+apache_module "proxy_http"
+
apache_site "trac.openstreetmap.org" do
template "apache.erb"
- variables :user => "trac", :group => "trac", :aliases => ["trac.osm.org"]
+ variables :docker_external_port => docker_external_port, :aliases => ["trac.osm.org"]
end
<% end -%>
ServerAdmin webmaster@openstreetmap.org
+ CustomLog /var/log/apache2/<%= @name %>-access.log combined
+ ErrorLog /var/log/apache2/<%= @name %>-error.log
+
SSLEngine on
SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem
SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key
- CustomLog /var/log/apache2/<%= @name %>-access.log combined
- ErrorLog /var/log/apache2/<%= @name %>-error.log
-
RedirectPermanent / https://<%= @name %>/
</VirtualHost>
<% end -%>
ServerName <%= @name %>
ServerAdmin webmaster@openstreetmap.org
+ CustomLog /var/log/apache2/<%= @name %>-access.log combined
+ ErrorLog /var/log/apache2/<%= @name %>-error.log
+
SSLEngine on
SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem
SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key
- CustomLog /var/log/apache2/<%= @name %>-access.log combined
- ErrorLog /var/log/apache2/<%= @name %>-error.log
+ RequestHeader set X-Forwarded-Proto "https"
+ RequestHeader set X-Forwarded-Port "443"
- RewriteEngine on
- RewriteMap tickets txt:/srv/trac.openstreetmap.org/tickets.map
- RewriteRule ^/ticket/(\d+)$ https://github.com/openstreetmap/trac-tickets/issues/${tickets:$1}
- RewriteRule ^/?(.*) https://github.com/openstreetmap/trac-tickets [QSD,L,R=permanent]
+ ProxyPass / http://localhost:<%= @docker_external_port %>/
+ ProxyPreserveHost on
</VirtualHost>