mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 11:01:41 +00:00
BREAKING CHANGE: deprecar la api de onion
This commit is contained in:
parent
487765f7d8
commit
0002ed53a9
2 changed files with 0 additions and 27 deletions
|
@ -12,31 +12,6 @@ module Api
|
||||||
render json: sites_names + alternative_names + api_names + www_names
|
render json: sites_names + alternative_names + api_names + www_names
|
||||||
end
|
end
|
||||||
|
|
||||||
# Sitios con hidden service de Tor
|
|
||||||
#
|
|
||||||
# @return [Array] lista de nombres de sitios sin onion aun
|
|
||||||
def hidden_services
|
|
||||||
render json: DeployHiddenService.where(values: nil).includes(:site).pluck(:name)
|
|
||||||
end
|
|
||||||
|
|
||||||
# Tor va a enviar el onion junto con el nombre del sitio y tenemos
|
|
||||||
# que guardarlo en su deploy_hidden_service.
|
|
||||||
#
|
|
||||||
# @params [String] name
|
|
||||||
# @params [String] onion
|
|
||||||
def add_onion
|
|
||||||
site = Site.find_by(name: params[:name])
|
|
||||||
|
|
||||||
if site
|
|
||||||
usuarie = GitAuthor.new email: "tor@#{Site.domain}", name: 'Tor'
|
|
||||||
service = SiteService.new site: site, usuarie: usuarie,
|
|
||||||
params: params
|
|
||||||
service.add_onion
|
|
||||||
end
|
|
||||||
|
|
||||||
head :ok
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def canonicalize(name)
|
def canonicalize(name)
|
||||||
|
|
|
@ -11,8 +11,6 @@ Rails.application.routes.draw do
|
||||||
namespace :v1 do
|
namespace :v1 do
|
||||||
resources :csp_reports, only: %i[create]
|
resources :csp_reports, only: %i[create]
|
||||||
|
|
||||||
get :'sites/hidden_services', to: 'sites#hidden_services'
|
|
||||||
post :'sites/add_onion', to: 'sites#add_onion'
|
|
||||||
resources :sites, only: %i[index], constraints: { site_id: /[a-z0-9\-.]+/, id: /[a-z0-9\-.]+/ } do
|
resources :sites, only: %i[index], constraints: { site_id: /[a-z0-9\-.]+/, id: /[a-z0-9\-.]+/ } do
|
||||||
get :'invitades/cookie', to: 'invitades#cookie'
|
get :'invitades/cookie', to: 'invitades#cookie'
|
||||||
post :'posts/:layout', to: 'posts#create', as: :posts
|
post :'posts/:layout', to: 'posts#create', as: :posts
|
||||||
|
|
Loading…
Reference in a new issue