view · edit · sidebar · attach · print · history

< Niklaus.20180116-oddb-doctors | Index | Niklaus.20180110-ydim-html-rack >>

20180115-ydim-html-rack

Summary

  • Port ydim-html to rack
  • Fix two small problem in oddb2xml
  • Keep in Mind

Commits

Index

Port ydim-html to rack

Reviewing changes of last week before pushing commit. readme.md must be updated to refence rack.

Must find a way on howto install the gem pg in version 0.21.0 which requires an installed postgres >= 9.2 and access to its header files.

This works for me sudo gem-240 install pg -- --with-pg-config=/usr/local/pgsql-10.1/bin/pg_config as discussed under https://bitbucket.org/ged/ruby-pg/wiki/Home

Installing via bundler worked like this

bundle-240 config build.pg --with-pg-config=/usr/local/pgsql-10.1/bin/pg_config
bundle-240 install --path=vendor --without debugger

Remarked that on January 10, 2018 the version 1.0.0 of the pg was released. YDIM used the previous version 0.21 of Januar 2017. I think we should upgrade to 1.0.0, as there are some commits for Postgres 10.

Upgrading to pg 1.0.0 needs some minor fixes as PGError was renamed to PG::Error. Done locally. I will require at least pg 1.0.0 in ydbi, ydim and ydim-html. Woking on providing new gem versions for ydbi, ydim and ydim-html.

As we no longer are able to specify the config to be loaded, I just emit in the config.ru the name of the used config YAML file. This should be easy to pinpoint errors. Output is as follow, when we start ydim-html

RCLConf uses the first existing files of etc/ydim-htmld.yml,/home/niklaus/.ydim/ydim-htmld.yml,/etc/ydim/ydim-htmld.yml
loaded config from /etc/ydim/ydim-htmld.yml
YDIM::Html::Util::App 18119f76baf8e4e86d24b3c36aa72de4e486b076 used version: sbsm 1.5.9, ydim 1.0.4, ydbi 0.5.4

Removing the nolonger used method quote_array_elements from lib/dbd/pg/database.rb (in ydbi)

Pushed the following commits

Pushed the following gems

gem push ydbi-0.5.5.gem 
gem push ydbd-pg-0.5.5.gem 

I no longer push a ydim-html gem, as this is a stand alone application with a Gemfile.lock. The required gems are specified in the Gemfile.

Checked again that ydim-html is working properly with Apache 8.4 on oddb-ci2.

Installing now on thinpower.

cd  /var/www/ydim.ywesee.com/
git pull https://github.com/ngiger/ydim-html.git
/usr/local/bin/bundle-240 install
su
cp example_site/service/ydim/run /service/ydim
svc -d /service/ydim*
# Manually checked that each run file works (must fix ydim/run)
chown -R apache:users log
svc -u /service/ydim*
# verified using
svstat /service/ydim*
/service/ydim: up (pid 5105) 25 seconds
/service/ydim-html: up (pid 5106) 25 seconds
cp -v example_site/etc/apache/vhosts.d/ydim.ywesee.com.conf /etc/apache2/vhosts.d/ydim.ywesee.com.conf 
/etc/init.d/apache2 reload
# fixing warning 
#  VirtualHost 62.12.131.38:443 overlaps with VirtualHost 62.12.131.38:443, the first has precedence, perhaps you need a NameVirtualHost directive 

Now https://ydim.ywesee.com/ presents the login dialog (but without a correct css). After the login I get redirected to http://ydim.ywesee.com/de/ydim, which shows

Not Found
The requested URL /de/ydim was not found on this server.
Apache Server at ydim.ywesee.com Port 80

Fixed this error by correcting the apache config. Now after the log in I get

DRb::DRbConnError at /de/ydim
druby://localhost:12375 - #<Errno::ECONNREFUSED: Connection refused - connect(2) for "localhost" port 12375>

Port 12375 belongs to ydimd. After some studies in pry, I manage to make it work by changing in /etc/ydim/ydim-htmld.yml the line server_url: druby://192.168.0.36:12375 to server_url: 'druby://192.168.0.36:12375'.

Now ydim.ywesee.com seems to work fine. Pushed commit Fix example_site configurations files

Fix two small problem in oddb2xml

We must fix the following two problems.

  • Link to download atc.csv from epha has changed (Fixed with commmit Adapt to new link of epha atc.csv
  • When generating transfer.dat for migel not all lines are 98 chars long

The problem stems from the fact that in build_dat we created the line in the UTF-8 enoding not ISO-8859-14. Looking at the output of bin/oddb2xml --append -f dat I see lines like U+201D from UTF-8 to ISO-8859-1: in 1117227600MYLIFE YPSOPUMP Orbit micro 8.5mm/80cm 31” 10 Stk 000000000000300 000000076131170107201 at 51. This led me to substitute it by '"' in lib/oddb2xml/extractor.rb.

Adding a new utility procedure patch_some_utf8. Using in the extractor and in the cli.rb. Also using this procedure when emitting the names coming from refdata for the migel.dat and transfer.dat

Pushed commit Ensure that transfer.dat lines have always the correct line length of 97.

Release version 2.4.9 of oddb2xml gem.

view · edit · sidebar · attach · print · history
Page last modified on January 15, 2018, at 05:05 PM