lookas2001 https://lookas2001.com The station of lookas2001 Tue, 28 Jul 2020 17:09:07 +0000 zh-CN hourly one https://wordpress.org/?v=5.4.2 https://lookas2001.com/wp-content/uploads/2017/10/cropped-icon-32x32.jpg lookas2001 https://lookas2001.com thirty-two thirty-two one hundred and sixty-four million five hundred and sixty thousand six hundred and two https://lookas2001.com/517-2/ https://lookas2001.com/517-2/#respond Tue, 28 Jul 2020 17:09:07 +0000 https://lookas2001.com/?p=517 Read on “”

]]>
What people hate is not power, but their own failure to gain power.

With the results of the college entrance examination coming down, I may not be able to go to the school that I really want to go to. So I complain about the society. Why do we all agree with 985 / 211, but not double non?

In fact, it is not a kind of discrimination to say that I tried to "pick up the Omissions" when I was searching for the school admission score table of last year?

With the name of the key school, ha, how powerful I am. When I look down on each other, have I ever thought that I will become the "despised" side?

Therefore, people should learn to meet the strong, to face the weak, and to keep awe.

This is also a profound lesson that the college entrance examination has brought to me.

]]>
https://lookas2001.com/517-2/feed/ zero five hundred and seventeen
https://lookas2001.com/515-2/ https://lookas2001.com/515-2/#respond Tue, 28 Jul 2020 17:00:16 +0000 https://lookas2001.com/?p=515 Read on “”

]]>
Humanities and social sciences are actually quite important, not only reflected in the achievements, but also reflected in people's cultural accomplishment.

Every time I think of some headache things, I always think, if I read more books, will my mind be a little better now?

]]>
https://lookas2001.com/515-2/feed/ zero five hundred and fifteen
CDN is a kind of multicast https://lookas2001.com/cdn%e6%98%af%e4%b8%80%e7%a7%8d%e5%a4%9a%e6%92%ad/ https://lookas2001.com/cdn%e6%98%af%e4%b8%80%e7%a7%8d%e5%a4%9a%e6%92%ad/#respond Thu, 25 Jun 2020 16:28:37 +0000 https://lookas2001.com/?p=506 Read on "CDN is a kind of multicast"

]]>
Before I came into contact with the concept of multicast, I had been thinking about why such a beautiful thing could not be used on the Internet. Later, I thought about it. Now, CDN has been saying that it can achieve this goal. It can reduce the transmission of duplicate data on the backbone network and copy it into multiple copies at the near user end.

Seeing this speech of Tencent cloud today also confirms this view: Tencent cloud pcdn: from P2P to Internet Framework

In addition, P2P is really a very interesting thing. It's fun to fight people~

]]>
https://lookas2001.com/cdn%e6%98%af%e4%b8%80%e7%a7%8d%e5%a4%9a%e6%92%ad/feed/ zero five hundred and six
https://lookas2001.com/492-2/ https://lookas2001.com/492-2/#respond Sun, 14 Jun 2020 14:34:14 +0000 https://lookas2001.com/?p=492 Never let someone else's misfortune sink in because you can't make sure that you won't encounter it yourself.

]]>
https://lookas2001.com/492-2/feed/ zero four hundred and ninety-two
What is Web 2.0? https://lookas2001.com/%e4%bb%80%e4%b9%88%e6%98%af-web-2-0-%ef%bc%9f/ https://lookas2001.com/%e4%bb%80%e4%b9%88%e6%98%af-web-2-0-%ef%bc%9f/#respond Sat, 13 Jun 2020 14:06:33 +0000 https://lookas2001.com/?p=489 Read on "What is Web 2.0?"

]]>
The essence of web is a tool to transmit information. Web has the method of transmitting information HTTP, and web has the method of representing information HTML. What is the particularity of Web 2.0?

In my understanding, Web 2.0 isolates how information is delivered and how it is expressed from the user's use, that is, in Web 2.0 In the era, users do not need to consider how to make a beautiful web page, how to put their information on the Internet all the time, and how to embed their own video works with flash. All they need to do is write a text or upload some videos. The rest of the content is handled by the computer city.

