Commit d7db327e authored by hellekin's avatar hellekin

Remove warnings on incommon lib

- remove `constants.rb` that was integrated to core
- use `require_dependency` instead of `require` to please
  `ActiveSupport::Concern`

These changes make `annotate` and `erd` operational again.
parent 1d3b6ab9
......@@ -7,12 +7,14 @@
require 'digest/sha2'
require 'incommon/version'
require 'incommon/core'
require 'incommon/functions'
require 'incommon/current_user'
require 'incommon/current_agent'
require 'incommon/api'
require 'incommon/cors'
%w(
version
core
functions
current_user
current_agent
api
cors
).each do |dep|
require_dependency "incommon/#{dep}"
end
......@@ -2,9 +2,9 @@
module INCOMMON
module API
require 'incommon/api/errors'
require 'incommon/api/controller'
require 'incommon/api/jsonapi'
require_dependency 'incommon/api/errors'
require_dependency 'incommon/api/controller'
require_dependency 'incommon/api/jsonapi'
attr_accessor :key
......
# frozen_string_literal: true
require 'active_support/concern'
module INCOMMON
module API
module Controller
......
# frozen_string_literal: true
module INCOMMON
# This is the default public read-only API key
#
# You can use it in place of your own for *read-only* access to the IN COMMON
# API:
#
# curl -H 'Accept: application/vnd.api+json' \
# -H 'Token 23d8009f-f2ec-44b6-bcbe-58ad1d3af10b' \
# -X GET https://api.incommon.cc/taxonomies
#
API_KEY_PUBLIC = '23d8009f-f2ec-44b6-bcbe-58ad1d3af10b'
# During +development+, use +api.example.net+.
#
# In +/etc/hosts+, add:
# 127.0.0.1 api.example.net
#
# (Sorry, Rubocop being noisy)
# rubocop:disable Metrics/LineLength
# Then, you can use an Nginx proxy to serve this hostname:
#
# upstream incommon_adm {
# server 127.0.2.1:3000;
# }
#
# upstream incommon_api {
# server 127.0.0.1:3001;
# }
#
# server {
# listen 80;
# server_name adm.example.net *.adm.example.net;
# root /srv/www/adm.incommon.cc;
# index index.html;
#
# access_log /var/log/nginx/adm.incommon.cc_access.log main;
# error_log /var/log/nginx/adm.incommon.cc_errors.log;
#
# try_files $uri $uri/ $uri.html =404;
#
# location / {
# add_header 'Content-Security-Policy' "default-src 'self' http://adm.example.net http://api.example.net https://talk.incommon.cc https://api.incommon.cc" always;
# add_header Referrer-Policy 'strict-origin-when-cross-origin';
#
# if ($request_method = 'OPTIONS') {
# add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With';
# add_header 'Access-Control-Max-Age' 60;
# add_header 'Access-Control-Allow-Origin' "$http_origin";
# add_header 'Access-Control-Allow-Credentials' 'true';
# add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
# add_header 'Content-Type' 'text/plain charset=UTF-8';
# add_header 'Content-Length' 0;
# return 204;
# }
#
# proxy_set_header Host $http_host;
# proxy_intercept_errors off;
# proxy_pass http://incommon_adm;
# }
# }
#
# server {
# listen 80;
# server_name api.example.net;
# # [snip...]
#
# location / {
# # [snip...]
# proxy_pass http://incommon_api;
# }
# }
#
# rubocop:enable Metrics/LineLength
API_ROOT_URL = if rails_in_production?
'https://api.incommon.cc'
else
'https://api.example.net'
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment