Skip to content

Commit

Permalink
#37 format
Browse files Browse the repository at this point in the history
  • Loading branch information
diced committed Oct 5, 2020
1 parent 7d68dc7 commit 06777cc
Show file tree
Hide file tree
Showing 28 changed files with 1,038 additions and 601 deletions.
11 changes: 6 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
title: ""
labels: bug
assignees: dicedtomatoreal

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,9 +24,10 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. Arch]
- Browser [e.g. chrome, firefox, chrome mobile]
- Version [e.g. 2.0.0]

- OS: [e.g. Arch]
- Browser [e.g. chrome, firefox, chrome mobile]
- Version [e.g. 2.0.0]

**Additional context**
Add any other context about the problem here.
19 changes: 9 additions & 10 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,23 @@ name: Node.js CI

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist
scripts
public
views
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
26 changes: 13 additions & 13 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Expand Down
146 changes: 72 additions & 74 deletions OLDREADME.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,43 +155,43 @@ Every single configuration option will be listed here
| `upload.fileLength` | integer | how long the random id for a file should be |
| `upload.tempDir` | string | temporary directory, files are stored here and then deleted. |
| `upload.uploadDir` | string | upload directory (where all uploads are stored) |
| `upload.route` | string | Route for uploads, default is /u, ex.`/u/hd27ua.png` |
| `upload.route` | string | Route for uploads, default is /u, ex.`/u/hd27ua.png` |

#### User Settings

**Config Property:** `user`

| Config Property | Type | Description / Expected Values |
| ------------------- | ------- | ------------------------------------------------------------ |
| `user.tokenLength` | integer | How long the randomly generated user token should be |
| Config Property | Type | Description / Expected Values |
| ------------------ | ------- | ---------------------------------------------------- |
| `user.tokenLength` | integer | How long the randomly generated user token should be |

#### Site Settings

**Config Property:** `site`