Web 2.0 makes the division of labor of the Internet more detailed, the beautiful design of the interface is handled by professional designers, the preservation of information has special operation and maintenance to deal with, and programmers are required to solve various difficult problems.

Web 2.0 is actually the Internet extension of the concept of application.

The characteristics of Web 2.0 have led to the completion of the above-mentioned matters and the shameless product "Rampart" strategy of some decision-makers, leading to the centralization of the Internet, from the Internet to the Internet tree, making the user's information a cash cow for some companies, and making the dissemination of control information [censered].

Separate the program from the data! Get rid of centralized nodes that don't really need to exist! Return the Internet to a free and open world!

#Embrace IPFs ~ ~ hashtag ~~

]]>
https://lookas2001.com/%e4%bb%80%e4%b9%88%e6%98%af-web-2-0-%ef%bc%9f/feed/ zero four hundred and eighty-nine
What is a mailing list? https://lookas2001.com/%e4%bb%80%e4%b9%88%e6%98%af%e9%82%ae%e4%bb%b6%e5%88%97%e8%a1%a8%ef%bc%88mailing-list%ef%bc%89%ef%bc%9f/ https://lookas2001.com/%e4%bb%80%e4%b9%88%e6%98%af%e9%82%ae%e4%bb%b6%e5%88%97%e8%a1%a8%ef%bc%88mailing-list%ef%bc%89%ef%bc%9f/#respond Tue, 08 Oct 2019 12:32:08 +0000 https://lookas2001.com/?p=457 Read on What is a mailing list

]]>
This is an answer to the question of Zhihu, What is a mailing list?

Simply put, it is a collection of recipients, which can be represented as an email address to which you send mail, which will help you forward to other users. It's essentially a one to many letter.

Compared with CC and CC, each recipient needs to be written to the email header. This list can be dynamically changed. New recipients can tell the mailing list that they are willing to receive the mail sent to the mailing list through the web page or other means, and they can also quit.

Please distinguish the services provided by major mail providers, such as QQ group mail and the so-called subscription list. Mailing lists are platform independent. Mailing list service providers do not necessarily have to be under the same service provider as the sender and receiver. Moreover, the mailing list should use a common email address identifier (such as me @ example. Com), instead of using QQ number as identification.

Mailing lists can be used for message subscription and community. The specific example is that the various promotional messages you receive can be regarded as a mailing list to some extent. In addition, foreign large open source communities generally use mailing lists as their communication tools.

Compared with BBS and other online forums, mailing list is more troublesome, real-time is not high (minute level, compared with the second level of IM instant messaging), learning cost is relatively high, and because of its decentralized characteristics (everyone can be used as a mailing list), it is difficult to review (not no, mailing list is not a safe information exchange tool for review), so it has not been promoted in China Kailai (the number of public mailing list service providers in China is poor).

In fact, the mailing list is quite valuable. It does not bind to any platform, which means that as long as you have a mail service account with a certain reputation, you can build a group with people from any service provider anywhere in the world. QQ is not like wechat group. Moreover, because there is a certain threshold for e-mail delivery, people tend to use formal style, and the efficiency of discussing style will be slightly higher.

]]>
https://lookas2001.com/%e4%bb%80%e4%b9%88%e6%98%af%e9%82%ae%e4%bb%b6%e5%88%97%e8%a1%a8%ef%bc%88mailing-list%ef%bc%89%ef%bc%9f/feed/ zero four hundred and fifty-seven
Openwrt uses its own dnsmasq to block websites (setting resolution) https://lookas2001.com/openwrt-%e4%bd%bf%e7%94%a8%e8%87%aa%e5%b8%a6%e7%9a%84-dnsmasq-%e5%b1%8f%e8%94%bd%e7%bd%91%e7%ab%99%ef%bc%88%e8%ae%be%e7%bd%ae%e8%a7%a3%e6%9e%90%ef%bc%89/ https://lookas2001.com/openwrt-%e4%bd%bf%e7%94%a8%e8%87%aa%e5%b8%a6%e7%9a%84-dnsmasq-%e5%b1%8f%e8%94%bd%e7%bd%91%e7%ab%99%ef%bc%88%e8%ae%be%e7%bd%ae%e8%a7%a3%e6%9e%90%ef%bc%89/#comments Fri, 02 Aug 2019 14:46:29 +0000 https://lookas2001.com/?p=430 Read on "Openwrt blocks websites with its own dnsmasq (settings resolution)"

]]>
Sometimes, we may want to block a website (e.g. screening Xiaomi ads), or set up a resolution for a specific website (for example, test your website locally before publishing it). Openwrt provides a parsing tool dnsmasq which is much more powerful than local host. Compared with local host, openwrt supports generic configuration and can resolve special types of records.

