mirror of
https://github.com/alopexc0de/Simple-Bookmarking-Service.git
synced 2024-12-21 14:22:39 +00:00
Load bot info from environment
This commit is contained in:
parent
efcf7f91a1
commit
a356c50ce0
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,3 +4,4 @@
|
||||
*~
|
||||
.vscode
|
||||
.env
|
||||
bot.session
|
||||
|
@ -9,11 +9,18 @@ The production environment will eventually be hosted at [save.c0de.link](https:/
|
||||
This project uses [Pipenv](https://pipenv.readthedocs.io/en/latest/) to manage the dependencies, so install that first after cloning this repository.
|
||||
|
||||
* Install dependencies - `pipenv install`
|
||||
* Create a Telegram bot (see Creating a Telegram Bot)
|
||||
* Enter the environment - `pipenv shell`
|
||||
* Start the server - `python server.py`
|
||||
* Start the server - `bash run.sh`
|
||||
|
||||
The server will be running on `http://localhost:8080/`
|
||||
|
||||
### Creating a Telegram bot
|
||||
|
||||
1. Login to [my.telegram.org/apps](https://my.telegram.org/apps) and create a Web App - You will need the `api_id` and `api_hash`
|
||||
1. Message the [BotFather](https://t.me/BotFather) to get an `api_token`
|
||||
1. Copy `sample.env` to `.env` and fill in the details from the previous steps
|
||||
|
||||
## Available Requests
|
||||
|
||||
Now that you have a running server, you can issue requests via a web browser, curl, wget, etc to the following endpoints:
|
||||
|
7
run.sh
Normal file
7
run.sh
Normal file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
# Copyright 2020 - David Todd (c0de@c0defox.es)
|
||||
# Licensed under the MIT License (https://opensource.org/licenses/MIT)
|
||||
# Part of the Simple Bookmark Service
|
||||
|
||||
source .env
|
||||
python server.py
|
8
sample.env
Normal file
8
sample.env
Normal file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
# Copyright 2020 - David Todd (c0de@c0defox.es)
|
||||
# Licensed under the MIT License (https://opensource.org/licenses/MIT)
|
||||
# Part of the Simple Bookmark Service
|
||||
|
||||
export telethon_api_id=
|
||||
export telethon_api_hash=
|
||||
export telethon_token=
|
Loading…
Reference in New Issue
Block a user