finishing file cleanup

This commit is contained in:
2024-11-11 18:43:05 -06:00
parent 17ed3bce46
commit 198f8633fa
66 changed files with 3558 additions and 0 deletions

88
lab/vagrant/Vagrantfile vendored Normal file
View File

@ -0,0 +1,88 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
# Convenience function for running Postgres commands. Accesses via temporarily-linked container.
def postgres(cmd)
"docker run --rm --link postgres:postgres -u postgres postgres:9.3 #{cmd}"
end
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
# If true, then any SSH connections made will enable agent forwarding.
# Default value: false
# config.ssh.forward_agent = true
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
config.vm.provider "virtualbox" do |vb|
# # Don't boot with headless mode
# vb.gui = true
#
# # Use VBoxManage to customize the VM. For example to change memory:
# vb.customize ["modifyvm", :id, "--memory", "1024"]
vb.memory = 1024
end
#
# View the documentation for the provider you're using for more
# information on available options. # Enable provisioning with CFEngine. CFEngine Community packages are
config.vm.define :hearth do |hearth|
hearth.vm.box = "ubuntu/trusty64"
hearth.vm.hostname = "hearth"
hearth.vm.network :forwarded_port, guest: 80, host: 8080
hearth.vm.provision :docker do |d|
d.pull_images "postgres:9.3"
d.build_image "/vagrant/docker/thefnf/freeradius", args: "-t thefnf/freeradius"
d.build_image "/vagrant/docker/thefnf/odoo", args: "-t thefnf/odoo"
d.run "thefnf/freeradius", args: "--name radius -p :1813:1813 -p :1863:1863"
d.run "postgres:9.3", args: "--name postgres"
end
hearth.vm.provision :shell, inline: """
sleep 5 # Give Postgres a chance to start
#{postgres("psql -h postgres -c \"CREATE USER odoo WITH UNENCRYPTED PASSWORD 'password' CREATEDB;\"")}
"""
hearth.vm.provision :docker do |d|
d.run "thefnf/odoo", args: "--name odoo --link postgres:postgres -p :80:8069"
end
end
config.vm.define :freedomlink do |fl|
fl.vm.box = "box-cutter/debian76"
fl.vm.hostname = "freedomlink"
end
end

View File

@ -0,0 +1,6 @@
FROM ubuntu:14.04
EXPOSE 1813 1863
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y freeradius
CMD freeradius -f

View File

