Git Product home page Git Product logo

simaster.ics's Introduction

simaster.ics

Simple Python-based web app to generate an iCalendar file from SIMASTER courses schedule.

Quick Usage

  1. Open the demo or your server URL if you self-hosted it.
  2. Fill in all the fields
  3. Copy the iCalendar URL
  4. Subscribe to it using your preferred calendar app (e.g. Google Calendar)

API

Once you have deployed simaster.ics (or, just use the demo, you can directly utilize its API to make an iCalendar file.

  • Method: GET
  • URI: /ics
  • Parameters:
    • username: your SIMASTER account username
    • password: your SIMASTER account password
    • period: calendar period (e.g. 20212, 20211)
    • type: optional, calendar event type (possible values: exam, class)
    • reuse_session: optional, cache and reuse session (possible values: 0, 1)

Deployment

Before deploying, make sure that you have already installed the requirements (e.g. by using pip install -r requirements.txt).

  • Gunicorn: gunicorn wsgi:app
  • Flask Development Server: python wsgi.py
  • Heroku: use the provided (or your own) Procfile
  • Docker: use the Dockerfile
    • docker build . -t simasterics
    • docker run -p 8000:8000 simasterics

Enabling Password Encryption

Password encryption is feature that allows user password to be encrypted (to hide plaintext password from the public calendar URL). To enable this feature, you have to provide the following environment variables (dotenv or .env file is also supported).

  • SICS_ENABLE_PWD_ENC set to 1
  • SICS_PRIVATE_KEY set to the Base64-encoded private key in PEM encoding and PKCS#8 format (you may want to use generate_key.py)

License

Distributed under the MIT License.

Contribution

Any form of contribution is highly appreciated. Feel free to contribute (or maybe even buying me a cofffee).

simaster.ics's People

Contributors

lc-at avatar

Stargazers

 avatar Yazid Rizki avatar Iqbal Rifai avatar  avatar Aziz Ridhwan Pratama avatar Alexander Adam avatar Dwikavindra avatar nara avatar click_here avatar Richardus Ferdian avatar ナンダ avatar

Watchers

James Cloos avatar  avatar

simaster.ics's Issues

Make a user interface

API stands for application programming interface. I think it would be more friendly for people to use it if there was an interface (a basic plain HTML should be more than enough) to generate a proper calendar URL.

Prevent the flooding of logged in devices by not sending `aId`

Thanks to @raffifu, he discovered that it is possible to log in and acquire session without having to send aId. The resulting session will also not listed in the Active Devices page in SIMASTER. I think this strategy can be used to prevent the page from being flooded (since calendar is usually fetched daily).

I may assign myself when I have the spare time to wire up a PR for this. If you are interested in wiring up the PR for this, I would really appreciate it.

Add a `Dockerfile` to support deployment via Docker

The demo page is currently deployed on Heroku using free Heroku Dynos which will no longer be available soon.

Starting November 28th, 2022, free Heroku Dynos, free Heroku Postgres, and free Heroku Data for Redis® will no longer be available.
If you have apps using any of these resources, you must upgrade to paid plans by this date to ensure your apps continue to run and to retain your data. For students, we will announce a new program by the end of September. Learn more at https://blog.heroku.com/next-chapter

To keep the demo running, the instance needs to be deployed somewhere else. Docker seems to be a good way to pack the project and ease deployment.

Add a feature to submit username and password in encrypted form

Proposed feature:

  1. Generate public and private key for asymmetrical encryption
  2. Let the server store the private key
  3. From the front-end, provide encryption using public key
  4. Generate calendar URL with encrypted credentials (also add the corresponding parameter to let the server know if the credential is encrypted)

This should be the default behavior for transmitting password.

Add a security warning

As simaster.ics uses GET request, and credentials are passed openly, it is definitely a security issue.

It would be helpful if there is some warning in the README.md file telling about the security issue
and what could be done to prevent unwanted things.

Add a method to add meeting links to events

So far, this project have been able to get in sync with SIMASTER's calendar. But, to make things easier, it would have been very nice to have those events linked with their own meeting link (only if they are online events). I am thinking about two options:

  1. To have a separate database that contains a user-curated list of meeting list (or make the API fetch another file that contains the meeting list).
  2. Crawl the eLearning page in SIMASTER for links (concern: resource)

Allow session reusing to reduce login flood

One of the downsides of not storing password/session is the need to log in every time a request to the API is made. This also don't look good in the logged in devices page on SIMASTER.

Caching the logged session is not secure, but having it as an option will be nice (should not be a default setting). This way, some users can let their session token cached and have a more efficient and less floody login history.

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.