Coder Social home page Coder Social logo

diced / zipline Goto Github PK

View Code? Open in Web Editor NEW
1.3K 8.0 126.0 9.75 MB

A ShareX/file upload server that is easy to use, packed with features, and with an easy setup!

Home Page: https://zipline.diced.sh/

License: MIT License

TypeScript 99.42% JavaScript 0.08% Dockerfile 0.49% Shell 0.02%
zipline sharex file-upload gallery reactjs nextjs screenshot sharex-server discord file-sharing docker sharex-uploader file-server

zipline's Introduction

A ShareX/file upload server that is easy to use, packed with features, and with an easy setup!

Stars Version GitHub last commit (branch) Discord

Build Docker Image (trunk) Docker Image (release)

Features

  • Configurable
  • Fast
  • Built with Next.js & React
  • Token protected uploading
  • Image uploading
  • Image compression
  • Password Protected Uploads
  • URL shortening
  • Text uploading
  • URL Formats (uuid, dates, random alphanumeric, original name, zws, gfycat -> animals adjectives)
  • Discord embeds (OG metadata)
  • Gallery viewer, and multiple file format support
  • Code highlighting
  • Fully customizable Discord webhook notifications
  • OAuth2 registration (Discord and GitHub)
  • Two-Factor authentication with Google Authenticator, Authy, etc (totp services).
  • User invites
  • File Chunking (for large files)
  • File deletion once it reaches a certain amount of views
  • Automatic video thumbnail generation
  • Easy setup instructions on docs (One command install docker compose up -d)

Screenshots (click)

View full album at imgur

Login Page Dashboard Files Page

Usage

Install & run with Docker

This section requires Docker and docker compose.

git clone https://github.com/diced/zipline
cd zipline

docker compose up -d

After installing

After installing, please edit the docker-compose.yml file and find the line that says SECRET=changethis and replace changethis with a random string. Ways you could generate the string could be from a password managers generator, or you could just slam your keyboard and hope for the best.

Building & running from source

This section requires nodejs, yarn.

It is recommended to not use npm, as it can cause issues with the build process.

Before you run yarn build, you might want to configure Zipline, as when building from source Zipline will need to read some sort of configuration. The only two variables needed are CORE_SECRET and CORE_DATABASE_URL.

git clone https://github.com/diced/zipline
cd zipline

yarn install
yarn build
yarn start

NGINX Proxy

This section requires NGINX.

server {
  listen 80 default_server;
  client_max_body_size 100M;
  server_name <your domain (optional)>;
  location / {
    proxy_pass http://localhost:3000;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
  }
}

Website

The default port is 3000, once you have accessed it you can see a login screen. The default credentials are "administrator" and "password". Once you login please immediately change the details to something more secure. You can do this by clicking on the top right corner where it says "administrator" with a gear icon and clicking Manage Account.

ShareX (Windows)

This section requires ShareX.

After navigating to Zipline, click on the top right corner where it says your username and click Manage Account. Scroll down to see "ShareX Config", select the one you would prefer using. After this you can import the .sxcu into sharex. More information here

Flameshot (Linux(Xorg/Wayland) and macOS)

This section requires Flameshot, jq, and xsel.

Wayland instructions

If using wayland you will need to have wl-clipboard installed, for the wl-copy command.

If you are not using GNOME/KDE/Qtile/Sway, and are using something like a wlroots-based or wlroots-compatible compositor (ex. Hyprland, River, etc), you will need to set the XDG_CURRENT_DESKTOP environment variable to sway, which will just override it for this script. Adding export XDG_CURRENT_DESKTOP=sway to the start of the script will work.

After this, replace the xsel -ib with wl-copy in the script.

Mac instructions

If using macOS, you can replace the xsel -ib with pbcopy in the script.

You can either use the script below, or generate one directly from Zipline (just like how you can generate a ShareX config). To upload files using flameshot we will use a script. Replace $TOKEN and $HOST with your own values, you probably know how to do this if you use linux.

DATE=$(date '+%h_%Y_%d_%I_%m_%S.png');
flameshot gui -r > ~/Pictures/$DATE;

curl -H "Content-Type: multipart/form-data" -H "authorization: $TOKEN" -F file=@$1 $HOST/api/upload | jq -r '.files[0]' | xsel -ib

Contributing

Bug reports

Create an issue on GitHub and use the template, please include the following (if one of them is not applicable to the issue then it's not needed):

  • The steps to reproduce the bug
  • Logs of Zipline
  • The version of Zipline
  • Your OS & Browser including server OS
  • What you were expecting to see

Feature requests

Create a discussion on GitHub, please include the following:

  • Brief explanation of the feature in the title (very brief please)
  • How it would work (Be detailed!)

Pull Requests (contributions to the codebase)

Create a pull request on GitHub. If your PR does not pass the action checks, then please fix the errors. If your PR was submitted before a release, and I have pushed a new release, please make sure to update your PR to reflect any changes, usually this is handled by GitHub.

Documentation

Documentation source code is located in diced/zipline-docs, and can be accessed here.

zipline's People

Contributors

alphanecron avatar ar065 avatar ari-party avatar axisiscool avatar cestef avatar chamburr avatar dependabot[bot] avatar diced avatar hexed avatar icetoast avatar ithundxr avatar itzderock avatar karlmanait avatar kashalls avatar l7neg avatar mateisr avatar maximmax42 avatar nebulabc avatar neomoth avatar polymo1 avatar relaxtakenotes avatar resetd3v avatar seaswimmerthefsh avatar tacticaltechjay avatar thereis avatar thezoker avatar vetlix avatar wdhdev avatar wingysam avatar winterfe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zipline's Issues

Add oauth support

Add Discord, Github, Google, ... auth support for easier log in. This should be optional and configurable in config file

Add template config.json

Configuring config.json by hand is a bit of a struggle, having a template that can easily be filled out with what's required would be way easier to launch from a clone.

No DB migration

I installed v3.0 and run yarn install and yarn build, then yarn start.
But DB tables aren't created.
Is this bug?

Feature requests

Option for owner to set rate limit and storage upload limit for user
Premium users, add option for admins to mark user as premium, then premium users should have another rate limit and storage limit + premium badge
Option to setup custom embed when generating uploader config
Text hosting, something like hastebin
Invisible links (spaces) option when generating uploader config (something like https://zws.im )
Add optional Github, Google and Discord oauth
Password protected files and links
Option to set expiration of files for user, for example that files of that user will be stored for 1 month and then will be deleted

Not work Keep Original [BUG?]

Describe the bug
In Zipline.toml original = true, a name of uploaded file keeps original's but a file name in database is encoded, so uploaded image is not found via browser.

I uploaded Myface.png and the database record as below:

zipline=> select * from zipline_images;
   id   |    file    | user | views
--------+------------+------+-------
 2E2i7q | 2E2i7q.png |    1 |     0
(1 row)

To Reproduce
Steps to reproduce the behavior:

  1. Upload an image
  2. visit /dash/images
  3. See broken image

Expected behavior
Show images normally.

Desktop (please complete the following information if desktop):

  • OS: macOS 10.15.7
  • Browser: Chrome
  • Zipline Version: latest of next branch

Image Favoriting/Pinning

I'm always frustrated when I can't find an image I wanted to look at later. A button that pins the image would get the job done.

Raw image data instead of viewable image

I posted about this on the discord server but I figure it's easier to keep track of here.

My zipline uploads are behaving strangely. In Firefox when I open the link it prompts a download instead of just viewing the file. In chrome it doesn't download but instead shows the image in plaintext.

Firefox:
firefox_2021-06-29_13-21-35

Chrome:
chrome_2021-06-29_13-22-22

Environment:
Zipline v3.0.0
MariaDB v10.5.10
Node.js v16.4.0
OS: Arch Linux x86_64
Kernel: 5.12.13-arch1-1

Login Screen moves on wrong password

Issue

  • When entering an incorrect password on the login screen, the username, password, and login text all shift upward when the "Incorrect Password" message appears, Making a weird animation that is not clean and looks very ugly

Solution

  • Make the text and input's stay put while the "incorrect password" prompt appears

Page Not Found

Describe the bug
After updating to 2c6ca79, 404 error occurred.

To Reproduce
Steps to reproduce the behavior:

  1. npm install
  2. npm run build
  3. npm start
  4. access top page via browser

Expected behavior
Show home page or login page.

Screenshots
ScreenShot

Desktop (please complete the following information if desktop):

  • OS: macOS 10.15.7
  • Browser: Chrome 86.0.4240.111
  • Zipline Version: next branch, 2c6ca79

Browser Logs (for desktop browsers)
See screenshot.

Missing dependency: sqlite3 [BUG]

(node:1) UnhandledPromiseRejectionWarning: DriverPackageNotInstalledError: SQLite package has not been found installed. Try to install it: npm install sqlite3 --save
    at new DriverPackageNotInstalledError (/opt/zipline/node_modules/typeorm/error/DriverPackageNotInstalledError.js:10:28)
    at SqliteDriver.loadDependencies (/opt/zipline/node_modules/typeorm/driver/sqlite/SqliteDriver.js:127:19)
    at new SqliteDriver (/opt/zipline/node_modules/typeorm/driver/sqlite/SqliteDriver.js:28:15)
    at DriverFactory.create (/opt/zipline/node_modules/typeorm/driver/DriverFactory.js:43:24)
    at new Connection (/opt/zipline/node_modules/typeorm/connection/Connection.js:53:59)
    at ConnectionManager.create (/opt/zipline/node_modules/typeorm/connection/ConnectionManager.js:56:26)
    at /opt/zipline/node_modules/typeorm/index.js:195:66
    at step (/opt/zipline/node_modules/tslib/tslib.js:141:27)
    at Object.next (/opt/zipline/node_modules/tslib/tslib.js:122:57)
    at /opt/zipline/node_modules/tslib/tslib.js:115:75

Sqlite is offered as an option, but package.json doesn't have the right dependencies.

I really wanted to just quickly check this out, but I can only take so many issues before giving up. :(

ShareX URL Empty: Unable to receive link after uploading images

Hey I was able to get zipline up in 2 minutes with docker-compose and images successfully upload into zipline, however after sharex uploads an image it returns "ERROR URL EMPTY".

I used to example ShareX config from the docs

{
  "Version": "13.2.1",
  "Name": "CDN",
  "DestinationType": "ImageUploader, TextUploader",
  "RequestMethod": "POST",
  "RequestURL": "https://domain.tld/api/upload",
  "Headers": {
    "Authorization": "1234567",
    "Embed": "true"
  },
  "URL": "$json:data.url$",
  "Body": "MultipartFormData",
  "FileFormName": "file"
}

chrome_qTu1lRIBB2

2021-07-15 15:05:26.843 - File opened: C:\Users\duck\Documents\ShareX\Logs\ShareX-Log-2021-07.txt
2021-07-15 15:05:46.596 - ApplicationConfig save started: C:\Users\duck\Documents\ShareX\ApplicationConfig.json
2021-07-15 15:05:46.596 - UploadersConfig save started: C:\Users\duck\Documents\ShareX\UploadersConfig.json
2021-07-15 15:05:46.597 - HotkeysConfig save started: C:\Users\duck\Documents\ShareX\HotkeysConfig.json
2021-07-15 15:05:46.727 - UploadersConfig save successful: C:\Users\duck\Documents\ShareX\UploadersConfig.json
2021-07-15 15:05:46.763 - HotkeysConfig save successful: C:\Users\duck\Documents\ShareX\HotkeysConfig.json
2021-07-15 15:05:46.799 - ApplicationConfig save successful: C:\Users\duck\Documents\ShareX\ApplicationConfig.json
2021-07-15 15:06:09.890 - UploadersConfig save started: C:\Users\duck\Documents\ShareX\UploadersConfig.json
2021-07-15 15:06:09.986 - UploadersConfig save successful: C:\Users\duck\Documents\ShareX\UploadersConfig.json
2021-07-15 15:07:49.288 - CommandLine: -CustomUploader "C:\Users\duck\Downloads\zip.sxcu"
2021-07-15 15:08:09.310 - CommandLine: C:\Users\duck\Pictures\idols\E4knzMnXMAQQUJN.jpg
2021-07-15 15:08:09.311 - Task in queue. Job: FileUpload, Type: Image, Host: Custom image uploader
2021-07-15 15:08:09.362 - Task status: Preparing
2021-07-15 15:08:09.389 - Upload started. Filename: E4knzMnXMAQQUJN.jpg, Filepath: C:\Users\duck\Pictures\idols\E4knzMnXMAQQUJN.jpg
2021-07-15 15:08:09.423 - Task failed. Filename: E4knzMnXMAQQUJN.jpg, Errors:
URL is empty.
2021-07-15 07:07:10,020 PM INFO  [url] 200: /api/user


2021-07-15 07:07:10,126 PM INFO  [url] 200: /api/user/images


2021-07-15 07:07:10,188 PM INFO  [url] 200: /api/stats


2021-07-15 07:08:10,254 PM INFO  [url] 200: /api/upload


2021-07-15 07:08:10,273 PM INFO  [image] User ducky (1) uploaded an image GrfvkL.jpg (6)


2021-07-15 07:11:42,246 PM INFO  [url] 200: /api/upload


2021-07-15 07:11:42,282 PM INFO  [image] User ducky (1) uploaded an image T0GZWr.jpg (7)


2021-07-15 07:13:07,783 PM INFO  [url] 200: /api/upload


2021-07-15 07:13:07,861 PM INFO  [image] User ducky (1) uploaded an image RkuwrT.jpg (8)

Now I can manually log into zipline and copy the url from the web ui and share it. It works perfectly that way.

Able to create more than one initial admin users [BUG]

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

To Reproduce
Steps to reproduce the behavior:

  1. Install Zipline and do the initial setup (through Docker in our case)
  2. Go to /user/setup

Expected behavior
You shouldn't be able to go through the initial setup again. Going to that subdirectory is possible for anyone and poses a big security risk as it means anyone can just create an administrative account.

Screenshots
"Bug Screenshot 1"

Desktop (please complete the following information if desktop):

  • OS: Windows 10 Pro 20H2
  • Browser: Firefox Developer Edition
  • Zipline Version: Newest upstream (self-built image with newest code from repo as of February 2)
    ^ This shouldn't be important for the bug as it seems to be backend-related

Browser Logs (for desktop browsers)

Not applicable for this bug

THIS IS A TEST IGNORE THIS PLEASE

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

To Reproduce
Steps to reproduce the behavior:

  1. Go to '..324234.'
  2. Click on '.234324...'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
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]

Additional context
Add any other context about the problem here.e

Fix metatags in Head

Is your feature request related to a problem? Please describe.
Metatags don't copy over to most Head attributes e.g. page title

Describe the solution you'd like
Metatags to go into config

Describe alternatives you've considered
None

Additional context
None

Error when trying to build

I'm getting this error when I try to build

npm run build

> [email protected] build /root/zipline
> npm-run-all build:schema build:next


> [email protected] build:schema /root/zipline
> prisma generate --schema=prisma/schema.shared.prisma

Prisma schema loaded from prisma/schema.shared.prisma

✔ Generated Prisma Client (2.25.0) to ./node_modules/@prisma/client in 168ms
You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client

import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()


> [email protected] build:next /root/zipline
> next build

info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
Failed to compile.


./src/pages/auth/login.tsx:3:10

Type error: Module '"@material-ui/core/Alert/Alert"' has no exported member 'Color'. Did you mean to use 'import Color from "@material-ui/core/Alert/Alert"' instead?

  1 | import React, { useEffect, useState } from 'react';
  2 | import { Typography, Box, TextField, Stack, Button } from '@material-ui/core';
> 3 | import { Color } from '@material-ui/core/Alert/Alert';
    |          ^
  4 | import { useRouter } from 'next/router';
  5 | import Alert from 'components/Alert';
  6 | import Backdrop from 'components/Backdrop';

MissingDriverError

When npm start, MissingDriverError occurred.

  • next branch
  • Node.js: v15.0.1 and v14.11.0
  • npm: 7.0.3
> zipline-next@2.0.0 start /srv/zipline/zipline
> NODE_ENV=production node dist


  ______       _ _
 |__  (_)_ __ | (_)_ __   ___
   / /| | '_ \| | | '_ \ / _ \
  / /_| | |_) | | | | | |  __/
 /____|_| .__/|_|_|_| |_|\___|
        |_|

GitHub  : https://github.com/ZiplineProject/zipline
Issues  : https://github.com/ZiplineProject/zipline/issues
Docs    : https://zipline.diced.wtf/
Mode    : production
Verbose : no

[10/25/2020 1:31:23 AM] info: Preparing app...
/srv/zipline/zipline/node_modules/typeorm/error/MissingDriverError.js:10
        var _this = _super.call(this) || this;
                           ^

MissingDriverError: Wrong driver: "undefined" given. Supported drivers are: "cordova", "expo", "mariadb", "mongodb", "mssql", "mysql", "oracle", "postgres", "sqlite", "better-sqlite3", "sqljs", "react-native", "aurora-data-api", "aurora-data-api-pg".
    at new MissingDriverError (/srv/zipline/zipline/node_modules/typeorm/error/MissingDriverError.js:10:28)
    at DriverFactory.create (/srv/zipline/zipline/node_modules/typeorm/driver/DriverFactory.js:67:23)
    at new Connection (/srv/zipline/zipline/node_modules/typeorm/connection/Connection.js:53:59)
    at ConnectionManager.create (/srv/zipline/zipline/node_modules/typeorm/connection/ConnectionManager.js:56:26)
    at /srv/zipline/zipline/node_modules/typeorm/index.js:194:66
    at step (/srv/zipline/zipline/node_modules/tslib/tslib.js:141:27)
    at Object.next (/srv/zipline/zipline/node_modules/tslib/tslib.js:122:57)
    at /srv/zipline/zipline/node_modules/tslib/tslib.js:115:75
    at new Promise (<anonymous>)
    at Object.__awaiter (/srv/zipline/zipline/node_modules/tslib/tslib.js:111:16)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `NODE_ENV=production node dist`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /srv/zipline/.npm/_logs/2020-10-25T08_31_24_040Z-debug.log

Add option embed endpoint

Hello, could you create endpoint that will create embed like this (it should be configurable)? It is possible using META OG tags.

image

/api/stats causes an error

(node:20707) UnhandledPromiseRejectionWarning: TypeError: Reduce of empty array with no initial value
    at Array.reduce (<anonymous>)
    at APIController.getStats (/root/zipline/out/src/controllers/APIController.js:266:83)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

seems to come from this line

[HELP] TypeError

Describe the bug
When npm start, the following error occurred.

> typex@2.1.3 start /srv/zipline/zipline
> node out/src

9/17/2020 8:55:18 AM info    Zipline: Starting Zipline 2.1.3
(node:20127) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'type' of undefined
    at /srv/zipline/zipline/out/src/index.js:47:111
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:20127) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:20127) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

