Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
chore: Backport changes from keystoregaen, bump dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
pojntfx committed Oct 24, 2022
1 parent 7c21e6e commit b66335a
Show file tree
Hide file tree
Showing 34 changed files with 682 additions and 134 deletions.
35 changes: 31 additions & 4 deletions .github/workflows/hydrun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,46 @@ name: hydrun CI
on:
push:
pull_request:
schedule:
- cron: "0 0 * * 0"

jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- id: test
src: .
os: golang:bullseye
flags: ""
cmd: GOFLAGS="-short" ./Hydrunfile test
dst: out/*
- id: go
src: .
os: golang:bullseye
flags: ""
cmd: ./Hydrunfile go
dst: out/*
- id: gccgo
src: .
os: ghcr.io/pojntfx/bagccgop-base-sid
flags: -e '--privileged'
cmd: ./Hydrunfile gccgo
dst: out/*
- id: pwa
src: .
os: golang:bullseye
flags: ""
cmd: make -j "$(nproc)"
cmd: ./Hydrunfile pwa
dst: out/*

steps:
- name: Maximize build space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
Expand Down Expand Up @@ -49,10 +74,11 @@ jobs:
uses: actions/download-artifact@v2
with:
path: /tmp/out
- name: Isolate the repositories
- name: Isolate the PWA
run: |
mkdir -p /tmp/github-pages
cp -r /tmp/out/pwa/web/* /tmp/github-pages
tar -xvzf /tmp/out/pwa/keystoregaen-pwa.tar.gz --directory /tmp/github-pages
- name: Publish pre-release to GitHub releases
if: ${{ github.ref == 'refs/heads/main' }}
uses: marvinpinto/action-automatic-releases@latest
Expand All @@ -71,7 +97,8 @@ jobs:
files: |
/tmp/out/*/*
- name: Publish release to GitHub pages
if: startsWith(github.ref, 'refs/tags/v')
if: startsWith(github.ref, 'refs/tags/v') # Uncomment on first release
# if: ${{ github.ref == 'refs/heads/main' }} # Comment on first release
uses: JamesIves/[email protected]
with:
branch: gh-pages
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
web/*.wasm
out
build
web/*.wasm
web/fonts
web/*.css*
node_modules
83 changes: 69 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,31 +1,86 @@
# Variables
# Public variables
DESTDIR ?=

WWWROOT ?= /var/www/html
WWWPREFIX ?= /keygaen

all: build
PREFIX ?= /usr/local
OUTPUT_DIR ?= out
BUILD_DIR ?= build
STATIC_DIR ?= web
DST ?=

# Private variables
clis = keygaen-cli
pwas = keygaen-pwa
all: $(addprefix build-cli/,$(clis)) $(addprefix build-pwa/,$(pwas))

# Build
build:
GOARCH=wasm GOOS=js go build -o web/app.wasm main.go
go run main.go -prefix $(WWWPREFIX)
cp -rf web/* out/web/web
tar -cvzf out/keygaen.tar.gz -C out/web .
build: $(addprefix build-cli/,$(clis)) $(addprefix build-pwa/,$(pwas))

$(addprefix build-cli/,$(clis)):
ifdef DST
go build -o $(DST) ./cmd/$(subst build-cli/,,$@)
else
go build -o $(OUTPUT_DIR)/$(subst build-cli/,,$@) ./cmd/$(subst build-cli/,,$@)
endif

$(addprefix build-pwa/,$(pwas)): build-scss
mkdir -p $(OUTPUT_DIR) $(BUILD_DIR)
GOARCH=wasm GOOS=js go build -o $(STATIC_DIR)/app.wasm ./cmd/$(subst build-pwa/,,$@)
go run ./cmd/$(subst build-pwa/,,$@) -dist $(BUILD_DIR) -prefix $(WWWPREFIX)
cp -rf $(STATIC_DIR)/* $(BUILD_DIR)/web
tar -cvzf $(OUTPUT_DIR)/$(subst build-pwa/,,$@).tar.gz -C $(BUILD_DIR) .

build-scss:
npx sass -I . web/main.scss web/main.css

# Install
install:
install: $(addprefix install-cli/,$(clis)) $(addprefix install-pwa/,$(pwas))

$(addprefix install-cli/,$(clis)):
install -D -m 0755 $(OUTPUT_DIR)/$(subst install-cli/,,$@) $(DESTDIR)$(PREFIX)/bin/$(subst install-cli/,,$@)

$(addprefix install-pwa/,$(pwas)):
mkdir -p $(DESTDIR)$(WWWROOT)$(WWWPREFIX)
cp -rf out/web/* $(DESTDIR)$(WWWROOT)$(WWWPREFIX)
cp -rf $(BUILD_DIR)/* $(DESTDIR)$(WWWROOT)$(WWWPREFIX)

# Uninstall
uninstall:
uninstall: $(addprefix uninstall-cli/,$(clis)) $(addprefix uninstall-pwa/,$(pwas))

$(addprefix uninstall-cli/,$(clis)):
rm -f $(DESTDIR)$(PREFIX)/bin/$(subst uninstall-cli/,,$@)

$(addprefix uninstall-pwa/,$(pwas)):
rm -rf $(DESTDIR)$(WWWROOT)$(WWWPREFIX)

# Run
run:
GOARCH=wasm GOOS=js go build -o web/app.wasm main.go
go run main.go -serve
run: $(addprefix run-cli/,$(clis)) $(addprefix run-pwa/,$(pwas))

$(addprefix run-cli/,$(clis)): build
$(OUTPUT_DIR)/$(subst run-cli/,,$@) $(ARGS)

$(addprefix run-pwa/,$(pwas)): build-scss
GOARCH=wasm GOOS=js go build -o $(STATIC_DIR)/app.wasm ./cmd/$(subst run-pwa/,,$@)
go run ./cmd/$(subst run-pwa/,,$@) -serve

# Test
test:
go test -timeout 3600s -parallel $(shell nproc) ./...

# Benchmark
benchmark:
go test -timeout 3600s -bench=./... ./...

# Clean
clean:
rm -rf out web/app.wasm
rm -rf $(OUTPUT_DIR) $(BUILD_DIR) $(STATIC_DIR)/app.wasm

# Dependencies
depend:
npm i
find node_modules/@patternfly/patternfly/ -name "*.css" -type f -delete
rm -rf $(STATIC_DIR)/fonts
mkdir -p $(STATIC_DIR)
cp -r node_modules/@patternfly/patternfly/assets/fonts $(STATIC_DIR)

61 changes: 34 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# keygaen

![Logo](./assets/logo-readme.png)
![Logo](./docs/logo-readme.png)

Sign, verify, encrypt and decrypt data with GPG in your browser.
Sign, verify, encrypt and decrypt data with PGP in your browser.

⚠️ keygaen has not yet been audited! While we try to make keygaen as secure as possible, it has not yet undergone a formal security audit by a third party. Please keep this in mind if you use it for security-critical applications. ⚠️

[![hydrun CI](https://github.com/pojntfx/keygaen/actions/workflows/hydrun.yaml/badge.svg)](https://github.com/pojntfx/keygaen/actions/workflows/hydrun.yaml)
![Go Version](https://img.shields.io/badge/go%20version-%3E=1.18-61CFDD.svg)
[![Go Reference](https://pkg.go.dev/badge/github.com/pojntfx/keygaen.svg)](https://pkg.go.dev/github.com/pojntfx/keygaen)
[![Matrix](https://img.shields.io/matrix/keygaen:matrix.org)](https://matrix.to/#/#keygaen:matrix.org?via=matrix.org)
[![Binary Downloads](https://img.shields.io/github/downloads/pojntfx/keygaen/total?label=binary%20downloads)](https://github.com/pojntfx/keygaen/releases)

## Overview

keygaen is an app to work with PGP without having to install anything on your local system.

## Installation

Expand All @@ -20,56 +26,57 @@ The web app is available on [GitHub releases](https://github.com/pojntfx/keygaen

Click on an image to see a larger version.

<a display="inline" href="./assets/empty.png?raw=true">
<img src="./assets/empty.png" width="45%" alt="Screenshot of the empty start screen" title="Screenshot of the empty start screen">
<a display="inline" href="./docs/empty.png?raw=true">
<img src="./docs/empty.png" width="45%" alt="Screenshot of the empty start screen" title="Screenshot of the empty start screen">
</a>

<a display="inline" href="./assets/key-create.png?raw=true">
<img src="./assets/key-create.png" width="45%" alt="Screenshot of the key creation modal" title="Screenshot of the key creation modal">
<a display="inline" href="./docs/key-create.png?raw=true">
<img src="./docs/key-create.png" width="45%" alt="Screenshot of the key creation modal" title="Screenshot of the key creation modal">
</a>

<a display="inline" href="./assets/key-import.png?raw=true">
<img src="./assets/key-import.png" width="45%" alt="Screenshot of the key import modal" title="Screenshot of the key import modal">
<a display="inline" href="./docs/key-import.png?raw=true">
<img src="./docs/key-import.png" width="45%" alt="Screenshot of the key import modal" title="Screenshot of the key import modal">
</a>

<a display="inline" href="./assets/key-list.png?raw=true">
<img src="./assets/key-list.png" width="45%" alt="Screenshot of the key list" title="Screenshot of the key list">
<a display="inline" href="./docs/key-list.png?raw=true">
<img src="./docs/key-list.png" width="45%" alt="Screenshot of the key list" title="Screenshot of the key list">
</a>

<a display="inline" href="./assets/encrypt-sign.png?raw=true">
<img src="./assets/encrypt-sign.png" width="45%" alt="Screenshot of the encrypt/sign modal" title="Screenshot of the encrypt/sign modal">
<a display="inline" href="./docs/encrypt-sign.png?raw=true">
<img src="./docs/encrypt-sign.png" width="45%" alt="Screenshot of the encrypt/sign modal" title="Screenshot of the encrypt/sign modal">
</a>

<a display="inline" href="./assets/view-cypher.png?raw=true">
<img src="./assets/view-cypher.png" width="45%" alt="Screenshot of the viewing the cypher" title="Screenshot of the viewing the cypher">
<a display="inline" href="./docs/view-cypher.png?raw=true">
<img src="./docs/view-cypher.png" width="45%" alt="Screenshot of the viewing the cypher" title="Screenshot of the viewing the cypher">
</a>

<a display="inline" href="./assets/download-cypher.png?raw=true">
<img src="./assets/download-cypher.png" width="45%" alt="Screenshot of the downloading the cypher" title="Screenshot of the downloading the cypher">
<a display="inline" href="./docs/download-cypher.png?raw=true">
<img src="./docs/download-cypher.png" width="45%" alt="Screenshot of the downloading the cypher" title="Screenshot of the downloading the cypher">
</a>

<a display="inline" href="./assets/decrypt-verify.png?raw=true">
<img src="./assets/decrypt-verify.png" width="45%" alt="Screenshot of the decrypt/verify modal" title="Screenshot of the decrypt/verify modal">
<a display="inline" href="./docs/decrypt-verify.png?raw=true">
<img src="./docs/decrypt-verify.png" width="45%" alt="Screenshot of the decrypt/verify modal" title="Screenshot of the decrypt/verify modal">
</a>

<a display="inline" href="./assets/view-plaintext.png?raw=true">
<img src="./assets/view-plaintext.png" width="45%" alt="Screenshot of the viewing the plaintext" title="Screenshot of the viewing the plaintext">
<a display="inline" href="./docs/view-plaintext.png?raw=true">
<img src="./docs/view-plaintext.png" width="45%" alt="Screenshot of the viewing the plaintext" title="Screenshot of the viewing the plaintext">
</a>

<a display="inline" href="./assets/download-plaintext.png?raw=true">
<img src="./assets/download-plaintext.png" width="45%" alt="Screenshot of the downloading the plaintext" title="Screenshot of the downloading the plaintext">
<a display="inline" href="./docs/download-plaintext.png?raw=true">
<img src="./docs/download-plaintext.png" width="45%" alt="Screenshot of the downloading the plaintext" title="Screenshot of the downloading the plaintext">
</a>

<a display="inline" href="./assets/export-key.png?raw=true">
<img src="./assets/export-key.png" width="45%" alt="Screenshot of the export key modal" title="Screenshot of the export key modal">
<a display="inline" href="./docs/export-key.png?raw=true">
<img src="./docs/export-key.png" width="45%" alt="Screenshot of the export key modal" title="Screenshot of the export key modal">
</a>

## Acknowledgements

- This project would not have been possible were it not for [@maxence-charriere](https://github.com/maxence-charriere)'s [go-app package](https://go-app.dev/); if you enjoy using keygaen, please donate to him!
- The open source [PatternFly design system](https://www.patternfly.org/v4/) provides the components for the project.
- [GopenPGP](https://gopenpgp.org/) is the GPG library in use.
- All the rest of the authors who worked on the dependencies used! Thanks a lot!
- [GopenPGP](https://gopenpgp.org/) is the PGP library in use.

To all the rest of the authors who worked on the dependencies used: **Thanks a lot!**

## Contributing

Expand All @@ -87,6 +94,6 @@ Have any questions or need help? Chat with us [on Matrix](https://matrix.to/#/#k

## License

keygaen (c) 2021 Felicitas Pojtinger and contributors
keygaen (c) 2022 Felicitas Pojtinger and contributors

SPDX-License-Identifier: AGPL-3.0
5 changes: 5 additions & 0 deletions cmd/keygaen-cli/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package main

func main() {
panic("not implemented")
}
12 changes: 5 additions & 7 deletions main.go → cmd/keygaen-pwa/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ func main() {
Title: "keygaen",
Name: "keygaen",
ShortName: "keygaen",
Description: "Sign, verify, encrypt and decrypt data with GPG.",
LoadingLabel: "Sign, verify, encrypt and decrypt data with GPG.",
Description: "Sign, verify, encrypt and decrypt data with PGP.",
LoadingLabel: "Sign, verify, encrypt and decrypt data with PGP.",
Author: "Felicitas Pojtinger",
ThemeColor: "#151515",
BackgroundColor: "#151515",
Expand All @@ -43,7 +43,7 @@ func main() {
Large: `/web/large.png`,
},
Keywords: []string{
"gpg",
"pgp",
"pgp",
"gopenpgp",
"encryption",
Expand All @@ -52,13 +52,11 @@ func main() {
RawHeaders: []string{
`<meta property="og:url" content="https://pojntfx.github.io/keygaen/">`,
`<meta property="og:title" content="keygaen">`,
`<meta property="og:description" content="Sign, verify, encrypt and decrypt data with GPG.">`,
`<meta property="og:description" content="Sign, verify, encrypt and decrypt data with PGP.">`,
`<meta property="og:image" content="https://pojntfx.github.io/keygaen/web/default.png">`,
},
Styles: []string{
`https://unpkg.com/@patternfly/[email protected]/patternfly.css`,
`https://unpkg.com/@patternfly/[email protected]/patternfly-addons.css`,
`/web/index.css`,
"/web/main.css",
},
}

Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
23 changes: 12 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
module github.com/pojntfx/keygaen

go 1.17
go 1.18

require (
github.com/ProtonMail/go-crypto v0.0.0-20210920160938-87db9fbc61c7
github.com/ProtonMail/gopenpgp/v2 v2.2.4
github.com/maxence-charriere/go-app/v9 v9.0.0
github.com/ProtonMail/go-crypto v0.0.0-20220930113650-c6815a8c17ad
github.com/ProtonMail/gopenpgp/v2 v2.4.10
github.com/maxence-charriere/go-app/v9 v9.6.7
)

require (
github.com/ProtonMail/go-mime v0.0.0-20190923161245-9b5a4261663a // indirect
github.com/google/uuid v1.2.0 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect
github.com/ProtonMail/go-mime v0.0.0-20220429130430-2192574d760f // indirect
github.com/cloudflare/circl v1.2.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/sirupsen/logrus v1.4.2 // indirect
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 // indirect
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44 // indirect
golang.org/x/text v0.3.6 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
golang.org/x/crypto v0.1.0 // indirect
golang.org/x/sys v0.1.0 // indirect
golang.org/x/text v0.4.0 // indirect
)
Loading

0 comments on commit b66335a

Please sign in to comment.