There are tutorials on the Internet, which need to install Adblock or something, but it is actually a matter of one line (three lines to be exact) (there is no location for modification on Luci, so it can't be solved on the web page).

 #Add.1.168.1_ List DHCP. @ dnsmasq [0]. Address = / example. COM / 192.168.0.1 "
 block a type resolution of ad.mi.com domain name_ List DHCP. @ dnsmasq [0]. Address: / / ad.mi. COM / ", effective configuration (write to / etc / config / DHCP) 
 UCI commit DHCP # restart service 
 service dnsmasq restart

Ref

]]>
https://lookas2001.com/openwrt-%e4%bd%bf%e7%94%a8%e8%87%aa%e5%b8%a6%e7%9a%84-dnsmasq-%e5%b1%8f%e8%94%bd%e7%bd%91%e7%ab%99%ef%bc%88%e8%ae%be%e7%bd%ae%e8%a7%a3%e6%9e%90%ef%bc%89/feed/ one four hundred and thirty
https://lookas2001.com/425-2/ https://lookas2001.com/425-2/#respond Thu, 01 Aug 2019 16:47:24 +0000 https://lookas2001.com/?p=425 Read on “”

]]>
Mojang is releasing bedrock_ The PDB debug symbol file is attached to the server.

The point is that the document is quite large. The whole terminal is 100MB, and the debugging file is 60MB.

However, it seems that mojang did this on purpose. Minecraft is a commercial software and can't send source code. However, minecraft needs the community to make plug-ins, and mojang is too lazy to do API.

Then I'll give you debug files, you decompile it yourself.

Plan pass!

]]>
https://lookas2001.com/425-2/feed/ zero four hundred and twenty-five
Minecraft dragon server universal market plug-in step hole record and repair Chinese version download https://lookas2001.com/minecraft-sponge-%e6%9c%8d%e5%8a%a1%e7%ab%af-universal-market-%e6%8f%92%e4%bb%b6%e8%b8%a9%e5%9d%91%e8%ae%b0%e5%bd%95%e5%8f%8a%e4%bf%ae%e5%a4%8d%e6%b1%89%e5%8c%96%e7%89%88%e6%9c%ac%e4%b8%8b%e8%bd%bd/ https://lookas2001.com/minecraft-sponge-%e6%9c%8d%e5%8a%a1%e7%ab%af-universal-market-%e6%8f%92%e4%bb%b6%e8%b8%a9%e5%9d%91%e8%ae%b0%e5%bd%95%e5%8f%8a%e4%bf%ae%e5%a4%8d%e6%b1%89%e5%8c%96%e7%89%88%e6%9c%ac%e4%b8%8b%e8%bd%bd/#comments Fri, 28 Jun 2019 04:26:45 +0000 https://lookas2001.com/?p=330 Read on "Download the Chinese version of minecraft spine server universal market plug-in step record and repair"

]]>
The original minecraft is tired of it At last I wanted to play minecraft mod, so I installed the industry 2 module. Is thinking of online, from the mcbbs for a long time, feel reliable on the few. It's too lonely to play by yourself, so let's build a suit. This is the preface. I don't want to talk about the details. In short, there are a lot of pitfalls. Fortunately, there are some tutorials from our predecessors (for example, http: / / www.mcbbs. Net / thread-786074-1-1. HTML), and the road is quite smooth. In the spirit of serving the people, select a pit here and summarize the process to help later partners.

