Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 0 additions & 70 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,76 +34,6 @@ jobs:
- name: 'Run the unit tests'
run: prove -lrs -j4 t

webdriver_tests:
name: 'Webdriver Tests for ${{ matrix.browser.name }}'
runs-on: '${{ matrix.browser.os }}'
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
browser:
- name: 'Chromium'
command: 'chromedriver --port=4444 &'
os: 'ubuntu-22.04'
- name: 'Firefox'
command: 'MOZ_HEADLESS=1 geckodriver --log warn &'
os: 'ubuntu-22.04'

services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgrespassword
POSTGRES_DB: postgres
ports:
- 5432:5432

env:
GADS_USERNAME: 'test@example.com'
GADS_PASSWORD: 'xyz123'

steps:
- name: 'Check out the GADS code'
uses: 'actions/checkout@v4'
- name: 'Install Non-CPAN dependencies'
run: |
sudo apt-get update
sudo apt-get install cpanminus liblua5.3-dev
# Avoid "Install CPAN dependencies" needing to compile so much
sudo apt-get install libdatetime-format-sqlite-perl libtest-most-perl libdatetime-set-perl libdbix-class-schema-loader-perl
- name: 'Build cpanfile'
run: |
perl bin/output_cpanfile > cpanfile
( cd webdriver && perl ../bin/output_cpanfile ) >> cpanfile
- name: 'Install CPAN dependencies'
uses: 'perl-actions/install-with-cpanm@v1'
with:
cpanfile: 'cpanfile'
- name: 'Set up credentials for psql'
# See https://wiki.postgresql.org/wiki/Pgpass
run: |
echo '*:*:*:postgres:postgrespassword' > ~/.pgpass
chmod 600 ~/.pgpass
- name: 'create uploads directory'
run: |
mkdir -p /tmp/uploads
chmod 777 /tmp/uploads
- name: 'Start the application'
env:
DANCER_CONFDIR: 'webdriver'
PGDATABASE: 'postgres'
PGHOST: 'localhost'
PGUSER: 'postgres'
run: |
./bin/setup_database
perl bin/app.pl &
- name: 'Run the Webdriver implementation'
run: '${{ matrix.browser.command }}'
- name: 'Run the Webdriver tests'
run: prove -lmrsv webdriver/t

cypress_tests:
name: 'Cypress Tests for ${{ matrix.browser.name }}'
runs-on: '${{ matrix.browser.os }}'
Expand Down
31 changes: 29 additions & 2 deletions Makefile.PL
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use strict;
use warnings;
use ExtUtils::MakeMaker;
use File::Find;

# Normalize version strings like 6.30_02 to 6.3002,
# so that we can do numerical comparisons on it.
Expand Down Expand Up @@ -56,8 +57,6 @@ our %prereq_pm = (
'Session::Token' => 0,
'Starman' => 0,
'String::CamelCase' => 0,
'Test::MockTime' => 0,
'Test::More' => '1.302112',
'Text::Autoformat' => 0,
'Text::CSV::Encoded' => 0,
'Text::Markdown' => 0,
Expand All @@ -69,8 +68,33 @@ our %prereq_pm = (
'YAML' => 0,
);

our %test_pm = (
'Test::MockTime' => 0,
'Test::More' => '1.302112',
);

return 1 if caller();

sub pre_build {
die "yarn is not installed. Please install yarn to build this project.\n" if(!`which yarn`);

print `yarn`;
print `yarn build --no-watch`;
}

sub post_build {
print `make manifest`;
open(my $fs, ">>MANIFEST");
find sub {
my $item = $File::Find::name;
return unless $item =~ /\.sql$/gi;
print $fs $item . "\n";
}, ("share");
close $fs;
}

pre_build();

WriteMakefile(
NAME => 'GADS',
AUTHOR => q{Ctrl O <info@ctrlo.com>},
Expand All @@ -81,6 +105,9 @@ WriteMakefile(
: ()),
PL_FILES => {},
PREREQ_PM => \%prereq_pm,
TEST_REQUIRES => \%test_pm,
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'GADS-*' },
);

post_build();
1 change: 1 addition & 0 deletions bin/seed-database.pl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@

