1
0
mirror of https://git.cloudron.io/cloudron/syncthing-app synced 2025-09-13 16:29:09 +00:00

Compare commits

..

97 Commits

Author SHA1 Message Date
Girish Ramakrishnan
cd247134d6 Version 1.4.0 2019-03-05 09:46:47 -08:00
Girish Ramakrishnan
44c030d6dc Update Syncthing to 1.1.0 2019-03-05 09:08:42 -08:00
Girish Ramakrishnan
e0a2b3acaf Version 1.3.1 2019-02-06 11:23:54 -08:00
Girish Ramakrishnan
b111013197 Update syncthing to 1.0.1 2019-02-05 17:17:02 -08:00
Girish Ramakrishnan
478d74f305 Version 1.3.0 2019-01-10 10:48:20 -08:00
Girish Ramakrishnan
55e4d56dcc Version 1.0.0 2019-01-10 10:32:07 -08:00
Girish Ramakrishnan
4ddc3b937a Version 1.2.1 2018-12-10 12:39:13 -08:00
Girish Ramakrishnan
2f00671685 Update syncthing to 0.14.54 2018-12-05 10:08:05 -08:00
Girish Ramakrishnan
55ad5b2a12 Version 1.2.0 2018-11-09 16:32:21 -08:00
Girish Ramakrishnan
1e5cc8b533 Update syncthing to 0.14.52 2018-11-09 16:22:11 -08:00
Girish Ramakrishnan
4c1b0d17e9 Version 1.1.0 2018-10-14 14:39:36 -07:00
Girish Ramakrishnan
e68c1e9ef2 Use latest base image 2018-10-14 14:39:18 -07:00
Girish Ramakrishnan
0d98ee2f5c Version 1.0.7 2018-10-04 16:35:40 -07:00
Girish Ramakrishnan
b2f48f24af Update syncthing to 0.14.51 2018-10-04 16:13:10 -07:00
Girish Ramakrishnan
481765c3db Version 1.0.6 2018-09-11 16:24:19 -07:00
Girish Ramakrishnan
6ea6e0cd30 Update packages 2018-09-11 16:14:50 -07:00
Girish Ramakrishnan
0cd6523548 Update syncthing to 0.14.50 2018-09-11 15:56:03 -07:00
Girish Ramakrishnan
ae1f3401ae Version 1.0.5 2018-08-08 18:17:51 -07:00
Girish Ramakrishnan
7dd3979bdc Update Syncthing to 0.14.49 2018-08-08 18:16:29 -07:00
Girish Ramakrishnan
a5a91b09c8 Version 1.0.4 2018-06-07 09:26:24 -07:00
Girish Ramakrishnan
91335ebc70 Update syncthing to 0.14.48 2018-06-07 09:21:41 -07:00
Girish Ramakrishnan
c0ba039523 Version 1.0.3 2018-05-02 13:33:56 -07:00
Girish Ramakrishnan
9f78b41ca2 make the tests work 2018-05-02 13:33:07 -07:00
Girish Ramakrishnan
5c2828f669 Fix paranthesis 2018-05-02 13:22:27 -07:00
Girish Ramakrishnan
391419d9f4 Update syncthing to 0.14.47 2018-05-02 13:10:39 -07:00
Girish Ramakrishnan
d99a39a0e5 Version 1.0.2 2018-04-08 00:12:35 -07:00
Girish Ramakrishnan
ab3a81a67b update package.json 2018-04-08 00:11:57 -07:00
Girish Ramakrishnan
8e5306db31 install chromedriver 2018-04-06 17:02:37 -07:00
Girish Ramakrishnan
e73991042d Update syncthing to 0.14.46 2018-04-06 17:01:24 -07:00
Girish Ramakrishnan
d566e12bc9 Version 1.0.1 2018-03-06 09:42:25 -08:00
Girish Ramakrishnan
6d051c2ad1 Update syncthing to 0.14.45 2018-03-06 09:25:21 -08:00
Girish Ramakrishnan
72d3757c51 add bad login test 2018-02-26 18:15:29 -08:00
Girish Ramakrishnan
5ca914f8d3 Fix mediaLinks 2018-02-26 17:50:51 -08:00
Girish Ramakrishnan
53bc9300d7 Add screenshots from docs 2018-02-26 17:48:24 -08:00
Girish Ramakrishnan
b67f87106f Add documentationUrl 2018-02-26 17:42:51 -08:00
Girish Ramakrishnan
84533d94cc Add back removeFolder 2018-02-26 17:16:52 -08:00
Girish Ramakrishnan
7d0ae7f24a Version 1.0.0 2018-02-26 17:14:03 -08:00
Girish Ramakrishnan
1901d8450d Fix tests 2018-02-26 17:09:23 -08:00
Girish Ramakrishnan
319d23ead8 Change the appstore id since it is not compat with older version 2018-02-26 17:08:41 -08:00
Girish Ramakrishnan
c1da43713e Fix postinstall 2018-02-26 17:08:41 -08:00
Girish Ramakrishnan
310b9443b0 Add nginx for healthcheck route 2018-02-26 16:35:12 -08:00
Girish Ramakrishnan
ee5dc6e5b8 Set defaultFolderPath 2018-02-26 14:59:30 -08:00
Girish Ramakrishnan
c8eca300d8 log audit events 2018-02-26 14:51:54 -08:00
Girish Ramakrishnan
22f8c8625e Move env vars 2018-02-26 14:51:26 -08:00
Girish Ramakrishnan
7a9f077e99 Use SYNC_PORT instead 2018-02-26 14:46:02 -08:00
Girish Ramakrishnan
9e7649fe36 Revert "Disable usage reporter"
This reverts commit aa6baa6ab9.