brief introduction

The universal market is a consignment market with a box like interface.

Mcbbs Reprint: http://www.mcbbs.net/thread-792152-1-1.html
GitHub original project: https://github.com/Xwaffle1/UniversalMarket

download

Update 20190628: fixed the problem that hot loading doesn't work, and fixed the bug of adding air to the market with empty hands

UniversalMarket-1.12.2-v1.3-Bug_ fix_ and_ chinese_ translation_ by_ yys_ and_ Tollainmear_ and_ lookas2001.jar

UniversalMarket-master-Bug_ fix_ and_ chinese_ translation-source.7z

Since various prompt texts of this project are built into the code, the Sinicization needs to be recompiled. There are project source code files on it. If you are worried, you can manually compile according to the compilation process below. The Chinese part adopts the translation provided by tollainmear.

There is a problem

The server versions I built are minecraft 1.12.2, forge 1.12.2-14.23.5.2825, and spongeforge 1.12.2-2825-7.1.6. After installing the universal market plug-in version 1.3 (HTTPS: / / GitHub. COM / xwaffle1 / universalmarket / releases / tag / 1.3), it is found that you cannot enter the store normally. The console error is as follows:

 [xx:xx:xx] [Server thread/ERROR] [Sponge]: Error occurred while executing command 'um' for source EntityPlayerMP['lookas2001'/248, l='world', x=302.00, y=64.00,  z=229.00]: There's no NBT Data set in the provided container
org.spongepowered.api.data.persistence.InvalidDataException: There's no NBT Data set in the provided container
    at net.minecraft.item.ItemStack.setRawData(ItemStack.java:2534) ~[aip.class:?]
    at com.xwaffle.universalmarket.utils.ItemBuilder.<init>(ItemBuilder.java:38)  ~[ItemBuilder.class:?]
    at com.xwaffle.universalmarket.utils.ItemBuilder.<init>(ItemBuilder.java:31) ~[ItemBuilder.class:?]
    at com.xwaffle.universalmarket.market.Market.openMarket(Market.java:247) ~[Market.class:?]
    at com.xwaffle.universalmarket.market.Market.openMarket(Market.java:167) ~[Market.class:?]
    at  com.xwaffle.universalmarket.commands.MarketCommand.process(MarketCommand.java:45) ~[MarketCommand.class:?]
    at org.spongepowered.api.command.dispatcher.SimpleDispatcher.process(SimpleDispatcher.java:340) ~[SimpleDispatcher.class:1.12.2-2825-7.1.6]
    at  org.spongepowered.common.command.SpongeCommandManager.process(SpongeCommandManager.java:337) [SpongeCommandManager.class:1.12.2-2825-7.1.6]
    at net.minecraft.command.ServerCommandManager.func_ 71556_ a(SourceFile:1156) [dh.class:?]
    at net.minecraft.network.NetHandlerPlayServer.func_ 147361_ d(NetHandlerPlayServer.java:960) [pa.class:?]
    at net.minecraft.network.NetHandlerPlayServer.func_ 147354_ a(NetHandlerPlayServer.java:939) [pa.class:?]
    at net.minecraft.network.play.client.CPacketChatMessage.func_ 148833_ a(SourceFile:37) [la.class:?]
    at net.minecraft.network.play.client.CPacketChatMessage.func_ 148833_ a(SourceFile:9) [la.class:?]
    at org.spongepowered.common.event.tracking.phase.packet.PacketPhaseUtil.onProcessPacket(PacketPhaseUtil.java:193) [PacketPhaseUtil.class:1.12.2-2825-7.1.6]
    at net.minecraft.network.PacketThreadUtil$1.redirect$onProcessPacket$zlk000(SourceFile:539) [hv$1.class:?]
    at  net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13) [hv$1.class:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_ 74]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_ 74]
    at net.minecraft.util.Util.func_ 181617_ a(SourceFile:46) [h.class:?]
    at org.spongepowered.common.SpongeImplHooks.onUtilRunTask(SpongeImplHooks.java:307) [SpongeImplHooks.class:1.12.2-2825-7.1.6]
    at net.minecraft.server.MinecraftServer.redirect$onRun$zjo000(MinecraftServer.java:3970) [MinecraftServer.class:?]
    at net.minecraft.server.MinecraftServer.func_ 71190_ q(MinecraftServer.java:723) [MinecraftServer.class:?]
    at net.minecraft.server.dedicated.DedicatedServer.func_ 71190_ q(DedicatedServer.java:397) [nz.class:?]
    at net.minecraft.server.MinecraftServer.func_ 71217_ p(MinecraftServer.java:668) [MinecraftServer.class:?]
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526) [MinecraftServer.class:?]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_ 74]

