Git Product home page Git Product logo

cyclestreets-setup's People

Contributors

claremacrae avatar doccyb avatar mk270 avatar mvl22 avatar scsmncao avatar si-the-pie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cyclestreets-setup's Issues

Explicit loading of suhosin

I believe we reference suhosin (the PHP hardening patch) in the .htaccess file of the site.

We must therefore ensure suhosin is explicitly installed in the setup repo.

I think the package is php5-suhosin but haven't done any further research, e.g. checking whether this is actually installed.

Move MySQL to >= 5.7.5

MySQL 5.7 adds far better OpenGIS spatial support.

MySQL 5.7.5 adds native spatial GeoJSON support:
https://dev.mysql.com/doc/refman/5.7/en/spatial-geojson-functions.html

Currently the repo expects 5.6:
https://github.com/cyclestreets/cyclestreets-setup/blob/master/utility/installBaseWebserver.sh#L105-L106

Upgrading to 5.7.x on Ubuntu 14.04 is possible but requires installation from MySQL's package repo rather than being a native Ubuntu package:
https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-14-04

Ubuntu 16.04 LTS (Xenial)'s native package is MySQL 5.7:
http://packages.ubuntu.com/xenial/mysql-server-5.7

Obviously performance and tuning requirements would need to be assessed before a move to 5.7 but no major changes would seem likely.

PHP configuration

Difficult directives

Despite being listed as PHP_INI_ALL the following directives are not effectively assigned to values applied from the Apache configuration:

Directive Changeable
session.gc_maxlifetime PHP_INI_ALL
session.cookie_lifetime PHP_INI_ALL
zend.assertions PHP_INI_ALL with restrictions

The assigned values are respected when included in the php.ini system, as has been tried for example in 9998f11.

The zend.assertions directive controls how PHP is compiled which might be why it has to be set in the php.ini system, and the qualification with restrictions is a hint to that.

phpinfo()

Despite looking at this many times over the last decade I have never gotten to the bottom of why the other two settings cannot be set reliably from the Apache configuration. E.g. when set in the either a virtualhost configuration or the one of the higher level conf-enabled files to 86400, phpinfo() lists them as:

Directive Local value Master value
session.cookie_lifetime 86400 1440
session.gc_maxlifetime 86400 1440

(1440 = 24 minutes, 86400 = 24 hours)

but the setting in force appears to be the master value as about 24 minutes later the site requests a login. (This wait also makes it a pain to test / debug.)

I think it might be something to do with the server wide nature of these settings - e.g. the garbage collection lifetime presumably applies to the whole of php as perhaps hinted at by the note attached to this documentation for the session.gc_maxlifetime directive.

Consequence

Until this matter can be resolved then changing these values from their defaults requires edits in the php.ini system files.

Munin installation is non-optimal

Munin setup is not routine.

It should be added for all machines via a distinct script, included in all installers.

It should pick up a set of IPv4/IPv6 addresses in the main .config.sh file.

There should be no manually-saved configurations.

MySQL configuration

Aim to get rid of all cyclestreets.cnf writing - currently setup by import and live deployment.

The main thing they set is:

query-cache
utf8

The rest of the application should do what they are currently trying to do. But the utf8 setting should remain as really that should be system wide.

Routing engine import should set engine status

An import currently sets the response to have an error status of: Routing service unavailable.

This should be changed to: Data update in progress, which would enable load balancing or other checking systems to detect a known state.

SMS monitoring - skip notifications during planned maintenance

Problem

Sometimes servers are temporarily offline during upgrades and installations of new routing edtions.

When these known planned maintenance events occur the SMS should avoid sending notifications.

Proposal

Add detection of the 503 (Service unavailable) header in the tests code.
The failure can then be ignored for specific (end-point) servers but still be sent when the original target was a load balancer.

Git clone fails because websitesContentFolder already exists

Unlike SVN, it seems you cannot clone into an existing directory.

However, the .mySuperUserCredentials.cnf gets written into there (why?) earlier in the script.

Either we need to amend git clone to clone into an existing directory somehow, or the MySQL file should be written after the git stage.

Wkhtmltopdf unpatched qt problem

