当前位置: 首页 > wzjs >正文

西宁的网站建设公司618网络营销策划方案

西宁的网站建设公司,618网络营销策划方案,网站百度多久做一次排名,承德网站开发公司NAS - SyncthingAndroid 文章目录 NAS - SyncthingAndroid参考资料编译解决编译遇到的各种问题gradle 无法下载syncthing.git 访问不可达golang 访问不可达防坑 总结 NAS - SyncthingAndroid 之所以了解SyncthingAndroid 开源项目,是因为最近两年关注到一款产品 NA…

NAS - SyncthingAndroid

文章目录

  • NAS - SyncthingAndroid
  • 参考资料
  • 编译
  • 解决编译遇到的各种问题
    • gradle 无法下载
    • syncthing.git 访问不可达
    • golang 访问不可达
    • 防坑
  • 总结


NAS - SyncthingAndroid

之所以了解SyncthingAndroid 开源项目,是因为最近两年关注到一款产品 NAS产品,恰好有朋友在做这款产品,就去研究了一下基于NAS产品的一些技术实现。

国内已经有非常成熟的生产厂商了,也在大面积铺货。 从时间技术上 SyncthingAndroid 并不是唯一技术实现,服务端可以用samba或者webdav 文件挂载,穿透方案可以用
n2n,Android和ios 叫hin2n,国外用syncthing 开源整体方案来做。

这里针对 SyncthingAndroid 端来讲一下环境搭建问题。
在这里插入图片描述

参考资料

syncthing-android
syncthing-android-fdroid

这里将的是syncthing-android-fdroid 环境搭建,其实它就是基于 syncthing-android 实现的。

编译

其实开源软件已经说明了 用 Linux 或者 SSL 推荐的编译方式,且编译步骤已经说明了的。


Build on Debian Linux / WSL - recommended way
A Linux VM, for example running Debian, is recommended to build this.Build SyncthingNative and the Syncthing-Android wrapper using the following commands:#
# Install prerequisites.
apt-get -y install gcc git openjdk-17-jdk python3 unzip
#
# Clone repository.
mkdir -p ~/git && cd ~/git
git clone https://github.com/Catfriend1/syncthing-android.git --recursive
## git stash && git pull origin Catfriend1-patch-1 && git checkout Catfriend1-patch-1
#
# Build
cd ~/git/syncthing-android
python3 install_minimum_android_sdk_prerequisites.py
./gradlew buildNative
export ANDROID_HOME=~/git/syncthing-android-prereq
echo -e "\norg.gradle.jvmargs=-Xmx4096m" >> gradle.properties
./gradlew lintDebug
./gradlew assembleDebug

解决编译遇到的各种问题

上面Build 已经说明了步骤,但是实际操作中会遇到各种问题,下面一一例举并说明修改方案。
为什么会遇到这些问题? 毕竟是在国内,开源项目会造成各种依赖条件不可达呗…

gradle 无法下载

root@wfc-VMware-Virtual-Platform:~/git/syncthing-android# ./gradlew buildNative
Downloading https://services.gradle.org/distributions/gradle-8.9-bin.zipException in thread "main" java.io.IOException: Downloading from https://services.gradle.org/distributions/gradle-8.9-bin.zip failed: timeout

解决方案,替换成阿里镜像:
修改文件:syncthing-android/gradle/wrapper/gradle-wrapper.properties

#Thu Sep 29 21:34:28 CEST 2022
# https://gradle.org/release-checksums/
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.9-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
#distributionSha256Sum=d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab
zipStoreBase=GRADLE_USER_HOME

syncthing.git 访问不可达

具体报错如下:

