Skip to content

Commit

Permalink
Firmware Mirror
Browse files Browse the repository at this point in the history
  • Loading branch information
Grotax committed May 26, 2019
1 parent 9c97315 commit 30228de
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 0 deletions.
60 changes: 60 additions & 0 deletions configs/nginx-firmware.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#
# Firmware Mirror configuration
#
server {
listen 80;
listen [::]:80;

#
# SSL configuration
#
#listen 443 ssl;
#listen [::]:443 ssl;
#ssl_certificate
#ssl_certificate_key
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
# ssl_ciphers HIGH:!aNULL:!MD5;

root /mnt/firmware;

index index.html index.htm index.nginx-debian.html;

server_name firmware.freifunk-suedholstein.de firmware.ffshev.de fw.ffshev.de;

location / {
try_files $uri $uri/ =404;
autoindex on;

#
# Wide-open CORS config for nginx
#
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
#
# Custom headers and headers various browsers *should* be OK with but aren't
#
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
#
# Tell client that this pre-flight info is valid for 20 days
#
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}

if ($request_method = 'POST') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
}
if ($request_method = 'GET') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
}
}
}
45 changes: 45 additions & 0 deletions firmware.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,51 @@ Dort führen wir zum ersten mal das :code:`build.py` Skript aus (Zeile 3).

In Zeile 4 besteht der unterschied dann nur in dem :code:`-c build` (wir wollen nun bauen) und dem :code:`-t "ar71xx-tiny"` (hier wird nur für ein target gebaut).

Mirror
------
Die Firmware wird zentral auf einer Storage Box von Hetzner gehostet. Diese Storage Box wird als Netzwerklaufwerk eingebunden.

Als root-User oder mit sudo

::

nano /etc/fstab

Die Datei um folgenden Eintrag ergänzen:

::

//u205465.your-storagebox.de/backup /mnt/firmware cifs iocharset=utf8,rw,credentials=/etc/firmware-credentials.txt,uid=0,gid=0,file_mode=0644,dir_mode=0744 0 0

Dann erstellen wir die Credentials-Datei.
::

nano /etc/firmware-credentials.txt

Inhalt so wie hier Daten gibts beim NOC

::

username=
password=

Rechte anpassen, cifs installieren und einbinden
::

chmod 600 /etc/firmware-credentials.txt
apt install cifs-utils
systemctl daemon-reload
systemctl restart remote-fs.target

Jetzt hast du ein Netzwerklaufwerk :)

::

ls /mnt/firmware

Für nginx gibt es eine vorbereitete Konfiguration.

.. literalinclude:: configs/nginx-firmware.conf

jenkins
-------
Expand Down

0 comments on commit 30228de

Please sign in to comment.