- Install PostgreSQL.
- Install rbenv.
- Install nodenv.
- Set the EDITOR environment variable (nano, vim, mcedit, etc.).
- Clone this repository and checkout to directory.
- Run exe/setup.sh to install Ruby (with gems), Node.js (with modules) and fill configs.
- Run toys db create_user to create database user.
- Run toys db create to create database.
- Run toys db migrate to run database migrations.
- Tune PostgreSQL (via pgtune, for example).
- Set correct timezone.
- Install traceroute (or traceroute6) for debug information in network errors reports.
- Add UNIX-user for project: adduser stream_timer.
- Install and configure nginx (with symbolic links from config/nginx).
- Make symbolic link of project directory to /var/www/stream_timer (Debian),
/usr/share/nginx/stream_timer (Fedora) or something else,
and change the root in nginx config.
to something like /home/stream_timer/stream_timer.
- Install Certbot and generate certificates.
- Optional openssl dhparam -out /etc/ssl/certs/dhparam.pem 4096.
- Copy config/systemd.service to the ~/.config/systemd/user/ directory and enable it.
- Don't forget to enable user services after logout: loginctl enable-linger stream_timer.
For management server state use toys server command.
Realized with pry:
(All models and other classes are available)
(For login as postgres user use sudo su - postgres)
toys db migrations new migration_name
toys db migrations
# toys db migrations list
To latest:
toys db migrate
# toys db migrations run
To specific version (forward or backward):
toys db migrate --target=part_of_target_migration_name_or_version
N is a number of migrations to rollback relatively to the latest existing.
toys db migrations rollback N
It will update default (or specified as first argument) branch,
update bundle, stop server, run migrations and start server.
It will run exe/update.sh command remotely
through ssh connection from deploy.yaml configuration file.
Update external resources
- Go to IcoMoon App
- Upload project
- Click Manage Projects button
- Click Import Project button
- Upload assets/icomoon/selection.json file
- Click Load button
- Modify the set of icons
- Enter keyword (like car or man) into search field
- Select desired icons
- Update icons
- Click Generate SVG & More button
- Check names and other settings
- Click Download button
- Run toys icomoon extract %path_to_downloaded_archive%
- Repeat these steps with the final assets/icomoon/selection.json file,
because of there is a difference (in setIdx and iconIdx fields) between
original selection.json file with freshly added icons and
generated selection.json file with the same icons.