<commit_before>OpenShifTor
===========

Tor cartridge for OpenShift. Make your application accessible
via Tor! (You will get cool .onion address.)

![Logo](OpenShifTor.png)

Example
-------

To save you of long preambles, let us just dive into example where
we will create hidden service for `diy`-based application:

~~~~ .bash
appname=hidden
rhc app create "${appname}" --no-git \
    diy \
    'https://raw.githubusercontent.com/xkollar/tor-openshift/master/metadata/manifest.yml' \
    --from-code 'https://github.com/xkollar/openshiftor-example.git'
~~~~

And that is all... you just have to wait till Tor builds and starts for
the first time (this is done asynchronously and it takes some time so
be patient).

Take note of the `.onion` hostname that was generated for your service.
If you forgot that (or you want to supply your own key), appropriate
places to look are `"${OPENSHIFT_TOR_DIR}tor/hidden_service/hostname"`
and `"${OPENSHIFT_TOR_DIR}tor/hidden_service/private_key"`.

If you want to check whether you was successful but you do not want
to install Tor yourselves, you can use some Tor gateway, e.g.
[tor2web.org](https://www.tor2web.org/).

![Screenshot](screenshot.png)

Integration notes
-----------------

When using with your own cartridge make sure that your application
use variables in form `*_PORT` and `*_IP` or `*_ADDRESS` so this
cartridge will know where to forward requests. For example `diy`
cartridge uses `OPENSHIFT_DIY_IP` and `OPENSHIFT_DIY_PORT`.

To prevent Tor from restarting (that causes .hidden site inavailability
for some time) use `keep_tor_running` marker.

~~~~ .bash
touch .openshift/markers/keep_tor_running
git add .openshift/markers/keep_tor_running
git commit -m 'Keep Tor running'
git push
~~~~

Note
----

There is more to Hidden services. Before doing anything,
you should probably educate yourself a little. Good starting points:

* https://www.torproject.org/docs/hidden-services.html.en
* https://www.torproject.org/docs/tor-hidden-service.html.en
* https://blog.torproject.org/blog/hidden-services-need-some-love

Also, when you want to run this gear at servers that are
not yours, be sure to read their terms and conditions, e.g.
[https://www.openshift.com/legal](https://www.openshift.com/legal).
This cartridge is inteded to provide possibility to access your applicateion
via `.onion` hosname, not to hide anything bad.<commit_msg>Polish<commit_after>OpenShifTor
===========

Tor cartridge for OpenShift. Make your application accessible
as a Tor Hidden Service! (You will get cool `.onion` address.)

![Logo](OpenShifTor.png)

Example
-------

To save you of long preambles, let us just dive into example where
we will create hidden service for `diy`-based application:

~~~~ .bash
appname=hidden
rhc app create "${appname}" --no-git \
    diy \
    'https://raw.githubusercontent.com/xkollar/tor-openshift/master/metadata/manifest.yml' \
    --from-code 'https://github.com/xkollar/openshiftor-example.git'
~~~~

And that is all... you just have to wait till Tor builds and starts for
the first time (this is done asynchronously and it takes some time so
be patient).

Take note of the `.onion` hostname that was generated for your service.
If you forgot that (or you want to supply your own key), appropriate
places to look are `"${OPENSHIFT_TOR_DIR}tor/hidden_service/hostname"`
and `"${OPENSHIFT_TOR_DIR}tor/hidden_service/private_key"`.

If you want to check whether you was successful but you do not want
to install Tor yourselves, you can use some Tor gateway, e.g.
[tor2web.org](https://www.tor2web.org/).

![Screenshot](screenshot.png)

Integration notes
-----------------

When using with your own cartridge make sure that your application
use variables in form `*_PORT` and `*_IP` or `*_ADDRESS` so this
cartridge will know where to forward requests. For example `diy`
cartridge uses `OPENSHIFT_DIY_IP` and `OPENSHIFT_DIY_PORT`.

To prevent Tor from restarting (that causes .hidden site inavailability
for some time) use `keep_tor_running` marker.

~~~~ .bash
touch .openshift/markers/keep_tor_running
git add .openshift/markers/keep_tor_running
git commit -m 'Keep Tor running'
git push
~~~~

Note
----

There is more to Hidden services. Before doing anything,
you should probably educate yourself a little. Good starting points:

* https://www.torproject.org/docs/hidden-services.html.en
* https://www.torproject.org/docs/tor-hidden-service.html.en
* https://blog.torproject.org/blog/hidden-services-need-some-love

Also, when you want to run this gear at servers that are
not yours, be sure to read terms and conditions of host, e.g.
[https://www.openshift.com/legal](https://www.openshift.com/legal).
This cartridge is intended to provide possibility to access your application
via `.onion` hostname, not to hide anything bad. Also by running
this service on machine that you are not the only one
to manage, you may expose your users to unpredictable dangers.
{'fraction_non_alphanumeric': 0.1092896174863388, 'fraction_numerical': 0.0008095527221210282, 'mean_word_length': 4.235169491525424, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 16, 'lorem ipsum': 0, 'www.': 10, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1705809', 'n_tokens_mistral': 1516, 'n_tokens_neox': 1452, 'n_words': 577}