At this time, I was a little flustered, because I had no systematic contact with Java before. I only had a little understanding when studying the authorization and verification of Ruijie network ess / SMP products and Moegirl android app.

Positioning and resolution

Go to search engine directly, didn't find

Because this project is open source (open source is great!) We can download the code and study it slowly.

Later, I went to the original project to find the issue, and found this https://github.com/xwaffle1/universalmarket/issues/20. I contacted Dalao alone, who had already patched the previous version of jar, through some ways. I would like to thank his work for enlightening me when I had no idea.

Fortunately, with trace, we can see that the last error about this plug-in occurred in com.xwaffle.universalmarket.utils.ItemBuilder.<init>(ItemBuilder.java:38) ~[ItemBuilder.class:?] here:

We throw the setraw data function on the sponge forum and search for https://forums.spongeowned.org/t/set-get-modify-subid-of-itemstack/19048/9 and find that this function is related to setting some attributes on items, which is a relatively Hacky approach.

Search the function corresponding to this code in the global project:

Call Java market to find the code.

We find that the call point with unsafetedamage (damage value) is actually passed in through the meta variable, which is only here:

After loading the Haoxing plug-in, you can find that this is the confirm button in the payment confirmation interface.

Therefore, it is speculated that this may be a function related to the progress bar that the author wants to do, but in the end, for various reasons, it finally coos (human nature).

Remove this line and the two related lines (the top two lines of the bug line) and try it.

Roadblock -- compiler

Minecraft uses Java 8 as its running environment. Correspondingly, mod development around minecraft is based on Java 8. It is recommended to use Java 8 for the following work.

My local computer is MacBook, and the development environment is MacOS. Compared with Windows system, it is more powerful on the command line and has more supporting facilities. Personal development, usually use brew as a package management, installation software fast and fast. But brew doesn't provide Java 8 by default However, it is impossible to download from the official website of Oracle (the download still needs to log in). There is such an answer on stackoverflow, which solves the problem of Java 8 installation.

See that this project uses gradle as its dependency management (or build tool?) According to my previous experience with composer and NPM, I think I need to install it with brew. In fact, it is unnecessary, but it is unnecessary to install it. The gradle version on brew is too high, and the project itself provides a package management command, gradlew. Running it will generate the corresponding files in the project directory and user directory.

so ./gradlew Now, after downloading the necessary files, I give a prompt that I should run ./gradlew tasks Run it and find the option that seems to be a build ./gradlew build Run it, silly eye, prompt error:

 : compilejava 
 / XXXXXX / universalmarket master / build / sources / main / Java / COM / xwaffle / universalmarket / market / market. Java: 30: error: package org.spongeowned.common.item.inventory.adapter.impl.slots does not exist 
 import org.spongeowned.common.item.inventory.adapter.impl.slots.slotadapter; / XXXXXX / universalmarket master / build / sources / main / Java / COM / xwaffle / universalmarket / market / market. Java: 31: error: package org.spongeowned.common.item.inventory.query.operation does not exist 
 import org.spongepowered.common.item.inventory.query.operation.InventoryPropertyQueryOperation; / XXXXXX / universalmarket master / build / sources / main / Java / COM / xwaffle / universalmarket / market / market. Java: 32: error: package org.spongeowned.common.item.inventory.util does not exist 
 import org.spongeowned.common.item.inventory.util.itemstackutil;; ^/ XXXXXX / universalmarket master / build / sources / main / Java / COM / xwaffle / universalmarket / market / marketitem. Java: 10: error: package org.spongeowned.common.item.inventory.util does not exist 
 import org.spongeowned.common.item.inventory.util.itemstackutil; / XXXXXX / universalmarket master / build / sources / main / Java / COM / xwaffle / universalmarket / utils / itembuilder. Java: 11: error: package org.spongeowned.common.item.inventory.util does not exist 
 import org.spongeowned.common.item.inventory.util.itemstackutil;; ^Note: writing plugin metadata to file / file / XXXXXX / universalmarket-master / build / classes / main / mcmmod.info has 5 errors, compile Java failed, build failed with an exception, build failed with an exception, what what went wrong wrong is: execution failed for task ': compilejava', > compilation failed; see the compiler error output output for details. 