wkhtmltopdf --print-media-type /tmp/zib6EPozh.html /tmp/tmp55f9dN.pdf

The switch --print-media-type, is not support using unpatched qt, and will be ignored.
QXcbConnection: Could not connect to display

Compress large read only table

The map_leg_detail table describes the edges in the routing graph. Some of these are CSV fields (e.g. distances and elevations) which compress well.

The following technique (based on this) has been manually applied to the current routing edition, reducing the table size from 13G to just under 6G. After the compression procedure the table works in the same way as previously. The reduced data size should yield a modest performance boost, although no benchmarking has been performed.

This procedure could be added to the main build process, but is a bit fiddly as involves working as root user on the command line, possibly while the mysql service is stopped.

# [email protected]:#
cd /var/lib/mysql/routing190109

# File sizes before compression (data for routing190101 is 13G)
ls -lh map_leg_detail.*

# Check status
myisamchk -dvv map_leg_detail

# Pack (takes five minutes)
date
myisampack map_leg_detail
date

# Check compressed tables (takes three minutes)
date
myisamchk -rq map_leg_detail
date

# File sizes after compression
ls -lh map_leg_detail.*
# Data file is 5.9G (before was 13G)

# Flush tables
mysql -uroot -e "flush tables;"

Sample databases - rehoming and regular rebuilding

The schema scripts build sample versions of the following databases:

  1. cyclestreets sample database contains a minimum set of data to run a new working installation
  2. routingYYMMDD contains minimal routing data for Cambridge

They result in files of several MB which are currently stored as part of the main repository.

This task is to move them out of the code repository and home them somewhere like downloads.cyclestreets.net.

This would allow them to be rebuilt daily and hence keep them up to date, smoothing the installation process.

use updated URL for wkhtmltopdf downloads

Hello,

wkhtmltopdf has moved the downloads provider from SourceForge to gna.org. As mentioned in the linked message, all earlier downloads have been removed from SourceForge and you are strongly advised to migrate to the new URLs. The following files in your repository will need to be updated:

  • install-website/run.sh

It is recommended to either subscribe to the mailing list or Twitter feed to receive updates on new releases and further changes.

Thanks,
wkhtmltopdf maintainer

SMS monitoring needs a rewrite

The SMS testing system has become stretched - this script needs a more fundamental rewrite.

It should have a defined list of server/API calls to test, not a single list with exceptions. It should also have support for testing specific areas.

Backup script should report shortage of space

The backup check script at backup-deployment/check-backup.sh reports any failed units.

It would be helpful if it, or another script doing the backup itself, reported lack of disk space on the target.

Splitting zcsglobal.conf

zcsglobal.conf at
https://github.com/cyclestreets/cyclestreets-setup/blob/master/install-website/zcsglobal.conf

contains two things:

  1. Global server-wide configuration, that is aimed at locking-down a server more securely, e.g. disabling the AcceptPathInfo misfeature;

  2. Items specific to the journey planner site.

Because this is installed as part of the journey planner setup, and not as part of a general machine setup, setup routines such as for microsites are not getting (1).

We should split this into to two configurations.

We should also take the opportunity also to remove the cryptic 'zcsglobal' name, which was named to means 'cyclestreets global, with z to ensure it is last'.

Routes from London Kings Cross going South involve many turns

Reproducible example: https://www.cyclestreets.net/journey/79719873/

As shown there and in the image below there are quite a few turns in each route option. From a user perspective the easiest option is to get straight onto the A201 which takes you straight there on reasonably quiet / protected infrastructure. The dotted red line represents the 'route 1' option from Google that is best from the perspective of minimising turns and maximising continuity.

image

Source: https://www.google.com/maps/dir/Kings+Cross,+London/SE11+4JP,+London/@51.5118702,-0.1440914,13z/data=!3m1!4b1!4m14!4m13!1m5!1m1!1s0x48761b10c73c4dcd:0x616f11fed05d6bb9!2m2!1d-0.1245845!2d51.5347488!1m5!1m1!1s0x4876049745fd7d11:0x8a34ecfec0841e5c!2m2!1d-0.1065995!2d51.4893899!3e1

Not sure this is the right place for people to submit feedback in an open forum on routing but hope this is useful feedback nonetheless.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.