Compare commits

..

10 commits

Author SHA1 Message Date
JuliusR
63bc26ab16 improve handling of User resource 2021-12-19 10:48:54 +01:00
JuliusR
b319b9de93 simplify routes 2021-12-19 10:46:47 +01:00
JuliusR
2470b514c2 add unique index on Users#email 2021-12-19 10:17:27 +01:00
JuliusR
6a9437cad7 rails db:schema:dump
This updates the db/schema.rb from a clean development database
(mariadb:10.1) using Rails 6.1.
2021-12-19 10:14:33 +01:00
JuliusR
fa29bc75a6 add public/packs to .gitignore 2021-12-19 10:12:41 +01:00
JuliusR
970fdecda7 stop ignoring config/*.yml, but ignore config/database.yml 2021-12-19 10:12:07 +01:00
JuliusR
c19eda923e copy .gitignore from old sharedlists 2021-12-19 10:10:41 +01:00
JuliusR
7257a2a5a9 replace database.yml by database.yml.SAMPLE (now mysql2 only) 2021-12-19 10:08:41 +01:00
JuliusR
84a78d82df fix GEM_PATH and PATH in Dockerfile.development 2021-12-19 09:44:09 +01:00
JuliusR
19deb9c398 add webrick 2021-12-19 09:27:47 +01:00
3 changed files with 15 additions and 17 deletions

View file

@ -9,7 +9,6 @@ gem 'webpacker', '~> 5.0'
gem 'turbolinks', '~> 5' gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.7' gem 'jbuilder', '~> 2.7'
gem 'bootsnap', '>= 1.4.4', require: false gem 'bootsnap', '>= 1.4.4', require: false
gem 'puma', '~> 5.0'
group :development, :test do group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
@ -43,3 +42,5 @@ gem 'will_paginate', '~> 3.0'
gem 'whenever', '~> 0.9', require: false gem 'whenever', '~> 0.9', require: false
gem 'mysql2', '>=0.5' gem 'mysql2', '>=0.5'
gem 'base32' gem 'base32'
gem "webrick", "~> 1.7" # fallback for removed puma; not included in alpine

View file

@ -127,8 +127,6 @@ GEM
mini_portile2 (~> 2.6.1) mini_portile2 (~> 2.6.1)
racc (~> 1.4) racc (~> 1.4)
public_suffix (4.0.6) public_suffix (4.0.6)
puma (5.5.2)
nio4r (~> 2.0)
racc (1.6.0) racc (1.6.0)
rack (2.2.3) rack (2.2.3)
rack-mini-profiler (2.3.3) rack-mini-profiler (2.3.3)
@ -232,6 +230,7 @@ GEM
rack-proxy (>= 0.6.1) rack-proxy (>= 0.6.1)
railties (>= 5.2) railties (>= 5.2)
semantic_range (>= 2.3.0) semantic_range (>= 2.3.0)
webrick (1.7.0)
websocket-driver (0.7.5) websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0) websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5) websocket-extensions (0.1.5)
@ -256,7 +255,6 @@ DEPENDENCIES
listen (~> 3.3) listen (~> 3.3)
midi-smtp-server (~> 3.0) midi-smtp-server (~> 3.0)
mysql2 (>= 0.5) mysql2 (>= 0.5)
puma (~> 5.0)
rack-mini-profiler (~> 2.0) rack-mini-profiler (~> 2.0)
rails (~> 6.1.4, >= 6.1.4.4) rails (~> 6.1.4, >= 6.1.4.4)
roo roo
@ -271,6 +269,7 @@ DEPENDENCIES
web-console (>= 4.1.0) web-console (>= 4.1.0)
webdrivers webdrivers
webpacker (~> 5.0) webpacker (~> 5.0)
webrick (~> 1.7)
whenever (~> 0.9) whenever (~> 0.9)
will_paginate (~> 3.0) will_paginate (~> 3.0)

View file

@ -5,7 +5,7 @@
Sharedlists is a simple rails driven database for managing multiple product lists of various suppliers. Sharedlists is a simple rails driven database for managing multiple product lists of various suppliers.
This app is used in conjunction with [foodsoft](https://github.com/foodcoops/foodsoft). This app is used in conjunction with [foodsoft](https://github.com/foodcoops/foodsoft).
Recommended [Ruby](http://ruby-lang.org/) version is 2.7. Recommended [Ruby](http://ruby-lang.org/) version is 2.3 (note that 2.4 does not work).
## Development ## Development
@ -15,7 +15,7 @@ Recommended [Ruby](http://ruby-lang.org/) version is 2.7.
Copy `config/database.yml.SAMPLE` to `config/database.yml` and Copy `config/database.yml.SAMPLE` to `config/database.yml` and
docker-compose run --rm app bundle docker-compose run --rm app bundle
docker-compose run --rm app rails db:setup docker-compose run --rm app rake db:setup
### Run ### Run
@ -31,8 +31,6 @@ To access sharedlists, you'll need to create a user (and I guess you want admin
> u.save! > u.save!
> exit > exit
You can create more users within the web interface.
## Production ## Production
Either fetch the image, or build it: Either fetch the image, or build it:
@ -41,16 +39,16 @@ Either fetch the image, or build it:
# or # or
docker build --tag sharedlists:latest --rm . docker build --tag sharedlists:latest --rm .
Then set environment variables `SECRET_KEY_BASE` and `DATABASE_URL` and run: Then set environment variables `SECRET_TOKEN` and `DATABASE_URL` and run:
docker run --name sharedlists_web \ docker run --name sharedlists_web \
-e SECRET_KEY_BASE -e DATABASE_URL -e RAILS_FORCE_SSL=false \ -e SECRET_TOKEN -e DATABASE_URL -e RAILS_FORCE_SSL=false \
sharedlists:latest sharedlists:latest
To run cronjobs, start another instance: To run cronjobs, start another instance:
docker run --name sharedlists_cron \ docker run --name sharedlists_cron \
-e SECRET_KEY_BASE -e DATABASE_URL \ -e SECRET_TOKEN -e DATABASE_URL \
sharedlists:latest ./proc-start cron sharedlists:latest ./proc-start cron
If you want to process incoming mails, add another instance like the previous, If you want to process incoming mails, add another instance like the previous,
@ -99,19 +97,19 @@ Once you have the `sync_ftp_files` task working, you may wish to setup a
### Email ### Email
Some suppliers send a regular email with an article list in the attachment. For this, an Some suppliers send a regular email with an article list in the attachment. For this, an
email server needs to be run using the rails task `mail:smtp_server`. email server needs to be run using the rake task `mail:smtp_server`.
On production, you may want to run this on localhost on an unprivileged port, with a On production, you may want to run this on localhost on an unprivileged port, with a
proper [MTA](https://en.wikipedia.org/wiki/Message_transfer_agent) in front that proper [MTA](https://en.wikipedia.org/wiki/Message_transfer_agent) in front that
does message routing. does message routing.
To enable this for a certain supplier, tick the checkbox _Update articles by email_. Then To enable this for a certain supplier, tick the checkbox _Update articles by email_. Then
select a file format to use for importing, and the supplier's email address from which the select a file format to use for importing, and the supplier's email address from which the
email is sent. If you only want to import mails with a subject that contains a certain email is sent. If you only want to import for mails with a subject that contains a certain
text (e.g. _Articles in week_), fill in the subject field as well. text (e.g. _Articles in week_), fill in the subject field as well.
What email address does the supplier need to send to? Users will find this after initial creating and What email address does the supplier need to send to? Users will find this after saving
saving the supplier after _Send to_. the supplier after _Send to_.
This needs setting up of the environment variable `MAILER_DOMAIN`, on which you receive the This needs setting up of the environment variable `MAILER_DOMAIN`, on which you receive the
mails. It is allowed to prefix the address, you may want to set the prefix in `MAILER_PREFIX`. emails. It is allowed to prefix the address, you may want to set the prefix in `MAILER_PREFIX`.
This is useful when you're running a mail server in front to route mails. This is useful when you're running an email server in front to route mails.