Skip to content

Commit 12da598

Browse files
committed
Initial commit
0 parents  commit 12da598

File tree

285 files changed

+29131
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

285 files changed

+29131
-0
lines changed

.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
appconfig.local.yml.setup
2+
concordion/.idea
3+
concordion/*.iml
4+
concordion/lib/*
5+
concordion/*.log
6+
concordion/*.log.????-??-??
7+
concordion/result/*
8+
concordion/target/*
9+
.cpanm/
10+
.DS_Store
11+
extlib/
12+
.gopancache
13+
hypnotoad.pid
14+
local/
15+
*.local.yml
16+
log
17+
*.log
18+
npm-debug.log
19+
*.swp
20+
*.tmp
21+
t/output.xml
22+
ch.gov.uk-*.zip

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "api-enumerations"]
2+
path = api-enumerations
3+
url = [email protected]:companieshouse/api-enumerations.git

.perl-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5.18.2

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Crown Copyright (Companies House)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
LOCAL ?= ./local
2+
3+
SMARTPAN_URL ?= http://darkpan.ch.gov.uk:7050
4+
5+
GETPAN_CPUS ?= -cpus 1 # Setting to null enables getpan to use all cores
6+
GETPAN_LOGLEVEL ?= INFO
7+
GETPAN_CACHEDIR ?= ./.gopancache
8+
GETPAN_ARGS ?= $(GETPAN_CPUS) -cachedir=$(GETPAN_CACHEDIR) -smart $(SMARTPAN_URL) -loglevel=$(GETPAN_LOGLEVEL) -nodepdump -nocpan -nobackpan -metacpan
9+
10+
CHS_ENV_HOME?=$(HOME)/.chs_env
11+
CHS_ENVS=$(CHS_ENV_HOME)/global_env $(CHS_ENV_HOME)/ch.gov.uk/env
12+
SOURCE_ENV=for chs_env in $(CHS_ENVS); do test -f $$chs_env && . $$chs_env; done
13+
14+
PROVE_CMD ?= $(LOCAL)/bin/prove
15+
PROVE_ARGS ?= -It/lib -Ilib -I$(LOCAL)/lib/perl5 -lr
16+
17+
TEST_UNIT_ENV ?= COOKIE_SECRET=abcdef123456 URL_SIGNING_SALT=abcdef123456
18+
19+
all: dist
20+
21+
submodules: api-enumerations/.git
22+
23+
api-enumerations/.git:
24+
git submodule init
25+
git submodule update
26+
27+
getpan:
28+
getpan $(GETPAN_ARGS)
29+
30+
clean:
31+
rm -rf $(LOCAL)
32+
rm -rf $(GETPAN_CACHEDIR)
33+
34+
test-unit:
35+
$(TEST_UNIT_ENV) $(PROVE_CMD) $(PROVE_ARGS) t/unit
36+
37+
test-int:
38+
$(SOURCE_ENV); $(PROVE_CMD) $(PROVE_ARGS) t/integration
39+
40+
test: test-unit test-int
41+
42+
build: submodules getpan
43+
44+
package:
45+
$(eval commit := $(shell git rev-parse --short HEAD))
46+
$(eval tag := $(shell git tag -l 'v*-rc*' --points-at HEAD))
47+
$(eval VERSION := $(shell if [[ -n "$(tag)" ]]; then echo $(tag) | sed 's/^v//'; else echo $(commit); fi))
48+
$(eval tmpdir:=$(shell mktemp -d build-XXXXXXXXXX))
49+
cp -r $(LOCAL) $(tmpdir)
50+
cp -r ./lib $(tmpdir)
51+
cp -r ./script $(tmpdir)
52+
cp -r ./templates $(tmpdir)
53+
cp -r ./api-enumerations $(tmpdir)
54+
cp -r ./t $(tmpdir)
55+
cp ./appconfig.yml $(tmpdir)
56+
cp ./routes.yaml $(tmpdir)
57+
cp ./errors.yml $(tmpdir)
58+
cp ./log4perl.production.conf $(tmpdir)
59+
cp ./cpanfile $(tmpdir)
60+
cp ./start.sh $(tmpdir)
61+
cd $(tmpdir); zip -r ../ch.gov.uk-$(VERSION).zip *
62+
rm -rf $(tmpdir)
63+
64+
dist: build package
65+
66+
.PHONY: all build clean dist package getpan test test-unit test-int

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
ch.gov.uk
2+
=========
3+
4+
The Companies House [public beta service](https://beta.companieshouse.gov.uk/) core web application.
5+
6+
Requirements
7+
------------
8+
9+
In order to build this service you need:
10+
11+
- GNU Make
12+
- [GetPAN](https://github.com/ian-kent/gopan/tree/master/getpan) for dependency resolution
13+
14+
In order to run this service you need:
15+
16+
- [Perl](https://www.perl.org/) >=5.18.2
17+
18+
Getting started
19+
---------------
20+
21+
#### Building the service
22+
23+
Clone this repository:
24+
25+
```
26+
$ git clone https://github.com/companieshouse/ch.gov.uk.git
27+
```
28+
29+
Initialise the submodule:
30+
```
31+
$ git submodule init
32+
$ git submodule update
33+
```
34+
35+
Resolve project dependencies by 'building' the service:
36+
37+
```
38+
$ make build
39+
```
40+
41+
#### Running the service
42+
43+
Run the service using the provided script:
44+
45+
```
46+
$ ./start.sh
47+
```
48+
49+
Configuration
50+
-------------
51+
52+
The default configuration can be overridden by either exporting environment variables at the command line prior to launching the application or by adding variable exports to `~/.chs_env/ch.gov.uk/env`.
53+

appconfig.yml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
base:
3+
url: <BASE_URL>
4+
5+
api:
6+
url: <ERIC_LOCAL_URL>
7+
key: <CHS_API_KEY>
8+
9+
cdn:
10+
url: <CDN_HOST>
11+
script_dir: <CDN_SCRIPT_DIR>
12+
13+
cookie_signing_key: "<COOKIE_SECRET>"
14+
15+
accounts_template:
16+
url: <ACCOUNTS_TEMPLATE_URL>
17+
18+
postcode:
19+
url: "<POSTCODE_SERVICE_URL>"
20+
21+
cache:
22+
backend : 'MojoX::Plugin::AnyCache::Backend::Mojo::Redis'
23+
serialiser : 'MojoX::Plugin::AnyCache::Serialiser::MessagePack'
24+
server : "<CACHE_SERVER>"
25+
redis_protocol: Protocol::Redis::XS
26+
27+
cookie_domain: "<COOKIE_DOMAIN>"
28+
29+
security:
30+
oauth2_request_key : "<CH_OAUTH2_REQUEST_KEY>"
31+
32+
url_sign_salt: "<URL_SIGNING_SALT>"
33+
34+
identity_providers:
35+
companies_house:
36+
redirect_uri : '<CHS_URL>/oauth2/user/callback'
37+
client_id : '<CHS_CH_CLIENT_ID>'
38+
client_secret : '<CHS_CH_CLIENT_SECRET>'
39+
authorize_url : '<ACCOUNT_URL>/oauth2/authorise'
40+
token_url : '<ACCOUNT_LOCAL_URL>/oauth2/token'
41+
profile_url : '<ACCOUNT_LOCAL_URL>/user/profile'
42+
home_url : '<CHS_URL>'
43+
44+
external_url_for:
45+
manage_user_details : '<ACCOUNT_URL>/user/account'
46+
make_authcode_change: '<ACCOUNT_URL>/company/:company_number/authcode/change'
47+
follow_company : '<CHS_MONITOR_GUI_URL>/company/:company_number/confirm-follow'
48+
unfollow_company : '<CHS_MONITOR_GUI_URL>/company/:company_number/confirm-unfollow'
49+
file_accounts : '<CHS_URL>/company/:company_number/submit-abridged-accounts/criteria'
50+
51+
admin_url_for:
52+
roles : <ACCOUNT_URL>/admin/roles
53+
queues : <CHS_BACKEND_URL>/admin/queues
54+
refresh_company : <CHS_BACKEND_URL>/admin/company/
55+
user_search : <ACCOUNT_URL>/admin/user/search
56+
transaction : <CHS_URL>/admin/transactions/:transaction_id
57+
transaction_by_company_number: <CHS_URL>/admin/company/:company_number/transactions
58+
monitor : <CHS_MONITOR_GUI_URL>/admin/monitor
59+
60+
filing_history:
61+
items_per_page: 25
62+
63+
officer_appointments:
64+
items_per_page: 35
65+
66+
piwik:
67+
url: "<PIWIK_URL>"
68+
site_id: <PIWIK_SITE_ID>
69+
embed: <PIWIK_EMBED>
70+
71+
statsd:
72+
host: "<STATSD_HOST>"
73+
port: "<STATSD_PORT>"
74+
75+
queue_api:
76+
url: <QUEUE_API_LOCAL_URL>
77+
78+
private_beta_follow: <PRIVATE_BETA_FOLLOW>
79+
disable_filing: <DISABLE_FILING>
80+
disable_follow: <DISABLE_FOLLOW>
81+
82+
web_proxy:
83+
doc_api: <WEB_PROXY_DOC_API_HTTP>
84+
monitor_api: <WEB_PROXY_MONITOR_API_HTTP>
85+
86+
elasticsearch:
87+
max_pages: <ELASTIC_SEARCH_MAX_PAGES>
88+
max_results: <ELASTIC_SEARCH_MAX_RESULTS>
89+
90+
feature:
91+
mortgage: <MORTGAGE_FEATURE>
92+
psc: <PSC_FEATURE>
93+
94+
image_service_start_date: <IMAGE_SERVICE_START_DATE>
95+
96+
disable_download_xhtml_link: <DISABLE_DOWNLOAD_XHTML_LINK>
97+
98+
recently_filed_days: <RECENTLY_FILED_DAYS>
99+
100+
unavailable_date: <UNAVAILABLE_DATE>
101+
102+
disable_previous_names: <DISABLE_PREVIOUS_NAMES>
103+
104+
display_image_disabled_message: <IMAGE_DISABLED_MESSAGE>
105+
image_disabled_message_header: <IMAGE_DISABLED_MESSAGE_HEADER>
106+
image_disabled_message_text: <IMAGE_DISABLED_MESSAGE_TEXT>
107+
108+
disable_feedback_form: <DISABLE_FEEDBACK_FORM>
109+
monitor:
110+
api_url: <CHS_MONITOR_API_LOCAL_URL>
111+
gui_url: <CHS_MONITOR_GUI_URL>
112+
113+
confirmation_statement_available_date: <CONFIRMATION_STATEMENT_AVAILABLE_DATE>
114+
115+
xhtml_available_date: <XHTML_AVAILABLE_DATE>
116+
117+
pflp_feature_enabled: <PFLP_FEATURE_ENABLED>
118+
119+
file_accounts_available_date: <FILE_ACCOUNTS_AVAILABLE_DATE>
120+
121+
max_memory_usage: <MAX_MEMORY_USAGE>
122+
shared_memory_percentage: <SHARED_MEMORY_PERCENTAGE>

cpanfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# make sure the correct versions of the following modules
2+
# are resolved upfront by "pre-requiring" them.
3+
# XXX unlike the rest of this file, the order in this
4+
# section is important.
5+
requires 'Log::Log4perl', '==1.49'; # Needs to be before CH::Perl
6+
requires 'Log::Log4perl::Appender::Fluent', '==0.04'; # Needs to be before CH::Perl
7+
requires 'AnyEvent', '==7.12';
8+
requires 'Mojolicious', '==5.47';
9+
requires 'Moose', '==2.1402';
10+
11+
requires 'CH::MojoX::Administration::Plugin', '==0.35';
12+
requires 'Net::CompaniesHouse', '==0.65';
13+
requires 'CH::MojoX::Plugin::API', '==0.40';
14+
requires 'CH::MojoX::Plugin::Config', '==0.31';
15+
requires 'CH::MojoX::Plugin::Exception', '==0.31';
16+
requires 'CH::MojoX::Plugin::HealthCheck', '==0.11';
17+
requires 'CH::MojoX::Plugin::QueueAPI', '==0.31';
18+
requires 'CH::MojoX::Plugin::Xslate', '==0.34';
19+
requires 'CH::MojoX::SignIn::Plugin', '==0.44';
20+
requires 'CH::Perl', '==0.31';
21+
requires 'Crypt::Rijndael', '==1.12';
22+
requires 'Data::Dumper::Concise', '==2.023';
23+
requires 'Date::Calc', '==6.3';
24+
requires 'DateTime::Format::ISO8601', '==0.08';
25+
requires 'DateTime::Tiny', '==1.04';
26+
requires 'Digest::SHA1', '==2.13';
27+
requires 'JSON::WebEncryption', '==0.06';
28+
requires 'Locale::Simple', '==0.016';
29+
requires 'Log::Declare', '==0.10';
30+
requires 'MojoX::JSON::XS', '==0.30';
31+
requires 'MojoX::Log::Declare', '==0.32';
32+
requires 'MojoX::Plugin::AnyCache', '==0.33';
33+
requires 'MojoX::Plugin::Hook::BeforeRendered', '==0.30';
34+
requires 'MojoX::Plugin::PODRenderer', '==0.30';
35+
requires 'MojoX::Plugin::Statsd', '==0.30';
36+
requires 'MojoX::Renderer::IncludeLater', '==0.30';
37+
requires 'MojoX::Renderer::Xslate', '==0.092';
38+
requires 'MojoX::Security::Session', '==0.38';
39+
requires 'MojoX::URL::Sign', '==0.30';
40+
requires 'MooseX::Model', '==0.31';
41+
requires 'Protocol::Redis::XS', '==0.05';
42+
requires 'Readonly', '==2.00';
43+
44+
test_requires 'CH::Test', '==0.32';
45+
test_requires 'Test::Differences', '==0.63';

0 commit comments

Comments
 (0)