This README would normally document whatever steps are necessary to get the application up and running.
List of the requirements (packages are named as in ALT conventions) are the following: 0. gcc-c++
- libhiredis-devel
- libsnappy-devel
- libruby-devel
- redis
- xclip
- sidekiq
- postgresql15-server-devel
- postgresql15-server
- postgresql15-contrib
- libwebp-tools
- libImageMagick-devel
- curl
- git
- sudo
- node
- yarn
- gostsum
If you have an ALT installation, just install requirements by single line:
apt-get install libhiredis-devel libsnappy-devel redis xclip sidekiq postgresql15-server-devel postgresql15-server postgresql15-contrib libwebp-tools curl git sudo node yarn gostsum libImageMagick-devel
It any others, just correlate them for each of packages to your system's ones, and then install as usually.
- Setup RVM: 1.1. Import gpg records if required:
command curl -sSL https://rvm.io/mpapis.asc | gpg --import -
command curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -
1.2. Install rvm itself as follows:
\curl -sSL https://get.rvm.io | bash -s stable
1.3. Make sure taht .bashrc has rvm setup lines:
grep rvm ~/.bashrc
export PATH="$PATH:$HOME/.rvm/bin"
1.4. Relogin into the shell.
- Install required ruby
Get into the projects folder, then run:
rvm install ruby-$(cat Gemfile|grep ^ruby|sed "s,.*'\([0-9.]\+\)'.*,\1,")
This will install projects ruby into the system.
- Create required config files secrets.yml, and database.yml, and .env
development:
adapter: postgresql
encoding: unicode
database: dneslov_development
pool: 5
username: dneslov
password:
production:
secret_key_base: <secret hash>
---
github:
client:
id: "..."
secret: "..."
access_token_url: "https://github.com/login/oauth/access_token"
user_info_url: "https://api.github.com/user"
client_url: "https://dneslov.org/dashboard"
redirect_url: "https://dneslov.org/auth/github"
secret_key_base: '...'
jwt_secret: "..."
sentry:
dsn: "https://...@....ingest.sentry.io/..."
rails:
resque:
redis: "localhost:6379"
redis:
url: "redis://localhost:6379"
Setup sudo for deployment if required.
Setup deployment, and remote restart can be done for production or staging environment, it is no meaning to do this for development. So these three steps can be skipped.
Run capistrano setup task:
$ cap production setup
$ cap production deploy
$ cap production deploy deploy:restart
$ cap production deploy:restart
In development mode:
Run server and file watcher with:
RAILS_ENV=development foreman start -f config/procfiles/development.rb -d .
On client side proceed images into to upload-ready format, so do:
rake dneslov:image:proceed[~/Документы/Изображения/dneslov_pin1/,~/Документы/днеслов/upimages]
Then rsync them with the upload server(s):
rake dneslov:image:rsync[~/Документы/днеслов/upimages,~/git/dneslov/public/images:~/git/dneslov/public/images1]
Then on server side from mouted upstream server load images as resources, and then converts them into icon or thumb links, as:
rake dneslov:load:resources[/mnt/mail] dneslov:load:images[/images]
Request for all licit calendaries:
curl -k "https://dneslov.org/api/v1/calendaries.json"
Paged version with 10 records per page:
curl -k "https://dneslov.org/api/v1/calendaries.json?page=1&per=10"
Request for all licit calendaries with ones unlicit, which are specified by slug:
curl -k "https://dneslov.org/api/v1/calendaries.json?c=гпц&page=1&per=10"
To generate PDF calendary with a first record per day, use the following:
rake book:pdf[днеслов.pdf,днеслов]