Compare commits

...

3 commits

Author SHA1 Message Date
Justin Lex-Hammarskjöld
3c8e0fdec6
Merge e314579cec into 49d1e7014b 2025-07-15 12:34:52 +02:00
Eugene Burmakin
49d1e7014b Add simple analytics 2025-07-14 21:26:19 +02:00
Justin Lex-Hammarskjöld
e314579cec
Allow using s3 storage when self_hosted 2025-06-26 01:10:52 +02:00
5 changed files with 16 additions and 4 deletions

View file

@ -17,6 +17,9 @@
<%= render 'application/favicon' %> <%= render 'application/favicon' %>
<%= Sentry.get_trace_propagation_meta.html_safe if Sentry.initialized? %> <%= Sentry.get_trace_propagation_meta.html_safe if Sentry.initialized? %>
<% if !DawarichSettings.self_hosted? %>
<script async src="https://scripts.simpleanalyticscdn.com/latest.js"></script>
<% end %>
</head> </head>
<body class='min-h-screen'> <body class='min-h-screen'>

View file

@ -99,5 +99,7 @@ Rails.application.configure do
config.lograge.enabled = true config.lograge.enabled = true
config.lograge.formatter = Lograge::Formatters::Json.new config.lograge.formatter = Lograge::Formatters::Json.new
config.active_storage.service = ENV['SELF_HOSTED'] == 'true' ? :local : :s3 # Store uploaded files either on the local file system or in S3-compatible object storage
# (see config/storage.yml for options).
config.active_storage.service = ENV.fetch('STORAGE_BACKEND', local)
end end

View file

@ -42,8 +42,9 @@ Rails.application.configure do
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
# config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
# Store uploaded files on the local file system (see config/storage.yml for options). # Store uploaded files either on the local file system or in S3-compatible object storage
config.active_storage.service = ENV['SELF_HOSTED'] == 'true' ? :local : :s3 # (see config/storage.yml for options).
config.active_storage.service = ENV.fetch('STORAGE_BACKEND', local)
config.silence_healthcheck_path = '/api/v1/health' config.silence_healthcheck_path = '/api/v1/health'

View file

@ -7,13 +7,14 @@ local:
root: <%= Rails.root.join("storage") %> root: <%= Rails.root.join("storage") %>
# Only load S3 config if not in test environment # Only load S3 config if not in test environment
<% if !Rails.env.test? && ENV['AWS_ACCESS_KEY_ID'] && ENV['AWS_SECRET_ACCESS_KEY'] && ENV['AWS_REGION'] && ENV['AWS_BUCKET'] %> <% if !Rails.env.test? && ENV['AWS_ACCESS_KEY_ID'] && ENV['AWS_SECRET_ACCESS_KEY'] && ENV['AWS_REGION'] && ENV['AWS_BUCKET'] && ENV['AWS_ENDPOINT_URL'] %>
s3: s3:
service: S3 service: S3
access_key_id: <%= ENV.fetch("AWS_ACCESS_KEY_ID") %> access_key_id: <%= ENV.fetch("AWS_ACCESS_KEY_ID") %>
secret_access_key: <%= ENV.fetch("AWS_SECRET_ACCESS_KEY") %> secret_access_key: <%= ENV.fetch("AWS_SECRET_ACCESS_KEY") %>
region: <%= ENV.fetch("AWS_REGION") %> region: <%= ENV.fetch("AWS_REGION") %>
bucket: <%= ENV.fetch("AWS_BUCKET") %> bucket: <%= ENV.fetch("AWS_BUCKET") %>
endpoint: <%= ENV.fetch("AWS_ENDPOINT_URL") %>
<% end %> <% end %>
# Remember not to checkin your GCS keyfile to a repository # Remember not to checkin your GCS keyfile to a repository

View file

@ -160,6 +160,11 @@ spec:
value: photon.komoot.io value: photon.komoot.io
- name: PHOTON_API_USE_HTTPS - name: PHOTON_API_USE_HTTPS
value: "true" value: "true"
# If you have s3-compatible object storage, (e.g. minio or ceph),
# you can set this to "s3" and set the necessary "AWS_" environment variables
# to use s3 storage for imports and exports
- name: STORAGE_BACKEND
value: "local"
image: freikin/dawarich:latest image: freikin/dawarich:latest
imagePullPolicy: Always imagePullPolicy: Always
volumeMounts: volumeMounts: