Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Sysadmin
A daemon to poll rsync and sync neon images.
Commits
aecd8b0b
Commit
aecd8b0b
authored
Dec 06, 2017
by
Harald Sitter
💣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rip out chown
it shouldn't be necessary and xenial's go has no User thingy yet
parent
d87ac60f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
27 deletions
+0
-27
main.go
main.go
+0
-27
No files found.
main.go
View file @
aecd8b0b
...
...
@@ -27,7 +27,6 @@ import (
"io"
"os"
"os/exec"
"os/user"
"sync"
"github.com/coreos/go-systemd/activation"
...
...
@@ -38,31 +37,6 @@ import (
)
var
rsyncMutex
sync
.
Mutex
var
chownUser
,
chownGroup
=
func
()
(
string
,
string
)
{
wwwGroupName
:=
"www-data"
u
,
err
:=
user
.
Current
()
if
err
!=
nil
{
panic
(
err
)
}
isMemberOfWWW
:=
false
groupIds
,
err
:=
u
.
GroupIds
()
if
err
!=
nil
{
panic
(
err
)
}
for
_
,
gid
:=
range
groupIds
{
group
,
err
:=
user
.
LookupGroupId
(
gid
)
if
err
!=
nil
{
continue
}
if
group
.
Name
==
wwwGroupName
{
isMemberOfWWW
=
true
}
}
if
isMemberOfWWW
{
return
u
.
Username
,
wwwGroupName
}
panic
(
"Current user is not member of "
+
wwwGroupName
)
}()
// Event is a helper struct to queue up events for streaming.
type
Event
struct
{
...
...
@@ -127,7 +101,6 @@ func v1Sync(c *gin.Context) {
// cmd := exec.Command("ls", "-lah")
cmd
:=
exec
.
Command
(
"/usr/bin/rsync"
,
"-rlptv"
,
"--info=progress"
,
"--delete"
,
"--chown="
+
chownUser
+
":"
+
chownGroup
,
"rsync://racnoss.kde.org/applicationdata/neon"
,
"/mnt/volume-do-cacher-storage/files.kde.org/"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment