├── .env.development ├── .github ├── CODEOWNERS ├── SECURITY.md ├── FUNDING.yml ├── ISSUE_TEMPLATE │ └── bug_report.md ├── workflows │ └── pull_request.yml ├── CODE_OF_CONDUCT.md ├── ROADMAP.md └── CONTRIBUTING.md ├── src ├── guards │ └── index.ts ├── contexts │ ├── index.ts │ ├── tab │ │ ├── types.ts │ │ └── index.tsx │ └── terminal │ │ ├── constants.ts │ │ ├── types.ts │ │ └── index.tsx ├── layouts │ ├── index.ts │ ├── fullscreen │ │ └── index.tsx │ └── default │ │ └── index.tsx ├── components │ ├── tab_controller │ │ ├── components │ │ │ ├── index.ts │ │ │ ├── tab │ │ │ │ ├── types.ts │ │ │ │ └── index.tsx │ │ │ ├── home │ │ │ │ └── index.tsx │ │ │ └── options │ │ │ │ └── index.tsx │ │ └── index.tsx │ ├── index.ts │ ├── center │ │ └── index.tsx │ ├── xterm │ │ ├── types.ts │ │ └── index.tsx │ └── flex │ │ ├── types.ts │ │ └── index.tsx ├── pages │ ├── index.tsx │ ├── terminal │ │ └── index.tsx │ └── _app.tsx ├── globals.css ├── types │ └── index.ts └── xterm.css ├── src-tauri ├── Cargo.toml ├── jexpe │ ├── build.rs │ ├── icons │ │ ├── icon.ico │ │ ├── icon.png │ │ ├── 128x128.png │ │ ├── 32x32.png │ │ ├── icon.icns │ │ ├── StoreLogo.png │ │ ├── 128x128@2x.png │ │ ├── Square107x107Logo.png │ │ ├── Square142x142Logo.png │ │ ├── Square150x150Logo.png │ │ ├── Square284x284Logo.png │ │ ├── Square30x30Logo.png │ │ ├── Square310x310Logo.png │ │ ├── Square44x44Logo.png │ │ ├── Square71x71Logo.png │ │ └── Square89x89Logo.png │ ├── src │ │ ├── shell │ │ │ ├── commands.rs │ │ │ ├── mod.rs │ │ │ ├── unix.rs │ │ │ └── windows.rs │ │ ├── pty │ │ │ ├── constants.rs │ │ │ ├── mod.rs │ │ │ └── commands.rs │ │ └── main.rs │ ├── Cargo.toml │ └── tauri.conf.json └── .gitignore ├── postcss.config.js ├── .prettierrc ├── next-env.d.ts ├── next.config.js ├── public └── assets │ ├── icons │ ├── oracle-linux.svg │ ├── cygwin.svg │ ├── clink.svg │ ├── cmd.svg │ ├── vs2017.svg │ ├── cmder.svg │ ├── cmder-powershell.svg │ ├── alpine.svg │ ├── open-euler.svg │ ├── git-bash.svg │ ├── powershell.svg │ ├── powershell-core.svg │ ├── vs2019.svg │ ├── docker.svg │ ├── kali.svg │ ├── alma.svg │ ├── suse.svg │ ├── ubuntu.svg │ ├── msys2.svg │ ├── debian.svg │ └── vs2022.svg │ ├── lock.svg │ └── empty_vault.svg ├── .gitignore ├── .eslintrc.js ├── .husky └── pre-commit ├── tsconfig.json ├── package.json ├── README.md ├── tailwind.config.js └── LICENSE.md /.env.development: -------------------------------------------------------------------------------- 1 | NEXT_TELEMETRY_DISABLED=1 -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @jexpe-apps/wg-jexpe 2 | -------------------------------------------------------------------------------- /src/guards/index.ts: -------------------------------------------------------------------------------- 1 | export type test = 'a' 2 | -------------------------------------------------------------------------------- /src-tauri/Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = [ 3 | "jexpe", 4 | ] -------------------------------------------------------------------------------- /src-tauri/jexpe/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | tauri_build::build() 3 | } 4 | -------------------------------------------------------------------------------- /src/contexts/index.ts: -------------------------------------------------------------------------------- 1 | export { TerminalContextProvider, useTerminal } from './terminal' 2 | -------------------------------------------------------------------------------- /src-tauri/.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | /target/ 4 | 5 | -------------------------------------------------------------------------------- /src-tauri/jexpe/icons/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jexpe-apps/jexpe/HEAD/src-tauri/jexpe/icons/icon.ico -------------------------------------------------------------------------------- /src-tauri/jexpe/icons/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jexpe-apps/jexpe/HEAD/src-tauri/jexpe/icons/icon.png -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /src-tauri/jexpe/icons/128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jexpe-apps/jexpe/HEAD/src-tauri/jexpe/icons/128x128.png -------------------------------------------------------------------------------- /src-tauri/jexpe/icons/32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jexpe-apps/jexpe/HEAD/src-tauri/jexpe/icons/32x32.png -------------------------------------------------------------------------------- /src-tauri/jexpe/icons/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jexpe-apps/jexpe/HEAD/src-tauri/jexpe/icons/icon.icns -------------------------------------------------------------------------------- /src-tauri/jexpe/icons/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jexpe-apps/jexpe/HEAD/src-tauri/jexpe/icons/StoreLogo.png -------------------------------------------------------------------------------- /src-tauri/jexpe/icons/128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jexpe-apps/jexpe/HEAD/src-tauri/jexpe/icons/128x128@2x.png -------------------------------------------------------------------------------- /src-tauri/jexpe/icons/Square107x107Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jexpe-apps/jexpe/HEAD/src-tauri/jexpe/icons/Square107x107Logo.png -------------------------------------------------------------------------------- /src-tauri/jexpe/icons/Square142x142Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jexpe-apps/jexpe/HEAD/src-tauri/jexpe/icons/Square142x142Logo.png -------------------------------------------------------------------------------- /src-tauri/jexpe/icons/Square150x150Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jexpe-apps/jexpe/HEAD/src-tauri/jexpe/icons/Square150x150Logo.png -------------------------------------------------------------------------------- /src-tauri/jexpe/icons/Square284x284Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jexpe-apps/jexpe/HEAD/src-tauri/jexpe/icons/Square284x284Logo.png -------------------------------------------------------------------------------- /src-tauri/jexpe/icons/Square30x30Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jexpe-apps/jexpe/HEAD/src-tauri/jexpe/icons/Square30x30Logo.png -------------------------------------------------------------------------------- /src-tauri/jexpe/icons/Square310x310Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jexpe-apps/jexpe/HEAD/src-tauri/jexpe/icons/Square310x310Logo.png -------------------------------------------------------------------------------- /src-tauri/jexpe/icons/Square44x44Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jexpe-apps/jexpe/HEAD/src-tauri/jexpe/icons/Square44x44Logo.png -------------------------------------------------------------------------------- /src-tauri/jexpe/icons/Square71x71Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jexpe-apps/jexpe/HEAD/src-tauri/jexpe/icons/Square71x71Logo.png -------------------------------------------------------------------------------- /src-tauri/jexpe/icons/Square89x89Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jexpe-apps/jexpe/HEAD/src-tauri/jexpe/icons/Square89x89Logo.png -------------------------------------------------------------------------------- /src/layouts/index.ts: -------------------------------------------------------------------------------- 1 | export { default as DefaultLayout } from './default' 2 | export { default as FullScreenLayout } from './fullscreen' -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "es5", 3 | "tabWidth": 4, 4 | "semi": false, 5 | "singleQuote": true, 6 | "printWidth": 400, 7 | "useTabs": true 8 | } 9 | -------------------------------------------------------------------------------- /src/components/tab_controller/components/index.ts: -------------------------------------------------------------------------------- 1 | export { default as HomeButton } from './home' 2 | export { default as Tab } from './tab' 3 | export { default as OptionsMenu } from './options' 4 | -------------------------------------------------------------------------------- /next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | // NOTE: This file should not be edited 5 | // see https://nextjs.org/docs/basic-features/typescript for more information. 6 | -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | 3 | const nextConfig = { 4 | reactStrictMode: false, 5 | swcMinify: true, 6 | images: { 7 | unoptimized: true, 8 | }, 9 | } 10 | 11 | module.exports = nextConfig 12 | -------------------------------------------------------------------------------- /src/components/index.ts: -------------------------------------------------------------------------------- 1 | import dynamic from 'next/dynamic' 2 | 3 | export { default as Flex } from './flex' 4 | export { default as Center } from './center' 5 | export { default as TabController } from './tab_controller' 6 | 7 | export const XTerm = dynamic(() => import('./xterm'), { ssr: false }) -------------------------------------------------------------------------------- /src/contexts/tab/types.ts: -------------------------------------------------------------------------------- 1 | import { UniqueObject } from 'src/types' 2 | 3 | export interface ITab extends UniqueObject { 4 | position: number 5 | title: string 6 | href: string 7 | icon?: string 8 | } 9 | 10 | export interface ITabContext { 11 | tabs: ITab[] 12 | } 13 | -------------------------------------------------------------------------------- /public/assets/icons/oracle-linux.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/center/index.tsx: -------------------------------------------------------------------------------- 1 | import { FCWithChildren } from 'src/types' 2 | import { Flex } from 'src/components' 3 | 4 | const Component: FCWithChildren = ({ children }) => ( 5 | 6 | {children} 7 | 8 | ) 9 | 10 | export default Component 11 | -------------------------------------------------------------------------------- /src/components/tab_controller/components/tab/types.ts: -------------------------------------------------------------------------------- 1 | import { ReactNode } from 'react' 2 | 3 | export interface ITabProps { 4 | href: string 5 | label: string 6 | icon?: ReactNode 7 | onClick?: () => void 8 | onClose?: () => void 9 | active?: boolean 10 | dragging?: boolean 11 | } 12 | -------------------------------------------------------------------------------- /src/layouts/fullscreen/index.tsx: -------------------------------------------------------------------------------- 1 | import { LayoutFC } from 'src/types' 2 | 3 | const Layout: LayoutFC = (page) => { 4 | return ( 5 |
6 | {page} 7 |
8 | ) 9 | } 10 | 11 | export default Layout 12 | -------------------------------------------------------------------------------- /public/assets/icons/cygwin.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/xterm/types.ts: -------------------------------------------------------------------------------- 1 | import type { Terminal } from 'xterm' 2 | import { ReactElement } from 'react' 3 | 4 | export interface IXTermProps { 5 | id: string 6 | terminal: Terminal 7 | 8 | canvas: ReactElement 9 | } 10 | 11 | export interface IPtyStdoutPayload { 12 | id: string 13 | bytes: Uint8Array 14 | } 15 | -------------------------------------------------------------------------------- /src/pages/index.tsx: -------------------------------------------------------------------------------- 1 | import { Typography } from 'antd' 2 | import { Flex } from 'src/components' 3 | import { NextPageWithLayout } from 'src/types' 4 | 5 | const Page: NextPageWithLayout = () => { 6 | return ( 7 | 8 | Homepage 9 | 10 | ) 11 | } 12 | 13 | export default Page 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | .next 15 | 16 | # Editor directories and files 17 | .vscode 18 | !.vscode/extensions.json 19 | .idea 20 | .DS_Store 21 | *.suo 22 | *.ntvs* 23 | *.njsproj 24 | *.sln 25 | *.sw? 26 | -------------------------------------------------------------------------------- /src/layouts/default/index.tsx: -------------------------------------------------------------------------------- 1 | import { LayoutFC } from 'src/types' 2 | import { Flex, TabController } from 'src/components' 3 | 4 | const Layout: LayoutFC = (page) => { 5 | return ( 6 | 7 | 8 | {page} 9 | 10 | ) 11 | } 12 | 13 | export default Layout 14 | -------------------------------------------------------------------------------- /public/assets/icons/clink.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/assets/icons/cmd.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src-tauri/jexpe/src/shell/commands.rs: -------------------------------------------------------------------------------- 1 | use crate::shell::SystemShell; 2 | 3 | #[cfg(target_family = "windows")] 4 | #[tauri::command] 5 | pub fn get_system_shells() -> Result, String> { 6 | Ok(crate::shell::windows::get_available_shells()) 7 | } 8 | 9 | #[cfg(target_family = "unix")] 10 | #[tauri::command] 11 | pub fn get_system_shells() -> Result, String> { 12 | Ok(crate::shell::unix::get_available_shells()) 13 | } -------------------------------------------------------------------------------- /src/contexts/terminal/constants.ts: -------------------------------------------------------------------------------- 1 | export const PTY_SPAWN_EVENT = 'EVENTS:PTY:SPAWN' 2 | export const PTY_STDOUT_EVENT = 'EVENTS:PTY:STDOUT' 3 | export const PTY_EXIT_EVENT = 'EVENTS:PTY:EXIT' 4 | 5 | export const GET_SYSTEM_SHELLS_COMMAND = 'get_system_shells' 6 | export const PTY_SPAWN_COMMAND = 'spawn_pty' 7 | export const PTY_STDIN_COMMAND = 'write_pty' 8 | export const PTY_RESIZE_COMMAND = 'resize_pty' 9 | export const PTY_KILL_COMMAND = 'kill_pty' 10 | -------------------------------------------------------------------------------- /src/components/flex/types.ts: -------------------------------------------------------------------------------- 1 | import { Property } from 'csstype' 2 | import { HTMLAttributes, RefAttributes } from 'react' 3 | 4 | export interface IFlexProps extends HTMLAttributes, RefAttributes { 5 | direction?: Property.FlexDirection 6 | align?: Property.AlignItems 7 | justify?: Property.JustifyContent 8 | wrap?: Property.FlexWrap 9 | basis?: Property.FlexBasis 10 | grow?: Property.FlexGrow 11 | shrink?: Property.FlexShrink 12 | } 13 | -------------------------------------------------------------------------------- /src/pages/terminal/index.tsx: -------------------------------------------------------------------------------- 1 | import { useTerminal } from 'src/contexts' 2 | import { XTerm } from 'src/components' 3 | 4 | import type { NextPageWithLayout } from 'src/types' 5 | 6 | const Terminal: NextPageWithLayout = () => { 7 | const { terminals, focused } = useTerminal() 8 | 9 | return ( 10 | <> 11 | {terminals.map((terminal) => ( 12 | 13 | ))} 14 | 15 | ) 16 | } 17 | 18 | export default Terminal 19 | -------------------------------------------------------------------------------- /public/assets/icons/vs2017.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/globals.css: -------------------------------------------------------------------------------- 1 | @tailwind utilities; 2 | 3 | html, 4 | body { 5 | cursor: default; 6 | padding: 0; 7 | margin: 0; 8 | 9 | @apply bg-dark-700; 10 | @apply text-dark-50; 11 | 12 | overscroll-behavior-y: none; 13 | 14 | -webkit-user-select: none; /* Safari */ 15 | -ms-user-select: none; /* Internet Explorer/Edge */ 16 | user-select: none; /* Non-prefixed version, currently supported by Chrome, Edge, Opera and Firefox */ 17 | } 18 | 19 | img, 20 | a { 21 | -webkit-user-drag: none; 22 | text-decoration: none; 23 | } 24 | -------------------------------------------------------------------------------- /src/contexts/tab/index.tsx: -------------------------------------------------------------------------------- 1 | import { createContext, useContext, useState } from 'react' 2 | 3 | import type { FCWithChildren } from 'src/types' 4 | import type { ITab, ITabContext } from './types' 5 | 6 | const TabContext = createContext({ 7 | tabs: [], 8 | }) 9 | 10 | export const TabContextProvider: FCWithChildren = ({ children }) => { 11 | const [tabs] = useState([]) 12 | 13 | return {children} 14 | } 15 | 16 | export const useTerminal = () => useContext(TabContext) 17 | -------------------------------------------------------------------------------- /public/assets/icons/cmder.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/assets/icons/cmder-powershell.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.github/SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Use this section to tell people about which versions of your project are 6 | currently being supported with security updates. 7 | 8 | | Version | Supported | 9 | | ------- | ------------------ | 10 | | < 1.0.0 | :white_check_mark: | 11 | 12 | ## Reporting a Vulnerability 13 | 14 | Use this section to tell people how to report a vulnerability. 15 | 16 | Tell them where to go, how often they can expect to get an update on a 17 | reported vulnerability, what to expect if the vulnerability is accepted or 18 | declined, etc. 19 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parser: '@typescript-eslint/parser', 3 | parserOptions: { 4 | tsconfigRootDir: __dirname, 5 | project: 'tsconfig.json', 6 | }, 7 | plugins: [ 8 | '@typescript-eslint', 9 | ], 10 | extends: [ 11 | 'next/core-web-vitals', 12 | 'plugin:@typescript-eslint/recommended', 13 | 'plugin:@typescript-eslint/recommended-requiring-type-checking', 14 | 'plugin:@typescript-eslint/strict', 15 | 'prettier', 16 | ], 17 | root: true, 18 | rules: { 19 | 'react-hooks/exhaustive-deps': 'off', 20 | }, 21 | } 22 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | exec >/dev/tty 2>&1 5 | 6 | npx lint-staged 7 | 8 | # Checking branch name 9 | branch="$(git rev-parse --abbrev-ref HEAD)" 10 | branch_regex="^(build|ci|docs|feat|fix|perf|refactor)\/[a-z0-9_]+$" 11 | 12 | message=" 13 | [❌ ] Working branch name must adhere to this contract: \"/\", e.g. \"build/migrate_yarn\". 14 | Your commit will be rejected! You should rename your branch to a valid name and try again. 15 | (Hint: git branch -m ) 16 | " 17 | 18 | if [[ ! $branch =~ $branch_regex ]] 19 | then 20 | echo "$message" 21 | exit 1 22 | fi -------------------------------------------------------------------------------- /src-tauri/jexpe/src/shell/mod.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | pub mod commands; 5 | 6 | #[cfg(target_family = "windows")] 7 | mod windows; 8 | 9 | #[cfg(target_family = "unix")] 10 | mod unix; 11 | 12 | #[derive(Serialize, Deserialize, Clone)] 13 | struct PtyStdoutPayload { 14 | id: String, 15 | bytes: Vec, 16 | } 17 | 18 | #[derive(Serialize, Deserialize, Clone)] 19 | pub struct SystemShell { 20 | pub id: String, 21 | pub name: String, 22 | pub command: String, 23 | pub args: Vec, 24 | pub env: HashMap, 25 | pub cwd: Option, 26 | pub icon: String, 27 | } -------------------------------------------------------------------------------- /src/types/index.ts: -------------------------------------------------------------------------------- 1 | import { NextPage } from 'next' 2 | import { AppProps } from 'next/app' 3 | import { FC, ReactElement, ReactNode } from 'react' 4 | 5 | export type LayoutFC = (page: ReactElement) => ReactNode 6 | 7 | export type NextPageWithLayout

