Compare commits

..

8 Commits

Author SHA1 Message Date
Jakob Borg
b48d9a3a82 Don't panic when lacking symlink support on XP (fixes #1016) 2014-11-24 23:32:11 +01:00
Jakob Borg
0255311bbe Note about IRC channel 2014-11-24 23:07:30 +01:00
Audrius Butkevicius
bd91519df9 Add aria label on cog (closes #1020) 2014-11-24 21:14:14 +00:00
Jakob Borg
58fe8b0cf1 Add example for Solaris SMF running 2014-11-24 13:59:59 +01:00
Jakob Borg
064aa64f20 Point to etc dir in README 2014-11-24 13:49:18 +01:00
Jakob Borg
d9f79853fb Include etc dir in Unix builds 2014-11-24 13:49:15 +01:00
Jakob Borg
2e68ee5c8b Add example for Mac OS X background running 2014-11-24 13:49:15 +01:00
Jakob Borg
a9544ca890 Add example for runit service 2014-11-24 13:48:42 +01:00
12 changed files with 172 additions and 6 deletions

View File

@@ -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
--------

View File

@@ -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
View File

@@ -0,0 +1 @@
This directory contains contributed setup examples.

15
etc/linux-runit/README.md Normal file
View 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
View 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

View 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.

View 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
View 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`.

View 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>

View File

@@ -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>&emsp;<span translate>Settings</span></a></li>
<li><a href="" ng-click="idDevice()"><span class="glyphicon glyphicon-qrcode"></span>&emsp;<span translate>Show ID</span></a></li>

View File

File diff suppressed because one or more lines are too long

View File

@@ -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: