Code Monkey home page Code Monkey logo

ascii-art's Introduction

zero-to-mastery

Zero to Mastery Open Source

Screenshot

ascii-art's People

Contributors

adamstok avatar anastasiacortes avatar avinash238 avatar bhatt01tapasvi avatar dennismwendwa avatar gsivanithin18 avatar hanisntsolo avatar hastyazad avatar kennithnichol avatar maidxn avatar mattcsmith avatar ndeoligence avatar nikhilchintawar avatar nitsujcm avatar peteruche21 avatar raghavan-b avatar roelzaps avatar rpdavila avatar shubhamm33 avatar siddharth2016 avatar simardeepsingh-zsh avatar smokeraven667 avatar somil-tyagi avatar sophiabrandt avatar szabopeter avatar t-crypt avatar thomas-lysens avatar thomashewett avatar vamshidhar-thonti avatar wmporter 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ascii-art's Issues

TypeError: key: expected bytes or bytearray, but got 'tuple'

Issue:
Run the flask app (web/)
Click on the given link (http://127.0.0.1:5000) to access the app

Expected: Should show the img-upload page
Actual: Gives an error with this as part of the stacktrace (Only external files are shown in the stacktrace):

127.0.0.1 - - [01/Nov/2020 15:06:37] "GET / HTTP/1.1" 500 -
Traceback (most recent call last):
  File "ascii-art/venv/lib/python3.8/site-packages/flask/app.py", line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File "ascii-art/venv/lib/python3.8/site-packages/flask/app.py", line 2450, in wsgi_app
    response = self.handle_exception(e)
  File "ascii-art/venv/lib/python3.8/site-packages/flask/app.py", line 1867, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "ascii-art/venv/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "ascii-art/venv/lib/python3.8/site-packages/flask/app.py", line 2446, in wsgi_app
    ctx.push()
  File "ascii-art/venv/lib/python3.8/site-packages/flask/ctx.py", line 390, in push
    self.session = session_interface.open_session(self.app, self.request)
  File "ascii-art/venv/lib/python3.8/site-packages/flask/sessions.py", line 348, in open_session
    data = s.loads(val, max_age=max_age)
  File "ascii-art/venv/lib/python3.8/site-packages/itsdangerous/timed.py", line 130, in loads
    base64d, timestamp = signer.unsign(s, max_age, return_timestamp=True)
  File "ascii-art/venv/lib/python3.8/site-packages/itsdangerous/timed.py", line 52, in unsign
    result = Signer.unsign(self, value)
  File "ascii-art/venv/lib/python3.8/site-packages/itsdangerous/signer.py", line 167, in unsign
    if self.verify_signature(value, sig):
  File "ascii-art/venv/lib/python3.8/site-packages/itsdangerous/signer.py", line 153, in verify_signature
    key = self.derive_key()
  File "ascii-art/venv/lib/python3.8/site-packages/itsdangerous/signer.py", line 132, in derive_key
    mac = hmac.new(self.secret_key, digestmod=self.digest_method)
  File "/usr/lib/python3.8/hmac.py", line 153, in new
    return HMAC(key, msg, digestmod)
  File "/usr/lib/python3.8/hmac.py", line 48, in __init__
    raise TypeError("key: expected bytes or bytearray, but got %r" % type(key).__name__)

major critical issue of command line arguments

command line arguments can be used to exploit servers, machines etc in which this code will be running just for example.
Issue --> we can put any command just after "python community-version.py two.png" (here two.png can be replaced by any file I've taken that as an example)

Screenshot (160)

Screenshot (161)

Issue Examples:

  1. python community-version.py two.png;ipconfig
  2. python community-version.py two.png;arp -a;
  3. python community-version.py two.png; dir
  4. python community-version.py two.png;ls

So More Fun Here it is
5) python community-version.py two.png; cat /etc/passwd

so the thing is we have to block these commands and the issue I think should be clear to you and it is very severe and should be taken care if you program such a code like this where we put inputs as an argument.

For New to Linux or Command Line Users
" ; " this character after statement represent new command after it.
therefore for example python community.py two.png; ipconfig here python community.py two.png is first command that will be run and after that " ; " this will stop and new command will run after this character.

UI for web version

it would be great for the user_upload and ascii_art display pages to have good UI design

Frontend [question]

How about having a frontend with React where you can:

  1. Select and upload image
  2. Apply different filters (not just ascii-art)
  3. Have color options too.

ascii_art | Implement independant operations as sub commands

The following options don't really modify the creation of ascii images. They're logically independent from that logic. Because of this, we always exit (or return) after completing them. We need to change them into sub-commands.
This is a bit of work and might require a read up of the click library docs.

Operations are:

  1. --clock
  2. --credits
  3. --text & --textinput (They're related, so they should be options of the same sub command)

When this is done, the way we'll show credits (for instance) should be to run: ascii_art credits. Meaning 'credits' is a subcommand of 'ascii_art'. And we should be able to run help on it: ascii_art credits --help.

See: https://click.palletsprojects.com/en/7.x/commands

User messages in web version (Flask)

The Flask app (under web version) has a few messages it prints to the console, which gives the user useful feedback on their actions. We need to move these to the browser (via flash messages) since the users wouldn't have access to the terminal to see them when deployed

Supported image types message

Although this is in the web version (Flask app), the changes only require python knowledge, and not Flask.

We need to replace the message only png files are accepted in web version/app.py with a formatted string version that gets the supported types from the configuration: ALLOWED_IMAGE_EXTENSIONS.

setup.py outdated

Problem: Because setup.py is outdated, the How to contribute instruction in the readme is kinda broken. The installation works (pip install -e .) but when trying to run the code, a lot of commands give errors.

Solution: We just need to add packages used by ascii_art to /setup.py.

Feature request: CLI font options

It would be nice to be able to

  • specify the font for the text, clock, timer and credits commands
  • list the fonts the same way as file types can be listed

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.