This is unnecessary, let the app decide the best UX
2018-02-26 14:44:53 -08:00
Girish Ramakrishnan
5b2993e1e0 No USERNAME and PASSWORD anymore 2018-02-26 14:44:35 -08:00
Girish Ramakrishnan
2fd1f42e44 Update post install 2018-02-26 14:44:35 -08:00
Girish Ramakrishnan
aa6baa6ab9 Disable usage reporter 2018-02-26 14:41:36 -08:00
Girish Ramakrishnan
9cd9df2876 Set default admin/password 2018-02-26 14:40:20 -08:00
Girish Ramakrishnan
09b27ff425 Rename to SYNCER_PORT 2018-02-26 14:07:43 -08:00
Girish Ramakrishnan
94520d61bf Remove ldap auth
syncthing is fundamentally a single user app and it's confusing that
one can LDAP login giving the impression it is somehow multi-user.
2018-02-26 14:05:39 -08:00
Girish Ramakrishnan
cdca87ef50 Update syncthing to 0.14.44 2018-02-26 08:54:55 -08:00
Girish Ramakrishnan
3078a34c8d Syncthing 0.14.42 2017-12-28 19:13:32 -08:00
Girish Ramakrishnan
a3f10a7f2d Use syncthing 0.14.41 2017-12-14 16:09:28 +05:30
Dennis Schwerdel
748697ba51 Version 0.5.0 2017-11-26 23:27:19 +01:00
Girish Ramakrishnan
d281fb8aef Version 0.4.0 2017-10-14 11:52:22 -07:00
Girish Ramakrishnan
d72a041d67 Use syncthing 0.14.39 2017-10-14 11:47:27 -07:00
Dennis Schwerdel
88a47bcf1a Update to 0.14.38 2017-09-21 23:06:33 +02:00
Dennis Schwerdel
6be20dbf5e Update to 0.14.37 2017-09-05 18:36:50 +02:00
Girish Ramakrishnan
eeabcd9b30 Merge branch 'update_to_0_14_36' into 'master'
Update to 0 14 36

See merge request !2
2017-08-28 16:24:28 +00:00
Girish Ramakrishnan
f56054506e Version 0.3.2 2017-08-24 11:45:12 -07:00
Girish Ramakrishnan
de4b8ff977 Update to 0.14.36 2017-08-24 11:35:09 -07:00
Girish Ramakrishnan
8c74b83013 Fix the version mess
0.3.0 was released without a changelog since I forgot to check that in
git (?)
2017-08-23 08:53:36 -07:00
Dennis Schwerdel
1f2ad16358 Updated to 0.14.35 2017-08-08 18:23:07 +02:00
Dennis Schwerdel
62b4fe40c1 Fixed tests 2017-08-08 18:22:39 +02:00
Girish Ramakrishnan
c3533569c1 encode the password 2017-07-28 15:36:51 -07:00
Girish Ramakrishnan
06a75583e8 fix promise usage 2017-07-28 15:35:45 -07:00
Girish Ramakrishnan
b413b5d43a Merge branch 'update_to_0_14_32' into 'master'
Update to 0 14 32

