A database-based CDN node supporting PostgreSQL and MongoDB backends.

Overview

cloudflare cloud

imoog

A simple to use database-based deployable CDN node for hobbyist developers who wish to have their own CDN!

Setup


  • Clone this repo via this command: git clone https://github.com/justanotherbyte/imoog
  • Go into the imoog/settings.py file and adjust your settings. Examples for both database drivers have been provided in the file.
  • Install a production asgi server of your choice. The 2 I recommend are hypercorn and uvicorn. Installing their base packages will suffice.
  • To automatically install the respective dependencies, please run pip install -r requirements.txt in the directory where you wish to store your node.
  • It is recommended to house the imoog folder within another folder, as there are other files that come with this repo, that are not housed within the imoog folder.

Settings

  • imoog offers granular control over many key aspects of the node. Most of these can be extremely overwhelming. Go ahead and hop into the imoog/settings.py file, where you'll find detailed explanations of each and every setting.
  • Another thing that can be overwhelming are the 2 database drivers. How do you configure them? What are their optimal settings. Again, everything is explained inside the imoog/settings.py file.

Proxy


  • In order to use this node cleanly, I recommend placing yourself behind a proxy server. One of the most popular choices is NGINX.

Caching + Cloudflare


  • The Imoog Node handles a lot of the caching for you, however, a good next step would be to place your CDN on cloudflare.
  • Cloudflare has some awesome caching solutions. Also, overall, they make it easy to expose your CDN to the open-web.

Uploading Files


This Node receives files via multipart/form-data. So it's best if you were to adapt your upload system to this. The field name the node expects is just file, so please upload it with this name. Please remember to register the Authorization header. This key can be set in the imoog/settings.py file.

Upload example (aiohttp)

import aiohttp
import asyncio


async def main():
    session = aiohttp.ClientSession()
    form  = aiohttp.FormData()
    form.add_field("file", b'imagebyteshere', content_type="bytes")
    resp = await session.post("http://localhost:8000/upload", data=form, headers={"Authorization": "myawesomesecretkey"})
    returned_data = await resp.json()
    print(returned_data)
    await session.close()

asyncio.get_event_loop().run_until_complete(main())
>>> {'status': 200, 'file_id': 'FSTSH2RPI'}

Driver and dependency information

Internally, imoog uses 2 different libraries for the 2 different supported database drivers.

Both of these libraries are currently the best in their field for asynchronous client side connections to their respective databases.

You might also like...
Network-Shredder is a python based NIDS.
Network-Shredder is a python based NIDS.

Network-Shredder is a python based NIDS.

Simple Port Scanner script written in Python, plans is to expand upon this script to turn it into a GUI based pen testing suite

PortScanner Simple Port Scanner script written in Python, plans is to expand upon this script to turn it into a GUI based pen testing suite. #IMPORTAN

Tool to get the top 100 of the fastest nodes in the Tor network. Based on Kirzahk tool.
Tool to get the top 100 of the fastest nodes in the Tor network. Based on Kirzahk tool.

Tor Network Top 100 IPs Tool to get the top 100 of the fastest nodes in the Tor network. Based on Kirzahk tool. Just execute top100ipstor.py to get th

This is a zeep based SOAP client wrapper for simple communication with the Bricknode SOAP API.

This is a zeep based SOAP client wrapper for simple communication with the Bricknode SOAP API.

Connects to databases or sftp server based on configured environmental variables.

Myconnections Connects to Oracle databases or sftp servers depending on configured environmental variables. VERY IMPORTANT: VPN must exist. Installati

A simple electrical network analyzer, BASED ON computer-aided design.
A simple electrical network analyzer, BASED ON computer-aided design.

Electrical Network Analyzer A simple electrical network analyzer. Given the oriented graph of the electrical network (circut), BASED ON computer-aided

A simple Encrypted IM chat software Server & client based on Python3.

SecretBox A simple Encrypted IM chat software Server & client based on Python3. Version 1.0 命令行版 安装步骤 Server 运行pip3 install -r requirements 安装依赖。 运行py

TsuserverMoS - A Python-based server for Attorney Online,

tsuserverMoS A Python-based server for Attorney Online, forked from RealKaiser/tsuserverCC Requires Python 3.7+ and PyYAML. Changes/additions from tsu

Serves some data over HTTP, once. Based on the built-in Python module http.server

serve-me-once Serves some data over HTTP, once. Based on the built-in Python module http.server.