, compile failed; see the compiler error error output for details. 
 
 * what went wrong wrong wrong wrong error output for details. 
 * what went wrong wrong wrong wrong output for details. 
 * what went wrong wrong wrong wrong output output for details. 

 * what what went wrong wrong doing wrong output for tasks': compile Java '; > compilation failed; see the compiler error error output output for details. 
 
 
 
 
 
 
 
 * try: 
 run with -- stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Looking through the sponge document, I can see that the examples given by the government are all based on ide. However, due to the lack of space in my MacBook, I finally installed IntelliJ idea community on another computer (Windows), and then used the build button provided by IDE, which took a long time to download. Finally, two errors "PKIX path building failed" and "Unable to find valid certification path to requested target" (this problem will not occur when using the command to build on windows, but the above error that has occurred in MacOS will still occur). It seems that it is not an IDE problem. Return my MacBook.

In the previous step, I observed one thing: why other introductions don't have problems, but these introductions do. I found that these packages start with org.spongepowered.common.xxx. I have checked the build. Gradle file before, and it has been approved compile 'org.spongepowered:spongeapi:7.0.0' Introducing spongeapi. After checking the IDE problems, I'll take a look at the java compiler.

Because of my previous experience with gradle, I knew that gradle would generate folders in the user directory ~/.gradle Go to it and search for it find . | grep sponge One of the search results ./caches/modules-2/files-2.1/org.spongepowered/spongeapi/7.0.0/ada1f9981de3459b182ee16d6408173ef33a8943/spongeapi-7.0.0.jar This is the package corresponding to the API.

Decompress it (no need to decompile it)

Autistic

Where is common!!

Go back to build. Gradle and look down, compile files('libs/spongeforge-1.12.2-2555-7.1.0-BETA-2837.jar') In combination with the description of the spongeharmony project, the author TM directly regards the release version of spongeforge as a dependency! And the source code also deleted this directory!!! From the point of view of using the side door API, the author of the plug-in is not recommended to bypass the behaviors such as spine, which is directly introduced by the plug-in author net.minecraft.nbt.NBTTagCompound )No wonder this author didn't post mod in ore when publishing mod (maybe because sponge didn't provide some API).

Download the latest stable version of spongeforge (spongeforge-1.12.2-2825-7.1.6. Jar) (the old one doesn't want to turn back), create LIBS directory and throw it in. Then change the corresponding file name in build. Gradle (keep matching). Run it again ./gradlew build

Baby, I finally see you

Finally, after testing, the work is perfect.

]]>
https://lookas2001.com/minecraft-sponge-%e6%9c%8d%e5%8a%a1%e7%ab%af-universal-market-%e6%8f%92%e4%bb%b6%e8%b8%a9%e5%9d%91%e8%ae%b0%e5%bd%95%e5%8f%8a%e4%bf%ae%e5%a4%8d%e6%b1%89%e5%8c%96%e7%89%88%e6%9c%ac%e4%b8%8b%e8%bd%bd/feed/ two three hundred and thirty
Sharing files through WebDAV on openwrt https://lookas2001.com/openwrt-%e4%b8%8a%e9%80%9a%e8%bf%87-webdav-%e5%85%b1%e4%ba%ab%e6%96%87%e4%bb%b6/ https://lookas2001.com/openwrt-%e4%b8%8a%e9%80%9a%e8%bf%87-webdav-%e5%85%b1%e4%ba%ab%e6%96%87%e4%bb%b6/#comments Sat, 11 May 2019 09:16:12 +0000 https://lookas2001.com/?p=321 Read on File sharing via opendav

]]>