To Reproduce

  1. npm start

Expected behavior
Run successfully.

Screenshots
None.

Desktop (please complete the following information):
None.

Additional context
None.

Docker-compose without installing node.js on the host system.

Is your feature request related to a problem? Please describe.
I was looking for a docker-compose file, but the only way to get it is to execute setup.js. The entire point of me using docker is so I don't have to install node.js or other dependencies on the host system.

Describe the solution you'd like
Provide an example docker-compose config without a setup script, or a docker run command for the setup script.

Default username/password (or config for them)?

hey, just installed zipline v3 for the first time, what is the default username/password? i cant find any info anywhere, and common ones like admin admin and username password dont work.

[BUG] MariaDB Errors Out

Describe the bug
MariaDB only creates one table then errors out with bellow Exibit A. the only table it creates is also bellow Exibit B

To Reproduce
Steps to reproduce the behavior:

  1. Use MariaDB or MySQL on Docker
  2. Watch Container Die
  3. Look at logs and see error

Expected behavior
MySQL/MariaDB to Work

Screenshots
Exibit A
Exibit B

Desktop (please complete the following information if desktop):

  • OS: Debian 10
  • Browser: N/A
  • Zipline Version: 2.8.1

Could not create user: Invalid salt. Salt must be in the form of: $Vers$log2(NumRounds)$saltvalue

