Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
upgrade: move secman desktop and spinner to secman repo and build s…
Browse files Browse the repository at this point in the history
…m monorepo
  • Loading branch information
abdfnx committed Mar 29, 2022
1 parent 2d25db1 commit 10d29df
Show file tree
Hide file tree
Showing 138 changed files with 17,737 additions and 185 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.turbo

# Binaries for programs and plugins
*.exe
Expand Down
6 changes: 5 additions & 1 deletion Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tasks:
default:
cmds:
- task: build
- task: build-core
- yarn build

set-tag-and-date:
cmds:
Expand Down Expand Up @@ -48,6 +48,10 @@ tasks:
cmds:
- yarn publish

test:
cmds:
- yarn dev

bfs:
desc: build from source
cmds:
Expand Down
10 changes: 0 additions & 10 deletions core/api/generator.ts

This file was deleted.

12 changes: 5 additions & 7 deletions core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@secman/scc",
"description": "The command-line interface of Secman Core",
"version": "0.1.0",
"description": "The command-line interface of Secman Core.",
"version": "0.1.1",
"main": "lib/index.js",
"license": "MIT",
"homepage": "https://secman.dev",
Expand All @@ -23,6 +23,7 @@
"scripts": {
"postpack": "rimraf oclif.manifest.json",
"prepack": "yarn build",
"dev": "yarn prepack",
"build": "rimraf lib && tsc -b && oclif-dev manifest"
},
"bin": {
Expand All @@ -34,18 +35,15 @@
"@oclif/core": "1.6.3",
"@oclif/plugin-help": "5.1.12",
"@oclif/plugin-not-found": "^2.2.1",
"@secman/spinner": "0.1.3",
"axios": "^0.26.1",
"@secman/crypto": "*",
"@secman/spinner": "*",
"cfonts": "2.10.0",
"chalk": "^4.1.2",
"cli-ux": "^6.0.9",
"crypto-js": "^4.1.1",
"lodash": "4.17.21",
"lodash.template": "^4.5.0",
"prettier": "2.6.1",
"rimraf": "3.0.2",
"shelljs": "0.8.5",
"ts-node": "^10",
"tslib": "^2",
"typescript": "^4.5.5",
"write-file-atomic": "^4.0.1"
Expand Down
2 changes: 1 addition & 1 deletion core/src/commands/auth.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Command, flags } from "@oclif/command";
import writeConfigFile, { readConfig } from "../../config";
import { API } from "../../contract";
import { CryptoTools } from "../../tools/crypto";
import { CryptoTools } from "@secman/crypto";

export default class Auth extends Command {
static description = "Manage secman's authentication state.";
Expand Down
2 changes: 1 addition & 1 deletion core/src/commands/edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
SERVERS_ENCRYPTED_FIELDS,
} from "../../constants";
import { API } from "../../contract";
import { CryptoTools } from "../../tools/crypto";
import { CryptoTools } from "@secman/crypto";
import cryptojs from "crypto-js";
import { spinner } from "@secman/spinner";
import { readData } from "../../config";
Expand Down
3 changes: 1 addition & 2 deletions core/src/commands/insert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import {
SERVERS_ENCRYPTED_FIELDS,
} from "../../constants";
import { API } from "../../contract";
import { CryptoTools } from "../../tools/crypto";
import { CryptoTools } from "@secman/crypto";
import { readData } from "../../config";
import { InsertExamples } from "../../contents/examples/insert";
import { error, success } from "../../design/layout";

export default class Insert extends Command {
static description = "Insert a password to your vault.";
Expand Down
4 changes: 2 additions & 2 deletions core/src/commands/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
NOTES_ENCRYPTED_FIELDS,
SERVERS_ENCRYPTED_FIELDS,
} from "../../constants";
import { CryptoTools } from "../../tools/crypto";
import { CryptoTools } from "@secman/crypto";

export default class List extends Command {
static description = "List all passwords.";
Expand Down Expand Up @@ -48,7 +48,7 @@ export default class List extends Command {
tree: flags.boolean({
char: "t",
description: "list password in tree view.",
})
}),
};

static examples = ListExamples;
Expand Down
2 changes: 1 addition & 1 deletion core/src/commands/read.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
SERVERS_ENCRYPTED_FIELDS,
} from "../../constants";
import { API } from "../../contract";
import { CryptoTools } from "../../tools/crypto";
import { CryptoTools } from "@secman/crypto";
import cryptojs from "crypto-js";
import { ReadExamples } from "../../contents/examples/read";
import { spinner } from "@secman/spinner";
Expand Down
1 change: 1 addition & 0 deletions crypto/example.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
7 changes: 7 additions & 0 deletions crypto/example.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { CryptoTools } from "./main";

const string = "Hi Secman";

const hash = CryptoTools.sha256Encrypt(string);

