Skip to content

Commit

Permalink
Merge branch 'master' into feat/extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
kimlimjustin committed Dec 22, 2021
2 parents e9a8a22 + cd993a2 commit b9fe970
Show file tree
Hide file tree
Showing 39 changed files with 3,360 additions and 57 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ko_fi: kimlimjustin
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
contact_links:
- name: Common Issues
url: https://xplorer.vercel.app/docs/common_problems
url: https://xplorer.space/docs/common_problems
about: Please see if your issue is a common issue
- name: Feature Request
url: https://github.com/kimlimjustin/xplorer/discussions
Expand Down
19 changes: 6 additions & 13 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
# The image is needed so that every Gitpod Workspace comes with gitpod/workspace-full-vnc whenever they start it.
image:
file: Dockerfile

# Now, there are specific tasks for dependencies, servers, noVNC, ports and even pre-builds so that you start without delay.
tasks:
- name: Yarn install
init: yarn install
command: sleep 1 && gp sync-done yarn-install
- name: Yarn App Server
init: echo "Starting app server"
command: yarn && yarn dev
- name: Yarn Docs Server
init: echo "Starting docs server"
command: cd docs && yarn && yarn start
command: |
gp sync-await yarn-install &&
yarn dev
vscode:
extensions:
Expand All @@ -32,17 +32,10 @@ ports:
# GitHub Prebuilds
github:
prebuilds:
# enable for the master/default branch (defaults to true)
master: true
# enable for all branches in this repo (defaults to false)
branches: true
# enable for pull requests coming from this repo (defaults to true)
pullRequests: true
# enable for pull requests coming from forks (defaults to false)
pullRequestsFromForks: true
# add a "Review in Gitpod" button as a comment to pull requests (defaults to true)
addComment: false
# add a "Review in Gitpod" button to pull requests (defaults to false)
addBadge: true
# add a label once the prebuild is ready to pull requests (defaults to false)
addLabel: prebuilt-in-gitpod
2 changes: 1 addition & 1 deletion CONTRIBUTING_GUIDELINE.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Please see https://xplorer.vercel.app/docs/Community/Contributing/
Please see https://xplorer.space/docs/Community/Contributing/
5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# I am adding the VNC edition since if anyone wanted to develop the app rather than the docs, they definetely can do it with noVNC which is used here.
# I am using the latest version since that can help us stay updated with Gitpod+noVNC

FROM gitpod/workspace-full-vnc:latest

# I got this from the GAUDC Project(not implemented yet, as told in #69, but the code is available on the fork.)
# Install custom tools, runtime, etc.
RUN sudo apt-get update \
# window manager
&& sudo apt-get install -y jwm \
Expand Down
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
</div>

<p align="center"><span><b>Xplorer</b>, a customizable, modern and cross-platform File Explorer.</span></p>
<h4 align="center"><span><a href="https://xplorer.vercel.app/community/support/">Supports</a></span> • <span><a href="https://github.com/kimlimjustin/xplorer/discussions">Discussions</a></span> • <span><a href="https://xplorer.vercel.app">Documentation</a></span> • <span><a href="https://discord.gg/MHGtSWvfUS">Discord</a></span></h4>
<h4 align="center"><span><a href="https://xplorer.space/docs/Community/support/">Supports</a></span> • <span><a href="https://github.com/kimlimjustin/xplorer/discussions">Discussions</a></span> • <span><a href="https://xplorer.space">Documentation</a></span> • <span><a href="https://discord.gg/MHGtSWvfUS">Discord</a></span></h4>

<div align="center">