Describe the bug
When I tired to a new user, an error occurred:

Could not create user: Invalid salt. Salt must be in the form of: $Vers$log2(NumRounds)$saltvalue

To Reproduce
Steps to reproduce the behavior:

  1. Login as administrator
  2. Users -> Create New User
  3. Fill username and password
  4. unable Administrator
    5 .Click 'Create'

Expected behavior
Created a new user successfully.

Screenshots
ScreenShot

Desktop (please complete the following information):

  • OS: macOS 10.15.6
  • Browser chrome
  • Version 2.1.1

Additional context
None.

links in read.me broken

looks like a links to install steps go to broken hosting.
Possible to move into github to avoid this reoccuring?

Setup.js: Wrong driver: "sqlite3" [BUG]

(node:1) UnhandledPromiseRejectionWarning: MissingDriverError: Wrong driver: "sqlite3" given. Supported drivers are: "cordova", "expo", "mariadb", "mongodb", "mssql", "mysql", "oracle", "postgres", "sqlite", "better-sqlite3", "sqljs", "react-native", "aurora-data-api", "aurora-data-api-pg".
    at new MissingDriverError (/opt/zipline/node_modules/typeorm/error/MissingDriverError.js:10:28)
    at DriverFactory.create (/opt/zipline/node_modules/typeorm/driver/DriverFactory.js:67:23)
    at new Connection (/opt/zipline/node_modules/typeorm/connection/Connection.js:53:59)
    at ConnectionManager.create (/opt/zipline/node_modules/typeorm/connection/ConnectionManager.js:56:26)
    at /opt/zipline/node_modules/typeorm/index.js:195:66
    at step (/opt/zipline/node_modules/tslib/tslib.js:141:27)
    at Object.next (/opt/zipline/node_modules/tslib/tslib.js:122:57)
    at /opt/zipline/node_modules/tslib/tslib.js:115:75
    at new Promise (<anonymous>)
    at Object.__awaiter (/opt/zipline/node_modules/tslib/tslib.js:111:16)

