mirror of
https://github.com/syncthing/syncthing.git
synced 2026-01-08 22:09:16 -05:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b48d9a3a82 | ||
|
|
0255311bbe | ||
|
|
bd91519df9 | ||
|
|
58fe8b0cf1 | ||
|
|
064aa64f20 | ||
|
|
d9f79853fb | ||
|
|
2e68ee5c8b | ||
|
|
a9544ca890 |
@@ -27,6 +27,12 @@ Getting Started
|
||||
|
||||
Take a look at the [getting started guide](http://discourse.syncthing.net/t/46).
|
||||
|
||||
There are a few examples for keeping syncthing running in the background
|
||||
on your system in [the etc directory](https://github.com/syncthing/syncthing/blob/master/etc).
|
||||
|
||||
There is an IRC channel, `#syncthing` on Freenode, for talking directly
|
||||
to developers and users (when awake and present, etc.).
|
||||
|
||||
Building
|
||||
--------
|
||||
|
||||
|
||||
27
build.go
27
build.go
@@ -207,12 +207,16 @@ func buildTar() {
|
||||
}
|
||||
build("./cmd/syncthing", tags)
|
||||
filename := name + ".tar.gz"
|
||||
tarGz(filename, []archiveFile{
|
||||
files := []archiveFile{
|
||||
{"README.md", name + "/README.txt"},
|
||||
{"LICENSE", name + "/LICENSE.txt"},
|
||||
{"AUTHORS", name + "/AUTHORS.txt"},
|
||||
{"syncthing", name + "/syncthing"},
|
||||
})
|
||||
}
|
||||
for _, file := range listFiles("etc") {
|
||||
files = append(files, archiveFile{file, name + "/" + file})
|
||||
}
|
||||
tarGz(filename, files)
|
||||
log.Println(filename)
|
||||
}
|
||||
|
||||
@@ -225,15 +229,30 @@ func buildZip() {
|
||||
}
|
||||
build("./cmd/syncthing", tags)
|
||||
filename := name + ".zip"
|
||||
zipFile(filename, []archiveFile{
|
||||
files := []archiveFile{
|
||||
{"README.md", name + "/README.txt"},
|
||||
{"LICENSE", name + "/LICENSE.txt"},
|
||||
{"AUTHORS", name + "/AUTHORS.txt"},
|
||||
{"syncthing.exe", name + "/syncthing.exe"},
|
||||
})
|
||||
}
|
||||
zipFile(filename, files)
|
||||
log.Println(filename)
|
||||
}
|
||||
|
||||
func listFiles(dir string) []string {
|
||||
var res []string
|
||||
filepath.Walk(dir, func(path string, fi os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if fi.Mode().IsRegular() {
|
||||
res = append(res, path)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
return res
|
||||
}
|
||||
|
||||
func setBuildEnv() {
|
||||
os.Setenv("GOOS", goos)
|
||||
if strings.HasPrefix(goarch, "arm") {
|
||||
|
||||
1
etc/README.md
Normal file
1
etc/README.md
Normal file
@@ -0,0 +1 @@
|
||||
This directory contains contributed setup examples.
|
||||
15
etc/linux-runit/README.md
Normal file
15
etc/linux-runit/README.md
Normal file
@@ -0,0 +1,15 @@
|
||||
This directory contains a configuration for running syncthing under the
|
||||
"runit" service manager on Linux. It probably works perfectly fine on
|
||||
other platforms also using runit.
|
||||
|
||||
1. Install runit.
|
||||
|
||||
2. Edit the `run` file to set the username to run as, the user's home
|
||||
directory and the place where the syncthing binary lives. It is
|
||||
recommended to place it in a directory writeable by the running user
|
||||
so that automatic upgrades work.
|
||||
|
||||
3. Copy the edited `run` file to `/etc/service/syncthing/run`.
|
||||
|
||||
Log output is sent to syslogd.
|
||||
|
||||
8
etc/linux-runit/run
Normal file
8
etc/linux-runit/run
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
export USERNAME=jb
|
||||
export HOME="/home/$USERNAME"
|
||||
export SYNCTHING="$HOME/bin/syncthing"
|
||||
|
||||
setuidgid "$USERNAME" "$SYNCTHING" -logflags 0 2>&1 | logger -t syncthing
|
||||
|
||||
17
etc/macosx-launchd/README.md
Normal file
17
etc/macosx-launchd/README.md
Normal file
@@ -0,0 +1,17 @@
|
||||
This directory contains an example for running Syncthing in the
|
||||
background under Mac OS X.
|
||||
|
||||
1. Install the `syncthing` binary in a directory called `bin` in your
|
||||
home directory.
|
||||
|
||||
2. Edit the `syncthing.plist` file in the two places that refer to your
|
||||
home directory; that is, replace `/Users/jb` with your actual home
|
||||
directory location.
|
||||
|
||||
3. Copy the `syncthing.plist` file to `~/Library/LaunchAgents`.
|
||||
|
||||
4. Log out and in again, or run `launchctl load
|
||||
~/Library/LaunchAgents/syncthing.plist`.
|
||||
|
||||
You probably want to turn off "Start Browser" among the settings to
|
||||
avoid it opening a browser window on each login.
|
||||
30
etc/macosx-launchd/syncthing.plist
Normal file
30
etc/macosx-launchd/syncthing.plist
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>net.syncthing.syncthing</string>
|
||||
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>/Users/jb/bin/syncthing</string>
|
||||
</array>
|
||||
|
||||
<key>EnvironmentVariables</key>
|
||||
<dict>
|
||||
<key>HOME</key>
|
||||
<string>/Users/jb</string>
|
||||
<key>STNORESTART</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
|
||||
<key>KeepAlive</key>
|
||||
<true/>
|
||||
|
||||
<key>LowPriorityIO</key>
|
||||
<true/>
|
||||
|
||||
<key>ProcessType</key>
|
||||
<string>Background</string>
|
||||
</dict>
|
||||
</plist>
|
||||
13
etc/solaris-smf/README.md
Normal file
13
etc/solaris-smf/README.md
Normal file
@@ -0,0 +1,13 @@
|
||||
This directory contains an example for running Syncthing under SMF on
|
||||
Solaris.
|
||||
|
||||
1. Install the `syncthing` binary in a directory called `bin` in your
|
||||
home directory.
|
||||
|
||||
2. Edit the `syncthing.xml` file in the two places that refer to your
|
||||
username and home directory; that is, replace `jb` with your actual
|
||||
username and `/home/jb` with your actual home directory location.
|
||||
|
||||
3. Load the service manifest, as a user with the appropriate rights.
|
||||
`svccfg import syncthing.xml`.
|
||||
|
||||
48
etc/solaris-smf/syncthing.xml
Normal file
48
etc/solaris-smf/syncthing.xml
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
|
||||
<service_bundle type="manifest" name="syncthing">
|
||||
<service name="site/syncthing" type="service" version="1">
|
||||
<create_default_instance enabled="true"/>
|
||||
<single_instance/>
|
||||
|
||||
<dependency name="network" grouping="require_all" restart_on="error" type="service">
|
||||
<service_fmri value="svc:/milestone/network:default"/>
|
||||
</dependency>
|
||||
|
||||
<dependency name="filesystem" grouping="require_all" restart_on="error" type="service">
|
||||
<service_fmri value="svc:/system/filesystem/local"/>
|
||||
</dependency>
|
||||
|
||||
<method_context>
|
||||
<method_credential user="jb" group="other"/>
|
||||
</method_context>
|
||||
|
||||
<exec_method type="method" name="start" exec="/home/jb/bin/syncthing" timeout_seconds="60">
|
||||
<method_context>
|
||||
<method_environment>
|
||||
<envvar name="HOME" value="/home/jb"/>
|
||||
<envvar name="STNORESTART" value="1"/>
|
||||
</method_environment>
|
||||
</method_context>
|
||||
</exec_method>
|
||||
<exec_method type="method" name="stop" exec=":kill" timeout_seconds="60"/>
|
||||
|
||||
<property_group name="startd" type="framework">
|
||||
<propval name="duration" type="astring" value="child"/>
|
||||
<propval name="ignore_error" type="astring" value="core,signal"/>
|
||||
</property_group>
|
||||
|
||||
<property_group name="application" type="application">
|
||||
</property_group>
|
||||
|
||||
<stability value="Evolving"/>
|
||||
|
||||
<template>
|
||||
<common_name>
|
||||
<loctext xml:lang="C">
|
||||
Syncthing
|
||||
</loctext>
|
||||
</common_name>
|
||||
</template>
|
||||
</service>
|
||||
</service_bundle>
|
||||
@@ -47,7 +47,7 @@
|
||||
</button>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-cog"></span></a>
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-cog" aria-label="Edit"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="" ng-click="editSettings()"><span class="glyphicon glyphicon-cog"></span> <span translate>Settings</span></a></li>
|
||||
<li><a href="" ng-click="idDevice()"><span class="glyphicon glyphicon-qrcode"></span> <span translate>Show ID</span></a></li>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -46,6 +46,15 @@ var (
|
||||
)
|
||||
|
||||
func init() {
|
||||
defer func() {
|
||||
if err := recover(); err != nil {
|
||||
// Ensure that the supported flag is disabled when we hit an
|
||||
// error, even though it should already be. Also, silently swallow
|
||||
// the error since it's fine for a system not to support symlinks.
|
||||
Supported = false
|
||||
}
|
||||
}()
|
||||
|
||||
// Needs administrator priviledges.
|
||||
// Let's check that everything works.
|
||||
// This could be done more officially:
|
||||
|
||||
Reference in New Issue
Block a user