console.log(`String: ${string}\nHash: ${hash}`);
23 changes: 23 additions & 0 deletions crypto/main.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export declare const isBase64: (value: any) => boolean;
export declare class CryptoTools {
static transmissionKey: any;
static encryptKey: any;
static sha1(msg: any): string;
static hmac(msg: any, transmissionKey?: any): string;
static encrypt(message: any, password?: any): string;
static decrypt(transitMessage: any, password?: any): string;
static pbkdf2Encrypt(masterPassword: any, secret: any): string;
static sha256Encrypt(value: any): string;
static aesEncrypt(value: any, key?: any): string;
static aesDecrypt(value: any, key?: any): string;
static encryptFields(data: any, encryptKey?: any): void;
static decryptFields(data: any, keyList: any, encryptKey?: any): void;
static encryptPayload(
data: any,
keyList: any,
encryptKey?: any,
transmissionKey?: any
): {
data: string;
};
}
File renamed without changes.
12 changes: 12 additions & 0 deletions crypto/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@secman/crypto",
"version": "0.0.1",
"main": "./main.ts",
"types": "./main.ts",
"license": "MIT",
"scripts": {
"dev": "ts-node ./example.ts",
"clean": "rimraf *.d.ts",
"build": "yarn clean && npx -p typescript tsc *.ts --declaration --emitDeclarationOnly --esModuleInterop --outDir ."
}
}
3 changes: 3 additions & 0 deletions desktop/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead
4 changes: 4 additions & 0 deletions desktop/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
node_modules

.vercel
15 changes: 15 additions & 0 deletions desktop/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:lts-alpine as build-stage

WORKDIR /app

COPY package.json .
COPY yarn.lock .
COPY . .

RUN yarn && yarn build

FROM nginx:1.21-alpine as production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html

EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
45 changes: 45 additions & 0 deletions desktop/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Secman Desktop

<p align="center">
<img src="https://assets.secman.dev/apps/desktop.svg" />
</p>

<p align="center">
🖥️ <strong>Secman Desktop</strong> is the desktop client for secman.
</p>

<p align="center">
<a href="https://secman.dev/download"><strong>secman.dev/download</strong></a>
</p>

> Secman Desktop is built with [Vue.js](https://vuejs.org/) and and [PWA](https://developers.google.com/web/progressive-web-apps/).
## Installation

Visit [desktop.secman.dev](https://desktop.secman.dev/) to download the desktop client.

1. Wait until `App is available` is displayed in the status bar.
2. Click the `Install Secman Desktop` button.
3. When the installation is complete, and secman desktop is displayed, refresh the page.

## Build & Run

> First sign up via [**Secman Authorize Website**](https://auth.secman.dev)
### Requirements

- [**Node.js**](https://nodejs.org)
- [**Vue**](https://vuejs.org)

### Run

``` bash
# install deps
yarn

# run secman desktop in dev mode
yarn serve

# build application for production
yarn build
```
14 changes: 14 additions & 0 deletions desktop/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
plugins: [
[
"module-resolver",
{
root: ["./src"],
alias: {
"@": "./src",
},
},
],
],
};
51 changes: 51 additions & 0 deletions desktop/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "@secman/desktop",
"version": "1.1.2",
"description": "🖥️ Secman Desktop is the desktop client for secman.",
"license": "MIT",
"scripts": {
"dev": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"@secman/crypto": "*",
"core-js": "^3.21.0",
"dotenv": "^11.0.0",
"localforage": "^1.10.0",
"papaparse": "^5.3.1",
"register-service-worker": "^1.7.1",
"v-tooltip": "^2.0.3",
"vee-validate": "^2.2.15",
"vue": "^2.6.11",
"vue-class-component": "^7.2.3",
"vue-clipboard2": "^0.3.3",
"vue-debounce": "^2.5.4",
"vue-i18n": "^8.27.0",
"vue-notification": "^1.3.20",
"vue-outside-events": "^1.1.3",
"vue-property-decorator": "^9.1.2",
"vue-router": "^3.0.1",
"vue-snotify": "^3.2.1",
"vue-wait": "^1.4.8",
"vue2-perfect-scrollbar": "^1.5.5",
"vuex": "^3.4.0"
},
"devDependencies": {
"@types/crypto-js": "^4.1.0",
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-pwa": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-typescript": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"babel-plugin-module-resolver": "^4.1.0",
"sass": "^1.48.0",
"sass-loader": "^8.0.2",
"typescript": "~4.1.5",
"vue-html-loader": "^1.2.4",
"vue-loader": "^15.2.4",
"vue-property-decorator": "^9.1.2",
"vue-style-loader": "^4.1.0",
"vue-template-compiler": "^2.6.11"
}
}
56 changes: 56 additions & 0 deletions desktop/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<meta
property="og:image"
content="https://assets.secman.dev/apps/icons/dsk.svg"
/>

<link
rel="icon"
type="image/svg"
href="https://assets.secman.dev/apps/icons/dsk.svg"
/>

<link
rel="apple-touch-icon"
href="https://assets.secman.dev/apps/icons/dsk.svg"
/>

<title>Secman Desktop</title>
</head>
<body>
<noscript>
<strong
>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work
properly without JavaScript enabled. Please enable it to
continue.</strong
>
</noscript>

<script>
(function (d, t) {
var CHATWOOT_URL = "https://app.chatwoot.com";
var g = d.createElement(t),
s = d.getElementsByTagName(t)[0];

g.src = CHATWOOT_URL + "/packs/js/sdk.js";
g.defer = true;
g.async = true;
s.parentNode.insertBefore(g, s);

g.onload = function () {
window.chatwootSDK.run({
websiteToken: "tzvY3mqAKzsGScGG9oSxS1bi",
baseUrl: CHATWOOT_URL,
});
};
})(document, "script");
</script>

<div id="app"></div>
</body>
</html>
2 changes: 2 additions & 0 deletions desktop/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow:
Loading

0 comments on commit 10d29df

Please sign in to comment.