See merge request !1
2017-07-20 16:55:43 +00:00
Girish Ramakrishnan
5377c0180c Version 0.2.5 2017-07-15 21:54:00 -05:00
Girish Ramakrishnan
f3a6e7b69e Update to 0.14.32 2017-07-15 21:53:29 -05:00
Dennis Schwerdel
7620eec7b6 Updated to new upstream version 2017-06-27 10:20:37 +02:00
Dennis Schwerdel
2d4e328955 Updated to new upstream version 2017-06-13 09:29:43 +02:00
Dennis Schwerdel
ef3a205467 Fixed tests 2017-06-13 09:29:14 +02:00
dswd
9400c1a99f Merge branch 'addsynctag' into 'master'
add sync tag

See merge request !2
2017-06-11 19:21:21 +00:00
gregory
ff751142d4 add sync tag 2017-06-11 00:30:44 -05:00
Dennis Schwerdel
2032c881a5 Fixed description 2017-06-10 12:07:25 +02:00
Dennis Schwerdel
692c124a61 Version 0.2.0 2017-06-10 11:48:10 +02:00
Dennis Schwerdel
70c159edbc Running under user cloudron 2017-06-10 11:47:54 +02:00
Dennis Schwerdel
d7a7febb91 Not creating a default share 2017-06-10 11:38:41 +02:00
Dennis Schwerdel
9fff5574cb Updated tests 2017-06-10 11:33:48 +02:00
Dennis Schwerdel
cfc7133606 Fixed possible race condition 2017-06-10 11:25:07 +02:00
dswd
ef92705074 Merge branch 'master' into 'master'
Uses Syncthing Generated Request

Closes #2

See merge request !1
2017-06-10 09:22:25 +00:00
Shane Perry
baf46b3f52 Bumps package version to 0.1.4 2017-06-07 17:31:36 -05:00
Shane Perry
3d8ea24781 Adds back some config settings in order to confirm they are set on each startup 2017-06-07 17:26:33 -05:00
Dennis Schwerdel
37558f3b10 Updated postinstall message 2017-06-07 13:26:54 +02:00
Dennis Schwerdel
0e8b61d7d4 Only usernames work, not emails 2017-06-07 13:24:43 +02:00
Shane Perry
e628a70b60 Bumps syncthing version to 0.14.29 2017-06-06 07:51:20 -05:00
Shane Perry
02e9dbdedc Bumps CloudronManifest.json to version 0.1.3 2017-06-06 07:17:23 -05:00
Shane Perry
3e83a29587 Updates Changelog to 0.1.3 2017-06-06 07:15:41 -05:00
Shane Perry
bbe4721c76 Merges master with pull request branch 2017-06-06 07:11:52 -05:00
Shane Perry
92ae28d0da Dockerfile no longer adds the hardcoded config.xml 2017-05-25 21:32:49 -05:00
Shane Perry
5e085fc42a Bumps package version to 0.1.2 2017-05-25 21:30:48 -05:00
Shane Perry
d1c449aef8 Removes now unused config.xml file 2017-05-25 21:28:12 -05:00
Shane Perry
831efb6f8c Fixes #2; Fixes broken link 2017-05-25 21:26:54 -05:00
Shane Perry
012db8bad1 Generates full syncthing config; removes warning about authentication at startup; Adds Default folder 2017-05-25 21:19:46 -05:00
Shane Perry
4e805ba62f Bumps version to 0.14.28 2017-05-25 21:15:12 -05:00
18 changed files with 280 additions and 143 deletions

109
CHANGELOG
View File