setup.js is not filling in the right value for sqlite.

PostgreSQL reserves 'user' table

Describe the bug
PostgreSQL reserves user table for system so many products use users table (in the plural).
In fact, users can't get user table contents by using psql.
Could you consider to change user to users?

Code formatting

For the love of all things holy. please use a linter or something cause the code for this is pretty badly formatted.

Shit we'll even supply you with a prettier/eslint config

[HELP] No connection options were found in any of configurations file

Describe the bug
When npm start, the following error occurred.

> typex@2.1.3 start /srv/zipline/zipline
> node out/src

9/17/2020 8:29:31 AM info    Zipline: Starting Zipline 2.1.3
(node:19180) UnhandledPromiseRejectionWarning: Error: No connection options were found in any of configurations file.
    at ConnectionOptionsReader.<anonymous> (/srv/zipline/zipline/node_modules/typeorm/connection/ConnectionOptionsReader.js:34:35)
    at step (/srv/zipline/zipline/node_modules/tslib/tslib.js:139:27)
    at Object.next (/srv/zipline/zipline/node_modules/tslib/tslib.js:120:57)
    at fulfilled (/srv/zipline/zipline/node_modules/tslib/tslib.js:110:62)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:19180) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:19180) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
  • config.json
{
    "database": {
        "type": "postgres",
        "host": "127.0.0.1",
        "port": 5432,
        "username": "zipline",
        "password": "password",
        "database": "zipline",
        "synchronize": true,
        "logging": false,
        "entities": [
            "out/src/entities/**/*.js"
        ]
    },
    "uploader": {
        "length": 6,
        "temp": "/srv/zipline/tmp",
        "upload": "/srv/zipline/files",
        "route": "/u",
        "blacklistedExt": []
    },
    "shortener": {
        "length": 4,
        "route": "/s"
    },
    "notes": {
        "length": 4,
        "route": "/n"
    },
    "core": {
        "secure": false,
        "log": true,
        "adminPassword": "password",
        "sessionSecret": "secret",
        "saltRounds": "10",
        "userTokenLength": 34,
        "ssl": {
            "key": "./ssl/server.key",
            "cert": "./ssl/server.crt"
        },
        "port": {
            "secure": 8000,
            "unsecure": 8000
        }
    },
    "meta": {
        "favicon": "/public/assets/zipline_small_circle.png",
        "title": "Zipline"
    },
    "discordWebhook": {
        "enabled": false,
        "url": "https://canary.discordapp.com/api/webhooks/??/??",
        "username": "Zipline Logs",
        "avatarURL": "some url"
    }
}

