Bläddra i källkod

Use the i2p user for bdsmail daemon

Bob Mottram 7 år sedan
förälder
incheckning
97d6524c90
1 ändrade filer med 7 tillägg och 10 borttagningar
  1. 7
    10
      src/freedombone-app-bdsmail

+ 7
- 10
src/freedombone-app-bdsmail Visa fil

86
 
86
 
87
     # update to the next commit
87
     # update to the next commit
88
     set_repo_commit /etc/bdsmail "bdsmail commit" "$BDSMAIL_COMMIT" $BDSMAIL_REPO
88
     set_repo_commit /etc/bdsmail "bdsmail commit" "$BDSMAIL_COMMIT" $BDSMAIL_REPO
89
-    chown -R bdsmail:bdsmail /etc/bdsmail
89
+    chown -R i2psvc:i2psvc /etc/bdsmail
90
 }
90
 }
91
 
91
 
92
 function backup_local_bdsmail {
92
 function backup_local_bdsmail {
118
             fi
118
             fi
119
             cp -rp $temp_restore_dir/* $bdsmail_dir
119
             cp -rp $temp_restore_dir/* $bdsmail_dir
120
         fi
120
         fi
121
-        chown -R bdsmail:bdsmail $bdsmail_dir
121
+        chown -R i2psvc:i2psvc $bdsmail_dir
122
         rm -rf $temp_restore_dir
122
         rm -rf $temp_restore_dir
123
     fi
123
     fi
124
 
124
 
154
             fi
154
             fi
155
             cp -rp $temp_restore_dir/* $bdsmail_dir
155
             cp -rp $temp_restore_dir/* $bdsmail_dir
156
         fi
156
         fi
157
-        chown -R bdsmail:bdsmail $bdsmail_dir
157
+        chown -R i2psvc:i2psvc $bdsmail_dir
158
         rm -rf $temp_restore_dir
158
         rm -rf $temp_restore_dir
159
     fi
159
     fi
160
 
160
 
167
         systemctl disable bdsmail
167
         systemctl disable bdsmail
168
         rm /etc/systemd/system/bdsmail.service
168
         rm /etc/systemd/system/bdsmail.service
169
     fi
169
     fi
170
-    userdel -r bdsmail
171
 
170
 
172
     remove_i2p
171
     remove_i2p
173
     remove_app bdsmail
172
     remove_app bdsmail
202
     git checkout $BDSMAIL_COMMIT -b $BDSMAIL_COMMIT
201
     git checkout $BDSMAIL_COMMIT -b $BDSMAIL_COMMIT
203
     set_completion_param "bdsmail commit" "$BDSMAIL_COMMIT"
202
     set_completion_param "bdsmail commit" "$BDSMAIL_COMMIT"
204
 
203
 
205
-    useradd -d /etc/bdsmail -s /bin/false bdsmail
206
-
207
     make GOROOT=/home/go/go${GO_VERSION}
204
     make GOROOT=/home/go/go${GO_VERSION}
208
     if [ ! -f /etc/bdsmail/bin/bdsconfig ]; then
205
     if [ ! -f /etc/bdsmail/bin/bdsconfig ]; then
209
         echo $'Unable to make bdsmail'
206
         echo $'Unable to make bdsmail'
232
     echo '' >> /etc/systemd/system/bdsmail.service
229
     echo '' >> /etc/systemd/system/bdsmail.service
233
     echo '[Service]' >> /etc/systemd/system/bdsmail.service
230
     echo '[Service]' >> /etc/systemd/system/bdsmail.service
234
     echo 'Type=simple' >> /etc/systemd/system/bdsmail.service
231
     echo 'Type=simple' >> /etc/systemd/system/bdsmail.service
235
-    echo 'User=bdsmail' >> /etc/systemd/system/bdsmail.service
236
-    echo 'Group=bdsmail' >> /etc/systemd/system/bdsmail.service
232
+    echo 'User=i2psvc' >> /etc/systemd/system/bdsmail.service
233
+    echo 'Group=i2psvc' >> /etc/systemd/system/bdsmail.service
237
     echo 'WorkingDirectory=/etc/bdsmail' >> /etc/systemd/system/bdsmail.service
234
     echo 'WorkingDirectory=/etc/bdsmail' >> /etc/systemd/system/bdsmail.service
238
     echo 'ExecStart=/etc/bdsmail/bin/maild /etc/bdsmail/config.ini' >> /etc/systemd/system/bdsmail.service
235
     echo 'ExecStart=/etc/bdsmail/bin/maild /etc/bdsmail/config.ini' >> /etc/systemd/system/bdsmail.service
239
     echo 'Restart=always' >> /etc/systemd/system/bdsmail.service
236
     echo 'Restart=always' >> /etc/systemd/system/bdsmail.service
240
-    echo 'Environment="USER=bdsmail"' >> /etc/systemd/system/bdsmail.service
237
+    echo 'Environment="USER=i2psvc"' >> /etc/systemd/system/bdsmail.service
241
     echo '' >> /etc/systemd/system/bdsmail.service
238
     echo '' >> /etc/systemd/system/bdsmail.service
242
     echo '[Install]' >> /etc/systemd/system/bdsmail.service
239
     echo '[Install]' >> /etc/systemd/system/bdsmail.service
243
     echo 'WantedBy=multi-user.target' >> /etc/systemd/system/bdsmail.service
240
     echo 'WantedBy=multi-user.target' >> /etc/systemd/system/bdsmail.service
244
     systemctl enable bdsmail
241
     systemctl enable bdsmail
245
-    chown -R bdsmail:bdsmail /etc/bdsmail
242
+    chown -R i2psvc:i2psvc /etc/bdsmail
246
     systemctl start bdsmail
243
     systemctl start bdsmail
247
 
244
 
248
     echo '#!/usr/bin/env python2' > /etc/bdsmail/get_address
245
     echo '#!/usr/bin/env python2' > /etc/bdsmail/get_address