mirror of
https://github.com/System-End/identity-vault.git
synced 2026-04-19 20:55:11 +00:00
rename to account.hackclub.com
woag!!
This commit is contained in:
parent
fb8017348c
commit
0b8a338902
10 changed files with 32 additions and 14 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Identity Vault
|
||||
# Hack Club Account
|
||||
|
||||
This is the Rails codebase powering https://identity.hackclub.com!
|
||||
This is the Rails codebase powering https://account.hackclub.com!
|
||||
|
||||
## contributing
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ module SAMLService
|
|||
@metadata_xml ||= begin
|
||||
xml = idp_entity.to_xml
|
||||
xml.root.add_child Nokogiri::XML::Comment.new(xml, " haiii :3 ")
|
||||
xml.add_child Nokogiri::XML::Comment.new(xml, " curious thing, aren't you? – https://hack.af/gh/identity-vault , glory awaits")
|
||||
xml.add_child Nokogiri::XML::Comment.new(xml, " curious thing, aren't you? – https://hack.af/gh/account , glory awaits")
|
||||
xml.to_s
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -11,4 +11,4 @@ thank you for being the kind of person who reads documentation.
|
|||
|
||||
these are still WIP, but i'll be adding more content here over time.
|
||||
|
||||
if you want to contribute, please open a PR! they're just [markdown files](https://github.com/hackclub/identity-vault/tree/main/app/views/docs/) :-)
|
||||
if you want to contribute, please open a PR! they're just [markdown files](https://github.com/hackclub/account/tree/main/app/views/docs/) :-)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "IdentityVault",
|
||||
"name": "Hack Club Account",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/icon.png",
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"scope": "/",
|
||||
"description": "IdentityVault.",
|
||||
"description": "hack club account!",
|
||||
"theme_color": "red",
|
||||
"background_color": "red"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
require_relative "boot"
|
||||
require_relative "../lib/middleware/domain_redirect"
|
||||
|
||||
require "rails"
|
||||
# Pick the frameworks you want:
|
||||
|
|
@ -27,7 +28,8 @@ module IdentityVault
|
|||
# Please, add to the `ignore` list any other `lib` subdirectories that do
|
||||
# not contain `.rb` files, or that should not be reloaded or eager loaded.
|
||||
# Common ones are `templates`, `generators`, or `middleware`, for example.
|
||||
config.autoload_lib(ignore: %w[assets tasks])
|
||||
config.autoload_lib(ignore: %w[assets tasks middleware])
|
||||
config.autoload_paths << "#{root}/lib/middleware"
|
||||
|
||||
# Configuration for the application, engines, and railties goes here.
|
||||
#
|
||||
|
|
@ -63,7 +65,7 @@ module IdentityVault
|
|||
httponly: true,
|
||||
same_site: :lax
|
||||
|
||||
config.middleware.use Rack::Attack
|
||||
config.middleware.use DomainRedirect
|
||||
|
||||
config.audits1984.base_controller_class = "Backend::NoAuthController"
|
||||
config.audits1984.auditor_class = "Backend::User"
|
||||
|
|
|
|||
|
|
@ -57,9 +57,9 @@ Rails.application.configure do
|
|||
# config.action_mailer.raise_delivery_errors = false
|
||||
|
||||
# Set host to be used by links generated in mailer templates.
|
||||
config.action_mailer.default_url_options = { host: "identity.hackclub.com" }
|
||||
config.action_mailer.default_url_options = { host: "account.hackclub.com" }
|
||||
|
||||
Rails.application.routes.default_url_options[:host] = "identity.hackclub.com"
|
||||
Rails.application.routes.default_url_options[:host] = "account.hackclub.com"
|
||||
|
||||
# Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit.
|
||||
config.action_mailer.delivery_method = :smtp
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ Rails.application.configure do
|
|||
# config.action_mailer.raise_delivery_errors = false
|
||||
|
||||
# Set host to be used by links generated in mailer templates.
|
||||
config.action_mailer.default_url_options = { host: "identity.hackclub.com" }
|
||||
config.action_mailer.default_url_options = { host: "account.hackclub.com" }
|
||||
|
||||
# Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit.
|
||||
config.action_mailer.delivery_method = :smtp
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Get the first 6 characters of the current git commit hash
|
||||
git_hash = ENV["SOURCE_COMMIT"] || `git rev-parse HEAD` rescue "unknown"
|
||||
|
||||
commit_link = git_hash != "unknown" ? "https://github.com/hackclub/identity-vault/commit/#{git_hash}" : nil
|
||||
commit_link = git_hash != "unknown" ? "https://github.com/hackclub/account/commit/#{git_hash}" : nil
|
||||
|
||||
short_hash = git_hash[0..7]
|
||||
|
||||
|
|
|
|||
|
|
@ -159,9 +159,9 @@ uat:
|
|||
allow_unsigned_requests: true
|
||||
production:
|
||||
idp_metadata:
|
||||
entity_id: https://identity.hackclub.com
|
||||
entity_id: https://account.hackclub.com
|
||||
single_sign_on_services:
|
||||
- location: https://identity.hackclub.com/saml/auth
|
||||
- location: https://account.hackclub.com/saml/auth
|
||||
binding: urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST
|
||||
service_providers:
|
||||
- slug: slack
|
||||
|
|
|
|||
16
lib/middleware/domain_redirect.rb
Normal file
16
lib/middleware/domain_redirect.rb
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
class DomainRedirect
|
||||
def initialize(app)
|
||||
@app = app
|
||||
end
|
||||
|
||||
def call(env)
|
||||
request = Rack::Request.new(env)
|
||||
|
||||
if request.path.start_with?('/api') || request.host == 'account.hackclub.com'
|
||||
return @app.call(env)
|
||||
end
|
||||
|
||||
# Redirect to account.hackclub.com
|
||||
[301, { 'Location' => "https://account.hackclub.com#{request.fullpath}", 'Content-Type' => 'text/html' }, []]
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Reference in a new issue