Skip to content

Commit

Permalink
Merge #82: Add workflow for testing
Browse files Browse the repository at this point in the history
c650342 feat: add workflow for testing (Jose Celano)

Pull request description:

  Add workflow for testing.

ACKs for top commit:
  josecelano:
    ACK c650342

Tree-SHA512: 6e49dc714ff03f246227fb60cf6b6cc046eeddf64310c95902f33234b4e438393286386e6539880ff13a45620db584c24a028a4eca7fc69232db2aff1832de8e
  • Loading branch information
josecelano committed Nov 30, 2023
2 parents b2f30dd + c650342 commit 6b09b3e
Show file tree
Hide file tree
Showing 47 changed files with 870 additions and 793 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Tests

on:
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: npm install

- name: Check
run: npm run check

- name: Lint
run: npm run lint

- name: Build
run: npm run build
22 changes: 11 additions & 11 deletions Git_GitHub_How_To.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ Here you will find the following information:
Links to two visual user interface applications:

- [GitHub Desktop](#github-desktop-app)
Very basic easy to use user interface built by GitHub.
Can through errors since it does not provide good support for repositories with GitHub submodules as of 2022-02-21.
Very basic easy to use user interface built by GitHub.
Can through errors since it does not provide good support for repositories with GitHub submodules as of 2022-02-21.

- [GitKraken](#gitkraken-desktop-app)
Complete solution with all bells and whistles, from GPG, SSH key creation, to in app pull requests, etc. Comes in three versions: Free, Pro, Enterprise.
The Free versions works with public online or locally hosted repositories.
Complete solution with all bells and whistles, from GPG, SSH key creation, to in app pull requests, etc. Comes in three versions: Free, Pro, Enterprise.
The Free versions works with public online or locally hosted repositories.

## Git

Expand All @@ -35,7 +35,7 @@ Links to two visual user interface applications:

Wikipedia.org Definition:

>"Git (/ɡɪt/) is software for tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data integrity, and support for distributed, non-linear workflows (thousands of parallel branches running on different systems)."
> "Git (/ɡɪt/) is software for tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data integrity, and support for distributed, non-linear workflows (thousands of parallel branches running on different systems)."
Essentially it is a software that helps track and coordinate software development among developers.

Expand All @@ -48,17 +48,17 @@ Here are some good videos that explain the what and how of Git:

#### Cloning Repositories

>git clone <git_repository ssh url>
> git clone <git_repository ssh url>
In order to get the git repository ssh url you have to go to the repository, and select the green "Code" button, and here choose the "ssh" tab to then copy the url as shown in the following image:

![Cloning](./docs/media_git/command-clone-01.png)

You have to click on "Code" and then select "SSH" and copy the address which whould look something similar to this:

>[email protected]:Nautilus-Cyberneering/chinese-ideographs-website.git
> [email protected]:Nautilus-Cyberneering/chinese-ideographs-website.git
**Important Note:
\*\*Important Note:

Before doing this step you might have to set up your git installation with OPENSSH.
If you are running Windows you will have to activate the OPENSSH service and then generate a new SSH-Key for yourself and copy it into your GitHub profile security settings to do so here are some useful links:
Expand All @@ -83,9 +83,9 @@ More on the "git clone":

git branch -a

Note: A good habit is to update your remote repositories information to make sure that you see all the remote repositories. You can do this using the following command:
Note: A good habit is to update your remote repositories information to make sure that you see all the remote repositories. You can do this using the following command:

git fetch
git fetch

#### Switching Branches

Expand All @@ -95,7 +95,7 @@ More on the "git clone":

- Remote

git checkout
git checkout

#### Deleting

Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# 🚨 Secure Git Guide 🚨

![Index header](./media/HEADER/SGG-IndexHeader-1600x500.jpg)

[![MegaLinter](https://github.com/Nautilus-Cyberneering/GPG-Bootcamp/actions/workflows/mega-linter.yml/badge.svg)](https://github.com/Nautilus-Cyberneering/GPG-Bootcamp/actions/workflows/mega-linter.yml)
![Open Source](https://badgen.net/badge/Open%20Source/100%25/DA2CE7)
![Cool](https://badgen.net/badge/Cool/100%25/FF7F50)
[![Deploy to GitHub Pages](https://github.com/nautilus-cyberneering/secure-git-guide/actions/workflows/deploy.yml/badge.svg)](https://github.com/nautilus-cyberneering/secure-git-guide/actions/workflows/deploy.yml) [![Testing](https://github.com/nautilus-cyberneering/secure-git-guide/actions/workflows/testing.yml/badge.svg)](https://github.com/nautilus-cyberneering/secure-git-guide/actions/workflows/testing.yml)

## Repository Description

Expand Down
42 changes: 21 additions & 21 deletions src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ html {
--border-light: var(--gray-4);
}

a:hover{
a:hover {
color: #62629d;
}

a:visited{
a:visited {
color: #6464e2;
}

Expand Down Expand Up @@ -84,10 +84,10 @@ a:visited{
.contact,
.contact-text h3,
.contribute-main-heading,
.contribute-list-heading{
.contribute-list-heading {
color: #000;
}
.post a{
.post a {
color: #fff;
}
}
Expand Down Expand Up @@ -122,7 +122,7 @@ img {
border-radius: var(--radius-3);
}

hr{
hr {
margin-block: 1rem;
}

Expand Down Expand Up @@ -156,7 +156,7 @@ li {
color: var(--text-1);
}

.prose :is(pre){
.prose :is(pre) {
background-color: black;
display: block;
position: relative;
Expand All @@ -169,22 +169,22 @@ li {
padding: 30px 15px;
margin: 30px 0;

overflow-x: auto;
scrollbar-color: var(--color--primary) var(--color--primary-tint);
scrollbar-width: thin;
padding-bottom: 5px;
overflow-x: auto;
scrollbar-color: var(--color--primary) var(--color--primary-tint);
scrollbar-width: thin;
padding-bottom: 5px;

&::-webkit-scrollbar {
height: 8px;
}
&::-webkit-scrollbar-thumb {
background: #fff;
&:hover {
background: var(--color--primary-shade);
}
&::-webkit-scrollbar {
height: 8px;
}
&::-webkit-scrollbar-thumb {
background: #fff;
&:hover {
background: var(--color--primary-shade);
}
}
}

.prose :is(p){
margin-block: .8rem;
}
.prose :is(p) {
margin-block: 0.8rem;
}
6 changes: 4 additions & 2 deletions src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
<meta name="viewport" content="width=device-width" />
%sveltekit.head%
<script type="module">
const theme = localStorage.getItem('color-scheme')
const theme = localStorage.getItem('color-scheme');

theme ? document.documentElement.setAttribute('color-scheme', theme) : localStorage.setItem('color-scheme', 'dark')
theme
? document.documentElement.setAttribute('color-scheme', theme)
: localStorage.setItem('color-scheme', 'dark');
</script>
</head>
<body data-sveltekit-preload-data="hover">
Expand Down
8 changes: 4 additions & 4 deletions src/lib/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {dev} from '$app/environment'
import { dev } from '$app/environment';

export const title = 'Secure Git Guide'
export const description = 'SvelteKit'
export const url = dev ? 'http://127.0.0.1:5173/' : 'url'
export const title = 'Secure Git Guide';
export const description = 'SvelteKit';
export const url = dev ? 'http://127.0.0.1:5173/' : 'url';
30 changes: 15 additions & 15 deletions src/lib/theme.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import {writable} from 'svelte/store'
import {browser} from '$app/environment'
import { writable } from 'svelte/store';
import { browser } from '$app/environment';

type Theme = 'light' | 'dark'
type Theme = 'light' | 'dark';

const userTheme = browser && localStorage.getItem('color-scheme')
const userTheme = browser && localStorage.getItem('color-scheme');

export const theme = writable(userTheme ?? 'dark')
export const theme = writable(userTheme ?? 'dark');

export function toggleTheme(){
theme.update((currentTheme) => {
const newTheme = currentTheme === 'dark' ? 'light' : 'dark'
export function toggleTheme() {
theme.update((currentTheme) => {
const newTheme = currentTheme === 'dark' ? 'light' : 'dark';

document.documentElement.setAttribute('color-scheme', newTheme)
localStorage.setItem('color-scheme', newTheme)
document.documentElement.setAttribute('color-scheme', newTheme);
localStorage.setItem('color-scheme', newTheme);

return newTheme
})
return newTheme;
});
}

export function setTheme(newTheme: Theme){
theme.set(newTheme)
}
export function setTheme(newTheme: Theme) {
theme.set(newTheme);
}
16 changes: 8 additions & 8 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export type Categories = 'sveltekit' | 'svelte'
export type Categories = 'sveltekit' | 'svelte';

export type Post = {
title: string
slug: string
description: string
date: string
categories: Categories[]
published: boolean
}
title: string;
slug: string;
description: string;
date: string;
categories: Categories[];
published: boolean;
};
8 changes: 4 additions & 4 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
type DateStyle = Intl.DateTimeFormatOptions['dateStyle']
type DateStyle = Intl.DateTimeFormatOptions['dateStyle'];

export function formatDate(date: string, dateStyle: DateStyle = 'medium', locales = 'en') {
const formatter = new Intl.DateTimeFormat(locales, { dateStyle })
return formatter.format(new Date(date))
}
const formatter = new Intl.DateTimeFormat(locales, { dateStyle });
return formatter.format(new Date(date));
}
2 changes: 1 addition & 1 deletion src/posts/001_GPG-What-is-GPG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ More recent releases of GnuPG 2.x ("modern" and the now deprecated "stable" seri
---

Note: Source [WIKIPEDIA](https://en.wikipedia.org/wiki/GNU_Privacy_Guard)

[Back to home](/)
10 changes: 5 additions & 5 deletions src/posts/002_GPG-Why-we-use-GPG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ It is the preferred option by our team members.

For authentication, certification and signing the receiving end can verify that the content is from you, having your public key. On the other hand, if the other party wants to send you something only for you, they will use your public encryption key in combination with their own private key to sign and certify the content. Such content can only be decrypted using your own private key, and by having their public key you will know that it is from them.

***First advantage:***
**_First advantage:_**

If someone sends to you something encrypted, meant only for you, you will be the only one capable of decrypting it.

>"All right but why now, so many keys?"
> "All right but why now, so many keys?"
Essentially there is one primary key, which is typically used only for signing and certification, and a subkey signed by the primary key for encryption. However, you can have one for each of the usages if you wanted.

***Second advantage:***
**_Second advantage:_**

Each subkey when used is transmitted at the same time, but if compromised it can be revoked individually and a new key generated while keeping your primary key valid. It makes it easier to manage your keys and split them for the different purposes you want to use them.
Each subkey when used is transmitted at the same time, but if compromised it can be revoked individually and a new key generated while keeping your primary key valid. It makes it easier to manage your keys and split them for the different purposes you want to use them.

### Disadvantage

If your primary key is compromised or you lose it, your security has been breached and someone can impersonate you or you lose access to your digital "id" stemming from this key.... you may have to start building your digital reputation from scratch.

Nevertheless, for this situation there exists the **revocation certificate** which is created from the start at the same time that you create your keys for the first time or at any given time for the individual keys you want to revoke. With this certificate you would have to go to the before mentioned GPG key servers and upload it, to publicly revoke the affected key or keys.

[Back to home](/)
[Back to home](/)
11 changes: 7 additions & 4 deletions src/posts/003-GPG-101-How-to-get-your-first-GPG-Keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ published: true
The steps to install GPG on your computer are the following:

1. Download the necessary software for your Operating System at:
- [Windows](https://gpg4win.org/download.html)
- [Linux - Installed through terminal](https://linuxhint.com/gpg-command-ubuntu/)
- [Mac OS](https://sourceforge.net/p/gpgosx/docu/Download/)
- [Windows](https://gpg4win.org/download.html)
- [Linux - Installed through terminal](https://linuxhint.com/gpg-command-ubuntu/)
- [Mac OS](https://sourceforge.net/p/gpgosx/docu/Download/)

## GPG4Win Kleopatra

Expand Down Expand Up @@ -74,6 +74,7 @@ Here is a series of screenshots of the process using the Kleopatra application f
### Creating a Revocation Certificate

---

(1)

![012](docs/media/003/KLEO_CREATE_012.png)
Expand Down Expand Up @@ -106,12 +107,14 @@ In order to generate your new keys you have two options:
### Default Setup

---

Open the command line as an admin and type:

<pre>
terminal
gpg --gen-keys
</pre>

(1)

![cli001](docs/media/003/CLI_CREATE_001.png)
Expand Down Expand Up @@ -215,4 +218,4 @@ Open the command line as an admin and type:

![cliFgk012](docs/media/003/CLI_CREATE_fgk_012.png)

[Back to home](/)
[Back to home](/)
2 changes: 1 addition & 1 deletion src/posts/004_GPG-How-to-use-GPG-with-GIT-and-GitHub.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ In order to use the GPG Keys Github and GIT develop two easy to follow guideline
- Git - <https://git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work>
- GitHub - <https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits>

[Back to home](/)
[Back to home](/)
Loading

0 comments on commit 6b09b3e

Please sign in to comment.