Skip to content

Initial implementation #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 65 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
7adc954
Initial commit
Jun 25, 2021
f2adfa3
Set up 2FA when confirming account
Jun 28, 2021
85f3dd5
Send token when creating session and confirming email
Jul 15, 2021
0854750
Return an empty token if 2FA is enabled and user didn't provide it
Jul 16, 2021
ed7ba8d
Validate current OTP when enabling 2FA
Jul 16, 2021
35cbc11
Add endpoint for resending confirmation email
Jul 23, 2021
429784b
Check current password when updating password
Jul 23, 2021
e116bbd
Fix sessions, add fields to serializers
AndriiMysko Jul 23, 2021
296d81a
Do not return 404 if user is not found when resending confirmation
Jul 23, 2021
4babd7b
Fix first_or_initialize
AndriiMysko Jul 23, 2021
01c69c7
Allow server level token to be added on creation/update
Jul 23, 2021
b781462
Add endpoint for adding repository level token
Jul 23, 2021
d6397e3
Add last_synced_at to repository serializer
Jul 23, 2021
af2eee1
Update reset password email link
Jul 23, 2021
f5a1ec3
Encrypt token in server provider and repository permission settings
Jul 23, 2021
2ac7979
Add possibility to remove repository level token
Jul 23, 2021
1311372
Use common Rails route for updating repo token
Jul 23, 2021
d22d5a9
Do not update existing server provider in creation form
Jul 23, 2021
51a678f
Validate current password when removing account
Jul 23, 2021
4e95fbf
Add endpoint for searching server provider by URL
Jul 23, 2021
1a1d857
Redirect to confirmed page from email confirmation
Jul 23, 2021
b737cc1
Add all kinds of sync
Jul 23, 2021
e9fdeed
Render file contents
Jul 23, 2021
f96fe59
Fix get_file_contents API call
Jul 26, 2021
19f78c8
Fix typo in TokenController
Jul 27, 2021
a555daa
Add pagination and adjust serializers for web UI
AndriiMysko Jul 27, 2021
652a5bf
Add server by URL + fixes and improvements
AndriiMysko Jul 28, 2021
aa78160
Feedback mailer
AndriiMysko Jul 28, 2021
301808c
Assign deleted email
AndriiMysko Jul 29, 2021
0cb27a4
Add listener endpoint
Jul 29, 2021
b3a6d09
Refactor P4-specific code to a more generic one
Aug 3, 2021
95a9429
Implement a production-ready Dockerfile
Aug 19, 2021
b68dcf4
Fix sync with Assembla repos
Aug 25, 2021
f88f1fa
Setup Config gem
Aug 27, 2021
2f197ba
Tweak database.yml to accept ENV variables
Aug 27, 2021
7f982e4
Add SMTP ENV vars
Aug 27, 2021
6a90acb
Add SMTP domain
Aug 27, 2021
d7c1762
Rename config initializer
Aug 27, 2021
4358901
Set up mail sender
Aug 30, 2021
8a955b7
Add OAuth server via doorkeeper
Aug 18, 2021
f9c3d06
Initial unit tests and travis
AndriiMysko Sep 9, 2021
917303f
Rubocop fixes
AndriiMysko Sep 9, 2021
23627fc
Add spec for models
AndriiMysko Sep 9, 2021
916991f
Add some controller specs
AndriiMysko Sep 9, 2021
a7c5226
Update .travis.yml
AndriiMysko Sep 9, 2021
31418b9
Rest of the specs
AndriiMysko Sep 10, 2021
9300986
Fix server provider serializer
AndriiMysko Sep 13, 2021
9e67905
Revert "Fix server provider serializer"
AndriiMysko Sep 13, 2021
ade7b7c
Pass credentials to repo
AndriiMysko Sep 13, 2021
55a331c
Rubocop
AndriiMysko Sep 13, 2021
3640c35
Fix spec
AndriiMysko Sep 13, 2021
c12b0aa
Fix spec
AndriiMysko Sep 13, 2021
5568655
Use p4 password
AndriiMysko Sep 13, 2021
3fbdbd8
Fix
AndriiMysko Sep 13, 2021
0bb5ccf
Fix exception and remove logging
Sep 13, 2021
051d32a
Do not throw an exception when not enough perms for checking permissions
Sep 13, 2021
f7eb074
Use server provider token if no user and repo token is available
Sep 13, 2021
f8ac8d0
Fix serializers
AndriiMysko Sep 15, 2021
331f2e1
Add Sentry
Sep 21, 2021
fe5f29c
Fix rubocop
AndriiMysko Sep 29, 2021
f596464
Fix rubocop
AndriiMysko Sep 29, 2021
89882b6
webhook creation/trigger fix, file contents fix/wa
AndriiMysko Oct 1, 2021
62ec4d3
added token get api
AndriiMysko Oct 1, 2021
259606c
saving settings on sp.update
AndriiMysko Oct 14, 2021
340bc94
Set a valid email when marking user as deleted
Nov 12, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# See https://git-scm.com/docs/gitattributes for more about git attribute files.

