Skip to content

Commit f03f4cd

Browse files
committed
add more info on authenticating
1 parent 15a3e61 commit f03f4cd

File tree

7 files changed

+82
-19
lines changed

7 files changed

+82
-19
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ This is a copy of the [Quarto website template](https://github.com/Openscapes/qu
1010

1111
Feel free to fork or as a template. Though if you want to start more bare bones, use the Openscapes [Quarto website template](https://github.com/Openscapes/quarto-website-tutorial).
1212

13-
# How does it work?
13+
# Contributing
1414

15-
This online book is being built automatically with a GitHub Action. The Action is not loading R (or Python), so any code you have in your qmd files will not render and in fact will cause the GitHub Action to fail. Note, for plain markdown, you can use `.md` instead of `.qmd`. You'll need to edit the workflow in the `.github/workflows` folder to install R/Python if you have code.
15+
This online book is being built automatically with a GitHub Action. Edit the qmd or md files in the content directory and edit `_quarto.yml` if you add pages. Push the changes to GitHub and the book will automatically rebuild.
16+
17+
The Action is not loading R (or Python), so any code you have in your qmd files will not render and in fact will cause the GitHub Action to fail. Note, for plain markdown, you can use `.md` instead of `.qmd`. You'll need to edit the workflow in the `.github/workflows` folder to install R/Python if you have code.
1618

1719
The structure of the book is in `_quarto.yml`. The rest should be self-explanatory after you look at that file.
1820

content/github/authenticating.qmd

Lines changed: 53 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,38 @@ title: Authenticating and Installing
66

77
Ask IT to install Git or GitHub Desktop. The later is more useful since you will get a good Git GUI and Git bundled together.
88

9-
## Git and RStudio
9+
## Authenticating
10+
11+
You need to authenticate in order to pull private repos and push to GitHub.
12+
13+
### GitHub Desktop
14+
15+
No tokens needed.
16+
17+
1. Sign in under GitHub Desktop > Settings (or Options) > Account.
18+
2. Fill out your user info on GitHub Desktop > Settings (or Options) > Account.
19+
3. Sign in at GitHub.com and ignore the GitHub Enterprise section, even if you use Enterprise Cloud. The Enterprise section if for signing into a Enterprise account on a private server.
20+
21+
**Help! I signed up for GitHub Enterprise and GitHub Desktop will not authenticate!!**
22+
Log out of GitHub Desktop under GitHub Desktop > Settings (or Options) > Account and log back in.
23+
24+
![](img/g_desktop_signin.png)
25+
26+
### Visual Studio Code (VSCode)
27+
28+
No tokens needed but you will need Git installed. <https://code.visualstudio.com/docs/sourcecontrol/github>
29+
30+
1. Install [GitHub Pull Requests and Issues](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github).
31+
2. Click on the GitHub icon in left nav bar and open a GitHub repo on your computer.
32+
3. Click on the GitHub icon (again) and sign into GitHub with your username and password.
33+
34+
### GitKraken Desktop
35+
36+
No tokens needed. Log in with your GitHub account. <https://help.gitkraken.com/gitkraken-desktop/github-gitkraken-desktop/>
37+
38+
### RStudio
39+
40+
#### Git and RStudio
1041

1142
In order for RStudio to use Git, it needs to know where your Git binary is installed. Instructions: <https://happygitwithr.com/rstudio-see-git>
1243

@@ -22,21 +53,9 @@ In order for RStudio to use Git, it needs to know where your Git binary is insta
2253
2. There is a box at top that asks for the location of the Git binary.
2354
3. Paste that path in.
2455

25-
## Authenticating
56+
#### Authenticating
2657

27-
### GitHub Desktop
28-
29-
No tokens needed.
30-
31-
1. Sign in under GitHub Desktop > Settings (or Options) > Account.
32-
2. Fill out your user info on GitHub Desktop > Settings (or Options) > Git.
33-
34-
**Help! I signed up for GitHub Enterprise and GitHub Desktop will not authenticate!!**
35-
Log out of GitHub Desktop under GitHub Desktop > Settings (or Options) > Account and log back in.
36-
37-
### R users with RStudio
38-
39-
Install the `usethis` and `credentials` packages. Then run this code.
58+
Install the R package `usethis`. Then run this code.
4059

4160
```
4261
## set your user name and email:
@@ -45,7 +64,8 @@ usethis::use_git_config(user.name = "YourName", user.email = "[email protected]")
4564
## create a personal access token for authentication:
4665
usethis::create_github_token()
4766
```
48-
Copy the token. It is really long. Copy that into `YourPAT` in code below.
67+
The typical scope that you want is repo and workflow (if you have GitHub Actions). Copy the token. It is really long. Copy that into `YourPAT` in code below.
68+
4969
```
5070
## set personal access token:
5171
credentials::set_github_pat("YourPAT")
@@ -56,7 +76,18 @@ Note for Linux users:
5676
when the computer is rebooted. You thus may wish to do extend the cache timeout to match the PAT validity period:
5777
`usethis::use_git_config(helper="cache --timeout=2600000")`
5878

59-
### With a Personal Access Token
79+
![](img/new_token.png)
80+
81+
#### Configure your token for Enterprise
82+
83+
If you will be pushing and pulling from repos in GitHub Enterprise, you will need to Configure SSO. Click on the button next to the token and follow the instructions.
84+
85+
![](img/configure_sso_token.png)
86+
87+
88+
### In terminal with a Personal Access Token
89+
90+
If you have authenticated with R following the instructions above, you do not need to authenticate again to use Git in the terminal. Conversely, if you authenticate in the terminal, you do not need to run the R code above.
6091

6192
1. Go to <https://github.com/settings/tokens>
6293
2. Click generate new token.
@@ -75,5 +106,10 @@ Next in the terminal window type one of these
75106
* Max: `git config --global credential.helper osxkeychain`
76107
* Windows: `git config –global credential.helper manager-core`
77108

109+
Now push a change to GitHub. It will ask for your username and password. For the password, end the token that you created.
110+
111+
### In terminal with SSH
112+
113+
Instead of a token, you can use SSH keys to authenticate. Search "github authentication with ssh" for instructions.
78114

79115

237 KB
Loading
100 KB
Loading

content/github/img/new_token.png

233 KB
Loading
75.8 KB
Loading

content/open_science_at_nmfs.qmd

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: "2023 Year of Open Science"
3+
---
4+
5+
On January 11, 2023, the White House Office of Science and Technology Policy (OSTP) launched 2023 as the Year of Open Science to advance national open science policies across the federal government: [White House Fact Sheet on Year of Open Science](https://www.whitehouse.gov/ostp/news-updates/2023/01/11/fact-sheet-biden-harris-administration-announces-new-actions-to-advance-open-and-equitable-research/). Along with this they created a [federal portal for open science research announcements](https://open.science.gov/).
6+
7+
## What is Open Science?
8+
9+
Here is the pithy definition that OSTP and the National Science and Technology Council (NSTC) for use across the U.S. government: “The principle and practice of making research products and processes available to all, while respecting diverse cultures, maintaining security and privacy, and fostering collaborations, reproducibility, and equity.”
10+
11+
Here is the definition from NASA's [Open-Source Science Initiative](https://science.nasa.gov/open-science-overview).
12+
13+
*"Open-source science is a commitment to the open sharing of software, data, and knowledge (algorithms, papers, documents, ancillary information) as early as possible in the scientific process. The principles of open-source science are to make publicly funded scientific research transparent, inclusive, accessible, and reproducible. Advances in technology, including collaborative tools and cloud computing, help enable open-source science, but technology alone is insufficient. Open-source science requires a culture shift to a more inclusive, transparent, and collaborative scientific process, which will increase the pace and quality of scientific progress."*
14+
15+
So it is both a principle of sharing openly (data, research, products) but also the work to make the cultural shifts in how we do our research so that it can be inclusive, transparent, reproducible and collaborative.
16+
17+
18+
## Open Science at NMFS
19+
20+
NOAA Fisheries has many efforts that fall under the rubric of Open Science. Here are some of them.
21+
22+
23+
24+
25+

0 commit comments

Comments
 (0)