Serve cgit with uwsgi's routing - cgi

I'm trying to serve cgit using uwsgi's routing, but I keep getting 500 responses.
My ini file:
[uwsgi]
http-socket = 127.0.0.1:8000
plugins = cgi
plugins-dir = /usr/lib/uwsgi/
threads = 20
route = ^/(.*) log:someone called ${PATH_INFO}
route = /(.*) cgi:/usr/share/webapps/cgit/cgit.cgi
#cgi = /=/usr/share/webapps/cgit/cgit.cgi
#cgi = info/refs=/usr/libexec/git-core/git-http-backend
#check-static = /usr/share/webapps/cgit
master = true
http-socket-modifier1 = 9
manage-script-name = true

Related

Gitlab External Https Url is not working anymore

I am having a problem with GitLab server external URL
here is what I did :
I changed my GitLab.rb conf
external_url 'https://gitlab.tools.ex.com/'
and here is what I'm using
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.gmail.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "gitlab"
gitlab_rails['smtp_password'] = "XXXXX"
gitlab_rails['smtp_domain'] = "ex.com"
gitlab_rails['smtp_authentication'] = "gitlab#ex.com"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false
gitlab_rails['smtp_openssl_verify_mode'] = 'none' # Can be: 'none', 'peer', 'client_once', 'fail_if_no_peer_cert', see http://api.rubyon$
gitlab_rails['smtp_ca_path'] = "/etc/ssl/certs"
gitlab_rails['smtp_ca_file'] = "/etc/ssl/certs/ca-certificates.crt"
first problem was a certificate problem :
ssl problem
after generating a certificate here is what I'm getting :
after generating
thanks in advance !

Jetty Service behind Traefik

I have a software package from a vendor that uses Jetty to provide web services. When I put Traefik infront of it and access the frontend I get redirected to the backend URL. For example the frontend URL is https://program.example.com/ and the backend (software) URL is http://192.168.1.1:8088/ when I browse to https://program.example.com/ i automatically get redirected to http://192.168.1.1:8088/. Thoughts?
[backends.sample]
[backends.sample.servers.sample]
url = "http://192.168.1.1:8088/"
[frontends.sample]
backend = "sample"
[frontends.sample.routes.sample]
rule = "Host:program.sample.com"
passHostHeader = true
useXForwardedFor = true
[frontends.sample.redirect]
entryPoint = "https"
permanent = true
I figured it out.
I had 'passHostHeader' in the wrong place.
[frontends.sample]
backend = "sample"
passHostHeader = true
[frontends.sample.routes.sample]
rule = "Host:program.sample.com"
useXForwardedFor = true
[frontends.sample.redirect]
entryPoint = "https"
permanent = true

Traefik frontend redirects doesn't work

Hey i am trying catch all request to an Subdomain, with no matching rool and redirect them to https://localhost:8000 without subdomain and suburl. But there is no redirect, i just get the response from the backend.
[file]
[frontends]
[frontends.homeRedirect]
entryPoints = ["https"]
priority = 1
backend = "homeRedirect"
[frontends.homeRedirect.routes.everything]
rule = "PathPrefix:/"
[frontends.homeRedirect.headers]
SSLRedirect = true
[frontends.homeRedirect.redirect]
regex = "(.*)"
replacement = "https://localhost:8000"
[backends]
[backends.homeRedirect]
[backends.homeRedirect.servers]
[backends.homeRedirect.servers.server0]
url = "http://frontend:80"
Is there something wrong with my file?
In this case, a redirect on the entry point is more appropriate:
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
regex = "^http://subdomain.mydomain/(.*)"
replacement = "http://myotherdomain/$1"
https://docs.traefik.io/v1.5/configuration/entrypoints/#rewriting-url
localhost inside the Traefik container is the container not the real machine.

Traefik blue green deployment. Initialize web provider

I'm starting using traefik for blue/green deployment. I would like to use the REST API, so I have to put my configuration in the [web] section:
[web]
address = ":8080"
readOnly = false
[backends]
[backends.back]
[backends.back.loadbalancer.stickiness]
cookieName = "backend"
[backends.back.servers.S000]
url = "http://HOST_IP_ADDRESS:30000"
weight = 1
[backends.back.servers.S001]
url = "http://HOST_IP_ADDRESS:30001"
weight = 1
[frontends]
[frontends.front]
backend = "back"
passHostHeader = true
But it's not initialized with those values. However if I use PUT to http://localhost:8091/api/providers/web I can see the web provider OK. And if I use this same configuration for [file] it works right (but I'm unable to update it via API)
Is there any web to initialize [web] backends/frontends?
web section is deprecated.
try this:
# Enable API and dashboard
[api]
# Name of the related entry point
entryPoint = "traefik"
# Enabled Dashboard
dashboard = true

Speeding up Rails 3.2.1 Development Environment

I'm running a rather large project in Development and its just too slow. I believe the reason is because on each request Rails reloads every class. This project literally has hundreds of classes so the response time is too slow.
How can I speed up my development environment?
I'm running Apache server, the latest version of Passenger, RVM ruby 1.9.2-p180 (which I'm more or less locked into the ruby version).
development.rb:
# (Development-only) what is our localhost called?
LOCALDOMAIN = File.read("/etc/context_dev_host").strip
# Don't verify SSL connections.
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
SMSAdmin::Application.configure do
config.cache_classes = false # reload on every request
config.whiny_nils = true # Log error messages when you accidentally call methods on nil.
config.consider_all_requests_local = true # Show full error reports and disable caching
config.action_controller.perform_caching = false # Show full error reports and disable caching
config.action_mailer.raise_delivery_errors = false # Don't care if the mailer can't send
config.action_mailer.default_url_options = { :host => "#{APP_HOSTNAME}" } # default url_for :host
config.action_mailer.raise_delivery_errors = false
# Distributed Assets will expect an asset host for path resolution:
config.action_controller.asset_host = Proc.new do |source, request|
ssl = request && request.ssl?
hash = false
subd = true
host = ( hash ? "a#{source.hash % 4}." : "" ) + ( subd && request && request.host || APP_HOSTNAME )
( ssl ? "https://" : "http://" ) + host
end
ActionMailer::Base.delivery_method = :sendmail
config.after_initialize do
# Custom developer files (generally to support Rake tasks, where we don't have a request to determine the FB API Key)
dh = File.read("/etc/context_dev_host").strip.split(".").first
df = File.expand_path("../#{dh}.rb", __FILE__)
if File.exists?(df) then
silence_warnings do
require(df)
end
end
end
# Do not compress assets
config.assets.compress = false
# Expands the lines which load the assets
config.assets.debug = false
config.assets.digest = false
# Raise exception on mass assignment protection for Active Record models
config.active_record.mass_assignment_sanitizer = :strict
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
config.active_record.auto_explain_threshold_in_seconds = 0.5
end