| Config Property | Type | Description / Expected Values |
| --------------- | ------- | ------------------------------------------------------ |
| `site.protocol` | integer | protocol (http or https) |
| `site.serveHTTP` | string | Port to run the web server on with HTTP (can be used with nginx + CloudFlare as a reverse proxy and let CloudFlare take care of SSL) |
| `site.serveHTTPS` | string | Port to run the web server on with HTTPS (only will be used if `site.protocol` is `https`) (you will need SSL certificates! See [this](#site-ssl-settings)) |
| `site.logRoutes` | boolean | Wether or not to log routes when they are requested |
| Config Property | Type | Description / Expected Values |
| ----------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `site.protocol` | integer | protocol (http or https) |
| `site.serveHTTP` | string | Port to run the web server on with HTTP (can be used with nginx + CloudFlare as a reverse proxy and let CloudFlare take care of SSL) |
| `site.serveHTTPS` | string | Port to run the web server on with HTTPS (only will be used if `site.protocol` is `https`) (you will need SSL certificates! See [this](#site-ssl-settings)) |
| `site.logRoutes` | boolean | Wether or not to log routes when they are requested |

#### Site SSL Settings

**Config Property:** `site.ssl`

| Config Property | Type | Description / Expected Values |
| --------------- | ------ | ----------------------------------------------- |
| `site.ssl.key` | string | path to ssl private key. ex: `./ssl/server.key` |
| `site.ssl.cert` | string | path to ssl certificate. ex: `./ssl/cert.crt` |
| `site.ssl.key` | string | path to ssl private key. ex: `./ssl/server.key` |
| `site.ssl.cert` | string | path to ssl certificate. ex: `./ssl/cert.crt` |

#### Administrator User

**Config Property:** `administrator`

| Config Property | Type | Description / Expected Values |
| ----------------------------- | ------ | -------------------------------------------------------------------------------------------------------- |
| `administrator.password` | string | password of administrator user (NOT RECOMENDED to use administrator user, set this to a SECURE password) |
| Config Property | Type | Description / Expected Values |
| ------------------------ | ------ | -------------------------------------------------------------------------------------------------------- |
| `administrator.password` | string | password of administrator user (NOT RECOMENDED to use administrator user, set this to a SECURE password) |

#### Database Configuration

Expand Down Expand Up @@ -232,63 +232,60 @@ Particles.JS, can be enabled and it's config can be changed willingly.
| `meta.favicon` | string | has to be in /public/assets folder and should be formatted as `"/public/assets/<file name>"` |
| `meta.title` | string | title of your server shows up like `<title> - Login` or `<title> - Dashboard` |


### Example Config

```json
{
"upload": {
"fileLength": 6,
"tempDir": "./temp",
"uploadDir": "./uploads",
"route": "/u"
},
"shorten": {
"idLength": 4,
"route": "/s"
},
"user": {
"tokenLength": 32
},
"site": {
"protocol": "http",
"returnProtocol": "https",
"ssl": {
"key": "./ssl/server.key",
"cert": "./ssl/server.crt"
},
"serveHTTPS": 8000,
"serveHTTP": 443,
"logRoutes": true
"upload": {
"fileLength": 6,
"tempDir": "./temp",
"uploadDir": "./uploads",
"route": "/u"
},
"shorten": {
"idLength": 4,
"route": "/s"
},
"user": {
"tokenLength": 32
},
"site": {
"protocol": "http",
"returnProtocol": "https",
"ssl": {
"key": "./ssl/server.key",
"cert": "./ssl/server.crt"
},
"administrator": {
"password": "1234"
},
"orm": {
"type": "postgres",
"host": "localhost",
"port": 5432,
"username": "user",
"password": "1234",
"database": "typex",
"synchronize": true,
"logging": false,
"entities": [
"out/src/entities/**/*.js"
]
},
"sessionSecret": "1234",
"saltRounds": 10, // You might get an error if its over a certain number, so choose carefully.
"meta": {
"favicon": "/public/assets/typex_small_circle.png",
"title": "TypeX"
},
"discordWebhook": {
"enabled": true,
"url": "https://canary.discordapp.com/api/webhooks/id/token",
"username": "TypeX Logs",
"avatarURL": "https://domain/public/assets/typex_small_circle.png"
}
"serveHTTPS": 8000,
"serveHTTP": 443,
"logRoutes": true
},
"administrator": {
"password": "1234"
},
"orm": {
"type": "postgres",
"host": "localhost",
"port": 5432,
"username": "user",
"password": "1234",
"database": "typex",
"synchronize": true,
"logging": false,
"entities": ["out/src/entities/**/*.js"]
},
"sessionSecret": "1234",
"saltRounds": 10, // You might get an error if its over a certain number, so choose carefully.
"meta": {
"favicon": "/public/assets/typex_small_circle.png",
"title": "TypeX"
},
"discordWebhook": {
"enabled": true,
"url": "https://canary.discordapp.com/api/webhooks/id/token",
"username": "TypeX Logs",
"avatarURL": "https://domain/public/assets/typex_small_circle.png"
}
}
```

Expand All @@ -315,16 +312,17 @@ These are the options you must pass when uploading a url or image/file
### Uploader

| Property | Value |
|-----------|-------------------------------------|
| --------- | ----------------------------------- |
| URL | `https://<DOMAIN>/api/upload` |
| Header | `authorization: <TOKEN>` |
| Header | `content-type: multipart/form-data` |
| File name | `file` |

### URL Shortener
| Property | Value |
|-----------|-------------------------------------|
| URL | `https://<DOMAIN>/api/shorten` |
| Header | `authorization: <TOKEN>` |
| Header | `content-type: application/json` |
| Data | `{"url": "<URL>"}` |

| Property | Value |
| -------- | -------------------------------- |
| URL | `https://<DOMAIN>/api/shorten` |
| Header | `authorization: <TOKEN>` |
| Header | `content-type: application/json` |
| Data | `{"url": "<URL>"}` |
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Zipline

Zipline is a Typescript based image/file uploading service & URL shortening service! Simple, and elegant.

# Images

![](https://cdn.diced.wtf/u/F1vtRX.png)
![](https://cdn.diced.wtf/u/a5BTaP.png)
![](https://cdn.diced.wtf/u/bdntjm.png)
Expand All @@ -11,7 +13,9 @@ Zipline is a Typescript based image/file uploading service & URL shortening serv
![](https://cdn.diced.wtf/u/VTXMbo.png)

# Bugs?

Make sure to open an issue if you think you ran into an issue, or need help with anything.

# Where is all the old information here?

All configuration options have been moved to the wiki, as the README was getting too long and hard to manage.
8 changes: 7 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
},
"devDependencies": {
"mongodb": "^3.5.8",
"pg": "^8.0.3"
"pg": "^8.0.3",
"prettier": "2.1.2"
}
}
Loading

0 comments on commit 06777cc

Please sign in to comment.