Could anyone tell me how to fix this issue?

  • OS: Debian 10.5
  • Node.js: v14.11.0
  • npm: 6.14.8
  • Typescript: Version 4.0.2

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'zipfile'
  2. run npm install
  3. run npm install pg --save-dev
  4. run npm run build
  5. run npm start

Expected behavior
run successfully.

Screenshots
None.

Additional context
None.

[BUG] Unable to login

Describe the bug
After updating to 2.5.8, I can’t login. /verify-login page returns 400 error.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'login' page
  2. Enter username and password
  3. Click LOGIN
  4. See Could not login. message.

Expected behavior
Login successfully.

Screenshots
ScreenShot

Desktop (please complete the following information if desktop):

  • OS: macOS 11.0.1 (Bug Sur)
  • Browser: Chrome (87.0.4280.88)
  • Zipline Version: 2.5.8

Browser Logs (for desktop browsers)
see screen shot.

Ziplined.toml [BUG]

Describe the bug
Unable to start zipline due to Ziplined.toml instead of being generated Zipline.toml

To Reproduce
Steps to reproduce the behavior:

  1. node setup.js
  2. yarn start
  3. See error

Expected behavior
node setup.js generates Zipline.toml or Zipline use Ziplined.toml config

Screenshots
None

  • Zipline: 2.4.0 and 2.4.1

How to shorten URL or upload images?

I have 2 questions about next branch.

  1. How can I shorten a new url or upload an image on the Web UI?
  2. When accessing /images from my browser, only loading circle is spinning and no image is shown. Why?

Changing username on dashboard sometimes doesn't register

Reproduce:

  1. Log in with valid credentials
  2. Change the dashboard Username field, hit save and apply.
  3. Go back to the login page, the saved Username may not have applied.

This is potentially bad for people with password managers, which may lock them out with invalid credentials.

Edit: I was able to change it at some point, unsure what exactly I did to commit the change.

S3 support

Is your feature request related to a problem? Please describe.
Storage isn't persistant. Also a good way to backup and high avalibility.

Describe the solution you'd like
S3 storage support

Describe alternatives you've considered
Block storage from cloud providers
CDN's

Additional context
making a local S3 dev server
NPM package

Lots o' Issues