All rights reserved by lookas2001. This work is licensed under the Creative Commons Attribution 4.0 international license agreement. Please indicate the author and source when reprinting.

Openwrt (HTTPS: / / openwrt. Org /) is a very powerful router firmware. Many functions can be achieved by installing the software package. WebDAV (http: / / www.webdav. Org /) is an extension of HTTP that can be used to share files. Therefore, we can try to install the corresponding software package on openwrt to make the device support WebDAV.

Compared with SMB and AFP, the speed of WebDAV is superior in actual test. This may be due to the fact that WebDAV is based on HTTP, and there may be some black technologies on the HTTP server to improve the speed while reducing the occupancy (or the reason that WebDAV in the next step is based on HTTP instead of HTTPS).

In addition, the reason for writing this article is that SMB and AFP already have relatively complete tutorials. For example, these two articles are https://openwrt.org/docs/guide-user/services/nas/samba_ configuration https://openwrt.org/docs/guide-user/services/nas/netatalk_ However, WebDAV is lack of documentation.

Lighttpd (HTTPS: / / www.lighttpd. Net /) is a lightweight but relatively complete HTTP server. It is observed that it provides WebDAV mod, so it can be used to implement WebDAV server.

Installation of weblight and webauth module

before opkg update To update the local software package.

adopt opkg install lighttpd lighttpd-mod-webdav lighttpd-mod-auth lighttpd-mod-authn_ file The package can be loaded with the same key.

If you don't need to download the http: / / downloads. Org file manually, you can download it manually.

Configure lighttpd

Unlike SMB, which provides UCI unified configuration interface, lighttpd needs to be modified under / etc / lighttpd.

adopt vi /etc/lighttpd/lighttpd.conf Open the main configuration file for lighttpd.

Can be passed through cp /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.bak Set up a backup to facilitate restore in case of configuration errors.

This is a configuration file:

 server.document-root        = "/mnt"
server.upload-dirs          = ( "/tmp" )
server.errorlog             = "/var/log/lighttpd/error.log"
server.pid-file             = "/var/run/lighttpd.pid"
server.username             = "http"
server.groupname            = "www-data"

index-file.names            = ( "index.php", "index.html",
                                 "index.htm", "default.htm",
                              )

static-file.exclude-extensions = ( ".php", ".pl",  ".fcgi" )

### Options that are useful but not always necessary:
#server.chroot               = "/"
server.port                 = 81
#server.bind                 = "localhost"
#server.tag                  = "lighttpd"
server.errorlog-use-syslog  = "enable"
#server.network-backend      = "writev"

### Use IPv6 if available
#include_ shell "/usr/share/lighttpd/use-ipv6.pl"

dir-listing.encoding        = "utf-8"
server.dir-listing          = "enable"

include "/etc/lighttpd/mime.conf"
include "/etc/lighttpd/conf.d/*.conf"

The annotation in lighttpd configuration file is implemented by adding "ා" before the line.

Here are some modifications:

server.document-root = "/mnt" To set the document root to /mnt , I have added two hard disks for the router, which are respectively mounted under / MNT / sda1 and / MNT / sdb1. This storage location is not fixed and can be adjusted according to your own preferences.

server.port = 81 , that is, the port we use to access later. Port 80 has been occupied by the system's own uhtpd. Here, we set another port to prevent conflicts.

server.errorlog-use-syslog = "enable" This option can output the error log to syslog so that we can view the error in the web console.

server.dir-listing = "enable" , dir-listing.encoding = "utf-8" These two options enable the listing of files and prevent garbled file names.

Configure WebDAV module

adopt vi /etc/lighttpd/conf.d/30-webdav.conf Open the main configuration file for lighttpd.

This is a configuration file:

 #######################################################################
##
##  WebDAV Module
## ---------------
##
## See https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ ModWebDAV
##
server.modules += ( "mod_ webdav" )

