Skip to content

Commit

Permalink
initilize
Browse files Browse the repository at this point in the history
  • Loading branch information
loatheb committed Oct 16, 2023
0 parents commit d1e2eb4
Show file tree
Hide file tree
Showing 25 changed files with 9,107 additions and 0 deletions.
Empty file added .github/CODEOWNERS
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file added .github/workflows/release.yml
Empty file.
78 changes: 78 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
node_modules
__generated__

.expo-shared
.expo
.DS_Store
.idea/
.vscode/

dist
build-electron
.next
build
*.tsbuildinfo
yarn-error.log
/apps/mobile/.env
/apps/mobile/pc-api-8644398719570171123-0-dcae07e2afab.json

.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

/apps/desktop/public/static/js-sdk

.env
webpack.config.preview.json
webpack.config.preview.devServer.json

*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/
# !/apps/web-embed/web-build/
/inpage-provider-bak
/apps/shared/src/web/index.html

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

# Support for Project snippet scope
.vscode/*.code-snippets

# Ignore code-workspaces
*.code-workspace

# Ignore yalc
.yalc/
yalc.lock

stats.json
stats.html
.java-version
.eslintcache
tsconfig.tsbuildinfo

test-report.html

# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*

.tamagui
1 change: 1 addition & 0 deletions apps/desktop
Submodule desktop added at 0c3935
1 change: 1 addition & 0 deletions apps/ext
Submodule ext added at 0c3935
1 change: 1 addition & 0 deletions apps/mobile
Submodule mobile added at 0c3935
1 change: 1 addition & 0 deletions apps/web
Submodule web added at 0c3935
1 change: 1 addition & 0 deletions apps/web-embed
Submodule web-embed added at 0c3935
89 changes: 89 additions & 0 deletions docs/BUG_RULES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
title: Overview
section: Bug Bounty Program
order: 0
---


## Scope

This bug bounty program extends to all code within the [OneKey Github Repo](https://github.com/OneKeyHQ/app-monorepo).

Bounties for potential bugs include, but are not limited to:
* Private keys, storage, forensics
* Task, and CI/CD workflow vulnerabilities
* Domain hijacking, Secrets compromise
* Authorization and privilege issues

More generally, if it lives in the repository* and affects OneKey's security, it's fair game.

_\* There are some components of the OneKey repository that are not created by the OneKey team, but which still could be relevant to overall security. If a bug or exploit makes use of any external libraries or submodules, it will be considered on a case-by-case basis for elegibility._

## Rules


### Submission Guidelines

All bugs reported must be done through the creation of an issue in the OneKey github repo, or _if the submitter wishes to disclose privately, or to remain anonymous_ by an email sent to [email protected] . Private submissions are still eligible for a bounty.

Unless there is a specific reason for a private disclosure, bugs should be submitted as issues on the OneKey GitHub repository, and tagged with the 'bug' label.

It is requested that all submissions follow the format defined in the [issue template](https://github.com/OneKeyHQ/app-monorepo/blob/onekey/docs/ISSUE_TEMPLATE.md) -- clarity of description and thoroughness of documentation will be a consideration for reward amount, in addition to impact and likelihood.

In the case of private bug disclosure, all relevant materials should be sent in email to `[email protected]` -- and should follow the same template as a public issue.

Once submitted, the issue will be responded to, verified, accepted, and rewarded accordindly.

### Submission Branches
Participants in the program are free to submit bugs on branches in the OneKey codebase:
* against the `master` branch which will be tagged as the mainnet release for deployment

### Bug Severity and Bounties
In the same manner as the [Ethereum Bug Bounty Program](https://bounty.ethereum.org/), submissions will be evaluated by the OneKey team according to the [OWASP risk rating methodology](https://www.owasp.org/index.php/OWASP_Risk_Rating_Methodology), which grades based on both _Impact_ and _Likelihood_.

It is at the *sole discretion of OneKey* to decide whether or not a bug report qualifies for a bounty, and to determine the severity of the issue


* *P0*: $5,000 USD
* *P1*: $2,500 USD
* *P2*: $1,000 USD
* *P3*: $500 USD
* *P4*: $250 USD


### Severity levels based on

* The severity of the bug.
* The likelihood that the bug will affect users.
* The responsibility of the researcher — did the researcher take destructive action or otherwise harm the functioning of our systems.
* The role of the researcher — was the researcher the first person to discover the bug, or is the bug based on some public information.
* How well the report was written and how easy it is to understand.


Issues reported may or may not constitute a security risk for the OneKey contracts. A higher severity will be awarded to vulnerabilities submitted that could potentially result in either the loss of funds, or a situation in which the contracts arrive in an undesirable state that cannot be rectified through existing contract mechanisms, such as 'emergency mode' or through a network upgrade. However, all submitted bugs and vulnerabilities will be considered for prizes.

### Ineligible Bugs

Any vulnerabilities or flaws in other software tools created by OneKey (e.g. OneKeyJS, purser, tailor, etc.) are not eligible. Flaws in these software tools are welcome disclosures, but will not be awarded bounties for this bug bounty program.

When reporting vulnerabilities, please consider (1) attack scenario / exploitability, and (2) security impact of the bug. The following issues are considered out of scope:

* Attacks and vulnerabilities that depend on compromised keys or other security flaws outside the OneKey codebase (keyloggers, intercepted communications, social engineering exploits, etc.).
* Attacks that are accounted for in the system design, i.e. Ethereum network spamming, malicious reputation mining, malfeasance in OneKey administration.
* Critiques of the OneKey and overall mechanism design. We welcome suggestions and constructive criticism, and ask that it be directed to [email protected] .
* Clickjacking on pages with no sensitive actions
* Cross-Site Request Forgery (CSRF) on unauthenticated forms or forms with no sensitive actions
* Attacks requiring MITM or physical access to a user's device.
* Attacks requiring a compromised victim device.
* Previously known vulnerable libraries without a working Proof of Concept.
* Comma Separated Values (CSV) injection without demonstrating a vulnerability.
* Any activity that could lead to the disruption of our service (DoS).
* Content spoofing and text injection issues without showing an attack vector/without being able to modify HTML/CSS
* Rate limiting or bruteforce issues on non-authentication endpoints
* Vulnerabilities only affecting users of outdated or unpatched browsers [Less than 2 stable versions behind the latest released stable version]
* Software version disclosure / Banner identification issues / Descriptive error messages or headers (e.g. stack traces, application or server errors).
* Public Zero-day vulnerabilities that have had an official patch for less than 1 month will be awarded on a case by case basis.
* Tabnabbing
* Open redirect - unless an additional security impact can be demonstrated
* Issues that require unlikely user interaction
* Perceived security weaknesses without evidence of the ability to demonstrate impact (e.g. Missing best practices, functional bugs without security implications, etc.)
32 changes: 32 additions & 0 deletions docs/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Prerequisites
Please answer the following questions for yourself before submitting an issue. **YOU MAY DELETE THE PREREQUISITES SECTION.**

- [ ] I checked to make sure that this issue has not already been filed
- [ ] I've asked for help in the [OneKey Discord](https://discord.com/invite/onekey) before filing this issue.

## Summary
<!--- Concise overview of the issue. -->

## Steps to Reproduce (for bugs)
<!--- Provide an example, or an unambiguous set of steps to reproduce this bug -->

## Expected Behavior
<!--- If you're describing a bug, tell us what should happen -->
<!--- If you're suggesting a change/improvement, tell us how it should work -->

## Current Behaviour
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
<!--- If suggesting a change/improvement, explain the difference from current behavior -->

## Possible Solution
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
<!--- or ideas how to implement the addition or change -->

## Context
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->

## Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
* Operating System:
* App Version:
66 changes: 66 additions & 0 deletions docs/i18n/README.de.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@

## 🌍 Konfiguration der Umgebung

1. installieren Sie [node.js LTS Version (>= 16)](https://nodejs.org/en/)
2. Installieren Sie das [yarn package management tool](https://yarnpkg.com/)
3. installieren Sie [git lfs](https://git-lfs.github.com/) (erforderlich für das Ziehen und Aktualisieren einiger Binärdateien)
4. Stellen Sie zum Starten des iOS-Projekts sicher, dass die lokale XCode-Version größer oder gleich 13.3 ist
5. Um das Android-Projekt zu starten, stellen Sie sicher, dass die lokale JDK-Version größer oder gleich 11 ist

Nachdem Sie den neuesten Code über das Git-Kommandozeilen-Tool geholt haben, installieren Sie die Projektabhängigkeiten im Hauptverzeichnis mit dem Befehl ``yarn``

```
# Installation aller JS-Abhängigkeiten und Submodul-Abhängigkeiten
yarn
```

## 🛠 Entwicklung

Entwickeln Sie verschiedene Geschäftscodes, indem Sie die folgenden Befehle im Stammverzeichnis ausführen

- yarn web": Web-Modus entwickeln, der einen statischen Server auf Port 3000 lokal startet
- yarn ios": Debugging-Entwicklung auf iphone-Geräten über USB-Verbindung
- yarn android": Fehlersuche für Android
- yarn desktop": Entwicklung im Desktop-Modus
- `yarn ext`: Entwicklung von Browser-Plugins

### Android-Projektkonfiguration

#### Erste Methode: für Gemeindeentwickler

Konfigurieren Sie die entsprechenden Schlüssel in `packages/app/android/lib-keys-secret/src/main/cpp/keys.c`, oder verwenden Sie die Standardoptionen. Einige APIs können Einschränkungen haben.

#### Zweiter Weg: für offizielle Entwickler

1. gehen Sie zum Verschlüsselungs-Repository und holen Sie die Datei "debug.keystore" und legen Sie sie in das Verzeichnis "packages/app/android/keystores", wenn Sie sie nicht haben, erstellen Sie sie selbst.
2. gehen Sie zum Verschlüsselungs-Repository und holen Sie die Datei `keys.secret` und legen Sie sie in das Verzeichnis `packages/app/android`.

## 🗂 Mehrere Repository-Verzeichnisstrukturen

Die Repositories sind nach dem Monorepo-Modell organisiert, um den Code auf verschiedenen Seiten zentralisiert und unberührt zu halten und gleichzeitig die Wiederverwendung von Code während des Paketierungs- und Kompilierungsprozesses so weit wie möglich zu ermöglichen

- Pakete/Komponenten" für UI-Komponenten
- packages/kit" enthält wiederverwendbare UI-Inhalte auf Seitenebene
- packages/app` APP-Code
- Pakete/desktop" Desktop-Elektronencode
- Pakete/web" Webseitiger Code
- Packages/ext" Plugin-seitiger Code

## 🧲 Abhängigkeiten installieren

Jedes Unterverzeichnis unter dem Verzeichnis `packages/` ist ein separates Projekt, dessen Name dem Wert des Feldes `name` im Verzeichnis **package.json** in monorepo entspricht.

Wenn Sie eine Abhängigkeit für ein Unterverzeichnis installieren müssen, verwenden Sie einfach `yarn workspace @onekeyhq/web add axios`. Mit einem Präfix wie `yarn workspace @onekeyhq/web` kann das axios-Modul schließlich im Stammverzeichnis des Web-Unterprojekts installiert werden.

Einige der Abhängigkeiten haben native Teile, daher müssen Sie in das Verzeichnis `packages/app/ios` gehen und `pod install` ausführen, nachdem Sie die JS-Abhängigkeiten installiert haben.

## 😷 Häufig gestellte Fragen

1. Die App kann nicht gestartet werden und verschiedene Umgebungsstartprobleme

Bei allen Umgebungs-, Modul- und Abhängigkeitsproblemen in der Startphase wird empfohlen, zuerst den Befehl "yarn clean" im Stammverzeichnis zu verwenden. Der Befehl löscht alle untergeordneten Abhängigkeiten sowie den Modul-Cache von Garn, den Cache von Tools wie Metro / Babel und startet dann das Projekt neu, um es zu versuchen.

2. Während der Installation von Abhängigkeiten oder beim Hinzufügen neuer Abhängigkeiten zeigt Garn **Fehler an. Ein unerwarteter Fehler ist aufgetreten: "expected workspace package to exist for**

Siehe https://github.com/yarnpkg/yarn/issues/7807, setzen Sie die aktuelle Garnversion der Umgebung auf 1.18.0 durch den Befehl „yarn policies set-version 1.18.0“.
66 changes: 66 additions & 0 deletions docs/i18n/README.fr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@

## 🌍 Configuration de l'environnement

1. installer [node.js LTS version (>= 16)](https://nodejs.org/en/)
2. Installez [l'outil de gestion des packages de fils](https://yarnpkg.com/) version 1.18.0. (Après avoir installé la dernière version de yarn, exécutez `yarn Policies set-version 1.18.0` dans le répertoire racine)
3. installer [git lfs](https://git-lfs.github.com/) (nécessaire pour tirer et mettre à jour certains binaires)
4. Pour démarrer le projet iOS, assurez-vous que la version locale de XCode est supérieure ou égale à 13.3
5. Pour démarrer le projet Android, assurez-vous que la version locale du JDK est supérieure ou égale à 11

Après avoir récupéré le dernier code via l'outil en ligne de commande git, installez les dépendances du projet dans le répertoire racine avec la commande ``yarn``.

```
# Installer toutes les dépendances JS et les dépendances du sous-module
yarn
```

## 🛠 Développement

Développez un code commercial différent en exécutant les commandes suivantes dans le répertoire racine

- `yarn web` : développer le mode web, qui démarrera localement un serveur statique sur le port 3000
- `yarn ios` : déboguer le développement sur les appareils iphone via une connexion USB
- `yarn android` : déboguer Android
- `yarn desktop` : développement en mode desktop
- `yarn ext` : développer des plugins de navigateur

### Configuration du projet Android

#### Première méthode : pour les développeurs communautaires

Configurez les clés pertinentes dans `packages/app/android/lib-keys-secret/src/main/cpp/keys.c`, ou utilisez les options par défaut. Certaines API peuvent présenter des limitations.

#### Deuxième voie : pour les développeurs officiels

1. allez dans le dépôt de cryptage et récupérez le fichier `debug.keystore` et mettez-le dans le répertoire `packages/app/android/keystores`, si vous ne l'avez pas, créez-le vous-même.
2. allez dans le dépôt de cryptage et récupérez le fichier `keys.secret` et mettez-le dans le répertoire `packages/app/android`.

## 🗂 Structure de répertoires de dépôts multiples

Les dépôts sont organisés selon le modèle monorepo afin de centraliser et de ne pas affecter le code des différentes extrémités, tout en permettant une réutilisation maximale du code au cours du processus de conditionnement et de compilation.

- `packages/components` pour les composants de l'interface utilisateur.
- `packages/kit` contient le contenu réutilisable de l'interface utilisateur au niveau de la page.
- `packages/app` Code APP
- `packages/desktop` Code électronique du bureau
- `packages/web` code côté web
- `packages/ext` Code côté plugin

## 🧲 Installer les dépendances

Chaque sous-répertoire sous le répertoire `packages/` est un projet séparé, dont le nom est la valeur du champ `name` dans le répertoire **package.json** de monorepo.

Lorsque vous avez besoin d'installer une dépendance pour un sous-répertoire, utilisez simplement `yarn workspace @onekeyhq/web add axios`. Avec un préfixe comme `yarn workspace @onekeyhq/web`, le module axios peut éventuellement être installé dans le répertoire racine du sous-projet web.

Certaines des dépendances ont des parties natives, vous devrez donc aller dans le répertoire `packages/app/ios` et lancer `pod install` après avoir installé les dépendances JS.

## 😷 Questions fréquemment posées

1. L'application ne peut pas être démarrée et divers problèmes de démarrage de l'environnement

Pour tout problème d'environnement, de module et de dépendance dans la phase de démarrage, il est recommandé d'utiliser d'abord la commande `yarn clean` dans le répertoire racine. La commande effacera toutes les sous-dépendances, ainsi que le cache du module de yarn, le cache des outils tels que metro/babel, puis redémarrera le projet pour essayer.

2. Lors de l'installation de dépendances ou lors de l'ajout de nouvelles dépendances, yarn affichera **error Une erreur inattendue s'est produite : "le package d'espace de travail attendu existe pour**

Reportez-vous à https://github.com/yarnpkg/yarn/issues/7807, définissez la version actuelle du fil de l'environnement sur 1.18.0 via la commande `yarn Policies set-version 1.18.0`
Loading

0 comments on commit d1e2eb4

Please sign in to comment.