10 KiB
🐲 dragonion-server
Websocket chat server on-top of onion network for dragonion
📜 Table of Contents
🛣️ Usage plan
- Check [Table of Contents] (optionally)
- Read [About] (optionally)
- Read [Usage guide]
- Go to [Configuration guide], choose your platform, navigate to opted installation method (they are arranged from most to least recommended)
- Install pre-requirements, install app, run it, checking [usage guide] if needed
🔖️ About
A configured and running dragonion-server is required for dragonion chat to work. Built on-top of dragonion-core, it implements work with the protocol and websockets server, that broadcasts and handles messages.
💻 Usage
To use dragonion-server, you need to install it first. To do this, you can visit [Configuration guide].
You can talk with this repo using collectivai chat. [Visit this page] and discuss your questions. AI will respond with up-to-date information using the data of this repository.
dragonion-server is controlled from cli. When you run it in some location on your
disk, data folder with tor and data.storage config file are created. You should
keep them safe to avoid data and key leaks. Using data.storage file anyone can
start server on your onion service id.
Guide sections:
Getting help
To check all available commands, you can run
dragonion-server --help
To get help for specific command, you should run
dragonion-server command-name --help
where command-name is name of existing command, for example
dragonion-server service-run --help
Running a service
To use dragonion chat, you need to run onion service with dragonion-server. In this situation, service is an onion service, an anonymous network service that is exposed over the Tor network. dragonion-server runs service, that points to local endpoint with running websocket server.
To run a service, you should run
dragonion-server service-run --name SERVICE_NAME
Available command options:
-nor--nameis required and used to specify service name. If service with this name exists in config, it will run with saved parameters (like port), and if not - new will be created-por--portis used to specify port, where local server will be started. It is saved to config file. Remember, that it isn't only port, that server will take. You cannot control tor ports using this option. If not specified, random available will be picked.-wt(--without-tor) and-ot(--only-tor) are used mostly for development, to separate the processes of the proxy and the server itself
After running this command, tor will start, and you will see that service is now
available on onion host. To connect to service, you should share two colorful
strings (orange and purple), that are service id and auth string, to your users.
Also, sharing SERVICE_NAME.auth file, that is created in working dir can be more
convenient for some users as connect option, so you should share it also.
Updating a service
You may have a situation where you need to update or write a service without actually starting it. In such cases, you can use the command provided below. It allows you to generate an id-key pair for a new name and overwrite the port for an existing name.
To run update a service, you should run
dragonion-server service-write --name SERVICE_NAME --port PORT
Available command options:
-nor--nameis required and used to specify service name to write.-por--portis required here and will rewrite port in settings.
Removing a service
In some situations, you may need to remove the service. In this case, you will no
longer be able to run the server on the same id due to the nature of the tor
network, so be careful with this. Also, do not forget that the loss of the
.storage (config file) means no access to the service ID-key pair, which also
means the loss of the ability to start the server without the possibility of
recovery.
To run update a service, you should run
dragonion-server service-remove --name SERVICE_NAME
Available command options:
-nor--nameis required and used to specify service name to remove.
Remember, if you still have questions about the operation of the server, you can [discuss them with AI] or create an issue.
⚙️ Configuration guide
Windows
Pre-requirements:
- [Python3] (with pip)
- [Git]
- [Windows terminal] is recommended, [install it from Microsoft Store]
Install options:
Use pipx
pipx is a tool to help you install and run end-user applications written in Python. It creates isolated environments for each application to install it.
Fresh installation:
pip install pipx
pipx ensurepath
pipx install git+https://github.com/kotikotprojects/dragonion-server
Launch options:
- After fresh install, re-run your shell, than run
dragonion-server(it is in your PATH because of pipx)
Updating:
pipx upgrade dragonion-server
Clone repo and use venv
Fresh installation:
git clone https://github.com/kotikotprojects/dragonion-server
cd dragonion-server
python -m venv venv
venv\Scripts\activate
pip install .
Launch options:
- After fresh install, run
dragonion-serverin environment (orpython -m dragonion-server) cdto app folder, runvenv\Scripts\activate, thandragonion-serverin environment (python -m dragonion-server)- Run
dragonion-server.exefromvenv\Scripts. You can also copy it anywhere you want, but remember that data and config files are saved near executable file
Updating:
cd to app directory, than
git pull
If there are new changes, run
venv\Scripts\activate
pip install .
Linux
Pre-requirements (install them via your package manager):
For x64/x86 systems:
python3python3-pippython3-venvgit
For arm (arm64, aarch64) systems:
- All from above
tor
Install options:
Use pipx
pipx is a tool to help you install and run end-user applications written in Python. It creates isolated environments for each application to install it.
Install pipx:
apt install pipx
or
pip install pipx
Fresh installation:
pipx ensurepath
pipx install git+https://github.com/kotikotprojects/dragonion-server
You may use python3 -m pipx for this
Launch options:
- After fresh installation relaunch your shell (if pipx was previously installed,
you can skip this), than run
dragonion-server(it is in your env because of pipx)
Updating:
pipx upgrade dragonion-server
Clone repo and use venv
Fresh installation:
git clone https://github.com/kotikotprojects/dragonion-server
cd dragonion-server
python3 -m venv venv
. venv/bin/activate
pip install .
Launch options:
- After fresh install, run
dragonion-serverin environment (orpython3 -m dragonion-server) cdto app folder, run. venv/bin/activate, thandragonion-serverin environment (python3 -m dragonion-server)- Run
dragonion-serverfromvenv\bin. You can also copy it anywhere you want, but remember that data and config files are saved near executable file
Updating:
cd to app directory, than
git pull
If there are new changes, run
. venv/bin/activate
pip install .
MacOS
Pre-requirements (install them via your package manager):
python3python3-pippython3-venvgit
Install options:
Use pipx
pipx is a tool to help you install and run end-user applications written in Python. It creates isolated environments for each application to install it.
Install pipx:
brew install pipx
or
pip3 install pipx
Fresh installation:
pipx ensurepath
pipx install git+https://github.com/kotikotprojects/dragonion-server
You may use python3 -m pipx for this
Launch options:
- After fresh installation relaunch your shell (if pipx was previously installed,
you can skip this), than run
dragonion-server(it is in your env because of pipx)
Updating:
pipx upgrade dragonion-server
Clone repo and use venv
Fresh installation:
git clone https://github.com/kotikotprojects/dragonion-server
cd dragonion-server
python3 -m venv venv
. venv/bin/activate
pip install .
Launch options:
- After fresh install, run
dragonion-serverin environment (orpython3 -m dragonion-server) cdto app folder, run. venv/bin/activate, thandragonion-serverin environment (python3 -m dragonion-server)- Run
dragonion-serverfromvenv\bin. You can also copy it anywhere you want, but remember that data and config files are saved near executable file
Updating:
cd to app directory, than
git pull
If there are new changes, run
. venv/bin/activate
pip install .
📃 Credits
- [OnionShare project] - code inspiration for integrating application with tor