|
| 1 | +Recovery Source: Services |
| 2 | +========================= |
| 3 | + |
| 4 | +This repository provides a "standardized" solution to test, deploy, and maintain |
| 5 | +various web "services" provided by [Recovery Source](https://handbook.recoverysource.net/). |
| 6 | + |
| 7 | +Basic Workflows |
| 8 | +--------------- |
| 9 | + |
| 10 | +To Do ... |
| 11 | + |
| 12 | +Repository Structure |
| 13 | +-------------------- |
| 14 | + |
| 15 | +The structure of this repository: |
| 16 | + |
| 17 | +- ``Makefile``: Convenient helper tasks |
| 18 | +- ``data/``: Primary source of data (all known 12-Step groups) |
| 19 | +- ``sync/``: Python3 module that collects and re-mangles data |
| 20 | +- ``web_index/``: Hugo-based website that hosts https://sober.page |
| 21 | +- ``ansible/``: Used for configuration management (deploy, maintain, etc.) |
| 22 | +- ``test/``: Data used for automated testing |
| 23 | + |
| 24 | +Web Index |
| 25 | +--------- |
| 26 | + |
| 27 | +Sober Pages service as a directory services for 12-step focused websites and |
| 28 | +aims to provide support for basic maintenance tasks. |
| 29 | + |
| 30 | +See this website running at https://sober.page/. |
| 31 | + |
| 32 | +Source Data |
| 33 | +----------- |
| 34 | + |
| 35 | +Everything the Recovery Source project knows about 12-Step groups. |
| 36 | + |
| 37 | +### Data Format |
| 38 | + |
| 39 | +**Location:** ``data/domains/<group>.yaml`` |
| 40 | + |
| 41 | +**Format [[YAML](https://handbook.recoverysource.net/essentials/yaml.html)]:** |
| 42 | +``` |
| 43 | +<subdomain>: |
| 44 | + title: website title |
| 45 | + keywords: list, of, regions |
| 46 | + target: <URL> |
| 47 | + type: forward OR cname |
| 48 | + feed: <type>^<URL>[^<options>] |
| 49 | +``` |
| 50 | + |
| 51 | +**Required:** subdomain, title, target |
| 52 | + |
| 53 | +**Rules:** |
| 54 | + |
| 55 | +- ``data/domains/*.yaml`` MUST be [valid YAML](https://yaml-online-parser.appspot.com/) |
| 56 | +- [``title``, ``keywords``] may be mixed-case, all other fields must be lower-case |
| 57 | +- ``target`` should be the shortest functional URL (without |
| 58 | +[path/query/fragment](https://handbook.recoverysource.net/essentials/websites.html#url)) |
| 59 | +- ``target`` should include www if upstream redirects to this address |
| 60 | +- ``feed`` may be a [YAML list](https://handbook.recoverysource.net/essentials/yaml.html) |
| 61 | +of feed locations (type+url) |
| 62 | +- ``subdomain`` is limited to one (1) per ``target`` |
| 63 | +- ``subdomain`` format should follow ``[type][area]-[district]`` (e.g. aa0-5) |
| 64 | +- ``subdomain`` may append characters to resolve conflicts (e.g. aa1-4north) |
| 65 | +- ``subdomain`` should use the lowest represented district as canonical |
| 66 | +- ``subdomain`` can be used as a SP alias to redirect additional-represented districts |
| 67 | +- ``feed/type`` must be one of [``aamod``, ``tsml``] |
| 68 | + |
| 69 | +Sync |
| 70 | +---- |
| 71 | + |
| 72 | +Data synchronization is done using the ``sync`` python module. |
| 73 | + |
| 74 | +**$ cd services && python3 -m sync -h**: |
| 75 | +``` |
| 76 | +usage: python3 -m sync [-h] [actions] <options> |
| 77 | +
|
| 78 | +Synchronize sober.page data with various destinations |
| 79 | +
|
| 80 | +options: |
| 81 | + -h, --help show this help message and exit |
| 82 | + -H <path> Path to source data (hugo format) |
| 83 | + -w <path> Local workspace used for importing/caching data |
| 84 | + -l <level> Log level (DEBUG, INFO*, WARNING, ERROR) |
| 85 | +
|
| 86 | +actions[*]: |
| 87 | + -m <path> Generate nginx map file at <path> |
| 88 | + -z <zone>:<path> Generate bind9 zone (db) at <path> |
| 89 | +
|
| 90 | +[*] At least one script action must be specified. |
| 91 | +``` |
0 commit comments