|c3ae113a38||1 year ago|
|app||1 year ago|
|bin||1 year ago|
|config||1 year ago|
|db||1 year ago|
|lib||1 year ago|
|log||1 year ago|
|public||1 year ago|
|storage||1 year ago|
|test||1 year ago|
|tmp||1 year ago|
|vendor||1 year ago|
|.browserslistrc||1 year ago|
|.dockerignore||1 year ago|
|.gitattributes||1 year ago|
|.gitignore||1 year ago|
|.ruby-version||1 year ago|
|Dockerfile||1 year ago|
|Dockerfile.development||1 year ago|
|Gemfile||1 year ago|
|Gemfile.lock||1 year ago|
|LICENSE||1 year ago|
|Procfile||1 year ago|
|README.md||1 year ago|
|Rakefile||1 year ago|
|babel.config.js||1 year ago|
|config.ru||1 year ago|
|docker-compose.yml||1 year ago|
|docker-entrypoint.sh||1 year ago|
|package.json||1 year ago|
|postcss.config.js||1 year ago|
|proc-start||1 year ago|
|yarn.lock||1 year ago|
Sharedlists is a simple rails driven database for managing multiple product lists of various suppliers.
This app is used in conjunction with foodsoft. Recommended Ruby version is 2.7.
docker-compose run --rm app bundle docker-compose run --rm app rails db:setup
Creating a user
To access sharedlists, you'll need to create a user (and I guess you want admin access).
docker-compose run --rm app rails c > u = User.new(email: 'email@example.com', password: 'secret') > u.admin = true > u.save! > exit
You can create more users within the web interface.
Either fetch the image, or build it:
docker pull sharedlists:latest # or docker build --tag sharedlists:latest --rm .
Then set environment variables
DATABASE_URL and run:
docker run --name sharedlists_web \ -e SECRET_KEY_BASE -e DATABASE_URL -e RAILS_FORCE_SSL=false \ sharedlists:latest
To run cronjobs, start another instance:
docker run --name sharedlists_cron \ -e SECRET_KEY_BASE -e DATABASE_URL \ sharedlists:latest ./proc-start cron
If you want to process incoming mails, add another instance like the previous,
To put this all together, you may want to wrap this in docker-compose. See the foodcoops.net setup for a real-world example.
To use shared suppliers from this sharedlists instance from within Foodsoft, you need
to configure the
config/app_config.yml. Don't forget to grant the Foodsoft database user
SELECT access on sharedlists'
Articles in the database can be updated regularly. There are currently two options to do this automatically.
Some suppliers distribute article lists via FTP. You can use the rake task
sync_ftp_files in order to download and parse those article
lists. First, you need to enable FTP synchronization for a certain supplier by
activating the checkbox Synchronize FTP files. Fill out all corresponding form
fields. In particular, make sure to adjust the file filter (regular
expression) such that it matches the files of interest; non-matching files are
ignored. The two supported file formats and sensible choices for a corresponding
file filter are shown in the following table.
|file format||example file filter|
Once you have the
sync_ftp_files task working, you may wish to setup a
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
On production, you may want to run this on localhost on an unprivileged port, with a
proper MTA in front that
does message routing.
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 email is sent. If you only want to import mails with a subject that contains a certain 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 saving the supplier after Send to.
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
This is useful when you're running a mail server in front to route mails.