./gradlew buildNative
Downloading https://mirrors.cloud.tencent.com/gradle/gradle-8.9-bin.zip
............10%.............20%.............30%.............40%.............50%.............60%.............70%.............80%.............90%.............100%Welcome to Gradle 8.9!Here are the highlights of this release:- Enhanced Error and Warning Messages- IDE Integration Improvements- Daemon JVM InformationFor more details see https://docs.gradle.org/8.9/release-notes.htmlStarting a Gradle Daemon (subsequent builds will be faster)> Task :syncthing:checkPython
Using python 3.12.3 from /usr (python3)> Task :syncthing:buildNative
[python] python3 -u ./build-syncthing.pygit_bin='/usr/bin/git'Info: go is not available on the PATH. Trying install_goDownloading prebuilt-go to: /root/git/syncthing-android/syncthing/../../syncthing-android-prereq/go_1.24.1.tgzDownloaded prebuilt-go to: /root/git/syncthing-android/syncthing/../../syncthing-android-prereq/go_1.24.1.tgzSHA-256: /root/git/syncthing-android/syncthing/../../syncthing-android-prereq/go_1.24.1.tgz cb2396bae64183cdccf81a9a6df0aea3bce9511fc21469fb89a0c00470088073[ok] Checksum of /root/git/syncthing-android/syncthing/../../syncthing-android-prereq/go_1.24.1.tgz matches expected value.Extracting prebuilt-go ...Adding to PATH: /root/git/syncthing-android/syncthing/../../syncthing-android-prereq/go_1.24.1/bingo_bin='/root/git/syncthing-android/syncthing/../../syncthing-android-prereq/go_1.24.1/bin/go'ANDROID_NDK_HOME env var is not defined. Then, NDK_VERSION and ANDROID_SDK_ROOT env vars must be defined.Downloading NDK to: /root/git/syncthing-android/syncthing/../../syncthing-android-prereq/ndk_r28.zipDownloaded NDK to: /root/git/syncthing-android/syncthing/../../syncthing-android-prereq/ndk_r28.zipSHA-1: /root/git/syncthing-android/syncthing/../../syncthing-android-prereq/ndk_r28.zip 894f469c5192a116d21f412de27966140a530ebc[ok] Checksum of /root/git/syncthing-android/syncthing/../../syncthing-android-prereq/ndk_r28.zip matches expected value.Extracting NDK ...Adding ANDROID_NDK_HOME='/root/git/syncthing-android/syncthing/../../syncthing-android-prereq/android-ndk-r28'ANDROID_NDK_HOME='/root/git/syncthing-android/syncthing/../../syncthing-android-prereq/android-ndk-r28'Invoking git fetch ...fatal: unable to access 'https://github.com/syncthing/syncthing.git/': Recv failure: Connection reset by peerTraceback (most recent call last):File "/root/git/syncthing-android/syncthing/./build-syncthing.py", line 338, in <module>subprocess.check_call([File "/usr/lib/python3.12/subprocess.py", line 413, in check_callraise CalledProcessError(retcode, cmd)subprocess.CalledProcessError: Command '['git', '-C', '/root/git/syncthing-android/syncthing/src/github.com/syncthing/syncthing', 'fetch', '--tags']' returned non-zero exit status 128.> Task :syncthing:buildNative FAILEDFAILURE: Build failed with an exception.

这里一定要看清问题的本质:是 访问不可达,而不是 python 脚本问题,这个问题自己在开源平台上咨询过都是答非所问…

 fatal: unable to access 'https://github.com/syncthing/syncthing.git/': Recv failure: Connection reset by peer

所以,要怎么分析问题和解决问题?
这里有个天坑 ,因为我是国内环境,ubuntu 无法访问github,这个才是问题的本质,这里也是为什么 github 的 syncthing.git 无法访问的原因。

尝试解决方案:更改DNS 路由

vim /etc/systemd/resolved.confnameserver 8.8.8.8
nameserver 1.1.1.1vim  /etc/resolv.confnameserver 8.8.8.8
nameserver 1.1.1.1

然后尝试看看github 是否能访问,当然如果还是不行,尝试其它方法看看。

golang 访问不可达

报错日志如下:

root@wfc-VMware-Virtual-Platform:~/git/syncthing-android# ./gradlew buildNative> Task :syncthing:checkPython
Using python 3.12.3 from /usr (python3)> Task :syncthing:buildNative
[python] python3 -u ./build-syncthing.pygit_bin='/usr/bin/git'Info: go is not available on the PATH. Trying install_goDownloaded prebuilt-go to: /root/git/syncthing-android/syncthing/../../syncthing-android-prereq/go_1.24.1.tgzSHA-256: /root/git/syncthing-android/syncthing/../../syncthing-android-prereq/go_1.24.1.tgz cb2396bae64183cdccf81a9a6df0aea3bce9511fc21469fb89a0c00470088073[ok] Checksum of /root/git/syncthing-android/syncthing/../../syncthing-android-prereq/go_1.24.1.tgz matches expected value.Adding to PATH: /root/git/syncthing-android/syncthing/../../syncthing-android-prereq/go_1.24.1/bingo_bin='/root/git/syncthing-android/syncthing/../../syncthing-android-prereq/go_1.24.1/bin/go'ANDROID_NDK_HOME env var is not defined. Then, NDK_VERSION and ANDROID_SDK_ROOT env vars must be defined.Downloaded NDK to: /root/git/syncthing-android/syncthing/../../syncthing-android-prereq/ndk_r28.zipSHA-1: /root/git/syncthing-android/syncthing/../../syncthing-android-prereq/ndk_r28.zip 894f469c5192a116d21f412de27966140a530ebc[ok] Checksum of /root/git/syncthing-android/syncthing/../../syncthing-android-prereq/ndk_r28.zip matches expected value.Adding ANDROID_NDK_HOME='/root/git/syncthing-android/syncthing/../../syncthing-android-prereq/android-ndk-r28'ANDROID_NDK_HOME='/root/git/syncthing-android/syncthing/../../syncthing-android-prereq/android-ndk-r28'Invoking git fetch ...From https://github.com/syncthing/syncthing+ e2973ff2f...fa0d933e4 release-nightly -> origin/release-nightly  (forced update)Invoking git describe ...Cleaning go-build cacheBuilding syncthing version v1.29.4*** Building for armgo: github.com/AudriusButkevicius/recli@v0.0.7-0.20220911121932-d000ce8fbf0f: Get "https://proxy.golang.org/github.com/%21audrius%21butkevicius/recli/@v/v0.0.7-0.20220911121932-d000ce8fbf0f.mod": dial tcp 142.250.217.113:443: connect: connection refusedTraceback (most recent call last):File "/root/git/syncthing-android/syncthing/./build-syncthing.py", line 384, in <module>subprocess.check_call([go_bin, 'mod', 'download'], cwd=syncthing_dir)File "/usr/lib/python3.12/subprocess.py", line 413, in check_callraise CalledProcessError(retcode, cmd)subprocess.CalledProcessError: Command '['/root/git/syncthing-android/syncthing/../../syncthing-android-prereq/go_1.24.1/bin/go', 'mod', 'download']' returned non-zero exit status 1.> Task :syncthing:buildNative FAILEDFAILURE: Build failed with an exception.* What went wrong:
Execution failed for task ':syncthing:buildNative'.
> Python call failed: python3 -u ./build-syncthing.pyOUTPUT:git_bin='/usr/bin/git'Info: go is not available on the PATH. Trying install_goDownloaded prebuilt-go to: /root/git/syncthing-android/syncthing/../../syncthing-android-prereq/go_1.24.1.tgzSHA-256: /root/git/syncthing-android/syncthing/../../syncthing-android-prereq/go_1.24.1.tgz cb2396bae64183cdccf81a9a6df0aea3bce9511fc21469fb89a0c00470088073[ok] Checksum of /root/git/syncthing-android/syncthing/../../syncthing-android-prereq/go_1.24.1.tgz matches expected value.Adding to PATH: /root/git/syncthing-android/syncthing/../../syncthing-android-prereq/go_1.24.1/bingo_bin='/root/git/syncthing-android/syncthing/../../syncthing-android-prereq/go_1.24.1/bin/go'ANDROID_NDK_HOME env var is not defined. Then, NDK_VERSION and ANDROID_SDK_ROOT env vars must be defined.Downloaded NDK to: /root/git/syncthing-android/syncthing/../../syncthing-android-prereq/ndk_r28.zipSHA-1: /root/git/syncthing-android/syncthing/../../syncthing-android-prereq/ndk_r28.zip 894f469c5192a116d21f412de27966140a530ebc[ok] Checksum of /root/git/syncthing-android/syncthing/../../syncthing-android-prereq/ndk_r28.zip matches expected value.Adding ANDROID_NDK_HOME='/root/git/syncthing-android/syncthing/../../syncthing-android-prereq/android-ndk-r28'ANDROID_NDK_HOME='/root/git/syncthing-android/syncthing/../../syncthing-android-prereq/android-ndk-r28'Invoking git fetch ...From https://github.com/syncthing/syncthing+ e2973ff2f...fa0d933e4 release-nightly -> origin/release-nightly  (forced update)Invoking git describe ...Cleaning go-build cacheBuilding syncthing version v1.29.4*** Building for armgo: github.com/AudriusButkevicius/recli@v0.0.7-0.20220911121932-d000ce8fbf0f: Get "https://proxy.golang.org/github.com/%21audrius%21butkevicius/recli/@v/v0.0.7-0.20220911121932-d000ce8fbf0f.mod": dial tcp 142.250.217.113:443: connect: connection refusedTraceback (most recent call last):File "/root/git/syncthing-android/syncthing/./build-syncthing.py", line 384, in <module>subprocess.check_call([go_bin, 'mod', 'download'], cwd=syncthing_dir)File "/usr/lib/python3.12/subprocess.py", line 413, in check_callraise CalledProcessError(retcode, cmd)subprocess.CalledProcessError: Command '['/root/git/syncthing-android/syncthing/../../syncthing-android-prereq/go_1.24.1/bin/go', 'mod', 'download']' returned non-zero exit status 1.* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.BUILD FAILED in 17m 42s
2 actionable tasks: 2 executed

当我们满心欢喜声明问题已经解决,开始build arm ,结果又报错了:
dial tcp 142.250.217.113:443: connect: connection refused

这里是还有个坑,无法访问这个地址,go 相关的,千万不要理解为python 脚本问题了。

大家可以看看尝试 网上搜一搜解决方案, 最终我自己也是不断倒腾出来的,设置代理解决。 当然遇到无法解决,再次尝试其它方法

echo 'export GOPROXY=https://goproxy.cn' >> ~/.bashrc
source ~/.bashrc
go env -w GO111MODULE=on
go mod vendor
apt install udo

在这里插入图片描述

防坑

这里能不开代理软件千万不要开代理软件,比如会遇到 无法访问github 就去打开代理软件,虽然能访问github了,但是还是无法访问github中的其它资源了。 慎用

总结

自己花了好几周,找了好多资料,测试无数测最终解决了编译问题:其实就是两个大问题,需要看到具体日志,然后解决。

  • github 依赖的资源无法访问,需要解决ubuntu 访问github 问题,修改dns 路由解决
  • go 在编译过程中编译不成功,需要解决网络接口不可达,设置go 代理来解决。
http://www.dtcms.com/wzjs/70669.html

相关文章:

  • 大连网站建设大全h5网站制作平台
  • 阜阳哪里做网站网站流量监控
  • 北京网站建设最便宜的公司产品营销策划方案3000字
  • 给公司做网站风险手机百度
  • 宝塔做两个网站6阿森纳英超积分
  • 网站建设一般报价多少钱免费建站系统哪个好用吗
  • 深圳网站建设托管东莞精准网络营销推广
  • 做720效果的还有哪个网站怎样在百度发广告贴
  • 网站访问不了的原因seo常见优化技术
  • 扬州做网站的科技公司现在推广一般都用什么软件
  • 网页设计购物网站淄博seo网络公司
  • 做搜狗pc网站nba最新消息新闻
  • 临沂品牌网站建设公司seo研究中心怎么了
  • 深圳网络营销网站建设网络推广费用高吗
  • 做淘宝客淘宝网站被黑代写文章多少钱
  • 学做面包网站昆山网站建设公司
  • 济南企业建站平台免费b站网站推广
  • 公安局打电话网站备案营销方案范文100例
  • 有哪些做的比较精美的网站天猫代运营
  • 青岛做网站的太原seo建站
  • 东莞网站建设公司哪家好新媒体推广渠道有哪些
  • wordpress 课百度网站排名优化
  • table表格 做的网站搜索引擎优化简称
  • 龙岩网站建设要多少费用关键词优化策略有哪些
  • 温州网站建设免费服务祁阳seo
  • 养殖p2p网站建设旅游新闻热点
  • 企业网站开发需要多少钱2022最新时事新闻及点评
  • 做网站还是app百度广告买下的订单在哪里找
  • 做网站的过程网店推广方案策划书
  • 学校网站建设流程中国十大电商平台