Basic RemoteStorage settings

This commit is contained in:
galfert 2023-03-22 00:51:33 +01:00
parent 4b17afa93d
commit 20c014607c
Signed by: galfert
GPG Key ID: EED8863A3A607B8D
4 changed files with 35 additions and 0 deletions

View File

@ -18,6 +18,7 @@ DISCOURSE_PUBLIC_URL='https://community.kosmos.org'
GITEA_PUBLIC_URL='https://gitea.kosmos.org' GITEA_PUBLIC_URL='https://gitea.kosmos.org'
MASTODON_PUBLIC_URL='https://kosmos.social' MASTODON_PUBLIC_URL='https://kosmos.social'
MEDIAWIKI_PUBLIC_URL='https://wiki.kosmos.org' MEDIAWIKI_PUBLIC_URL='https://wiki.kosmos.org'
RS_STORAGE_URL='https://storage.kosmos.org'
EJABBERD_ADMIN_URL='https://xmpp.kosmos.org/admin' EJABBERD_ADMIN_URL='https://xmpp.kosmos.org/admin'
EJABBERD_API_URL='https://xmpp.kosmos.org/api' EJABBERD_API_URL='https://xmpp.kosmos.org/api'

View File

@ -90,4 +90,14 @@ class Setting < RailsSettings::Base
# #
field :nostr_enabled, type: :boolean, default: true field :nostr_enabled, type: :boolean, default: true
#
# RemoteStorage
#
field :remotestorage_enabled, type: :boolean,
default: (ENV["RS_STORAGE_URL"].present?.to_s || false)
field :rs_storage_url, type: :string,
default: ENV["RS_STORAGE_URL"].presence
end end

View File

@ -0,0 +1,17 @@
<h3>RemoteStorage</h3>
<ul role="list">
<%= render FormElements::FieldsetToggleComponent.new(
form: f,
attribute: :remotestorage_enabled,
enabled: Setting.remotestorage_enabled?,
title: "Enable RemoteStorage integration",
description: "RemoteStorage configuration present and features enabled"
) %>
<% if Setting.remotestorage_enabled? %>
<%= render FormElements::FieldsetComponent.new(title: "Storage URL") do %>
<%= f.text_field :rs_storage_url,
value: Setting.rs_storage_url,
class: "w-full", disabled: true %>
<% end %>
<% end %>
</ul>

View File

@ -47,3 +47,10 @@
icon: Setting.nostr_enabled? ? "check" : "x", icon: Setting.nostr_enabled? ? "check" : "x",
active: current_page?(admin_settings_services_path(params: { s: "nostr" })), active: current_page?(admin_settings_services_path(params: { s: "nostr" })),
) %> ) %>
<%= render SidenavLinkComponent.new(
level: 2,
name: "RemoteStorage",
path: admin_settings_services_path(params: { s: "remotestorage" }),
icon: Setting.remotestorage_enabled? ? "check" : "x",
active: current_page?(admin_settings_services_path(params: { s: "remotestorage" })),
) %>