このコミットが含まれているのは:
n9k 2022-03-08 03:38:23 +00:00
コミット 9f79050ccf
3個のファイルの変更89行の追加1行の削除

ファイルの表示

@ -11,6 +11,59 @@ These mirrors also exist:
* <https://gitlab.com/ninya9k/anonstream>
* <https://github.com/ninya9k/anonstream>
## Setup
You must have Python 3.10 at a minimum.
Clone the repo:
```sh
git clone https://git.076.ne.jp/ninya9k/anonstream.git
cd anonstream
```
Install dependencies in a virtual environment:
```sh
python -m venv venv
source venv/bin/activate
python -m pip install -r requirements.txt
```
Before you run it might want to edit [/config.toml][config]:
* `secret_key`:
used for cryptography, make it any long random string
(e.g. `$ dd if=/dev/urandom bs=16 count=1 | base64`)
* `segments/directory`:
directory containing stream segments, the default is `stream/` in
the project root
* `title/file`:
location of the stream title, the default is `title.txt` in the
project root
* `captcha/fonts`:
locations of fonts for the captcha, leaving it blank will use the
default font
Run it:
```sh
python -m uvicorn app:app --port 5051
```
This will start a webserver listening on localhost port 5051.
If you go to `http://localhost:5051` in a regular web browser now
you should see the interface. When you started the webserver some
credentials were printed in the terminal; you can log in with those at
`http://localhost:5051/login` (requires cookies).
The only things left are (1) streaming, and (2) letting other people
access your stream. [/STREAMING.md][streaming] has instructions for
setting up OBS Studio and a Tor onion service. The instructions will
be useful even if you want to use different streaming software and put
your stream on the Internet some other way.
## Copying
anonstream is AGPL 3.0 or later, see

35
STREAMING.md ノーマルファイル
ファイルの表示

@ -0,0 +1,35 @@
### Tor
Install tor and include these lines in your [torrc][torrc]:
```
HiddenServiceDir $PROJECT_ROOT/hidden_service
HiddenServicePort 80 127.0.0.1:5051
```
but replace `$PROJECT_ROOT` with the folder you cloned the git repo
into.
Then reload tor. If everything went well, the directory will have been
created and your onion address will be in
`$PROJECT_ROOT/hidden_service/hostname`.
### OBS Studio
Install OBS Studio. If the autoconfiguration wizard prompts you to
choose a third-party service, ignore it since we're not gonna be doing
that. Click `Settings`.
* Advanced
* Recording
* Filename Formatting: `stream`
* Output
* Output Mode: `Advanced`
* Recording
* Type: `Custom Output (FFmpeg)`
* FFmpeg Output Type: `Output to File`
* File path or URL: (`segments/directory` from the config, but should be an absolute path)
* Container Format: `hls`
* Muxer Settings (if any): `hls_init_time=0 hls_time=2 hls_list_size=120 hls_flags=delete_segments hls_segment_type=fmp4`
* Video Bitrate: `400 Kbps`
[torrc]: https://support.torproject.org/#tbb-editing-torrc

ファイルの表示

@ -1,4 +1,4 @@
secret_key = "test"
secret_key = "place actual secret key here"
[auth]
username = "broadcaster"