Skip to content
Snippets Groups Projects
Commit a5458815 authored by MyIgel's avatar MyIgel :fire:
Browse files

API: Community: Fetch from github

parent cec76528
Branches
No related tags found
1 merge request!141API: Community: Fetch from github
Pipeline #
{
"name": "Freifunk Frankfurt am Main",
"url": "https://ffm.freifunk.net",
"location": {
"city": "Frankfurt am Main",
"country": "DE",
"lat": 50.110556,
"lon": 8.682222,
"address": {
"Name": "Depot 1899",
"Street": "Textorstrasse 33",
"Zipcode": "60594"
}
},
"contact": {
"email": "info@wifi-frankfurt.de",
"irc": "irc://irc.hackint.org#ffffm",
"ml": "user@wifi-frankfurt.de",
"twitter": "@FreiFunkFFM"
},
"state": {
"nodes": 596,
"focus": [
"infrastructure/backbone",
"Public Free Wifi",
"Social Community Building",
"Local services and content",
"Free internet access"
],
"lastchange": "2017-05-14T11:35:32.343Z"
},
"timeline": [
{
"description": "512 Knoten online",
"timestamp": "2017-01-13"
},
{
"description": "Babel / l3roamd Gluon Intergations Projekt gewinnt den 3. Platz beim Thomas-Krenn-Award 2017",
"timestamp": "2017-03-12",
"url": "https://www.thomas-krenn.com/de/tkmag/allgemein/zammad-home-assistant-und-freifunk-das-sind-die-gewinner-des-thomas-krenn-awards-2017/"
},
{
"description": "IPv6 im FFFFM Netz",
"timestamp": "2017-03-13"
}
],
"feeds": [
{
"name": "ffm.freifunk.net",
"category": "blog",
"type": "RSS",
"url": "https://ffm.freifunk.net/feed/"
},
{
"name": "calendar",
"category": "ics",
"type": "ics",
"url": "https://ffm.freifunk.net/?plugin=all-in-one-event-calendar&controller=ai1ec_exporter_controller&action=export_events&no_html=true"
}
],
"nodeMaps": [
{
"url": "https://map.ffm.freifunk.net/",
"interval": "1",
"technicalType": "meshviewer",
"mapType": "geographical"
},
{
"url": "https://yanic.ffm.freifunk.net/legacy/nodes.json",
"interval": "1",
"technicalType": "meshviewer",
"mapType": "list/status"
}
],
"support": {
"club": {
"name": "Freifunk Frankfurt am Main e.V.",
"street": "Postfach 160214",
"zip": "60065",
"city": "Frankfurt am Main",
"email": "vorstand@wifi-frankfurt.de",
"board": [
"Christof Schulze",
"Markus M. May",
"Magnus Frühling"
]
},
"donations": {
"bankaccount": {
"IBAN": "DE50500502010200568663",
"BIC": "HELADEF1822",
"usage": "Spende"
}
}
},
"techDetails": {
"firmware": {
"name": "ffffm",
"url": "https://ffm.freifunk.net/firmware/",
"docs": "https://ffm.freifunk.net/mitmachen/",
"vpnaccess": "automatic"
},
"dns": [
{
"domainname": ".ffffm",
"nameserver": [
"10.126.255.14"
]
}
],
"networks": {
"ipv6": [
{
"network": "fddd:5d16:b5dd::/48"
},
{
"network": "2a06:8187:fb00::/40"
}
],
"ipv4": [
{
"network": "10.126.0.0/16"
}
]
},
"routing": [
"Babel",
"batman-adv"
],
"updatemode": [
"manual",
"autoupdate"
],
"legals": [
"vpnnational",
"vpninternational",
"institutions"
]
},
"api": "0.4.14"
}
{% set api_domain = "api.ffm.freifunk.net" %}
{% set api_update_community_command = "(/home/freifunk/update-nodes.sh '/srv/www/{{ api_domain }}/htdocs/ff-frankfurt.json' 2>&1)" %}
{% set api_community_json = "/var/lib/{{ api_domain }}-community" %}
create_srv_www_api:
api_create_srv_www_community_api:
file.directory:
- user: www-data
- group: www-data
- name: /srv/www/{{ api_domain }}/htdocs
place_api_file:
file.managed:
- name: /srv/www/{{ api_domain }}/htdocs/ff-frankfurt.json
- source: salt://api/files/ff-frankfurt.json
- user: freifunk
api_update_community_repository:
git.latest:
- name: https://github.com/freifunk-ffm/directory.api.freifunk.net.git
- target: {{ api_community_json }}
- user: www-data
- group: www-data
- force_fetch: True
- force_reset: True
- require:
- user: freifunk
- pkg: git
- file: api_create_srv_www_community_api
- onchanges:
- cmd: {{ api_run_update_community_json }}
place_api_updater_file:
api_symlink_community_json:
file.symlink:
- name: /srv/www/{{ api_domain }}/htdocs/ff-frankfurt.json
- target: {{ api_community_json }}/ff-frankfurt.json
- require:
- file: api_create_srv_www_community_api
- git: api_update_community_repository
api_place_community_updater_script:
file.managed:
- name: /home/freifunk/update-nodes.sh
- source: salt://api/files/update-nodes.sh
......@@ -28,12 +43,19 @@ place_api_updater_file:
- curl
- jq
update_api_crontab:
api_update_community_crontab:
cron.present:
- identifier: api-updater
- user: freifunk
- minute: '*/5'
- name: (/home/freifunk/update-nodes.sh "/srv/www/{{ api_domain }}/htdocs/ff-frankfurt.json" 2>&1)
- name: {{ api_update_community_command }}
- require:
- user: freifunk
- file: /home/freifunk/update-nodes.sh
- file: api_place_community_updater_script
- file: api_symlink_community_json
api_run_update_community_json:
cmd.run:
- name: {{ api_update_community_command }}
- require:
- file: api_place_community_updater_script
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment