{"id":18625510,"url":"https://github.com/nprapps/executive-orders","last_synced_at":"2025-07-27T07:06:52.659Z","repository":{"id":147504277,"uuid":"81878722","full_name":"nprapps/executive-orders","owner":"nprapps","description":"Cron job that posts to Slack incoming webhook when new executive orders (or actions or memos) are published to whitehouse.gov","archived":false,"fork":false,"pushed_at":"2017-02-13T23:02:40.000Z","size":13,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-11T13:32:39.356Z","etag":null,"topics":["cron","federal-government","slack"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nprapps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-13T22:29:08.000Z","updated_at":"2025-04-05T22:34:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"fe57b834-25ea-4c49-972d-718556cadacd","html_url":"https://github.com/nprapps/executive-orders","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nprapps/executive-orders","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nprapps%2Fexecutive-orders","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nprapps%2Fexecutive-orders/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nprapps%2Fexecutive-orders/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nprapps%2Fexecutive-orders/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nprapps","download_url":"https://codeload.github.com/nprapps/executive-orders/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nprapps%2Fexecutive-orders/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267320254,"owners_count":24068527,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cron","federal-government","slack"],"created_at":"2024-11-07T04:34:45.842Z","updated_at":"2025-07-27T07:06:52.611Z","avatar_url":"https://github.com/nprapps.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# executive-orders\n\n## What is this?\n\n**Executive Orders is a cron job that posts to a Slack webhook whenever new a new document is published on [whitehouse.gov](https://www.whitehouse.gov/briefing-room/presidential-actions).**\n\n## Assumptions\n\nThe following things are assumed to be true in this documentation.\n\n* You are running OSX.\n* You are using Python 3. (Probably the version that came OSX.)\n* You have [virtualenv](https://pypi.python.org/pypi/virtualenv) and [virtualenvwrapper](https://pypi.python.org/pypi/virtualenvwrapper) installed and working.\n\nFor more details our stack, see our [development environment blog post](http://blog.apps.npr.org/2013/06/06/how-to-setup-a-developers-environment.html).\n\n## What's in here?\n\nThe project contains the following folders and important files:\n\n* ``fabfile`` -- [Fabric](http://docs.fabfile.org/en/latest/) commands for automating setup, deployment, data processing, etc.\n* ``app_config.py`` -- Global project configuration for scripts, deployment, etc.\n* ``crontab`` -- Cron jobs to be installed as part of the project.\n* ``requirements.txt`` -- Python requirements.\n* ``run_on_server.sh`` -- Shell script to run at the beginning of cron jobs to source environment variables and virtual environments.\n\n## Bootstrap the project\n\n```\ncd executive-orders\nmkvirtualenv -p `which python3` executive-orders\npip install -r requirements.txt\n```\n\n## Hide project secrets\n\nProject secrets should **never** be stored in ``app_config.py`` or anywhere else in the repository. They will be leaked to the client if you do. Instead, always store passwords, keys, etc. in environment variables and document that they are needed here in the README.\n\nAny environment variable that starts with ``$PROJECT_SLUG_`` will be automatically loaded when ``app_config.get_secrets()`` is called.\n\n## Connecting to Slack\n\nTo connect Clerk to your Slack, you will need to create an [incoming webhook](https://api.slack.com/incoming-webhooks) and copy the webhook endpoint to an environment variable called `clerk_WEBHOOK`. The default server setup expects the environment variable to be placed in `/etc/environment`.\n\n## Setting up servers\n\nUse the server configuration in [app_config.py](https://github.com/nprapps/clerk/blob/master/app_config.py#L36-L46) to set up your servers correctly. You can set the user, python version, and the folders where various pieces install.\n\n## Deploy to EC2\n\n1. Run ``fab staging master servers.setup`` to configure the server.\n2. Run ``fab staging master deploy`` to deploy the project to the server. Note that this will also install your crontab.\n\n## Managing cron jobs\n\nCron jobs are defined in the file `crontab`. Each task should use the `run_on_server.sh` shim to ensure the project's virtualenv is properly activated prior to execution. For example:\n\n```\n* * * * * ubuntu bash /home/ubuntu/apps/executive_orders/repository/cron.sh fab $DEPLOYMENT_TARGET cron_jobs.test \u003e\u003e /var/log/executive_orders/crontab.log 2\u003e\u00261\n```\n\nThe cron jobs themselves should be defined in `fabfile/cron_jobs.py` whenever possible.\n\nTo install the cronjob, run either `fab staging master deploy`, which will also synchronize the repo with the latest on Github, or `fab staging master servers.install_crontab` to simply copy the crontab on the server to `etc/cron.d`.\n\nTo uninstall the cronjob (a recommended practice for disabling the job), run `fab staging master servers.uninstall_cronjob`.\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnprapps%2Fexecutive-orders","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnprapps%2Fexecutive-orders","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnprapps%2Fexecutive-orders/lists"}