Skip to content

Commit

Permalink
release v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
privapps committed Feb 27, 2021
1 parent fa12bb1 commit 9ab3666
Show file tree
Hide file tree
Showing 60 changed files with 22,593 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support

# You can see what browsers were selected by your queries by running:
# npx browserslist

last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single

[*.md]
max_line_length = off
trim_trailing_whitespace = false
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out

# dependencies
/node_modules

# profiling files
chrome-profiler-events*.json
speed-measure-plugin*.json

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
#!.vscode/launch.json
!.vscode/extensions.json
.history/*

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db
73 changes: 73 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Privapp :: Notebook

## A Simple End to End Encrypted Notebook
Privacy is a right, an irrevocable entitlement held by all human beings from the moment of birth. However, the boundary has been crossed systematically over and over again, not to mention about a large population is still living under heavily monitoring and censorship.

This application is an End to End encrypted notebook that can only be viewed, edit, or shared by the permitted user. Unless the `E2E key` or your device is compromised, no one can view the content.

## Use Cases
* Use it as a personal private notebook. For example your daily, family secrects and etc.
* Personal lock box. You can put your private information such as passport number and etc.
* Share your notes to some of your friends with limited time.
* Maybe more that not listed above.

## App Demo
[![](https://privapps.github.io/notebook_m.jpg)](https://d.tube/#!/v/n0teb00k.privapps/QmXY3YD71CpFnQEMVa64aDeLUgGiEfKAqNMomyqahiEund)

## How it Work
* You create or modify the notebook at your browser from the local computer. Then you can choose to save it as a file, or publish to the web.
* If you save to a file, you can choose as plain text or enrypted. If you choose to publish to the web,
* `E2E key` is used for end-to-end encrypting or decrypting the content. If you don't set that, it would be used as a regular notebook. Note, even if there is no `E2E key`, from the server-side, the system administrator, network monitor are still not able to decrypt the content, because the encryption and decryption is happening at your **browser**.
* This notebook is fully integrated with [privatebin](https://privatebin.info/). You can save the data at privatebin, then decrypt and view it from this app.

#### Use file as storage
You can read or write a notebook and then save or load from a local file
* `E2E key` is strongly recommended as it gives a better protection
* Once you load the content, you can modify the note or save it with a different `E2E key`

#### Use it from the web
* When creating it, you can write a notebook start from scratch or load it from a pre-saved file
* There are two ways you can share the notebook

1. If this app is configured with privatebin, you can directly save it from the app. Then the shareable URL would appear at the top right of your screen.
2. You can also gather the note data and publish it to a public available privatebin. This app can load from the public URL, and translate it into another URL that you can share.

## Sample Sites

- Here is an [Peppa pigs' simple trivial questions](https://privapps.github.io/notebooks/index.html#/notes/0/type,remote&url,data___peppa&symmetric,Hj84nE4pQW4iBXhXhGf3wNeHqtYzGsupFFZHYgDDffjw) without a password. And you need the answers from the simple one to open [Advance Peppa Pig trivial](https://privapps.github.io/notebooks/index.html#/notes/0/type,remote&url,data___peppa2&symmetric,7rrxctQBPgKwfUuU5XrQLteScRpZvPX2jQ6pbRcsASGt)
- 中文问答 [00后不懂的事情](https://privapps.github.io/notebooks/index.html#/notes/0/type,remote&url,data___00&symmetric,5PQae51qE2E7e8KwqQERYkWYTcUntdWqH4Qn4LMKRj6d). 你必须答出来之前的题目才能够看 [巧问妙答和笑话](https://privapps.github.io/notebooks/index.html#/notes/0/type,remote&url,data___002&symmetric,253ZfcKR1KW3RZh35vYMybD1W4GoFHnh898L4ZbRUFDd)
- Of course, you can always [create a brand new one](https://privapps.github.io/notebooks/index.html#/notes/0/&new)

## Docker

You can also find docker images at https://hub.docker.com/u/privapps

See details at https://github.com/privapps/notebook-docker-nginx-fpm-alpine-privatebin

## Feedbacks
We would love to hear your opinions. Please let us know from [Feedback From](https://public.biaomail.us.to/stdv.php?id=MTQ=)

## Developer Guild

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 11.0.7.

1. in the root folder, do
```npm -i```
2. launch the privatebin docker, note I am using the port 9080
``` docker run -d --restart="always" --read-only -p 9080:8080 -v c:/temp/php:/app privatebin/nginx-fpm-alpine ```
3. check the following two files, one is for angular proxy and the other one is the configuration of the apps
```
\proxy.conf.json
\src\assets\config.json
```
4. start developing the app as a regular angular one
``` ng s --proxy-config proxy.conf.json ```

## Wish list
- [ ] Multi-languages support
- [ ] Implement editiable backend, so existing notebook can be modified

## Please donate:
```bitcoin:bc1qmyewq7mh03a3sd5zgvvg3y5sqgm5un3e7eayhq?time=1614371109```


139 changes: 139 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"notebook-privapps": {
"projectType": "application",
"schematics": {
"@schematics/angular:application": {
"strict": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/notebook-privapps",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": true,
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles.css"
],
"scripts": [
"ext/zlib-1.2.11.js",
"ext/rawinflate-0.3.js",
"ext/base-x-3.0.7.js",
"ext/privatebin-1.3.4.js"
]
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "1mb",
"maximumError": "2mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "notebook-privapps:build"
},
"configurations": {
"production": {
"browserTarget": "notebook-privapps:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "notebook-privapps:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": [
"ext/zlib-1.2.11.js",
"ext/rawinflate-0.3.js",
"ext/base-x-3.0.7.js",
"ext/privatebin-1.3.4.js"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "notebook-privapps:serve"
},
"configurations": {
"production": {
"devServerTarget": "notebook-privapps:serve:production"
}
}
}
}
}
},
"defaultProject": "notebook-privapps"
}
37 changes: 37 additions & 0 deletions e2e/protractor.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// @ts-check
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts

const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter');

/**
* @type { import("protractor").Config }
*/
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
capabilities: {
browserName: 'chrome'
},
directConnect: true,
SELENIUM_PROMISE_MANAGER: false,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.json')
});
jasmine.getEnv().addReporter(new SpecReporter({
spec: {
displayStacktrace: StacktraceOption.PRETTY
}
}));
}
};
23 changes: 23 additions & 0 deletions e2e/src/app.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { AppPage } from './app.po';
import { browser, logging } from 'protractor';

describe('workspace-project App', () => {
let page: AppPage;

beforeEach(() => {
page = new AppPage();
});

it('should display welcome message', async () => {
await page.navigateTo();
expect(await page.getTitleText()).toEqual('a-blog app is running!');
});

afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
} as logging.Entry));
});
});
11 changes: 11 additions & 0 deletions e2e/src/app.po.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { browser, by, element } from 'protractor';

export class AppPage {
async navigateTo(): Promise<unknown> {
return browser.get(browser.baseUrl);
}

async getTitleText(): Promise<string> {
return element(by.css('app-root .content span')).getText();
}
}
13 changes: 13 additions & 0 deletions e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"module": "commonjs",
"target": "es2018",
"types": [
"jasmine",
"node"
]
}
}
7 changes: 7 additions & 0 deletions ext/ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Those files comes from PrivateBin v1.3.4

Some modification in
* privatebin-1.3.4.js that strip out unused code
* zlib-1.2.11.js that change the wasm location

The zlib-1.2.11.wasm is at app/assets/css/
Loading

0 comments on commit 9ab3666

Please sign in to comment.