So, current issues. Can't Update User(had to use Postman to fix the POST request), Shortened URLs don't work, Hitting Enter in URL textbox relocates you to Home Page, No way to Delete Images.

File Size Configuration

File Size Configuration

  • Option to let users with admin role no limit on file size.
  • Option to change default file size limit.

Missing dependencies for setup.js [BUG]

Installed nodejs (to my dismay, see #58 ) , did npm install to install dependencies, yet these were missing for setup.js:

❯ node setup.js
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module 'inquirer'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/root/docker-compose/zipline/setup.js:2:18)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
❯ node setup.js
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module 'toml-patch'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/root/docker-compose/zipline/setup.js:3:23)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)

[HELP] RepositoryNotFoundError and not created out/src

Describe the bug

  1. When npm start, the following error occurred.
> typex@2.1.3 start /srv/zipline/zipline
> node out/src

internal/modules/cjs/loader.js:896
  throw err;
  ^

Error: Cannot find module '/srv/zipline/zipline/out/src'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:893:15)
    at Function.Module._load (internal/modules/cjs/loader.js:743:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! typex@2.1.3 start: `node out/src`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the typex@2.1.3 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /srv/zipline/.npm/_logs/2020-09-18T12_21_25_726Z-debug.log

Now there is no out/src directory.

$ ls out
controllers  core  entities  index.js  interval.js  middleware  server.js  structures  util.js
  1. Next, I ran node out, then the following error occurred.
9/18/2020 4:06:02 AM info    Zipline: Starting Zipline 2.1.3
(node:28601) UnhandledPromiseRejectionWarning: RepositoryNotFoundError: No repository for "User" was found. Looks like this entity is not registered in current "default" connection?
    at new RepositoryNotFoundError (/srv/zipline/zipline/node_modules/typeorm/error/RepositoryNotFoundError.js:11:28)
    at EntityManager.getRepository (/srv/zipline/zipline/node_modules/typeorm/entity-manager/EntityManager.js:660:19)
    at Connection.getRepository (/srv/zipline/zipline/node_modules/typeorm/connection/Connection.js:343:29)
    at /srv/zipline/zipline/out/index.js:40:30
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:28601) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:28601) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Please help me.

To Reproduce

  1. Run npm start
  2. Run node out

Expected behavior
Run successfully.

Screenshots
None.

Desktop (please complete the following information):
None.

Additional context
None.

Images section hangs when there are many images

When you have over 1 thousand screenshots, the image section of the dashboard hangs while your browser tries to download over 75mb with of image data, taking a total of over 55 seconds to fully load the page.

Potential fixes:

  • Pagination
  • Lazy loading

[BUG] docker-compose failed

Describe the bug
docker-compose won't start

  1. copy docker-compose template
cp docker-compose.template.yml docker-compose.yml
  1. update expose ports
version: "3"
services:
  zipline:
    ports:
      - "87:8000"
    volumes:
      - "./uploads:/opt/zipline/uploads"
    build: .
    tty: true
  1. docker-compose up -d
chchang@hqdc039:~/git/zipline$ docker-compose up -d
Creating network "zipline_default" with the default driver
Building zipline
Step 1/8 : FROM node:14
14: Pulling from library/node
76b8ef87096f: Pull complete
2e2bafe8a0f4: Pull complete
b53ce1fd2746: Pull complete
84a8c1bd5887: Pull complete
7a803dc0b40f: Pull complete
b800e94e7303: Pull complete
8e9f42962912: Pull complete
cc1c1f0d8c86: Pull complete
a42c31ab44dd: Pull complete
Digest: sha256:8eb45f4677c813ad08cef8522254640aa6a1800e75a9c213a0a651f6f3564189
Status: Downloaded newer image for node:14
 ---> d6602e31594f
Step 2/8 : WORKDIR /opt/zipline
 ---> Running in 8278610801e5
Removing intermediate container 8278610801e5
 ---> 75e703a95bc3
Step 3/8 : COPY . /opt/zipline
 ---> f479c232a4a0
Step 4/8 : RUN npm i
 ---> Running in 08036a204853
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated

> [email protected] install /opt/zipline/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

[bcrypt] Success: "/opt/zipline/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node" is installed via remote

