[owncloud] Petit hack pour que www-data écrive en tant qu'un autre utilisateur

On monte en sshfs user@127.0.0.1:/home/user/Owncloud /home-owncloud/user pour
www-data quand on essaye d'accéder au dossier /home-owncloud/user en utilisant
une clef ssh commune pour tous les utilistateur uniquement utilisable depuis
127.0.0.1
This commit is contained in:
Valentin Samir 2014-11-18 18:25:25 +01:00
parent bc199ad58d
commit a8f9d9d8b8
7 changed files with 28 additions and 1 deletions

9
Bundler/owncloud.xml Normal file
View file

@ -0,0 +1,9 @@
<Bundle name="owncloud">
<Path name="/home-owncloud" type="directory" />
<Python name="/etc/auto.master"/>
<Path name="/etc/auto.home-owncloud"/>
<Package name="sshfs"/>
<Package name="autofs"/>
<Service name="autofs"/>
</Bundle>

View file

@ -0,0 +1,6 @@
#!/bin/sh
#
# Fichier gere par BCfg2.
chmod 750 /home-owncloud &&
chown www-data:root /home-owncloud &&
echo "-fstype=fuse,port=22,rw,uid=33,gid=33,allow_other,nodev,noatime,delay_connect,reconnect,workaround=all,ConnectTimeout=1,transform_symlinks,idmap=user,intr,bg :sshfs\#$1@127.0.0.1\:/home/$1/OwnCloud"

View file

@ -0,0 +1,3 @@
<FileInfo>
<Info owner='root' group='root' perms='0755'/>
</FileInfo>

View file

@ -162,6 +162,7 @@
profile="true">
<Group name="crans-vm-wheezy"/>
<Group name="home-permanent"/>
<Bundle name="owncloud"/>
<Group name="nginx"/> <!-- Pour owncloud -->
<Group name="php"/> <!-- Pour owncloud -->
</Group>

View file

@ -14,3 +14,5 @@ if has("home") and not has("home-permanent"):
if has("ldapcert"):
mount("/-", "/etc/auto.ldapcert", 600)
if has("owncloud"):
mount("/home-owncloud", "/etc/auto.home-owncloud", 60)

View file

@ -32,6 +32,9 @@ header("Configuration du serveur ssh")
@RSAAuthentication yes
@PubkeyAuthentication yes
if has("owncloud"):
@AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys2 /etc/ssh/authorized_keys
else:
@#AuthorizedKeysFile %h/.ssh/authorized_keys
@# Don't read the user's ~/.rhosts and ~/.shosts files

3
Rules/owncloud.xml Normal file
View file

@ -0,0 +1,3 @@
<Rules priority="1">
<Path name="/home-owncloud" type="directory" owner="www-data" group="root" perms="0750" />
</Rules>