= NextPage & { 8 | getLayout?: LayoutFC 9 | protectedRoute?: boolean 10 | } 11 | 12 | export type AppPropsWithLayout = AppProps & { 13 | Component: NextPageWithLayout 14 | } 15 | 16 | export type FCWithChildren = FC<{ children?: ReactNode } & V> 17 | 18 | export type Maybe = T | undefined 19 | export type Nullable = T | null 20 | 21 | export interface UniqueObject { 22 | id: string 23 | } 24 | -------------------------------------------------------------------------------- /src-tauri/jexpe/src/pty/constants.rs: -------------------------------------------------------------------------------- 1 | use std::time::Duration; 2 | 3 | /// Represents the maximum size (in bytes) that data will be read from pipes 4 | /// per individual `read` call 5 | /// 6 | /// Current setting is 16k size 7 | pub const MAX_PIPE_CHUNK_SIZE: usize = 16384; 8 | 9 | /// Duration in milliseconds to sleep between reading stdout/stderr chunks 10 | /// to avoid sending many small messages to clients 11 | pub const READ_PAUSE_DURATION: Duration = Duration::from_millis(1); 12 | 13 | /// Events that can be emitted by the pty 14 | pub const PTY_SPAWN_EVENT: &str = "EVENTS:PTY:SPAWN"; 15 | pub const PTY_STDOUT_EVENT: &str = "EVENTS:PTY:STDOUT"; 16 | pub const PTY_EXIT_EVENT: &str = "EVENTS:PTY:EXIT"; -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "allowJs": true, 10 | "moduleResolution": "node", 11 | "skipLibCheck": true, 12 | "strict": true, 13 | "forceConsistentCasingInFileNames": true, 14 | "noEmit": true, 15 | "incremental": true, 16 | "esModuleInterop": true, 17 | "module": "esnext", 18 | "resolveJsonModule": true, 19 | "isolatedModules": true, 20 | "jsx": "preserve", 21 | "baseUrl": "./" 22 | }, 23 | "include": [ 24 | "next-env.d.ts", 25 | "**/*.ts", 26 | "**/*.tsx" 27 | ], 28 | "exclude": [ 29 | "node_modules" 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: raccoman 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: ['https://discord.com/invite/cfHmUnPDtM'] 14 | -------------------------------------------------------------------------------- /src/components/flex/index.tsx: -------------------------------------------------------------------------------- 1 | import type { FCWithChildren } from 'src/types' 2 | import type { IFlexProps } from './types' 3 | 4 | const Component: FCWithChildren = ({ children, direction, grow, basis, shrink, wrap, align, justify, ...props }) => { 5 | return ( 6 |