> @ampproject/[email protected] postinstall /opt/zipline/node_modules/@ampproject/toolbox-optimizer
> node lib/warmup.js

Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
AMP OPTIMIZER Downloaded latest AMP runtime data.
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.1 (node_modules/webpack/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 1327 packages from 835 contributors and audited 1336 packages in 44.664s

91 packages are looking for funding
  run `npm fund` for details

found 5 vulnerabilities (4 low, 1 high)
  run `npm audit fix` to fix them, or `npm audit` for details
Removing intermediate container 08036a204853
 ---> 56150b05dbdc
Step 5/8 : RUN npm run build
 ---> Running in 3956ca9860ba

> [email protected] build /opt/zipline
> next build && tsc -p .

Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
info  - Creating an optimized production build...
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry

info  - Compiled successfully
info  - Collecting page data...
info  - Generating static pages (0/11)
info  - Generating static pages (2/11)
info  - Generating static pages (5/11)
info  - Generating static pages (8/11)
info  - Generating static pages (11/11)
info  - Finalizing page optimization...

Page                                                           Size     First Load JS
┌ ○ /                                                          239 B          99.1 kB
├   /_app                                                      0 B            98.8 kB
├ ○ /404                                                       5.48 kB         104 kB
├ ● /dash                                                      1.05 kB         357 kB
├ ● /dash/images                                               4.28 kB         360 kB
├ ○ /dash/statistics                                           2.44 kB         356 kB
├ ○ /dash/upload                                               15.4 kB         369 kB
├ ● /dash/urls                                                 2.94 kB         360 kB
├ ○ /dash/users                                                4.45 kB         362 kB
├ ○ /user/login                                                4.33 kB         132 kB
├ ● /user/manage                                               2.18 kB         360 kB
└ ○ /user/setup                                                2.46 kB         130 kB
+ First Load JS shared by all                                  98.8 kB
  ├ chunks/54d8afaa53b3f96daaf95af2d599c4ace7023576.c2f253.js  26 kB
  ├ chunks/8af701fd6c717923a0d81eba7532ee453c4f3efd.13981a.js  9.76 kB
  ├ chunks/990404156a8317c8d69269cd1922f67953c7c0f0.223f05.js  11.1 kB
  ├ chunks/framework.13d6f2.js                                 40.2 kB
  ├ chunks/main.4aa302.js                                      7.19 kB
  ├ chunks/pages/_app.7d0c9c.js                                3.91 kB
  └ chunks/webpack.e06743.js                                   751 B

λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
○  (Static)  automatically rendered as static HTML (uses no initial props)
●  (SSG)     automatically generated as static HTML + JSON (uses getStaticProps)
   (ISR)     incremental static regeneration (uses revalidate in getStaticProps)

Removing intermediate container 3956ca9860ba
 ---> bbe23839168f
Step 6/8 : ENV NODE_ENV=production
 ---> Running in e75681ef027c
Removing intermediate container e75681ef027c
 ---> ed24a4582f9c
Step 7/8 : EXPOSE 8000
 ---> Running in 2bbddab9bcde
Removing intermediate container 2bbddab9bcde
 ---> 15c7b05270bc
Step 8/8 : CMD ["node", "dist"]
 ---> Running in 520b412778c3
Removing intermediate container 520b412778c3
 ---> 7774233226dd
Successfully built 7774233226dd
Successfully tagged zipline_zipline:latest
WARNING: Image for service zipline was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating zipline_zipline_1 ... done

docker status

chchang@hqdc039:~/git/zipline$ docker ps -a
CONTAINER ID        IMAGE                           COMMAND                  CREATED             STATUS                      PORTS                            NAMES
e8a68b08a638        zipline_zipline                 "docker-entrypoint.s…"   2 minutes ago       Exited (0) 2 minutes ago                                     zipline_zipline_1

docker logs

chchang@hqdc039:~/git/zipline$ docker logs zipline_zipline_1 
[4/20/2021 3:09:11 AM] [configuration] error: could not find a Zipline.toml file in /opt/zipline

[BUG?] 2FA failed.

Describe the bug
I can't enable 2FA.

To Reproduce
Steps to reproduce the behavior:

  1. Click ENABLE 2FA
  2. Scan Code
  3. Enter 6 digit code and click UNABLE
  4. Nothing happened.

Expected behavior
Enable 2FA

Screenshots
スクリーンショット 2020-12-07 19 38 01

Desktop (please complete the following information if desktop):

  • OS: macOS 11.0.1 (Big Sur)
  • Browser: Chrome
  • Zipline Version: 2.5.8

Browser Logs (for desktop browsers)
See screen shot.

Unable to compile

https://sourceb.in/7a93098363
Error when trying to do tsc -p .

when I do node out/src
4/29/2020 8:48:33 AM err [TypeX.Config]: Missing needed property on configuration: forever.route
4/29/2020 8:48:41 AM info [Connection]: Successfully initialized database type: mysql
4/29/2020 8:48:41 AM err [TypeX.Routes]: Could not formulate upload and forever static routes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.