@@ -6,3 +6,112 @@
[0.1.2]
* Fixed wrong URL
[0.1.3]
* Updated postinstall message
[0.2.0]
* Upstream version 0.14.29
* Uses syncthing generated config (thanks to @rymnel)
* Fixed typo in manifest (thanks to @rymnel)
* Running under user cloudron
[0.2.1]
* Fixed description
[0.2.2]
* Add to sync category in app store
[0.2.3]
* Updated to version 0.14.30
[0.2.4]
* Updated to version 0.14.31
[0.2.5]
* Updated to version 0.14.32
[0.3.0]
* Updated to version 0.14.33
[0.3.1]
* Updated to version 0.14.35
[0.3.2]
* Updated to version 0.14.36
[0.3.3]
* Updated to version 0.14.37
[0.3.4]
* Updated to version 0.14.38
[0.4.0]
* Updated to version 0.14.39
* #4357: Removing paused folders no longer triggers a crash.
* #4360: Add further security related HTTP headers
* #4375: Improve info level logging in some cases
* #4377: Improve GUI tooltips in chromium based browsers
* #4382: Hide temporary files on Windows
* #4387: Add -device-id command line switch
[0.5.0]
* Updated to version 0.14.40
[1.0.0]
* Updated to version 0.14.44
* #4634: Panic when connecting to device with auto accept and paused folders
* #4636: List of files needed on remote is not wrapped at word boundaries
* #4644: Impossible to run non-release builds without deadlock detectors
* #4649: UTF-8 normalization does not work correctly on ZFS.
* #4654: Upgrade system shows an error on RCs in some cases
* #4657: Sparse files with zero blocks are not closed when pulling
* #4668: Remote device out of sync items shows "0 items, ~0 B"
[1.0.1]
* Updated to version 0.14.45
* #4659: panic: bug: removed more than added
* #4680: Ignore pattern beginning with "#" does not match subpaths
* #4689: Ignore patterns in web UI aren't reloaded if only comments change
* #4701: Global is different from local state when ignoring files
[1.0.2]
* Update Syncthing to version 0.14.46
[1.0.3]
* Update Syncthing to version 0.14.47
[1.0.4]
* Update Syncthing to version 0.14.48
[1.0.5]
* Update Syncthing to 0.14.49
[1.0.6]
* Update Syncthign to 0.14.50
[1.0.7]
* Update Syncthing to 0.14.51
[1.1.0]
* Use latest base image
[1.2.0]
* Update Syncthing to 0.14.52
[1.2.1]
* Update Syncthing to 0.14.54
[1.3.0]
* Update Syncthing to 1.0.0
* #2760: Option to limit max simultaneous scans
* #5286: Add hardening options to systemd units
* #5320: Show configured rate limit in the GUI
* #5336: Show list of locally changed files for receive only folders
[1.3.1]
* Update Syncthing to 1.0.1
[1.4.0]
* Update Syncthing to 1.1.0

View File