20 | {children} 21 |
22 | ) 23 | } 24 | 25 | export default Component 26 | -------------------------------------------------------------------------------- /src/components/tab_controller/components/home/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { FC, useMemo } from 'react' 2 | import Link from 'next/link' 3 | import { House } from 'phosphor-react' 4 | import { useRouter } from 'next/router' 5 | import { Button } from 'antd' 6 | import { Center } from 'src/components' 7 | 8 | const Component: FC = () => { 9 | const router = useRouter() 10 | const isActive = useMemo(() => router.pathname === '/', [router.pathname]) 11 | 12 | return ( 13 | 14 | 22 | 23 | ) 24 | } 25 | 26 | export default Component -------------------------------------------------------------------------------- /src-tauri/jexpe/src/pty/mod.rs: -------------------------------------------------------------------------------- 1 | use portable_pty::MasterPty; 2 | use serde::{Deserialize, Serialize}; 3 | use tokio::sync::mpsc::Sender; 4 | use tokio::task::JoinHandle; 5 | use crate::shell::SystemShell; 6 | 7 | mod constants; 8 | pub mod commands; 9 | 10 | #[derive(Serialize, Deserialize, Clone)] 11 | struct PtyStdoutPayload { 12 | id: String, 13 | bytes: Vec, 14 | } 15 | 16 | #[derive(Serialize, Deserialize, Clone)] 17 | struct PtyExitPayload { 18 | id: String, 19 | success: bool, 20 | code: Option, 21 | } 22 | 23 | #[derive(Serialize, Deserialize, Clone)] 24 | struct PtySpawnPayload { 25 | id: String, 26 | shell: SystemShell, 27 | } 28 | 29 | pub struct PtyProcess { 30 | id: String, 31 | pty_master: Box, 32 | stdin_tx: Sender>, 33 | kill_tx: Sender<()>, 34 | stdin_task: JoinHandle<()>, 35 | stdout_task: JoinHandle<()>, 36 | } -------------------------------------------------------------------------------- /src-tauri/jexpe/src/main.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | use tauri::Builder; 3 | use tokio::sync::{Mutex}; 4 | 5 | use crate::pty::PtyProcess; 6 | 7 | mod pty; 8 | mod shell; 9 | 10 | pub struct JexpeState { 11 | ptys: Mutex>, 12 | } 13 | 14 | impl JexpeState { 15 | fn new() -> Self { 16 | Self { 17 | ptys: Mutex::new(HashMap::new()), 18 | } 19 | } 20 | } 21 | 22 | 23 | fn main() { 24 | Builder::default() 25 | .manage(JexpeState::new()) 26 | .invoke_handler(tauri::generate_handler![ 27 | shell::commands::get_system_shells, 28 | pty::commands::spawn_pty, 29 | pty::commands::write_pty, 30 | pty::commands::resize_pty, 31 | pty::commands::kill_pty, 32 | ]) 33 | .run(tauri::generate_context!()) 34 | .expect("error while running jexpe application"); 35 | } 36 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [_e.g. iOS] 28 | - Browser [_e.g. chrome, safari] 29 | - Version [_e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [_e.g. iPhone6] 33 | - OS: [_e.g. iOS8.1] 34 | - Browser [_e.g. stock browser, safari] 35 | - Version [_e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /src/contexts/terminal/types.ts: -------------------------------------------------------------------------------- 1 | import type { Terminal as XTerm } from 'xterm' 2 | import type { UniqueObject } from 'src/types' 3 | 4 | export interface ITerminal extends UniqueObject { 5 | title: string 6 | shell: ISystemShell 7 | xterm: XTerm 8 | } 9 | 10 | export interface ITerminalContext { 11 | shells: ISystemShell[] 12 | 13 | spawnPty: (shell: ISystemShell) => void 14 | killPty: (id: string) => void 15 | terminals: ITerminal[] 16 | focused: string | undefined 17 | focus: (id: string) => void 18 | } 19 | 20 | export interface ISystemShell { 21 | id: string 22 | name: string 23 | command: string 24 | args?: string[] 25 | env: Record 26 | cwd?: string 27 | icon: string 28 | } 29 | 30 | export interface IPtySize { 31 | rows: number 32 | cols: number 33 | pixel_width: number 34 | pixel_height: number 35 | } 36 | 37 | export interface IPTYSpawnPayload extends UniqueObject { 38 | shell: ISystemShell 39 | } 40 | 41 | export interface IPTYSdoutPayload extends UniqueObject { 42 | bytes: Uint8Array 43 | } 44 | 45 | export interface IPTYExitPayload extends UniqueObject { 46 | success: boolean 47 | code?: number 48 | } 49 | -------------------------------------------------------------------------------- /src/pages/_app.tsx: -------------------------------------------------------------------------------- 1 | import 'src/xterm.css' 2 | import 'src/globals.css' 3 | 4 | import { DefaultLayout } from 'src/layouts' 5 | import { AppPropsWithLayout } from 'src/types' 6 | import { ConfigProvider, theme } from 'antd' 7 | import { TerminalContextProvider } from 'src/contexts' 8 | 9 | const MyApp = ({ Component, pageProps }: AppPropsWithLayout) => { 10 | const getLayout = Component.getLayout ?? DefaultLayout 11 | 12 | return ( 13 | 28 | {getLayout()} 29 | 30 | ) 31 | } 32 | 33 | export default MyApp 34 | -------------------------------------------------------------------------------- /src-tauri/jexpe/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "jexpe" 3 | version = "0.0.1" 4 | description = "Your one-stop connection software" 5 | authors = ["raccoman "] 6 | edition = "2021" 7 | 8 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 9 | 10 | [build-dependencies] 11 | tauri-build = { version = "1.2", features = [] } 12 | 13 | [dependencies] 14 | serde_json = { version = "1.0" } 15 | serde = { version = "1.0", features = ["derive"] } 16 | tauri = { version = "1.2", features = [] } 17 | tokio = { version = "1.24", features = ["macros", "rt", "sync", "time"] } 18 | cuid = { version = "1.2.0" } 19 | portable-pty = { git = "https://github.com/wez/wezterm.git", features = ["serde_support"] } 20 | phf = { version = "0.11.1", features = ["macros"] } 21 | 22 | [target.'cfg(target_os = "windows")'.dependencies] 23 | winreg = "0.10.1" 24 | 25 | [features] 26 | # by default Tauri runs in production mode 27 | # when `jexpe dev` runs it is executed with `cargo run --no-default-features` if `devPath` is an URL 28 | default = ["custom-protocol"] 29 | # this feature is used used for production builds where `devPath` points to the filesystem 30 | # DO NOT remove this 31 | custom-protocol = ["tauri/custom-protocol"] 32 | -------------------------------------------------------------------------------- /.github/workflows/pull_request.yml: -------------------------------------------------------------------------------- 1 | name: 'build-on-pr-review' 2 | on: 3 | pull_request_review: 4 | types: ["submitted"] 5 | branches: [ "dev" ] 6 | 7 | jobs: 8 | build-tauri: 9 | strategy: 10 | fail-fast: false 11 | matrix: 12 | platform: [macos-latest, ubuntu-20.04, windows-latest] 13 | 14 | runs-on: ${{ matrix.platform }} 15 | steps: 16 | - uses: actions/checkout@v3 17 | 18 | - name: setup node 19 | uses: actions/setup-node@v3 20 | with: 21 | node-version: 16 22 | 23 | - name: install Rust stable 24 | uses: dtolnay/rust-toolchain@stable 25 | 26 | - name: install dependencies (ubuntu only) 27 | if: matrix.platform == 'ubuntu-20.04' 28 | run: | 29 | sudo apt-get update 30 | sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf 31 | 32 | - name: install app dependencies and build it 33 | run: yarn && yarn build 34 | 35 | - uses: tauri-apps/tauri-action@v0 36 | env: 37 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 38 | 39 | - uses: actions/upload-artifact@v2 40 | with: 41 | name: ${{ matrix.platform }} 42 | path: | 43 | **/src-tauri/target/release/bundle/ 44 | -------------------------------------------------------------------------------- /src-tauri/jexpe/src/shell/unix.rs: -------------------------------------------------------------------------------- 1 | use phf::phf_map; 2 | 3 | use super::SystemShell; 4 | use std::{fs::File, io::{BufReader, BufRead}, collections::HashMap}; 5 | 6 | const ICON_MAPPINGS: phf::Map<&'static str, &'static str> = phf_map! { 7 | "bash" => "/assets/icons/bash.svg", 8 | }; 9 | 10 | pub fn get_available_shells() -> Vec { 11 | let mut shells = Vec::new(); 12 | 13 | let file = File::open("/etc/shells"); 14 | if let Ok(file) = file { 15 | for line in BufReader::new(file) 16 | .lines() 17 | .filter_map(|line| line.ok()) { 18 | if let Some(path) = line.split('#').next() { 19 | if !path.trim().is_empty() { 20 | if let Some(name) = path.split('/').last() { 21 | shells.push(SystemShell { 22 | id: name.to_string(), 23 | name: name.to_string(), 24 | command: path.to_string(), 25 | args: Vec::new(), 26 | env: HashMap::new(), 27 | cwd: None, 28 | icon: ICON_MAPPINGS.get(name).cloned() 29 | .unwrap_or("/assets/icons/bash.svg").to_string(), 30 | }); 31 | } 32 | } 33 | } 34 | } 35 | } 36 | 37 | shells 38 | } -------------------------------------------------------------------------------- /public/assets/icons/alpine.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/assets/icons/open-euler.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/assets/icons/git-bash.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/components/tab_controller/components/options/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { FC, useState } from 'react' 2 | import { CaretDown, Plus } from 'phosphor-react' 3 | import { useTerminal } from 'src/contexts' 4 | import { Button, Modal, Space, Typography } from 'antd' 5 | import Image from 'next/image' 6 | import { Center, Flex } from 'src/components' 7 | 8 | const Component: FC = () => { 9 | const { shells, spawnPty } = useTerminal() 10 | 11 | const [isModalOpen, setModalOpen] = useState(false) 12 | 13 | const closeModal = () => setModalOpen(false) 14 | const openModal = () => setModalOpen(true) 15 | 16 | return ( 17 | 18 | 44 | ))} 45 | 46 | 47 | 48 | 60 | 61 | 62 | 63 | {contextHolder} 64 | 65 | ) 66 | } 67 | 68 | export default Component 69 | -------------------------------------------------------------------------------- /src/components/xterm/index.tsx: -------------------------------------------------------------------------------- 1 | import { FC, useEffect, useMemo, useRef } from 'react' 2 | import { FitAddon } from 'xterm-addon-fit' 3 | import { useSize } from 'ahooks' 4 | import { Unicode11Addon } from 'xterm-addon-unicode11' 5 | import { CanvasAddon } from 'xterm-addon-canvas' 6 | // import { WebglAddon } from 'xterm-addon-webgl' 7 | // import { LigaturesAddon } from 'xterm-addon-ligatures' 8 | // import { ImageAddon } from 'xterm-addon-image' 9 | import { WebLinksAddon } from 'xterm-addon-web-links' 10 | 11 | import type { ITerminal } from 'src/contexts/terminal/types' 12 | 13 | const Component: FC<{ terminal: ITerminal; focused: boolean }> = ({ terminal, focused }) => { 14 | const target = useRef(null) 15 | const targetSize = useSize(target) 16 | 17 | const addons = useMemo( 18 | () => ({ 19 | resize: new FitAddon(), 20 | render: new CanvasAddon(), // TODO: user.config.renderMode === 'CANVAS' ? new CanvasAddon() : new WebglAddon(), 21 | webLinks: new WebLinksAddon(), 22 | unicode11: new Unicode11Addon(), 23 | // ligaturesAddon: new LigaturesAddon(), 24 | // imageAddon: new ImageAddon(), 25 | }), 26 | [] 27 | ) 28 | 29 | useEffect(() => { 30 | if (!focused) { 31 | return 32 | } 33 | 34 | addons.resize.fit() 35 | }, [targetSize, focused]) 36 | 37 | useEffect(() => { 38 | terminal.xterm.focus() 39 | return () => terminal.xterm.blur() 40 | }, [focused]) 41 | 42 | useEffect(() => { 43 | if (!target.current) { 44 | return 45 | } 46 | 47 | console.log('mounting terminal', terminal.id) 48 | 49 | terminal.xterm.open(target.current) 50 | terminal.xterm.focus() 51 | 52 | // Activate the xtermjs addons 53 | Object.values(addons).forEach((addon) => { 54 | terminal.xterm.loadAddon(addon) 55 | addon.activate(terminal.xterm) 56 | }) 57 | 58 | // Extra configurations for xtermjs addons 59 | terminal.xterm.unicode.activeVersion = '11' 60 | 61 | return () => { 62 | Object.values(addons).forEach((x) => x.dispose()) 63 | terminal.xterm.dispose() 64 | } 65 | }, []) 66 | 67 | return
68 | } 69 | 70 | export default Component 71 | -------------------------------------------------------------------------------- /public/assets/icons/kali.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/assets/icons/alma.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/assets/icons/suse.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | 4 | 5 | 6 | 7 |