@ -0,0 +1,55 @@
FROM debian:7
ENV VERSION 3.3
RUN echo deb http://freeside.biz/~ivan/freeside-wheezy/ ./ >/etc/apt/sources.list.d/freeside.list && \
apt-get update && \
apt-get upgrade -y && \
apt-get install -y --force-yes --no-install-recommends adduser apache2 apache2-mpm-prefork apache2-utils curl gcc gnupg ghostscript gsfonts gzip latex-xcolor \
less libapache-dbi-perl libapache2-mod-perl2 libapache2-request-perl libapache-session-perl \
libbusiness-creditcard-perl libcache-cache-perl libcache-simple-timedexpiry-perl libchart-perl \
libclass-container-perl libclass-data-inheritable-perl libclass-returnvalue-perl libcolor-scheme-perl \
libio-compress-perl libconvert-binhex-perl libcrypt-passwdmd5-perl libcrypt-ssleay-perl libcss-squish-perl \
libdate-manip-perl libdbd-mysql-perl libdbd-pg-perl libdbi-perl libdbix-dbschema-perl libdbix-searchbuilder-perl \
libdevel-stacktrace-perl libdevel-symdump-perl liberror-perl libexception-class-perl \
libfile-counterfile-perl libfile-rsync-perl libfont-afm-perl libfreezethaw-perl libfrontier-rpc-perl \
libgd-gd2-perl libgd-graph-perl libgd2-xpm libhtml-format-perl libhtml-mason-perl libhtml-parser-perl \
libhtml-scrubber-perl libhtml-tagset-perl libhtml-tree-perl libhtml-widgets-selectlayers-perl libio-stringy-perl \
libipc-run-perl libipc-run3-perl libipc-sharelite-perl libjavascript-rpc-perl libjson-perl \
liblingua-en-inflect-perl liblingua-en-nameparse-perl liblocale-gettext-perl liblocale-maketext-fuzzy-perl \
liblocale-maketext-lexicon-perl liblocale-subcountry-perl liblog-dispatch-perl libmailtools-perl libmime-tools-perl \
libmodule-versions-report-perl libnet-daemon-perl libnet-ping-external-perl libnet-scp-perl libnet-ssh-perl \
libnet-whois-raw-perl libnetaddr-ip-perl libnumber-format-perl libpam-modules libpam-runtime libpaper-utils \
libparams-validate-perl libparse-recdescent-perl libpcre3 libpg-perl libregexp-common-perl \
libspreadsheet-writeexcel-perl libstring-approx-perl libstring-shellquote-perl libterm-readkey-perl \
libtest-inline-perl libtext-autoformat-perl libtext-charwidth-perl libtext-csv-perl libtext-csv-xs-perl libtext-iconv-perl \
libtext-quoted-perl libtext-reform-perl libtext-template-perl libtext-wrapi18n-perl libtext-wrapper-perl \
libtie-ixhash-perl libtime-duration-perl libtime-modules-perl libtimedate-perl libtree-simple-perl \
libuniversal-require-perl liburi-perl libwant-perl libwww-perl libxml-parser-perl libyaml-perl lmodern make \
perl perl-base perl-modules texlive \
texlive-latex-extra texinfo traceroute ttf-bitstream-vera ttf-dustin ucf zlib1g \
libdatetime-perl libdatetime-format-strptime-perl libfile-slurp-perl libspreadsheet-parseexcel-perl \
libauthen-passphrase-perl libnet-domain-tld-perl libbusiness-us-usps-webtools-perl libxml-simple-perl \
libemail-sender-perl libemail-sender-transport-smtp-tls-perl libemail-sender-perl \
libemail-sender-transport-smtp-tls-perl libhtml-defang-perl libdatetime-format-natural-perl libcgi-pm-perl \
libfile-sharedir-perl libmodule-versions-report-perl libtext-wikiformat-perl libnet-server-perl \
libhttp-server-simple-perl libhtml-rewriteattributes-perl libmime-types-perl libperlio-eol-perl \
libgnupg-interface-perl libdata-ical-perl libcalendar-simple-perl libdatetime-set-perl \
libhook-lexwrap-perl libhttp-server-simple-mason-perl libxml-rss-perl libipc-run-safehandles-perl libpoe-perl \
libsoap-lite-perl libhtml-tableextract-perl libhtml-element-extended-perl libcam-pdf-perl libgd-barcode-perl \
libnet-openssh-perl libgeo-coder-googlev3-perl libgeo-googleearth-pluggable-perl libnet-snmp-perl \
libcrypt-openssl-rsa-perl libpdf-webkit-perl wkhtmltopdf xvfb \
sam2p psmisc libsys-sigaction-perl liblog-dispatch-perl libconvert-color-perl libdate-simple-perl libemail-valid-perl \
libencode-perl libexcel-writer-xlsx-perl libhtml-mason-psgihandler-perl libhtml-quoted-perl libio-string-perl \
libregexp-common-net-cidr-perl libregexp-ipv6-perl libsnmp-perl libtext-password-pronounceable-perl \
libparse-fixedlength-perl && \
cd /usr/src && \
curl http://www.freeside.biz/freeside/freeside-$VERSION.tar.gz |tar xz && \
adduser freeside --system --group --shell /bin/bash && \
rm -rf /var/www/*
ADD Makefile /usr/src/freeside-$VERSION/Makefile
RUN cd /usr/src/freeside-$VERSION && \
make perl-modules && \
make install-perl-modules && \
make create-config && \
make install-docs && \
make install-apache
USER freeside

View File

@ -0,0 +1,468 @@
#!/usr/bin/make
#solaris and perhaps other very weirdass /bin/sh
#SHELL="/bin/ksh"
DB_TYPE = Pg
#DB_TYPE = mysql
DB_USER = freeside
DB_PASSWORD=password
DATASOURCE = DBI:${DB_TYPE}:dbname=freeside;host=postgres
#changable now (some things which should go to the others still go to CONF)
FREESIDE_CONF = /usr/local/etc/freeside
FREESIDE_LOG = /usr/local/etc/freeside
FREESIDE_LOCK = /usr/local/etc/freeside
FREESIDE_CACHE = /usr/local/etc/freeside
FREESIDE_EXPORT = /usr/local/etc/freeside
MASON_HANDLER = ${FREESIDE_CONF}/handler.pl
MASONDATA = ${FREESIDE_CACHE}/masondata
#where to put the default configuraiton used by freeside-setup to initialize
#a new database (not used after that). primarily of interest to distro
#package maintainers
DIST_CONF = ${FREESIDE_CONF}/default_conf
#deb
FREESIDE_DOCUMENT_ROOT = /var/www
#redhat, fedora, mandrake
#FREESIDE_DOCUMENT_ROOT = /var/www/html/freeside
#freebsd
#FREESIDE_DOCUMENT_ROOT = /usr/local/www/data/freeside
#openbsd
#FREESIDE_DOCUMENT_ROOT = /var/www/htdocs/freeside
#suse
#FREESIDE_DOCUMENT_ROOT = /srv/www/htdocs/freeside
#apache
#FREESIDE_DOCUMENT_ROOT = /usr/local/apache/htdocs/freeside
#deb, redhat, fedora, mandrake, suse, others?
INIT_FILE = /etc/init.d/freeside
#freebsd
#INIT_FILE = /usr/local/etc/rc.d/011.freeside.sh
#deb
INIT_INSTALL = PATH=$PATH:/sbin /usr/sbin/update-rc.d freeside defaults 23 01
#redhat, fedora
#INIT_INSTALL = /sbin/chkconfig freeside on
#not necessary (freebsd)
#INIT_INSTALL = /usr/bin/true
#deb, suse
#HTTPD_RESTART = /etc/init.d/apache restart
#deb w/apache2
HTTPD_RESTART = /etc/init.d/apache2 restart
#redhat, fedora, mandrake
#HTTPD_RESTART = /etc/init.d/httpd restart
#freebsd
#HTTPD_RESTART = /usr/local/etc/rc.d/apache.sh stop || true; sleep 10; /usr/local/etc/rc.d/apache.sh start
#openbsd
#HTTPD_RESTART = kill -TERM `cat /var/www/logs/httpd.pid`; sleep 10; /usr/sbin/httpd -u -DSSL
#apache
#HTTPD_RESTART = /usr/local/apache/bin/apachectl stop; sleep 10; /usr/local/apache/bin/apachectl startssl
#(an include directory, not a file, "Include /etc/apache/conf.d" in httpd.conf)
#deb (3.1+), apache2
APACHE_CONF = /etc/apache2/conf.d
INSSERV_OVERRIDE = /etc/insserv/overrides
FREESIDE_RESTART = ${INIT_FILE} restart
#deb, redhat, fedora, mandrake, suse, others?
INSTALLGROUP = root
#freebsd, openbsd
#INSTALLGROUP = wheel
#edit the stuff below to have the daemons start
QUEUED_USER=fs_queue
API_USER = fs_api
SELFSERVICE_USER = fs_selfservice
#never run on the same machine in production!!!
SELFSERVICE_MACHINES =
# SELFSERVICE_MACHINES = www.example.com
# SELFSERVICE_MACHINES = web1.example.com web2.example.com
#user with sudo access on SELFSERVICE_MACHINES for automated self-service
#installation.
SELFSERVICE_INSTALL_USER = ivan
SELFSERVICE_INSTALL_USERADD = /usr/sbin/useradd
#SELFSERVICE_INSTALL_USERADD = "/usr/sbin/pw useradd"
#RT_ENABLED = 0
RT_ENABLED = 1
RT_DOMAIN = example.com
RT_TIMEZONE = US/Pacific
#RT_TIMEZONE = US/Eastern
FREESIDE_URL = "http://localhost/freeside/"
#for now, same db as specified in DATASOURCE... eventually, otherwise?
RT_DB_DATABASE = freeside
TORRUS_ENABLED = 0
# for auto-version updates, so we can "make release" more things automatically
RPM_SPECFILE = rpm/freeside.spec
#---
#rt/config.layout.in
RT_PATH = /opt/rt3
#only used for dev kludge now, not a big deal
FREESIDE_PATH = `pwd`
PERL_INC_DEV_KLUDGE = /usr/local/share/perl/5.14.2/
VERSION := `grep '^$$VERSION' FS/FS.pm | cut -d\' -f2`
TAG := freeside_`grep '^$$VERSION' FS/FS.pm | cut -d\' -f2 | perl -pe 's/\./_/g'`
#DEBVERSION = `echo ${VERSION} | perl -pe 's/(\d)([a-z])/\1~\2/'`-1
TEXMFHOME := "\$$TEXMFHOME"
ver:
@echo "${VERSION}"
tag:
@echo "${TAG}"
help:
@echo "supported targets:"
@echo " create-database create-config"
@echo " install deploy"
@echo " configure-rt create-rt"
@echo " clean help"
@echo
@echo " install-docs install-perl-modules"
@echo " install-init install-apache"
@echo " install-rt install-texmf"
@echo " install-selfservice update-selfservice"
@echo
@echo " dev dev-docs dev-perl-modules"
@echo
@echo " masondocs alldocs docs"
@echo " wikiman"
@echo " perl-modules"
#@echo
#@echo " upload-docs release"
masondocs: httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/*
rm -rf masondocs
cp -pr httemplate masondocs
touch masondocs
alldocs: masondocs
docs:
make masondocs
wikiman:
chmod a+rx ./bin/pod2x
./bin/pod2x
install-docs: docs
#ancient attempt to avoid overwriting customer modifications directly to production web files that's overlived its usefulness
#[ -e ${FREESIDE_DOCUMENT_ROOT} ] && mv ${FREESIDE_DOCUMENT_ROOT} ${FREESIDE_DOCUMENT_ROOT}.`date +%Y%m%d%H%M%S` || true
#cp -r masondocs ${FREESIDE_DOCUMENT_ROOT}
[ -h ${FREESIDE_DOCUMENT_ROOT} ] && rm ${FREESIDE_DOCUMENT_ROOT} || true
mkdir -p ${FREESIDE_DOCUMENT_ROOT}
cp -r masondocs/* masondocs/.htaccess ${FREESIDE_DOCUMENT_ROOT}
chown -R freeside:freeside ${FREESIDE_DOCUMENT_ROOT}
install -D htetc/handler.pl ${MASON_HANDLER}
perl -p -i -e "\
s|%%%FREESIDE_EXPORT%%%|${FREESIDE_EXPORT}|g;\
s'%%%RT_ENABLED%%%'${RT_ENABLED}'g; \
" ${MASON_HANDLER} || true
mkdir -p ${FREESIDE_EXPORT}/profile
chown freeside ${FREESIDE_EXPORT}/profile
cp htetc/htpasswd.logout ${FREESIDE_CONF}
[ ! -e ${MASONDATA} ] && mkdir ${MASONDATA} || true
chown -R freeside ${MASONDATA}
dev-docs:
[ -e ${FREESIDE_DOCUMENT_ROOT} ] && mv ${FREESIDE_DOCUMENT_ROOT} ${FREESIDE_DOCUMENT_ROOT}.`date +%Y%m%d%H%M%S` || true
ln -s ${FREESIDE_PATH}/httemplate ${FREESIDE_DOCUMENT_ROOT}
cp htetc/handler.pl ${MASON_HANDLER}
perl -p -i -e "\
s'###use Module::Refresh;###'use Module::Refresh;'; \
s'###Module::Refresh->refresh;###'Module::Refresh->refresh;'; \
s|%%%FREESIDE_EXPORT%%%|${FREESIDE_EXPORT}|g;\
s'%%%RT_ENABLED%%%'${RT_ENABLED}'g; \
" ${MASON_HANDLER} || true
perl-modules:
cd FS; \
[ -e Makefile ] || perl Makefile.PL; \
make; \
perl -p -i -e "\
s|%%%FREESIDE_CONF%%%|${FREESIDE_CONF}|g;\
s|%%%FREESIDE_CACHE%%%|${FREESIDE_CACHE}|g;\
s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g; \
s'%%%RT_ENABLED%%%'${RT_ENABLED}'g; \
s'%%%RT_PATH%%%'${RT_PATH}'g; \
s'%%%MASONDATA%%%'${MASONDATA}'g;\
s/%%%SELFSERVICE_USER%%%/${SELFSERVICE_USER}/g;\
" blib/lib/FS/*.pm;\
perl -p -i -e "\
s/%%%SELFSERVICE_USER%%%/${SELFSERVICE_USER}/g;\
s/%%%SELFSERVICE_MACHINES%%%/${SELFSERVICE_MACHINES}/g;\
s|%%%FREESIDE_EXPORT%%%|${FREESIDE_EXPORT}|g;\
" blib/lib/FS/Cron/*.pm;\
perl -p -i -e "\
s|%%%FREESIDE_CONF%%%|${FREESIDE_CONF}|g;\
s|%%%FREESIDE_EXPORT%%%|${FREESIDE_EXPORT}|g;\
s|%%%FREESIDE_LOG%%%|${FREESIDE_LOG}|g;\
" blib/lib/FS/part_export/*.pm;\
perl -p -i -e "\
s|%%%FREESIDE_CACHE%%%|${FREESIDE_CACHE}|g;\
" blib/lib/FS/cust_main/*.pm blib/lib/FS/cust_pkg/*.pm;\
perl -p -i -e "\
s|%%%FREESIDE_LOG%%%|${FREESIDE_LOG}|g;\
" blib/lib/FS/Daemon/*.pm;\
perl -p -i -e "\
s|%%%FREESIDE_CONF%%%|${FREESIDE_CONF}|g;\
s|%%%FREESIDE_LOG%%%|${FREESIDE_LOG}|g;\
s|%%%FREESIDE_LOCK%%%|${FREESIDE_LOCK}|g;\
s|%%%FREESIDE_CACHE%%%|${FREESIDE_CACHE}|g;\
s|%%%FREESIDE_EXPORT%%%|${FREESIDE_EXPORT}|g;\
s|%%%DIST_CONF%%%|${DIST_CONF}|g;\
" blib/script/*
install-perl-modules: perl-modules install-rt-initialdata
[ -L ${PERL_INC_DEV_KLUDGE}/FS ] \
&& rm ${PERL_INC_DEV_KLUDGE}/FS \
&& mv ${PERL_INC_DEV_KLUDGE}/FS.old ${PERL_INC_DEV_KLUDGE}/FS \
|| true
cd FS; \
make install UNINST=1
#install this for freeside-setup
install -d $(DIST_CONF)
#install conf/[a-z]* $(DEFAULT_CONF)
#CVS is not [a-z]
install `ls -d conf/[a-z]* | grep -v CVS | grep -v '^conf/registries'` $(DIST_CONF)
dev-perl-modules: perl-modules
[ -d ${PERL_INC_DEV_KLUDGE}/FS -a ! -L ${PERL_INC_DEV_KLUDGE}/FS ] \
&& mv ${PERL_INC_DEV_KLUDGE}/FS ${PERL_INC_DEV_KLUDGE}/FS.old \
|| true
rm -rf ${PERL_INC_DEV_KLUDGE}/FS
ln -sf ${FREESIDE_PATH}/FS/blib/lib/FS ${PERL_INC_DEV_KLUDGE}/FS
install-texmf:
install -D -o freeside -m 444 etc/longtable.sty \
/usr/local/share/texmf/tex/latex/longtable.sty
texhash /usr/local/share/texmf
install-init:
#[ -e ${INIT_FILE} ] || install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-init ${INIT_FILE}
install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-init ${INIT_FILE}
perl -p -i -e "\
s/%%%QUEUED_USER%%%/${QUEUED_USER}/g;\
s/%%%API_USER%%%/${API_USER}/g;\
s/%%%SELFSERVICE_USER%%%/${SELFSERVICE_USER}/g;\
s/%%%SELFSERVICE_MACHINES%%%/${SELFSERVICE_MACHINES}/g;\
" ${INIT_FILE}
${INIT_INSTALL}
install-apache:
[ -e ${APACHE_CONF}/freeside-base.conf ] && rm ${APACHE_CONF}/freeside-base.conf || true
[ -d ${APACHE_CONF} ] && \
( install -o root -m 755 htetc/freeside-base2.conf ${APACHE_CONF} && \
( [ ${RT_ENABLED} -eq 1 ] && install -o root -m 755 htetc/freeside-rt.conf ${APACHE_CONF} || true ) && \
( [ ${TORRUS_ENABLED} -eq 1 ] && install -o root -m 755 htetc/freeside-torrus.conf ${APACHE_CONF} || true ) && \
perl -p -i -e "\
s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g; \
s'%%%FREESIDE_CONF%%%'${FREESIDE_CONF}'g; \
s'%%%MASON_HANDLER%%%'${MASON_HANDLER}'g; \
" ${APACHE_CONF}/freeside-*.conf \
) || true
[ -d ${INSSERV_OVERRIDE} ] && [ -x /sbin/insserv ] && ( install -o root -m 755 init.d/insserv-override-apache2 ${INSSERV_OVERRIDE}/apache2 && insserv -d ) || true
install-selfservice:
[ -e ~freeside ] || cp -pr /etc/skel ~freeside && chown -R freeside ~freeside
[ -e ~freeside/.ssh/id_dsa.pub ] || [ -e ~freeside/.ssh/id_rsa.pub ] || su - freeside -c 'ssh-keygen -t dsa'
for MACHINE in ${SELFSERVICE_MACHINES}; do \
scp -r fs_selfservice/FS-SelfService ${SELFSERVICE_INSTALL_USER}@$$MACHINE:. ;\
ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; perl Makefile.PL && make" ;\
ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; sudo make install" ;\
scp ~freeside/.ssh/id_dsa.pub ${SELFSERVICE_INSTALL_USER}@$$MACHINE:. ;\
ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "sudo ${SELFSERVICE_INSTALL_USERADD} freeside; sudo install -d -o freeside -m 755 ~freeside/.ssh/; sudo install -o freeside -m 600 ./id_dsa.pub ~freeside/.ssh/authorized_keys" ;\
ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "sudo install -o freeside -d /usr/local/freeside" ;\
done
update-selfservice:
for MACHINE in ${SELFSERVICE_MACHINES}; do \
RSYNC_RSH=ssh rsync -rlptz fs_selfservice/FS-SelfService/ ${SELFSERVICE_INSTALL_USER}@$$MACHINE:FS-SelfService ;\
ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; make clean; perl Makefile.PL && make" ;\
ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; sudo make install" ;\
done
install-chown:
chown freeside "${FREESIDE_CACHE}/counters.${DATASOURCE}"
chown freeside "${FREESIDE_CACHE}/cache.${DATASOURCE}"
chown freeside "${FREESIDE_EXPORT}/export.${DATASOURCE}"
install: install-perl-modules install-docs install-init install-apache install-rt install-torrus install-texmf install-chown
deploy: install
${HTTPD_RESTART}
${FREESIDE_RESTART}
dev: dev-perl-modules dev-docs
create-database:
perl -e 'use DBIx::DataSource qw( create_database ); create_database( "${DATASOURCE}", "${DB_USER}", "${DB_PASSWORD}" ) or die $$DBIx::DataSource::errstr;'
create-config: install-perl-modules
[ -e ${FREESIDE_CONF} ] && mv ${FREESIDE_CONF} ${FREESIDE_CONF}.`date +%Y%m%d%H%M%S` || true
install -d -o freeside ${FREESIDE_CONF}
touch ${FREESIDE_CONF}/secrets
chown freeside ${FREESIDE_CONF}/secrets
chmod 600 ${FREESIDE_CONF}/secrets
/bin/echo -e "${DATASOURCE}\n${DB_USER}\n${DB_PASSWORD}" >${FREESIDE_CONF}/secrets
chmod 600 ${FREESIDE_CONF}/secrets
chown freeside ${FREESIDE_CONF}/secrets
mkdir "${FREESIDE_CACHE}/counters.${DATASOURCE}"
chown freeside "${FREESIDE_CACHE}/counters.${DATASOURCE}"
mkdir "${FREESIDE_CACHE}/cache.${DATASOURCE}"
chown freeside "${FREESIDE_CACHE}/cache.${DATASOURCE}"
mkdir "${FREESIDE_EXPORT}/export.${DATASOURCE}"
chown freeside "${FREESIDE_EXPORT}/export.${DATASOURCE}"
#install this for freeside-setup
install -d $(DIST_CONF)
#install conf/[a-z]* $(DEFAULT_CONF)
#CVS is not [a-z]
install `ls -d conf/[a-z]* | grep -v CVS | grep -v '^conf/registries'` $(DIST_CONF)
configure-rt:
cd rt; \
cp config.layout.in config.layout; \
perl -p -i -e "\
s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g;\
s'%%%MASONDATA%%%'${MASONDATA}'g;\
" config.layout; \
./configure --enable-layout=Freeside\
--with-db-type=${DB_TYPE} \
--with-db-dba=${DB_USER} \
--with-db-database=${RT_DB_DATABASE} \
--with-db-rt-user=${DB_USER} \
--with-db-rt-pass="${DB_PASSWORD}" \
--with-web-user=freeside \
--with-web-group=freeside \
--with-rt-group=freeside \
--with-web-handler=modperl2
create-rt: configure-rt
[ -d /opt ] || mkdir /opt #doh
[ -d /opt/rt3 ] || mkdir /opt/rt3 #
[ -d /opt/rt3/share ] || mkdir /opt/rt3/share #
cd rt; make install
rt/sbin/rt-setup-database --dba '${DB_USER}' \
--dba-password '${DB_PASSWORD}' \
--action schema \
|| true
rt/sbin/rt-setup-database --dba-password '${DB_PASSWORD}' \
--action coredata \
&& rt/sbin/rt-setup-database --dba-password '${DB_PASSWORD}' \
--action insert \
--datafile ${RT_PATH}/etc/initialdata \
|| true
install-rt:
if [ ${RT_ENABLED} -eq 1 ]; then ( cd rt; make install ); fi
if [ ${RT_ENABLED} -eq 1 ]; then perl -p -i -e "\
s'%%%RT_DOMAIN%%%'${RT_DOMAIN}'g;\
s'%%%RT_TIMEZONE%%%'${RT_TIMEZONE}'g;\
s'%%%FREESIDE_URL%%%'${FREESIDE_URL}'g;\
" ${RT_PATH}/etc/RT_SiteConfig.pm; fi
if [ ${RT_ENABLED} -eq 1 ]; then \
chown -R freeside:freeside ${RT_PATH}/etc; fi
install-rt-initialdata:
if [ ${RT_ENABLED} -eq 1 ] && [ -d ${RT_PATH} ]; then \
chown -R freeside:freeside ${RT_PATH}/etc; \
install -D -o freeside -g freeside -m 0440 rt/etc/initialdata \
${RT_PATH}/etc/initialdata; fi
configure-torrus:
cd torrus; \
torrus_user=freeside var_user=freeside var_group=freeside ./configure
install-torrus:
if [ ${TORRUS_ENABLED} -eq 1 ]; then ( cd torrus; \
make; \
make install; \
perl -p -i -e "\
s'%%%FREESIDE_URL%%%'${FREESIDE_URL}'g;\
" /usr/local/etc/torrus/conf/torrus-siteconfig.pl; \
torrus clearcache \
);fi
clean:
rm -rf masondocs
rm -rf httemplate/docs/man
rm -rf pod2htmi.tmp
rm -rf pod2htmd.tmp
-cd FS; \
make clean
-cd fs_selfservice/FS-SelfService; \
make clean
#these are probably only useful if you're me...
#release: upload-docs
.PHONY: release
release:
# Update the changelog
#./bin/cvs2cl
#cvs commit -m "Updated for ${VERSION}" ChangeLog
# Update the RPM specfile
#cvs edit ${RPM_SPECFILE}
#perl -p -i -e "s/\d+[^\}]+/${VERSION}/ if /%define\s+version\s+(\d+[^\}]+)\}/;" ${RPM_SPECFILE}
#perl -p -i -e "s/\d+[^\}]+/1/ if /%define\s+release\s+(\d+[^\}]+)\}/;" ${RPM_SPECFILE}
#cvs commit -m "Updated for ${VERSION}" ${RPM_SPECFILE}
# Update the Debian changelog
#cvs edit debian/changelog
#dch -v ${DEBVERSION} -p "New upstream release"
#cvs commit -m "Updated for ${VERSION}" debian/changelog
# Make sure other people's changes are pulled in!
git pull
# Tag the release
git tag -f ${TAG}
#cd /home/ivan
git archive --prefix=freeside-${VERSION}/ ${TAG} | gzip -9 >freeside-${VERSION}.tar.gz
scp freeside-${VERSION}.tar.gz ivan@420.am:/var/www/www.sisd.com/freeside/
mv freeside-${VERSION}.tar.gz ..
#these things failing should not make release target fail, so: "|| true"
#kick off vmware update
#./BUILD_VMWARE_APPLIANCE ${$TAG} || true
#kick off deb package update
#kick off rpm package update too?
#update web demo?
#update web demo self-service?

View File

@ -0,0 +1,13 @@
FROM python:2.7
RUN apt-get install -y libldap2-dev libsasl2-dev && \
adduser odoo --system --group --shell /bin/bash
USER odoo
ENV HOME /home/odoo
ENV PATH $HOME/.local/bin:$PATH
WORKDIR /home/odoo
RUN curl http://nightly.odoo.com/8.0/nightly/src/odoo_8.0-latest.tar.gz |tar xz --strip-components 1 && \
python setup.py install --user && \
python setup.py install --user --single-version-externally-managed --root / # Strips version hash from module directories
ADD openerp_serverrc /home/odoo/.openerp_serverrc
EXPOSE 8069 8072
CMD openerp-server

View File

@ -0,0 +1,62 @@
[options]
addons_path = /home/odoo/.local/lib/python2.7/site-packages/openerp/addons
admin_passwd = admin
auto_reload = False
csv_internal_sep = ,
data_dir = /home/odoo/.local/share/Odoo
db_host = postgres
db_maxconn = 64
db_name = False
db_password = odoo
db_port = 5432
db_template = template1
db_user = odoo
dbfilter = .*
debug_mode = False
demo = {}
email_from = False
import_partial =
limit_memory_hard = 2684354560
limit_memory_soft = 2147483648
limit_request = 8192
limit_time_cpu = 60
limit_time_real = 120
list_db = True
log_db = False
log_handler = [':INFO']
log_level = info
logfile = None
logrotate = False
longpolling_port = 8072
max_cron_threads = 2
osv_memory_age_limit = 1.0
osv_memory_count_limit = False
pg_path = None
pidfile = None
proxy_mode = False
reportgz = False
secure_cert_file = server.cert
secure_pkey_file = server.pkey
server_wide_modules = None
smtp_password = False
smtp_port = 25
smtp_server = localhost
smtp_ssl = False
smtp_user = False
syslog = False
test_commit = False
test_enable = False
test_file = False
test_report_directory = False
timezone = False
translate_modules = ['all']
unaccent = False
without_demo = False
workers = 0
xmlrpc = True
xmlrpc_interface =
xmlrpc_port = 8069
xmlrpcs = True
xmlrpcs_interface =
xmlrpcs_port = 8071