Skip to content
@Brown-University-Library

Brown University Library

Brown Library GitHub Best practices

Security

Main security message:

Never Commit Sensitive Information: Avoid committing passwords, API keys, server paths, database-structure info (where reasonably possible), and other confidential data to your repository -- even if the repository is private.

How to reliably do this?

  • Keep private things out of the github code directory:
  • Things to keep out of the github code directory: Private settings, environmental-variable-shell-scripts, and log-files (which can sometimes contain sensitive info). One common pattern is to have a "project_outer_directory" that contains these things (as well as the "project_code_directory"), and have that "project_code_directory" the one that gets committed to github.
  • Utilize Environment Variables: Store sensitive information in environment variables, which are not tracked in version control. Then load these from your code.
  • Do not depend on the .gitignore file for security: Rather, get in the habit of thinking of the .gitignore file as keeping messy-unnecessary-cruft out of github (like virtual-environments), not as basic security. Instead, keep the sensitive info out of the github directory in the first place.

Other recommended GitHub practices...

  • Include a README
  • Really helpful areas: Purpose, Usage, Installation
  • Add a "Description"
  • Include "dependencies" in such a way that github can auto-scan them and notify you of vulnerabilities
  • If you have a dotenv with private info—as noted above it should not be in the repo—but it's useful to have a "sample_dotenv.txt" file for users to get a sense of what kind of info is required.
  • Main branch is special.
  • It should always work.
  • There should be a "release" for every version of the code actually deployed. (That makes it easier to know which commit to revert back to if there's a problem.)

See also:

This document is a draft & will be undergoing revisions.

Pinned Loading

  1. bdrxml bdrxml Public

    Reading and writing XML for the Fedora based BDR.

    Python 1 3

Repositories

Showing 10 of 231 repositories
  • Brown-University-Library/site_checker_project’s past year of commit activity
    CSS 0 MIT 0 1 0 Updated Mar 5, 2025
  • vivo-on-rails Public

    A Ruby on Rails front-end for VIVO

    Brown-University-Library/vivo-on-rails’s past year of commit activity
    Ruby 9 0 1 4 Updated Mar 4, 2025
  • Brown-University-Library/requirements-auto-updater’s past year of commit activity
    Python 0 0 1 0 Updated Mar 4, 2025
  • Brown-University-Library/bdr_deposits_uploader_project’s past year of commit activity
    Python 0 0 4 1 Updated Mar 4, 2025
  • geodata_usgovt_backup Public

    US Federal Government Data Backup

    Brown-University-Library/geodata_usgovt_backup’s past year of commit activity
    HTML 2 0 0 0 Updated Mar 3, 2025
  • geodata_routing Public

    Calculate routes between separate files of origins and destinations with OpenRouteService

    Brown-University-Library/geodata_routing’s past year of commit activity
    Jupyter Notebook 0 0 0 0 Updated Mar 2, 2025
  • Brown-University-Library/geodata_geopandas_basic’s past year of commit activity
    Jupyter Notebook 1 0 0 0 Updated Mar 2, 2025
  • ml_hhoag_image_clustering_project Public

    Experimental python ML code, to explore using embeddings to cluster hall-hoag images.

    Brown-University-Library/ml_hhoag_image_clustering_project’s past year of commit activity
    Python 0 0 0 0 Updated Mar 2, 2025
  • gcp_ingest Public
    Brown-University-Library/gcp_ingest’s past year of commit activity
    Python 0 0 0 0 Updated Feb 28, 2025
  • usep-data Public

    inscriptions and related data files for 'http://library.brown.edu/projects/usep/'

    Brown-University-Library/usep-data’s past year of commit activity
    XSLT 2 22 49 1 Updated Feb 28, 2025

Top languages

Loading…

Most used topics

Loading…