mysociety / commonlib Goto Github PK
View Code? Open in Web Editor NEWmySociety code common to several projects
License: Other
mySociety code common to several projects
License: Other
This is the mySociety commonlib repository. It contains libraries which are shared (or potentially shared) between multiple mySociety sites.
We set the pinning-priority to 50 but that prevents the updated pdftk (1.44.2+ms) being chosen as the preferred package.
Is this intentional?
# apt-cache policy pdftk
pdftk:
Installed: (none)
Candidate: 1.41+dfsg-10+squeeze1
Version table:
1.44.2+ms 0
50 http://debian.mysociety.org/ squeeze/main amd64 Packages
1.41+dfsg-10+squeeze1 0
500 http://http.us.debian.org/debian/ squeeze/main amd64 Packages
The install-site.sh
script restarts nginx by calling /etc/init.d/nginx restart
, this should probably be changed to something more future-proof such as /sbin/service nginx restart
for systems that have transitioned to systemd units while maintaining backward compatibility with older systems.
The same script also has a install_sysvinit_script()
function that might need augmenting or complementing in some way.
This is more friendly for re-users who might want to test using an OS we haven't formally added support for.
Hi.
We are trying to upgrade norways mapit instance in a Debian 11 server.
The problem we encounter is that Debian 11 no longer supports Python2, but all packages that the mapit installer (as initiated by install-site.sh) wants to install is hardcoded to assume python2. Several of the packages no longer exist on Debian, such as python-flup, which needs to be installed using «pip3 install flup-py3».
Is it really not possible to install this on a python3 only server?
Unlike the other language versions, the ruby version checks that the config file exists every time a config variable is looked up, rather than only the first time.
Hi guys I am having an issue while trying to install fixmystret on vagrant in ubuntu 12.04 and the problem is as described above and the line of code being referred to is
# read_config_from_php
# Read configuration data from the named PHP configuration file
sub read_config_from_php($) {
my ($f) = @_;
if (! -r $f) {
throw Error::Simple "$f: read permissions not OK for config file";
}
Investigate improving the site install script to utilise /proc/cpuinfo
to guess a sensible number of workers, and perhaps use gevent, and so on.
Currently uses_mixed_capitals
uses the regular expressions /[A-Z]/
and /[a-z]/
to detect upper and lower case letters. This doesn't take into account non-ASCII upper case and lower case letters. In fixing this, case needs to be taken to preserve Ruby 1.8.7 compatibility, which doesn't have support for Unicode character classes in its regular expressions, meaning that one couldn't just use /[[:upper:]]/
, for example.
If you specify both --dev
and a user (pmo
, say) for install-site.sh
the results
are unexpected. e.g. if you're logged into a fresh vagrant box as vagrant
and
run:
sudo ./install-site.sh --dev pombola pmo pombola.127.0.0.1.xip.io
... then DIRECTORY
is set to /home/vagrant
and all of /home/vagrant
is
chown
ed to pmo.pmo
here:
There's no real use for the USER or HOST options when you're using --dev
so they should be optional.
When building a fresh Vagrant box I am seeing:
Updating APT sources...
/home/vagrant/alaveteli/commonlib/bin/install-site.sh: 167: [: false: unexpected operator
Line 167 in 02fa755
# Check that we can find the bin or script directory:
if [ -d "$REPOSITORY/bin" ]
then
BIN_DIRECTORY="$REPOSITORY/bin"
elif [ -d "$REPOSITORY/script" ]
then
BIN_DIRECTORY="$REPOSITORY/script"
else
error_msg "No bin or script directory was found in $REPOSITORY"
fi
. "$BIN_DIRECTORY/site-specific-install.sh"
This becomes a problem in rails/ruby apps with both a bin
and script
directory, which is common (and default in Rails 4). This script finds ./bin
and tries to source ./bin/site-specific-install.sh
rather than the actual location of the script (./script/site-specific-install.sh
).
After having installed FixMyStreet with the installation script, I found that I had one (or two?) $UNIX_USER occurrences in the crontab. $UNIX_USER was not set in the environment of our FixMyStreet user, and as such, produced an error.
This file is really designed (and maintained) to work on our own deployment system, it's not a generic file that is likely to work on any non-(Debian|Ubuntu) linux. We should error out saying "please contribute a package file" if the target OS is not a supported version Ubuntu or Debian. What is implicit here is that we take a strategy of supporting the current versions of Ubuntu and Debian (and perhaps checking/maintaining this in a more automated way), but don't try to do the automated install on any other linux OS.
Had to hack this call to taskset to work on OSX.
Could this maybe go something like:
if (exec("uname") eq SOME_DEBIAN_THING) {
# Using taskset to deal with debian 5 php/mysql extension bug,
# by restricting to one processor
exec('taskset', '0x1', $php_path) or throw Error::Simple "$php_path: exec: $!";
} else {
exec($php_path) or throw Error::Simple "$php_path: exec: $!";
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.