#$HTTP["url"] =~ "^/dav($|/)" {
  ##
  ## enable webdav for this location
  ##
  webdav.activate = "enable"

  ##
  ## By default the webdav url is writable.
  ## Uncomment the following line if you want to make it readonly.
  ##
  webdav.is-readonly = "enable"

  ##
  ## Log the XML Request bodies for debugging
  ##
  #webdav.log-xml =  "disable"

  ##
  ##
  ##
  webdav.sqlite-db-name = "/tmp/lighttpd-webdav.db"
#}
##
#######################################################################

Here are some modifications:

The notes are missing $HTTP["url"] =~ "^/dav($|/)" { , } Two lines. Lighttpd is installed for WebDAV. Comment out these two lines to set the entire website as WebDAV.

webdav.activate = "enable" WebDAV is enabled for the entire site.

webdav.is-readonly = "enable" To set the running mode to read-only mode, set here disable You can disable read-only (i.e., write read).

"/mnt/sda1/.lighttpd-webdav.db" In addition to the storage location of this Dav storage module, there is also a location where the storage module needs to be easily lost, such as in the database /tmp )It will result in data loss, and the storage location other than the hard disk will shorten the life of flash memory (flash memory has an upper limit for erasing). Please note that lighttpd needs to have write permission to the directory of the storage location chmod a+w xxx , to grant permissions.

Ref

  • Content on the openwrt Forum: http://forum.openwrt.org/t/webdav-configuration-essense-with-lighttpd-on-openwrt/25357
  • Documents provided by lighttpd: https://redmine.lighttpd.net/projects/lighttpd/wiki/doc_ ModWebDAV

Configure auth module

This configuration is used to improve the security of your files, but it is not necessary. Moreover, this configuration can only improve a little security. Attackers can still intercept passwords in the middle of the way. If you want to improve the security, please configure HTTPS.

adopt vi /etc/lighttpd/conf.d/20-auth.conf Open the main configuration file for lighttpd.

This is a configuration file:

 #######################################################################
##
##  Authentication Module
## -----------------------
##
## See https://redmine.lighttpd.net/projects/lighttpd/wiki/docs_ modauth
## for more info.
##
server.modules += ( "mod_ auth" )

auth.backend                 = "plain"
auth.backend.plain.userfile  = "/etc/lighttpd/lighttpd.user"
#auth.backend.plain.groupfile = "/etc/lighttpd/lighttpd.group"

#auth.backend.ldap.hostname = "localhost"
#auth.backend.ldap.base-dn  = "dc=my-domain,dc=com"
#auth.backend.ldap.filter   = "(uid=$)"

auth.require               = ( "/" =>
                                (
                                 "method"  => "basic",
                                 "realm"   => "Personal File Server",
                                 "require" => "valid-user"
                               ), 
                             )

##
#######################################################################

Here are some modifications:

It may be due to the negligence of the package packer, which was not found in the original configuration file server.modules += ( "mod_ auth" ) In order to enable this module, it must be added manually.

auth.backend = "plain" , set the authentication backend to plain

auth.backend.plain.userfile = "/etc/lighttpd/lighttpd.user" , set the location where authentication information is stored in the authentication backend.

auth.require = ..... To uncomment here means authentication is enabled.

"/" Here is the authentication location.

"method" => "basic" , the type of authentication, which is set to basic For better client compatibility.

"realm" => "Personal File Server" , that is, the message prompted during authentication, which can be set arbitrarily.

adopt touch /etc/lighttpd/lighttpd.user We can create the authentication information file we need.

adopt vi /etc/lighttpd/lighttpd.user Edit the certification information file.

This is an example:

 user1:password1
user2:password2

User name and password : Separate. Multiple users are separated by a blank line.

Ref

  • Documents provided by lighttpd: https://redmine.lighttpd.net/projects/lighttpd/wiki/doc_ modauth
]]>
https://lookas2001.com/openwrt-%e4%b8%8a%e9%80%9a%e8%bf%87-webdav-%e5%85%b1%e4%ba%ab%e6%96%87%e4%bb%b6/feed/ four three hundred and twenty-one