source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | piotrmurach/strings-case | https://github.com/piotrmurach/strings-case | tasks/console.rake | Ruby | mit | 97 | master | 252 | # frozen_string_literal: true
desc "Load gem inside IRB console"
task :console do
require "irb"
require "irb/completion"
require_relative "../lib/strings-case"
ARGV.clear
IRB.start
end
desc "Alias for the :console task"
task c: %w[console] |
github | samrayner/jekyll-asset-path-plugin | https://github.com/samrayner/jekyll-asset-path-plugin | asset_path_tag.rb | Ruby | mit | 97 | master | 3,874 | # frozen_string_literal: true
# rubocop: disable Metrics/LineLength
# Title: Asset path tag for Jekyll
# Authors:
# Sam Rayner http://samrayner.com
# Otto Urpelainen http://koti.kapsi.fi/oturpe/projects/
#
# Description: Output a relative URL for assets based on the post or page
#
# Syntax
# {% asset_path ... |
github | Arie/serveme | https://github.com/Arie/serveme | Capfile | Ruby | apache-2.0 | 97 | master | 680 | # Load DSL and set up stages
require 'capistrano/setup'
# Include default deployment tasks
require 'capistrano/deploy'
require 'capistrano/scm/git'
install_plugin Capistrano::SCM::Git
require 'capistrano/maintenance'
require 'capistrano/rvm'
require 'capistrano/bundler'
require 'capistrano/rails'
require 'capistran... |
github | Arie/serveme | https://github.com/Arie/serveme | Gemfile | Ruby | apache-2.0 | 97 | master | 3,253 | # frozen_string_literal: true
source "https://rubygems.org"
gem "actionpack-action_caching"
gem "american_date"
gem "aws-sigv4"
gem "aws-sdk-core", require: false
gem "aws-sdk-s3", require: false
gem "bcrypt_pbkdf"
gem "bootsnap", require: false
gem "bootstrap"
gem "carrierwave"
gem "cgi"
gem "connection_pool", "< 3"... |
github | Arie/serveme | https://github.com/Arie/serveme | Rakefile | Ruby | apache-2.0 | 97 | master | 272 | #!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
Serveme::Application.load_tasks |
github | Arie/serveme | https://github.com/Arie/serveme | config/environment.rb | Ruby | apache-2.0 | 97 | master | 221 | # typed: false
# frozen_string_literal: true
require "opentelemetry/sdk"
# Load the rails application
require File.expand_path("application", __dir__)
# Initialize the rails application
Serveme::Application.initialize! |
github | Arie/serveme | https://github.com/Arie/serveme | config/routes.rb | Ruby | apache-2.0 | 97 | master | 10,511 | # typed: false
# frozen_string_literal: true
require "sidekiq/web"
require "sidekiq/cron/web"
# rubocop:disable Metrics/BlockLength
Serveme::Application.routes.draw do
get "/404", to: "pages#not_found"
get "/500", to: "pages#error"
devise_for :users, controllers: { omniauth_callbacks: "sessions" }
devise_sc... |
github | Arie/serveme | https://github.com/Arie/serveme | config/importmap.rb | Ruby | apache-2.0 | 97 | master | 756 | # typed: false
# frozen_string_literal: true
# Pin npm packages by running ./bin/importmap
pin "application", preload: true
pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true
pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload... |
github | Arie/serveme | https://github.com/Arie/serveme | config/application.rb | Ruby | apache-2.0 | 97 | master | 3,287 | # typed: false
# frozen_string_literal: true
require File.expand_path("boot", __dir__)
%w[
active_record/railtie
action_controller/railtie
action_view/railtie
action_mailer/railtie
active_job/railtie
action_cable/engine
action_text/engine
rails/test_unit/railtie
].each do |railtie|
require railtie
e... |
github | Arie/serveme | https://github.com/Arie/serveme | config/deploy.rb | Ruby | apache-2.0 | 97 | master | 2,510 | # typed: false
# frozen_string_literal: true
require "./config/deploy/logdaemon"
set :application, "serveme"
set :repo_url, "https://github.com/Arie/serveme.git"
set :deploy_to, "/var/www/serveme"
set :copy_compression, :gzip
set :use_sudo, false
set :user, "tf2"
set :rvm... |
github | Arie/serveme | https://github.com/Arie/serveme | config/boot.rb | Ruby | apache-2.0 | 97 | master | 283 | # typed: strict
# frozen_string_literal: true
require "rubygems"
# Set up gems listed in the Gemfile.
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
require "sorbet-runtime"
require "bootsnap/setup" |
github | Arie/serveme | https://github.com/Arie/serveme | config/deploy/logdaemon.rb | Ruby | apache-2.0 | 97 | master | 4,532 | # typed: false
# frozen_string_literal: true
namespace :logdaemon do
define_method(:logdaemon_service_name) do
"serveme_logdaemon_#{fetch(:stage)}"
end
define_method(:logdaemon_socket_name) do
"#{logdaemon_service_name}.socket"
end
define_method(:logdaemon_host) do
# systemd ListenDatagram requ... |
github | Arie/serveme | https://github.com/Arie/serveme | config/deploy/au.rb | Ruby | apache-2.0 | 97 | master | 341 | # typed: false
# frozen_string_literal: true
set :main_server, "direct.au.serveme.tf"
set :user, "tf2"
set :puma_threads, [ 0, 8 ]
set :puma_workers, 1
set :sidekiq_processes, 1
set :rvm_type, :user
set :puma_phased_restart, false
server "direct.au.serveme.tf", user: "tf2", r... |
github | Arie/serveme | https://github.com/Arie/serveme | config/deploy/na.rb | Ruby | apache-2.0 | 97 | master | 310 | # typed: false
# frozen_string_literal: true
set :main_server, "direct.na.serveme.tf"
set :user, "arie"
set :puma_threads, [ 0, 8 ]
set :puma_workers, 2
set :sidekiq_processes, 2
set :rvm_type, :user
server "direct.na.serveme.tf", user: "arie", roles: %w[web app db] |
github | Arie/serveme | https://github.com/Arie/serveme | config/deploy/sea.rb | Ruby | apache-2.0 | 97 | master | 329 | # typed: false
# frozen_string_literal: true
set :main_server, "139.99.42.241"
set :user, "arie"
set :puma_threads, [ 1, 4 ]
set :puma_workers, 1
set :sidekiq_processes, 1
set :rvm_type, :user
set :puma_phased_restart, false
server "139.99.42.241", user: "arie", roles: %w[web... |
github | Arie/serveme | https://github.com/Arie/serveme | config/deploy/eu.rb | Ruby | apache-2.0 | 97 | master | 267 | # typed: false
# frozen_string_literal: true
set :main_server, "new.fakkelbrigade.eu"
set :puma_threads, [ 0, 8 ]
set :puma_workers, 2
set :sidekiq_processes, 2
set :rvm_type, :user
server "new.fakkelbrigade.eu", user: "tf2", roles: %w[web app db] |
github | Arie/serveme | https://github.com/Arie/serveme | config/environments/production.rb | Ruby | apache-2.0 | 97 | master | 2,385 | # typed: strict
# frozen_string_literal: true
Serveme::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_a... |
github | Arie/serveme | https://github.com/Arie/serveme | config/environments/development.rb | Ruby | apache-2.0 | 97 | master | 1,481 | # typed: strict
# frozen_string_literal: true
Serveme::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development... |
github | Arie/serveme | https://github.com/Arie/serveme | config/environments/test.rb | Ruby | apache-2.0 | 97 | master | 1,602 | # typed: strict
# frozen_string_literal: true
Serveme::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your t... |
github | Arie/serveme | https://github.com/Arie/serveme | config/initializers/log_formatting.rb | Ruby | apache-2.0 | 97 | master | 669 | # typed: true
# frozen_string_literal: true
require "English"
module ActiveSupport
class Logger
class SimpleFormatter
SEVERITY_TO_COLOR_MAP = { "DEBUG" => "0;37", "INFO" => "32", "WARN" => "33", "ERROR" => "31", "FATAL" => "31", "UNKNOWN" => "37" }.freeze
def call(severity, time, _progname, msg)
... |
github | Arie/serveme | https://github.com/Arie/serveme | config/initializers/mime_types.rb | Ruby | apache-2.0 | 97 | master | 252 | # typed: strict
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone |
github | Arie/serveme | https://github.com/Arie/serveme | config/initializers/geocoder.rb | Ruby | apache-2.0 | 97 | master | 2,162 | # typed: false
# frozen_string_literal: true
if Rails.env.test?
Geocoder.configure(
ip_lookup: :maxmind_local
)
else
Geocoder.configure(
ip_lookup: :geoip2,
cache: Rails.cache,
geoip2: {
lib: "hive_geoip2",
file: File.join(Rails.root, "doc", "GeoLite2-City.mmdb")
}
)
end
Geocode... |
github | Arie/serveme | https://github.com/Arie/serveme | config/initializers/timezone_renames.rb | Ruby | apache-2.0 | 97 | master | 1,228 | # typed: false
# frozen_string_literal: true
# Fix for IANA timezone renames that Rails' MAPPING doesn't handle
# See: https://github.com/rails/rails/issues/44273
# See: https://github.com/rails/rails/pull/51703
#
# On Debian Trixie and other modern systems, the old timezone names (Europe/Kiev,
# America/Godthab, Asia... |
github | Arie/serveme | https://github.com/Arie/serveme | config/initializers/omni_auth.rb | Ruby | apache-2.0 | 97 | master | 1,111 | # typed: false
# frozen_string_literal: true
if Rails.env.development?
OmniAuth.config.request_validation_phase = nil
OmniAuth.config.silence_get_warning = true
end
Rails.application.config.middleware.use OmniAuth::Builder do
provider :steam, Rails.application.credentials.dig(:steam, :api_key)
end
require "ope... |
github | Arie/serveme | https://github.com/Arie/serveme | config/initializers/lograge.rb | Ruby | apache-2.0 | 97 | master | 361 | # typed: false
# frozen_string_literal: true
module LogrageControllerOverride
def append_info_to_payload(payload)
super
payload[:ip] = request.remote_ip
payload[:user_id] = current_user.try(:id)
end
end
# should probably do this only if Rails.env is production
ActionController::Base.prepend LogrageCon... |
github | Arie/serveme | https://github.com/Arie/serveme | config/initializers/allowed_commands.rb | Ruby | apache-2.0 | 97 | master | 53,508 | # typed: true
# config/initializers/allowed_commands.rb
# Generated by rake commands:discover on 2025-04-18 18:59:24 UTC
# Commands discovered from: elzas.fakkelbrigade.eu:27205 (using iterative find)
ALLOWED_SERVER_COMMANDS = Set.new(%w[
1v1
2v2
BindToggle
PerfMark
Test_CreateEntity
Test_EHandle
Test_I... |
github | Arie/serveme | https://github.com/Arie/serveme | config/initializers/devise.rb | Ruby | apache-2.0 | 97 | master | 11,314 | # typed: strict
# frozen_string_literal: true
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
# ==> Mailer Configuration
# Configure the e-mail address which will be shown in Devise::Mailer,
#... |
github | Arie/serveme | https://github.com/Arie/serveme | config/initializers/sentry.rb | Ruby | apache-2.0 | 97 | master | 477 | # typed: strict
# frozen_string_literal: true
Sentry.init do |config|
config.breadcrumbs_logger = [ :active_support_logger ]
config.sdk_logger.level = ::Logger::WARN
config.dsn = Rails.application.credentials.dig(:sentry, :dsn)
config.excluded_exceptions += [ "ActionController::RoutingError", "ActiveRecord::Re... |
github | Arie/serveme | https://github.com/Arie/serveme | config/initializers/assets.rb | Ruby | apache-2.0 | 97 | master | 388 | # typed: strict
# frozen_string_literal: true
# Explicitly register the extensions we are interested in compiling
Rails.application.config.assets.precompile << [
"*.html", "*.erb", "*.haml",
"*.css", "*.sass",
"*.png", "*.gif", ".jpg", ".jpeg",
"*.eot", "*.otf", "*.svc", "*.woff", ".woff2", ".ttf"
]
Rails.app... |
github | Arie/serveme | https://github.com/Arie/serveme | config/initializers/session_store.rb | Ruby | apache-2.0 | 97 | master | 228 | # typed: strict
# frozen_string_literal: true
session_key = "_serveme_sessions#{ENV['SESSION_KEY_SUFFIX']}"
Serveme::Application.config.session_store ActionDispatch::Session::CacheStore, key: session_key, expire_after: 1.month |
github | Arie/serveme | https://github.com/Arie/serveme | config/initializers/opentelemetry.rb | Ruby | apache-2.0 | 97 | master | 494 | # typed: strict
# frozen_string_literal: true
if [ "serveme.tf", "na.serveme.tf", "sea.serveme.tf", "au.serveme.tf" ].include?(SITE_HOST)
ENV["OTEL_EXPORTER"] = "otlp"
ENV["OTEL_SERVICE_NAME"] = SITE_HOST
ENV["OTEL_EXPORTER_OTLP_ENDPOINT"] = "http://localhost:4318"
OpenTelemetry::SDK.configure do |c|
c.us... |
github | Arie/serveme | https://github.com/Arie/serveme | config/initializers/simple_form.rb | Ruby | apache-2.0 | 97 | master | 7,176 | # typed: strict
# frozen_string_literal: true
#
# Uncomment this and change the path if necessary to include your own
# components.
# See https://github.com/plataformatec/simple_form#custom-components to know
# more about custom components.
# Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f }
#
# Us... |
github | Arie/serveme | https://github.com/Arie/serveme | config/initializers/paypal.rb | Ruby | apache-2.0 | 97 | master | 1,620 | # typed: strict
# frozen_string_literal: true
if SITE_HOST == "sea.serveme.tf"
PayPal::SDK::Core::Config.load("config/paypal.yml", "sea_production")
else
PayPal::SDK::Core::Config.load("config/paypal.yml", Rails.env)
end
PayPal::SDK.logger.level = Logger::WARN if Rails.env.test?
PayPal::SDK.configure do |config|
... |
github | Arie/serveme | https://github.com/Arie/serveme | config/initializers/steam_condenser.rb | Ruby | apache-2.0 | 97 | master | 212 | # typed: false
# frozen_string_literal: true
if Rails.application.credentials.dig(:steam, :api_key).present?
SteamCondenser::Community::WebApi.api_key = Rails.application.credentials.dig(:steam, :api_key)
end |
github | Arie/serveme | https://github.com/Arie/serveme | config/initializers/secret_token.rb | Ruby | apache-2.0 | 97 | master | 465 | # typed: strict
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular... |
github | Arie/serveme | https://github.com/Arie/serveme | config/initializers/rswag.rb | Ruby | apache-2.0 | 97 | master | 232 | # typed: strict
# frozen_string_literal: true
Rswag::Ui.configure do |c|
c.openapi_endpoint "/api-docs/v1/swagger.yaml", "serveme.tf API V1"
end
Rswag::Api.configure do |c|
c.openapi_root = Rails.root.join("swagger").to_s
end |
github | Arie/serveme | https://github.com/Arie/serveme | config/initializers/rack_attack.rb | Ruby | apache-2.0 | 97 | master | 327 | # typed: strict
# frozen_string_literal: true
module Rack
class Attack
unless Rails.env.test? || Rails.env.development?
safelist("server-monitoring") do |req|
req.path.start_with?("/server-monitoring") && req.post?
end
throttle("req/ip", limit: 300, period: 5.minutes, &:ip)
end
e... |
github | Arie/serveme | https://github.com/Arie/serveme | config/initializers/backtrace_silencers.rb | Ruby | apache-2.0 | 97 | master | 451 | # typed: strict
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all ... |
github | Arie/serveme | https://github.com/Arie/serveme | config/initializers/simple_form_bootstrap.rb | Ruby | apache-2.0 | 97 | master | 20,118 | # typed: strict
# frozen_string_literal: true
# Please do not make direct changes to this file!
# This generator is maintained by the community around simple_form-bootstrap:
# https://github.com/rafaelfranca/simple_form-bootstrap
# All future development, tests, and organization should happen there.
# Background histo... |
github | Arie/serveme | https://github.com/Arie/serveme | config/initializers/sidekiq.rb | Ruby | apache-2.0 | 97 | master | 200 | # typed: strict
# frozen_string_literal: true
schedule_file = "config/schedule.yml"
Sidekiq::Cron::Job.load_from_hash! YAML.load_file(schedule_file) if File.exist?(schedule_file) && Sidekiq.server? |
github | Arie/serveme | https://github.com/Arie/serveme | config/initializers/stripe.rb | Ruby | apache-2.0 | 97 | master | 521 | # typed: true
# frozen_string_literal: true
if SITE_HOST == "sea.serveme.tf"
Stripe.api_key = Rails.application.credentials.dig(:stripe, :sea_api_key)
STRIPE_PUBLISHABLE_KEY = Rails.application.credentials.dig(:stripe, :sea_publishable_key)
else
Stripe.api_key = Rails.application.credentials.dig(:stripe, :api_ke... |
github | Arie/serveme | https://github.com/Arie/serveme | config/initializers/maxmind_asn.rb | Ruby | apache-2.0 | 97 | master | 407 | # typed: strict
# frozen_string_literal: true
require "maxmind/geoip2"
$maxmind_asn = if Rails.env.test?
MaxMind::GeoIP2::Reader.new(
database: Rails.root.join("doc", "GeoLite2-ASN-Test.mmdb").to_s
)
else
MaxMind::GeoIP2::Reader.new(
... |
github | Arie/serveme | https://github.com/Arie/serveme | config/initializers/inflections.rb | Ruby | apache-2.0 | 97 | master | 580 | # typed: strict
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^... |
github | Arie/serveme | https://github.com/Arie/serveme | features/step_definitions/statistics.rb | Ruby | apache-2.0 | 97 | master | 220 | # typed: false
# frozen_string_literal: true
When 'I go view the statistics' do
visit statistics_pages_path
end
Then 'I can see the most active users' do
page.should have_content Reservation.last.user.nickname
end |
github | Arie/serveme | https://github.com/Arie/serveme | features/step_definitions/buying.rb | Ruby | apache-2.0 | 97 | master | 2,624 | # typed: false
# frozen_string_literal: true
When 'I buy 1 month worth of donator status' do
step 'I go to donate'
select '1 month - 1 EUR'
step 'I click the buy button'
end
When 'I buy 1 month worth of donator status with Stripe' do
step 'I go to donate'
click_button 'Credit Card'
fill_in 'card-number', ... |
github | Arie/serveme | https://github.com/Arie/serveme | features/step_definitions/finding_servers.rb | Ruby | apache-2.0 | 97 | master | 1,493 | # typed: false
# frozen_string_literal: true
When 'I enter a date and time on which there is a server available' do
create :reservation, starts_at: 3.hours.from_now, ends_at: 5.hours.from_now
fill_in 'reservation_starts_at', with: I18n.l(1.hours.from_now, format: :datepicker)
fill_in 'reservation_ends_at', ... |
github | Arie/serveme | https://github.com/Arie/serveme | features/step_definitions/welcome.rb | Ruby | apache-2.0 | 97 | master | 890 | # typed: false
# frozen_string_literal: true
When(/^I go to the welcome page$/) do
visit '/'
end
Given 'there are servers' do
create(:server)
GroupServer.create!(group_id: Group::DONATOR_GROUP.id, server: create(:server))
end
Then(/^I can view a list of current reservations$/) do
page.should have_content @re... |
github | Arie/serveme | https://github.com/Arie/serveme | features/step_definitions/server_statistics.rb | Ruby | apache-2.0 | 97 | master | 1,246 | # typed: false
# frozen_string_literal: true
Given 'there are server statistics' do
server = create :server, name: 'the right server'
reservation = create :reservation, server: server
@stat = create :server_statistic, server: server, reservation: reservation, fps: 1337
create :server_statistic, server: server,... |
github | Arie/serveme | https://github.com/Arie/serveme | features/step_definitions/account.rb | Ruby | apache-2.0 | 97 | master | 422 | # typed: false
# frozen_string_literal: true
Given 'I am logged in' do
@current_user = create(:user, uid: '12345')
login_as(@current_user, scope: :user)
end
Given 'I am a donator' do
@current_user.group_ids += [ Group.donator_group.id ]
end
Given 'I am an admin' do
@current_user.group_ids += [ Group.admin_gr... |
github | Arie/serveme | https://github.com/Arie/serveme | features/step_definitions/vouchers.rb | Ruby | apache-2.0 | 97 | master | 633 | # typed: false
# frozen_string_literal: true
When 'I go to activate a premium code' do
visit new_voucher_path
end
When 'I enter a valid premium code' do
voucher = Voucher.generate!(Product.find_by_name('1 month'))
fill_in_voucher_code(voucher.code)
end
When 'I enter a used premium code' do
create(:voucher, c... |
github | Arie/serveme | https://github.com/Arie/serveme | features/step_definitions/player_statistics.rb | Ruby | apache-2.0 | 97 | master | 2,485 | # typed: false
# frozen_string_literal: true
Given 'there are player statistics' do
server = create :server, name: 'the right server'
reservation = create :reservation, server: server
rp = create :reservation_player, name: 'the right player', reservation: reservation, ip: '8.8.8.8', steam_uid: '1234'
@ps = cre... |
github | Arie/serveme | https://github.com/Arie/serveme | features/step_definitions/reservations.rb | Ruby | apache-2.0 | 97 | master | 9,563 | # typed: false
# frozen_string_literal: true
Given 'there are reservations today' do
create(:reservation, starts_at: 10.minutes.from_now, ends_at: 1.hour.from_now)
@reservation = create(:reservation, starts_at: 130.minutes.from_now, ends_at: 3.hours.from_now)
end
When 'I go make a reservation' do
visit new_rese... |
github | Arie/serveme | https://github.com/Arie/serveme | features/step_definitions/ratings.rb | Ruby | apache-2.0 | 97 | master | 685 | # typed: false
# frozen_string_literal: true
Given 'there is a rating' do
create :rating, user: create(:user)
end
Given 'there is a published rating' do
create :rating, published: true
end
When 'I go to the ratings' do
visit ratings_path
end
When 'I publish a rating' do
click_link 'Publish'
end
When 'I unp... |
github | Arie/serveme | https://github.com/Arie/serveme | features/step_definitions/servers.rb | Ruby | apache-2.0 | 97 | master | 1,043 | # typed: false
# frozen_string_literal: true
Given 'there is a donator only server' do
@server = create :server, name: 'Donator Only Server', groups: [ Group.donator_group ]
end
When 'I go add a server' do
visit new_server_path
end
When 'I go edit a server' do
create(:server)
visit edit_server_path(Server.fi... |
github | Arie/serveme | https://github.com/Arie/serveme | features/step_definitions/map_upload.rb | Ruby | apache-2.0 | 97 | master | 1,373 | # typed: false
# frozen_string_literal: true
Given 'I go to upload a map' do
visit new_map_upload_path
end
When 'I try to upload a wrong kind of file' do
bad_map = generate_fake_map('foo', 'foobar')
attach_file('map_upload_file', bad_map.path)
click_button 'Upload'
end
Then 'I see a message the map file was ... |
github | Arie/serveme | https://github.com/Arie/serveme | features/step_definitions/donators.rb | Ruby | apache-2.0 | 97 | master | 1,147 | # typed: false
# frozen_string_literal: true
Given 'I am on the donators page' do
visit admin_users_path(group_id: Group.donator_group.id)
end
Given 'there is a donator' do
@donator = create :user, nickname: 'Donator'
GroupUser.create(expires_at: 1.month.from_now,
group_id: Group.donator_grou... |
github | Arie/serveme | https://github.com/Arie/serveme | features/support/geocoder.rb | Ruby | apache-2.0 | 97 | master | 646 | # typed: false
# frozen_string_literal: true
module Geocoder
module Lookup
class MaxmindLocal
private
remove_method(:results)
def results(query)
return [] if query.to_s == 'no results'
if query.to_s == '127.0.0.1'
[]
else
[ { request: '8.8.8.8', ip... |
github | Arie/serveme | https://github.com/Arie/serveme | features/support/env.rb | Ruby | apache-2.0 | 97 | master | 1,143 | # typed: false
# frozen_string_literal: true
require 'cucumber/rails'
require 'cucumber/rspec/doubles'
require 'sidekiq'
require 'sidekiq/testing'
require 'factory_bot_rails'
require 'rspec/sorbet'
RSpec::Sorbet.allow_doubles!
Sidekiq::Testing.fake!
# Load seed data
require Rails.root.join('db', 'seeds')
# Set server... |
github | Arie/serveme | https://github.com/Arie/serveme | features/support/vcr.rb | Ruby | apache-2.0 | 97 | master | 205 | # typed: false
# frozen_string_literal: true
require 'vcr'
VCR.cucumber_tags do |t|
t.tag '@vcr'
end
VCR.configure do |c|
c.cassette_library_dir = 'features/fixtures/vcr'
c.hook_into :webmock
end |
github | Arie/serveme | https://github.com/Arie/serveme | db/seeds.rb | Ruby | apache-2.0 | 97 | master | 3,332 | # typed: strict
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.crea... |
github | Arie/serveme | https://github.com/Arie/serveme | db/schema.rb | Ruby | apache-2.0 | 97 | master | 22,155 | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `bin/rai... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20170124165159_rename_paypal_orders_to_orders.rb | Ruby | apache-2.0 | 97 | master | 259 | # typed: true
# frozen_string_literal: true
class RenamePaypalOrdersToOrders < ActiveRecord::Migration[4.2]
def change
add_column :paypal_orders, :type, :string, default: 'PaypalOrder'
rename_column :vouchers, :paypal_order_id, :order_id
end
end |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20251111115752_add_steam_uid_ip_index_to_reservation_players.rb | Ruby | apache-2.0 | 97 | master | 532 | class AddSteamUidIpIndexToReservationPlayers < ActiveRecord::Migration[8.0]
disable_ddl_transaction!
def change
# Add composite index for steam_uid and ip to speed up cross-reference queries
# Partial index excludes SDR IPs (169.254.x.x) which are not useful for league requests
add_index :reservation_p... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20250628091713_remove_ai_command_notification.rb | Ruby | apache-2.0 | 97 | master | 534 | # typed: true
class RemoveAiCommandNotification < ActiveRecord::Migration[8.0]
def up
ServerNotification.where(
message: "New: Use !ai in chat to control the server! Ask for map changes, configs, or anything else. The AI will help you manage the server",
).delete_all
end
def down
ServerNotific... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20260307120000_create_site_settings.rb | Ruby | apache-2.0 | 97 | master | 1,156 | # typed: false
# frozen_string_literal: true
class CreateSiteSettings < ActiveRecord::Migration[8.0]
def up
create_table :site_settings do |t|
t.string :key, null: false
t.string :value
t.timestamps
end
add_index :site_settings, :key, unique: true
defaults = case SITE_HOST
whe... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20170321122041_restore_whitelist_tf_integration.rb | Ruby | apache-2.0 | 97 | master | 274 | # typed: true
class RestoreWhitelistTfIntegration < ActiveRecord::Migration[5.0]
def change
create_table :whitelist_tfs do |t|
t.integer :tf_whitelist_id
t.text :content
t.timestamps
end
add_index :whitelist_tfs, :tf_whitelist_id
end
end |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20260225120000_add_cloud_phase_timestamps.rb | Ruby | apache-2.0 | 97 | master | 302 | class AddCloudPhaseTimestamps < ActiveRecord::Migration[7.2]
def change
add_column :servers, :cloud_vm_running_at, :datetime
add_column :servers, :cloud_vm_progress, :integer
add_column :servers, :cloud_ssh_ready_at, :datetime
add_column :reservations, :ready_at, :datetime
end
end |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20260221125622_add_cloud_columns_to_servers.rb | Ruby | apache-2.0 | 97 | master | 499 | class AddCloudColumnsToServers < ActiveRecord::Migration[8.1]
def change
add_column :servers, :cloud_provider, :string
add_column :servers, :cloud_provider_id, :string
add_column :servers, :cloud_status, :string
add_column :servers, :cloud_location, :string
add_column :servers, :cloud_reservation_... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20211123143404_add_sdr_fields_to_servers_and_reservations.rb | Ruby | apache-2.0 | 97 | master | 464 | # typed: true
class AddSdrFieldsToServersAndReservations < ActiveRecord::Migration[6.1]
def change
add_column :reservations, :sdr_ip, :string
add_column :reservations, :sdr_port, :string
add_column :reservations, :sdr_tv_port, :string
add_column :servers, :sdr, :boolean, default: false
add_column... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20250813081442_update_more_server_coordinates.rb | Ruby | apache-2.0 | 97 | master | 1,092 | class UpdateMoreServerCoordinates < ActiveRecord::Migration[8.0]
def up
# Chicago servers
Server.where(ip: [ 'chi5.serveme.tf', '14.1.30.218' ]).update_all(
latitude: 41.8500,
longitude: -87.6500
)
Server.where(ip: [ 'chi2.serveme.tf', '104.128.50.71' ]).update_all(
latitude: 41.850... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20260301110437_create_stac_detections.rb | Ruby | apache-2.0 | 97 | master | 528 | # typed: true
class CreateStacDetections < ActiveRecord::Migration[8.1]
def change
create_table :stac_detections do |t|
t.integer :reservation_id, null: false
t.bigint :steam_uid, null: false
t.string :player_name, null: false
t.string :steam_id
t.string :detection_type, null: false... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20250809151350_add_statistics_indexes_and_counter_caches.rb | Ruby | apache-2.0 | 97 | master | 861 | class AddStatisticsIndexesAndCounterCaches < ActiveRecord::Migration[8.0]
def change
# Add indexes for statistics performance
add_index :reservations, [ :starts_at, :duration ], name: 'index_reservations_on_starts_at_and_duration'
add_index :reservations, :created_at, name: 'index_reservations_on_created_... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20231130194248_add_hidden_to_server_configs.rb | Ruby | apache-2.0 | 97 | master | 205 | # typed: true
class AddHiddenToServerConfigs < ActiveRecord::Migration[7.1]
def change
add_column :server_configs, :hidden, :boolean, default: false
add_index :server_configs, :hidden
end
end |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20231022074155_remove_old_types_from_servers.rb | Ruby | apache-2.0 | 97 | master | 200 | # typed: true
class RemoveOldTypesFromServers < ActiveRecord::Migration[7.1]
def change
Server.where(type: %w[GameyeServer SimraiServer HiperzServer]).update_all(type: 'LocalServer')
end
end |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20250809103739_add_asn_fields_to_reservation_players.rb | Ruby | apache-2.0 | 97 | master | 324 | class AddAsnFieldsToReservationPlayers < ActiveRecord::Migration[8.0]
def change
add_column :reservation_players, :asn_number, :integer
add_column :reservation_players, :asn_organization, :string
add_column :reservation_players, :asn_network, :string
add_index :reservation_players, :asn_number
end
... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20260324081900_deduplicate_reservation_matches.rb | Ruby | apache-2.0 | 97 | master | 913 | # frozen_string_literal: true
class DeduplicateReservationMatches < ActiveRecord::Migration[7.2]
def up
# Delete duplicate reservation_matches, keeping the one with the lowest id per (reservation_id, match_number)
execute <<~SQL
DELETE FROM match_players
WHERE reservation_match_id IN (
SE... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20260418120000_add_hostname_and_setup_status_to_docker_hosts.rb | Ruby | apache-2.0 | 97 | master | 564 | # typed: true
# frozen_string_literal: true
class AddHostnameAndSetupStatusToDockerHosts < ActiveRecord::Migration[7.2]
def up
add_column :docker_hosts, :hostname, :string
add_column :docker_hosts, :setup_status, :string, default: "pending", null: false
add_index :docker_hosts, :hostname, unique: true
... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20231008093210_create_action_text_tables.action_text.rb | Ruby | apache-2.0 | 97 | master | 997 | # typed: true
# This migration comes from action_text (originally 20180528164100)
class CreateActionTextTables < ActiveRecord::Migration[6.0]
def change
# Use Active Record's configured type for primary and foreign keys
primary_key_type, foreign_key_type = primary_and_foreign_key_types
create_table :act... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20260130113947_create_ip_lookups.rb | Ruby | apache-2.0 | 97 | master | 532 | # frozen_string_literal: true
class CreateIpLookups < ActiveRecord::Migration[8.1]
def change
create_table :ip_lookups do |t|
t.string :ip, null: false
t.boolean :is_proxy, default: false
t.boolean :is_residential_proxy, default: false
t.integer :fraud_score
t.string :connection_typ... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20231008093209_create_active_storage_tables.active_storage.rb | Ruby | apache-2.0 | 97 | master | 2,212 | # typed: true
# This migration comes from active_storage (originally 20170806125915)
class CreateActiveStorageTables < ActiveRecord::Migration[7.0]
def change
# Use Active Record's configured type for primary and foreign keys
primary_key_type, foreign_key_type = primary_and_foreign_key_types
create_tabl... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20250711094424_add_locked_fields_to_reservations.rb | Ruby | apache-2.0 | 97 | master | 213 | # typed: true
class AddLockedFieldsToReservations < ActiveRecord::Migration[8.0]
def change
add_column :reservations, :original_password, :text
add_column :reservations, :locked_at, :datetime
end
end |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20260321120000_add_democheck_mode_to_reservations.rb | Ruby | apache-2.0 | 97 | master | 589 | # frozen_string_literal: true
class AddDemocheckModeToReservations < ActiveRecord::Migration[7.2]
def up
add_column :reservations, :democheck_mode, :string, default: "kick", null: false
execute "UPDATE reservations SET democheck_mode = 'disable' WHERE disable_democheck = true"
remove_column :reservations... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20260301120000_create_docker_hosts.rb | Ruby | apache-2.0 | 97 | master | 465 | # frozen_string_literal: true
class CreateDockerHosts < ActiveRecord::Migration[8.1]
def change
create_table :docker_hosts do |t|
t.references :location, null: false, foreign_key: true
t.string :city, null: false
t.string :ip, null: false
t.integer :start_port, default: 27015
t.inte... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20260322140000_create_match_players.rb | Ruby | apache-2.0 | 97 | master | 1,366 | # frozen_string_literal: true
class CreateMatchPlayers < ActiveRecord::Migration[7.2]
def change
create_table :reservation_matches do |t|
t.references :reservation, null: false, index: true
t.integer :red_score
t.integer :blue_score
t.float :total_duration_seconds, default: 0, null: false... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20220727191656_ensure_utc_timestamps.rb | Ruby | apache-2.0 | 97 | master | 1,676 | # typed: true
class EnsureUtcTimestamps < ActiveRecord::Migration[7.0]
def switcheroo(table, columns)
puts "Doing the switcheroo for #{table} and columns #{columns.join(', ')}"
columns.each do |column|
add_column table, :"#{column}_utc", :datetime
end
fill_columns_statement = columns.map do |... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20260129082641_add_index_to_reservations_for_active_past.rb | Ruby | apache-2.0 | 97 | master | 299 | class AddIndexToReservationsForActivePast < ActiveRecord::Migration[8.1]
disable_ddl_transaction!
def change
add_index :reservations, [ :ended, :provisioned, :ends_at ],
algorithm: :concurrently,
name: "index_reservations_on_ended_provisioned_ends_at"
end
end |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20211213121448_create_server_upload.rb | Ruby | apache-2.0 | 97 | master | 491 | # typed: true
class CreateServerUpload < ActiveRecord::Migration[6.1]
def change
create_table :server_uploads do |t|
t.integer :server_id
t.integer :file_upload_id
t.datetime :started_at
t.datetime :uploaded_at
t.timestamps
end
add_index :server_uploads, :server_id
add... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20250613072343_create_file_upload_permissions.rb | Ruby | apache-2.0 | 97 | master | 293 | # typed: true
class CreateFileUploadPermissions < ActiveRecord::Migration[7.0]
def change
create_table :file_upload_permissions do |t|
t.references :user, null: false, foreign_key: true
t.string :allowed_paths, array: true, default: []
t.timestamps
end
end
end |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20260120124752_add_discord_fields_to_reservations.rb | Ruby | apache-2.0 | 97 | master | 209 | class AddDiscordFieldsToReservations < ActiveRecord::Migration[8.1]
def change
add_column :reservations, :discord_channel_id, :string
add_column :reservations, :discord_message_id, :string
end
end |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20251028201310_add_composite_index_to_reservation_players.rb | Ruby | apache-2.0 | 97 | master | 241 | class AddCompositeIndexToReservationPlayers < ActiveRecord::Migration[8.0]
disable_ddl_transaction!
def change
add_index :reservation_players, [ :steam_uid, :reservation_id ], algorithm: :concurrently, if_not_exists: true
end
end |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20170519163845_squasher_clean.rb | Ruby | apache-2.0 | 97 | master | 363 | # typed: true
class SquasherClean < ActiveRecord::Migration[5.0]
class SchemaMigration < ActiveRecord::Base
end
def up
migrations = Dir.glob(File.join(File.dirname(__FILE__), '*.rb'))
versions = migrations.map { |file| File.basename(file)[/\A\d+/] }
SchemaMigration.where("version NOT IN (?)", versio... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20221208220436_add_server_update_fields_to_servers.rb | Ruby | apache-2.0 | 97 | master | 265 | # typed: true
class AddServerUpdateFieldsToServers < ActiveRecord::Migration[7.0]
def change
add_column :servers, :last_known_version, :integer
add_column :servers, :update_started_at, :datetime
add_column :servers, :update_status, :string
end
end |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20190617085355_add_tv_port_to_servers.rb | Ruby | apache-2.0 | 97 | master | 386 | # typed: true
class AddTvPortToServers < ActiveRecord::Migration[5.2]
class Server < ActiveRecord::Base
self.inheritance_column = nil
end
def up
add_column :servers, :tv_port, :string
Server.reset_column_information
Server.all.each do |s|
s.update_attribute(:tv_port, s.port.to_i + 5)
en... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20240703131707_create_stac_logs.rb | Ruby | apache-2.0 | 97 | master | 304 | # typed: true
class CreateStacLogs < ActiveRecord::Migration[7.1]
def change
create_table :stac_logs do |t|
t.integer :reservation_id
t.string :filename
t.integer :filesize
t.binary :contents
t.timestamps
end
add_index :stac_logs, :reservation_id
end
end |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20260418130000_add_provider_fields_to_docker_hosts.rb | Ruby | apache-2.0 | 97 | master | 351 | # typed: false
# frozen_string_literal: true
class AddProviderFieldsToDockerHosts < ActiveRecord::Migration[8.0]
def change
add_column :docker_hosts, :provider, :string
add_column :docker_hosts, :provider_server_id, :string
add_column :docker_hosts, :provider_location, :string
change_column_null :doc... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20211213121026_add_file_uploads.rb | Ruby | apache-2.0 | 97 | master | 201 | # typed: true
class AddFileUploads < ActiveRecord::Migration[6.1]
def change
create_table :file_uploads do |t|
t.string :file
t.integer :user_id
t.timestamps
end
end
end |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20250401124250_add_ai_command_notification.rb | Ruby | apache-2.0 | 97 | master | 531 | # typed: true
class AddAiCommandNotification < ActiveRecord::Migration[8.0]
def up
ServerNotification.create!(
message: "New: Use !ai in chat to control the server! Ask for map changes, configs, or anything else. The AI will help you manage the server",
notification_type: "public"
)
end
def ... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20250112165949_update_server_coordinates_from_overrides.rb | Ruby | apache-2.0 | 97 | master | 453 | class UpdateServerCoordinatesFromOverrides < ActiveRecord::Migration[8.0]
def up
Server.where(ip: 'monika.fakkelbrigade.eu').update_all(
latitude: 50.11552,
longitude: 8.68417
)
Server.where(ip: 'new.fakkelbrigade.eu').update_all(
latitude: 50.4779,
longitude: 12.3716
)
R... |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20170220234313_remove_default_type_for_orders.rb | Ruby | apache-2.0 | 97 | master | 233 | # typed: true
class RemoveDefaultTypeForOrders < ActiveRecord::Migration[5.0]
def up
change_column_default(:paypal_orders, :type, nil)
end
def down
change_column_default(:paypal_orders, :type, "PaypalOrder")
end
end |
github | Arie/serveme | https://github.com/Arie/serveme | db/migrate/20160902141018_init_schema.rb | Ruby | apache-2.0 | 97 | master | 12,689 | # typed: false
class InitSchema < ActiveRecord::Migration[4.2]
def up
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "group_servers", force: :cascade do |t|
t.integer "server_id"
t.integer "group_id"
t.datetime "c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.