2013-10-04 02:06:42 +02:00
|
|
|
== SaferSharing ==
|
|
|
|
|
2013-10-04 02:32:48 +02:00
|
|
|
To avoid legal steps because you are hosting to everyone:
|
2013-10-04 02:06:42 +02:00
|
|
|
|
|
|
|
* get nginx with auth_base
|
|
|
|
* proxy around
|
|
|
|
* modify your fw a bit
|
|
|
|
|
|
|
|
==== config nginx ====
|
2013-10-04 02:53:36 +02:00
|
|
|
as root
|
2013-10-04 02:06:42 +02:00
|
|
|
|
2013-10-04 02:55:24 +02:00
|
|
|
<source lang="bash">vi /etc/nginx/sites-available/default</source>
|
|
|
|
<source lang="bash">cat /etc/nginx/sites-available/default</source>
|
2013-10-04 02:32:48 +02:00
|
|
|
<pre>
|
2013-10-04 02:06:42 +02:00
|
|
|
server {
|
|
|
|
listen 80 default_server;
|
|
|
|
listen [::]:80 default_server ipv6only=on;
|
|
|
|
|
|
|
|
root /usr/share/nginx/html;
|
|
|
|
index index.html index.htm;
|
|
|
|
|
|
|
|
# Make site accessible from http://localhost/
|
|
|
|
server_name localhost;
|
|
|
|
|
|
|
|
location / {
|
|
|
|
auth_basic "Sharing is Caring";
|
|
|
|
auth_basic_user_file /etc/nginx/htpasswd;
|
|
|
|
proxy_pass http://localhost:8000;
|
|
|
|
proxy_buffering off;
|
|
|
|
}
|
|
|
|
}
|
2013-10-04 02:43:25 +02:00
|
|
|
</pre>
|
2013-10-04 02:06:42 +02:00
|
|
|
|
2013-10-04 02:43:25 +02:00
|
|
|
<source lang="bash">vi /etc/nginx/htpasswd</source>
|
|
|
|
<source lang="bash">cat /et/nginx/htpasswd</source>
|
2013-10-04 02:32:48 +02:00
|
|
|
<pre>
|
2013-10-04 02:43:25 +02:00
|
|
|
user:yoursavepassword
|
2013-10-04 02:32:48 +02:00
|
|
|
</pre>
|
2013-10-04 02:43:25 +02:00
|
|
|
|
|
|
|
In addition we used <source lang="bash">openssl passwd -crypt yoursupersafepassword</source> instead of plaintext password.
|
2013-10-04 02:06:42 +02:00
|
|
|
|
|
|
|
==== sharing2 conf ====
|
2013-10-04 02:53:36 +02:00
|
|
|
as user
|
2013-10-04 02:43:25 +02:00
|
|
|
<source lang="bash">vi /path/to/sharing2/main.hs</source>
|
|
|
|
<source lang="bash">cat /path/to/sharing2/main.hs</source>
|
2013-10-04 02:32:48 +02:00
|
|
|
<pre>
|
2013-10-04 02:06:42 +02:00
|
|
|
main :: IO ()
|
|
|
|
main = app >>=
|
|
|
|
runSettings (defaultSettings
|
|
|
|
{ settingsHost = HostIPv6
|
|
|
|
, settingsPort = 8000
|
|
|
|
, ...
|
2013-10-04 02:32:48 +02:00
|
|
|
})
|
|
|
|
</pre>
|
|
|
|
|
2013-10-04 02:06:42 +02:00
|
|
|
==== modify iptables ====
|
2013-10-04 02:53:36 +02:00
|
|
|
as root
|
2013-10-04 02:43:25 +02:00
|
|
|
<source lang="bash">iptables -t filter -A INPUT ! -s 127.0.0.1 -p tcp --dport 8000 -j DROP</source>
|
2013-10-04 02:44:21 +02:00
|
|
|
<source lang="bash">ip6tables -t filter -A INPUT ! -s ::1 -p tcp --dport 8000 -j DROP</source>
|
2013-10-04 02:06:42 +02:00
|
|
|
|
|
|
|
== Na toll, aber wie ist der Zugang zu Cider nun? ==
|
|
|
|
|
|
|
|
wie auf allen anderen Maschinen auch
|
2013-10-04 02:32:48 +02:00
|
|
|
|
2014-02-19 00:36:33 +01:00
|
|
|
==== MPD (Music Player Daemon) mit NCMPCPP ====
|
|
|
|
|
|
|
|
ssh k-ot@cider
|
|
|
|
|
|
|
|
ncmpcpp ausführen, Musik Quelle ist das eingebundene SMB Feile Verzeichnis
|
|
|
|
|
|
|
|
//feile/space /feile_space cifs credentials=/.feile_space_smbcredentials,uid=1002,gid=1002,iocharset=utf8 0 0
|
|
|
|
|
|
|
|
|
2013-10-04 02:32:48 +02:00
|
|
|
[[Kategorie:Infrastruktur]]
|