Comments
  • Don't need async definition in conection. (Sourcery refactored)

    Don't need async definition in conection. (Sourcery refactored)

    Pull Request #3 refactored by Sourcery.

    Since the original Pull Request was opened as a fork in a contributor's repository, we are unable to create a Pull Request branching from it.

    To incorporate these changes, you can either:

    1. Merge this Pull Request instead of the original, or

    2. Ask your contributor to locally incorporate these commits and push them to the original Pull Request

      Incorporate changes via command line
      git fetch https://github.com/justanotherbyte/imoog pull/3/head
      git merge --ff-only FETCH_HEAD
      git push

    NOTE: As code is pushed to the original Pull Request, Sourcery will re-run and update (force-push) this Pull Request with new refactorings as necessary. If Sourcery finds no refactorings at any point, this Pull Request will be closed automatically.

    See our documentation here.

    Run Sourcery locally

    Reduce the feedback loop during development by using the Sourcery editor plugin:

    Help us improve this pull request!

    opened by sourcery-ai[bot] 1
  • Fix some psql stuff

    Fix some psql stuff

    This fixes some psql fixes on database/postgres.py file.

    1. Add table on connect in postgresql if it does not exist.
    2. Fix invalid psql statements such as: Having name but passing image instead
      DELETE FROM {table_name}
      - WHERE image = $1
      + WHERE name = $1
      

      Trying to get mime but only image is passed in SELECT statement

      - SELECT image FROM {table_name}
      + SELECT image, mime FROM {table_name}
      WHERE image = $1
      
    opened by proguy914629bot 1
  • some fixes (Sourcery refactored)

    some fixes (Sourcery refactored)

    Pull Request #6 refactored by Sourcery.

    Since the original Pull Request was opened as a fork in a contributor's repository, we are unable to create a Pull Request branching from it.

    To incorporate these changes, you can either:

    1. Merge this Pull Request instead of the original, or

    2. Ask your contributor to locally incorporate these commits and push them to the original Pull Request

      Incorporate changes via command line
      git fetch https://github.com/justanotherbyte/imoog pull/6/head
      git merge --ff-only FETCH_HEAD
      git push

    NOTE: As code is pushed to the original Pull Request, Sourcery will re-run and update (force-push) this Pull Request with new refactorings as necessary. If Sourcery finds no refactorings at any point, this Pull Request will be closed automatically.

    See our documentation here.

    Run Sourcery locally

    Reduce the feedback loop during development by using the Sourcery editor plugin:

    Help us improve this pull request!

    opened by sourcery-ai[bot] 1
  • Docker Image

    Docker Image

    Hi, I'm writing an issue in hopes to hear if there are any plans for a Docker image.

    Why? Docker is only getting more and more popular, especially among self-hosters. It allows them to setup a service within a matter of seconds.

    If need be I'd be okay trying to make something for this.

    Preferably there'd be multiple images, each one for Redis, PostgreSQL, and MongoDB.

    Thank you.

    opened by kaylynnnn 1
Releases(v1.1.1)
Owner
Vish M
Hey! I'm Vish, an avid Discord Bot Developer. I primarily work in Python, but I sometimes use HTML and CSS. Pronouns: he/him
Vish M
High capacity, high availability, well connected, fast lightning node.

LND ⚡ Routing High capacity, high availability, well connected, fast lightning node. We aim to become a top liquidity provider for the lightning netwo

null 18 Dec 16, 2022
Build custom OSINT tools and APIs (Ping, Traceroute, Scans, Archives, DNS, Scrape, Whois, Metadata & built-in database for more info) with this python package

Build custom OSINT tools and APIs with this python package - It includes different OSINT modules (Ping, Traceroute, Scans, Archives, DNS, Scrape, Whoi

QeeqBox 52 Jan 6, 2023
OptiPLANT is a cloud-based based system that empowers professional and non-professional data scientists to build high-quality predictive models

OptiPLANT OptiPLANT is a cloud-based based system that empowers professional and non-professional data scientists to build high-quality predictive mod

Intellia ICT 1 Jan 26, 2022
DNSStager is an open-source project based on Python used to hide and transfer your payload using DNS.

What is DNSStager? DNSStager is an open-source project based on Python used to hide and transfer your payload using DNS. DNSStager will create a malic

Askar 547 Dec 20, 2022
Socket Based Backdoor and Listener

The Project is mainly based on Sockets , File Handling and subprocess library for Creating backdoors For Hacking into one's Computer (Any OS-Platform Service) and listening on your computer and waiting for Connections and Running system Commands from Your Computer to the target Computer for which Output will be Displayed On your Computer.

Shivansh Mehta 3 May 31, 2021
🐛 Self spreading Botnet based on Mirai C&C Arch, spreading through SSH and Telnet protocol.

HBot Self spreading Botnet based on Mirai C&C Arch, spreading through SSH and Telnet protocol. Modern script fullly written in python3. Warning. This

Ѵιcнч 137 Nov 14, 2022
Raspberry Pi Based Serial Console Server, with PushBullet Notification of IP changes, Automatic VPN termination, custom menu, Power Outlet Control, and a lot more

ConsolePi Acts as a serial Console Server, allowing you to remotely connect to ConsolePi via Telnet/SSH/bluetooth to gain Console Access to devices co

null 120 Jan 5, 2023
A web-based app that allows easy, simple - and if desired high-throughput - analysis of qPCR data

qpcr-Analyser A web-based GUI for the qpcr package that allows easy, simple and high-throughput analysis of qPCR data. As is described in more detail

null 1 Sep 13, 2022
This is a python based command line Network Scanner utility, which input as an argument for the exact IP address or the relative IP Address range you wish to do the Network Scan for and returns all the available IP addresses with their MAC addresses on your current Network.

This is a python based command line Network Scanner utility, which input as an argument for the exact IP address or the relative IP Address range you wish to do the Network Scan for and returns all the available IP addresses with their MAC addresses on your current Network.

Abhinandan Khurana 1 Feb 9, 2022
A Python based command line ARP Spoofer utility, which takes input as arguments for the exact target IP and gateway IP for which you wish to Spoof ARP request

A Python based command line ARP Spoofer utility, which takes input as arguments for the exact target IP and gateway IP for which you wish to Spoof ARP request

Abhinandan Khurana 1 Feb 10, 2022