@@ -1,34 +1,38 @@
{
"id": "net.syncthing.cloudronapp",
"id": "net.syncthing.cloudronapp2",
"title": "Syncthing",
"author": "Syncthing Developers",
"description": "file://DESCRIPTION.md",
"changelog": "file://CHANGELOG",
"tagline": "Decentralized file synchronization",
"version": "0.1.2",
"healthCheckPath": "/check",
"version": "1.4.0",
"healthCheckPath": "/healthcheck",
"httpPort": 8000,
"addons": {
"localstorage": {},
"ldap": {}
"localstorage": {}
},
"tcpPorts": {
"PORT": {
"title": "Port",
"SYNC_PORT": {
"title": "Sync Port",
"description": "Port over which syncthing will exchange data (do not disable)",
"defaultValue": 22000,
"containerPort": 22000
}
},
"manifestVersion": 1,
"website": "http://syncthing.net",
"website": "https://syncthing.net",
"contactEmail": "support@cloudron.io",
"icon": "logo.png",
"tags": [
"storage"
"storage",
"sync"
],
"minBoxVersion": "1.8.1",
"documentationUrl": "https://cloudron.io/documentation/apps/syncthing/",
"mediaLinks": [
"https://git.cloudron.io/dswd/syncthing-app/raw/master/screenshots/1.jpg"
"https://s3.amazonaws.com/cloudron-app-screenshots/net.syncthing.cloudronapp2/53bc9300d71bb5bf32362f8213194a0c3a415429/1.png",
"https://s3.amazonaws.com/cloudron-app-screenshots/net.syncthing.cloudronapp2/53bc9300d71bb5bf32362f8213194a0c3a415429/2.png",
"https://s3.amazonaws.com/cloudron-app-screenshots/net.syncthing.cloudronapp2/53bc9300d71bb5bf32362f8213194a0c3a415429/3.png"
],
"postInstallMessage": "file://POSTINSTALL.md"
}

View File

@@ -1,15 +1,17 @@
This app packages Syncthing v0.14.27.
This app packages Syncthing <upstream>1.1.0</upstream>.
Syncthing replaces proprietary sync and cloud services with something open, trustworthy and decentralized. Your data is your data alone and you deserve to choose where it is stored, if it is shared with some third party and how it's transmitted over the Internet.
### Features
#### Secure & Private
- **Private.** None of your data is ever stored anywhere else other than on your computers. There is no central server that might be compromised, legally or illegally.
- **Encrypted.** All communication is secured using TLS. The encryption used includes perfect forward secrecy to prevent any eavesdropper from ever gaining access to your data.
- **Authenticated.** Every node is identified by a strong cryptographic certificate. Only nodes you have explicitly allowed can connect to your cluster.
#### Easy to Use
Syncthing is still in development, although a large number of features have already been implemented:
- **Web GUI.** Configure and monitor Syncthing via a responsive and powerful interface accessible via your browser.
@@ -18,6 +20,7 @@ Syncthing is still in development, although a large number of features have alre
- **Powerful.** Synchronize as many folders as you need with different people.
#### Native GUIs & Integrations
- **Windows** tray utility, filesystem watcher & launcher: [SyncTrayzor](https://github.com/canton7/SyncTrayzor/releases/latest)
- **Cross-platform** GUI wrapper: [Syncthing-GTK](https://github.com/syncthing/syncthing-gtk/releases/latest)
- **Android** app: [Syncthing App](https://f-droid.org/repository/browse/?fdid=com.nutomic.syncthingandroid)

View File

@@ -1,34 +1,6 @@
FROM cloudron/base:0.10.0
MAINTAINER Syncthing Developers <support@cloudron.io>
FROM cloudron/base:1.0.0@sha256:147a648a068a2e746644746bbfb42eb7a50d682437cead3c67c933c546357617
EXPOSE 8000
RUN apt-get update && apt-get -y install busybox
ENV NGINX_VERSION=1.12.0
ENV NGINX_LDAP_VERSION=b80942160417e95adbadb16adc41aaa19a6a00d9
# Build a custom nginx with ldap support
RUN apt-get remove -y nginx-full && apt-get autoremove -y && apt-get -y install libldap2-dev libpcre3-dev
RUN mkdir -p /tmp/nginx-ldap
WORKDIR /tmp/nginx-ldap
RUN wget "https://github.com/kvspb/nginx-auth-ldap/archive/${NGINX_LDAP_VERSION}.tar.gz" -O - \
| tar -xz -C /tmp/nginx-ldap --strip-components=1
RUN mkdir -p /tmp/nginx
WORKDIR /tmp/nginx
RUN wget "https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" -O - \
| tar -xz -C /tmp/nginx --strip-components=1
RUN ./configure \
--add-dynamic-module=/tmp/nginx-ldap \
--modules-path=/usr/local/nginx/modules \
--conf-path=/app/code/nginx.conf \
--pid-path=/run/nginx.pid \
--error-log-path=/run/nginx.error.log \
--build=cloudron-river
RUN make install
ENV VERSION 0.14.27
ENV VERSION 1.1.0
RUN mkdir -p /app/code \
&& wget https://github.com/syncthing/syncthing/releases/download/v${VERSION}/syncthing-linux-amd64-v${VERSION}.tar.gz -O - \
@@ -36,9 +8,11 @@ RUN mkdir -p /app/code \
WORKDIR /app/code
# add supervisor configs
ADD supervisor/* /etc/supervisor/conf.d/
RUN ln -sf /run/syncthing/supervisord.log /var/log/supervisor/supervisord.log
ADD nginx.conf /app/code/nginx.conf
ADD config.xml /app/code/config.xml.default
ADD inittab /etc/inittab
ADD start.sh /app/code/start.sh
CMD [ "/app/code/start.sh" ]

View File

@@ -1,8 +1,8 @@
This application integrates with Cloudron authentication.
However, all Cloudron users share the same Syncthing session.
Use the following credentials for initial setup:
Syncthing contains an internal user `admin` that is needed by Cloudron but not exposed.
Please do not change the password of that account.
`username`: admin
Please create all sync folders as subfolders of `/app/data` as this is the only writable folder.
`password`: changeme
**Please change the admin password on first login**

View File

@@ -31,7 +31,6 @@ The e2e tests are located in the `test/` folder and require [nodejs](http://node
cd syncthing-app/test
npm install
export PATH=$PATH:node_modules/.bin
USERNAME=user PASSWORD=password mocha --bail test.js
PATH=$PATH:node_modules/.bin USERNAME=user PASSWORD=password mocha --bail test.js
```

View File

@@ -1,15 +0,0 @@
<configuration version="19">
<gui enabled="true" tls="false" debugging="false">
<insecureAdminAccess>true</insecureAdminAccess>
<address>0.0.0.0:3000</address>
<theme>default</theme>
</gui>
<options>
<listenAddress>tcp://:22000</listenAddress>
<localAnnounceEnabled>false</localAnnounceEnabled>
<startBrowser>false</startBrowser>
<natEnabled>true</natEnabled>
<autoUpgradeIntervalH>0</autoUpgradeIntervalH>
<upgradeToPreReleases>false</upgradeToPreReleases>
</options>
</configuration>

View File

@@ -1,2 +0,0 @@
::respawn:/app/code/syncthing -gui-address=0.0.0.0:3000 -home=/app/data/config -no-browser >/dev/stdout 2>/dev/stderr
::respawn:/usr/local/nginx/sbin/nginx -c /app/code/nginx.conf

View File

@@ -1,5 +1,4 @@
user cloudron;
load_module "/usr/local/nginx/modules/ngx_http_auth_ldap_module.so";
worker_processes 1;
pid /run/nginx.pid;
@@ -8,14 +7,11 @@ daemon off;
# Send logs to stderr
error_log /dev/stderr warn;
events {
worker_connections 768;
}
http {
include /run/ldap.conf;
error_log /dev/stderr warn;
log_format simple '$remote_addr [$time_local] "$request" $status $body_bytes_sent "$http_referer"';
access_log /dev/stdout simple;
@@ -28,22 +24,18 @@ http {
proxy_buffering off;
proxy_cache_path /tmp/proxy_cache levels=1:2 keys_zone=my_cache:10m max_size=100m inactive=60m use_temp_path=off;
proxy_cache my_cache;
auth_ldap_cache_enabled on;
auth_ldap_cache_expiration_time 300000;
auth_ldap_cache_size 100;
server {
error_log /dev/stderr warn;
listen 8000 default_server;
server_name _;
proxy_read_timeout 120s;
location /check {
proxy_pass http://localhost:3000/syncthing/app.js;
location /healthcheck {
return 200;
}
location / {
auth_ldap "Forbidden";
auth_ldap_servers cloudron;
proxy_pass http://localhost:3000;
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

BIN
screenshots/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

BIN
screenshots/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

BIN
screenshots/3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

View File

@@ -2,26 +2,28 @@
set -eu
mkdir -p /app/data/config
mkdir -p /app/data/config /app/data/folders /run/syncthing
if ! [ -f /app/data/config/config.xml ]; then
cp /app/code/config.xml.default /app/data/config/config.xml
# if this if the first run, generate a useful config
if [ ! -f /app/data/config/config.xml ]; then
echo "=> Generating config"
STNODEFAULTFOLDER=1 /app/code/syncthing --generate="/app/data/config"
# The password value was determined by reading config.xml and setting value in the GUI
# urAccepted is 0 for not decided, -1 for no reporting
xmlstarlet ed --inplace \
--subnode "//configuration/gui" -t elem -n user -v "admin" \
--subnode "//configuration/gui" -t elem -n password -v '$2a$10$93OsgwAMD4NcPFTpGDnuTORMMbj5dc1ZlYUPrQCcy1N/Bsy9scUvK' \
--update "//configuration/options/defaultFolderPath" -v '/app/data/folders' \
--update "//configuration/options/urAccepted" -v '-1' \
/app/data/config/config.xml
fi
cat >/run/ldap.conf <<EOF
ldap_server cloudron {
url ${LDAP_URL}/${LDAP_USERS_BASE_DN}?username;
binddn ${LDAP_BIND_DN};
binddn_passwd ${LDAP_BIND_PASSWORD};
group_attribute ${LDAP_GROUPS_BASE_DN};
group_attribute_is_dn on;
require valid_user;
}
EOF
sed -e 's,<listenAddress>.*</listenAddress>,<listenAddress>tcp://:22000</listenAddress>,' -i /app/data/config/config.xml
# Set the listenAddress and the gui enabled to make sure user doesnt lock themselves out by accident.
sed -e "s,<listenAddress>.*</listenAddress>,<listenAddress>tcp://:${SYNC_PORT}</listenAddress>," -i /app/data/config/config.xml
sed -e 's,<gui .*>,<gui enabled="true" tls="false" debugging="false">,' -i /app/data/config/config.xml
export STNODEFAULTFOLDER=1 STNOUPGRADE=1
exec busybox init
chown -R cloudron:cloudron /app/data /run/syncthing
echo "Starting supervisor"
exec /usr/bin/supervisord --configuration /etc/supervisor/supervisord.conf --nodaemon -i GitLab

12
supervisor/nginx.conf Normal file
View File

@@ -0,0 +1,12 @@
[program:nginx]
priority=100
directory=/tmp
command=/usr/sbin/nginx -c /app/code/nginx.conf
user=root
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

14
supervisor/syncthing.conf Normal file
View File

@@ -0,0 +1,14 @@
[program:syncthing]
priority=20
environment=HOME=/app/data/folders,STNOUPGRADE=1
; -no-browser opens up the browser (for desktop app preumably)
; auditfile "-" means log to stdout
command=/app/code/syncthing -gui-address=127.0.0.1:3000 -home=/app/data/config -no-browser -auditfile=-
user=cloudron
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

View File

@@ -9,6 +9,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"chromedriver": "^2.36.0",
"ejs": "^2.4.2",
"expect.js": "^0.3.1",
"mkdirp": "^0.5.1",
@@ -16,7 +17,6 @@
"rimraf": "^2.5.3",
"selenium-server-standalone-jar": "^2.53.1",
"selenium-webdriver": "^2.53.3",
"superagent": "^1.4.0",
"chromedriver": "^2.27.0"
"superagent": "^1.4.0"
}
}

View File

@@ -2,8 +2,11 @@
'use strict';
require('chromedriver');
var execSync = require('child_process').execSync,
expect = require('expect.js'),
superagent = require('superagent'),
path = require('path'),
webdriver = require('selenium-webdriver');
@@ -19,17 +22,12 @@ var bucket_prefix = 'bucket',
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
if (!process.env.USERNAME || !process.env.PASSWORD) {
console.log('USERNAME and PASSWORD env vars need to be set');
process.exit(1);
}
describe('Application life cycle test', function () {
this.timeout(0);
var chrome = require('selenium-webdriver/chrome');
var server, browser = new chrome.Driver();
var username = process.env.USERNAME, password = process.env.PASSWORD;
var username = 'admin', password = 'changeme';
before(function (done) {
var seleniumJar= require('selenium-server-standalone-jar');
@@ -46,11 +44,16 @@ describe('Application life cycle test', function () {
done();
});
var LOCATION = 'syncthing-test';
var LOCATION = 'test';
var TEST_TIMEOUT = 30000;
var FOLDER = 'xmf'; // keep this small. long folder names fail in automation, not sure why
var SYNC_PORT = 22001;
var app;
function installApp() {
execSync('cloudron install --new --wait --port-bindings SYNC_PORT=' + SYNC_PORT + ' --location ' + LOCATION, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
}
function pageLoaded() {
return browser.wait(until.titleMatches(/[0-9a-f]{12} \| Syncthing/), TEST_TIMEOUT);
}
@@ -61,48 +64,77 @@ describe('Application life cycle test', function () {
});
}
function invalidPassword(callback) {
superagent.get('https://' + app.fqdn).auth(username, password + 'x').end(function (error, result) {
expect(result.status).to.eql(401);
callback();
});
}
function loadPage(callback) {
browser.manage().deleteAllCookies();
browser.get('https://' + username + ':' + password + '@' + app.fqdn);
return pageLoaded().then(function() {
browser.manage().deleteAllCookies().then(function () {
return browser.get('https://' + username + ':' + encodeURIComponent(password) + '@' + app.fqdn).then(function () {
return browser.get('https://' + app.fqdn);
});
}).then(function () {
return pageLoaded();
}).then(function () {
callback();
});
}
function addFolder(callback) {
return pageLoaded().then(function() {
browser.findElement(by.css('[ng-click*=addFolder]')).click();
return visible(by.id('folderPath')).then(function() {
return browser.findElement(by.id('folderLabel')).sendKeys('test');
}).then(function() {
return browser.findElement(by.id('folderPath')).sendKeys('/app/data/test');
}).then(function() {
//Clear and re-enter the folder to avoid race with auto-completion
return browser.findElement(by.id('folderPath')).clear();
}).then(function() {
return browser.findElement(by.id('folderPath')).sendKeys('/app/data/test');
}).then(function() {
return browser.findElement(by.css('[ng-click*=saveFolder]')).click();
}).then(function() {
return browser.wait(until.elementLocated(by.css('#folders .panel-status span[ng-switch-when=unshared]')), TEST_TIMEOUT);
}).then(function() {
callback();
});
browser.get('https://' + app.fqdn).then(function () {
return browser.findElement(by.css('[ng-click*=addFolder]')).click();
}).then(function () {
return visible(by.id('folderPath'));
}).then(function () {
return browser.sleep(4000); // wait more, not sure why this is needed
}).then(function() {
return browser.findElement(by.id('folderLabel')).sendKeys(FOLDER);
}).then(function () {
return browser.sleep(4000); // without this sometimes only part of the folder name gets through
}).then(function() {
return browser.findElement(by.css('[ng-click*=saveFolder]')).click();
}).then(function() {
return browser.wait(until.elementLocated(by.css('#folders .panel-status span[ng-switch-when=unshared]')), TEST_TIMEOUT);
}).then(function () {
return browser.sleep(4000);
}).then(function() {
callback();
});
}
function checkFolder(callback) {
browser.get('https://' + app.fqdn).then(function () {
return browser.wait(until.elementLocated(by.xpath(`//span[text()="${FOLDER}"]`)), TEST_TIMEOUT);
}).then(function () {
callback();
});
}
function removeFolder(callback) {
browser.get('https://' + username + ':' + password + '@' + app.fqdn);
return pageLoaded().then(function() {
browser.findElement(by.css('#folders button')).click();
setTimeout(function() {
browser.findElement(by.css('#folder-0 button[ng-click*=editFolder]')).click();
setTimeout(function() {
browser.findElement(by.css('[ng-click*=deleteFolder]')).click().then(function() {
setTimeout(callback, 1000); //This needs to run for some time
});
}, 1000); //No way to check for visibility of angular-js components
}, 1000); //No way to check for visibility of angular-js components
browser.get('https://' + app.fqdn).then(function () {
return pageLoaded();
}).then(function() {
return browser.findElement(by.css('#folders button')).click();
}).then(function () {
return browser.sleep(3000); //No way to check for visibility of angular-js components
}).then(function () {
return browser.findElement(by.css('#folder-0 button[ng-click*=editFolder]')).click();
}).then(function () {
return browser.sleep(3000); //No way to check for visibility of angular-js components
}).then(function () {
return browser.findElement(by.xpath('//button[@data-target="#remove-folder-confirmation"]')).click();
}).then(function () {
return browser.sleep(3000); //No way to check for visibility of angular-js components
}).then(function () {
return browser.findElement(by.css('[ng-click*=deleteFolder]')).click();
}).then(function () {
return browser.sleep(3000); //This needs to run for some time
}).then(function () {
callback();
});
}
@@ -110,9 +142,7 @@ describe('Application life cycle test', function () {
execSync('cloudron build', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
});
it('install app', function () {
execSync('cloudron install --new --wait --port-bindings PORT=' + SYNC_PORT + ' --location ' + LOCATION, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
});
it('install app', installApp);
it('can get app information', function () {
var inspect = JSON.parse(execSync('cloudron inspect'));
@@ -122,9 +152,9 @@ describe('Application life cycle test', function () {
expect(app).to.be.an('object');
});
it('fails with invalid password', invalidPassword);
it('can load page', loadPage);
it('can add folder', addFolder);
it('can remove folder', removeFolder);
it('backup app', function () {
execSync('cloudron backup create --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
@@ -135,8 +165,7 @@ describe('Application life cycle test', function () {
});
it('can load page', loadPage);
it('can add folder', addFolder);
it('can remove folder', removeFolder);
it('can check folder', checkFolder);
it('move to different location', function () {
browser.manage().deleteAllCookies();
@@ -147,11 +176,27 @@ describe('Application life cycle test', function () {
});
it('can load page', loadPage);
it('can add folder', addFolder);
it('can check folder', checkFolder);
it('can remove folder', removeFolder);
it('uninstall app', function () {
execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
});
// test update
it('can install app', function () {
installApp();
var inspect = JSON.parse(execSync('cloudron inspect'));
app = inspect.apps.filter(function (a) { return a.location === LOCATION; })[0];
expect(app).to.be.an('object');
});
it('can load page', loadPage);
it('can add folder', addFolder);
it('can update', function () {
execSync('cloudron install --wait --app ' + LOCATION, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
});
it('can check folder', checkFolder);
it('uninstall app', function () {
execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
});
});