├── .bp-config ├── options.json └── php │ └── php.ini.d │ ├── extensions.ini │ ├── misc.ini │ └── uploads.ini ├── .cfignore ├── .editorconfig ├── .gitattributes ├── .github └── workflows │ ├── commit.yml │ ├── crawl-long.yml │ ├── crawl.yml │ └── restart.yml ├── .gitignore ├── .gitmodules ├── .profile ├── .snyk ├── CONTRIBUTING.md ├── Jenkinsfile ├── LICENSE.md ├── Makefile ├── README.md ├── application ├── config │ ├── autoload.php │ ├── config.php │ ├── config.sample.php │ ├── constants.php │ ├── database.php │ ├── database.sample.php │ ├── doctypes.php │ ├── foreign_chars.php │ ├── gearman.php │ ├── gearman.php.sample │ ├── hooks.php │ ├── index.html │ ├── memcached.php │ ├── migration.php │ ├── mimes.php │ ├── profiler.php │ ├── routes.php │ ├── smileys.php │ ├── upload.php │ ├── upload.sample.php │ └── user_agents.php ├── controllers │ ├── Campaign.php │ ├── Docs.php │ ├── Export.php │ ├── Healthcheck.php │ ├── Import.php │ ├── Merge.php │ ├── Migrate.php │ ├── Offices.php │ ├── Welcome.php │ └── index.html ├── core │ └── index.html ├── helpers │ ├── api_helper.php │ ├── csv_helper.php │ └── index.html ├── hooks │ └── index.html ├── index.html ├── language │ ├── english │ │ └── index.html │ └── index.html ├── libraries │ ├── CILogger.php │ ├── DataJsonParser.php │ ├── Lib_gearman.php │ ├── Markdown.php │ └── index.html ├── logs │ └── index.html ├── migrations │ ├── 001_datajson_stat_versioning.php │ ├── 002_office_ids.php │ ├── 003_sess_use_database.php │ ├── 004_alter_session_table.php │ ├── 005_create_logging_table.php │ ├── 006_update_session_table_id.php │ ├── 007_add_omb_monitored_flag.php │ ├── 008_fix_nasa_url.php │ ├── 009_add_idempotent_migration_scaffolding.php │ ├── 010_add_long_running_flag.php │ ├── 011_add_and_edit_omb_monitored_agencies.php │ ├── 012_add_fcc_to_omb_monitored_agencies.php │ ├── 013_fix_navy_name.php │ └── offices.csv ├── models │ ├── Campaign_model.php │ └── index.html ├── tests │ ├── .gitignore │ ├── Bootstrap.php │ ├── DbTestCase.php │ ├── TestCase.php │ ├── UnitTestCase.php │ ├── controllers │ │ ├── .gitkeep │ │ ├── API_test.php │ │ ├── Offices_test.php │ │ ├── Strapping_test.php │ │ └── Welcome_test.php │ ├── helpers │ │ ├── .gitkeep │ │ └── api_helper_test.php │ ├── hooks │ │ └── .gitkeep │ ├── libraries │ │ └── .gitkeep │ ├── migrations │ │ └── Migrate_test.php │ ├── mocks │ │ ├── autoloader.php │ │ └── libraries │ │ │ └── email.php │ ├── models │ │ ├── .gitkeep │ │ └── Campaign_model_test.php │ └── phpunit.xml ├── third_party │ └── index.html └── views │ ├── changeset.php │ ├── changeset_result.php │ ├── csv_upload_removed.php │ ├── digitalstrategy.php │ ├── docs.php │ ├── errors │ ├── cli │ │ ├── error_404.php │ │ ├── error_db.php │ │ ├── error_exception.php │ │ ├── error_general.php │ │ ├── error_php.php │ │ └── index.html │ ├── html │ │ ├── error_404.php │ │ ├── error_db.php │ │ ├── error_exception.php │ │ ├── error_general.php │ │ ├── error_php.php │ │ └── index.html │ └── index.html │ ├── export.php │ ├── footer.php │ ├── header_inc_view.php │ ├── header_meta_inc_view.php │ ├── index.html │ ├── logout_view.php │ ├── merge.php │ ├── office_detail.php │ ├── office_list.php │ ├── office_table_inc_view.php │ ├── upgrade_schema.php │ ├── validate.php │ ├── validate_response.php │ └── welcome_message.php ├── archive ├── .git_keep └── digitalstrategy │ └── .git_keep ├── bin ├── cf-crawl-daily.sh ├── cf-crawl-long.sh ├── check-diff.sh ├── composer ├── install.php ├── jenkins_build ├── my-codeigniter.sh ├── router.php └── server.sh ├── bootstrap.php ├── composer.json ├── composer.lock ├── docker-compose.yml ├── docker ├── Dockerfile ├── install-composer.sh ├── startup.sh └── wait_for_db ├── documentation ├── about.md ├── main.md ├── modernizr-config.json ├── modernizr.md └── rubric.md ├── dotenv_sample ├── downloads └── README.md ├── manifest.yml ├── public ├── .htaccess ├── css │ ├── bootstrap-theme.css │ ├── bootstrap-theme.min.css │ ├── bootstrap.css │ ├── bootstrap.min.css │ ├── font-awesome.min.css │ ├── highlight.css │ ├── main.css │ └── morris.css ├── favicon.ico ├── fonts │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.svg │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ ├── fontawesome-webfont.woff2 │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── index.php └── js │ ├── main.js │ └── vendor │ ├── FileSaver.js │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── g.pie.js │ ├── g.raphael-min.js │ ├── g.raphael.js │ ├── highlight.pack.js │ ├── jquery-3.6.0.min.js │ ├── modernizr.min.js │ ├── moment.min.js │ ├── morris.min.js │ └── raphael-min.js ├── schema ├── catalog.json ├── federal-v1.1 │ ├── catalog.json │ ├── dataset.json │ ├── distribution.json │ ├── organization.json │ └── vcard.json ├── federal │ ├── catalog.json │ └── single_entry.json ├── fitara │ ├── boards.json │ └── leaders.json ├── non-federal-temp │ ├── catalog.json │ └── single_entry.json ├── non-federal-v1.1 │ ├── catalog.json │ ├── dataset-non-federal.json │ ├── distribution.json │ ├── organization.json │ └── vcard-non-federal.json ├── non-federal │ ├── catalog.json │ └── single_entry.json └── single_entry.json ├── sql ├── datagov_campaign.sql ├── notes.sql ├── offices.sql └── users_auth.sql ├── tests ├── 00_migrate.bats ├── baddata.json ├── opendata.json ├── s3.bats └── validation.bats ├── uploads └── .git_keep ├── vars.development.yml ├── vars.production.yml ├── vars.staging.yml └── vars.yml.template /.bp-config/options.json: -------------------------------------------------------------------------------- 1 | { 2 | "WEBDIR": "public", 3 | "COMPOSER_VENDOR_DIR": "{BUILD_DIR}/vendor" 4 | } 5 | -------------------------------------------------------------------------------- /.bp-config/php/php.ini.d/extensions.ini: -------------------------------------------------------------------------------- 1 | extension=mysqli.so 2 | extension=pcntl.so 3 | -------------------------------------------------------------------------------- /.bp-config/php/php.ini.d/misc.ini: -------------------------------------------------------------------------------- 1 | request_terminate_timeout = 120s 2 | pm.max_requests = 500 3 | pm.max_children = 50 4 | -------------------------------------------------------------------------------- /.bp-config/php/php.ini.d/uploads.ini: -------------------------------------------------------------------------------- 1 | upload_max_filesize="200M" 2 | post_max_size="200M" 3 | -------------------------------------------------------------------------------- /.cfignore: -------------------------------------------------------------------------------- 1 | .gitignore -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | ; This file is for unifying the coding style for different editors and IDEs. 2 | ; More information at http://editorconfig.org 3 | 4 | ; Don't look higher than this file for this project 5 | root = true 6 | 7 | ; Use UTF8, Unix-style line endings, indent with 4 spaces, end files with a newline, trim trailing whitespace 8 | [*] 9 | charset = utf-8 10 | end_of_line = lf 11 | indent_style = space 12 | indent_size = 4 13 | insert_final_newline = true 14 | trim_trailing_whitespace = true 15 | ; C-style doc comments 16 | block_comment_start = /* 17 | block_comment = * 18 | block_comment_end = */ 19 | 20 | ; Trailing whitespace can be important in Markdown for continuing lines 21 | ; Limit lines to 80 characters wide to make files easily readable in a terminal 22 | [*.md] 23 | trim_trailing_whitespace = false 24 | max_line_length = 80 25 | 26 | ; Use smaller indent size for YAML files, since nesting tends to be deep 27 | [*.{yml,yaml}] 28 | indent_size = 2 29 | 30 | ; Tabs are significant for Makefiles 31 | [Makefile] 32 | indent_style = tab 33 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | composer.lock merge=binary linguist-generated 2 | -------------------------------------------------------------------------------- /.github/workflows/commit.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: commit 3 | 4 | on: 5 | push: 6 | 7 | 8 | jobs: 9 | test: 10 | name: test 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: checkout 14 | uses: actions/checkout@v3 15 | - name: run-tests 16 | run: make cloud-test 17 | 18 | deploy-development: 19 | if: github.ref == 'refs/heads/develop' 20 | name: deploy (development) 21 | environment: development 22 | runs-on: ubuntu-latest 23 | needs: 24 | - test 25 | steps: 26 | - name: checkout 27 | uses: actions/checkout@v3 28 | - name: deploy 29 | uses: cloud-gov/cg-cli-tools@main 30 | with: 31 | command: cf push dashboard --vars-file vars.development.yml --strategy rolling 32 | cf_org: gsa-datagov 33 | cf_space: development 34 | cf_username: ${{secrets.CF_SERVICE_USER}} 35 | cf_password: ${{secrets.CF_SERVICE_AUTH}} 36 | - name: smoke test 37 | run: curl --fail --silent https://dashboard-dev-datagov.app.cloud.gov/healthcheck?$(date +%s) 38 | 39 | deploy-staging: 40 | if: github.ref == 'refs/heads/main' 41 | name: deploy (staging) 42 | environment: staging 43 | runs-on: ubuntu-latest 44 | needs: 45 | - test 46 | steps: 47 | - name: checkout 48 | uses: actions/checkout@v3 49 | - name: deploy 50 | uses: cloud-gov/cg-cli-tools@main 51 | with: 52 | command: cf push dashboard-stage --vars-file vars.staging.yml --strategy rolling 53 | cf_org: gsa-datagov 54 | cf_space: staging 55 | cf_username: ${{secrets.CF_SERVICE_USER}} 56 | cf_password: ${{secrets.CF_SERVICE_AUTH}} 57 | - name: smoke test 58 | run: curl --fail --silent https://dashboard-stage-datagov.app.cloud.gov/healthcheck?$(date +%s) 59 | 60 | deploy-production: 61 | if: github.ref == 'refs/heads/main' 62 | name: deploy (production) 63 | environment: production 64 | runs-on: ubuntu-latest 65 | needs: 66 | - deploy-staging 67 | steps: 68 | - name: checkout 69 | uses: actions/checkout@v3 70 | - name: deploy 71 | uses: cloud-gov/cg-cli-tools@main 72 | with: 73 | command: cf push dashboard --vars-file vars.production.yml --strategy rolling 74 | cf_org: gsa-datagov 75 | cf_space: prod 76 | cf_username: ${{secrets.CF_SERVICE_USER}} 77 | cf_password: ${{secrets.CF_SERVICE_AUTH}} 78 | - name: smoke test 79 | run: curl --fail --silent https://dashboard-prod-datagov.app.cloud.gov/healthcheck?$(date +%s) 80 | -------------------------------------------------------------------------------- /.github/workflows/crawl-long.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Dashboard crawl-long 3 | 4 | on: 5 | workflow_dispatch: 6 | schedule: 7 | - cron: '30 12 1 1,4,7,10 *' 8 | 9 | jobs: 10 | dashboard-crawl-long-staging: 11 | name: dashboard long crawl (staging) 12 | environment: staging 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: checkout 16 | uses: actions/checkout@v3 17 | - name: crawl download 18 | uses: cloud-gov/cg-cli-tools@cli-v7 19 | with: 20 | command: ./bin/cf-crawl-long.sh dashboard-stage 21 | cf_org: gsa-datagov 22 | cf_space: staging 23 | cf_username: ${{secrets.CF_SERVICE_USER}} 24 | cf_password: ${{secrets.CF_SERVICE_AUTH}} 25 | 26 | dashboard-crawl-long-prod: 27 | name: dashboard long crawl (production) 28 | environment: production 29 | runs-on: ubuntu-latest 30 | steps: 31 | - name: checkout 32 | uses: actions/checkout@v3 33 | - name: crawl download 34 | uses: cloud-gov/cg-cli-tools@cli-v7 35 | with: 36 | command: ./bin/cf-crawl-long.sh dashboard 37 | cf_org: gsa-datagov 38 | cf_space: prod 39 | cf_username: ${{secrets.CF_SERVICE_USER}} 40 | cf_password: ${{secrets.CF_SERVICE_AUTH}} 41 | -------------------------------------------------------------------------------- /.github/workflows/crawl.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Dashboard crawl (daily) 3 | 4 | on: 5 | workflow_dispatch: 6 | schedule: 7 | - cron: '15 4 * * *' 8 | 9 | jobs: 10 | dashboard-crawl-staging: 11 | name: dashboard crawl (staging) 12 | environment: staging 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - name: checkout 17 | uses: actions/checkout@v3 18 | - name: crawl daily (stage) 19 | # pinned to cf7 until --wait is available for run-task on cf8... 20 | uses: cloud-gov/cg-cli-tools@cli-v7 21 | with: 22 | command: ./bin/cf-crawl-daily.sh dashboard-stage 23 | cf_org: gsa-datagov 24 | cf_space: staging 25 | cf_username: ${{secrets.CF_SERVICE_USER}} 26 | cf_password: ${{secrets.CF_SERVICE_AUTH}} 27 | dashboard-crawl-prod: 28 | name: dashboard crawl (production) 29 | environment: production 30 | runs-on: ubuntu-latest 31 | steps: 32 | - name: checkout 33 | uses: actions/checkout@v3 34 | - name: crawl daily (prod) 35 | # pinned to cf7 until --wait is available for run-task on cf8... 36 | uses: cloud-gov/cg-cli-tools@cli-v7 37 | with: 38 | command: ./bin/cf-crawl-daily.sh dashboard 39 | cf_org: gsa-datagov 40 | cf_space: prod 41 | cf_username: ${{secrets.CF_SERVICE_USER}} 42 | cf_password: ${{secrets.CF_SERVICE_AUTH}} 43 | -------------------------------------------------------------------------------- /.github/workflows/restart.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: restart application 3 | 4 | on: 5 | schedule: 6 | - cron: '14/15 * * * *' 7 | workflow_dispatch: 8 | 9 | jobs: 10 | restart-staging: 11 | name: restart (staging) 12 | environment: staging 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: checkout 16 | uses: actions/checkout@v3 17 | - name: restart 18 | uses: cloud-gov/cg-cli-tools@main 19 | with: 20 | command: cf restart dashboard-stage --strategy rolling 21 | cf_org: gsa-datagov 22 | cf_space: staging 23 | cf_username: ${{secrets.CF_SERVICE_USER}} 24 | cf_password: ${{secrets.CF_SERVICE_AUTH}} 25 | - name: smoke test 26 | run: curl --fail --silent https://dashboard-stage-datagov.app.cloud.gov/healthcheck?$(date +%s) 27 | 28 | restart-prod: 29 | name: restart (prod) 30 | environment: production 31 | runs-on: ubuntu-latest 32 | steps: 33 | - name: checkout 34 | uses: actions/checkout@v3 35 | - name: restart 36 | uses: cloud-gov/cg-cli-tools@main 37 | with: 38 | command: cf restart dashboard --strategy rolling 39 | cf_org: gsa-datagov 40 | cf_space: prod 41 | cf_username: ${{secrets.CF_SERVICE_USER}} 42 | cf_password: ${{secrets.CF_SERVICE_AUTH}} 43 | - name: smoke test 44 | run: curl --fail --silent https://dashboard-prod-datagov.app.cloud.gov/healthcheck?$(date +%s) 45 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | */config/development 2 | */logs/log-*.php 3 | */logs/!index.html 4 | */cache/* 5 | */cache/!index.html 6 | csv/* 7 | 8 | .DS_Store 9 | .env* 10 | 11 | downloads/* 12 | uploads/* 13 | archive/error_log/* 14 | archive/datajson/20* 15 | archive/digitalstrategy/20* 16 | archive/datajson-lines/* 17 | archive/curl_header 18 | 19 | composer.phar 20 | /vendor 21 | 22 | # Intellij 23 | .idea 24 | 25 | # cloud.gov deployment variables 26 | vars.yml 27 | application/tests/.phpunit.result.cache 28 | secrets.json 29 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GSA/project-open-data-dashboard/fd112f19c67301f36fb7ea57b1cdc5d563350fda/.gitmodules -------------------------------------------------------------------------------- /.profile: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | fail() { 5 | echo FAIL: "$@" 6 | exit 1 7 | } 8 | 9 | mkdir -p $APP_DIR/uploads 10 | chmod 777 $APP_DIR/uploads 11 | 12 | SECRETS=$(echo $VCAP_SERVICES | jq -r '.["user-provided"][] | select(.name == "secrets") | .credentials') || 13 | fail "Unable to parse SECRETS from VCAP_SERVICES" 14 | ENCRYPTION_KEY=$(echo $SECRETS | jq --exit-status -r '.ENCRYPTION_KEY') || 15 | fail "Unable to parse ENCRYPTION_KEY from SECRETS" 16 | 17 | DB_NAME=$(echo $VCAP_SERVICES | jq -r '.["aws-rds"][] | .credentials.db_name') 18 | DB_USER=$(echo $VCAP_SERVICES | jq -r '.["aws-rds"][] | .credentials.username') 19 | DB_PASSWORD=$(echo $VCAP_SERVICES | jq -r '.["aws-rds"][] | .credentials.password') 20 | DB_HOST=$(echo $VCAP_SERVICES | jq -r '.["aws-rds"][] | .credentials.host') 21 | DB_PORT=$(echo $VCAP_SERVICES | jq -r '.["aws-rds"][] | .credentials.port') 22 | 23 | # Truncate the .env file if it already exists 24 | :>$APP_DIR/.env 25 | for e in DB_NAME DB_USER DB_PASSWORD DB_HOST DB_PORT ENCRYPTION_KEY; do 26 | echo "$e=${!e}" >> $APP_DIR/.env 27 | done 28 | 29 | S3_PREFIX=${S3_PREFIX:-} 30 | S3_BUCKET=$(echo $VCAP_SERVICES | jq -r '.["s3"]?[]? | .credentials.bucket') 31 | S3_REGION=$(echo $VCAP_SERVICES | jq -r '.["s3"]?[]? | .credentials.region') 32 | S3_ACCESS_KEY_ID=$(echo $VCAP_SERVICES | jq -r '.["s3"]?[]? | .credentials.access_key_id') 33 | S3_SECRET_ACCESS_KEY=$(echo $VCAP_SERVICES | jq -r '.["s3"]?[]? | .credentials.secret_access_key') 34 | 35 | for e in S3_BUCKET S3_PREFIX S3_REGION S3_ACCESS_KEY_ID S3_SECRET_ACCESS_KEY; do 36 | echo "$e=${!e}" >> $APP_DIR/.env 37 | done 38 | 39 | echo "DEFAULT_HOST=$DEFAULT_HOST" >> $APP_DIR/.env 40 | 41 | fake=$(echo "$VCAP_APPLICATION" | jq -r '.fake') 42 | if [ "$fake" = "yes" ]; then 43 | echo "CONTENT_PROTOCOL=http" >> $APP_DIR/.env 44 | else 45 | echo "CONTENT_PROTOCOL=https" >> $APP_DIR/.env 46 | fi 47 | 48 | 49 | echo "PROJECT_SHARED_PATH=$APP_DIR" >> $APP_DIR/.env 50 | echo "USE_LOCAL_STORAGE=true" >> $APP_DIR/.env 51 | 52 | echo "ENVIRONMENT=${ENVIRONMENT:-production}" >> $APP_DIR/.env 53 | -------------------------------------------------------------------------------- /.snyk: -------------------------------------------------------------------------------- 1 | # Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities. 2 | version: v1.13.4 3 | # ignores vulnerabilities until expiry date; change duration by modifying expiry date 4 | ignore: 5 | SNYK-PHP-CODEIGNITERFRAMEWORK-560941: 6 | - '*': 7 | reason: Dashboard does not have privileged users so not relevant, and no mitigation in place 8 | expires: 2021-12-30T06:00:00.000Z 9 | patch: {} 10 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Welcome! 2 | 3 | We're so glad you're thinking about contributing to the Project Open Data Dashboard! 4 | 5 | Before contributing, we encourage you to read our CONTRIBUTING guide (you are here), our [LICENSE](https://github.com/project-open-data/project-open-data-dashboard/blob/master/LICENSE.md), and our [README](https://github.com/project-open-data/project-open-data-dashboard/blob/master/README.md), all of which should be in this repository. 6 | 7 | ## Ways to Contribute 8 | 9 | If you do not already have a GitHub account, you can [sign up for GitHub here](https://github.com/). In the spirit of open source software, everyone is encouraged to help improve this project. Here are some ways you can contribute: 10 | - by reporting bugs 11 | - by suggesting new features 12 | - by translating content to a new language 13 | - by writing or editing documentation 14 | - by writing specifications 15 | - by writing code and documentation (**no pull request is too small**: fix typos, add code comments, clean up inconsistent whitespace) 16 | - by reviewing [pull requests](https://github.com/project-open-data/project-open-data-dashboard/pulls). 17 | - by closing issues 18 | 19 | #### Submit Great Issues 20 | * Before submitting a new [issue](https://github.com/project-open-data/project-open-data-dashboard/issues), check to make sure [a similar issue isn't already open](https://github.com/project-open-data/project-open-data-dashboard/issues?q=is%3Aissue+is%3Aopen). If one is, contribute to that issue thread with your feedback. 21 | * When submitting a bug report, please try to provide as much detail as possible, i.e. a screenshot or [gist](https://gist.github.com/) that demonstrates the problem, the technology you are using, and any relevant links. 22 | 23 | #### Ready for your Help 24 | Issues labeled :sparkles:[`help wanted`](https:/github.com/project-open-data/project-open-data-dashboard/labels/help%20wanted):sparkles: make it easy for you to find ways you can contribute today. 25 | 26 | ## Public Domain 27 | 28 | This project constitutes a work of the United States Government and is not subject to domestic copyright protection under 17 USC § 105. Additionally, we waive copyright and related rights in the work worldwide through the [CC0 1.0 Universal public domain dedication](https://creativecommons.org/publicdomain/zero/1.0/). 29 | 30 | All contributions to this project will be released under the CC0 31 | dedication. By submitting a pull request, you are agreeing to comply 32 | with this waiver of copyright interest. 33 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | pipeline { 2 | agent any 3 | environment { 4 | INVENTORY = 'inventories/sandbox' 5 | PLAYBOOK = 'dashboard-web.yml' 6 | } 7 | stages { 8 | stage('deploy') { 9 | when { anyOf { branch 'master' } } 10 | environment { 11 | ANSIBLE_VAULT_FILE = credentials('ansible-vault-secret') 12 | SSH_KEY_FILE = credentials('datagov-sandbox') 13 | } 14 | steps { 15 | ansiColor('xterm') { 16 | echo 'Deploying with Ansible' 17 | sh 'docker run --rm -v $SSH_KEY_FILE:$SSH_KEY_FILE -v $ANSIBLE_VAULT_FILE:$ANSIBLE_VAULT_FILE -u $(id -u) datagov/datagov-deploy:latest pipenv run ansible-playbook --key-file=$SSH_KEY_FILE --vault-password-file=$ANSIBLE_VAULT_FILE --inventory $INVENTORY $PLAYBOOK' 18 | } 19 | } 20 | } 21 | } 22 | post { 23 | always { 24 | step([$class: 'GitHubIssueNotifier', issueAppend: true]) 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | This project utilizes code from http://codeigniter.com/. Therefore, all code and content created by CodeIgniter is [licensed under the MIT License](https://github.com/bcit-ci/CodeIgniter/blob/develop/license.txt). All contributions and code added to this project are [dedicated to the public domain worldwide](https://creativecommons.org/publicdomain/zero/1.0/). 2 | 3 | ## Public Domain 4 | 5 | This project constitutes a work of the United States Government and is not subject to domestic copyright protection under 17 USC § 105. Additionally, we waive copyright and related rights in the work worldwide through the [CC0 1.0 Universal public domain dedication](https://creativecommons.org/publicdomain/zero/1.0/). 6 | 7 | All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest. 8 | 9 | ## MIT License 10 | 11 | The MIT License (MIT) 12 | Copyright (c) 2014 - 2015, British Columbia Institute of Technology 13 | 14 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all build clean down install-dependencies install-dev-dependencies integration-tests test unit-tests up update-dependencies 2 | 3 | all: clean build install-dev-dependencies up test 4 | 5 | build: 6 | docker-compose build 7 | 8 | cloud-test: build install-dev-dependencies up test 9 | 10 | clean: 11 | docker-compose down -v --remove-orphans 12 | 13 | down: 14 | docker-compose down 15 | 16 | test: unit-tests integration-tests 17 | 18 | install-dependencies: 19 | bin/composer install --no-dev 20 | 21 | install-dev-dependencies: 22 | bin/composer install 23 | 24 | integration-tests: 25 | docker-compose exec -T app bats -r tests/ 26 | 27 | unit-tests: install-dev-dependencies 28 | docker-compose exec -T app composer test 29 | 30 | up: 31 | docker-compose up -d 32 | @for i in `seq 1 10`; do docker-compose exec -T app true && exit 0; echo "Waiting for docker ready..."; sleep 2; done; exit 1 33 | @docker-compose exec -T app docker/wait_for_db 34 | docker-compose exec -T app mkdir -p ./uploads && docker-compose exec -T app chmod 777 ./uploads 35 | docker-compose exec -T app chmod 777 ./archive 36 | 37 | update-dependencies: 38 | bin/composer update 39 | -------------------------------------------------------------------------------- /application/config/autoload.php: -------------------------------------------------------------------------------- 1 | 'ua'); 60 | */ 61 | $autoload['libraries'] = array('database', 'migration', 'session', 'lib_gearman'); 62 | 63 | /* 64 | | ------------------------------------------------------------------- 65 | | Auto-load Drivers 66 | | ------------------------------------------------------------------- 67 | | These classes are located in system/libraries/ or in your 68 | | application/libraries/ directory, but are also placed inside their 69 | | own subdirectory and they extend the CI_Driver_Library class. They 70 | | offer multiple interchangeable driver options. 71 | | 72 | | Prototype: 73 | | 74 | | $autoload['drivers'] = array('cache'); 75 | | 76 | | You can also supply an alternative property name to be assigned in 77 | | the controller: 78 | | 79 | | $autoload['drivers'] = array('cache' => 'cch'); 80 | | 81 | */ 82 | $autoload['drivers'] = array(); 83 | 84 | /* 85 | | ------------------------------------------------------------------- 86 | | Auto-load Helper Files 87 | | ------------------------------------------------------------------- 88 | | Prototype: 89 | | 90 | | $autoload['helper'] = array('url', 'file'); 91 | */ 92 | $autoload['helper'] = array(); 93 | 94 | /* 95 | | ------------------------------------------------------------------- 96 | | Auto-load Config files 97 | | ------------------------------------------------------------------- 98 | | Prototype: 99 | | 100 | | $autoload['config'] = array('config1', 'config2'); 101 | | 102 | | NOTE: This item is intended for use ONLY if you have created custom 103 | | config files. Otherwise, leave it blank. 104 | | 105 | */ 106 | $autoload['config'] = array('gearman'); 107 | 108 | /* 109 | | ------------------------------------------------------------------- 110 | | Auto-load Language files 111 | | ------------------------------------------------------------------- 112 | | Prototype: 113 | | 114 | | $autoload['language'] = array('lang1', 'lang2'); 115 | | 116 | | NOTE: Do not include the "_lang" part of your file. For example 117 | | "codeigniter_lang.php" would be referenced as array('codeigniter'); 118 | | 119 | */ 120 | $autoload['language'] = array(); 121 | 122 | /* 123 | | ------------------------------------------------------------------- 124 | | Auto-load Models 125 | | ------------------------------------------------------------------- 126 | | Prototype: 127 | | 128 | | $autoload['model'] = array('first_model', 'second_model'); 129 | | 130 | | You can also supply an alternative model name to be assigned 131 | | in the controller: 132 | | 133 | | $autoload['model'] = array('first_model' => 'first'); 134 | */ 135 | $autoload['model'] = array(); 136 | -------------------------------------------------------------------------------- /application/config/constants.php: -------------------------------------------------------------------------------- 1 | '', 6 | 'xhtml1-strict' => '', 7 | 'xhtml1-trans' => '', 8 | 'xhtml1-frame' => '', 9 | 'xhtml-basic11' => '', 10 | 'html5' => '', 11 | 'html4-strict' => '', 12 | 'html4-trans' => '', 13 | 'html4-frame' => '', 14 | 'mathml1' => '', 15 | 'mathml2' => '', 16 | 'svg10' => '', 17 | 'svg11' => '', 18 | 'svg11-basic' => '', 19 | 'svg11-tiny' => '', 20 | 'xhtml-math-svg-xh' => '', 21 | 'xhtml-math-svg-sh' => '', 22 | 'xhtml-rdfa-1' => '', 23 | 'xhtml-rdfa-2' => '' 24 | ); 25 | -------------------------------------------------------------------------------- /application/config/foreign_chars.php: -------------------------------------------------------------------------------- 1 | 'ae', 14 | '/ö|œ/' => 'oe', 15 | '/ü/' => 'ue', 16 | '/Ä/' => 'Ae', 17 | '/Ü/' => 'Ue', 18 | '/Ö/' => 'Oe', 19 | '/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ|Α|Ά|Ả|Ạ|Ầ|Ẫ|Ẩ|Ậ|Ằ|Ắ|Ẵ|Ẳ|Ặ|А/' => 'A', 20 | '/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª|α|ά|ả|ạ|ầ|ấ|ẫ|ẩ|ậ|ằ|ắ|ẵ|ẳ|ặ|а/' => 'a', 21 | '/Б/' => 'B', 22 | '/б/' => 'b', 23 | '/Ç|Ć|Ĉ|Ċ|Č/' => 'C', 24 | '/ç|ć|ĉ|ċ|č/' => 'c', 25 | '/Д|Δ/' => 'D', 26 | '/д|δ/' => 'd', 27 | '/Ð|Ď|Đ/' => 'Dj', 28 | '/ð|ď|đ/' => 'dj', 29 | '/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě|Ε|Έ|Ẽ|Ẻ|Ẹ|Ề|Ế|Ễ|Ể|Ệ|Е|Э/' => 'E', 30 | '/è|é|ê|ë|ē|ĕ|ė|ę|ě|έ|ε|ẽ|ẻ|ẹ|ề|ế|ễ|ể|ệ|е|э/' => 'e', 31 | '/Ф/' => 'F', 32 | '/ф/' => 'f', 33 | '/Ĝ|Ğ|Ġ|Ģ|Γ|Г|Ґ/' => 'G', 34 | '/ĝ|ğ|ġ|ģ|γ|г|ґ/' => 'g', 35 | '/Ĥ|Ħ/' => 'H', 36 | '/ĥ|ħ/' => 'h', 37 | '/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ|Η|Ή|Ί|Ι|Ϊ|Ỉ|Ị|И|Ы/' => 'I', 38 | '/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı|η|ή|ί|ι|ϊ|ỉ|ị|и|ы|ї/' => 'i', 39 | '/Ĵ/' => 'J', 40 | '/ĵ/' => 'j', 41 | '/Θ/' => 'TH', 42 | '/θ/' => 'th', 43 | '/Ķ|Κ|К/' => 'K', 44 | '/ķ|κ|к/' => 'k', 45 | '/Ĺ|Ļ|Ľ|Ŀ|Ł|Λ|Л/' => 'L', 46 | '/ĺ|ļ|ľ|ŀ|ł|λ|л/' => 'l', 47 | '/М/' => 'M', 48 | '/м/' => 'm', 49 | '/Ñ|Ń|Ņ|Ň|Ν|Н/' => 'N', 50 | '/ñ|ń|ņ|ň|ʼn|ν|н/' => 'n', 51 | '/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ|Ο|Ό|Ω|Ώ|Ỏ|Ọ|Ồ|Ố|Ỗ|Ổ|Ộ|Ờ|Ớ|Ỡ|Ở|Ợ|О/' => 'O', 52 | '/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º|ο|ό|ω|ώ|ỏ|ọ|ồ|ố|ỗ|ổ|ộ|ờ|ớ|ỡ|ở|ợ|о/' => 'o', 53 | '/П/' => 'P', 54 | '/п/' => 'p', 55 | '/Ŕ|Ŗ|Ř|Ρ|Р/' => 'R', 56 | '/ŕ|ŗ|ř|ρ|р/' => 'r', 57 | '/Ś|Ŝ|Ş|Ș|Š|Σ|С/' => 'S', 58 | '/ś|ŝ|ş|ș|š|ſ|σ|ς|с/' => 's', 59 | '/Ț|Ţ|Ť|Ŧ|Τ|Т/' => 'T', 60 | '/ț|ţ|ť|ŧ|τ|т/' => 't', 61 | '/Þ|þ/' => 'th', 62 | '/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ|Ũ|Ủ|Ụ|Ừ|Ứ|Ữ|Ử|Ự|У/' => 'U', 63 | '/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ|υ|ύ|ϋ|ủ|ụ|ừ|ứ|ữ|ử|ự|у/' => 'u', 64 | '/Ƴ|Ɏ|Ỵ|Ẏ|Ӳ|Ӯ|Ў|Ý|Ÿ|Ŷ|Υ|Ύ|Ϋ|Ỳ|Ỹ|Ỷ|Ỵ|Й/' => 'Y', 65 | '/ẙ|ʏ|ƴ|ɏ|ỵ|ẏ|ӳ|ӯ|ў|ý|ÿ|ŷ|ỳ|ỹ|ỷ|ỵ|й/' => 'y', 66 | '/В/' => 'V', 67 | '/в/' => 'v', 68 | '/Ŵ/' => 'W', 69 | '/ŵ/' => 'w', 70 | '/Φ/' => 'F', 71 | '/φ/' => 'f', 72 | '/Χ/' => 'CH', 73 | '/χ/' => 'ch', 74 | '/Ź|Ż|Ž|Ζ|З/' => 'Z', 75 | '/ź|ż|ž|ζ|з/' => 'z', 76 | '/Æ|Ǽ/' => 'AE', 77 | '/ß/' => 'ss', 78 | '/IJ/' => 'IJ', 79 | '/ij/' => 'ij', 80 | '/Œ/' => 'OE', 81 | '/ƒ/' => 'f', 82 | '/Ξ/' => 'KS', 83 | '/ξ/' => 'ks', 84 | '/Π/' => 'P', 85 | '/π/' => 'p', 86 | '/Β/' => 'V', 87 | '/β/' => 'v', 88 | '/Μ/' => 'M', 89 | '/μ/' => 'm', 90 | '/Ψ/' => 'PS', 91 | '/ψ/' => 'ps', 92 | '/Ё/' => 'Yo', 93 | '/ё/' => 'yo', 94 | '/Є/' => 'Ye', 95 | '/є/' => 'ye', 96 | '/Ї/' => 'Yi', 97 | '/Ж/' => 'Zh', 98 | '/ж/' => 'zh', 99 | '/Х/' => 'Kh', 100 | '/х/' => 'kh', 101 | '/Ц/' => 'Ts', 102 | '/ц/' => 'ts', 103 | '/Ч/' => 'Ch', 104 | '/ч/' => 'ch', 105 | '/Ш/' => 'Sh', 106 | '/ш/' => 'sh', 107 | '/Щ/' => 'Shch', 108 | '/щ/' => 'shch', 109 | '/Ъ|ъ|Ь|ь/' => '', 110 | '/Ю/' => 'Yu', 111 | '/ю/' => 'yu', 112 | '/Я/' => 'Ya', 113 | '/я/' => 'ya' 114 | ); 115 | -------------------------------------------------------------------------------- /application/config/gearman.php: -------------------------------------------------------------------------------- 1 | 'CILogger', 16 | 'function' => 'pre_application', 17 | 'filename' => 'CILogger.php', 18 | 'filepath' => 'libraries' 19 | ); 20 | $hook['post_controller'][] = array( 21 | 'class' => 'CILogger', 22 | 'function' => 'post_application', 23 | 'filename' => 'CILogger.php', 24 | 'filepath' => 'libraries' 25 | ); 26 | $hook['post_system'][] = array( 27 | 'class' => 'CILogger', 28 | 'function' => 'resolve_profiling', 29 | 'filename' => 'CILogger.php', 30 | 'filepath' => 'libraries' 31 | ); 32 | -------------------------------------------------------------------------------- /application/config/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/config/memcached.php: -------------------------------------------------------------------------------- 1 | array( 15 | 'hostname' => '127.0.0.1', 16 | 'port' => '11211', 17 | 'weight' => '1', 18 | ), 19 | ); 20 | -------------------------------------------------------------------------------- /application/config/migration.php: -------------------------------------------------------------------------------- 1 | migration->current() this is the version that schema will 69 | | be upgraded / downgraded to. 70 | | 71 | */ 72 | $config['migration_version'] = 13; 73 | 74 | /* 75 | |-------------------------------------------------------------------------- 76 | | Migrations Path 77 | |-------------------------------------------------------------------------- 78 | | 79 | | Path to your migrations folder. 80 | | Typically, it will be within your application path. 81 | | Also, writing permission is required within the migrations path. 82 | | 83 | */ 84 | $config['migration_path'] = APPPATH.'migrations/'; 85 | -------------------------------------------------------------------------------- /application/config/profiler.php: -------------------------------------------------------------------------------- 1 | my_controller/index 50 | | my-controller/my-method -> my_controller/my_method 51 | */ 52 | $route['default_controller'] = 'offices/qa'; 53 | $route['404_override'] = ''; 54 | $route['translate_uri_dashes'] = FALSE; 55 | 56 | $route['upgrade-schema'] = "campaign/upgrade_schema"; 57 | 58 | $route['digitalstrategy'] = "campaign/digitalstrategy"; 59 | 60 | $route['validate'] = "campaign/validate"; 61 | $route['changeset'] = "campaign/changeset"; 62 | 63 | $route['datagov/status-update'] = "campaign/status_update"; 64 | $route['datagov/status-review-update'] = "campaign/status_review_update"; 65 | 66 | $route['datagov/(:any)'] = "campaign/$1"; 67 | $route['datagov/(:any)/'] = "campaign/$1"; 68 | $route['datagov/(:any)/(:any)'] = "campaign/$1/$2"; 69 | $route['datagov/(:any)/(:any)/(:any)'] = "campaign/$1/$2/$3"; 70 | 71 | $route['docs/(:any)'] = "docs/index/$1"; 72 | 73 | // Specific date reports (of the form Y-m-d) can have up to four parameters 74 | $route['offices/(\d{4}-\d{2}-\d{2})/?(:any)?/?(:any)?/?(:any)?/?(:any)?'] = 75 | "offices/milestone/$1/$2/$3/$4"; 76 | -------------------------------------------------------------------------------- /application/config/smileys.php: -------------------------------------------------------------------------------- 1 | array('grin.gif', '19', '19', 'grin'), 21 | ':lol:' => array('lol.gif', '19', '19', 'LOL'), 22 | ':cheese:' => array('cheese.gif', '19', '19', 'cheese'), 23 | ':)' => array('smile.gif', '19', '19', 'smile'), 24 | ';-)' => array('wink.gif', '19', '19', 'wink'), 25 | ';)' => array('wink.gif', '19', '19', 'wink'), 26 | ':smirk:' => array('smirk.gif', '19', '19', 'smirk'), 27 | ':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'), 28 | ':-S' => array('confused.gif', '19', '19', 'confused'), 29 | ':wow:' => array('surprise.gif', '19', '19', 'surprised'), 30 | ':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'), 31 | ':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'), 32 | '%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'), 33 | ';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'), 34 | ':P' => array('raspberry.gif', '19', '19', 'raspberry'), 35 | ':blank:' => array('blank.gif', '19', '19', 'blank stare'), 36 | ':long:' => array('longface.gif', '19', '19', 'long face'), 37 | ':ohh:' => array('ohh.gif', '19', '19', 'ohh'), 38 | ':grrr:' => array('grrr.gif', '19', '19', 'grrr'), 39 | ':gulp:' => array('gulp.gif', '19', '19', 'gulp'), 40 | '8-/' => array('ohoh.gif', '19', '19', 'oh oh'), 41 | ':down:' => array('downer.gif', '19', '19', 'downer'), 42 | ':red:' => array('embarrassed.gif', '19', '19', 'red face'), 43 | ':sick:' => array('sick.gif', '19', '19', 'sick'), 44 | ':shut:' => array('shuteye.gif', '19', '19', 'shut eye'), 45 | ':-/' => array('hmm.gif', '19', '19', 'hmmm'), 46 | '>:(' => array('mad.gif', '19', '19', 'mad'), 47 | ':mad:' => array('mad.gif', '19', '19', 'mad'), 48 | '>:-(' => array('angry.gif', '19', '19', 'angry'), 49 | ':angry:' => array('angry.gif', '19', '19', 'angry'), 50 | ':zip:' => array('zip.gif', '19', '19', 'zipper'), 51 | ':kiss:' => array('kiss.gif', '19', '19', 'kiss'), 52 | ':ahhh:' => array('shock.gif', '19', '19', 'shock'), 53 | ':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'), 54 | ':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'), 55 | ':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'), 56 | ':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'), 57 | ':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'), 58 | ':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'), 59 | ':vampire:' => array('vampire.gif', '19', '19', 'vampire'), 60 | ':snake:' => array('snake.gif', '19', '19', 'snake'), 61 | ':exclaim:' => array('exclaim.gif', '19', '19', 'exclaim'), 62 | ':question:' => array('question.gif', '19', '19', 'question') 63 | 64 | ); 65 | -------------------------------------------------------------------------------- /application/config/upload.php: -------------------------------------------------------------------------------- 1 | load->helper('url'); 10 | $this->load->helper('api'); 11 | 12 | } 13 | 14 | 15 | /** 16 | * Index Page for this controller. 17 | * 18 | * Maps to the following URL 19 | * http://example.com/index.php/welcome 20 | * - or - 21 | * http://example.com/index.php/welcome/index 22 | * - or - 23 | * Since this controller is set as the default controller in 24 | * config/routes.php, it's displayed at http://example.com/ 25 | * 26 | * So any other public methods not prefixed with an underscore will 27 | * map to /index.php/welcome/Directory access is forbidden.
8 | 9 | 10 | -------------------------------------------------------------------------------- /application/core/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/helpers/csv_helper.php: -------------------------------------------------------------------------------- 1 | fp = fopen($file_name, "r"); 14 | $this->parse_header = $parse_header; 15 | $this->delimiter = $delimiter; 16 | $this->length = $length; 17 | 18 | if ($this->parse_header) 19 | { 20 | $this->header = fgetcsv($this->fp, $this->length, $this->delimiter); 21 | } 22 | 23 | } 24 | //-------------------------------------------------------------------- 25 | function __destruct() 26 | { 27 | if ($this->fp) 28 | { 29 | fclose($this->fp); 30 | } 31 | } 32 | //-------------------------------------------------------------------- 33 | function get($max_lines=0) 34 | { 35 | //if $max_lines is set to 0, then get all the data 36 | 37 | $data = array(); 38 | 39 | if ($max_lines > 0) 40 | $line_count = 0; 41 | else 42 | $line_count = -1; // so loop limit is ignored 43 | 44 | while ($line_count < $max_lines && ($row = fgetcsv($this->fp, $this->length, $this->delimiter)) !== FALSE) 45 | { 46 | if ($this->parse_header) 47 | { 48 | foreach ($this->header as $i => $heading_i) 49 | { 50 | $row_new[$heading_i] = $row[$i]; 51 | } 52 | $data[] = $row_new; 53 | } 54 | else 55 | { 56 | $data[] = $row; 57 | } 58 | 59 | if ($max_lines > 0) 60 | $line_count++; 61 | } 62 | return $data; 63 | } 64 | //-------------------------------------------------------------------- 65 | 66 | } 67 | ?> -------------------------------------------------------------------------------- /application/helpers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/hooks/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/language/english/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/language/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/libraries/DataJsonParser.php: -------------------------------------------------------------------------------- 1 | _json; 23 | } 24 | 25 | public function start_document() { 26 | $this->_stack = array(); 27 | $this->_level = 0; 28 | $this->_array_count = 0; 29 | $this->_front_matter = array(); 30 | $this->_dataset_stack = false; 31 | 32 | // Key is an array so that we can can remember keys per level to avoid it being reset when processing child keys. 33 | $this->_key = array(); 34 | } 35 | 36 | public function end_document() { 37 | 38 | // remove trailing comma from last object 39 | fseek ( $this->out_file, -2, SEEK_CUR); 40 | 41 | // end file 42 | fwrite($this->out_file, "\n]}"); 43 | fclose($this->out_file); 44 | } 45 | 46 | public function start_object() { 47 | $this->_level++; 48 | array_push($this->_stack, array()); 49 | // Reset the stack when entering the second level 50 | if($this->_level == 2) { 51 | $this->_stack = array(); 52 | $this->_key[$this->_level] = null; 53 | } 54 | } 55 | 56 | public function end_object() { 57 | $this->_level--; 58 | 59 | $obj = array_pop($this->_stack); 60 | if (empty($this->_stack)) { 61 | // doc is DONE! 62 | $this->_json = $obj; 63 | } else { 64 | $this->value($obj); 65 | } 66 | 67 | 68 | // Output the stack when returning to the second level 69 | if($this->_level == 2 && $this->_key[1] == 'dataset') { 70 | 71 | $this->_array_count++; 72 | $json_line = ''; 73 | 74 | // If this is the first line of the file, write the frontmatter 75 | if ($this->_dataset_stack === false) { 76 | $front_matter = json_encode($this->_front_matter); 77 | $front_matter = substr($front_matter, 0, strlen($front_matter) - 1); 78 | $json_line = $front_matter . ',"dataset":[' . "\n"; 79 | $this->_dataset_stack = true; 80 | } 81 | 82 | $json_line .= json_encode($this->_json) . ",\n"; 83 | fwrite($this->out_file, $json_line); 84 | } 85 | } 86 | 87 | public function start_array() { 88 | $this->start_object(); 89 | } 90 | 91 | public function end_array() { 92 | $this->end_object(); 93 | } 94 | 95 | // Key will always be a string 96 | public function key($key) { 97 | $this->_key[$this->_level] = $key; 98 | } 99 | 100 | // Note that value may be a string, integer, boolean, null 101 | public function value($value) { 102 | $obj = array_pop($this->_stack); 103 | if (isset($this->_key[$this->_level])) { 104 | $obj[$this->_key[$this->_level]] = $value; 105 | 106 | if($this->_level == 1 && $this->_dataset_stack === false) { 107 | $this->_front_matter[$this->_key[$this->_level]] = $value; 108 | } 109 | 110 | $this->_key[$this->_level] = null; 111 | } else { 112 | array_push($obj, $value); 113 | } 114 | array_push($this->_stack, $obj); 115 | } 116 | 117 | public function whitespace($whitespace) { 118 | // do nothing 119 | } 120 | } -------------------------------------------------------------------------------- /application/libraries/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/logs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/migrations/001_datajson_stat_versioning.php: -------------------------------------------------------------------------------- 1 | db->query(" 10 | CREATE TABLE IF NOT EXISTS `datagov_campaign` ( 11 | `office_id` int(10) NOT NULL, 12 | `milestone` varchar(256) CHARACTER SET latin1 NOT NULL DEFAULT '', 13 | `contact_name` text CHARACTER SET latin1, 14 | `contact_email` text CHARACTER SET latin1, 15 | `datajson_status` longtext CHARACTER SET latin1, 16 | `datapage_status` longtext CHARACTER SET latin1, 17 | `digitalstrategy_status` longtext CHARACTER SET latin1, 18 | `tracker_fields` longtext CHARACTER SET latin1 NOT NULL, 19 | `tracker_status` longtext COLLATE utf8_unicode_ci, 20 | PRIMARY KEY (`office_id`,`milestone`) 21 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"); 22 | 23 | $this->db->query(" 24 | CREATE TABLE IF NOT EXISTS `notes` ( 25 | `id` int(10) NOT NULL AUTO_INCREMENT, 26 | `office_id` int(10) NOT NULL, 27 | `milestone` varchar(256) CHARACTER SET latin1 DEFAULT NULL, 28 | `field_name` varchar(256) CHARACTER SET latin1 NOT NULL, 29 | `note` longtext CHARACTER SET latin1 NOT NULL, 30 | PRIMARY KEY (`id`) 31 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1021 ; 32 | "); 33 | 34 | $this->db->query(" 35 | CREATE TABLE IF NOT EXISTS `offices` ( 36 | `id` int(10) NOT NULL, 37 | `name` varchar(256) CHARACTER SET latin1 NOT NULL, 38 | `abbreviation` text CHARACTER SET latin1, 39 | `url` text CHARACTER SET latin1, 40 | `notes` text CHARACTER SET latin1, 41 | `parent_office_id` int(10) DEFAULT NULL, 42 | `no_parent` varchar(256) CHARACTER SET latin1 NOT NULL, 43 | `reporting_authority_type` varchar(256) CHARACTER SET latin1 NOT NULL, 44 | `cfo_act_agency` varchar(256) CHARACTER SET latin1 DEFAULT NULL, 45 | PRIMARY KEY (`id`) 46 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 47 | "); 48 | 49 | $this->db->query(" 50 | CREATE TABLE IF NOT EXISTS `users_auth` ( 51 | `user_id` int(8) NOT NULL, 52 | `username` varchar(255) CHARACTER SET latin1 NOT NULL, 53 | `username_url` varchar(255) CHARACTER SET latin1 NOT NULL, 54 | `name_full` varchar(255) CHARACTER SET latin1 DEFAULT NULL, 55 | `provider_url` text CHARACTER SET latin1 NOT NULL, 56 | `provider_user_id` int(12) NOT NULL, 57 | `token` text CHARACTER SET latin1 NOT NULL, 58 | `provider` varchar(255) CHARACTER SET latin1 NOT NULL DEFAULT 'github', 59 | `permissions` varchar(256) CHARACTER SET latin1 DEFAULT NULL 60 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 61 | "); 62 | 63 | $this->db->query("ALTER TABLE `datagov_campaign` ADD `crawl_start` DATETIME NULL AFTER `milestone`;"); 64 | $this->db->query("ALTER TABLE `datagov_campaign` ADD `crawl_end` DATETIME NULL AFTER `crawl_start`;"); 65 | $this->db->query("ALTER TABLE `datagov_campaign` ADD `crawl_status` VARCHAR(256) NULL AFTER `crawl_end`;"); 66 | $this->db->query("ALTER TABLE `datagov_campaign` DROP PRIMARY KEY; "); 67 | $this->db->query("ALTER TABLE `datagov_campaign` ADD `status_id` INT(5) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;"); 68 | 69 | /* 70 | Populate offices table 71 | 72 | The agency hierarchy in the offices table was originally populated from 73 | the USA.gov Federal Agency Directory API. That API is no longer 74 | available, so we've captured the data in this CSV file. 75 | 76 | Note that the IDs, which originally came from the API, are exposed in 77 | URLs that people may have bookmarked; use caution if you change them! 78 | */ 79 | if (($handle = fopen(APPPATH."migrations/offices.csv", "r")) === FALSE) { 80 | 81 | echo "Couldn't open the CSV file"; 82 | 83 | } else { 84 | 85 | $this->db->query('BEGIN;'); 86 | 87 | // Read in the header row 88 | if (($keys = fgetcsv($handle, 1000, ",")) === FALSE) { 89 | 90 | echo "Couldn't find a header row"; 91 | 92 | } else { 93 | 94 | // For each remaining row... 95 | while (($values = fgetcsv($handle, 1000, ",")) !== FALSE) { 96 | // Make an INSERT query and execute it 97 | $record = array_combine($keys, $values); 98 | $query = $this->db->insert_string('offices', $record); 99 | $result = $this->db->simple_query($query); 100 | if(!$result) { 101 | $this->db->simple_query('ROLLBACK;'); 102 | } 103 | } 104 | 105 | } 106 | 107 | $this->db->query('COMMIT;'); 108 | fclose($handle); 109 | 110 | } 111 | 112 | } 113 | 114 | } 115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /application/migrations/002_office_ids.php: -------------------------------------------------------------------------------- 1 | db->query("ALTER TABLE `offices` ADD `url_slug` VARCHAR(256) NULL AFTER `id`;"); 9 | } 10 | 11 | } 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /application/migrations/003_sess_use_database.php: -------------------------------------------------------------------------------- 1 | db->query(" 11 | CREATE TABLE IF NOT EXISTS `ci_sessions` ( 12 | session_id varchar(40) DEFAULT '0' NOT NULL, 13 | ip_address varchar(45) DEFAULT '0' NOT NULL, 14 | user_agent varchar(120) NOT NULL, 15 | last_activity int(10) unsigned DEFAULT 0 NOT NULL, 16 | user_data text NOT NULL, 17 | PRIMARY KEY (session_id), 18 | KEY `last_activity_idx` (`last_activity`) 19 | );"); 20 | } 21 | } 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /application/migrations/004_alter_session_table.php: -------------------------------------------------------------------------------- 1 | db->query("ALTER TABLE ci_sessions CHANGE session_id id varchar(40) DEFAULT '0' NOT NULL;"); 12 | $this->db->query("ALTER TABLE ci_sessions DROP COLUMN user_agent CASCADE;"); 13 | $this->db->query("ALTER TABLE ci_sessions CHANGE user_data data text NOT NULL;"); 14 | $this->db->query("ALTER TABLE ci_sessions CHANGE last_activity timestamp int(10) unsigned DEFAULT 0 NOT NULL;"); 15 | 16 | // See https://codeigniter.com/userguide3/libraries/sessions.html#database-driver 17 | // No need to adjust the primary key as described there; sess_match_ip is FALSE. 18 | } 19 | } 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /application/migrations/005_create_logging_table.php: -------------------------------------------------------------------------------- 1 | db->query(' 12 | CREATE TABLE IF NOT EXISTS ci_logs ( 13 | ip VARCHAR(10) NOT NULL, 14 | page VARCHAR(255) NOT NULL, 15 | user_agent VARCHAR(255) NOT NULL, 16 | referrer VARCHAR(255) NOT NULL, 17 | logged TIMESTAMP NOT NULL 18 | default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, 19 | username VARCHAR(255) NOT NULL, 20 | memory INT UNSIGNED NOT NULL, 21 | render_elapsed FLOAT NOT NULL, 22 | ci_elapsed FLOAT NOT NULL, 23 | controller_elapsed FLOAT NOT NULL, 24 | mysql_elapsed FLOAT NOT NULL, 25 | mysql_count_queries TINYINT UNSIGNED NOT NULL, 26 | mysql_queries TEXT NOT NULL 27 | ) ENGINE=ARCHIVE; 28 | '); 29 | $this->db->query('ALTER TABLE ci_logs CHANGE referrer referrer VARCHAR(255) DEFAULT NULL;'); 30 | $this->db->query('ALTER TABLE ci_logs CHANGE username username VARCHAR(255) DEFAULT NULL;'); 31 | 32 | 33 | } 34 | } 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /application/migrations/006_update_session_table_id.php: -------------------------------------------------------------------------------- 1 | db->query("ALTER TABLE ci_sessions CHANGE id id varchar(128) NOT NULL;"); 12 | } 13 | } 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /application/migrations/007_add_omb_monitored_flag.php: -------------------------------------------------------------------------------- 1 | db->query("ALTER TABLE `offices` ADD `omb_monitored` varchar(256) CHARACTER SET latin1 DEFAULT 'FALSE' AFTER `cfo_act_agency`;"); 12 | 13 | // OMB wants to monitor all CFO Act agencies 14 | $this->db->query("UPDATE offices SET omb_monitored = 'TRUE' WHERE cfo_act_agency = 'TRUE'"); 15 | 16 | // OMB wants to monitor these offices (for which there is no existing DB entry) 17 | $this->db->query("INSERT INTO offices 18 | (id, name, abbreviation, url, notes, no_parent, parent_office_id, reporting_authority_type, cfo_act_agency, omb_monitored) VALUES 19 | (80000, 'District of Columbia Courts', 'DCC', 'https://www.dccourts.gov/', '', 'TRUE', 0, 'independent', 'FALSE', 'TRUE'), 20 | (80001, 'Public Defender Service of the District of Columbia', 'PDSDC', 'https://www.pdsdc.org/', '', 'TRUE', 0, 'independent', 'FALSE', 'TRUE'), 21 | (80002, 'US Agency for Global Media', 'USAGM', 'https://www.usagm.gov/', '', 'TRUE', 0, 'independent', 'FALSE', 'TRUE') 22 | "); 23 | 24 | // OMB also wants to monitor these offices, already in the DB 25 | $this->db->query("UPDATE offices SET omb_monitored = 'TRUE' WHERE name IN ( 26 | 'Administrative Conference of the United States', 27 | 'American Battle Monuments Commission', 28 | 'Commission on Civil Rights', 29 | 'Consumer Financial Protection Bureau', 30 | 'Consumer Product Safety Commission', 31 | 'Corporation for National and Community Service', 32 | 'Court Services and Offender Supervision Agency for the District of Columbia', 33 | 'District of Columbia Courts', 34 | 'Equal Employment Opportunity Commission', 35 | 'Export-Import Bank of the United States', 36 | 'Farm Credit Administration', 37 | 'Farm Credit System Insurance Corporation ', 38 | 'Federal Communications Commission', 39 | 'Federal Deposit Insurance Corporation', 40 | 'Federal Energy Regulatory Commission', 41 | 'Federal Housing Finance Agency', 42 | 'Federal Maritime Commission', 43 | 'Federal Mediation and Conciliation Service', 44 | 'Federal Reserve System', 45 | 'Federal Retirement Thrift Investment Board', 46 | 'Federal Trade Commission', 47 | 'Inter-American Foundation', 48 | 'Merit Systems Protection Board', 49 | 'Millennium Challenge Corporation', 50 | 'Morris K. Udall and Stewart L. Udall Foundation', 51 | 'National Capital Planning Commission', 52 | 'National Credit Union Administration', 53 | 'National Endowment for the Arts', 54 | 'National Endowment for the Humanities', 55 | 'National Mediation Board', 56 | 'National Transportation Safety Board', 57 | 'Nuclear Waste Technical Review Board', 58 | 'Occupational Safety and Health Review Commission', 59 | 'Office of Government Ethics', 60 | 'Office of the Comptroller of the Currency', 61 | 'Peace Corps', 62 | 'Pension Benefit Guaranty Corporation', 63 | 'Presidio Trust', 64 | 'Public Defender Service of the District of Columbia', 65 | 'Railroad Retirement Board', 66 | 'Selective Service System', 67 | 'Surface Transportation Board', 68 | 'U.S. Access Board', 69 | 'U.S. Commission of Fine Arts', 70 | 'U.S. Commodity Futures Trading Commission', 71 | 'U.S. International Trade Commission', 72 | 'Office of Special Counsel', 73 | 'U.S. Trade and Development Agency', 74 | 'US Agency for Global Media') 75 | "); 76 | 77 | } 78 | } 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /application/migrations/008_fix_nasa_url.php: -------------------------------------------------------------------------------- 1 | db->query('UPDATE offices SET url = "https://data.nasa.gov" WHERE id = "49476"'); 12 | } 13 | } 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /application/migrations/009_add_idempotent_migration_scaffolding.php: -------------------------------------------------------------------------------- 1 | create_idempotent_helpers(); 11 | } 12 | 13 | public function down() 14 | { 15 | return $this->drop_idempotent_helpers(); 16 | } 17 | 18 | private function drop_idempotent_helpers() { 19 | $this->db->query('DROP FUNCTION IF EXISTS column_exists'); 20 | $this->db->query('DROP PROCEDURE IF EXISTS drop_column_if_exists'); 21 | $this->db->query('DROP PROCEDURE IF EXISTS add_column_if_not_exists'); 22 | return true; 23 | } 24 | 25 | /* 26 | * Create functions and stored procedures useful for writing idempotent DDL statements 27 | * in future migrations. 28 | * 29 | * Example usage: 30 | * SELECT column_exists('my_table', 'my_column'); -- 0 31 | * CALL add_column_if_not_exists('my_table', 'my_column', varchar(15)); -- success 32 | * SELECT column_exists('my_table', 'my_column'); -- 1 33 | * CALL add_column_if_not_exists('my_table', 'my_column', varchar(15)); -- success 34 | * SELECT column_exists('my_table', 'my_column'); -- 1 35 | * CALL drop_column_if_exists('my_table', 'my_column'); -- success 36 | * SELECT column_exists('my_table', 'my_column'); -- 0 37 | * CALL drop_column_if_exists('my_table', 'my_column'); -- success 38 | * SELECT column_exists('my_table', 'my_column'); -- 0 39 | * 40 | * Source for this approach: https://stackoverflow.com/a/49676339 41 | */ 42 | private function create_idempotent_helpers() { 43 | 44 | // column_exists: test whether a table already has a column 45 | $this->db->query('DROP FUNCTION IF EXISTS column_exists'); 46 | $this->db->query('CREATE FUNCTION column_exists( 47 | tname VARCHAR(64), 48 | cname VARCHAR(64) 49 | ) 50 | RETURNS BOOLEAN 51 | READS SQL DATA 52 | BEGIN 53 | RETURN 0 < (SELECT COUNT(*) 54 | FROM `INFORMATION_SCHEMA`.`COLUMNS` 55 | WHERE `TABLE_SCHEMA` = SCHEMA() 56 | AND `TABLE_NAME` = tname 57 | AND `COLUMN_NAME` = cname); 58 | END'); 59 | 60 | // drop_column_if_exists: idempotently drop a column from a table 61 | $this->db->query('DROP PROCEDURE IF EXISTS drop_column_if_exists'); 62 | $this->db->query('CREATE PROCEDURE drop_column_if_exists( 63 | tname VARCHAR(64), 64 | cname VARCHAR(64) 65 | ) 66 | BEGIN 67 | IF column_exists(tname, cname) THEN 68 | SET @drop_column_if_exists = CONCAT(\'ALTER TABLE `\', tname, \'` DROP COLUMN `\', cname, \'`\'); 69 | PREPARE drop_query FROM @drop_column_if_exists; 70 | EXECUTE drop_query; 71 | END IF; 72 | END'); 73 | 74 | // Similar function for only adding a column if it doesn't already exist 75 | // add_column_if_not_exists: idempotently add a column to a table 76 | $this->db->query('DROP PROCEDURE IF EXISTS add_column_if_not_exists'); 77 | $this->db->query('CREATE PROCEDURE add_column_if_not_exists( 78 | tname VARCHAR(64), 79 | cname VARCHAR(64), 80 | cdef VARCHAR(255) 81 | ) 82 | BEGIN 83 | IF NOT column_exists(tname, cname) THEN 84 | SET @statement = \'ALTER TABLE `tname` ADD COLUMN `cname` cdef\'; 85 | ELSE 86 | -- Make sure the column is defined the way we want 87 | SET @statement = \'ALTER TABLE `tname` CHANGE `cname` `cname` cdef\'; 88 | END IF; 89 | 90 | SET @statement = REPLACE(@statement, \'tname\', tname); 91 | SET @statement = REPLACE(@statement, \'cname\', cname); 92 | SET @statement = REPLACE(@statement, \'cdef\', cdef); 93 | PREPARE change_query FROM @statement; 94 | EXECUTE change_query; 95 | 96 | END'); 97 | 98 | return true; 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /application/migrations/010_add_long_running_flag.php: -------------------------------------------------------------------------------- 1 | db->query("CALL add_column_if_not_exists('offices', 'long_running', 'varchar(256) CHARACTER SET latin1 DEFAULT \'FALSE\' AFTER `cfo_act_agency`')"); 11 | // these are the offices that have long running crawls 12 | $this->db->query("UPDATE offices SET long_running = 'TRUE' WHERE name IN ( 13 | 'Department of Commerce', 14 | 'Department of Health and Human Services', 15 | 'Department of the Interior', 16 | 'Department of Transportation', 17 | 'Environmental Protection Agency', 18 | 'Federal Energy Regulatory Commission', 19 | 'National Aeronautics and Space Administration', 20 | 'U.S. Agency for International Development') 21 | "); 22 | } 23 | 24 | public function down() 25 | { 26 | $this->db->query("CALL drop_column_if_exists('offices', 'long_running')"); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /application/migrations/011_add_and_edit_omb_monitored_agencies.php: -------------------------------------------------------------------------------- 1 | db->query("INSERT INTO offices 12 | (id, name, abbreviation, url, notes, no_parent, parent_office_id, reporting_authority_type, cfo_act_agency, omb_monitored, long_running) VALUES 13 | (80003, 'Gulf Coast Ecosystem Restoration Council', 'GCERC', 'https://restorethegulf.gov', '', 'TRUE', 0, 'independent', 'FALSE', 'TRUE', 'FALSE'), 14 | (80004, 'Intelligence Community', 'IC', 'https://www.intelligence.gov', '', 'TRUE', 0, 'independent', 'FALSE', 'TRUE', 'FALSE') 15 | "); 16 | 17 | // OMB also wants to monitor these offices, already in the DB 18 | $this->db->query("UPDATE offices SET omb_monitored = 'TRUE' WHERE name IN ( 19 | 'Navy', 20 | 'Securities and Exchange Commission', 21 | 'U.S. Air Force', 22 | 'U.S. Army') 23 | "); 24 | 25 | // Navy should have an updated name 26 | $this->db->query('UPDATE offices SET name = "U.S. Navy" WHERE id = "49561"'); 27 | } 28 | } -------------------------------------------------------------------------------- /application/migrations/012_add_fcc_to_omb_monitored_agencies.php: -------------------------------------------------------------------------------- 1 | db->query("UPDATE offices SET omb_monitored = 'TRUE' WHERE name IN ('Federal Communications Commission')"); 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /application/migrations/013_fix_navy_name.php: -------------------------------------------------------------------------------- 1 | db->query('UPDATE offices SET name = "U.S. Navy" WHERE id = "49561"'); 12 | } 13 | 14 | public function down() 15 | { 16 | $this->db->query('UPDATE offices SET name = "Navy" WHERE id = "49561"'); 17 | } 18 | } -------------------------------------------------------------------------------- /application/models/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/tests/.gitignore: -------------------------------------------------------------------------------- 1 | _ci_phpunit_test/tmp/ 2 | build/ 3 | -------------------------------------------------------------------------------- /application/tests/DbTestCase.php: -------------------------------------------------------------------------------- 1 | assertEquals($expected_public_methods, json_encode($public_methods)); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /application/tests/controllers/Strapping_test.php: -------------------------------------------------------------------------------- 1 | assertNull(NULL); 20 | } 21 | 22 | /** 23 | * These are strapping tests that just assert that no PHP errors are encountered on clicks of nav links 24 | * @dataProvider navLinksProvider 25 | */ 26 | public function testMainNavReturns200($path) 27 | { 28 | $this->request('GET', $path); 29 | $this->assertResponseCode(200); 30 | } 31 | 32 | public function navLinksProvider() { 33 | return [ 34 | 'Home' => ['offices/qa'], 35 | 'Agencies' => ['offices/qa'], 36 | 'Validator' => ['validate'], 37 | 'Converters > ExportAPI' => ['export'], 38 | 'Converters > CSV Converter' => ['datagov/csv_to_json'], 39 | 'Converters > Schema Converter' => ['upgrade-schema'], 40 | 'Converters > Data.json merger' => ['merge'], 41 | 'Help > Docs' => ['docs'], 42 | 'About' => ['docs/about'] 43 | ]; 44 | 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /application/tests/controllers/Welcome_test.php: -------------------------------------------------------------------------------- 1 | 6 | * @license MIT License 7 | * @copyright 2015 Kenji Suzuki 8 | * @link https://github.com/kenjis/ci-phpunit-test 9 | */ 10 | 11 | class WelcomeTest extends TestCase 12 | { 13 | public function testGeneratesTheExpectedTitle() 14 | { 15 | $output = $this->request('GET', 'welcome/index'); 16 | $this->assertStringContainsString('Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/views/changeset.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |If you’ve used the CSV to JSON tool in the past, please 9 | contact us; we’d love to hear from you.
10 |' . "{$item->fields[$column]->label} | "; 65 | 66 | echo ''; 67 | if(!empty($item->fields[$column]->value[$row])) { 68 | echo $item->fields[$column]->value[$row]; 69 | } 70 | echo " | "; 71 | 72 | echo "
---|
Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/views/errors/html/error_404.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 |Type:
10 |Message:
11 |Filename: getFile(); ?>
12 |Line Number: getLine(); ?>
13 | 14 | 15 | 16 |Backtrace:
17 | getTrace() as $error): ?> 18 | 19 | 20 | 21 |
22 | File:
23 | Line:
24 | Function:
25 |
Severity:
10 |Message:
11 |Filename:
12 |Line Number:
13 | 14 | 15 | 16 |Backtrace:
17 | 18 | 19 | 20 | 21 |
22 | File:
23 | Line:
24 | Function:
25 |
Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/views/errors/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Directory access is forbidden.
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /application/views/export.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |12 | This is a simple API for exporting data from http://catalog.data.gov in a way that conforms to the data.json schema as both JSON and CSV files 13 |
14 | 15 |GET /datagov/convert
17 |
18 | The only parameter is ?orgs
where the orgs
refers the the name of the organization in CKAN. For example:
19 |
GET /datagov/csv
23 |
24 | The only parameter is ?orgs
where the orgs
refers the the name of the organization in CKAN. For example:
25 |