diff --git a/.env.example b/.env.example index b667033..e8dc0f3 100644 --- a/.env.example +++ b/.env.example @@ -18,6 +18,7 @@ DISCOURSE_PUBLIC_URL='https://community.kosmos.org' GITEA_PUBLIC_URL='https://gitea.kosmos.org' MASTODON_PUBLIC_URL='https://kosmos.social' MEDIAWIKI_PUBLIC_URL='https://wiki.kosmos.org' +RS_STORAGE_URL='https://storage.kosmos.org' EJABBERD_ADMIN_URL='https://xmpp.kosmos.org/admin' EJABBERD_API_URL='https://xmpp.kosmos.org/api' diff --git a/app/models/setting.rb b/app/models/setting.rb index 56aa785..3a7e8c5 100644 --- a/app/models/setting.rb +++ b/app/models/setting.rb @@ -90,4 +90,14 @@ class Setting < RailsSettings::Base # 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 diff --git a/app/views/admin/settings/services/_remotestorage.html.erb b/app/views/admin/settings/services/_remotestorage.html.erb new file mode 100644 index 0000000..fdfa3f4 --- /dev/null +++ b/app/views/admin/settings/services/_remotestorage.html.erb @@ -0,0 +1,17 @@ +

RemoteStorage

+ diff --git a/app/views/shared/_admin_sidenav_settings_services.html.erb b/app/views/shared/_admin_sidenav_settings_services.html.erb index c897b6d..142f6fc 100644 --- a/app/views/shared/_admin_sidenav_settings_services.html.erb +++ b/app/views/shared/_admin_sidenav_settings_services.html.erb @@ -47,3 +47,10 @@ icon: Setting.nostr_enabled? ? "check" : "x", 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" })), +) %>