my $migration = DBIx::Class::Migration->new(
schema_class => 'GADS::Schema',
target_dir => "$FindBin::Bin/../share",
schema_args => [{
user => $dbic->{user},
password => $dbic->{password},
Expand Down
70 changes: 70 additions & 0 deletions dpkg/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
Package: GADS
Version: %version%
Section: database
Priority: optional
Architecture: amd64
Depends: libalgorithm-dependency-perl (>= 0),
libcgi-deurl-xs-perl (>= 0),
libcrypt-urandom-perl (>= 0),
libctrlo-crypt-xkcdpassword-perl (>= 0),
libctrlo-pdf-perl (>= 0.06),
libdancer2-perl (>= 0.300001),
libdancer2-plugin-auth-extensible-perl (>= 0.601),
libdancer2-plugin-auth-extensible-provider-dbic-perl (>= 0.623),
libdancer2-plugin-dbic-perl (>= 0.0013),
libdancer2-plugin-logreport-perl (>= 1.10),
libdata-compare-perl (>= 0),
libdate-holidays-gb-perl (>= 0),
libdatetime-perl (>= 0),
libdatetime-event-random-perl (>= 0),
libdatetime-format-cldr-perl (>= 0),
libdatetime-format-datemanip-perl (>= 0),
libdatetime-format-iso8601-perl (>= 0),
libdatetime-format-sqlite-perl (>= 0),
libdatetime-format-strptime-perl (>= 0),
libdatetime-set-perl (>= 0),
libdbd-pg-perl (>= 0),
libdbix-class-helpers-perl (>= 0),
libdbix-class-migration-perl (>= 0),
libdbix-class-perl (>= 0),
libfile-bom-perl (>= 0),
libfile-libmagic-perl (>= 0),
libhtml-fromtext-perl (>= 0),
libhtml-scrubber-perl (>= 0),
libinline-lua-perl (>= 0.16),
liblist-compare-perl (>= 0),
liblist-moreutils-perl (>= 0),
libscalar-list-utils-perl (>= 1.45),
liblog-log4perl-perl (>= 0),
liblog-report-perl (>= 1.28),
libmail-message-perl (>= 0),
libmail-transport-perl (>= 0),
libmath-random-isaac-xs-perl (>= 0),
libmath-round-perl (>= 0),
libmoox-singleton-perl (>= 0),
libmoox-types-mooselike-datetime-perl (>= 0),
libnamespace-clean-perl (>= 0),
libnet-oauth2-authorizationserver-perl (>= 0),
libnet-saml2-perl (>= 0),
libplack-perl (>= 1.0047),
libpdf-table-perl (>= 1.006),
libsession-token-perl (>= 0),
starman (>= 0),
libstring-camelcase-perl (>= 0),
libtext-autoformat-perl (>= 0),
libtext-csv-encoded-perl (>= 0),
libtext-markdown-perl (>= 0),
libtie-cache-perl (>= 0),
libtree-dagnode-perl (>= 0),
liburl-encode-perl (>= 0),
libwww-form-urlencoded-xs-perl (>= 0),
libwww-mechanize-chrome-perl (>= 0),
libyaml-perl (>= 0),
postfix (>=0),
libdancer2-plugin-logreport-perl (>= 0)
Recommends: postgresql (>= 0)
Maintainer: CtrlO Ltd <info@ctrlo.com>
Description: Globally Accessible Data Store (GADS) is a web application for storing and sharing data across an organisation.
It provides a simple interface for creating and managing data, as well as powerful features for sharing and collaborating on data with others.
GADS is built using the Dancer2 web framework and is designed to be easy to use and extendable.
Vcs-Git: https://github.com/ctrlo/GADS.git
39 changes: 39 additions & 0 deletions dpkg/package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh

set -e

version=$(sed -n "s/.*\$VERSION *= *['\"]*\([^'\"]*\).*/\1/p" ./lib/GADS.pm)

echo "Building scripts for GADS version $version"

yarn --frozen-lockfile
npx update-browserslist-db@latest
NODE_ENV=production yarn webpack
git checkout ./public/js/fengari-web.js

echo "Building GADS version $version"

mkdir -p GADS-$version/srv/GADS
mkdir -p GADS-$version/DEBIAN

echo "Copying files..."
cp -r bin environments lib public share views config.yml-example GADS-$version/srv/GADS/
sed "s/%version%/$version/g" dpkg/control > GADS-$version/DEBIAN/control
if [ -f dpkg/postrm ]; then
cp dpkg/postrm GADS-$version/DEBIAN/postrm
fi
if [ -f dpkg/postinst ]; then
cp dpkg/postinst GADS-$version/DEBIAN/postinst
fi

echo "Building package..."
cd GADS-$version
dpkg-deb --build . ../GADS-$version.deb

echo "Package built: GADS-$version.deb"

echo "Cleaning up..."
cd ..
rm -rf GADS-$version

echo "Done."
2 changes: 1 addition & 1 deletion lib/GADS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ tie %{schema->storage->dbh->{CachedKids}}, 'Tie::Cache', 100;
# required for that)
GADS::DB->setup(schema);

our $VERSION = '0.1';
our $VERSION = '2.8.0';

# set serializer => 'JSON';
set behind_proxy => config->{behind_proxy}; # XXX Why doesn't this work in config file
Expand Down
18 changes: 0 additions & 18 deletions webdriver/Makefile.PL

This file was deleted.

50 changes: 0 additions & 50 deletions webdriver/README.md

This file was deleted.

Loading
Loading