Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wdbm/ovipositor
Flask link shortening service
https://github.com/wdbm/ovipositor
database database-sqlite flask yourls yourls-database
Last synced: 11 days ago
JSON representation
Flask link shortening service
- Host: GitHub
- URL: https://github.com/wdbm/ovipositor
- Owner: wdbm
- License: gpl-3.0
- Created: 2017-02-05T01:29:27.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-14T18:20:40.000Z (over 6 years ago)
- Last Synced: 2024-12-15T06:08:40.177Z (about 1 month ago)
- Topics: database, database-sqlite, flask, yourls, yourls-database
- Language: Python
- Size: 1.1 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ovipositor
Flask link-shortening service and database system
![](https://raw.githubusercontent.com/wdbm/ovipositor/master/media/ovipositor.png)
# credits
- name by Ellis Kay
# introduction
Ovipositor is a link-shortener web program. A long URL is entered, together with an optional shortlink and an optional comment. When creating a shortlink, the long URL and the shortlink are saved to a database. When an attempt is made to use a shortlink, the specified shortlink is searched for in the database and, if the shortlink is in the database, there is a redirect to its corresponding long URL.
![](https://raw.githubusercontent.com/wdbm/ovipositor/master/media/screenshot.png)
# setup
```Bash
sudo apt install sqlite
sudo pip install ovipositor
```# Flask
```Bash
while true; do
ovipositor --home="index.html"
done
```# Gunicorn
```Bash
sudo gunicorn --workers=1 "ovipositor.__init__:WSGI(argv=['--home=index.html'])" --bind=0.0.0.0:443 --certfile=/home/user/certificates/fullchain.pem --keyfile=/home/user/certificates/privkey.pem
```# ovipositor database structure
There is one table in an ovipositor database called "shortlinks". This table has 6 fields:
|**field**|**description** |
|---------|-------------------------------------------|
|comment |shortlink descriptive comment |
|count |shortlink usage count |
|IP |IP address that created the shortlink |
|URL |long URL to which the shortlink corresponds|
|shortlink|shortlink text |
|timestamp|shortlink creation timestamp |# changing from YOURLS to ovipositor
An export dump should be made of the YOURLS MySQL database and the dump should be converted to an SQLite3 database. This can be done using [mysql2sqlite](https://github.com/dumblob/mysql2sqlite).
The YOURLS SQLite database then can be converted to an ovipositor database using the script `convert_YOURLS_SQLite_database_to_ovipositor_database.py`.
```Bash
convert_YOURLS_SQLite_database_to_ovipositor_database.py --helpconvert_YOURLS_SQLite_database_to_ovipositor_database.py \
--database_YOURLD=linkdb.db \
--database_ovipositor=ovipositor.db
```The YOURLS database contains three tables, "yourls_url", "sqlite_sequence" and "yourls_options". These tables have the following fields:
- yourls_url
- clicks
- ip
- keyword
- timestamp
- title
- url
- sqlite_sequence
- name
- seq
- yourls_options
- option_id
- option_name
- option_valueIn changing from YOURLS to ovipositor, the following database table and field conversions are made:
|**YOURLS** |**ovipositor** |
|-------------------------------|-------------------------------|
|yourls_url |shortlinks |
|clicks |count |
|ip |IP |
|keyword |shortlink |
|url |URL |
|timestamp (`datetime.datetime`)|timestamp (`datetime.datetime`)|
|title |comment |