https://github.com/night0721/nxc
Simple host for file uploader, paste bin and URL shortener, with dashboard, oauth and webhook support
https://github.com/night0721/nxc
file-uploader image-uploader pastebin rust sharex url-shortener
Last synced: about 2 months ago
JSON representation
Simple host for file uploader, paste bin and URL shortener, with dashboard, oauth and webhook support
- Host: GitHub
- URL: https://github.com/night0721/nxc
- Owner: night0721
- License: gpl-3.0
- Created: 2023-04-16T09:38:52.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2026-02-03T12:51:49.000Z (4 months ago)
- Last Synced: 2026-02-05T20:20:12.597Z (4 months ago)
- Topics: file-uploader, image-uploader, pastebin, rust, sharex, url-shortener
- Language: Rust
- Homepage: https://nxc.night0721.xyz
- Size: 188 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nxc
NightX Client File Uploader is a simple host for file uploader, paste bin and URL shortener, with oauth and dashboard.
# Usage
```sh
./start
```
You would need to fill .env.example then rename it to .env for the backend server to work, and `nginx.conf` is provided for reverse proxy.
## Routes
### Authentication
* **GET** `/auth/github/login` — Initiates GitHub OAuth2 flow.
* **GET** `/auth/github/callback` — Handles the redirection from GitHub and exchanges the code for a token.
* **GET** `/auth/me` — Returns the currently authenticated user's profile.
* **POST** `/auth/logout` — Invalidates the session and clears the cookie.
### URL Shortener
* **POST** `/` — Creates a new short link (by providing the `url` field).
* **GET** `/s/:slug` — Redirects the browser to the original long URL.
### Pastebin
* **POST** `/` — Submits a new paste (by providing the `content` field).
* **GET** `/i/:slug` — Displays the highlighted paste in the web viewer.
* **GET** `/i/raw/:slug` — Returns the raw text content of the paste.
### Files & Images
* **POST** `/` — Uploads a single file/image via Multipart (by providing the `file` field).
* **GET** `/i/:slug` — Displays the file/image/code in the web viewer.
* **GET** `/i/raw/:slug` — Serves the raw file with the original mime-type.
* **GET** `/i/bin/:slug` — Direct file/image download as attachment.
### Management
* **GET** `/api/urls` — Lists all short URLs owned by the current user.
* **GET** `/api/files` — Lists all uploaded files and pastes owned by the current user.
* **POST** `/api/:kind/delete` — Deletes a record by type (where `:kind` is `url` or `file`).
* **POST** `/api/webhooks` — Registers a Discord webhook for upload notifications.
# Building
You will need to run these with elevated privilages.
```sh
# For backend
cd backend
cargo install nxs
# For cli
cd cli
cargo install nxc
# For frontend
cd frontend
npm i
npm run build
```
# Contributions
Contributions are welcomed, feel free to open a pull request.
# License
This project is licensed under the GNU Public License v3.0. See [LICENSE](https://github.com/night0721/nxc/blob/master/LICENSE) for more information.