# Mark the database schema as having been generated.
db/schema.rb linguist-generated

# Mark the yarn lockfile as having been generated.
yarn.lock linguist-generated

# Mark any vendored files as having been vendored.
vendor/* linguist-vendored
44 changes: 44 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'

# Ignore bundler config.
/.bundle

# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-*

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# Ignore pidfiles, but keep the directory.
/tmp/pids/*
!/tmp/pids/
!/tmp/pids/.keep

# Ignore uploaded files in development.
/storage/*
!/storage/.keep

/public/assets
.byebug_history

# Ignore master key for decrypting credentials and more.
/config/master.key

/public/packs
/public/packs-test
/node_modules
/yarn-error.log
yarn-debug.log*
.yarn-integrity

config/settings.local.yml
config/settings/*.local.yml
config/environments/*.local.yml
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--require spec_helper
90 changes: 90 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
require:
- rubocop-rspec

AllCops:
Exclude:
- vendor/**/*
- tmp/**/*
- lib/tasks/*
- bin/*
- rgloader/*
- db/*
- config/**/*
- spec/rails_helper.rb
- spec/spec_helper.rb
TargetRubyVersion: 2.7

Style/Documentation:
Enabled: false

Metrics/ClassLength:
Enabled: false

Metrics/LineLength:
Enabled: false

Metrics/MethodLength:
CountComments: false
Max: 40
Exclude:
- spec/**/*.rb

Metrics/BlockLength:
Exclude:
- spec/**/*.rb
- config/routes.rb

Metrics/AbcSize:
Enabled: false

Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma

Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma

Style/StringLiterals:
Exclude:
- db/schema.rb

Style/IfUnlessModifier:
Enabled: false

Lint/AssignmentInCondition:
Enabled: false

RSpec/DescribedClass:
EnforcedStyle: explicit

RSpec/MultipleExpectations:
Enabled: false

RSpec/NestedGroups:
Enabled: false

RSpec/VerifiedDoubles:
Enabled: false

RSpec/ExampleLength:
Enabled: false

RSpec/AnyInstance:
Enabled: false

RSpec/MessageSpies:
EnforcedStyle: receive

RSpec/NamedSubject:
Enabled: false

RSpec/SubjectStub:
Enabled: false

RSpec/LetSetup:
Enabled: false

RSpec/InstanceVariable:
Enabled: false

Lint/UnusedMethodArgument:
Enabled: false
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby-2.7.2
27 changes: 27 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
language: ruby
os: linux
dist: xenial

addons:
postgresql: 9.6

rvm: 3.0.1

env:
global:
- PATH=/snap/bin:$PATH

cache: bundler

jobs:
include:
- stage: "rubocop"
script: bundle exec rubocop
- stage: "rspec"
script: bundle exec rspec
before_install:
- "gem install bundler -v 2.1.4"
before_script:
- "RAILS_ENV=test bundle exec rake db:create"
services:
- redis
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM ruby:3.0.1

RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
curl -sL https://deb.nodesource.com/setup_16.x | bash -s && \
apt-get install -y --no-install-recommends \
postgresql-client nodejs yarn \
&& rm -rf /var/lib/apt/lists/*

RUN bundle config --global frozen 1
RUN bundle config set deployment 'true'
RUN bundle config set without 'development test'

WORKDIR /app
COPY Gemfile* ./

RUN gem install bundler -v '2.1.4'
RUN bundle install

COPY . .

EXPOSE 3000
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]
17 changes: 17 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ruby:3.0.1

RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
curl -sL https://deb.nodesource.com/setup_16.x | bash -s && \
apt-get install -y --no-install-recommends \
postgresql-client nodejs yarn \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /srv/app
# COPY Gemfile* ./
# RUN bundle install
# COPY . .

EXPOSE 3000
ENTRYPOINT ["/srv/app/entrypoint.sh"]
CMD ["rails", "server", "-b", "0.0.0.0"]
45 changes: 45 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# frozen_string_literal: true

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '3.0.1'

gem 'bootsnap', require: false
gem 'config'
gem 'devise'
gem 'devise-jwt'
gem 'devise-two-factor'
gem 'doorkeeper'
gem 'jsonapi-serializer'
gem 'kaminari'
gem 'ledermann-rails-settings'
gem 'p4ruby'
gem 'pg'
gem 'puma', '~> 5.0'
gem 'rack-cors'
gem 'rails', '~> 6.1.3', '>= 6.1.3.2'
gem 'redis'
gem 'sentry-rails'
gem 'sentry-ruby'
gem 'sentry-sidekiq'
gem 'sidekiq'
gem 'validate_url'

group :development, :test do
gem 'brakeman'
gem 'byebug', platforms: %i[mri mingw x64_mingw]
gem 'factory_bot'
gem 'listen'
gem 'rspec-rails'
end

group :test do
gem 'database_cleaner'
gem 'rspec'
end

group :development do
gem 'rubocop', '~> 0.75.1', require: false
gem 'rubocop-rspec'
end
Loading