Jexpe

8 | 9 |

10 | 11 |

12 | 13 | GitHub closed pull requests 14 | 15 | 16 | GitHub 17 | 18 | 19 | Discord 20 | 21 |

22 | 23 | Jexpe is a cross-platform, open source SSH and SFTP client that makes connecting to your remote servers easy. 24 | 25 | ## Getting Started 26 | 27 | Our stack is based on [Tauri](https://tauri.app/v1/guides/getting-started/prerequisites) and [NextJS](https://nextjs.org/docs/getting-started) please follow following their installation steps before continuing. We use [Yarn](https://yarnpkg.com/getting-started/install) as package manager, so follow his installation steps too. 28 | 29 | ```console 30 | 31 | # Install all the dependencies listed within package.json 32 | yarn install 33 | 34 | # To be sure of using basic linting and formatting rules, subscribe to git-hooks 35 | yarn prepare 36 | 37 | # You are ready to start the development environment 38 | yarn tauri dev 39 | ``` 40 | 41 | ## Roadmap 42 | 43 | See [ROADMAP.md](./.github/ROADMAP.md) for more information. 44 | 45 | ## Contributing 46 | 47 | See [CONTRIBUTING.md](./.github/CONTRIBUTING.md) for more information. 48 | 49 | ## Community 50 | 51 | Join our [Jexpe Discord](https://discord.com/invite/cfHmUnPDtM), and be part of our community! Ask questions, voice ideas, and share your projects. 52 | 53 | Our [Code of Conduct](https://github.com/jexpe-apps/jexpe/blob/main/.github/CODE_OF_CONDUCT.md) applies to all Jexpe community channels. 54 | 55 | ## Security 56 | 57 | If you believe you have found a security vulnerability in Jexpe, we encourage you to responsibly disclose this and not open a public issue. We will investigate all legitimate reports. Email [riccardoaccoma@gmail.com](mailto:riccardoaccoma@gmail.com) to disclose any security vulnerabilities. 58 | -------------------------------------------------------------------------------- /public/assets/icons/ubuntu.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/tab_controller/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { FC } from 'react' 2 | import { DragDropContext, Draggable, DraggableProvided, Droppable, OnDragEndResponder } from '@hello-pangea/dnd' 3 | import { Center, Flex } from 'src/components' 4 | import { theme } from 'antd' 5 | import { HomeButton, Tab, OptionsMenu } from './components' 6 | import Image from 'next/image' 7 | import { useTerminal } from 'src/contexts' 8 | import { useRouter } from 'next/router' 9 | 10 | const preventDragYMovement = (provided: DraggableProvided) => { 11 | let transform = provided.draggableProps.style?.transform 12 | 13 | if (transform) { 14 | transform = transform.replace(/,\s[-+]*\d+px\)/, ', 0px)') 15 | provided.draggableProps.style = { 16 | ...provided.draggableProps.style, 17 | transform, 18 | } 19 | } 20 | } 21 | 22 | const Component: FC = () => { 23 | const { asPath } = useRouter() 24 | const { 25 | token: { paddingXS }, 26 | } = theme.useToken() 27 | 28 | const { terminals, focused, focus, killPty } = useTerminal() 29 | 30 | // a little function to help us with reordering the result 31 | // const reorder = (list: any, startIndex: any, endIndex: any) => { 32 | // const result = Array.from(list) 33 | // const [removed] = result.splice(startIndex, 1) 34 | // result.splice(endIndex, 0, removed) 35 | // 36 | // return result 37 | // } 38 | 39 | const onDragEnd: OnDragEndResponder = (result) => { 40 | // dropped outside the list 41 | if (!result.destination) { 42 | return 43 | } 44 | 45 | // const ordered = reorder( 46 | // items, 47 | // result.source.index, 48 | // result.destination.index, 49 | // ) 50 | // 51 | // // @ts-ignore 52 | // setItems([...ordered]) 53 | } 54 | 55 | return ( 56 | 57 | 58 | 59 | 60 | 61 | {(droppable) => { 62 | return ( 63 |
64 | {terminals.map((terminal, index) => ( 65 | 66 | {(draggable, snapshot) => { 67 | preventDragYMovement(draggable) 68 | 69 | return ( 70 |
71 | 76 | pty-icon 77 | 78 | } 79 | onClick={() => focus(terminal.id)} 80 | onClose={() => killPty(terminal.id)} 81 | active={asPath === '/terminal' && focused === terminal.id} 82 | dragging={snapshot.isDragging} 83 | /> 84 |
85 | ) 86 | }} 87 |
88 | ))} 89 | {droppable.placeholder} 90 |
91 | ) 92 | }} 93 |
94 |
95 | 96 | 97 |
98 | ) 99 | } 100 | 101 | export default Component 102 | -------------------------------------------------------------------------------- /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | 3 | ### Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. 6 | 7 | We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. 8 | 9 | ### Our Standards 10 | 11 | Examples of behavior that contributes to a positive environment for our community include: 12 | 13 | - Demonstrating empathy and kindness toward other people 14 | - Being respectful of differing opinions, viewpoints, and experiences 15 | - Giving and gracefully accepting constructive feedback 16 | - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience 17 | - Focusing on what is best not just for us as individuals, but for the overall community 18 | 19 | Examples of unacceptable behavior include: 20 | 21 | - The use of sexualized language or imagery, and sexual attention or advances of any kind 22 | - Trolling, insulting or derogatory comments, and personal or political attacks 23 | - Public or private harassment 24 | - Publishing others’ private information, such as a physical or email address, without their explicit permission 25 | - Other conduct which could reasonably be considered inappropriate in a professional setting 26 | 27 | ### Enforcement Responsibilities 28 | 29 | Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. 32 | 33 | ### Scope 34 | 35 | This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official _e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. 36 | 37 | ### Enforcement 38 | 39 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project team responsible for enforcement at [riccardoaccoma@gmail.com](mailto:riccardoaccoma@gmail.com). All complaints will be reviewed and investigated promptly and fairly. 40 | 41 | All project maintainers are obligated to respect the privacy and security of the reporter of any incident. 42 | 43 | Project maintainers who do not follow or enforce the Code of Conduct in good 44 | faith may face temporary or permanent repercussions as determined by other 45 | members of the project's leadership. 46 | 47 | ### Attribution 48 | 49 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, 50 | available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct/][version] 51 | 52 | [homepage]: http://contributor-covenant.org 53 | [version]: https://www.contributor-covenant.org/version/2/1 54 | -------------------------------------------------------------------------------- /.github/ROADMAP.md: -------------------------------------------------------------------------------- 1 | # 🗺️ JEXPE ROADMAP 🗺️ 2 | 3 | This roadmap should give direction on what to expect in the next few days, weeks as we continue to build together with the community. 4 | 5 | Goal status: 6 | [ ✅ ] = achieved 7 | [ ❌ ] = not achieved 8 | [ ⛳ ] = planned 9 | 10 | _Please note that this is not the final roadmap and what you see can be updated down the road, so check back regularly for any future updates._ 11 | 12 | ## 🗿**Q3 2022** 13 | 14 | [ ✅ ] **- THE IDEA WAS BORN** 15 | 16 | > While me and @mghizzo were working for Minecraft servers, we realized that we were having some troubles finding a special SSH and SFTP client. We needed a single software including them both with additional features like passwords management and sharing. 17 | 18 | **[ ✅ ] - MARKET ANALYSIS** 19 | 20 | > Once the idea was born, we looked for competitors to see if there was a viable market. We found a few and analyzed and grouped them according to two parameters: all-in-one and cross-platform. We got: 21 | > 22 | > - Putty ([https://www.putty.org/](https://www.putty.org/ 'https://www.putty.org/')) 23 | > - FileZilla ([https://filezilla-project.org/](https://filezilla-project.org/ 'https://filezilla-project.org/')) 24 | > - WinSCP ([https://winscp.net/](https://winscp.net/ 'https://winscp.net/')) 25 | > - CyberDuck ([https://cyberduck.io/](https://cyberduck.io/ 'https://cyberduck.io/')) 26 | > - MobaXterm ([https://mobaxterm.mobatek.net/](https://mobaxterm.mobatek.net/ 'https://mobaxterm.mobatek.net/')) 27 | > - WindTerm ([https://github.com/kingToolbox/WindTerm](https://github.com/kingToolbox/WindTerm 'https://github.com/kingToolbox/WindTerm')) 28 | > - Termius ([https://termius.com/](https://termius.com/ 'https://termius.com/')) 29 | > 30 | > You'll probably think that we are a Termius copycat and that's 31 | > partially true. Analyzing Termius' user base, we can deduce that 32 | > almost 60% of all the users know it and use it on mobile. We are 33 | > extremely focused on desktop instead. 34 | > 35 | > **Here is why Jexpe is better:** 36 | > 37 | > - **It's lightweight**: Jexpe runs on Tauri which completely overcome Termius' stack (Electron) in terms of security and 38 | > performance. 39 | > - **It's open source**: We strongly believe that in 21st century a software like this should be free 40 | 41 | **[ ✅ ] - SOFTWARE STACK** 42 | 43 | > If you work like a developer today you will discover a trouble: there's not a software using a technology that provides you a tidy modern interface and a good performance without compromising. That's why we chose Tauri. It give us the chance to provide to our users all the features that I listed before. 44 | 45 | **[ ✅ ] - LAUNCH THE PROJECT** 46 | 47 | > We created a Github repository and a Discord server to grow up a community and a relationship between users and developers. Our goal is to not stop users' ideas with some feedbacks, but we want them to contribute directly to the project to grow blazingly fast. 48 | 49 | ## **Q1 2023** 50 | 51 | **[ ⛳ ] - WORKING LOCAL SHELL** 52 | 53 | > Let's start with basic functionality. The user must have the ability to: 54 | > 55 | > - Choose which of the shells available on his or her operating system to start. 56 | > - Have multiple shells open at the same time 57 | > - Manage through a horizontal navigation bar similar to Chrome's, all open shells 58 | 59 | **[ ⛳ ] - 50 STARS ON GITHUB** 60 | 61 | > Stars on GitHub are one of the most important metrics to watch for in this project. They reflect the interest of a segment of our community. The one composed of users who are also developers and therefore make a greater contribution to the project. 62 | 63 | **[ ⛳ ] - 50 MEMBERS ON DISCORD** 64 | 65 | > Members on the Discord server are another of the most important metrics to consider in this project. Our goal is to not stop users' ideas with some feedbacks, but we want them to contribute directly to the project to grow blazingly fast. 66 | -------------------------------------------------------------------------------- /public/assets/icons/msys2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | image/svg+xml 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /public/assets/icons/debian.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/assets/icons/vs2022.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/xterm.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2014 The xterm.js authors. All rights reserved. 3 | * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) 4 | * https://github.com/chjj/term.js 5 | * @license MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | * 25 | * Originally forked from (with the author's permission): 26 | * Fabrice Bellard's javascript vt100 for jslinux: 27 | * http://bellard.org/jslinux/ 28 | * Copyright (c) 2011 Fabrice Bellard 29 | * The original design remains. The terminal itself 30 | * has been extended to include xterm CSI codes, among 31 | * other features. 32 | */ 33 | 34 | /** 35 | * Default styles for xterm.js 36 | */ 37 | 38 | .xterm { 39 | cursor: text; 40 | position: relative; 41 | user-select: none; 42 | -ms-user-select: none; 43 | -webkit-user-select: none; 44 | } 45 | 46 | .xterm.focus, 47 | .xterm:focus { 48 | outline: none; 49 | } 50 | 51 | .xterm .xterm-helpers { 52 | position: absolute; 53 | top: 0; 54 | /** 55 | * The z-index of the helpers must be higher than the canvases in order for 56 | * IMEs to appear on top. 57 | */ 58 | z-index: 5; 59 | } 60 | 61 | .xterm .xterm-helper-textarea { 62 | padding: 0; 63 | border: 0; 64 | margin: 0; 65 | /* Move textarea out of the screen to the far left, so that the cursor is not visible */ 66 | position: absolute; 67 | opacity: 0; 68 | left: -9999em; 69 | top: 0; 70 | width: 0; 71 | height: 0; 72 | z-index: -5; 73 | /** Prevent wrapping so the IME appears against the textarea at the correct position */ 74 | white-space: nowrap; 75 | overflow: hidden; 76 | resize: none; 77 | } 78 | 79 | .xterm .composition-view { 80 | /* TODO: Composition position got messed up somewhere */ 81 | background: #000; 82 | color: #FFF; 83 | display: none; 84 | position: absolute; 85 | white-space: nowrap; 86 | z-index: 1; 87 | } 88 | 89 | .xterm .composition-view.active { 90 | display: block; 91 | } 92 | 93 | .xterm .xterm-viewport { 94 | /* On OS X this is required in order for the scroll bar to appear fully opaque */ 95 | background-color: #000; 96 | overflow-y: scroll; 97 | cursor: default; 98 | position: absolute; 99 | right: 0; 100 | left: 0; 101 | top: 0; 102 | bottom: 0; 103 | } 104 | 105 | .xterm .xterm-screen { 106 | position: relative; 107 | } 108 | 109 | .xterm .xterm-screen canvas { 110 | position: absolute; 111 | left: 0; 112 | top: 0; 113 | } 114 | 115 | .xterm .xterm-scroll-area { 116 | visibility: hidden; 117 | } 118 | 119 | .xterm-char-measure-element { 120 | display: inline-block; 121 | visibility: hidden; 122 | position: absolute; 123 | top: 0; 124 | left: -9999em; 125 | line-height: normal; 126 | } 127 | 128 | .xterm.enable-mouse-events { 129 | /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */ 130 | cursor: default; 131 | } 132 | 133 | .xterm.xterm-cursor-pointer, 134 | .xterm .xterm-cursor-pointer { 135 | cursor: pointer; 136 | } 137 | 138 | .xterm.column-select.focus { 139 | /* Column selection mode */ 140 | cursor: crosshair; 141 | } 142 | 143 | .xterm .xterm-accessibility, 144 | .xterm .xterm-message { 145 | position: absolute; 146 | left: 0; 147 | top: 0; 148 | bottom: 0; 149 | z-index: 10; 150 | color: transparent; 151 | } 152 | 153 | .xterm .live-region { 154 | position: absolute; 155 | left: -9999px; 156 | width: 1px; 157 | height: 1px; 158 | overflow: hidden; 159 | } 160 | 161 | .xterm-dim { 162 | opacity: 0.5; 163 | } 164 | 165 | .xterm-underline-1 { 166 | text-decoration: underline; 167 | } 168 | 169 | .xterm-underline-2 { 170 | text-decoration: double underline; 171 | } 172 | 173 | .xterm-underline-3 { 174 | text-decoration: wavy underline; 175 | } 176 | 177 | .xterm-underline-4 { 178 | text-decoration: dotted underline; 179 | } 180 | 181 | .xterm-underline-5 { 182 | text-decoration: dashed underline; 183 | } 184 | 185 | .xterm-strikethrough { 186 | text-decoration: line-through; 187 | } 188 | 189 | .xterm-screen .xterm-decoration-container .xterm-decoration { 190 | z-index: 6; 191 | position: absolute; 192 | } 193 | 194 | .xterm-decoration-overview-ruler { 195 | z-index: 7; 196 | position: absolute; 197 | top: 0; 198 | right: 0; 199 | pointer-events: none; 200 | } 201 | 202 | .xterm-decoration-top { 203 | z-index: 2; 204 | position: relative; 205 | } 206 | 207 | 208 | .xterm-viewport::-webkit-scrollbar { 209 | background-color: transparent; 210 | width: 0.5rem; 211 | } 212 | 213 | .xterm-viewport::-webkit-scrollbar-thumb { 214 | border-radius: 0.5rem; 215 | } -------------------------------------------------------------------------------- /src/contexts/terminal/index.tsx: -------------------------------------------------------------------------------- 1 | import { createContext, useCallback, useContext, useEffect, useState } from 'react' 2 | import { listen } from '@tauri-apps/api/event' 3 | import { invoke } from '@tauri-apps/api/tauri' 4 | import { useRouter } from 'next/router' 5 | 6 | import { GET_SYSTEM_SHELLS_COMMAND, PTY_EXIT_EVENT, PTY_KILL_COMMAND, PTY_RESIZE_COMMAND, PTY_SPAWN_COMMAND, PTY_SPAWN_EVENT, PTY_STDIN_COMMAND, PTY_STDOUT_EVENT } from './constants' 7 | 8 | import type { FCWithChildren } from 'src/types' 9 | import type { ITerminal, ITerminalContext, IPTYSpawnPayload, IPTYExitPayload, IPTYSdoutPayload, ISystemShell, IPtySize } from './types' 10 | 11 | const TerminalContext = createContext({ 12 | shells: [], 13 | spawnPty: () => undefined, 14 | killPty: () => undefined, 15 | terminals: [], 16 | focused: undefined, 17 | focus: () => undefined, 18 | }) 19 | 20 | export const TerminalContextProvider: FCWithChildren = ({ children }) => { 21 | const [shells, setShells] = useState([]) 22 | const [terminals, setTerminals] = useState([]) 23 | const [focused, setFocused] = useState(undefined) 24 | 25 | const router = useRouter() 26 | 27 | const spawnPty = useCallback((shell: ISystemShell) => { 28 | invoke(PTY_SPAWN_COMMAND, { shell }).catch(console.error) 29 | }, []) 30 | 31 | const writePty = useCallback((id: string, data: string) => { 32 | invoke(PTY_STDIN_COMMAND, { id, data }) 33 | // TODO: Handle errors properly 34 | .catch(console.error) 35 | }, []) 36 | 37 | const resizePty = useCallback((id: string, size: IPtySize) => { 38 | invoke(PTY_RESIZE_COMMAND, { id, size }) 39 | // TODO: Handle errors properly 40 | .catch(console.error) 41 | }, []) 42 | 43 | const updateTitle = useCallback( 44 | (id: string, title: string) => { 45 | setTerminals((terminals) => { 46 | const index = terminals.findIndex((x) => x.id === id) 47 | if (index < 0) { 48 | // This should never happen, but just to be on the safe side 49 | console.error(`[TITLE-LISTENER] Could not find terminal with id ${id}`) 50 | return terminals 51 | } 52 | 53 | terminals[index].title = title 54 | return [...terminals] 55 | }) 56 | }, 57 | [terminals] 58 | ) 59 | 60 | const killPty = useCallback((id: string) => { 61 | invoke(PTY_KILL_COMMAND, { id }) 62 | // TODO: Handle errors properly 63 | .catch(console.error) 64 | }, []) 65 | 66 | useEffect(() => { 67 | invoke(GET_SYSTEM_SHELLS_COMMAND, {}).then(setShells).catch(console.error) 68 | }, []) 69 | 70 | useEffect(() => { 71 | const spawnListener = listen(PTY_SPAWN_EVENT, ({ payload }) => { 72 | const { id, shell } = payload 73 | 74 | // Dynamically import xterm to ensure it's only loaded client-side 75 | import('xterm') 76 | .then(({ Terminal }) => { 77 | // Create a new xterm instance 78 | const xterm = new Terminal({ 79 | // TODO: Add possibility to customize theme 80 | theme: { 81 | background: '#1A1B1E', 82 | cursor: '#10B981', 83 | cursorAccent: '#10B98100', 84 | }, 85 | fontFamily: 'Cascadia Mono, MesloLGS NF, Monospace', 86 | fontWeight: 'normal', 87 | fontSize: 14, 88 | cursorBlink: true, 89 | allowTransparency: true, 90 | allowProposedApi: true, 91 | overviewRulerWidth: 8, 92 | }) 93 | 94 | xterm.onData((data) => writePty(id, data)) 95 | xterm.onResize((size) => 96 | resizePty(id, { 97 | ...size, 98 | // TODO: Retrieve char width and height 99 | pixel_width: 0, 100 | pixel_height: 0, 101 | }) 102 | ) 103 | xterm.onTitleChange((title) => updateTitle(id, title)) 104 | 105 | // Add the terminal to the context 106 | setTerminals((terminals) => [...terminals, { id, shell, title: shell.name, xterm }]) 107 | 108 | // Focus the new terminal 109 | setFocused(id) 110 | 111 | if (router.asPath !== '/terminal') { 112 | void router.push('/terminal') 113 | } 114 | }) 115 | // TODO: Maybe kill pty, just to be on the safe side (?) 116 | .catch(console.error) 117 | }) 118 | 119 | const stdoutListener = listen(PTY_STDOUT_EVENT, ({ payload }) => { 120 | const { id, bytes } = payload 121 | 122 | // Find the terminal with the given id 123 | const terminal = terminals.find((terminal) => terminal.id === id) 124 | if (!terminal) { 125 | // TODO: Maybe kill pty, just to be on the safe side (?) 126 | console.error(`[STDOUT-LISTENER] Could not find terminal with id ${id}`) 127 | return 128 | } 129 | 130 | // Write the bytes to the xterm instance 131 | terminal.xterm.write(bytes) 132 | }) 133 | 134 | const exitListener = listen(PTY_EXIT_EVENT, ({ payload }) => { 135 | const { id, success, code } = payload 136 | 137 | // Find the terminal with the given id 138 | const index = terminals.findIndex((terminal) => terminal.id === id) 139 | if (index < 0) { 140 | // This should never happen, but just to be on the safe side 141 | console.error(`[EXIT-LISTENER] Could not find terminal with id ${id}`) 142 | setFocused(undefined) 143 | return 144 | } 145 | 146 | // TODO: Handle `success` and `code` properly 147 | void success 148 | void code 149 | 150 | setTerminals((terminals) => { 151 | // Focus the next terminal in the array 152 | const toFocus = terminals.at(index + 1) ?? terminals.at(index - 1) 153 | setFocused(toFocus?.id) 154 | 155 | // Remove the terminal from the array 156 | terminals.splice(index, 1) 157 | return [...terminals] 158 | }) 159 | }) 160 | 161 | return () => { 162 | spawnListener.then((unlisten) => unlisten()).catch(console.error) 163 | 164 | stdoutListener.then((unlisten) => unlisten()).catch(console.error) 165 | 166 | exitListener.then((unlisten) => unlisten()).catch(console.error) 167 | } 168 | }, [terminals]) 169 | 170 | return ( 171 | 181 | {children} 182 | 183 | ) 184 | } 185 | 186 | export const useTerminal = () => useContext(TerminalContext) 187 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Jexpe Contributing Guide 2 | 3 | Hi! We, the maintainers, are really excited that you are interested in contributing to Jexpe. Before submitting your 4 | contribution though, please make sure to take a moment and read through the [Code of Conduct](CODE_OF_CONDUCT.md), as 5 | well as the appropriate section for the contribution you intend to make: 6 | 7 | - [Issue Reporting Guidelines](#issue-reporting-guidelines) 8 | - [Development Guide](#development-guide) 9 | - [Pull Request Guidelines](#pull-request-guidelines) 10 | 11 | **We strongly advise you to join the [Jexpe Discord](https://discord.com/invite/cfHmUnPDtM) to discuss your contribution 12 | with the community.** 13 | 14 | ## Issue Reporting Guidelines 15 | 16 | - The issue list of this repo is **exclusively** for bug reports and feature requests. Non-conforming issues will be 17 | closed immediately. 18 | 19 | - If you have a question, you can get quick answers from the [Jexpe Discord](https://discord.com/invite/cfHmUnPDtM). 20 | 21 | - Try to search for your issue, it may have already been answered or even fixed in the development branch (`dev`). 22 | 23 | - Check if the issue is reproducible with the latest stable version of Jexpe. If you are using a pre-release, please 24 | indicate the specific version you are using. 25 | 26 | - It is **required** that you clearly describe the steps necessary to reproduce the issue you are running into. Although 27 | we would love to help our users as much as possible, diagnosing issues without clear reproduction steps is extremely 28 | time-consuming and simply not sustainable. 29 | 30 | - Use only the minimum amount of code necessary to reproduce the unexpected behavior. A good bug report should isolate 31 | specific methods that exhibit unexpected behavior and precisely define how expectations were violated. What did you 32 | expect the method or methods to do, and how did the observed behavior differ? The more precisely you isolate the 33 | issue, the faster we can investigate. 34 | 35 | - Issues with no clear repro steps will not be triaged. If an issue labeled "need repro" receives no further input from 36 | the issue author for more than 5 days, it will be closed. 37 | 38 | - If your issue is resolved but still open, don’t hesitate to close it. In case you found a solution by yourself, it 39 | could be helpful to explain how you fixed it. 40 | 41 | - Most importantly, we beg your patience: the team must balance your request against many other responsibilities — 42 | fixing other bugs, answering other questions, new features, new documentation, etc. The issue list is not paid 43 | support, and we cannot make guarantees about how fast your issue can be resolved. 44 | 45 | ## Development Guide 46 | 47 | **Jexpe is undergoing rapid development right now, and the docs match the latest published version. They 48 | are horribly out of date when compared with the code in the development branch (`dev`). This contributor guide is up-to-date, but it 49 | doesn't cover all of Jexpe's functions in depth. If you have any questions, don't hesitate to ask in 50 | our [Jexpe Discord](https://discord.com/invite/cfHmUnPDtM)** 51 | 52 | Is this repository we stick to the following branch structure: 53 | 54 | | Branch | Description | 55 | |-|-| 56 | | `dev` | The develop branch is where all the working branches are merged. It's not possible to push code directly here, not even for a maintainer. Everything in `dev` must come from a pull request after a code review. | 57 | | `` | Working branches are always created from `dev` and to `dev` shall return! Only working branches should be merged in to the develop branch after a code review. | 58 | | `release` | Release branches are handled by [code owners](https://github.com/jexpe-apps/jexpe/blob/dev/.github/CODEOWNERS). A release branch contains all the features planned for that release. | 59 | 60 | ## Pull Request Guidelines 61 | 62 | You must read the [Development Guide](#development-guide) section before proceeding with the pull request guidelines. 63 | 64 | In this project we stick to the following naming convention for the Pull Request title: 65 | 66 | ```yml 67 | (): 68 | │ │ │ 69 | │ │ └─⫸ Summary: Present tense. Not capitalized. No period at the end. 70 | │ │ 71 | │ └─⫸ Scope: tauri|nextjs| 72 | │ 73 | └─⫸ Type: build|ci|docs|feat|fix|perf|refactor 74 | ``` 75 | 76 | The `` and `` fields are mandatory, the `()` field is optional. 77 | 78 | ##### Type must be one of the following: 79 | >* **build**: Changes that affect the build system or external dependencies (example scopes: yarn) 80 | >* **ci**: Changes to our CI configuration files and scripts (examples: Github Actions) 81 | >* **docs**: Documentation only changes 82 | >* **feat**: A new feature 83 | >* **fix**: A bug fix 84 | >* **perf**: A code change that improves performance 85 | >* **refactor**: A code change that neither fixes a bug nor adds a feature 86 | 87 | 88 | ##### Scope should be one of the following: 89 | >The scope should be the name of the package affected. 90 | > 91 | >* **tauri**: Backend **only** changes 92 | >* **nextjs**: Frontend **only** changes 93 | >* **\**: Reference of the fixed issue 94 | 95 | ##### Summary 96 | >Use the summary field to provide a succinct description of the change: 97 | > 98 | >* use the imperative, present tense: "change" not "changed" nor "changes" 99 | >* don't capitalize the first letter 100 | >* no dot (.) at the end 101 | 102 | **You must follow this convention also for the working branch name: `/`, _e.g. `build/migrate_yarn`.** 103 | 104 | ##### Some clarifications 105 | >- It's OK to have multiple small commits as you work on the PR - We will let GitHub automatically squash it before 106 | > merging. (That is why we are restrictive about the title of the PR) 107 | > 108 | >- If adding new feature: 109 | > 110 | > - Provide convincing reason to add this feature. Ideally you should open a suggestion issue first and have it 111 | > greenlighted before working on it. 112 | > 113 | >- If fixing a bug: 114 | > - If you are resolving a special issue, in the `` set the issue id in your PR title for a better release log, _e.g. `fix(#3899): ...`. 115 | > - Provide detailed description of the bug in the PR, or link to an issue that does. 116 | 117 | ## Financial Contribution 118 | 119 | Jexpe is an MIT-licensed open source project. Its ongoing development can be supported [here](https://github.com/jexpe-apps/jexpe/blob/dev/.github/FUNDING.yml) 120 | -------------------------------------------------------------------------------- /src-tauri/jexpe/src/shell/windows.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | use std::{env, fs}; 3 | use std::path::Path; 4 | use std::string::ToString; 5 | use winreg::enums::{HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE}; 6 | use winreg::RegKey; 7 | use crate::shell::SystemShell; 8 | use phf::{phf_map}; 9 | 10 | const WSL_ICON_MAPPINGS: phf::Map<&'static str, &'static str> = phf_map! { 11 | "Alpine" => "/assets/icons/alpine.svg", 12 | "Debian" => "/assets/icons/debian.svg", 13 | "kali-linux" => "/assets/icons/kali.svg", 14 | "SLES-12" => "/assets/icons/suse.svg", 15 | "openSUSE-Leap-15-1" => "/assets/icons/suse.svg", 16 | "Ubuntu-16.04" => "/assets/icons/ubuntu.svg", 17 | "Ubuntu-18.04" => "/assets/icons/ubuntu.svg", 18 | "Ubuntu-22.04" => "/assets/icons/ubuntu.svg", 19 | "Ubuntu" => "/assets/icons/ubuntu.svg", 20 | "AlmaLinux-8" => "/assets/icons/alma.svg", 21 | "OracleLinux_7_9" => "/assets/icons/oracle-linux.svg", 22 | "OracleLinux_8_5" => "/assets/icons/oracle-linux.svg", 23 | "openEuler" => "/assets/icons/open-euler.svg", 24 | "Linux" => "/assets/icons/linux.svg", 25 | "docker-desktop" => "/assets/icons/docker.svg", 26 | "docker-desktop-data" => "/assets/icons/docker.svg", 27 | }; 28 | 29 | pub fn get_available_shells() -> Vec { 30 | let mut shells = Vec::new(); 31 | 32 | shells = get_stock(shells); 33 | shells = get_gitbash(shells); 34 | shells = get_powershell_core(shells); 35 | shells = get_vscode(shells); 36 | shells = get_wsl(shells); 37 | 38 | shells 39 | } 40 | 41 | fn get_stock(mut shells: Vec) -> Vec { 42 | 43 | // TODO: Maybe bundle https://mridgers.github.io/clink/ (?) 44 | 45 | shells.push(SystemShell { 46 | id: "cmd".to_string(), 47 | name: "CMD (Stock)".to_string(), 48 | command: "cmd.exe".to_string(), 49 | args: Vec::new(), 50 | env: HashMap::new(), 51 | cwd: None, 52 | icon: "/assets/icons/cmd.svg".to_string(), 53 | }); 54 | 55 | shells.push(SystemShell { 56 | id: "powershell".to_string(), 57 | name: "PowerShell".to_string(), 58 | command: "powershell.exe".to_string(), 59 | args: Vec::from(["-NoLogo".to_string()]), 60 | env: HashMap::from([ 61 | ("TERM".to_string(), "cygwin".to_string()) 62 | ]), 63 | cwd: None, 64 | icon: "/assets/icons/powershell.svg".to_string(), 65 | }); 66 | 67 | shells 68 | } 69 | 70 | fn get_gitbash(mut shells: Vec) -> Vec { 71 | let mut gitbash_path: Option = None; 72 | 73 | if let Ok(regkey) = RegKey::predef(HKEY_LOCAL_MACHINE).open_subkey("Software\\GitForWindows") { 74 | if let Ok(path) = regkey.get_value("InstallPath") { 75 | gitbash_path = Some(path); 76 | } 77 | } 78 | 79 | if let Ok(regkey) = RegKey::predef(HKEY_CURRENT_USER).open_subkey("Software\\GitForWindows") { 80 | if let Ok(path) = regkey.get_value("InstallPath") { 81 | gitbash_path = Some(path); 82 | } 83 | } 84 | 85 | if let Some(path) = gitbash_path { 86 | shells.push(SystemShell { 87 | id: "git-bash".to_string(), 88 | name: "Git Bash".to_string(), 89 | command: format!("{}\\bin\\bash.exe", path), 90 | args: Vec::from(["--login".to_string(), "-i".to_string()]), 91 | env: HashMap::from([ 92 | ("TERM".to_string(), "cygwin".to_string()) 93 | ]), 94 | cwd: None, 95 | icon: "/assets/icons/git-bash.svg".to_string(), 96 | }); 97 | }; 98 | 99 | shells 100 | } 101 | 102 | fn get_powershell_core(mut shells: Vec) -> Vec { 103 | if let Ok(regkey) = RegKey::predef(HKEY_LOCAL_MACHINE) 104 | .open_subkey("Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\pwsh.exe") { 105 | if let Ok(path) = regkey.get_value("") { 106 | shells.push(SystemShell { 107 | id: "powershell-core".to_string(), 108 | name: "PowerShell Core".to_string(), 109 | command: path, 110 | args: Vec::from(["-NoLogo".to_string()]), 111 | env: HashMap::from([ 112 | ("TERM".to_string(), "cygwin".to_string()) 113 | ]), 114 | cwd: None, 115 | icon: "/assets/icons/powershell-core.svg".to_string(), 116 | }); 117 | } 118 | } 119 | 120 | shells 121 | } 122 | 123 | fn get_vscode(mut shells: Vec) -> Vec { 124 | if let Ok(program_files) = env::var("ProgramFiles") { 125 | let path = Path::new(&program_files).join("Microsoft Visual Studio").display().to_string(); 126 | if let Ok(dirs) = fs::read_dir(path) { 127 | for dir in dirs 128 | .filter_map(|x| x.ok()) 129 | .map(|x| x.path()) { 130 | let version = dir.file_name().unwrap().to_str().unwrap(); 131 | let bat = dir.join("Community\\Common7\\Tools\\VsDevCmd.bat").display().to_string(); 132 | 133 | shells.push(SystemShell { 134 | id: format!("vs-cmd-{}", version), 135 | name: format!("Developer Prompt for VS {}", version), 136 | command: "cmd.exe".to_string(), 137 | args: Vec::from(["/k".to_string(), bat]), 138 | env: HashMap::new(), 139 | cwd: None, 140 | icon: format!("/assets/icons/vs{}.svg", version), 141 | }) 142 | } 143 | } 144 | } 145 | 146 | shells 147 | } 148 | 149 | fn get_wsl(mut shells: Vec) -> Vec { 150 | let lxss_path = "Software\\Microsoft\\Windows\\CurrentVersion\\Lxss"; 151 | 152 | for key in RegKey::predef(HKEY_CURRENT_USER) 153 | .open_subkey(lxss_path).unwrap() 154 | .enum_keys() 155 | .map(|x| x.unwrap()) 156 | { 157 | let distribution_name: String = RegKey::predef(HKEY_CURRENT_USER) 158 | .open_subkey(format!("{}\\{}", lxss_path, key)).unwrap() 159 | .get_value("DistributionName").unwrap(); 160 | 161 | shells.push(SystemShell { 162 | id: format!("wsl-{}", distribution_name.clone()), 163 | name: format!("WSL / {}", distribution_name.clone()), 164 | command: "wsl.exe".to_string(), 165 | args: Vec::from(["-d".to_string(), distribution_name.clone()]), 166 | env: HashMap::from([ 167 | ("TERM".to_string(), "xterm-256color".to_string()), 168 | ("COLORTERM".to_string(), "truecolor".to_string()), 169 | ]), 170 | cwd: None, 171 | icon: WSL_ICON_MAPPINGS.get(distribution_name.clone().as_ref()).cloned() 172 | .unwrap_or("/assets/icons/linux.svg").to_string(), 173 | }) 174 | } 175 | 176 | shells 177 | } -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | important: true, 4 | content: ['./src/**/*.{js,ts,jsx,tsx}'], 5 | theme: { 6 | extend: { 7 | colors: { 8 | brand: { 9 | 50: '#e7f8f2', 10 | 100: '#cff1e6', 11 | 200: '#b7ead9', 12 | 300: '#88dcc0', 13 | 400: '#58cea7', 14 | 500: '#40c79a', 15 | 600: '#28c08e', 16 | 700: '#10B981', 17 | 800: '#0ea774', 18 | 900: '#0d9467', 19 | }, 20 | dark: { 21 | 50: '#C1C2C5', 22 | 100: '#A6A7AB', 23 | 200: '#909296', 24 | 300: '#5c5f66', 25 | 400: '#373A40', 26 | 500: '#2C2E33', 27 | 600: '#25262b', 28 | 700: '#1A1B1E', 29 | 800: '#141517', 30 | 900: '#101113', 31 | }, 32 | gray: { 33 | 50: '#f8f9fa', 34 | 100: '#f1f3f5', 35 | 200: '#e9ecef', 36 | 300: '#dee2e6', 37 | 400: '#ced4da', 38 | 500: '#adb5bd', 39 | 600: '#868e96', 40 | 700: '#495057', 41 | 800: '#343a40', 42 | 900: '#212529', 43 | }, 44 | red: { 45 | 50: '#fff5f5', 46 | 100: '#ffe3e3', 47 | 200: '#ffc9c9', 48 | 300: '#ffa8a8', 49 | 400: '#ff8787', 50 | 500: '#ff6b6b', 51 | 600: '#fa5252', 52 | 700: '#f03e3e', 53 | 800: '#e03131', 54 | 900: '#c92a2a', 55 | }, 56 | pink: { 57 | 50: '#fff0f6', 58 | 100: '#ffdeeb', 59 | 200: '#fcc2d7', 60 | 300: '#faa2c1', 61 | 400: '#f783ac', 62 | 500: '#f06595', 63 | 600: '#e64980', 64 | 700: '#d6336c', 65 | 800: '#c2255c', 66 | 900: '#a61e4d', 67 | }, 68 | grape: { 69 | 50: '#f8f0fc', 70 | 100: '#f3d9fa', 71 | 200: '#eebefa', 72 | 300: '#e599f7', 73 | 400: '#da77f2', 74 | 500: '#cc5de8', 75 | 600: '#be4bdb', 76 | 700: '#ae3ec9', 77 | 800: '#9c36b5', 78 | 900: '#862e9c', 79 | }, 80 | violet: { 81 | 50: '#f3f0ff', 82 | 100: '#e5dbff', 83 | 200: '#d0bfff', 84 | 300: '#b197fc', 85 | 400: '#9775fa', 86 | 500: '#845ef7', 87 | 600: '#7950f2', 88 | 700: '#7048e8', 89 | 800: '#6741d9', 90 | 900: '#5f3dc4', 91 | }, 92 | indigo: { 93 | 50: '#edf2ff', 94 | 100: '#dbe4ff', 95 | 200: '#bac8ff', 96 | 300: '#91a7ff', 97 | 400: '#748ffc', 98 | 500: '#5c7cfa', 99 | 600: '#4c6ef5', 100 | 700: '#4263eb', 101 | 800: '#3b5bdb', 102 | 900: '#364fc7', 103 | }, 104 | blue: { 105 | 50: '#e7f5ff', 106 | 100: '#d0ebff', 107 | 200: '#a5d8ff', 108 | 300: '#74c0fc', 109 | 400: '#4dabf7', 110 | 500: '#339af0', 111 | 600: '#228be6', 112 | 700: '#1c7ed6', 113 | 800: '#1971c2', 114 | 900: '#1864ab', 115 | }, 116 | cyan: { 117 | 50: '#e3fafc', 118 | 100: '#c5f6fa', 119 | 200: '#99e9f2', 120 | 300: '#66d9e8', 121 | 400: '#3bc9db', 122 | 500: '#22b8cf', 123 | 600: '#15aabf', 124 | 700: '#1098ad', 125 | 800: '#0c8599', 126 | 900: '#0b7285', 127 | }, 128 | teal: { 129 | 50: '#e6fcf5', 130 | 100: '#c3fae8', 131 | 200: '#96f2d7', 132 | 300: '#63e6be', 133 | 400: '#38d9a9', 134 | 500: '#20c997', 135 | 600: '#12b886', 136 | 700: '#0ca678', 137 | 800: '#099268', 138 | 900: '#087f5b', 139 | }, 140 | green: { 141 | 50: '#ebfbee', 142 | 100: '#d3f9d8', 143 | 200: '#b2f2bb', 144 | 300: '#8ce99a', 145 | 400: '#69db7c', 146 | 500: '#51cf66', 147 | 600: '#40c057', 148 | 700: '#37b24d', 149 | 800: '#2f9e44', 150 | 900: '#2b8a3e', 151 | }, 152 | lime: { 153 | 50: '#f4fce3', 154 | 100: '#e9fac8', 155 | 200: '#d8f5a2', 156 | 300: '#c0eb75', 157 | 400: '#a9e34b', 158 | 500: '#94d82d', 159 | 600: '#82c91e', 160 | 700: '#74b816', 161 | 800: '#66a80f', 162 | 900: '#5c940d', 163 | }, 164 | yellow: { 165 | 50: '#fff9db', 166 | 100: '#fff3bf', 167 | 200: '#ffec99', 168 | 300: '#ffe066', 169 | 400: '#ffd43b', 170 | 500: '#fcc419', 171 | 600: '#fab005', 172 | 700: '#f59f00', 173 | 800: '#f08c00', 174 | 900: '#e67700', 175 | }, 176 | orange: { 177 | 50: '#fff4e6', 178 | 100: '#ffe8cc', 179 | 200: '#ffd8a8', 180 | 300: '#ffc078', 181 | 400: '#ffa94d', 182 | 500: '#ff922b', 183 | 600: '#fd7e14', 184 | 700: '#f76707', 185 | 800: '#e8590c', 186 | 900: '#d9480f', 187 | }, 188 | }, 189 | borderRadius: { 190 | DEFAULT: '0.5rem', 191 | }, 192 | boxShadow: { 193 | DEFAULT: 194 | '0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)', 195 | }, 196 | }, 197 | }, 198 | plugins: [], 199 | } 200 | -------------------------------------------------------------------------------- /src-tauri/jexpe/src/pty/commands.rs: -------------------------------------------------------------------------------- 1 | use cuid::cuid; 2 | use portable_pty::{CommandBuilder, native_pty_system, PtySize}; 3 | use tauri::{AppHandle, Manager, State}; 4 | use tokio::sync::mpsc::channel; 5 | use tokio::task::spawn_blocking; 6 | use tokio::time::sleep; 7 | use crate::JexpeState; 8 | use crate::pty::constants::{PTY_EXIT_EVENT, PTY_SPAWN_EVENT, PTY_STDOUT_EVENT}; 9 | use crate::shell::SystemShell; 10 | use super::{PtyProcess, PtyExitPayload, PtyStdoutPayload, PtySpawnPayload}; 11 | use super::constants::{MAX_PIPE_CHUNK_SIZE, READ_PAUSE_DURATION}; 12 | 13 | #[tauri::command] 14 | pub async fn spawn_pty( 15 | app_handle: AppHandle, 16 | state: State<'_, JexpeState>, 17 | shell: SystemShell, 18 | ) -> Result<(), String> { 19 | let id = cuid() 20 | .map_err(|_| "Failed to generate cuid.".to_string())?; 21 | 22 | // Establish our new pty for the given size 23 | let pty_system = native_pty_system(); 24 | let pty_pair = pty_system.openpty(PtySize::default()) 25 | .map_err(|x| x.to_string())?; 26 | 27 | let pty_master = pty_pair.master; 28 | let pty_slave = pty_pair.slave; 29 | 30 | // Spawn our process within the pty 31 | let mut cmd = CommandBuilder::new(shell.command.clone()); 32 | cmd.args(shell.args.clone()); 33 | 34 | if let Some(dir) = shell.cwd.clone() { 35 | cmd.cwd(dir); 36 | } 37 | 38 | for (key, value) in shell.env.clone() { 39 | cmd.env(key, value) 40 | } 41 | 42 | let mut child = pty_slave 43 | .spawn_command(cmd) 44 | .map_err(|x| x.to_string())?; 45 | 46 | // NOTE: Need to drop slave to close out file handles and avoid deadlock when waiting on the child 47 | drop(pty_slave); 48 | 49 | // Spawn a thread to wait input from frontend and write to the pty 50 | let (stdin_tx, mut stdin_rx) = channel::>(1); 51 | let mut stdin_writer = pty_master 52 | .take_writer() 53 | .map_err(|x| x.to_string())?; 54 | 55 | let stdin_task = spawn_blocking(move || { 56 | while let Some(input) = stdin_rx.blocking_recv() { 57 | if stdin_writer.write_all(&input).is_err() { 58 | break; 59 | } 60 | } 61 | }); 62 | 63 | // Spawn a thread to read from the pty and send the output to the frontend 64 | let mut stdout_reader = pty_master 65 | .try_clone_reader() 66 | .map_err(|x| x.to_string())?; 67 | 68 | let app_handle_clone = app_handle.clone(); 69 | let id_clone = id.clone(); 70 | let stdout_task = spawn_blocking(move || { 71 | let mut buf: [u8; MAX_PIPE_CHUNK_SIZE] = [0; MAX_PIPE_CHUNK_SIZE]; 72 | loop { 73 | match stdout_reader.read(&mut buf) { 74 | Ok(n) if n > 0 => { 75 | app_handle_clone 76 | .emit_all(PTY_STDOUT_EVENT, PtyStdoutPayload { 77 | id: id_clone.clone(), 78 | bytes: buf[..n].to_vec(), 79 | }) 80 | .unwrap(); 81 | } 82 | _ => { break; } 83 | } 84 | } 85 | }); 86 | 87 | // Wait for the child to exit and send the exit code to the frontend 88 | let (kill_tx, mut kill_rx) = channel::<()>(1); 89 | 90 | // Update the state with the new pty process 91 | { 92 | let mut ptys = state.ptys.lock().await; 93 | ptys.insert(id.clone(), PtyProcess { 94 | id: id.clone(), 95 | pty_master, 96 | stdin_tx, 97 | kill_tx, 98 | stdin_task, 99 | stdout_task, 100 | }); 101 | 102 | app_handle 103 | .emit_all(PTY_SPAWN_EVENT, PtySpawnPayload { 104 | id: id.clone(), 105 | shell: shell.clone(), 106 | }) 107 | .unwrap(); 108 | 109 | println!("[TAURI]: Successfully spawned pty ({}).", id.clone()); 110 | } 111 | 112 | loop { 113 | match (child.try_wait(), kill_rx.try_recv()) { 114 | (Ok(Some(status)), _) => { 115 | app_handle 116 | .emit_all(PTY_EXIT_EVENT, PtyExitPayload { 117 | id: id.clone(), 118 | success: status.success(), 119 | code: Some(status.exit_code()), 120 | }).unwrap(); 121 | break; 122 | } 123 | 124 | (_, Ok(_)) => { 125 | app_handle 126 | .emit_all(PTY_EXIT_EVENT, PtyExitPayload { 127 | id: id.clone(), 128 | success: true, 129 | code: None, 130 | }).unwrap(); 131 | break; 132 | } 133 | 134 | (Err(_), _) => { 135 | app_handle 136 | .emit_all(PTY_EXIT_EVENT, PtyExitPayload { 137 | id: id.clone(), 138 | success: false, 139 | code: None, 140 | }).unwrap(); 141 | break; 142 | } 143 | 144 | _ => { 145 | sleep(READ_PAUSE_DURATION).await; 146 | continue; 147 | } 148 | } 149 | } 150 | 151 | let mut ptys = state.ptys.lock().await; 152 | if let Some(pty) = ptys.remove(&id) { 153 | 154 | // Need to drop the stdin_tx to avoid deadlock when waiting on stdin_task 155 | drop(pty.stdin_tx); 156 | 157 | // Need to drop the kill_tx to drop also the kill_rx 158 | drop(pty.kill_tx); 159 | 160 | // Need to drop the pty_master to close out file handles and avoid deadlock when waiting on stdout_task 161 | drop(pty.pty_master); 162 | 163 | pty.stdin_task.await.unwrap(); 164 | pty.stdout_task.await.unwrap(); 165 | 166 | println!("[TAURI]: Successfully dropped pty ({}).", id.clone()); 167 | } 168 | 169 | Ok(()) 170 | } 171 | 172 | #[tauri::command] 173 | pub async fn write_pty( 174 | state: State<'_, JexpeState>, 175 | id: String, 176 | data: String, 177 | ) -> Result<(), String> { 178 | let mut ptys = state.ptys.lock().await; 179 | 180 | let pty = ptys.get_mut(&id) 181 | .ok_or("[WRITE_PTY] The specified ID is not associated with any pty.")?; 182 | 183 | pty.stdin_tx.send(data.into_bytes()) 184 | .await 185 | .map_err(|x| x.to_string())?; 186 | 187 | Ok(()) 188 | } 189 | 190 | #[tauri::command] 191 | pub async fn resize_pty( 192 | state: State<'_, JexpeState>, 193 | id: String, 194 | size: PtySize, 195 | ) -> Result<(), String> { 196 | let ptys = state.ptys.lock().await; 197 | 198 | let pty = ptys.get(&id) 199 | .ok_or("[RESIZE_PTY] The specified ID is not associated with any pty.")?; 200 | 201 | pty.pty_master.resize(size) 202 | .map_err(|x| x.to_string())?; 203 | 204 | Ok(()) 205 | } 206 | 207 | #[tauri::command] 208 | pub async fn kill_pty( 209 | state: State<'_, JexpeState>, 210 | id: String, 211 | ) -> Result<(), String> { 212 | let mut ptys = state.ptys.lock().await; 213 | 214 | let pty = ptys.get_mut(&id) 215 | .ok_or("[KILL_PTY] The specified ID is not associated with any pty.")?; 216 | 217 | pty.kill_tx.send(()) 218 | .await 219 | .map_err(|x| x.to_string())?; 220 | 221 | Ok(()) 222 | } -------------------------------------------------------------------------------- /public/assets/lock.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 1Password 26 | 27 | 28 | 29 | 49 | 50 | 1Password 52 | Created with Sketch. 54 | 56 | 59 | 64 | 69 | 74 | 79 | 84 | 89 | 94 | 99 | 104 | 109 | 114 | 119 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2022 - Present Jexpe Contributors 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /public/assets/empty_vault.svg: -------------------------------------------------------------------------------- 1 | --------------------------------------------------------------------------------