diff --git a/auto/gui.files.go b/auto/gui.files.go index 77b103d73..77a71c185 100644 --- a/auto/gui.files.go +++ b/auto/gui.files.go @@ -63,7 +63,7 @@ func init() { bs, _ = ioutil.ReadAll(gr) Assets["favicon.png"] = bs - bs, _ = hex.DecodeString("1f8b080000096e8800ffec5de973dc36b2ffeebf02e6eef3514fe4c847f66dc9a3a9722467e3daf8282b7e795ba97cc09098212292a00150f23c59fbb76f37c0fb98e18c478ab29b0fb186381ae84677e3d7608399de3f7d77f2e33fdebf22a18ea3d9bd29fe21114d96c70e4b1c922c5d9aa6c78e5a25be0e79b23445be48b41451c4e4b17356d49c681939c48fa852c70e368a043d779024a3c1ec1e21d398694afc904ac5f4b193e985fb57a7aa08b54e5df629e317c7ceffb91f5fba27224ea9e6f3880159189125d0ebf5ab63162c59ad5f426376ec5c7076990aa96b4d2f79a0c3e3805d709fb9e6e180f0846b4e2357f93462c74fbcc30ea180295ff2547391d468759ad14c8742765a443c392792452031a8d67ea609f7915228d9e2d859d00b7cf45210e4ec1e76d05c476c560a917c215757f04bbd15017b0b233d7a7c7d3d9dd856e50096d85c08adb4a4e9c4576a523e79314f3c2871f279e855c454c898b63334cf44af526042b3cf1a3b9b1a42e62258912bf393909406014cc89d0bad457c44fee730fdfc22af5b00d3ee82c63c5a1d11e77b165d30cd7d4adeb28c3907a42c38202f2548fb80289a285731c91796c4f53df3278bfe3bfca61c31a672c913578bf4883cf1be6171a3ad87937563910895529f95bd1a7379c392481c903722a13efc3d118912a09007c4391199e44cc2142f61862599d61014940db53b608962c14c1bd5d57286aad3ad45790dd72e6041866b4bcac15acabdb525e5a094c25cc880492bbb44242dbe22b1142d311f91c317cd95ae951832ee37d582a74271b48823d429b0c98bf6005c693711ee3c03a7a0cba14cb151381715ce4eadd511188bb23829fb045ca51185b5e409e83a73e791f0cf8b79806a5b4b067d2cf4a3541cc997a106d5a92ae6d43f5f4a9125018e22244c7f397ff4f4d95f0ec8d3e787f8cf93c72f9a129434e0993a22cf6acc17f279927e26cfabf242904fa1f869517cdde60bd42cf1020a8ea3a5e7115bc06c0f2b456fb0f7e4b02a369a4f23be44f923932f36cbaa1070e188bbf2c5b520f7798c5e9326bac712880e9b6676c9ac889f1f1ef6360f3adec332f9147c47cf50e08d26463b609398d85de2ded4a8be718df75d97fc28525845495cd79625f4a2dc62e805d6d83fa8f9c5cf802d6816c14e005b1433edf8921a7f6edddc34e0251174df144427f33a7490b060cd31dcb9a449e0cca63c5e163568520e51d2470febe293fbe4e95f8d632776e3719e3d05b76f24667f4f66a4f4f35315d3282a88853c00db763f83236e8e6f7d5ea6198cfe05840555b3de0dc2909be52d0a4eb2a8c647219dda4fa34b15e3112f9a0752a481b84cca3a534ff37de74f4ebb1d487fb9c46d1af53c7fa853791570fd2099abf4c5745e4a9e4adc92a69339fc471b0355f32e07885992356663e63b2be7646149c4fd73d89a83e0034bc5a3c740bd2ecc65b44a43dc7e49f9cb0d035c572bb6072c8619be0c0282ddc1e109b9c2a94d2730d2e8a1715d460d0dec5f322b82d6f0486270e05234fc8207a8b75b4c8fc13a9c31ad4101d5a839fa62d99a5fd17d4bc1f0f172f9247d68da1e361497e4f5a91db5aee47b918b0a338d6a366a7e62b1e84cce76df522692294da51ea92c0b681eb606fe6029f48d3b9d6451f5dcacadeaa6131097818513f009d6c50e7847db1e7df2775c2a0dcef5f28088245a1140ba9709e10b92309f2945e5ea05c967462ea94c10d6e6fe3b270f32e0208cfb407fc197af13748ba55301c2954f6a4c2672e300bc6ccd0fd4eb412c2c22e65f371fb6e9bfda6d5ddc724cab69f8ac5963f0b6332bb878cb58c002d8a39ecd4a890d93c51dacedabd2d98f212396df4c9add8884549139630011e8050bc81c62854468427dc057145cbe576d1724ce50e4f974b4281bc116cd40ee974dd2de7492369561e3a41153d676c1bc19cc49c34c6db4601fca759aeb84c07fae8acd9f7cd7252940c07c67b9195db7d3684db4ae2711a372c13f3b3d6bd52c683cd61ef29f1d8d67cb2c02c4010adad2e786e616f4b063b591182c4c1e214c414cf4b8a2d0abe57fe93501bb5488685387f000c59ad3e74c8d308bab2bec7082158ff097f7fa14d08359277864545b8a002709fefd01a68c2b36ce88eaad06eca989261a6001f88e68aa0a0c91023ac0a8fa4f0d0e0b0082853933c00270d0a0bccd9e4f722aa75c32dfacd3176222f7f75487d7d743646b4a3eb314ce34d5595daadd6daa0d73d09d6c34d262951bec36855b888e9432dcd23fd59bd86013ec2f85d819e2bcb647b048bfde98b4e2d3fc5969c953c4adadfe16df13d22c95ed222c0c37fb0a4ddb00a56672881780480fe5a001b01b0b69240cfd82ce2427dd59ee3ef1858830dc14294b5a0c7c676a769979a9c4b7c1802f6200e56df88a3b562845c2ffdf6c443b70d1634837cdca3212f336e0fc1b94d1a811096cc54a0c1836fa39e7e2176f69c87dc723a6c0c3d0e892aed4db2c9e33797d4d16587c40063a7dbbd2a6d39c271497f6db9b174828e2b63c7e10fe1ec51121b52da561fafc06c2f02391052ee2fb48d076b4f80e409b5818a0f675124900626e2910ecf21bc803cf985a5278431580c75db5a3dbce4c210f120cbb1f0064bc8358c399fd83a9be00b0d3ed7eabdf5b31d8edc625a64240332e8d3ace12cb03f213d7e19e0456a0b8a480701e86ddaaa7cbd555521c202d7862a3f3c4b406a78b5eb721cc3fc32460e003322cc4af112e947461011422906817b641d2102c0380d91fa8a492c7602bcec0f988393a42d18d095560f7f679d45a563cedea3fa8d83520698624796c816b558b2a0cdb7b0a2b9296d20cc513e5496b5df5a0efc962890af873714ef9e8f12f3b4411a3e288f1918465aa0821f0c9b54600b3cd151f2389ed36c7ba1de5b40c64a16db51d8bf587e6b501f283b8ef30ea1fc2fd034e752cf6ef1c11bc7c433e6a1ead059f6bb664b5826d2cf6e0cfa61db57f87f84a76a83a572d8e4ede7fdc07477e9abd67d2073b68a10b784c006e4b1a1d3db9befeafdb62752da43acd8bc907aad9d61cf3649ee2f2c50c34d1bfbe86a7dbe52a4b7b78fa98eece91c87487a5de7d750d4fc5469eeb03d07f9924224b7cf6eeefe4fe31c9c08a0106f418ee68eef1d56f28643b9a2dc621674c5e0c85b5e3914e6bc337ef554d0795f978f8ecace3d499bd33ef4987c0ca20f180264b264bdaf707882f161ba8df9a27691f8afc2f936a17ff7161fbf507e1033079772c770368cee2da7c63fecd00dd888359334773305bc188215c2574c8a401f63b9dcefe36b86a789dc7bc1c6df4eec55ce3f4c876cdcf98ea80ade79de2ad83b8ff380487c96cddf7dfc084dada53a1acb16f63516f69dfdffd247403433d7afabb0768403e613e8a44fddc34905fbc7f3ff0b68edb7d00bb3b8011902de8bb9396fe0116369cfedcab7edb539f49f3ed3316bd925248d59f62c1b0cebec7f522962c754866e4f02ee65abc159afbecab722cea70091847a854e31f17d464c95d5d41a9f7238f19d81e601976e47c7f14c747103d5c5f1f15b97480321692b3248856166a6127236aa3e1379f5f516934e94fb5a8abaf497ab08a302e89a9bdefbefbfbed66563474bacc332af33cb1f85b93793e2efdb3c83ec91f61922cc853d7492dbbf25e57d13bf99f4359937553b0295dcd2451036672cf8277198e26c0a2f2452615f3cafb135ec2f4c4999d652926c39209f94ec82cee66708d1a42c1184baec36cee010899f8348ac34939d4443258308527b93f80962b4d3ed8821d475bc3900ff49742ae2681f033044379beed69fdf16698e44a65c8e2b7595f52e21e4680c502967d464e7ad232d7a7d299637a8864843cb79e88c422a051a9ce65bc60db18fb2deddf365dd080f5e8ada974034e23b1ecf5e0b6417e3b65c08bdb36e899c1f268c4401fcdbfc57947c3c0c3e7cd6ebd21e326b7c33e43656cb4c1557c99f4c777272568b27b5bc3cf84cf07dc4c1f6fdd90296d0e5565d829067e1053ebe68c20f03d20b05c186833c215a124950240494c2e4151c80a3482bc06d94a583a52813caf41fc03e0ba15d07e10b228e2e98b061fe9686fd9709b36abcca4c299bcc05e7d926583bba04d3c59881bd0a5769a604bf485046e457940432a997be4bd71b3241451b0efb52f728d0756bec864be0beb5e1cc9ee7fe9eb29d8cd1529a483770723a6d9adac7e95c80bc31be7e1ed6bb95f9f0e2c340f3eedb05558626eb49fd5be81956d25ff373a9b17deaf01ca69bee0becda17e100754852fea4782d54be7e6a9e0d7ad7fbdc1259834c17f1090b7ae259a477cd3d612cfd555bc82c5fc42fc304bcef13470702a78cb280fdfb04fb9ca96aabde445a0910b88259e271442507b11e9939c748771265b30dd13a58cca012f231273340c2831e625d15119dfb1b868679c9d4402a16a2728d9d6848cda60783f08bf8ad8ffced91368015eae3876eee314c1d5bcfa0ca16c675b2f4cadba3b54d7f416a95194f010a387d40e4e7321649c5fc4c39f4e7e7d1aadf5955993b687a8d1c40e455a8a09754de9d543f0b7ae81d30ff1166341c84bccb99af7679e5cd08807e4c183beda804bbd6abf8fc04081ce19acb9907672607733eb704e01ef635da7074f52bcb291bf13ecc8b562146db8782d50b367c35e7e95bee5469cda056dc3bb49fd031790497ceb8213cb8f11f196f7a78c4b1680f5981975e6593f0e1a58fc351ecd9c627686ad7b989ea339731a93d30600945aa7b529d5af67b5ec4a7ef9d2b792a9345cc00cf16e4d62170b11bcf193c440771fa803a05fe01d603c0fc2eb328ed1ee19c9ef9481d3b2b62c6cb579bb66c879e40c2500e81f3ae33e833f81a8305f07000ff108421801a27fec0d333660c0b39f42000cf6962c4417788507873c20e78ca538d398c3a03aa49a4c593cc34dcd34984ee0c95e0702bea03f0b9a13571ce4a085f0b64ed5dbb014c6e2bc42dbd6595773416009f05a13cc761ed1e47c605ead13b5fe03df7edfb0d69429266b212e586fc569040b1d9accfb63e77b1117f90ab9e122953eb31d65a7d4e68bf51b67af999cd91b7589d2b02f607e71ee890a0df6a3cc24dc2af37ea87ddb6b5fb2a3f6551c1eaebc2c7e6e21c5600562e3be110b20023cd20ffa3c18393e2616e7a0a8ab4177957739d7332db794fb2be338f07d1e258aa554e235bcbe1bd99573e4e9111ee415e980e5f4f1f4606dc75c3c4547705b299366b7a499167846e21373dc065ab8421dc085cfc98f58f1e90469dd02f42bdfa9d4aed3d20b965ff76d2e7ecd6114bbf42e67d56740bfefb4face41d57246fddb2ffad062633863d1c2d93073732a672f58e21dc2bac8c10a20da1d7dc71a3697ac9d6b786a4874b9d8fe742a159bf136b6fa77c0dbf53b0f7b41dd4304f787bd31b97d2fd8bb22e4e1cf16f6eea91d81bd6d53bc7addb8c6b71681975ce126d2dc83f2f70faae5883acb515cb31c80e71bf69d0ff64a4e85c54996f04f19e6e3a462bb2da8dda87d15a625d1121ff7d455f8f80c6fb4028ff6e8047cc8c29e6d93f276edca236f724c89e50a448ab0d27ea3c4820d93e73584de364cd362472b1463f90621cafa1a9798d6b6faaa81ea2075480dfba670e35075ac29e1ede375c664eb479a13366e1814168c3529d3b96954ff9c9c566655188e6db7a3e99417574744b35f6b3556744376636b2bcbc167c4664d6329222e732511f1224c94498ffcc4c15e407b7cc90c72e40bc2f1409829f3650786eec623a8779a832ccdb7f0a88fc635c563cfd93fa713f3b7085b334ccba3f8f6a9fc9a1c5aae6d5c66f71b5a18869be21d0cc732bdd1746a4ad7319e14e574fb915efd4d7ec8fcf3b9f8dc77c8d0abea3575b71a5a5218d0d2ea3261fdbb0ef6ee634f94dd6f5fe3cf4aec6d503c6f482540731f156a21458c5a0340509118300c6a627560a10ecc5744da0d8a03047b7660e2f2cb5c5315de0929f55be922d0c89dfe4d8596f9053393583324a9beb56d2744afcd86deebe22b40c7b804662093ca57e4f1399d4b60ed6ce4fde8c3999981fde00b4e0297cddc2c25e670a8668cf88a7a8710b13a2a1c3ab36ad0eb1e605553e83bc6c28937501dbe35351e0ef58fd7dc0937cc2d99d1ebb9c9044f72f881ce73658cc2c737aca0bef861c20b668ee80c8280c8d90fc1d5825f8d56656f043296c2bd4189dc76889c7fa4ac894c6b3ef78f101991f95786c4a3bf0477932171f1d1b4a197f679f59d8b87fb8254527d016ecfe1e9f0ae524f53edabefdc6eee6fd602e2c546928b1fbd55b912bdfb45ed454aded043edc403cc87086f1f22a0ecd424e6a6e5c35e92cd5d11105dde99077865a67a361f25468837b89995db192a548bd03a585e35c5e7fcce51b1ff996f8a79989a060ddea5368dbd22fdcbe0f16a8f460cac5c7ddbed15ec5c8868bdf0faebf0957b4b7ceb44b406057c95140677fe3522ea0705bd85376104cb8c9fdd9c1df4d6a530351070f0fbb792bf7d7cfd1f6e21db48e026ade3cebd12d9eacbabbf5b44371a1be14ffba97d9bbd04500e3faf683e5fffab4562a676d66ef8eba78cc995fbd43bf49e6d6e5d7d25ffd7f647f2d7f6a369da6a00bc9abb4a007cccff2be15f000000ffff010000fffffff571603c610000") + bs, _ = hex.DecodeString("1f8b080000096e8800ffec7d5b73db38b2ff7b3e05c2dd7f2ef53729e7327bb61c5955193bd949ede4527172e66c4dcd03444222c624c100a01d1dc7fbd94f37c0fb45a214d9c9ecee432292001a40a3bbf1eb66839ede3d7d7bf2e11fef5e9050c7d1ecce147f484493e5b1c31287244b97a6e9b1a35689af439e2ccd235f245a8a2862f2d8392b4a4eb48c1ce24754a963072b45829e3b4892d16076879069cc34257e48a562fad8c9f4c2fdab5315845aa72efb94f18b63e77fdc8fcfdd1311a754f379c4802cf4c81268f5eac5310b96acd62ea1313b762e38bb4c85d4b5aa973cd0e171c02eb8cf5c73734078c235a791ab7c1ab1e347de618750c0942f79aab9486ab43ad568a643213b35229e9c13c922e018146b3fd384fb4829946c71ec2ce805de7a29307276071b68ae23362b9948be90ab2bb8526f44c0de404f0f1e5e5f4f27b656d981253617422b2d693af1959a94775ecc130f9e38f938f42a622a644cdb119a7ba257294c42b3cf1a1b9b1242e62258912b7349484a830006e4ce85d6223e22ff75987e7e96972d60d2ee82c63c5a1d11e727165d30cd7d4adeb08c3907a47c70409e4be0f601513451ae62922f2c89eb3be6278bfe7ff843d9634ce59227ae16e91179e4fdc0e2465d0f07ebc622112aa53e2b5b35c6f29a25913820af45427df83d118912209007c4391199e44cc2102f61842599561714840da53b608962c14c1bd1d57286a2d32d457e0d972e6041864b4bcac15acabda525e5a0e4c25cc88049cbbb4424ad794562295a6c3e2287cf9a2b5d7b62c8b83f540b9e0ac551238e50a640272fda1d70a5dd44b8f30c8c822ebb328f8dc0b928707668ad8630b1288b93b24dc0551a51584b9e80ac33771e09ffbc180788b6d56490c7423e4ac1917c196a109daa604efdf3a5145912602f42c2f097f3078f9ffce5803c7e7a88ff3d7af8acc94149039ea923f2a436f9823f8fd2cfe469f5bc60e46378fcb8787cdd9e178859e205140c474bce23b680d11e5682de98dea3c3eab1917c1af125f21f27f96c33af0a061786b8cb5f5c0b7297c7683569a27b3481e8b0a96697ccb2f8e9e1616ff5a0633dec241f83ede8e90aacd1c448076c1213bb4bdc991ad137a6f1aeeb920f22855594c475edb3845e945b0cbdc012fb83925f5c066c41b3087602d8a298a9c797d4d8736be6a6012f89a0f9a6c03a9997a18184056bf6e1ce254d026736e5f1b22841957288923e5a5817efdc478fff6a0c3bb11b8ff3e431987dc3317b3d9991d2ce4f554ca3a82016f20074dbfd0c86b8d9bfb5799966d0fb17601614cd7a3708436e96d728669245b57914dca95d1a59aa261ef1a27a20451a88cba42c33e534df77fee4b4eb01f7974bdca651cef39b3a951701d7f792b94a9f4de725e7a9c42d693a99c33fdae8a81a77d941cc92ac311a33de5939260b4b22ee9fc3d61c04ef592a1e3c04ea75662ea3551ae2f64bca2b370c705d2ddbeeb11846f83c080836078327e40a87369d404fa3bbc67519d5354cff925916b4ba4712831d97ace1173c40b9dd62780cd6e18c690d02a8468dd117cbd6f88ae65b32868fe7cb27e943d576b7a1b824af4e6daf7521df0b5f54986914b351e3138b456770b6f9963c914c692af548615940f5b0d5f17b4ba1afdfe9248baafb666955369d00bb0c2c9c804db02676c03adafa68935f72a93418d7cb032292684500e95e26842f48c27ca61495ab67241f19b9a43241589bdbef9c3cf0800333ee02fd055fbe4ad02c964605085736a93198c88d03b0b2353b502f07b6b08898ffddbcdba6fd6ad77571cb31b5a6e1936689c1dbceac98c51bc60216c01ef56456726c982cee606d5b95ce3e848cd8f966d2ec4624a48acc190388402f5840e6e02b244213ea03bea260f2bd6abb2071862ccf87a3455909b668067cbf6c92f6a693b4290c1b078d98b2b60be6d5604c1a466abd057b53aed35c2704feb92a363ff9ae4b528080f9ce7233b26e87d11a685d4e2246e5827f767ad6aaf9a0715bbbc92f3b12cf965904880304b425cf0dc92de861c36a233158983c40988298e86145a157caffd2ab0276a910d1a60ee101b235a7cf991aa1165757d8e0040b1ee095f7ea14d0835927b865545b8a002709fefe0c43c6151ba744f55a03fad444130db000f38e68aa0a0c91023a40affa4f8d191600041fe6938129c00c1a94b7d9f3494ee5944be69b75fa428ce7fe8eeaf0fa7a886c4dc86796c299a63aab73b5bb4db5610e9a938d4a5aac7263ba4de616ac23250fb7b44ff52ad6d904fd4bc177063faf6d112cd2af57262dff34bf575af214716babbdc5f784349fcaf6237c186eb6159ab6014a4de5102f00911eca4103603716d27018da059d414ebaa3dc7de00b11a1bb295296b426f0d294ec32f252886f6302be880194b7e12bee58a11409ff5fb311ed308b1e45bae9a92c23316f03cebfc1331a353c81ada61203868d7ecd67f19bb734e45ef28829b03034baa42bf5268be74c5e5f93053e3e20038d7e5c69d368ce138a4bfbe3cd332414719b1f3f0b7f8fec8890da96dc306dbe0133fc4864818bf83e12b4ed2dbe05d0261606a87d1d471280985b32049b7c037e608ca9c585d7540178dc553abaf5cc107227c14cf73d808cb7e06b38b37f30d5e700769add6db57b23069bdd38c732b089cc3f676de179b54c8464e41d9331570acca5da37df6c0fd881da96758da6df927b2a042ce8d2a8b3d5e0f380fcc275b827b61518382900b087410bd5d3e4ea2a29c26f0b9ed8d846626ac396857b56839f7f864140c7076498895fc35c78d20555f0106158fb611b620e815a80e7fd6e5e2a790c96c619882e99c01bb26e8ca307d8c7e7516b593156d81fe6d9d59d6b3a74b967866b55f3c9ccb4f7e494252da119f2c6ca38755df4a0edc9628902f86b11e57df0f0b71d7cb0515ed8783fcc4eaa70c0f0ceb54a00a3cd051ffdb0eda0455d8f725a06f0d1b6d88ef59486c6b5c16102767fc73ed390d7346054c77a4e9d00cbf3d7e4a3e6d15ae8be06d0a8158080d8839f4d78a47f87f8cae95075ae5a333a79f7711f33f2d30cb6411ff4a085cde036016745d2e8e8d1f5f5ffbbada9ae05a4a7f963f29e6ab6f58c79324f71f9620692e85f5fc3ddedce2a4b7be6f431dd7d4622d39d29f5eeab6be6546ce4b93c00fde7492200d5b1b77f27778f49065a0c30a0477147cf1e5f9c8742b66301453fe48cc98ba1a0c078a4d3daf0cd5b69d340653e86ee9d753375666fcd5be621b032483ca0c992c992f6dd01e28bc506eab76649da21a5ff6652ed623f2e6cbbfe10c6004cde1dcbdd009ab3b836df98bf19a01b11d636633461ed0a460ce12aa143260db0df29b6fd6d70d5f03a8f79b5dc68dd8bb9c6c9916d9a47e8ea80ade78decad83b87f3b0487a980ddec0198c44018618da5425e63dbc6a2ded2bebf7b1c79c3847ae4f40f0fd0807cc27c6489fab5a920bf79ff7ae06ddd6cf701ecbe038c80d382b63b49e97fc0c286e8cf9deada467d26cd77f7f8e8859442aafe04158665f62db817b164a943322387df63a6ca1ba1b9cfbe2a43a50e9760e208956af3c7053539865757f0d4fbc06306ba0758861d393f1dc5f111780fd7d747452622a08c85e42c09a295855ad8c8b0da48f8cd67a754124dfa1355eae26b5246ac208c4b016befbb6fff7ebb79290d992eb3b4ca2c597cfca3c9db1f973c5be4eee4b7304816e489ffa4969b7aa72be89decd9a19cd3ba2ad884b8668aad0133b965c19320471398a2f2452615f3cad3275ec2f4c4999d6529a61293097929641677f3df4675a1a08f25d76136f700844c7c1ac5e1a4ec6a22192c98c248eecf20e54a93f7f6c18ebdad99900ff49742ae2681f033044379b6f269fdf66626c995ca708a3f667d299d7be801160ba6ec3372d293d4ba3e11d184e9c19311f2dc5a22128b8046a53897fe82ad63f4b7d47f5b754103d623b7a6d00d388dc4b2d782db0af9d99e012b6eeba06506cda311037934ff17f18e8682874f9bcd7a5dc64d66877d86c2d84883abf832e9f7ef4e4ad064f7b6869d099f0e9899beb9755da6b4d955959fa818d8414c4c9c3382c0f780c072a1a3cd08578492540a002531b90441212b9008f20a782b61e94805f2bc06f1f780eb5640fb5ec8a288a7cf1af348475bcb86d9b439792691d06455f6ca932c2b7c0fd2c49385b801596a2759b6585f70e056840724a4e2b947de19334b421105fb5efb22537b60e58b3cf0ef61dd8b90ecfe97be9ec0de5c91823b78f232629addcaea5769d0d0bd311edebe96fbd5e9c042f3e0d30e5b8525e646fb59ed1b58d9d6d1894663f3c2fb154039cd17dcb719e8f7e280aaf0593d2458bd746e4605bf6efdeb152e41a509fe8780bc75a8d3dce29bb6167baeaee2152ce617e28759728ed1c0c1a1e019addc7dc336e52a5baaf6881c814a2e2096789e507041ed31ae4f72d2edc6996c31e91e2f6554067de99198d030a0444c07ca898eca978fc5453b5fef241208553b4ec9b62a64c406ddfb41f855f8fedf9d3e8114e0d19463e72e0e114ccd8bcfe0ca76b6f542d5aa935775496f911a450983183da476309a0b21e3fc18235e3af9e173d4d617664dda16a246131b146929c6d5354fafee83bd750d9cbe8f67400b425e62e26ade9f797241231e907bf7fa4a032ef5aafd3e021d053a67b0e642dac181decdacc13905bc8f659d163c49f1c04bfe4eb0c3d76aa2a8c3c56b819a3e9be9e51f22689911a776bcddccdd244e8209c824be75c181e561443c23ff29e39205a03d66449d71d6c341038bbfc6a2992866a7dbba85e909cd99684c4e1b00506a8dd6a684bf9ed5b22bf9e54bdf4aa6d2cc024688279312bb5888e08d9d2406bafb401d00fd024f50633c080f1b3946ba67243f910746cbeab2b0c5e6ed9a21e79133e400a07f688cfb0c5e025161bead0016e201372986c1436f7862030a3cfb2504c060cf1883778107a0b0cb0372ce588a238d3974aa43aac994c533dcd44c85e904eeec612a9817b4674173e08a031fb410ded6a97a1b96c2689c5748db3aed6a2e082c011e0a83d1ce239a9c0f8cab1551eb0ff8f6db86b5aa4c31590b71c17a2d4e2358e8d09c5b38767e127191af902b2e52e953db517a4a6dbe58bf72f6aac9993d8f98280dfb026667e796a890603fca4cbab232ef87da67e5f6c53b6a5fc56170e57971b905178315b08dfb862d800830a41ff45930727c4c2cce4156579deecaef72ac675a6ec9f717c670e0fb3c4a144ba9c4438c7de7d92be3c8d3230ce415e980e5f0317ab0b661ce9ea22198ad9449b35bd24c0b8c91f8c484db400a572803b8f039f9112b3e9d20ad5b807ee53b95da61647ac1f2c3d2cdc5af198c6297de25567d06f4fba2d5df1d542d47d4bffda20d2d368633162d9c0d233751397b3c154f60d6590e5a00deeee813eab0b964ed5cc35343a23b8beda353a9d88cb7b1d6bf02deae9f18d90bea1e22b83fec8dc9ed7bc1de15210f2f5bd8bba77404f6b655f1e07ae310e45a045ece0a3791e61e94bf7f502d43d4598ee290ea003cdfb0efbcb7079a2a2c4eb2847fca301f2715db6d41ed4aed03312d8e96f8b8a7acc2c767781e18e668432760431636b64dcab3c92b8fbcce31253e57c0528495f60b2f166c983caf21f4b66198163b5aa618cd370851d6d7b8c4b4b6d657755407a94362d837841b87aa635509cf6eaf53265b3e529db07243a1f0c15895328d9b4af5cfc969a55685e2d87a3baa4e79ec778437fbb55a635937a437b6b4d21cbc476cd65496c2e332073a112fc24099f4c82f1cf405a4c797cc2047be201c03c24c99ef623034371e41b9d31c7869be24487d54ae29863d67ff9c4ecc6fe1b666989647f1ed53f92d3ed45c5bb9ccee37b4d00d378f77501c3be98daa5313ba8ef2a4c8a7dbf7f4ea6ff2f180e25c7cee0b32f48a7a4ddcad84961406a4b43a8a59ff2a863d39dae365f7ebd7f858893d4b8bf186540234f751a01652c428350004158901c3a02456010b7560bec1d2ae5004106cecc0f8e597b9a42a3c1352cab7d285a3911bfdbdba96b7ba588dc39fa47b4ef586160c9db8bc0b32e7daae5f1e25229718f289843847ec8f8a9c2f94473e2ab3502f9f7fb067a58d62df98639f1fef33694d43d3ee5bac763afada5cf4bdaea602df0415c0746412298b2c4aa77304af9d0bbe9fc53d3323b01f2bc241a0d29873bdc484e66aa61013047670d0ab40ed50c4b041af1b3eac86d01744c481373035beb336fb0b6a3faf19736e26b764c6aacc4d1e7e92833fdcba5646a47d7cbf0dc6033faa79c14c80d4e0b7986a3f848d0e76b56855b646186929dc19e4c86d0728f20fec35fd82da8ef79f0005fa455f199018fd15c39b0c48141ffc1b4a99c88bbfbb68445f8880545f2fdc7370607857a92709f79577ce96f7576bb941c54692b31fad55b912bdfb45ed35565ed143e9c4f0f17d742eee239cef9424e69cebfd5e92cd5d11f074de98077860a9ba371fd446803db89995db190a548bd03aa7a8aa8af7f989af62ff33dfc3f33031102abc4ded21828af46f83c1ed1e891858b9fab6dbcbd8b910d17ae6f59761c2438b7deb58b406057c15170677fe352cea0705bd0f6f420996193fbb393de82d4b6168c0e0e08faf257ffbf8eadf5c43b6e1c04d6ac777f7426aabaf06ff6111dd686c8497f6cf44d8dc318072f86950f3a7177eb748cc94ceda157fff9431b9721f7b87de93cdb5abbff0f07bfb0f3cac6d47d3b45501e66a4e8a01f0317fe7e3ff000000ffff010000ffffcb897872f8630000") gr, _ = gzip.NewReader(bytes.NewBuffer(bs)) bs, _ = ioutil.ReadAll(gr) Assets["index.html"] = bs diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go index f0591d0f6..d464394bb 100644 --- a/cmd/syncthing/main.go +++ b/cmd/syncthing/main.go @@ -252,8 +252,8 @@ func main() { if repo.Invalid != "" { continue } - dir := expandTilde(repo.Directory) - m.AddRepo(repo.ID, dir, repo.Nodes) + repo.Directory = expandTilde(repo.Directory) + m.AddRepo(repo) } // GUI diff --git a/config/config.go b/config/config.go index 37c79ad3a..65016d706 100644 --- a/config/config.go +++ b/config/config.go @@ -27,12 +27,13 @@ type Configuration struct { } type RepositoryConfiguration struct { - ID string `xml:"id,attr"` - Directory string `xml:"directory,attr"` - Nodes []NodeConfiguration `xml:"node"` - ReadOnly bool `xml:"ro,attr"` - Invalid string `xml:"-"` // Set at runtime when there is an error, not saved - nodeIDs []string + ID string `xml:"id,attr"` + Directory string `xml:"directory,attr"` + Nodes []NodeConfiguration `xml:"node"` + ReadOnly bool `xml:"ro,attr"` + IgnorePerms bool `xml:"ignorePerms,attr"` + Invalid string `xml:"-"` // Set at runtime when there is an error, not saved + nodeIDs []string } func (r *RepositoryConfiguration) NodeIDs() []string { diff --git a/gui/index.html b/gui/index.html index 11fa62dc9..e4786a7eb 100644 --- a/gui/index.html +++ b/gui/index.html @@ -166,6 +166,13 @@ No + +  Ignore Permissions + + Yes + No + +  Shared With @@ -477,6 +484,14 @@

Files are protected from changes made on other nodes, but changes made on this node will be sent to the rest of the cluster.

+
+
+ +
+

File permission bits are ignored when looking for changes. Use on FAT filesystems.

+
diff --git a/model/model.go b/model/model.go index 4f60aedd8..3b386f8f7 100644 --- a/model/model.go +++ b/model/model.go @@ -43,12 +43,12 @@ type Model struct { clientName string clientVersion string - repoDirs map[string]string // repo -> dir - repoFiles map[string]*files.Set // repo -> files - repoNodes map[string][]string // repo -> nodeIDs - nodeRepos map[string][]string // nodeID -> repos - suppressor map[string]*suppressor // repo -> suppressor - rmut sync.RWMutex // protects the above + repoCfgs map[string]config.RepositoryConfiguration // repo -> cfg + repoFiles map[string]*files.Set // repo -> files + repoNodes map[string][]string // repo -> nodeIDs + nodeRepos map[string][]string // nodeID -> repos + suppressor map[string]*suppressor // repo -> suppressor + rmut sync.RWMutex // protects the above repoState map[string]repoState // repo -> state smut sync.RWMutex @@ -80,7 +80,7 @@ func NewModel(indexDir string, cfg *config.Configuration, clientName, clientVers cfg: cfg, clientName: clientName, clientVersion: clientVersion, - repoDirs: make(map[string]string), + repoCfgs: make(map[string]config.RepositoryConfiguration), repoFiles: make(map[string]*files.Set), repoNodes: make(map[string][]string), nodeRepos: make(map[string][]string), @@ -104,10 +104,10 @@ func (m *Model) StartRepoRW(repo string, threads int) { m.rmut.RLock() defer m.rmut.RUnlock() - if dir, ok := m.repoDirs[repo]; !ok { + if cfg, ok := m.repoCfgs[repo]; !ok { panic("cannot start without repo") } else { - newPuller(repo, dir, m, threads, m.cfg) + newPuller(cfg, m, threads, m.cfg) } } @@ -386,7 +386,7 @@ func (m *Model) Request(nodeID, repo, name string, offset int64, size int) ([]by l.Debugf("REQ(in): %s: %q / %q o=%d s=%d", nodeID, repo, name, offset, size) } m.rmut.RLock() - fn := filepath.Join(m.repoDirs[repo], name) + fn := filepath.Join(m.repoCfgs[repo].Directory, name) m.rmut.RUnlock() fd, err := os.Open(fn) // XXX: Inefficient, should cache fd? if err != nil { @@ -582,23 +582,23 @@ func (m *Model) broadcastIndexLoop() { } } -func (m *Model) AddRepo(id, dir string, nodes []config.NodeConfiguration) { +func (m *Model) AddRepo(cfg config.RepositoryConfiguration) { if m.started { panic("cannot add repo to started model") } - if len(id) == 0 { + if len(cfg.ID) == 0 { panic("cannot add empty repo id") } m.rmut.Lock() - m.repoDirs[id] = dir - m.repoFiles[id] = files.NewSet() - m.suppressor[id] = &suppressor{threshold: int64(m.cfg.Options.MaxChangeKbps)} + m.repoCfgs[cfg.ID] = cfg + m.repoFiles[cfg.ID] = files.NewSet() + m.suppressor[cfg.ID] = &suppressor{threshold: int64(m.cfg.Options.MaxChangeKbps)} - m.repoNodes[id] = make([]string, len(nodes)) - for i, node := range nodes { - m.repoNodes[id][i] = node.NodeID - m.nodeRepos[node.NodeID] = append(m.nodeRepos[node.NodeID], id) + m.repoNodes[cfg.ID] = make([]string, len(cfg.Nodes)) + for i, node := range cfg.Nodes { + m.repoNodes[cfg.ID][i] = node.NodeID + m.nodeRepos[node.NodeID] = append(m.nodeRepos[node.NodeID], cfg.ID) } m.addedRepo = true @@ -607,8 +607,8 @@ func (m *Model) AddRepo(id, dir string, nodes []config.NodeConfiguration) { func (m *Model) ScanRepos() { m.rmut.RLock() - var repos = make([]string, 0, len(m.repoDirs)) - for repo := range m.repoDirs { + var repos = make([]string, 0, len(m.repoCfgs)) + for repo := range m.repoCfgs { repos = append(repos, repo) } m.rmut.RUnlock() @@ -627,9 +627,9 @@ func (m *Model) ScanRepos() { func (m *Model) CleanRepos() { m.rmut.RLock() - var dirs = make([]string, 0, len(m.repoDirs)) - for _, dir := range m.repoDirs { - dirs = append(dirs, dir) + var dirs = make([]string, 0, len(m.repoCfgs)) + for _, cfg := range m.repoCfgs { + dirs = append(dirs, cfg.Directory) } m.rmut.RUnlock() @@ -651,12 +651,13 @@ func (m *Model) CleanRepos() { func (m *Model) ScanRepo(repo string) error { m.rmut.RLock() w := &scanner.Walker{ - Dir: m.repoDirs[repo], + Dir: m.repoCfgs[repo].Directory, IgnoreFile: ".stignore", BlockSize: scanner.StandardBlockSize, TempNamer: defTempNamer, Suppressor: m.suppressor[repo], CurrentFiler: cFiler{m, repo}, + IgnorePerms: m.repoCfgs[repo].IgnorePerms, } m.rmut.RUnlock() m.setState(repo, RepoScanning) @@ -671,7 +672,7 @@ func (m *Model) ScanRepo(repo string) error { func (m *Model) SaveIndexes(dir string) { m.rmut.RLock() - for repo := range m.repoDirs { + for repo := range m.repoCfgs { fs := m.protocolIndex(repo) m.saveIndex(repo, dir, fs) } @@ -680,7 +681,7 @@ func (m *Model) SaveIndexes(dir string) { func (m *Model) LoadIndexes(dir string) { m.rmut.RLock() - for repo := range m.repoDirs { + for repo := range m.repoCfgs { fs := m.loadIndex(repo, dir) m.SeedLocal(repo, fs) } @@ -688,7 +689,7 @@ func (m *Model) LoadIndexes(dir string) { } func (m *Model) saveIndex(repo string, dir string, fs []protocol.FileInfo) { - id := fmt.Sprintf("%x", sha1.Sum([]byte(m.repoDirs[repo]))) + id := fmt.Sprintf("%x", sha1.Sum([]byte(m.repoCfgs[repo].Directory))) name := id + ".idx.gz" name = filepath.Join(dir, name) @@ -710,7 +711,7 @@ func (m *Model) saveIndex(repo string, dir string, fs []protocol.FileInfo) { } func (m *Model) loadIndex(repo string, dir string) []protocol.FileInfo { - id := fmt.Sprintf("%x", sha1.Sum([]byte(m.repoDirs[repo]))) + id := fmt.Sprintf("%x", sha1.Sum([]byte(m.repoCfgs[repo].Directory))) name := id + ".idx.gz" name = filepath.Join(dir, name) diff --git a/model/puller.go b/model/puller.go index e5e69fc1a..34e92f34e 100644 --- a/model/puller.go +++ b/model/puller.go @@ -63,8 +63,7 @@ var errNoNode = errors.New("no available source node") type puller struct { cfg *config.Configuration - repo string - dir string + repoCfg config.RepositoryConfiguration bq *blockQueue model *Model oustandingPerNode activityMap @@ -74,11 +73,10 @@ type puller struct { requestResults chan requestResult } -func newPuller(repo, dir string, model *Model, slots int, cfg *config.Configuration) *puller { +func newPuller(repoCfg config.RepositoryConfiguration, model *Model, slots int, cfg *config.Configuration) *puller { p := &puller{ + repoCfg: repoCfg, cfg: cfg, - repo: repo, - dir: dir, bq: newBlockQueue(), model: model, oustandingPerNode: make(activityMap), @@ -94,13 +92,13 @@ func newPuller(repo, dir string, model *Model, slots int, cfg *config.Configurat p.requestSlots <- true } if debug { - l.Debugf("starting puller; repo %q dir %q slots %d", repo, dir, slots) + l.Debugf("starting puller; repo %q dir %q slots %d", repoCfg.ID, repoCfg.Directory, slots) } go p.run() } else { // Read only if debug { - l.Debugf("starting puller; repo %q dir %q (read only)", repo, dir) + l.Debugf("starting puller; repo %q dir %q (read only)", repoCfg.ID, repoCfg.Directory) } go p.runRO() } @@ -114,7 +112,7 @@ func (p *puller) run() { <-p.requestSlots b := p.bq.get() if debug { - l.Debugf("filler: queueing %q / %q offset %d copy %d", p.repo, b.file.Name, b.block.Offset, len(b.copy)) + l.Debugf("filler: queueing %q / %q offset %d copy %d", p.repoCfg.ID, b.file.Name, b.block.Offset, len(b.copy)) } p.blocks <- b } @@ -130,13 +128,13 @@ func (p *puller) run() { for { select { case res := <-p.requestResults: - p.model.setState(p.repo, RepoSyncing) + p.model.setState(p.repoCfg.ID, RepoSyncing) changed = true p.requestSlots <- true p.handleRequestResult(res) case b := <-p.blocks: - p.model.setState(p.repo, RepoSyncing) + p.model.setState(p.repoCfg.ID, RepoSyncing) changed = true if p.handleBlock(b) { // Block was fully handled, free up the slot @@ -149,7 +147,7 @@ func (p *puller) run() { break pull } if debug { - l.Debugf("%q: idle but have %d open files", p.repo, len(p.openFiles)) + l.Debugf("%q: idle but have %d open files", p.repoCfg.ID, len(p.openFiles)) i := 5 for _, f := range p.openFiles { l.Debugf(" %v", f) @@ -163,22 +161,22 @@ func (p *puller) run() { } if changed { - p.model.setState(p.repo, RepoCleaning) + p.model.setState(p.repoCfg.ID, RepoCleaning) p.fixupDirectories() changed = false } - p.model.setState(p.repo, RepoIdle) + p.model.setState(p.repoCfg.ID, RepoIdle) // Do a rescan if it's time for it select { case <-walkTicker: if debug { - l.Debugf("%q: time for rescan", p.repo) + l.Debugf("%q: time for rescan", p.repoCfg.ID) } - err := p.model.ScanRepo(p.repo) + err := p.model.ScanRepo(p.repoCfg.ID) if err != nil { - invalidateRepo(p.cfg, p.repo, err) + invalidateRepo(p.cfg, p.repoCfg.ID, err) return } @@ -195,11 +193,11 @@ func (p *puller) runRO() { for _ = range walkTicker { if debug { - l.Debugf("%q: time for rescan", p.repo) + l.Debugf("%q: time for rescan", p.repoCfg.ID) } - err := p.model.ScanRepo(p.repo) + err := p.model.ScanRepo(p.repoCfg.ID) if err != nil { - invalidateRepo(p.cfg, p.repo, err) + invalidateRepo(p.cfg, p.repoCfg.ID, err) return } } @@ -214,7 +212,7 @@ func (p *puller) fixupDirectories() { return nil } - rn, err := filepath.Rel(p.dir, path) + rn, err := filepath.Rel(p.repoCfg.Directory, path) if err != nil { return nil } @@ -223,7 +221,7 @@ func (p *puller) fixupDirectories() { return nil } - cur := p.model.CurrentRepoFile(p.repo, rn) + cur := p.model.CurrentRepoFile(p.repoCfg.ID, rn) if cur.Name != rn { // No matching dir in current list; weird if debug { @@ -276,7 +274,7 @@ func (p *puller) fixupDirectories() { for { deleteDirs = nil changed = 0 - filepath.Walk(p.dir, walkFn) + filepath.Walk(p.repoCfg.Directory, walkFn) var deleted = 0 // Delete any queued directories @@ -320,7 +318,7 @@ func (p *puller) handleRequestResult(res requestResult) { p.openFiles[f.Name] = of if debug { - l.Debugf("pull: wrote %q / %q offset %d outstanding %d done %v", p.repo, f.Name, res.offset, of.outstanding, of.done) + l.Debugf("pull: wrote %q / %q offset %d outstanding %d done %v", p.repoCfg.ID, f.Name, res.offset, of.outstanding, of.done) } if of.done && of.outstanding == 0 { @@ -338,7 +336,7 @@ func (p *puller) handleBlock(b bqBlock) bool { // Deleted directories we mark as handled and delete later. if protocol.IsDirectory(f.Flags) { if !protocol.IsDeleted(f.Flags) { - path := filepath.Join(p.dir, f.Name) + path := filepath.Join(p.repoCfg.Directory, f.Name) _, err := os.Stat(path) if err != nil && os.IsNotExist(err) { if debug { @@ -352,7 +350,7 @@ func (p *puller) handleBlock(b bqBlock) bool { } else if debug { l.Debugf("ignore delete dir: %v", f) } - p.model.updateLocal(p.repo, f) + p.model.updateLocal(p.repoCfg.ID, f) return true } @@ -361,12 +359,12 @@ func (p *puller) handleBlock(b bqBlock) bool { if !ok { if debug { - l.Debugf("pull: %q: opening file %q", p.repo, f.Name) + l.Debugf("pull: %q: opening file %q", p.repoCfg.ID, f.Name) } - of.availability = uint64(p.model.repoFiles[p.repo].Availability(f.Name)) - of.filepath = filepath.Join(p.dir, f.Name) - of.temp = filepath.Join(p.dir, defTempNamer.TempName(f.Name)) + of.availability = uint64(p.model.repoFiles[p.repoCfg.ID].Availability(f.Name)) + of.filepath = filepath.Join(p.repoCfg.Directory, f.Name) + of.temp = filepath.Join(p.repoCfg.Directory, defTempNamer.TempName(f.Name)) dirName := filepath.Dir(of.filepath) _, err := os.Stat(dirName) @@ -374,13 +372,13 @@ func (p *puller) handleBlock(b bqBlock) bool { err = os.MkdirAll(dirName, 0777) } if err != nil { - l.Debugf("pull: error: %q / %q: %v", p.repo, f.Name, err) + l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, err) } of.file, of.err = os.Create(of.temp) if of.err != nil { if debug { - l.Debugf("pull: error: %q / %q: %v", p.repo, f.Name, of.err) + l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, of.err) } if !b.last { p.openFiles[f.Name] = of @@ -393,7 +391,7 @@ func (p *puller) handleBlock(b bqBlock) bool { if of.err != nil { // We have already failed this file. if debug { - l.Debugf("pull: error: %q / %q has already failed: %v", p.repo, f.Name, of.err) + l.Debugf("pull: error: %q / %q has already failed: %v", p.repoCfg.ID, f.Name, of.err) } if b.last { delete(p.openFiles, f.Name) @@ -424,14 +422,14 @@ func (p *puller) handleCopyBlock(b bqBlock) { of := p.openFiles[f.Name] if debug { - l.Debugf("pull: copying %d blocks for %q / %q", len(b.copy), p.repo, f.Name) + l.Debugf("pull: copying %d blocks for %q / %q", len(b.copy), p.repoCfg.ID, f.Name) } var exfd *os.File exfd, of.err = os.Open(of.filepath) if of.err != nil { if debug { - l.Debugf("pull: error: %q / %q: %v", p.repo, f.Name, of.err) + l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, of.err) } of.file.Close() of.file = nil @@ -450,7 +448,7 @@ func (p *puller) handleCopyBlock(b bqBlock) { buffers.Put(bs) if of.err != nil { if debug { - l.Debugf("pull: error: %q / %q: %v", p.repo, f.Name, of.err) + l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, of.err) } exfd.Close() of.file.Close() @@ -493,10 +491,10 @@ func (p *puller) handleRequestBlock(b bqBlock) bool { go func(node string, b bqBlock) { if debug { - l.Debugf("pull: requesting %q / %q offset %d size %d from %q outstanding %d", p.repo, f.Name, b.block.Offset, b.block.Size, node, of.outstanding) + l.Debugf("pull: requesting %q / %q offset %d size %d from %q outstanding %d", p.repoCfg.ID, f.Name, b.block.Offset, b.block.Size, node, of.outstanding) } - bs, err := p.model.requestGlobal(node, p.repo, f.Name, b.block.Offset, int(b.block.Size), nil) + bs, err := p.model.requestGlobal(node, p.repoCfg.ID, f.Name, b.block.Offset, int(b.block.Size), nil) p.requestResults <- requestResult{ node: node, file: f, @@ -527,24 +525,24 @@ func (p *puller) handleEmptyBlock(b bqBlock) { os.Remove(of.temp) os.Chmod(of.filepath, 0666) if err := os.Remove(of.filepath); err == nil || os.IsNotExist(err) { - p.model.updateLocal(p.repo, f) + p.model.updateLocal(p.repoCfg.ID, f) } } else { if debug { - l.Debugf("pull: no blocks to fetch and nothing to copy for %q / %q", p.repo, f.Name) + l.Debugf("pull: no blocks to fetch and nothing to copy for %q / %q", p.repoCfg.ID, f.Name) } t := time.Unix(f.Modified, 0) if os.Chtimes(of.temp, t, t) != nil { delete(p.openFiles, f.Name) return } - if protocol.HasPermissionBits(f.Flags) && os.Chmod(of.temp, os.FileMode(f.Flags&0777)) != nil { + if !p.repoCfg.IgnorePerms && protocol.HasPermissionBits(f.Flags) && os.Chmod(of.temp, os.FileMode(f.Flags&0777)) != nil { delete(p.openFiles, f.Name) return } defTempNamer.Show(of.temp) if Rename(of.temp, of.filepath) == nil { - p.model.updateLocal(p.repo, f) + p.model.updateLocal(p.repoCfg.ID, f) } } delete(p.openFiles, f.Name) @@ -552,8 +550,8 @@ func (p *puller) handleEmptyBlock(b bqBlock) { func (p *puller) queueNeededBlocks() { queued := 0 - for _, f := range p.model.NeedFilesRepo(p.repo) { - lf := p.model.CurrentRepoFile(p.repo, f.Name) + for _, f := range p.model.NeedFilesRepo(p.repoCfg.ID) { + lf := p.model.CurrentRepoFile(p.repoCfg.ID, f.Name) have, need := scanner.BlockDiff(lf.Blocks, f.Blocks) if debug { l.Debugf("need:\n local: %v\n global: %v\n haveBlocks: %v\n needBlocks: %v", lf, f, have, need) @@ -566,13 +564,13 @@ func (p *puller) queueNeededBlocks() { }) } if debug && queued > 0 { - l.Debugf("%q: queued %d blocks", p.repo, queued) + l.Debugf("%q: queued %d blocks", p.repoCfg.ID, queued) } } func (p *puller) closeFile(f scanner.File) { if debug { - l.Debugf("pull: closing %q / %q", p.repo, f.Name) + l.Debugf("pull: closing %q / %q", p.repoCfg.ID, f.Name) } of := p.openFiles[f.Name] @@ -584,7 +582,7 @@ func (p *puller) closeFile(f scanner.File) { fd, err := os.Open(of.temp) if err != nil { if debug { - l.Debugf("pull: error: %q / %q: %v", p.repo, f.Name, err) + l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, err) } return } @@ -593,31 +591,37 @@ func (p *puller) closeFile(f scanner.File) { if l0, l1 := len(hb), len(f.Blocks); l0 != l1 { if debug { - l.Debugf("pull: %q / %q: nblocks %d != %d", p.repo, f.Name, l0, l1) + l.Debugf("pull: %q / %q: nblocks %d != %d", p.repoCfg.ID, f.Name, l0, l1) } return } for i := range hb { if bytes.Compare(hb[i].Hash, f.Blocks[i].Hash) != 0 { - l.Debugf("pull: %q / %q: block %d hash mismatch", p.repo, f.Name, i) + l.Debugf("pull: %q / %q: block %d hash mismatch", p.repoCfg.ID, f.Name, i) return } } t := time.Unix(f.Modified, 0) - os.Chtimes(of.temp, t, t) - if protocol.HasPermissionBits(f.Flags) { - os.Chmod(of.temp, os.FileMode(f.Flags&0777)) + err = os.Chtimes(of.temp, t, t) + if debug && err != nil { + l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, err) + } + if !p.repoCfg.IgnorePerms && protocol.HasPermissionBits(f.Flags) { + err = os.Chmod(of.temp, os.FileMode(f.Flags&0777)) + if debug && err != nil { + l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, err) + } } defTempNamer.Show(of.temp) if debug { - l.Debugf("pull: rename %q / %q: %q", p.repo, f.Name, of.filepath) + l.Debugf("pull: rename %q / %q: %q", p.repoCfg.ID, f.Name, of.filepath) } if err := Rename(of.temp, of.filepath); err == nil { - p.model.updateLocal(p.repo, f) + p.model.updateLocal(p.repoCfg.ID, f) } else { - l.Debugf("pull: error: %q / %q: %v", p.repo, f.Name, err) + l.Debugf("pull: error: %q / %q: %v", p.repoCfg.ID, f.Name, err) } } diff --git a/scanner/walk.go b/scanner/walk.go index 5ab6ca4c3..25c30720e 100644 --- a/scanner/walk.go +++ b/scanner/walk.go @@ -29,10 +29,10 @@ type Walker struct { // Suppressed files will be returned with empty metadata and the Suppressed flag set. // Requires CurrentFiler to be set. Suppressor Suppressor - // If IgnorePermissions is true, changes to permission bits will not be + // If IgnorePerms is true, changes to permission bits will not be // detected. Scanned files will get zero permission bits and the // NoPermissionBits flag set. - IgnorePermissions bool + IgnorePerms bool } type TempNamer interface { @@ -166,7 +166,7 @@ func (w *Walker) walkAndHashFiles(res *[]File, ign map[string][]string) filepath if info.Mode().IsDir() { if w.CurrentFiler != nil { cf := w.CurrentFiler.CurrentFile(rn) - permUnchanged := w.IgnorePermissions || !protocol.HasPermissionBits(cf.Flags) || PermsEqual(cf.Flags, uint32(info.Mode())) + permUnchanged := w.IgnorePerms || !protocol.HasPermissionBits(cf.Flags) || PermsEqual(cf.Flags, uint32(info.Mode())) if cf.Modified == info.ModTime().Unix() && protocol.IsDirectory(cf.Flags) && permUnchanged { if debug { l.Debugln("unchanged:", cf) @@ -174,7 +174,7 @@ func (w *Walker) walkAndHashFiles(res *[]File, ign map[string][]string) filepath *res = append(*res, cf) } else { var flags uint32 = protocol.FlagDirectory - if w.IgnorePermissions { + if w.IgnorePerms { flags |= protocol.FlagNoPermBits } else { flags |= uint32(info.Mode() & os.ModePerm) @@ -197,7 +197,7 @@ func (w *Walker) walkAndHashFiles(res *[]File, ign map[string][]string) filepath if info.Mode().IsRegular() { if w.CurrentFiler != nil { cf := w.CurrentFiler.CurrentFile(rn) - permUnchanged := w.IgnorePermissions || !protocol.HasPermissionBits(cf.Flags) || PermsEqual(cf.Flags, uint32(info.Mode())) + permUnchanged := w.IgnorePerms || !protocol.HasPermissionBits(cf.Flags) || PermsEqual(cf.Flags, uint32(info.Mode())) if !protocol.IsDeleted(cf.Flags) && cf.Modified == info.ModTime().Unix() && permUnchanged { if debug { l.Debugln("unchanged:", cf) @@ -249,7 +249,7 @@ func (w *Walker) walkAndHashFiles(res *[]File, ign map[string][]string) filepath } var flags = uint32(info.Mode() & os.ModePerm) - if w.IgnorePermissions { + if w.IgnorePerms { flags = protocol.FlagNoPermBits } f := File{