mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-24 02:16:21 +00:00
BREAKING CHANGE: variables de entorno
This commit is contained in:
parent
089c09a26c
commit
f488028455
6 changed files with 27 additions and 17 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -28,7 +28,7 @@
|
||||||
/data/*
|
/data/*
|
||||||
/_storage/*
|
/_storage/*
|
||||||
|
|
||||||
.env*
|
.env.*
|
||||||
|
|
||||||
# Ignore master key for decrypting credentials and more.
|
# Ignore master key for decrypting credentials and more.
|
||||||
/config/master.key
|
/config/master.key
|
||||||
|
|
3
Gemfile
3
Gemfile
|
@ -4,8 +4,6 @@ source ENV.fetch('GEMS_SOURCE', 'https://17.3.alpine.gems.sutty.nl')
|
||||||
|
|
||||||
ruby "~> #{ENV.fetch('RUBY_VERSION', '3.1')}"
|
ruby "~> #{ENV.fetch('RUBY_VERSION', '3.1')}"
|
||||||
|
|
||||||
gem 'dotenv-rails', require: 'dotenv/rails-now'
|
|
||||||
|
|
||||||
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
||||||
gem 'rails', '~> 6.1.0'
|
gem 'rails', '~> 6.1.0'
|
||||||
# Use Puma as the app server
|
# Use Puma as the app server
|
||||||
|
@ -108,6 +106,7 @@ end
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
gem 'derailed_benchmarks'
|
gem 'derailed_benchmarks'
|
||||||
|
gem 'dotenv-rails'
|
||||||
gem 'pry'
|
gem 'pry'
|
||||||
# Adds support for Capybara system testing and selenium driver
|
# Adds support for Capybara system testing and selenium driver
|
||||||
gem 'capybara', '~> 2.13'
|
gem 'capybara', '~> 2.13'
|
||||||
|
|
11
README.md
11
README.md
|
@ -28,6 +28,12 @@ instalación (en inglés)](https://taskfile.dev/installation/)
|
||||||
go-task
|
go-task
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Variables de entorno
|
||||||
|
|
||||||
|
Las variables de entorno por defecto se encuentran en el archivo `.env`.
|
||||||
|
Para modificar las opciones, crear o modificar el archivo `.env.local`
|
||||||
|
con valores distintos.
|
||||||
|
|
||||||
### Documentación
|
### Documentación
|
||||||
|
|
||||||
Para navegar la documentación del código usando YARD:
|
Para navegar la documentación del código usando YARD:
|
||||||
|
@ -62,6 +68,11 @@ instructions](https://taskfile.dev/installation/).
|
||||||
go-task
|
go-task
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Environment variables
|
||||||
|
|
||||||
|
Default env vars are store on `.env`. For local options, copy them to
|
||||||
|
`.env.local`.
|
||||||
|
|
||||||
### Documentation
|
### Documentation
|
||||||
|
|
||||||
To browse documentation using YARD:
|
To browse documentation using YARD:
|
||||||
|
|
|
@ -6,8 +6,10 @@ vars:
|
||||||
shopt:
|
shopt:
|
||||||
- "globstar"
|
- "globstar"
|
||||||
dotenv:
|
dotenv:
|
||||||
- ".env"
|
|
||||||
- ".env.development"
|
- ".env.development"
|
||||||
|
- ".env"
|
||||||
|
- ".env.local"
|
||||||
|
- ".env.development.local"
|
||||||
tasks:
|
tasks:
|
||||||
credentials:
|
credentials:
|
||||||
desc: "Generate credentials file"
|
desc: "Generate credentials file"
|
||||||
|
@ -17,20 +19,9 @@ tasks:
|
||||||
- "config/credentials.yml.enc.ci"
|
- "config/credentials.yml.enc.ci"
|
||||||
generates:
|
generates:
|
||||||
- "config/credentials.yml.enc"
|
- "config/credentials.yml.enc"
|
||||||
env:
|
|
||||||
desc: "Install the .env file"
|
|
||||||
cmds:
|
|
||||||
- "test -f .env || cp .env.example .env"
|
|
||||||
- ": == Environment vars have changed, please review and edit =="
|
|
||||||
- "diff -auN --color .env.example .env"
|
|
||||||
sources:
|
|
||||||
- ".env.example"
|
|
||||||
generates:
|
|
||||||
- ".env"
|
|
||||||
gems:
|
gems:
|
||||||
desc: "Install gems"
|
desc: "Install gems"
|
||||||
deps:
|
deps:
|
||||||
- "env"
|
|
||||||
- "credentials"
|
- "credentials"
|
||||||
cmds:
|
cmds:
|
||||||
- "go-task bundle"
|
- "go-task bundle"
|
||||||
|
@ -79,8 +70,6 @@ tasks:
|
||||||
- "grep -q \" panel.{{.SUTTY}} \" /etc/hosts"
|
- "grep -q \" panel.{{.SUTTY}} \" /etc/hosts"
|
||||||
database-init:
|
database-init:
|
||||||
desc: "Database install"
|
desc: "Database install"
|
||||||
deps:
|
|
||||||
- "env"
|
|
||||||
cmds:
|
cmds:
|
||||||
- "{{.HAINISH}} /usr/bin/initdb --locale en_US.utf8 -E UTF8 -D /var/lib/postgresql/{{.PGVER}}/data"
|
- "{{.HAINISH}} /usr/bin/initdb --locale en_US.utf8 -E UTF8 -D /var/lib/postgresql/{{.PGVER}}/data"
|
||||||
- "echo \"host all all samenet trust\" >> ../hain/var/lib/postgresql/{{.PGVER}}/data/pg_hba.conf"
|
- "echo \"host all all samenet trust\" >> ../hain/var/lib/postgresql/{{.PGVER}}/data/pg_hba.conf"
|
||||||
|
|
|
@ -21,6 +21,17 @@ require 'rails/test_unit/railtie'
|
||||||
# you've limited to :test, :development, or :production.
|
# you've limited to :test, :development, or :production.
|
||||||
Bundler.require(*Rails.groups)
|
Bundler.require(*Rails.groups)
|
||||||
|
|
||||||
|
if %w[development test].include? ENV['RAILS_ENV']
|
||||||
|
# https://github.com/bkeepers/dotenv/pull/453
|
||||||
|
Dotenv::Railtie.class_eval do
|
||||||
|
def overload
|
||||||
|
Dotenv.overload(*dotenv_files.reverse)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Dotenv::Railtie.overload
|
||||||
|
end
|
||||||
|
|
||||||
module Sutty
|
module Sutty
|
||||||
# Sutty!
|
# Sutty!
|
||||||
class Application < Rails::Application
|
class Application < Rails::Application
|
||||||
|
|
Loading…
Reference in a new issue