aboutsummaryrefslogtreecommitdiffstats

A tiny baby feeding tracking web app for their very first weeks.

Configuration

To work, this application needs the following environment variables to be exported:

BIBERON_COOKIE_DOMAIN
domain name of your public instance (i.e. mysite.com), to be used to pin the session cookie to your website only.
BIBERON_PUBLISH_FOLDER
Where to upload your website (via the server:publish rake task, which use rsync internally)
BIBERON_SESSION_SECRET
Long string use as secret key to encrypt the session cookies.

A quick way to do it locally, is to create a file named .env at the root of this repository, containing the following lines:

export BIBERON_PUBLISH_FOLDER=myserver.com:/opt/web/biberon/
export BIBERON_SESSION_SECRET='bliblabluverylongstringohmy'
export BIBERON_COOKIE_DOMAIN=127.0.0.1

The admin:session_secret rake task exists to help you generate a session secret string.

Run

Development server

You can start a local server by using the following rake task.

rake server:start

You should also try to build the various assets first:

rake assets:all

Production server

You can adapt the following systemd service file:

[Unit]
Description=Control Rack Server for Biberons App
After=network.target

[Service]
Type=simple
User=www-data
Group=www-data
Environment="PATH=/usr/local/share/rvm/gems/ruby-3.1.2@biberons/bin:/usr/local/share/rvm/gems/ruby-3.1.2@global/bin:/usr/local/share/rvm/rubies/ruby-3.1.2/bin:/usr/local/share/rvm/bin:/usr/local/bin:/usr/bin:/bin"
Environment="GEM_HOME=/usr/local/share/rvm/gems/ruby-3.1.2@biberons"
Environment="GEM_PATH=/usr/local/share/rvm/gems/ruby-3.1.2@biberons:/usr/local/share/rvm/gems/ruby-3.1.2@global"
Environment="BIBERON_SESSION_SECRET=bliblabluverylongstringohmy"
Environment="BIBERON_COOKIE_DOMAIN=mywebsite.com"
Environment="RACK_ENV=production"
WorkingDirectory=/opt/web/biberon
ExecStart=/usr/local/share/rvm/gems/ruby-3.1.2@biberons/bin/rackup -I ./lib -s puma -E production -P ./tmp/puma.pid -o 127.0.0.1 -p 9595
KillMode=control-group

[Install]
WantedBy=multi-user.target

Credits