[![LICENSE](https://img.shields.io/github/license/kimlimjustin/xplorer.svg?style=for-the-badge)](https://github.com/kimlimjustin/xplorer/blob/master/LICENSE) [![Download Counts](https://img.shields.io/github/downloads/kimlimjustin/xplorer/total.svg?style=for-the-badge)](https://github.com/kimlimjustin/xplorer/releases) [![Stars Count](https://img.shields.io/github/stars/kimlimjustin/xplorer.svg?style=for-the-badge)](https://github.com/kimlimjustin/xplorer/stargazers) [![Forks Count](https://img.shields.io/github/forks/kimlimjustin/xplorer.svg?style=for-the-badge)](https://github.com/kimlimjustin/xplorer/network/members) [![Watchers Count](https://img.shields.io/github/watchers/kimlimjustin/xplorer.svg?style=for-the-badge)](https://github.com/kimlimjustin/xplorer/watchers) [![Issues Count](https://img.shields.io/github/issues/kimlimjustin/xplorer.svg?style=for-the-badge)](https://github.com/kimlimjustin/xplorer/issues) [![Pull Request Count](https://img.shields.io/github/issues-pr/kimlimjustin/xplorer.svg?style=for-the-badge)](https://github.com/kimlimjustin/xplorer/pulls) [![Follow](https://img.shields.io/github/followers/kimlimjustin.svg?style=for-the-badge&label=Follow&maxAge=2592000)](https://github.com/kimlimjustin) [![Discord Server](https://img.shields.io/discord/893135322093871104?style=for-the-badge)](https://discord.gg/eM2hsDMtjq)
[![LICENSE](https://img.shields.io/github/license/kimlimjustin/xplorer.svg?style=for-the-badge)](https://github.com/kimlimjustin/xplorer/blob/master/LICENSE) [![Download Counts](https://img.shields.io/github/downloads/kimlimjustin/xplorer/total.svg?style=for-the-badge)](https://github.com/kimlimjustin/xplorer/releases) [![Stars Count](https://img.shields.io/github/stars/kimlimjustin/xplorer.svg?style=for-the-badge)](https://github.com/kimlimjustin/xplorer/stargazers) [![Forks Count](https://img.shields.io/github/forks/kimlimjustin/xplorer.svg?style=for-the-badge)](https://github.com/kimlimjustin/xplorer/network/members) [![Watchers Count](https://img.shields.io/github/watchers/kimlimjustin/xplorer.svg?style=for-the-badge)](https://github.com/kimlimjustin/xplorer/watchers) [![Issues Count](https://img.shields.io/github/issues/kimlimjustin/xplorer.svg?style=for-the-badge)](https://github.com/kimlimjustin/xplorer/issues) [![Pull Request Count](https://img.shields.io/github/issues-pr/kimlimjustin/xplorer.svg?style=for-the-badge)](https://github.com/kimlimjustin/xplorer/pulls) [![Follow](https://img.shields.io/github/followers/kimlimjustin.svg?style=for-the-badge&label=Follow&maxAge=2592000)](https://github.com/kimlimjustin) [![Discord Server](https://img.shields.io/discord/893135322093871104?style=for-the-badge)](https://discord.gg/eM2hsDMtjq) [![Ko-Fi](https://img.shields.io/badge/Ko--fi-F16061?style=for-the-badge&logo=ko-fi&logoColor=white)](https://ko-fi.com/kimlimjustin)

[![Windows Support](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white)](https://github.com/kimlimjustin/xplorer/releases) [![Ubuntu Support](https://img.shields.io/badge/Ubuntu-E95420?style=for-the-badge&logo=ubuntu&logoColor=white)](https://github.com/kimlimjustin/xplorer/releases) [![Arch Linux Support](https://img.shields.io/badge/Arch_Linux-1793D1?style=for-the-badge&logo=arch-linux&logoColor=white)](https://github.com/kimlimjustin/xplorer/releases) [![Windows Support](https://img.shields.io/badge/MACOS-adb8c5?style=for-the-badge&logo=macos&logoColor=white)](https://github.com/kimlimjustin/xplorer/releases)

Expand Down Expand Up @@ -42,12 +42,12 @@ To summarize, Xplorer's features contain:
- It looks modern
- Easy to use
- Cross-platform
- [File Preview](https://xplorer.vercel.app/docs/guides/operation/#preview-file), even for videos!
- [File Preview](https://xplorer.space/docs/guides/operation/#preview-file), even for videos!
- Customizable
- Supports multiple tabs
- Most importantly, Free and Open Source Software(FOSS), which means you can change components inside if you see fit

Xplorer is currently under heavy development. You can give your suggestions and feedback on our [Discussions](https://github.com/kimlimjustin/xplorer/discussions/) page. If you feel comfortable in writing code using Typescript and Rust, we highly encourage you to [contribute to this project](https://xplorer.vercel.app/community/Contributing/).
Xplorer is currently under heavy development. You can give your suggestions and feedback on our [Discussions](https://github.com/kimlimjustin/xplorer/discussions/) page. If you feel comfortable in writing code using Typescript and Rust, we highly encourage you to [contribute to this project](https://xplorer.space/community/Contributing/).

---

Expand All @@ -63,20 +63,20 @@ If you find any bugs, please report it by submitting an issue on our [issue page

## Feature Request

You can also submit a feature request on our [issue page](https://github.com/kimlimjustin/xplorer) or [discussions](https://github.com/kimlimjustin/xplorer/discussions) and we will try to implement it as soon as possible. If you want to contribute to this project, please [contribute to this project](https://xplorer.vercel.app/community/Contributing/).
You can also submit a feature request on our [issue page](https://github.com/kimlimjustin/xplorer) or [discussions](https://github.com/kimlimjustin/xplorer/discussions) and we will try to implement it as soon as possible. If you want to contribute to this project, please [contribute to this project](https://xplorer.space/community/Contributing/).

---

## Common Problems

**NB: For common installation problems, please visit this page [here](https://xplorer.vercel.app/docs/install/#common-problems)**
**NB: For common installation problems, please visit this page [here](https://xplorer.space/docs/install/#common-problems)**

<details>
<summary>
Opening folders like <code>Documents</code>, <code>Desktop</code>, <code>Downloads</code> makes Xplorer crash
</summary>

Try disabling the [`Extract exe file icon and make it as preview`](https://xplorer.vercel.app/docs/guides/setting/#extract-exe-file-icon-and-make-it-a-preview) option on `Preference` page on Settings.
Try disabling the [`Extract exe file icon and make it as preview`](https://xplorer.space/docs/guides/setting/#extract-exe-file-icon-and-make-it-a-preview) option on `Preference` page on Settings.

Also, please make sure that Windows Defender isn't blocking Xplorer from accessing your documents.

Expand Down Expand Up @@ -133,18 +133,22 @@ $ yarn dev

### Gitpod for Xplorer's development

The easiest way to run Xplorer in Gitpod is to use the [Gitpod](https://gitpod.io/) service, all what you need to do is to click the button below and log in with your GitHub account. Afterwards, you will see a VS Code-like environment where you can start developing and pushing your changes.

Please note that after starting GitPod, there're be two terminals opened. The first one is for developing Xplorer itself and the second one is for Xplorer documentation, for some reasons, the initialed command might fail, if it does, please simply run the command again (Arrow Down + Enter). To open the remote application, you can navigate to the GitPod Remote Explorer on the left side and click the globe icon on 6080 port.
The easiest way to run Xplorer in Gitpod is to use the [Gitpod](https://gitpod.io/) service, all what you need to do is to click the button below and log in with your GitHub account. Afterwards, you will see a VS Code-like environment where you can start developing and pushing your changes. Please note that you may have to wait up to minutes to get Xplorer running on the poped up VNC tab.

## [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#/https://github.com/kimlimjustin/xplorer)

## Contribution Guide

We highly encourage you to contribute to this project (even if you are a beginner). And if you finally want to contribute to this project, please read [our contribution guide](https://xplorer.vercel.app/community/Contributing).
We highly encourage you to contribute to this project (even if you are a beginner). And if you finally want to contribute to this project, please read [our contribution guide](https://xplorer.space/community/Contributing).

---

## LICENSE

[Apache-2.0](https://github.com/kimlimjustin/xplorer/blob/master/LICENSE)

---

## Love my work?

<a href='https://ko-fi.com/kimlimjustin' target='_blank'><img height='35' style='border:0px;height:34px;' src='https://az743702.vo.msecnd.net/cdn/kofi3.png?v=0' border='0' alt='Buy Me a Coffee at ko-fi.com' />
5 changes: 5 additions & 0 deletions api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Home for Xplorer API.

# /api/updater

An API to check if there is an update available and to download it.
3 changes: 3 additions & 0 deletions api/updater/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
39 changes: 39 additions & 0 deletions api/updater/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# typescript
*.tsbuildinfo

.vercel
4 changes: 4 additions & 0 deletions api/updater/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## This is Xplorer's automatic updater API.

Nothing much here, just an [API](https://updater.xplorer.space) to check if there is an update available and to download it.
Go back to the [Xplorer website](https://xplorer.space) for Xplorer's docs.
5 changes: 5 additions & 0 deletions api/updater/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
4 changes: 4 additions & 0 deletions api/updater/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
reactStrictMode: true,
}
24 changes: 24 additions & 0 deletions api/updater/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "updater",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"next": "12.0.7",
"react": "17.0.2",
"react-dom": "17.0.2",
"semver": "^7.3.5"
},
"devDependencies": {
"@types/node": "17.0.2",
"@types/react": "17.0.37",
"@types/semver": "^7.3.9",
"eslint": "8.5.0",
"eslint-config-next": "12.0.7",
"typescript": "4.5.4"
}
}
8 changes: 8 additions & 0 deletions api/updater/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import '../styles/globals.css'
import type { AppProps } from 'next/app'

function MyApp({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
}

export default MyApp
96 changes: 96 additions & 0 deletions api/updater/pages/api/[...slug].ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import { AVAILABLE_PLATFORMS, validatePlatform } from '../../util/platform';
import semver from 'semver';
import { GITHUB_TOKEN } from '../../util/constant';

export default async function handler(req: any, res: any) {
const { slug } = req.query;
const platform = slug[0];
const version = slug[1];

if (!platform || !validatePlatform(platform)) {
res.status(400).send('Invalid platform');
return;
}

if (!version || !semver.valid(version)) {
res.status(400).send('Invalid version');
return;
}
const reqUrl = new URL(`https://api.github.com/repos/kimlimjustin/xplorer/releases`);
// Headers
const headers: HeadersInit = { Accept: 'application/vnd.github.preview' };
if (GITHUB_TOKEN && GITHUB_TOKEN.length > 0) {
headers.Authorization = `token ${GITHUB_TOKEN}`;
}
const release = await (await fetch(reqUrl.toString(), { method: 'GET', headers })).json();

// Get the latest release but only the ones that is not draft
let index = 0;
let latest_release = release[index];
while (latest_release.draft) {
index++;
latest_release = release[index];
}
const latest_version = sanitizeVersion(latest_release.tag_name);
const should_update = semver.gt(latest_version, version);
if (!should_update) {
res.status(204).send('');
return;
}
for (const asset of latest_release.assets) {
const { name, browser_download_url } = asset;
const findPlatform = checkPlatform(platform, name);
if (!findPlatform) continue;

res.status(200).json({
name: latest_release.tag_name,
notes: `Please visit ${latest_release.html_url} to see the detailed changelog.`,
pub_date: latest_release.published_at,
signature: '',
url: browser_download_url,
});
return;
}
res.status(204).send('');
}

function sanitizeVersion(version: string): string {
// if it start with v1.0.0 remove the `v`
if (version.charAt(0) === 'v') {
return version.substring(1);
}

return version;
}

function extname(filename: string) {
return filename.split('.').pop() || '';
}

function checkPlatform(platform: string, fileName: string) {
const extension = extname(fileName);

// OSX we should have our .app tar.gz
if (
(fileName.includes('.app') || fileName.includes('darwin') || fileName.includes('osx')) &&
extension === 'gz' &&
platform === AVAILABLE_PLATFORMS.MacOS
) {
return 'darwin';
}

// Windows 64 bits
if ((fileName.includes('x64') || fileName.includes('win64')) && extension === 'zip' && platform === AVAILABLE_PLATFORMS.Win64) {
return 'win64';
}

// Windows 32 bits
if ((fileName.includes('x32') || fileName.includes('win32')) && extension === 'zip' && platform === AVAILABLE_PLATFORMS.Win32) {
return 'win32';
}

// Linux app image
if (fileName.includes('AppImage') && extension === 'gz' && platform === AVAILABLE_PLATFORMS.Linux) {
return 'linux';
}
}
30 changes: 30 additions & 0 deletions api/updater/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import type { NextPage } from 'next';
import Head from 'next/head';
import styles from '../styles/Home.module.css';

const Home: NextPage = () => {
return (
<div className={styles.container}>
<Head>
<title>Create Next App</title>
<meta name="description" content="Generated by create next app" />
<link rel="icon" href="/favicon.ico" />
</Head>

<main className={styles.main}>
<h1 className={styles.title}>Hello World.</h1>

<p className={styles.description}>Actually there{"'"}s nothing here, just an auto updater API for Xplorer. </p>

<div className={styles.grid}>
<a href="https://xplorer.space" className={styles.card}>
<h2>Xplorer Documentation &rarr;</h2>
<p>Go to Xplorer home page instead</p>
</a>
</div>
</main>
</div>
);
};

export default Home;
Binary file added api/updater/public/favicon.ico
Binary file not shown.
Loading

0 comments on commit b9fe970

Please sign in to comment.