Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

Commit

Permalink
Merge pull request #190 from omu/develop
Browse files Browse the repository at this point in the history
Merge develop into master
  • Loading branch information
msdundar authored Aug 8, 2018
2 parents bd986ec + 5cc4b8e commit 95fca1a
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
.byebug_history
.vagrant*/
.env
/storage/*

# never remove!
config/master.key
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ gem 'sidekiq'
# active-record
gem 'ancestry'

# active-storage
gem 'aws-sdk-s3', require: false

# authentication
gem 'devise'

Expand Down
17 changes: 17 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ GEM
io-like (~> 0.3.0)
arel (9.0.0)
ast (2.4.0)
aws-eventstream (1.0.1)
aws-partitions (1.97.0)
aws-sdk-core (3.24.0)
aws-eventstream (~> 1.0)
aws-partitions (~> 1.0)
aws-sigv4 (~> 1.0)
jmespath (~> 1.0)
aws-sdk-kms (1.7.0)
aws-sdk-core (~> 3)
aws-sigv4 (~> 1.0)
aws-sdk-s3 (1.17.0)
aws-sdk-core (~> 3, >= 3.21.2)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.0)
aws-sigv4 (1.0.3)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
Expand Down Expand Up @@ -142,6 +157,7 @@ GEM
jbuilder (2.7.0)
activesupport (>= 4.2.0)
multi_json (>= 1.2)
jmespath (1.4.0)
json (2.1.0)
kwalify (0.7.2)
launchy (2.4.3)
Expand Down Expand Up @@ -337,6 +353,7 @@ PLATFORMS

DEPENDENCIES
ancestry
aws-sdk-s3
bcrypt (~> 3.1.7)
bootsnap (>= 1.1.0)
brakeman
Expand Down
4 changes: 3 additions & 1 deletion app/views/layouts/shared/_footer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
</div>

<div class="d-none d-sm-block">
<a href="https://github.com/omu/nokul">Nokul</a>
<%= link_to 'https://github.com/omu/nokul' do %>
Nokul <%= Nokul::VERSION %>
<% end %>
<span>&nbsp;© 2018 BAUM</span>
</div>

Expand Down
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX

# Store uploaded files on the local file system (see config/storage.yml for options)
config.active_storage.service = :local
config.active_storage.service = :minio

# Mount Action Cable outside main process or domain
# config.action_cable.mount_path = nil
Expand Down
5 changes: 5 additions & 0 deletions config/initializers/git_version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

module Nokul
VERSION = `git describe --tags --abbrev=0`.chomp
end
21 changes: 11 additions & 10 deletions config/storage.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
test:
service: Disk
root: <%= Rails.root.join("tmp/storage") %>
root: <%= Rails.root.join('tmp/storage') %>

local:
service: Disk
root: <%= Rails.root.join("storage") %>
root: <%= Rails.root.join('storage') %>

# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
# amazon:
# service: S3
# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
# region: us-east-1
# bucket: your_own_bucket
minio:
service: S3
access_key_id: <%= Rails.application.credentials.minio[:access_key] %>
secret_access_key: <%= Rails.application.credentials.minio[:secret_key] %>
region: us-east-1 # required for aws GEMs, can not be nil
bucket: nokul
endpoint: https://s3.omu.sh
force_path_style: true # use https://domain.com/bucket, instead of bucket.domain.com

# Remember not to checkin your GCS keyfile to a repository
# google:
# service: GCS
# project: your_project
# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
# credentials: <%= Rails.root.join('path/to/gcs.keyfile') %>
# bucket: your_own_bucket

# Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This migration comes from active_storage (originally 20170806125915)
class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
def change
create_table :active_storage_blobs do |t|
t.string :key, null: false
t.string :filename, null: false
t.string :content_type
t.text :metadata
t.bigint :byte_size, null: false
t.string :checksum, null: false
t.datetime :created_at, null: false

t.index [ :key ], unique: true
end

create_table :active_storage_attachments do |t|
t.string :name, null: false
t.references :record, null: false, polymorphic: true, index: false
t.references :blob, null: false

t.datetime :created_at, null: false

t.index [ :record_type, :record_id, :name, :blob_id ], name: "index_active_storage_attachments_uniqueness", unique: true
end
end
end
23 changes: 22 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2018_08_03_203638) do
ActiveRecord::Schema.define(version: 2018_08_07_230631) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand All @@ -35,6 +35,27 @@
t.datetime "updated_at", null: false
end

create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
t.string "record_type", null: false
t.bigint "record_id", null: false
t.bigint "blob_id", null: false
t.datetime "created_at", null: false
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
end

create_table "active_storage_blobs", force: :cascade do |t|
t.string "key", null: false
t.string "filename", null: false
t.string "content_type"
t.text "metadata"
t.bigint "byte_size", null: false
t.string "checksum", null: false
t.datetime "created_at", null: false
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
end

create_table "addresses", force: :cascade do |t|
t.integer "type", default: 4, null: false
t.string "phone_number", default: "", null: false
Expand Down

0 comments on commit 95fca1a

Please sign in to comment.