5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-21 13:16:23 +00:00

BREAKING CHANGE: variables de entorno

This commit is contained in:
f 2024-01-10 17:04:53 -03:00
parent 089c09a26c
commit f488028455
No known key found for this signature in database
6 changed files with 27 additions and 17 deletions

View file

2
.gitignore vendored
View file

@ -28,7 +28,7 @@
/data/*
/_storage/*
.env*
.env.*
# Ignore master key for decrypting credentials and more.
/config/master.key

View file

@ -4,8 +4,6 @@ source ENV.fetch('GEMS_SOURCE', 'https://17.3.alpine.gems.sutty.nl')
ruby "~> #{ENV.fetch('RUBY_VERSION', '3.1')}"
gem 'dotenv-rails', require: 'dotenv/rails-now'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.1.0'
# Use Puma as the app server
@ -108,6 +106,7 @@ end
group :development, :test do
gem 'derailed_benchmarks'
gem 'dotenv-rails'
gem 'pry'
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '~> 2.13'

View file

@ -28,6 +28,12 @@ instalación (en inglés)](https://taskfile.dev/installation/)
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
Para navegar la documentación del código usando YARD:
@ -62,6 +68,11 @@ instructions](https://taskfile.dev/installation/).
go-task
```
### Environment variables
Default env vars are store on `.env`. For local options, copy them to
`.env.local`.
### Documentation
To browse documentation using YARD:

View file

@ -6,8 +6,10 @@ vars:
shopt:
- "globstar"
dotenv:
- ".env"
- ".env.development"
- ".env"
- ".env.local"
- ".env.development.local"
tasks:
credentials:
desc: "Generate credentials file"
@ -17,20 +19,9 @@ tasks:
- "config/credentials.yml.enc.ci"
generates:
- "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:
desc: "Install gems"
deps:
- "env"
- "credentials"
cmds:
- "go-task bundle"
@ -79,8 +70,6 @@ tasks:
- "grep -q \" panel.{{.SUTTY}} \" /etc/hosts"
database-init:
desc: "Database install"
deps:
- "env"
cmds:
- "{{.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"

View file

@ -21,6 +21,17 @@ require 'rails/test_unit/railtie'
# you've limited to :test, :development, or :production.
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
# Sutty!
class Application < Rails::Application