mirror of
https://github.com/monlor/MIXBOX-ARCHIVE.git
synced 2026-03-10 23:41:27 +00:00
moxbox init
This commit is contained in:
51
.github/workflows/main.yml
vendored
Normal file
51
.github/workflows/main.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
name: CI
|
||||
|
||||
# on:
|
||||
# push:
|
||||
# branchs:
|
||||
# - 'test'
|
||||
# - 'master'
|
||||
# pull_request:
|
||||
# branchs:
|
||||
# - 'test'
|
||||
# - 'master'
|
||||
# paths:
|
||||
# - 'apps/**'
|
||||
# - 'appsbin/**'
|
||||
# - 'temp/**'
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
- name: Pack files
|
||||
run: |
|
||||
git lfs pull
|
||||
mkdir appstore/
|
||||
mkdir mbfiles/
|
||||
bash ./tools/gitsync.sh pack all
|
||||
cp -rf appsbin/ mbfiles/appsbin/
|
||||
cp -rf appstore/ mbfiles/appstore/
|
||||
cp -rf temp/ mbfiles/temp/
|
||||
cp -rf applist.txt mbfiles/
|
||||
cp -rf install.sh mbfiles/
|
||||
- name: Push changes
|
||||
env:
|
||||
GH_REF: ${{ secrets.GH_REF }}
|
||||
CO_REF: ${{ secrets.CO_REF }}
|
||||
BRANCH_NAME: $(cd .. && git branch | awk '$1 == "*"{print $2}')
|
||||
run: |
|
||||
cd mbfiles/
|
||||
git init
|
||||
git config --local user.email "monlor@qq.com"
|
||||
git config --local user.name "monlor"
|
||||
git add .
|
||||
git commit -m "$(TZ='Asia/Shanghai' date "+%Y-%m-%d %H:%M:%S")" -a
|
||||
eval "git branch | grep -q "${BRANCH_NAME}" || git checkout -b "${BRANCH_NAME}""
|
||||
eval "git push "${GH_REF}" "${BRANCH_NAME}":"${BRANCH_NAME}" -f"
|
||||
eval "git push "${CO_REF}" "${BRANCH_NAME}":"${BRANCH_NAME}" -f"
|
||||
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
.DS_Store
|
||||
appstore
|
||||
674
LICENSE
Normal file
674
LICENSE
Normal file
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
182
README.md
Normal file
182
README.md
Normal file
@@ -0,0 +1,182 @@
|
||||
# MIXBOX
|
||||
|
||||

|
||||
|
||||
> MIXBOX是一款全新的,完全基于Shell脚本的工具箱,为在路由器上实现程序的快速配置及运行管理,欢迎大佬们stars、fork及pr.
|
||||
|
||||
* Telegram群:[MIXBOX CHAT](https://t.me/joinchat/FMraA0lwzH9fzEW1wXdCFA)
|
||||
* 我的博客:[Monlor's Blog](https://www.monlor.com)
|
||||
* GitHub地址:[monlor/MIXBOX](https://github.com/monlor/MIXBOX)
|
||||
|
||||
***
|
||||
|
||||
### 更新日志
|
||||
|
||||
* 2020-03-04
|
||||
* 为了减少项目体积,现在采用`Github Actions`自动部署插件安装包
|
||||
* coding下载源地址改为`https://monlor.coding.net/p/mbfiles/d/mbfiles/git/raw/master`
|
||||
* github下载源地址改为`https://raw.githubusercontent.com/monlor/mbfiles/master`
|
||||
* 这一版更新需要手动更新,请执行下方的**手动更新命令**,并手动更换下载源
|
||||
* 不想更新的以前的版本同样会保留,只是不再会更新
|
||||
|
||||
* 2020-03-03
|
||||
* 更新工具箱coding下载源,**请手动更换coding下载源:`https://monlor.coding.net/p/MIXBOX/d/MIXBOX/git/raw/master`**
|
||||
* 更新插件`Koolproxy`规则地址
|
||||
* 更新`qiandao`插件,现在支持更多网站签到,**并且支持mips设置,如R3**
|
||||
|
||||
* 2020-02-27
|
||||
* 新增插件npc,待测试
|
||||
* aria2版本更新
|
||||
|
||||
* 2019-03-03
|
||||
* 修复`v2ray`配置文件问题(未测试),感谢`@leafnsand`的PR
|
||||
* 修复`Entware`插件无法启动`ONMP`的问题
|
||||
* 插件`VerySync`和`BaiduPCS`的程序版本更新
|
||||
* 现在修复小米路由器远程访问后会自动开放8098端口
|
||||
|
||||
### 介绍
|
||||
|
||||
**工具箱`MIXBOX`公测发布,`Monlor Tools`不再更新。新版本有以下改变:**
|
||||
* MIXBOX
|
||||
* 工具箱尝试支持更多的路由器固件,正在努力中,需要测试
|
||||
* 去掉随时可能被小米封的web界面
|
||||
* 移除针对小米路由器设置的功能,如修改samba路径和禁用迅雷等,合并到新的插件`MIWIFI`
|
||||
* 增加一个应急功能,在用户目录创建文件`uninstall_mixbox`即可卸载工具箱
|
||||
* 增加几个工具箱常用命令,`applist`:用于管理插件列表,`cru`:定时任务管理,`mbdb`:工具箱数据库,基于uci,`mixbox`:工具箱命令行交互界面
|
||||
* 工具箱增加目录,`/etc/mixbox/mbdb`:存放数据文件,`/etc/mixbox/var/run`:存在程序进程pid文件,`/etc/mixbox/var/log`:工具箱日志目录
|
||||
* 工具箱现在不会特意去兼容某个型号,比如`R3`上的`Aria2`问题,只考虑`CPU`架构,`mips`/`arm`等,所以如果`R3`/`R1CM`发现程序不兼容的情况,可以选择自己替换程序,或同时安装`Monlor-Tools`工具箱
|
||||
* 插件安装去掉了离线安装的功能,后续会加入进来,给用户提供一个自己修改打包插件的机会
|
||||
|
||||
* ShadowSocks
|
||||
* 订阅现在会多次尝试,如已安装`EntWare`中的`curl`程序会自动调用用作订阅
|
||||
* 现已支持`v2ray`并测试黑白名单和全局模式,正常使用,v2ray订阅暂不支持
|
||||
* 已支持`kcptun`加速功能,`ss`和`kcp`需为同一个服务器,否则不启用
|
||||
* 优化添加`ss`节点时的提示信息
|
||||
* 增加`haveged`程序,用于生成随机数
|
||||
|
||||
* KoolProxy
|
||||
* 由于作者更新程序修改了视频模式的启用方式,更新了启动脚本
|
||||
* `https`证书生成不再使用`openssl`程序,而使用`kp`自带程序生成
|
||||
|
||||
* 新增插件
|
||||
* AliDDNS:获取当前网络的ip,自动解析到阿里云
|
||||
* BaiduPCS:第三方百度网盘下载工具,带web界面
|
||||
* DropBear:移植小米路由器的`SSH`功能到工具箱
|
||||
* Frps:快速搭建`frp`服务端
|
||||
* PPTPD:快速搭建`vpn`服务器,基于`EntWare`环境
|
||||
* SmartDNS:智能`dns`解析,从多个上游`dns`服务器中选取最快的解析地址
|
||||
* SSServer:搭建`ss`服务器
|
||||
* Transmission:强大的`pt`下载工具,基于`EntWare`环境
|
||||
* WebD:极其小巧的网盘工具,功能比较简单
|
||||
|
||||
* 其他等等等小更新...
|
||||
|
||||
### 注意事项
|
||||
|
||||
* 用户目录是指存放一下大文件的目录,如下载的文件等
|
||||
* **经测试`R3`不支持`EntWare`环境,原因未知,所以基于`EntWare`的程序都无法使用**
|
||||
|
||||
### 命令
|
||||
|
||||
#### 一键安装
|
||||
|
||||
``` shell
|
||||
sh -c "$(curl -kfsSl https://monlor.coding.net/p/mbfiles/d/mbfiles/git/raw/master/install.sh)" && source /etc/profile &> /dev/null
|
||||
```
|
||||
|
||||
### 手动更新命令
|
||||
|
||||
``` shell
|
||||
sh -c "$(curl -kfsSl https://raw.githubusercontent.com/monlor/MIXBOX/master/apps/mixbox/scripts/update.sh)" && source /etc/profile &> /dev/null
|
||||
```
|
||||
|
||||
#### 卸载`Monlor Tools`工具箱
|
||||
|
||||
``` shell
|
||||
sh -c "$(curl -kfsSl https://monlor.coding.net/p/mbfiles/d/mbfiles/git/raw/master/temp/uninstall_old.sh)" && source /etc/profile &> /dev/null
|
||||
```
|
||||
|
||||
#### 一键更新所有插件(请先更新工具箱)
|
||||
|
||||
``` shell
|
||||
applist installed -n | while read line; do mixbox upgrade $line; done
|
||||
```
|
||||
|
||||
#### 查看插件常用命令(appname为插件名)
|
||||
|
||||
``` shell
|
||||
mixbox help
|
||||
```
|
||||
|
||||
### 小米路由器目录结构
|
||||
|
||||
/
|
||||
|--- /etc/mixbox
|
||||
| |--- /apps/ --- 插件安装目录
|
||||
| |--- /config/ --- 工具箱配置文件目录
|
||||
| |--- /scripts/ --- 工具箱脚本目录
|
||||
| |--- /mbdb/ --- 工具箱数据文件目录
|
||||
| |--- /var/ --- 工具箱运行pid及日志存放目录
|
||||
|--- /tmp
|
||||
| |--- /messages --- 系统日志,工具箱日志
|
||||
|--- /userdisk
|
||||
| |--- /data/ --- 硬盘目录
|
||||
|--- /extdisks/
|
||||
| |--- /sd*/ --- 外接盘目录
|
||||
|
||||
|
||||
### 插件列表
|
||||
|
||||
> 感谢以下插件列表中的作者给我们带来的这么好用的程序!`作者链接待完善`
|
||||
|
||||
01. [ShadowSocks](https://github.com/shadowsocks/shadowsocks/tree/master)
|
||||
02. [KoolProxy](http://koolshare.b0.upaiyun.com/)
|
||||
03. [Aria2](http://aria2.github.io/)
|
||||
04. [VsFtpd](https://security.appspot.com/vsftpd.html)
|
||||
05. [kms](https://github.com/Wind4/vlmcsd)
|
||||
06. [Frpc](https://github.com/fatedier/frp)
|
||||
07. [Ngrok](https://github.com/dosgo/ngrok-c)
|
||||
08. [WebShell](https://github.com/shellinabox/shellinabox)
|
||||
09. [TinyProxy](https://github.com/tinyproxy/tinyproxy)
|
||||
10. [Entware](https://github.com/Entware/Entware-ng)
|
||||
11. [KodExplorer](https://kodcloud.com/)
|
||||
12. [EasyExplorer](http://koolshare.cn/thread-129199-1-1.html)
|
||||
13. [HttpFile](http://nginx.org/)
|
||||
14. [VerySync](http://verysync.com/)
|
||||
15. [FastDick](https://github.com/fffonion/Xunlei-Fastdick)
|
||||
16. [FireWall](https://www.netfilter.org/)
|
||||
17. [JetBrains](http://blog.lanyus.com/archives/174.html)
|
||||
18. [QianDao](http://koolshare.cn/thread-127783-1-1.html)
|
||||
19. [FileBrowser](https://github.com/filebrowser/filebrowser)
|
||||
20. [ZeroTier](https://www.zerotier.com)
|
||||
21. MIWIFI
|
||||
22. [AliDDNS]
|
||||
23. [BaiduPCS]
|
||||
24. [DropBear]
|
||||
25. [Frps]
|
||||
26. [PPTPD]
|
||||
27. [SmartDNS]
|
||||
28. [SSServer]
|
||||
29. [Transmission]
|
||||
30. [WebD]
|
||||
|
||||
### 快速制作插件
|
||||
|
||||
#### 步骤
|
||||
|
||||
* `git clone https://github.com/monlor/MIXBOX.git`
|
||||
* `cd MIXBOX/`
|
||||
* `chmod +x ./tools/*.sh`
|
||||
* `./tools/newapp.sh [插件名] [插件服务名] [插件介绍]`
|
||||
* 修改插件脚本和配置文件
|
||||
* `./tools/gitsync.sh pack [插件名] [-v]`
|
||||
|
||||
#### 注意事项
|
||||
|
||||
* 插件名必须为小写,插件服务名一般为驼峰的写法
|
||||
* 执行完插件生成脚本后,插件会生成在apps中,注意名称不能与现有插件重复
|
||||
* `gitsync.sh`是打包插件的脚本,-v为更新版本号`可无`,打包的插件生成在appstore下
|
||||
|
||||
|
||||
|
||||
|
||||
BIN
apps/aliddns/bin/aliddns_darwin_x86_64
Normal file
BIN
apps/aliddns/bin/aliddns_darwin_x86_64
Normal file
Binary file not shown.
BIN
apps/aliddns/bin/aliddns_linux_arm
Normal file
BIN
apps/aliddns/bin/aliddns_linux_arm
Normal file
Binary file not shown.
BIN
apps/aliddns/bin/aliddns_linux_mips
Normal file
BIN
apps/aliddns/bin/aliddns_linux_mips
Normal file
Binary file not shown.
BIN
apps/aliddns/bin/aliddns_linux_x86_64
Normal file
BIN
apps/aliddns/bin/aliddns_linux_x86_64
Normal file
Binary file not shown.
7
apps/aliddns/config/aliddns.uci
Normal file
7
apps/aliddns/config/aliddns.uci
Normal file
@@ -0,0 +1,7 @@
|
||||
service="AliDDNS"
|
||||
appname="aliddns"
|
||||
needver="0.0.1"
|
||||
supports="linux_arm,linux_mips,linux_x86_64,darwin_x86_64"
|
||||
appinfo="动态将你的路由器IP绑定到域名"
|
||||
newinfo=""
|
||||
version="0.0.2"
|
||||
28
apps/aliddns/config/mixbox.conf
Normal file
28
apps/aliddns/config/mixbox.conf
Normal file
@@ -0,0 +1,28 @@
|
||||
#------------------【AliDDNS】--------------------
|
||||
aliddns() {
|
||||
|
||||
eval `mbdb export aliddns`
|
||||
source /etc/mixbox/bin/base
|
||||
echo "********* $service ***********"
|
||||
echo "[${appinfo}]"
|
||||
readsh "启动${appname}服务[1/0] " "enable" "1"
|
||||
|
||||
if [ "$enable" == '1' ]; then
|
||||
# Scripts Here
|
||||
read -p "修改${appname}配置?[1/0] " res
|
||||
if [ "$res" = '1' ]; then
|
||||
readsh "请输入${appname}访问ID" "app_key"
|
||||
readsh "请输入${appname}访问密钥" "app_secret"
|
||||
readsh "请输入${appname}域名[例如@.mixbox.com或www.mixbox.com]" "domain"
|
||||
readsh "请输入${appname}检查分钟间隔(建议10)" "time" "10"
|
||||
fi
|
||||
# read -p "更新DNS前先清除旧的DNS记录(默认不清除)?[1/0] " res
|
||||
# mbdb set $appname.main.clean="$res"
|
||||
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh restart
|
||||
else
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
|
||||
fi
|
||||
|
||||
}
|
||||
#------------------【AliDDNS】--------------------
|
||||
1
apps/aliddns/config/version.txt
Normal file
1
apps/aliddns/config/version.txt
Normal file
@@ -0,0 +1 @@
|
||||
1.0.5
|
||||
68
apps/aliddns/scripts/aliddns.sh
Normal file
68
apps/aliddns/scripts/aliddns.sh
Normal file
@@ -0,0 +1,68 @@
|
||||
#!/bin/sh
|
||||
source /etc/mixbox/bin/base
|
||||
eval `mbdb export aliddns`
|
||||
|
||||
start() {
|
||||
|
||||
# [ -n "$(pidof ${appname})" ] && logsh "【$service】" "${appname}已经在运行!" && exit 1
|
||||
logsh "【$service】" "正在启动${appname}服务... "
|
||||
|
||||
# Scripts Here
|
||||
# open_port
|
||||
# write_firewall_start
|
||||
[ -z "$app_key" -o -z "$app_secret" -o -z "$domain" ] && logsh "【$service】" "访问ID或密钥或域名为空!" && exit 1
|
||||
[ -z "$time" ] && time=10
|
||||
|
||||
cru a "${appname}" "*/$time * * * * ${mbroot}/apps/${appname}/scripts/${appname}.sh restart"
|
||||
daemon ${mbroot}/apps/${appname}/bin/${appname} --id "$app_key" --secret "$app_secret" auto-update --domain "$domain"
|
||||
if [ $? -ne 0 ]; then
|
||||
logsh "【$service】" "启动${appname}服务失败!"
|
||||
else
|
||||
logsh "【$service】" "启动${appname}服务完成!"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
stop() {
|
||||
|
||||
logsh "【$service】" "正在停止${appname}服务... "
|
||||
[ "$enable" == '0' ] && destroy
|
||||
killall -9 ${appname} &> /dev/null
|
||||
|
||||
}
|
||||
|
||||
destroy() {
|
||||
|
||||
# End app, Scripts here
|
||||
cru d "${appname}"
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
end() {
|
||||
|
||||
mbdb set $appname.main.enable=0
|
||||
|
||||
stop && exit 1
|
||||
|
||||
}
|
||||
|
||||
status() {
|
||||
|
||||
if [ -n "$(cru l | grep ${appname})" ]; then
|
||||
status="更新域名:$domain|1"
|
||||
else
|
||||
status="未运行|0"
|
||||
fi
|
||||
mbdb set $appname.main.status="$status"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start) start ;;
|
||||
stop) stop ;;
|
||||
restart) stop; start ;;
|
||||
reload) close_port && open_port ;;
|
||||
status) status ;;
|
||||
esac
|
||||
|
||||
|
||||
BIN
apps/aria2/bin/aria2_linux_arm
Normal file
BIN
apps/aria2/bin/aria2_linux_arm
Normal file
Binary file not shown.
BIN
apps/aria2/bin/aria2_linux_mips
Normal file
BIN
apps/aria2/bin/aria2_linux_mips
Normal file
Binary file not shown.
BIN
apps/aria2/bin/aria2_linux_x86_64
Normal file
BIN
apps/aria2/bin/aria2_linux_x86_64
Normal file
Binary file not shown.
63
apps/aria2/config/aria2.conf
Normal file
63
apps/aria2/config/aria2.conf
Normal file
@@ -0,0 +1,63 @@
|
||||
#用户名
|
||||
#rpc-user=user
|
||||
#密码
|
||||
#rpc-passwd=passwd
|
||||
#设置加密的密钥
|
||||
#rpc-secret=secret
|
||||
#允许rpc
|
||||
enable-rpc=true
|
||||
#允许所有来源, web界面跨域权限需要
|
||||
rpc-allow-origin-all=true
|
||||
#是否启用https加密,启用之后要设置公钥,私钥的文件路径
|
||||
#rpc-secure=true
|
||||
#启用加密设置公钥
|
||||
#rpc-certificate=/home/name/.config/aria2/example.crt
|
||||
#启用加密设置私钥
|
||||
#rpc-private-key=/home/name/.config/aria2/example.key
|
||||
#允许外部访问,false的话只监听本地端口
|
||||
rpc-listen-all=true
|
||||
#RPC端口, 仅当默认端口被占用时修改
|
||||
rpc-listen-port=6800
|
||||
#最大同时下载数(任务数), 路由建议值: 3
|
||||
max-concurrent-downloads=5
|
||||
#断点续传
|
||||
continue=true
|
||||
#同服务器连接数
|
||||
max-connection-per-server=5
|
||||
#最小文件分片大小, 下载线程数上限取决于能分出多少片, 对于小文件重要
|
||||
min-split-size=10M
|
||||
#单文件最大线程数, 路由建议值: 5
|
||||
split=10
|
||||
#下载速度限制
|
||||
max-overall-download-limit=0
|
||||
#单文件速度限制
|
||||
max-download-limit=0
|
||||
#上传速度限制
|
||||
max-overall-upload-limit=0
|
||||
#单文件速度限制
|
||||
max-upload-limit=0
|
||||
#断开速度过慢的连接
|
||||
#lowest-speed-limit=0
|
||||
#验证用,需要1.16.1之后的release版本
|
||||
#referer=*
|
||||
#文件保存路径, 默认为当前启动位置
|
||||
dir=/extdisks/sda1/下载
|
||||
#IPv4 DHT routing table file to PATH(IPV6默认没有打开的)
|
||||
#dht-file-path=/extdisks/sda1/下载/.aria2/dht.dat
|
||||
#dht-file-path6=/extdisks/sda1/下载/.aria2/dht6.dat
|
||||
#bt-tracker
|
||||
#bt-tracker=
|
||||
#文件缓存, 使用内置的文件缓存, 如果你不相信Linux内核文件缓存和磁盘内置缓存时使用, 需要1.16及以上版本
|
||||
#disk-cache=0
|
||||
#另一种Linux文件缓存方式, 使用前确保您使用的内核支持此选项, 需要1.15及以上版本(?)
|
||||
#enable-mmap=true
|
||||
#文件预分配, 能有效降低文件碎片, 提高磁盘性能. 缺点是预分配时间较长
|
||||
#所需时间 none < falloc ? trunc << prealloc, falloc和trunc需要文件系统和内核支持
|
||||
file-allocation=prealloc
|
||||
#不进行证书校验
|
||||
check-certificate=false
|
||||
#保存aria2下载记录
|
||||
input-file=/etc/aria2.session
|
||||
save-session=/etc/aria2.session
|
||||
save-session-interval=60
|
||||
log-level=warn
|
||||
7
apps/aria2/config/aria2.uci
Normal file
7
apps/aria2/config/aria2.uci
Normal file
@@ -0,0 +1,7 @@
|
||||
service="Aria2"
|
||||
appname="aria2"
|
||||
needver="0.0.1"
|
||||
supports="linux_arm,linux_mips,linux_x86_64"
|
||||
appinfo="Linux下一款高效的下载工具"
|
||||
newinfo="支持x86_64设备"
|
||||
version="0.0.5"
|
||||
33
apps/aria2/config/mixbox.conf
Normal file
33
apps/aria2/config/mixbox.conf
Normal file
@@ -0,0 +1,33 @@
|
||||
#------------------【Aria2】--------------------
|
||||
aria2() {
|
||||
eval `mbdb export aria2`
|
||||
source /etc/mixbox/bin/base
|
||||
echo "********* $service ***********"
|
||||
echo "[Linux下一款高效的下载工具]"
|
||||
readsh "启动${appname}服务[1/0] " "enable" "1"
|
||||
if [ "$enable" == '1' ]; then
|
||||
read -p "修改${appname}端口号(`mbdb get ${appname}.main.port || echo 6800`)?[1/0] " res
|
||||
if [ "$res" == '1' ]; then
|
||||
read -p "请输入${appname}端口号(默认6800):" res
|
||||
mbdb set $appname.main.port="$res"
|
||||
fi
|
||||
token=$(mbdb get ${appname}.main.token)
|
||||
path=$(mbdb get ${appname}.main.path)
|
||||
[ -z $token ] && token="空"
|
||||
[ -z $path ] && path="$mbdisk/下载"
|
||||
read -p "修改${appname}配置($token, $path)?[1/0] " res
|
||||
if [ "$res" == '1' ]; then
|
||||
read -p "请输入${appname}密钥(回车表示不设置):" res
|
||||
[ ! -z "$res" ] && mbdb set $appname.main.token="$res" || mbdb set $appname.main.token=""
|
||||
read -p "请输入${appname}下载路径(回车默认$mbdisk/下载):" res
|
||||
[ ! -z "$res" ] && mbdb set $appname.main.path="$res" || mbdb set $appname.main.path="$mbdisk/下载"
|
||||
fi
|
||||
readsh "请输入${appname}外网访问配置[1/0]" "openport" "1"
|
||||
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh restart
|
||||
else
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
|
||||
fi
|
||||
|
||||
}
|
||||
#------------------【Aria2】--------------------
|
||||
BIN
apps/aria2/lib/libstdc++.so
Normal file
BIN
apps/aria2/lib/libstdc++.so
Normal file
Binary file not shown.
BIN
apps/aria2/lib/libstdc++.so.6
Normal file
BIN
apps/aria2/lib/libstdc++.so.6
Normal file
Binary file not shown.
BIN
apps/aria2/lib/libxml2.so.2
Normal file
BIN
apps/aria2/lib/libxml2.so.2
Normal file
Binary file not shown.
129
apps/aria2/scripts/aria2.sh
Normal file
129
apps/aria2/scripts/aria2.sh
Normal file
@@ -0,0 +1,129 @@
|
||||
#!/bin/sh
|
||||
source /etc/mixbox/bin/base
|
||||
eval `mbdb export aria2`
|
||||
|
||||
port=6800
|
||||
WEBDIR=${mbroot}/apps/${appname}/web
|
||||
[ -z "${port}" ] && port=6800
|
||||
[ -z "$path" ] && path="$mbdisk/下载"
|
||||
aria2url=http://$lanip/backup/log/${appname}
|
||||
binname=aria2c
|
||||
|
||||
open_ports() {
|
||||
# 添加bt下载和DHT监听端口
|
||||
open_port 6881:6999 tcp
|
||||
}
|
||||
|
||||
set_config() {
|
||||
|
||||
logsh "【$service】" "加载${appname}配置..."
|
||||
[ ! -f /etc/aria2.session ] && touch /etc/aria2.session
|
||||
|
||||
[ ! -z "${port}" ] && sed -i "s/^.*rpc-listen-port.*$/rpc-listen-port=${port}/" ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
|
||||
if [ ! -z "$token" ]; then
|
||||
sed -i "s/^.*rpc-secret.*$/rpc-secret=$token/" ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
else
|
||||
sed -i "s/^.*rpc-secret.*$/#rpc-secret=/" ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
fi
|
||||
|
||||
sed -i "s#dir.*#dir=$path#" ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
|
||||
[ ! -d "$path" ] && mkdir -p $path
|
||||
|
||||
# DHT 缓存目录配置
|
||||
if [ ! -d "${path}/.aria2" ]; then
|
||||
mkdir -p "${path}/.aria2"
|
||||
# IPV6默认没有开,可以不用配置
|
||||
sed -i "s#.*dht-file-path.*#dht-file-path=${path}/.aria2/dht.dat#" ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
sed -i "s#.*dht-file-path6.*#dht-file-path6=${path}/.aria2/dht6.dat#" ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
fi
|
||||
|
||||
# 自动更新bt-tracker
|
||||
list=`curl -s https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best.txt|awk NF|sed ":a;N;s/\n/,/g;ta"`
|
||||
if [ ! -z "${list}" ]; then
|
||||
sed -i "s#.*bt-tracker.*#bt-tracker=${list}#" ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
logsh "【$service】" "更新bt-tracker"
|
||||
fi
|
||||
|
||||
#R3加载库文件
|
||||
[ "$xq" == "R3" -o "$xq" == "R1CM" ] && export LD_LIBRARY_PATH=${mbroot}/apps/${appname}/lib:/usr/lib:/lib
|
||||
|
||||
if [ ! -d /tmp/syslogbackup/${appname} ] && [ -n "$xq" ]; then
|
||||
logsh "【$service】" "生成${appname}本地web页面"
|
||||
mkdir -p /tmp/syslogbackup &> /dev/null
|
||||
ln -s $WEBDIR/AriaNG /tmp/syslogbackup/${appname} > /dev/null 2>&1
|
||||
fi
|
||||
#添加定时重启任务
|
||||
cru a ${appname} "0 6 * * * ${mbroot}/apps/${appname}/scripts/${appname}.sh restart"
|
||||
|
||||
}
|
||||
|
||||
start () {
|
||||
|
||||
result=$(ps | grep ${mbroot}/apps/${appname}/bin/${appname} | grep -v grep | wc -l)
|
||||
if [ "$result" != '0' ];then
|
||||
logsh "【$service】" "${appname}已经在运行!"
|
||||
exit 1
|
||||
fi
|
||||
logsh "【$service】" "正在启动${appname}服务... "
|
||||
|
||||
set_config
|
||||
|
||||
open_port
|
||||
write_firewall_start
|
||||
|
||||
if [ ! -f ${mbroot}/apps/${appname}/bin/${appname} ]; then
|
||||
bincheck ${binname}
|
||||
[ $? -eq 0 ] && ln -sf $(which $binname) ${mbroot}/apps/${appname}/bin/${appname}
|
||||
fi
|
||||
daemon ${mbroot}/apps/${appname}/bin/${appname} --conf-path=${mbroot}/apps/${appname}/config/${appname}.conf -D -l ${mbroot}/var/log/${appname}.log
|
||||
if [ $? -ne 0 ]; then
|
||||
logsh "【$service】" "启动${appname}服务失败!"
|
||||
else
|
||||
logsh "【$service】" "启动${appname}服务完成!"
|
||||
logsh "【$service】" "访问[$aria2url]管理服务"
|
||||
[ -z "$token" ] && tokentext="" || tokentext=token:"$token"@
|
||||
logsh "【$service】" "jsonrpc地址:http://"$tokentext""$lanip":"${port}"/jsonrpc"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
stop () {
|
||||
|
||||
logsh "【$service】" "正在停止${appname}服务... "
|
||||
close_port
|
||||
remove_firewall_start
|
||||
killall -9 ${appname} &> /dev/null
|
||||
|
||||
destroy
|
||||
}
|
||||
|
||||
destroy() {
|
||||
if [ "$enable" == '0' ]; then
|
||||
[ -d /tmp/syslogbackup/${appname} ] && rm -rf /tmp/syslogbackup/${appname}
|
||||
cru d ${appname}
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
status() {
|
||||
|
||||
result=$(pssh | grep ${mbroot}/apps/${appname}/bin/${appname} | grep -v grep | wc -l)
|
||||
if [ "$result" == '0' ]; then
|
||||
status="未运行|0"
|
||||
else
|
||||
status="运行端口号: ${port}|1"
|
||||
fi
|
||||
mbdb set $appname.main.status="$status"
|
||||
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start) start ;;
|
||||
stop) stop ;;
|
||||
restart) stop; start ;;
|
||||
reload) close_port && open_port ;;
|
||||
status) status ;;
|
||||
esac
|
||||
|
||||
6
apps/aria2/scripts/install.sh
Normal file
6
apps/aria2/scripts/install.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
#copyright by monlor
|
||||
source /etc/mixbox/bin/base
|
||||
|
||||
appname=aria2
|
||||
[ "$xq" != "R3" -a "$xq" != "R1CM" ] && rm -rf ${mbtmp}/${appname}/lib
|
||||
576
apps/aria2/web/AriaNG/index.html
Executable file
576
apps/aria2/web/AriaNG/index.html
Executable file
File diff suppressed because one or more lines are too long
BIN
apps/baidupcs/bin/baidupcs_darwin_x86_64
Executable file
BIN
apps/baidupcs/bin/baidupcs_darwin_x86_64
Executable file
Binary file not shown.
BIN
apps/baidupcs/bin/baidupcs_linux_arm
Executable file
BIN
apps/baidupcs/bin/baidupcs_linux_arm
Executable file
Binary file not shown.
BIN
apps/baidupcs/bin/baidupcs_linux_mips
Executable file
BIN
apps/baidupcs/bin/baidupcs_linux_mips
Executable file
Binary file not shown.
BIN
apps/baidupcs/bin/baidupcs_linux_x86_64
Executable file
BIN
apps/baidupcs/bin/baidupcs_linux_x86_64
Executable file
Binary file not shown.
8
apps/baidupcs/config/baidupcs.uci
Normal file
8
apps/baidupcs/config/baidupcs.uci
Normal file
@@ -0,0 +1,8 @@
|
||||
service="BaiduPCS"
|
||||
appname="baidupcs"
|
||||
needver="0.0.1"
|
||||
backupfiles=""
|
||||
supports="linux_arm,linux_mips,linux_x86_64,darwin_x86_64"
|
||||
appinfo="第三方百度网盘web客户端,基于Go语言"
|
||||
newinfo="二进制更新至3.7.0"
|
||||
version="0.0.6"
|
||||
20
apps/baidupcs/config/mixbox.conf
Normal file
20
apps/baidupcs/config/mixbox.conf
Normal file
@@ -0,0 +1,20 @@
|
||||
#------------------【BaiduPCS】--------------------
|
||||
baidupcs() {
|
||||
|
||||
eval `mbdb export baidupcs`
|
||||
source "$(mbdb get mixbox.main.path)"/bin/base
|
||||
echo "********* $service ***********"
|
||||
echo "[${appinfo}]"
|
||||
readsh "启动${appname}服务[1/0] " "enable" "1"
|
||||
if [ "$enable" == '1' ]; then
|
||||
# Scripts Here
|
||||
# readsh "请输入${appname}端口号" "port" "5299"
|
||||
readsh "请输入${appname}外网访问配置[1/0]" "openport" "0"
|
||||
readsh "重启${appname}服务[1/0] " "res" "1"
|
||||
[ "$res" = '1' -o -z "$res" ] && ${mbroot}/apps/${appname}/scripts/${appname}.sh restart
|
||||
else
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
|
||||
fi
|
||||
|
||||
}
|
||||
#------------------【BaiduPCS】--------------------
|
||||
69
apps/baidupcs/scripts/baidupcs.sh
Normal file
69
apps/baidupcs/scripts/baidupcs.sh
Normal file
@@ -0,0 +1,69 @@
|
||||
#!/bin/sh
|
||||
eval `mbdb export baidupcs`
|
||||
source "$(mbdb get mixbox.main.path)"/bin/base
|
||||
export BAIDUPCS_GO_CONFIG_DIR="${mbroot}/apps/${appname}/config"
|
||||
port="5299"
|
||||
|
||||
start() {
|
||||
|
||||
[ -n "$(pidof ${appname})" ] && logsh "【$service】" "${appname}已经在运行!" && exit 1
|
||||
logsh "【$service】" "正在启动${appname}服务... "
|
||||
# cru a "${appname}" "0 6 * * * ${mbroot}/apps/${appname}/scripts/${appname}.sh restart"
|
||||
# Scripts Here
|
||||
|
||||
# open_port
|
||||
# write_firewall_start
|
||||
daemon ${mbroot}/apps/${appname}/bin/${appname}
|
||||
if [ $? -ne 0 ]; then
|
||||
logsh "【$service】" "启动${appname}服务失败!" && end
|
||||
else
|
||||
logsh "【$service】" "启动${appname}服务完成!"
|
||||
logsh "【$service】" "请在浏览器打开地址:http://$lanip:$port"
|
||||
logsh "【$service】" "注意登陆成功后先设置下载路径,例如:$mbdisk/下载"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
stop() {
|
||||
|
||||
logsh "【$service】" "正在停止${appname}服务... "
|
||||
[ "$enable" == '0' ] && destroy
|
||||
# close_port
|
||||
# remove_firewall_start
|
||||
killall -9 ${appname} &> /dev/null
|
||||
|
||||
}
|
||||
|
||||
destroy() {
|
||||
|
||||
# End app, Scripts here
|
||||
# cru d "${appname}"
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
end() {
|
||||
|
||||
mbdb set ${appname}.main.enable=0
|
||||
stop && exit 1
|
||||
|
||||
}
|
||||
|
||||
status() {
|
||||
|
||||
if [ -n "$(pidof ${appname})" ]; then
|
||||
status="运行中|1"
|
||||
else
|
||||
status="未运行|0"
|
||||
fi
|
||||
mbdb set ${appname}.main.status="$status"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start) start ;;
|
||||
stop) stop ;;
|
||||
restart) stop; start ;;
|
||||
reload) close_port && open_port ;;
|
||||
status) status ;;
|
||||
esac
|
||||
|
||||
9
apps/dropbear/config/banner
Normal file
9
apps/dropbear/config/banner
Normal file
@@ -0,0 +1,9 @@
|
||||
-----------------------------------------------------
|
||||
Welcome to MIXBOX!
|
||||
-----------------------------------------------------
|
||||
__ ______ __ ________ __ ____ ____ _ __
|
||||
/ / / / _/ / |/ / _/ |/ // __ )/ __ \ |/ /
|
||||
/ /_/ // / / /|_/ // / | // __ / / / / /
|
||||
/ __ // / / / / // / / |/ /_/ / /_/ / |
|
||||
/_/ /_/___/ /_/ /_/___//_/|_/_____/\____/_/|_|
|
||||
|
||||
8
apps/dropbear/config/dropbear.uci
Normal file
8
apps/dropbear/config/dropbear.uci
Normal file
@@ -0,0 +1,8 @@
|
||||
service="DropBear"
|
||||
appname="dropbear"
|
||||
needver="0.0.1"
|
||||
backupfiles="bin/dropbear,config/dropbear_dss_host_key,config/dropbear_rsa_host_key"
|
||||
supports="linux_arm,linux_mips"
|
||||
appinfo="移植小米的SSH功能到工具箱"
|
||||
newinfo="添加备份功能支持"
|
||||
version="0.0.2"
|
||||
26
apps/dropbear/config/mixbox.conf
Normal file
26
apps/dropbear/config/mixbox.conf
Normal file
@@ -0,0 +1,26 @@
|
||||
#------------------【DropBear】--------------------
|
||||
dropbear() {
|
||||
|
||||
eval `mbdb export dropbear`
|
||||
source "$(mbdb get mixbox.main.path)"/bin/base
|
||||
echo "********* $service ***********"
|
||||
echo "[${appinfo}]"
|
||||
echo "[仅支持小米路由器!]"
|
||||
readsh "启动${appname}服务[1/0] " "enable" "1"
|
||||
|
||||
if [ "$enable" == '1' ]; then
|
||||
# Scripts Here
|
||||
readsh "请输入${appname}端口号" "port" "1022"
|
||||
read -p "【慎重】是否启动时修改root用户密码[1/0]? " modify_passwd
|
||||
checkread $modify_passwd && mbdb set $appname.main.modify_passwd="$modify_passwd"
|
||||
if [ "$modify_passwd" = '1' ]; then
|
||||
readsh "请输入系统root用户密码" "rootpasswd"
|
||||
fi
|
||||
readsh "请输入${appname}外网访问配置[1/0]" "openport" "1"
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh restart
|
||||
elif [ "$enable" = '0' ]; then
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
|
||||
fi
|
||||
|
||||
}
|
||||
#------------------【DropBear】--------------------
|
||||
84
apps/dropbear/scripts/dropbear.sh
Normal file
84
apps/dropbear/scripts/dropbear.sh
Normal file
@@ -0,0 +1,84 @@
|
||||
#!/bin/sh
|
||||
source "$(mbdb get mixbox.main.path)"/bin/base
|
||||
eval `mbdb export dropbear`
|
||||
|
||||
[ -z "${port}" ] && port=1022
|
||||
|
||||
get_config() {
|
||||
|
||||
logsh "【$service】" "检查${appname}配置文件中..."
|
||||
[ ! -f ${mbroot}/apps/${appname}/config/dropbear_rsa_host_key -a ! -f /etc/dropbear/dropbear_rsa_host_key ] && logsh "【$service】" "缺失证书文件无法启动!" && exit 1
|
||||
[ ! -f ${mbroot}/apps/${appname}/config/dropbear_dss_host_key -a ! -f /etc/dropbear/dropbear_dss_host_key ] && logsh "【$service】" "缺失证书文件无法启动!" && exit 1
|
||||
[ ! -f ${mbroot}/apps/${appname}/bin/${appname} ] && cp -rf /usr/sbin/dropbear ${mbroot}/apps/${appname}/bin/${appname}
|
||||
# [ ! -f ${mbroot}/apps/${appname}/bin/dropbearkey ] && cp -rf /usr/bin/dropbearkey ${mbroot}/apps/${appname}/bin/dropbearkey
|
||||
[ ! -f ${mbroot}/apps/${appname}/config/dropbear_rsa_host_key ] && cp -rf /etc/dropbear/dropbear_rsa_host_key ${mbroot}/apps/${appname}/config/dropbear_rsa_host_key
|
||||
[ ! -f ${mbroot}/apps/${appname}/config/dropbear_dss_host_key ] && cp -rf /etc/dropbear/dropbear_dss_host_key ${mbroot}/apps/${appname}/config/dropbear_dss_host_key
|
||||
|
||||
}
|
||||
|
||||
start() {
|
||||
|
||||
logsh "【$service】" "正在启动${appname}服务... "
|
||||
# cru a "${appname}" "0 6 * * * ${mbroot}/apps/${appname}/scripts/${appname}.sh restart"
|
||||
# Scripts Here
|
||||
logsh "【$service】" "服务启动端口号为:${port}"
|
||||
get_config
|
||||
if [ "$modify_passwd" = '1' -a -n "$rootpasswd" ]; then
|
||||
logsh "【$service】" "系统root用户密码将修改为:$rootpasswd"
|
||||
echo -e "${rootpasswd}\n${rootpasswd}" | passwd root
|
||||
fi
|
||||
open_port
|
||||
write_firewall_start
|
||||
${mbroot}/apps/${appname}/bin/${appname} -p ${port} -d ${mbroot}/apps/${appname}/config/dropbear_dss_host_key -r ${mbroot}/apps/${appname}/config/dropbear_rsa_host_key -b ${mbroot}/apps/${appname}/config/banner
|
||||
logsh "【$service】" "启动${appname}服务完成!"
|
||||
sleep 1
|
||||
kill -9 "$(pssh | grep ${mbroot}/apps/${appname}/bin/${appname} | grep -Ev "[ ]+${port}[ ]+" | awk '{print$1}' | tr '\n' ' ')" && sleep 1
|
||||
|
||||
|
||||
}
|
||||
|
||||
stop() {
|
||||
|
||||
logsh "【$service】" "正在停止${appname}服务... "
|
||||
[ "$enable" == '0' ] && destroy
|
||||
close_port
|
||||
remove_firewall_start
|
||||
|
||||
}
|
||||
|
||||
destroy() {
|
||||
|
||||
# End app, Scripts here
|
||||
# cru d "${appname}"
|
||||
logsh "【$service】" "如果终止${appname}将会在重启后生效!"
|
||||
# kill -9 "$(pssh | grep ${mbroot}/apps/${appname}/bin/${appname} | awk '{print$1}' | tr '\n' ' ')" && sleep 1
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
end() {
|
||||
|
||||
mbdb set $appname.main.enable=0
|
||||
stop && exit 1
|
||||
|
||||
}
|
||||
|
||||
status() {
|
||||
|
||||
if [ -n "$(pssh | grep ${mbroot}/apps/${appname}/bin/${appname})" ]; then
|
||||
status="运行端口号:${port}|1"
|
||||
else
|
||||
status="未运行|0"
|
||||
fi
|
||||
mbdb set ${appname}.main.status="$status"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start) start ;;
|
||||
stop) stop ;;
|
||||
restart) stop; start; ;;
|
||||
reload) close_port && open_port ;;
|
||||
status) status ;;
|
||||
esac
|
||||
|
||||
|
||||
BIN
apps/easyexplorer/bin/easyexplorer_darwin_x86_64
Normal file
BIN
apps/easyexplorer/bin/easyexplorer_darwin_x86_64
Normal file
Binary file not shown.
BIN
apps/easyexplorer/bin/easyexplorer_linux_arm
Normal file
BIN
apps/easyexplorer/bin/easyexplorer_linux_arm
Normal file
Binary file not shown.
BIN
apps/easyexplorer/bin/easyexplorer_linux_x86_64
Normal file
BIN
apps/easyexplorer/bin/easyexplorer_linux_x86_64
Normal file
Binary file not shown.
7
apps/easyexplorer/config/easyexplorer.uci
Normal file
7
apps/easyexplorer/config/easyexplorer.uci
Normal file
@@ -0,0 +1,7 @@
|
||||
service="EasyExplorer"
|
||||
appname="easyexplorer"
|
||||
needver="0.0.1"
|
||||
supports="linux_arm,linux_x86_64,darwin_x86_64"
|
||||
appinfo="一款跨设备的P2P文件同步工具"
|
||||
newinfo="修复程序无法运行的bug,更新二进制版本为最新版"
|
||||
version="0.0.5"
|
||||
31
apps/easyexplorer/config/mixbox.conf
Normal file
31
apps/easyexplorer/config/mixbox.conf
Normal file
@@ -0,0 +1,31 @@
|
||||
#------------------【EasyExplorer】--------------------
|
||||
easyexplorer() {
|
||||
|
||||
eval `mbdb export easyexplorer`
|
||||
source /etc/mixbox/bin/base
|
||||
echo "********* $service ***********"
|
||||
echo "[${appinfo}]"
|
||||
readsh "启动${appname}服务[1/0] " "enable" "1"
|
||||
if [ "$enable" == '1' ]; then
|
||||
read -p "修改${appname}文件共享目录(`mbdb get ${appname}.main.share_path || echo $mbdisk`)?[1/0] " res
|
||||
if [ "$res" == '1' ]; then
|
||||
read -p "请输入${appname}文件共享目录(回车默认$mbdisk):" res
|
||||
[ ! -z $res ] && mbdb set $appname.main.share_path="$res" || mbdb set $appname.main.share_path="$mbdisk"
|
||||
fi
|
||||
echo "请在https://www.ddnsto.com/注册获取秘钥(token)"
|
||||
[ -z $token ] && token="空"
|
||||
read -p "修改${appname}秘钥($token)?[1/0] " res
|
||||
if [ "$res" == '1' ]; then
|
||||
read -p "请输入${appname}秘钥:" res
|
||||
mbdb set $appname.main.token="$res"
|
||||
fi
|
||||
readsh "请输入${appname}运行端口号" "port" "8890"
|
||||
readsh "请输入${appname}外网访问配置[1/0]" "openport" "1"
|
||||
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh restart
|
||||
else
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
|
||||
fi
|
||||
|
||||
}
|
||||
#------------------【EasyExplorer】--------------------
|
||||
74
apps/easyexplorer/scripts/easyexplorer.sh
Normal file
74
apps/easyexplorer/scripts/easyexplorer.sh
Normal file
@@ -0,0 +1,74 @@
|
||||
#!/bin/sh
|
||||
source /etc/mixbox/bin/base
|
||||
eval `mbdb export easyexplorer`
|
||||
|
||||
path=$(mbdb get ${appname}.main.share_path) || path="$mbdisk"
|
||||
port=$(mbdb get ${appname}.main.port) || port=8890
|
||||
|
||||
|
||||
set_config() {
|
||||
|
||||
[ ! -d "$path" ] && mkdir -p $path
|
||||
token=$(mbdb get ${appname}.main.token)
|
||||
[ -z "$token" ] && logsh "【$service】" "未配置${appname}的密钥" && exit
|
||||
|
||||
}
|
||||
|
||||
start () {
|
||||
|
||||
if [ "$model" != "arm" ]; then
|
||||
logsh "【$service】" "${appname}服务仅支持arm路由器,准备卸载"
|
||||
${mbroot}/scripts/appmanage.sh del ${appname}
|
||||
exit
|
||||
fi
|
||||
result=$(ps | grep ${mbroot}/apps/${appname}/bin | grep -v grep | wc -l)
|
||||
if [ "$result" != '0' ];then
|
||||
logsh "【$service】" "${appname}已经在运行!"
|
||||
exit 1
|
||||
fi
|
||||
logsh "【$service】" "正在启动${appname}服务... "
|
||||
|
||||
set_config
|
||||
|
||||
# open_port
|
||||
# write_firewall_start
|
||||
|
||||
daemon ${mbroot}/apps/${appname}/bin -fe 0.0.0.0:${port} -u $token -share $path -c ${mbtmp}
|
||||
if [ $? -ne 0 ]; then
|
||||
logsh "【$service】" "启动${appname}服务失败!"
|
||||
else
|
||||
logsh "【$service】" "启动${appname}服务完成!"
|
||||
logsh "【$service】" "请在浏览器中访问[http://$lanip:${port}]"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
stop () {
|
||||
|
||||
logsh "【$service】" "正在停止${appname}服务... "
|
||||
service_stop ${mbroot}/apps/${appname}/bin
|
||||
killall -9 ${appname} &> /dev/null
|
||||
|
||||
}
|
||||
|
||||
|
||||
status() {
|
||||
|
||||
result=$(pssh | grep ${mbroot}/apps/${appname}/bin | grep -v grep | wc -l)
|
||||
if [ "$result" == '0' ]; then
|
||||
status="未运行|0"
|
||||
else
|
||||
status="运行端口号:${port},共享目录: $path|1"
|
||||
fi
|
||||
mbdb set $appname.main.status="$status"
|
||||
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start) start ;;
|
||||
stop) stop ;;
|
||||
restart) stop; start ;;
|
||||
reload) close_port && open_port ;;
|
||||
status) status ;;
|
||||
esac
|
||||
|
||||
7
apps/entware/config/entware.uci
Normal file
7
apps/entware/config/entware.uci
Normal file
@@ -0,0 +1,7 @@
|
||||
service=Entware
|
||||
appname="entware"
|
||||
needver="0.0.1"
|
||||
supports="linux_arm,linux_mips,linux_x86_64"
|
||||
newinfo="修复了ONMP无法使用的问题"
|
||||
appinfo="一款开源且强大的包管理工具,许多功能都通过它来实现"
|
||||
version="0.0.4"
|
||||
21
apps/entware/config/mixbox.conf
Normal file
21
apps/entware/config/mixbox.conf
Normal file
@@ -0,0 +1,21 @@
|
||||
#------------------【Entware】--------------------
|
||||
entware() {
|
||||
|
||||
eval `mbdb export entware`
|
||||
source /etc/mixbox/bin/base
|
||||
echo "********* $service ***********"
|
||||
echo "[${appinfo}]"
|
||||
readsh "启动${appname}服务[1/0] " "enable" "1"
|
||||
if [ "$enable" == '1' ]; then
|
||||
readsh "请输入${appname}安装路径" "path" "$mbdisk/.Entware"
|
||||
echo "安装ONMP后,请勿安装工具箱插件HttpFile和KodExplorer"
|
||||
read -p "启动ONMP安装程序?[1/0] " res
|
||||
[ "$res" == '1' ] && mbdb set $appname.main.onmp="1" || mbdb set $appname.main.onmp="0"
|
||||
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh restart
|
||||
else
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
|
||||
fi
|
||||
|
||||
}
|
||||
#------------------【Entware】--------------------
|
||||
161
apps/entware/scripts/entware.sh
Normal file
161
apps/entware/scripts/entware.sh
Normal file
@@ -0,0 +1,161 @@
|
||||
#!/bin/sh
|
||||
source /etc/mixbox/bin/base
|
||||
eval `mbdb export entware`
|
||||
|
||||
# port=
|
||||
BIN=/opt/etc/init.d/rc.unslung
|
||||
[ -z "$path" ] && path="$mbdisk/.Entware"
|
||||
|
||||
|
||||
# set_env() {
|
||||
|
||||
# echo "alias opkg=/opt/bin/opkg" >> ${mbroot}/config/profile
|
||||
# logsh "【$service】" "已修改opkg配置,请运行source /etc/profile生效!"
|
||||
|
||||
# }
|
||||
|
||||
# clear_env() {
|
||||
# sed -i '/alias opkg/d' ${mbroot}/config/profile
|
||||
# }
|
||||
|
||||
init() {
|
||||
|
||||
logsh "【$service】" "初始化${appname}服务..."
|
||||
if [ -z "$path" ]; then
|
||||
logsh "【$service】" "未配置安装路径!"
|
||||
exit
|
||||
fi
|
||||
[ ! -d /opt/bin ] && mount -o blind "$path" /opt > /dev/null 2>&1
|
||||
result1=$(echo ${profilepath} | grep -c /opt/sbin)
|
||||
result2=$(echo ${libpath} | grep -c /opt/lib)
|
||||
[ "$result1" == '0' ] && mbdb set mixbox.main.profilepath="${profilepath}:/opt/bin:/opt/sbin"
|
||||
[ "$result2" == '0' ] && mbdb set mixbox.main.libpath="${libpath}:/opt/lib"
|
||||
|
||||
if [ ! -f $path/etc/init.d/rc.unslung ]; then
|
||||
logsh "【$service】" "检测到第一次运行${appname}服务,正在安装..."
|
||||
mkdir -p $path > /dev/null 2>&1
|
||||
[ $? -ne 0 ] && logsh "【Tools】" "创建目录失败,检查你的路径是否正确!" && end
|
||||
umount -lf /opt > /dev/null 2>&1
|
||||
mount -o blind $path /opt
|
||||
if [ "$model" = "linux_arm" ]; then
|
||||
if [ "$(uname -r | cut -d'.' -f1)" -ge '3' ]; then
|
||||
wget -O - http://bin.entware.net/armv7sf-k3.2/installer/generic.sh | sh
|
||||
else
|
||||
wget -O - http://bin.entware.net/armv7sf-k2.6/installer/generic.sh | sh
|
||||
fi
|
||||
elif [ "$model" = "linux_mips" ]; then
|
||||
wget -O - http://bin.entware.net/mipselsf-k3.4/installer/generic.sh | sh
|
||||
elif [ "$model" = "linux_x86_64" ]; then
|
||||
wget -O - http://bin.entware.net/x64-k3.2/installer/generic.sh | sh
|
||||
else
|
||||
logsh "【Tools】" "不支持你的设备!"
|
||||
end
|
||||
fi
|
||||
if [ $? -ne 0 ]; then
|
||||
logsh "【Tools】" "【${appname}】服务安装失败"
|
||||
umount -lf /opt
|
||||
rm -rf $path
|
||||
exit 1
|
||||
fi
|
||||
/opt/bin/opkg update
|
||||
/opt/bin/opkg install curl
|
||||
source /etc/profile > /dev/null 2>&1
|
||||
logsh "【$service】" "安装完成,请运行source /etc/profile使配置生效!"
|
||||
logsh "【$service】" "如需安装ONMP,参考https://github.com/mixbox/ONMP"
|
||||
fi
|
||||
# echo >> ${mbroot}/config/profile
|
||||
#if [ -z "$(cat ${mbroot}/config/profile | grep "alias opkg")" ]; then
|
||||
# echo "alias opkg=/opt/bin/opkg" >> ${mbroot}/config/profile
|
||||
# set_env
|
||||
#fi
|
||||
}
|
||||
|
||||
start () {
|
||||
|
||||
result=$(ps | grep "{${appname}}" | grep -v grep | wc -l)
|
||||
if [ "$result" -gt '2' ];then
|
||||
logsh "【$service】" "${appname}已经在运行!"
|
||||
exit 1
|
||||
fi
|
||||
logsh "【$service】" "正在启动${appname}服务... "
|
||||
|
||||
init
|
||||
|
||||
# open_port
|
||||
# write_firewall_start
|
||||
# ${mbroot}/apps/${appname}/bin start >> /tmp/messages 2>&1
|
||||
logsh "【$service】" "启动依赖${appname}的所有插件..."
|
||||
mbdb keys ${appname}.app | while read line
|
||||
do
|
||||
[ "$(mbdb get ${appname}.app.${line})" != '1' ] && continue
|
||||
mbdb set ${line}.main.enable=1
|
||||
${mbroot}/apps/${line}/scripts/${line}.sh status
|
||||
if [ "$(mbdb get mixbox.${line}.status | cut -d'|' -f2)" = '0' ]; then
|
||||
${mbroot}/apps/${line}/scripts/${line}.sh restart
|
||||
fi
|
||||
done
|
||||
|
||||
logsh "【$service】" "${appname}服务启动完成"
|
||||
[ "$onmp" == '1' ] && sh -c "$(curl -kfsSl https://raw.githubusercontent.com/monlor/ONMP/master/oneclick.sh)"
|
||||
|
||||
}
|
||||
|
||||
stop () {
|
||||
|
||||
logsh "【$service】" "正在停止${appname}服务... "
|
||||
[ "$enable" == '0' ] && destroy
|
||||
# ${mbroot}/apps/${appname}/bin stop >> /tmp/messages 2>&1
|
||||
[ -d /opt/bin ] && umountsh /opt
|
||||
# ps | grep ${mbroot}/apps/${appname}/bin | grep -v grep | awk '{print$1}' | xargs kill -9 > /dev/null 2>&1
|
||||
#
|
||||
# clear_env
|
||||
logsh "【$service】" "停止成功,请运行source /etc/profile使配置生效!"
|
||||
logsh "【$service】" "若要重置【${appname}】服务,删除$path文件并启动即可"
|
||||
|
||||
}
|
||||
|
||||
destroy() {
|
||||
|
||||
logsh "【$service】" "关闭依赖${appname}的所有插件..."
|
||||
local uciname=app
|
||||
mbdb keys $appname.app | while read line
|
||||
do
|
||||
[ "$(mbdb get $appname.app.${line})" != '1' ] && continue
|
||||
${mbroot}/apps/${line}/scripts/${line}.sh stop
|
||||
# 后将enable置为0不会运行destroy方法,保存依赖entware的插件列表
|
||||
mbdb set ${line}.main.enable=0
|
||||
done
|
||||
mbdb set mixbox.main.profilepath="$(echo "$profilepath" | sed -e 's/:\/opt\/bin:\/opt\/sbin//')"
|
||||
mbdb set mixbox.main.libpath="$(echo "$libpath" | sed -e 's/:\/opt\/lib//')"
|
||||
|
||||
}
|
||||
|
||||
end() {
|
||||
|
||||
mbdb set $appname.main.enable=0
|
||||
|
||||
stop && exit 1
|
||||
|
||||
}
|
||||
|
||||
|
||||
status() {
|
||||
|
||||
result1=$(echo ${libpath} | grep -c "/opt/lib")
|
||||
result2=$(echo ${profilepath} | grep -c /opt/sbin)
|
||||
if [ -d $path ] && [ "$result1" != '0' ] && [ "$result2" != '0' ] && [ -d /opt/bin ]; then
|
||||
status="安装路径: $path|1"
|
||||
else
|
||||
status="未运行|0"
|
||||
fi
|
||||
mbdb set $appname.main.status="$status"
|
||||
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start) start ;;
|
||||
stop) stop ;;
|
||||
restart) stop; start ;;
|
||||
reload) close_port && open_port ;;
|
||||
status) status ;;
|
||||
esac
|
||||
34
apps/entware/scripts/functions.sh
Normal file
34
apps/entware/scripts/functions.sh
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
auto_start_enable() {
|
||||
[ -z "$1" ] && return 1
|
||||
mbdb set entware.app."$1" "1"
|
||||
}
|
||||
|
||||
auto_start_disable() {
|
||||
[ -z "$1" ] && return 1
|
||||
mbdb del entware.app."$1"
|
||||
}
|
||||
|
||||
detect_entware() {
|
||||
result1=$(mbdb show entware)
|
||||
result2=$(ls /opt | grep etc)
|
||||
if [ -z "$result1" ] || [ -z "$result2" ]; then
|
||||
logsh "【$service】" "检测到【Entware】服务未启动或未安装"
|
||||
return 1
|
||||
else
|
||||
result3=$(echo $PATH | grep opt)
|
||||
[ -z "$result3" ] && export PATH=/opt/bin:/opt/sbin:$PATH
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
install_entware_app() {
|
||||
for i in $@; do
|
||||
result=$(/opt/bin/opkg list-installed | grep -c "^$i")
|
||||
if [ "$result" == '0' ]; then
|
||||
/opt/bin/opkg install $i
|
||||
[ $? -ne 0 ] && logsh "【$service】" "程序$i安装失败!" && return 1
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
}
|
||||
8
apps/fastdick/config/fastdick.uci
Normal file
8
apps/fastdick/config/fastdick.uci
Normal file
@@ -0,0 +1,8 @@
|
||||
service="FastDick"
|
||||
appname="fastdick"
|
||||
needver="0.0.1"
|
||||
supports="linux_arm,linux_mips,linux_x86_64,darwin_x86_64"
|
||||
backupfiles="bin/fastdick"
|
||||
appinfo="迅雷快鸟,宽带提速工具"
|
||||
newinfo=""
|
||||
version="0.0.2"
|
||||
30
apps/fastdick/config/mixbox.conf
Normal file
30
apps/fastdick/config/mixbox.conf
Normal file
@@ -0,0 +1,30 @@
|
||||
#------------------【FastDick】--------------------
|
||||
fastdick() {
|
||||
|
||||
eval `mbdb export fastdick`
|
||||
source /etc/mixbox/bin/base
|
||||
echo "********* $service ***********"
|
||||
echo "[${appinfo}]"
|
||||
[ -z "$(mbdb show entware)" ] && echo "请先安装Entware插件!" && return
|
||||
readsh "启动${appname}服务[1/0] " "enable" "1"
|
||||
if [ "$enable" == '1' ]; then
|
||||
uid=$(mbdb get ${appname}.main.uid) || uid="空"
|
||||
pwd=$(mbdb get ${appname}.main.pwd) || pwd="空"
|
||||
peerid=$(mbdb get ${appname}.main.peerid) || peerid="空"
|
||||
echo "[请按https://github.com/fffonion/Xunlei-Fastdick这里的教程运行swjsq.py并找到运行成功后生成的swjsq_wget.sh文件,复制其所有内容编辑到配置里]"
|
||||
read -p "修改${appname}配置(将开始使用vim编辑快鸟运行脚本)?[1/0]" res
|
||||
if [ "$res" == '1' ]; then
|
||||
echo "[提示]按i开始编辑,编辑完按ESC键再按:wq即可保存退出[注意冒号]"
|
||||
read -p "清空文件之后再编辑?[1/0]" res
|
||||
[ "$res" = '1' ] && cat /dev/null > ${mbroot}/apps/${appname}/bin/${appname}
|
||||
vim ${mbroot}/apps/${appname}/bin/${appname}
|
||||
fi
|
||||
readsh "请输入${appname}外网访问配置[1/0]" "openport" "1"
|
||||
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh restart
|
||||
else
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
|
||||
fi
|
||||
|
||||
}
|
||||
#------------------【FastDick】--------------------
|
||||
1
apps/fastdick/config/version.txt
Normal file
1
apps/fastdick/config/version.txt
Normal file
@@ -0,0 +1 @@
|
||||
1.0.6
|
||||
80
apps/fastdick/scripts/fastdick.sh
Normal file
80
apps/fastdick/scripts/fastdick.sh
Normal file
@@ -0,0 +1,80 @@
|
||||
#!/bin/sh
|
||||
source /etc/mixbox/bin/base
|
||||
eval `mbdb export fastdick`
|
||||
|
||||
|
||||
# set_config() {
|
||||
|
||||
# logsh "【$service】" "检查${appname}配置"
|
||||
# if [ -z "$uid" ] || [ -z "pwd" ] || [ -z "peerid" ]; then
|
||||
# logsh "【$service】" "${appname}用户名或密码为空"
|
||||
# exit
|
||||
# fi
|
||||
# uidline=$(cat ${mbroot}/apps/${appname}/bin/${appname} | grep -n uid | head -1 | cut -d: -f1)
|
||||
# pwdline=$(cat ${mbroot}/apps/${appname}/bin/${appname} | grep -n pwd | head -1 | cut -d: -f1)
|
||||
# peerline=$(cat ${mbroot}/apps/${appname}/bin/${appname} | grep -n peerid | head -1 | cut -d: -f1)
|
||||
# #设置用户名密码
|
||||
# sed -i ""$uidline"s#.*#uid=$uid#" ${mbroot}/apps/${appname}/bin/${appname}
|
||||
# sed -i ""$pwdline"s#.*#pwd=$pwd#" ${mbroot}/apps/${appname}/bin/${appname}
|
||||
# sed -i ""$peerline"s#.*#peerid=$peerid#" ${mbroot}/apps/${appname}/bin/${appname}
|
||||
|
||||
# }
|
||||
|
||||
start () {
|
||||
|
||||
result=$(ps | grep ${mbroot}/apps/${appname}/bin/${appname} | grep -v grep | wc -l)
|
||||
if [ "$result" != '0' ];then
|
||||
logsh "【$service】" "${appname}已经在运行!"
|
||||
exit 1
|
||||
fi
|
||||
logsh "【$service】" "正在启动${appname}服务... "
|
||||
# open_port
|
||||
# write_firewall_start
|
||||
nohup ${mbroot}/apps/${appname}/bin/${appname} &> ${mbroot}/var/log/${appname}.log &
|
||||
logsh "【$service】" "启动${appname}服务完成!"
|
||||
|
||||
|
||||
}
|
||||
|
||||
stop () {
|
||||
|
||||
logsh "【$service】" "正在停止${appname}服务... "
|
||||
killall -9 ${appname} &> /dev/null
|
||||
killall ${mbroot}/apps/${appname}/bin/${appname} > /dev/null 2>&1
|
||||
#
|
||||
|
||||
}
|
||||
|
||||
status() {
|
||||
|
||||
result=$(pssh | grep ${mbroot}/apps/${appname}/bin/${appname} | grep -v grep | wc -l)
|
||||
if [ "$result" == '0' ]; then
|
||||
status="未运行|0"
|
||||
else
|
||||
if [ -f ${mbroot}/var/log/${appname}.log ]; then
|
||||
info=$(cat ${mbroot}/var/log/${appname}.log | tail -1)
|
||||
message=$(echo "$info" | awk -F ',|\{|\}' '{print$8}' | sed -e 's/\"//g' | cut -d':' -f2)
|
||||
province_name=$(echo "$info" | awk -F ',|\{|\}' '{print$10}' | sed -e 's/\"//g' | cut -d':' -f2)
|
||||
sp_name=$(echo "$info" | awk -F ',|\{|\}' '{print$14}' | sed -e 's/\"//g' | cut -d':' -f2)
|
||||
downstream=$(echo "$info" | awk -F ',|\{|\}' '{print$3}' | sed -e 's/\"//g' | cut -d':' -f2)
|
||||
let downstream=$downstream/1024 > /dev/null 2>&1
|
||||
if [ "$message" == "提速成功" ]; then
|
||||
status="登录用户id: $uid, 运营商: $province_name$sp_name, 下行速度: "$downstream"Mbps|1"
|
||||
else
|
||||
status="提速异常, 可能还在运行, 请查看日志cat ${mbroot}/var/log/${appname}.log|0"
|
||||
fi
|
||||
else
|
||||
status="提速异常, 账号问题或登录频繁|0"
|
||||
fi
|
||||
fi
|
||||
mbdb set $appname.main.status="$status"
|
||||
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start) start ;;
|
||||
stop) stop ;;
|
||||
restart) stop; start ;;
|
||||
reload) close_port && open_port ;;
|
||||
status) status ;;
|
||||
esac
|
||||
BIN
apps/filebrowser/bin/filebrowser_darwin_x86_64
Normal file
BIN
apps/filebrowser/bin/filebrowser_darwin_x86_64
Normal file
Binary file not shown.
BIN
apps/filebrowser/bin/filebrowser_linux_arm
Executable file
BIN
apps/filebrowser/bin/filebrowser_linux_arm
Executable file
Binary file not shown.
BIN
apps/filebrowser/bin/filebrowser_linux_mips
Normal file
BIN
apps/filebrowser/bin/filebrowser_linux_mips
Normal file
Binary file not shown.
BIN
apps/filebrowser/bin/filebrowser_linux_x86_64
Normal file
BIN
apps/filebrowser/bin/filebrowser_linux_x86_64
Normal file
Binary file not shown.
8
apps/filebrowser/config/filebrowser.uci
Normal file
8
apps/filebrowser/config/filebrowser.uci
Normal file
@@ -0,0 +1,8 @@
|
||||
service="FileBrowser"
|
||||
appname="filebrowser"
|
||||
needver="0.0.1"
|
||||
appinfo="Web文件浏览器"
|
||||
supports="linux_arm,linux_mips,linux_x86_64,darwin_x86_64"
|
||||
backupfiles="config/filebrowser.conf"
|
||||
newinfo="更新arm二进制至2.0.3"
|
||||
version="0.0.3"
|
||||
41
apps/filebrowser/config/mixbox.conf
Normal file
41
apps/filebrowser/config/mixbox.conf
Normal file
@@ -0,0 +1,41 @@
|
||||
#------------------【FileBrowser】--------------------
|
||||
filebrowser() {
|
||||
|
||||
eval `mbdb export filebrowser`
|
||||
source /etc/mixbox/bin/base
|
||||
uciset="mbdb set $appname.main"
|
||||
echo "********* $service ***********"
|
||||
echo "[${appinfo}]"
|
||||
readsh "启动${appname}服务[1/0] " "enable" "1"
|
||||
|
||||
if [ "$enable" == '1' ]; then
|
||||
# Scripts Here
|
||||
[ -z "${port}" ] && port=1086
|
||||
read -p "修改${appname}端口号(${port})?[1/0] " res
|
||||
if [ "$res" == '1' ]; then
|
||||
read -p "请输入端口号:" res
|
||||
[ -n "$res" ] && mbdb set $appname.main.port="$res"
|
||||
fi
|
||||
[ -z "$scope" ] && scope="$mbdisk"
|
||||
read -p "修改${appname}默认访问路径($scope)?[1/0] " res
|
||||
if [ "$res" == '1' ]; then
|
||||
while(true)
|
||||
do
|
||||
read -p "请输入默认访问路径:" res
|
||||
[ -z "$res" ] && break
|
||||
if [ ! -d "$res" ]; then
|
||||
echo "输入的路径不存在!"
|
||||
else
|
||||
[ -n "$res" ] && mbdb set $appname.main.scope="$res"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
readsh "请输入${appname}外网访问配置[1/0]" "openport" "1"
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh restart
|
||||
else
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
|
||||
fi
|
||||
|
||||
}
|
||||
#------------------【FileBrowser】--------------------
|
||||
1
apps/filebrowser/config/version.txt
Normal file
1
apps/filebrowser/config/version.txt
Normal file
@@ -0,0 +1 @@
|
||||
1.0.3
|
||||
62
apps/filebrowser/scripts/filebrowser.sh
Normal file
62
apps/filebrowser/scripts/filebrowser.sh
Normal file
@@ -0,0 +1,62 @@
|
||||
#!/bin/sh
|
||||
source /etc/mixbox/bin/base
|
||||
eval `mbdb export filebrowser`
|
||||
|
||||
[ -z "${port}" ] && port=1086
|
||||
[ -z "$scope" ] && scope="$mbdisk"
|
||||
|
||||
|
||||
start() {
|
||||
|
||||
[ -n "$(pidof ${appname})" ] && logsh "【$service】" "${appname}已经在运行!" && exit 1
|
||||
logsh "【$service】" "正在启动${appname}服务... "
|
||||
cru a "${appname}" "0 6 * * * ${mbroot}/apps/${appname}/scripts/${appname}.sh restart"
|
||||
# Scripts Here
|
||||
open_port
|
||||
write_firewall_start
|
||||
daemon ${mbroot}/apps/${appname}/bin/${appname} -p ${port} -d ${mbroot}/apps/${appname}/config/${appname}.db -l ${mbroot}/var/log/${appname}.log -s $scope
|
||||
if [ $? -ne 0 ]; then
|
||||
logsh "【$service】" "启动${appname}服务失败!"
|
||||
else
|
||||
logsh "【$service】" "启动${appname}服务完成!"
|
||||
logsh "【$service】" "请在浏览器中访问[http://$lanip:${port}],默认用户名密码admin"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
stop() {
|
||||
|
||||
logsh "【$service】" "正在停止${appname}服务... "
|
||||
close_port
|
||||
remove_firewall_start
|
||||
killall -9 ${appname} &> /dev/null
|
||||
[ "$enable" == '0' ] && destroy
|
||||
|
||||
}
|
||||
|
||||
destroy() {
|
||||
|
||||
# End app, Scripts here
|
||||
cru d "${appname}"
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
|
||||
status() {
|
||||
|
||||
if [ -z "$(pidof ${appname})" ]; then
|
||||
status="未运行|0"
|
||||
else
|
||||
status="运行端口号:${port}|1"
|
||||
fi
|
||||
mbdb set $appname.main.status="$status"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start) start ;;
|
||||
stop) stop ;;
|
||||
restart) stop; start ;;
|
||||
reload) close_port && open_port ;;
|
||||
status) status ;;
|
||||
esac
|
||||
8
apps/firewall/config/firewall.uci
Normal file
8
apps/firewall/config/firewall.uci
Normal file
@@ -0,0 +1,8 @@
|
||||
service="FireWall"
|
||||
appname="firewall"
|
||||
needver="0.0.1"
|
||||
supports="linux_arm,linux_mips,linux_x86_64"
|
||||
openport=1
|
||||
appinfo="防火墙端口开放插件"
|
||||
newinfo="支持添加多种端口号类型"
|
||||
version="0.0.2"
|
||||
52
apps/firewall/config/mixbox.conf
Normal file
52
apps/firewall/config/mixbox.conf
Normal file
@@ -0,0 +1,52 @@
|
||||
#------------------【FireWall】--------------------
|
||||
firewall() {
|
||||
|
||||
eval `mbdb export firewall`
|
||||
source /etc/mixbox/bin/base
|
||||
echo "********* $service ***********"
|
||||
echo "[${appinfo}]"
|
||||
readsh "启动${appname}服务[1/0] " "enable" "1"
|
||||
|
||||
if [ "$enable" == '1' ]; then
|
||||
echo "已开放端口(工具箱插件默认已开通端口): "
|
||||
allport=$(mbdb show $appname.openport)
|
||||
[ -z "$allport" ] && echo "没有开通端口!" || echo "$allport"
|
||||
read -p "是否要更改${appname}配置?[1/0] " res
|
||||
if [ "$res" == '1' ]; then
|
||||
read -p "添加${appname}配置?[1/0] " res
|
||||
if [ "$res" == '1' ]; then
|
||||
while(true)
|
||||
do
|
||||
read -p "请输入配置名称: " name
|
||||
read -p "请输入开通端口(列入70或70,80,10或100:110): " port
|
||||
if [ ! -z "$name" -a ! -z "${port}" ]; then
|
||||
mbdb set $appname.openport.$name="${port}"
|
||||
else
|
||||
echo "配置为空,未添加!"
|
||||
fi
|
||||
read -p "继续添加配置?[1/0] " res
|
||||
[ "$res" == '0' -o -z "$res" ] && break
|
||||
done
|
||||
fi
|
||||
read -p "删除${appname}配置?[1/0] " res
|
||||
if [ "$res" == '1' ]; then
|
||||
read -p "清空配置再添加?[1/0] " res
|
||||
[ "$res" == '1' ] && mbdb clear $appname.openport
|
||||
echo "`mbdb keys $appname.openport`"
|
||||
while(true)
|
||||
do
|
||||
read -p "请输入要删除的配置名: " res
|
||||
[ ! -z "$res" ] && mbdb del $appname.openport.$res
|
||||
read -p "继续删除配置?[1/0] " res
|
||||
[ "$res" == '0' -o -z "$res" ] && break
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh restart
|
||||
else
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
|
||||
fi
|
||||
|
||||
}
|
||||
#------------------【FireWall】--------------------
|
||||
1
apps/firewall/config/version.txt
Normal file
1
apps/firewall/config/version.txt
Normal file
@@ -0,0 +1 @@
|
||||
1.1.0
|
||||
67
apps/firewall/scripts/firewall.sh
Normal file
67
apps/firewall/scripts/firewall.sh
Normal file
@@ -0,0 +1,67 @@
|
||||
#!/bin/sh
|
||||
source /etc/mixbox/bin/base
|
||||
eval `mbdb export firewall`
|
||||
|
||||
# port=1688
|
||||
|
||||
open_ports() {
|
||||
|
||||
logsh "【$service】" "加载${appname}配置"
|
||||
[ -z "`mbdb keys $appname.openport`" ] && logsh "【$service】" "未添加${appname}配置!" && exit
|
||||
mbdb keys $appname.openport | while read line
|
||||
do
|
||||
name="${line}"
|
||||
port=$(mbdb get $appname.openport.$name)
|
||||
[ -z "$name" -o -z "${port}" ] && return 1
|
||||
logsh "【$service】" "开放$name的端口号: ${port}"
|
||||
open_port ${port}
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
start () {
|
||||
|
||||
result=$(ps | grep ${mbroot}/apps/${appname}/bin/${appname} | grep -v grep | wc -l)
|
||||
if [ "$result" != '0' ];then
|
||||
logsh "【$service】" "${appname}已经在运行!"
|
||||
exit 1
|
||||
fi
|
||||
logsh "【$service】" "正在启动${appname}服务... "
|
||||
|
||||
open_ports
|
||||
write_firewall_start
|
||||
|
||||
status
|
||||
logsh "【$service】" "启动${appname}服务完成!"
|
||||
|
||||
|
||||
}
|
||||
|
||||
stop () {
|
||||
|
||||
logsh "【$service】" "正在停止${appname}服务... "
|
||||
close_port
|
||||
remove_firewall_start
|
||||
|
||||
}
|
||||
|
||||
|
||||
status() {
|
||||
|
||||
result1=$(iptables -S | grep -c "mixbox-${appname}")
|
||||
if [ "$result1" != '0' ]; then
|
||||
status="运行中|1"
|
||||
else
|
||||
status="未运行|0"
|
||||
fi
|
||||
mbdb set $appname.main.status="$status"
|
||||
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start) start ;;
|
||||
stop) stop ;;
|
||||
restart) stop; start ;;
|
||||
reload) close_port && open_ports ;;
|
||||
status) status ;;
|
||||
esac
|
||||
BIN
apps/frpc/bin/frpc_darwin_x86_64
Normal file
BIN
apps/frpc/bin/frpc_darwin_x86_64
Normal file
Binary file not shown.
BIN
apps/frpc/bin/frpc_linux_arm
Normal file
BIN
apps/frpc/bin/frpc_linux_arm
Normal file
Binary file not shown.
BIN
apps/frpc/bin/frpc_linux_mips
Normal file
BIN
apps/frpc/bin/frpc_linux_mips
Normal file
Binary file not shown.
BIN
apps/frpc/bin/frpc_linux_x86_64
Normal file
BIN
apps/frpc/bin/frpc_linux_x86_64
Normal file
Binary file not shown.
7
apps/frpc/config/frpc.uci
Normal file
7
apps/frpc/config/frpc.uci
Normal file
@@ -0,0 +1,7 @@
|
||||
service=Frpc
|
||||
appname="frpc"
|
||||
needver="0.0.1"
|
||||
supports="linux_arm,linux_mips,linux_x86_64,darwin_x86_64"
|
||||
appinfo="内网穿透工具,相对于ngrok资源占用较多"
|
||||
newinfo="修复自定义域名配置错误"
|
||||
version="0.0.5"
|
||||
97
apps/frpc/config/mixbox.conf
Normal file
97
apps/frpc/config/mixbox.conf
Normal file
@@ -0,0 +1,97 @@
|
||||
#------------------【Frpc】--------------------
|
||||
frpcAdd() {
|
||||
read -p "请输入${appname}名称:" name
|
||||
[ -z "$name" ] && return
|
||||
read -p "请输入${appname}类型(1.http 2.tcp):" type
|
||||
read -p "请输入${appname}本地ip(回车默认$lanip):" local_ip
|
||||
read -p "请输入${appname}本地端口:" local_port
|
||||
remote_port="" && domain=""
|
||||
[ "$type" == '2' ] && read -p "请输入${appname}远程访问端口:" remote_port
|
||||
[ "$type" == '1' ] && read -p "请输入${appname}域名(自动识别子域名或自定义域名):" domain
|
||||
if [ ! -z $name ]; then
|
||||
[ -z $local_ip ] && local_ip=$lanip
|
||||
if [ "$type" == '1' ]; then
|
||||
type=http
|
||||
elif [ "$type" == '2' ]; then
|
||||
type=tcp
|
||||
else
|
||||
type="输入有误"
|
||||
fi
|
||||
read -p "确定要添加配置:$name,$type,$local_ip,$local_port,$remote_port,$domain?[1/0] " res
|
||||
if [ "$res" == '1' ]; then
|
||||
mbdb set $appname.info.$name="$type,$local_ip,$local_port,$remote_port,$domain"
|
||||
fi
|
||||
fi
|
||||
read -p "添加完成,再添加一个?[1/0] " res
|
||||
if checkread $res; then
|
||||
[ "$res" == '1' ] && frpcAdd
|
||||
fi
|
||||
}
|
||||
|
||||
frpcDel() {
|
||||
|
||||
frpclist=$(mbdb keys $appname.info)
|
||||
echo "${appname}穿透配置[`echo $frpclist`]"
|
||||
read -p "请输入要删除的配置名:" res
|
||||
[ ! -z "$res" ] && mbdb del $appname.info.$res
|
||||
read -p "删除完成,继续删除?[1/0] " res
|
||||
if checkread $res; then
|
||||
[ "$res" == '1' ] && frpcDel
|
||||
fi
|
||||
}
|
||||
|
||||
frpc() {
|
||||
|
||||
eval `mbdb export frpc`
|
||||
source /etc/mixbox/bin/base
|
||||
echo "********* $service ***********"
|
||||
echo "[${appinfo}]"
|
||||
readsh "启动${appname}服务[1/0] " "enable" "1"
|
||||
if [ "$enable" == '1' ]; then
|
||||
echo "1.[0.9.3] 2.[0.17.0] 3.[0.20.0]"
|
||||
read -p "请选择${appname}运行版本(回车不修改,默认最新):" res
|
||||
case "$res" in
|
||||
1) res="0.9.3" ;;
|
||||
2) res="0.17.0" ;;
|
||||
3) res="0.20.0" ;;
|
||||
*) res="" ;;
|
||||
esac
|
||||
[ -z "$res" ] && [ -z "$runver" ] && res="0.20.0"
|
||||
[ -n "$res" ] && mbdb set $appname.main.runver="$res"
|
||||
|
||||
[ -z "$server" ] && server="空"
|
||||
[ -z "$server_port" ] && server_port="空"
|
||||
[ -z "$token" ] && token="空"
|
||||
read -p "修改${appname}服务器($server, $server_port, $token)?[1/0] " res
|
||||
if [ "$res" == '1' ]; then
|
||||
read -p "请输入${appname}服务器:" res
|
||||
[ ! -z "$res" ] && mbdb set $appname.main.server="$res"
|
||||
read -p "请输入${appname}服务器端口:" res
|
||||
[ ! -z "$res" ] && mbdb set $appname.main.server_port="$res"
|
||||
read -p "请输入${appname}服务器秘钥:" res
|
||||
[ ! -z "$res" ] && mbdb set $appname.main.token="$res"
|
||||
if [ "$(mbdb get ${appname}.main.runver)" != "0.9.3" ]; then
|
||||
read -p "请输入${appname}的tcp_mux配置(true/false):" res
|
||||
[ -n "$res" ] && mbdb set $appname.main.tcp_mux="$res"
|
||||
read -p "请输入${appname}的user配置:" res
|
||||
[ -n "$res" ] && mbdb set $appname.main.user="$res"
|
||||
read -p "请输入${appname}的协议配置protocol:" res
|
||||
[ -n "$res" ] && mbdb set $appname.main.protocol="$res"
|
||||
|
||||
fi
|
||||
fi
|
||||
frpclist=$(mbdb keys $appname.info)
|
||||
[ -z "$frpclist" ] && frpclist="空"
|
||||
echo "${appname}穿透配置[`echo $frpclist`]"
|
||||
read -p "添加${appname}穿透配置?[1/0] " res
|
||||
[ "$res" == '1' ] && frpcAdd
|
||||
read -p "删除${appname}穿透配置?[1/0] " res
|
||||
[ "$res" == '1' ] && frpcDel
|
||||
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh restart
|
||||
else
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
|
||||
fi
|
||||
|
||||
}
|
||||
#------------------【Frpc】--------------------
|
||||
133
apps/frpc/scripts/frpc.sh
Normal file
133
apps/frpc/scripts/frpc.sh
Normal file
@@ -0,0 +1,133 @@
|
||||
#!/bin/sh
|
||||
source /etc/mixbox/bin/base
|
||||
eval `mbdb export frpc`
|
||||
|
||||
# port=
|
||||
[ -z "$tcp_mux" ] && tcp_mux="true"
|
||||
[ -z "$user" ] && user="mixbox"
|
||||
[ -z "$protocol" ] && protocol="tcp"
|
||||
[ -z "$runver" ] && runver=`${mbroot}/apps/${appname}/bin/${appname} -v`
|
||||
|
||||
set_config() {
|
||||
|
||||
logsh "【$service】" "生成${appname}配置文件"
|
||||
result=$(mbdb show ${appname}.main | grep server | wc -l)
|
||||
if [ "$result" == '0' ]; then
|
||||
logsh "【$service】" "${appname}配置出现问题!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ "$(${mbroot}/apps/${appname}/bin/${appname} -v)" != "$runver" ]; then
|
||||
logsh "【$service】" "检测到版本号更换,重新下载${appname}程序..."
|
||||
wgetsh "${mbroot}/apps/${appname}/bin/${appname}" "$mburl/appsbin/frp-bin/$runver/frpc_${model}"
|
||||
[ "$?" -ne 0 ] && logsh "【$service】" "下载${appname}程序失败!" && exit 1
|
||||
fi
|
||||
|
||||
token=$(mbdb get ${appname}.main.token)
|
||||
cat > ${mbroot}/apps/${appname}/config/${appname}.conf <<-EOF
|
||||
[common]
|
||||
server_addr = $server
|
||||
server_port = $server_port
|
||||
log_file = ${mbroot}/var/log/${appname}.log
|
||||
log_level = info
|
||||
log_max_days = 1
|
||||
EOF
|
||||
if [ "$runver" != "0.9.3" ]; then
|
||||
echo "token = $token" >> ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
echo "tcp_mux = $tcp_mux" >> ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
echo "user = $user" >> ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
echo "protocol = $protocol" >> ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
else
|
||||
echo "privilege_token = $token" >> ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
fi
|
||||
mbdb show ${appname}.info | while read line
|
||||
do
|
||||
[ -z "${line}" ] || [ ${line:0:1} == "#" ] && continue
|
||||
echo >> ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
name="$(echo ${line} | cut -d'=' -f1)"
|
||||
info="$(echo ${line} | cut -d'=' -f2)"
|
||||
echo "[$name]" >> ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
type=`cutsh $info 1`
|
||||
[ "$type" != "http" -a "$type" != "tcp" ] && logsh "【$service】" "节点$name类型设置错误!" && exit
|
||||
echo "type = $type" >> ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
echo "local_ip = `cutsh $info 2`" >> ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
echo "local_port = `cutsh $info 3`" >> ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
if [ "$type" == "tcp" -o "$type" == "udp" ]; then
|
||||
echo "remote_port = `cutsh $info 4`" >> ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
logsh "【$service】" "加载${appname}配置:【$name】启动为tcp/udp模式,端口号:[`cutsh ${line} 4`]"
|
||||
fi
|
||||
if [ "$type" == "http" -o "$type" == "https" ]; then
|
||||
domain=`cutsh $info 5`
|
||||
if [ `echo $domain | grep "\." | wc -l` -eq 0 ]; then
|
||||
echo "subdomain = $domain" >> ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
logsh "【$service】" "加载${appname}配置:【$name】启动为http/https子域名模式,域名:[$domain]"
|
||||
else
|
||||
echo "custom_domains = $domain" >> ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
logsh "【$service】" "加载${appname}配置:【$name】启动为http/https自定义域名模式,域名:[$domain]"
|
||||
fi
|
||||
fi
|
||||
echo "use_encryption = true" >> ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
echo "use_gzip = false" >> ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
start () {
|
||||
|
||||
result=$(ps | grep ${mbroot}/apps/${appname}/bin/${appname} | grep -v grep | wc -l)
|
||||
if [ "$result" != '0' ];then
|
||||
logsh "【$service】" "${appname}已经在运行!"
|
||||
exit 1
|
||||
fi
|
||||
logsh "【$service】" "正在启动${appname}服务... "
|
||||
cru a "${appname}" "0 6 * * * ${mbroot}/apps/${appname}/scripts/${appname}.sh restart"
|
||||
set_config
|
||||
|
||||
# open_port
|
||||
# write_firewall_start
|
||||
daemon ${mbroot}/apps/${appname}/bin/${appname} -c ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
if [ $? -ne 0 ]; then
|
||||
logsh "【$service】" "启动${appname}服务失败!"
|
||||
else
|
||||
logsh "【$service】" "启动${appname}服务完成!"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
stop () {
|
||||
|
||||
logsh "【$service】" "正在停止${appname}服务... "
|
||||
|
||||
killall -9 ${appname} &> /dev/null
|
||||
#
|
||||
rm -rf ${mbroot}/apps/${appname}/config/${appname}.conf > /dev/null 2>&1
|
||||
[ "$enable" == '0' ] && destroy
|
||||
|
||||
}
|
||||
|
||||
destroy() {
|
||||
|
||||
cru d "${appname}"
|
||||
|
||||
}
|
||||
|
||||
|
||||
status() {
|
||||
|
||||
result=$(pssh | grep ${mbroot}/apps/${appname}/bin/${appname} | grep -v grep | wc -l)
|
||||
if [ "$result" == '0' ]; then
|
||||
status="未运行|0"
|
||||
else
|
||||
status="运行服务器: $server:$server_port|1"
|
||||
fi
|
||||
mbdb set $appname.main.status="$status"
|
||||
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start) start ;;
|
||||
stop) stop ;;
|
||||
restart) stop; start ;;
|
||||
reload) stop; start ;;
|
||||
status) status ;;
|
||||
esac
|
||||
BIN
apps/frps/bin/frps_darwin_x86_64
Normal file
BIN
apps/frps/bin/frps_darwin_x86_64
Normal file
Binary file not shown.
BIN
apps/frps/bin/frps_linux_arm
Normal file
BIN
apps/frps/bin/frps_linux_arm
Normal file
Binary file not shown.
BIN
apps/frps/bin/frps_linux_mips
Normal file
BIN
apps/frps/bin/frps_linux_mips
Normal file
Binary file not shown.
BIN
apps/frps/bin/frps_linux_x86_64
Normal file
BIN
apps/frps/bin/frps_linux_x86_64
Normal file
Binary file not shown.
8
apps/frps/config/frps.uci
Normal file
8
apps/frps/config/frps.uci
Normal file
@@ -0,0 +1,8 @@
|
||||
service="Frps"
|
||||
appname="frps"
|
||||
needver="0.0.1"
|
||||
openport="1"
|
||||
supports="linux_arm,linux_mips,linux_x86_64,darwin_x86_64"
|
||||
appinfo="内网穿透工具Frp服务端"
|
||||
newinfo="frp程序更新到0.21.0"
|
||||
version="1.1.2"
|
||||
39
apps/frps/config/mixbox.conf
Normal file
39
apps/frps/config/mixbox.conf
Normal file
@@ -0,0 +1,39 @@
|
||||
#------------------【Frps】--------------------
|
||||
frps() {
|
||||
|
||||
eval `mbdb export frps`
|
||||
source /etc/mixbox/bin/base
|
||||
uciset="mbdb set $appname.main"
|
||||
echo "********* $service ***********"
|
||||
echo "[${appinfo}]"
|
||||
echo "技巧:回车表示默认或历史设置,-1表示还原默认或不启用"
|
||||
readsh "启动${appname}服务[1/0] " "enable" "1"
|
||||
|
||||
if [ "$enable" == '1' ]; then
|
||||
# Scripts Here
|
||||
read -p "修改${appname}配置信息?[1/0] " res
|
||||
if [ "$res" = '1' ]; then
|
||||
readsh "请输入${appname}运行端口号" "port" "7000"
|
||||
readsh "请输入${appname}的udp端口号" "udp_port" "7001"
|
||||
readsh "请输入${appname}的kcp配置[1/0]" "kcp" "1"
|
||||
readsh "请输入${appname}用于http穿透的端口号" "http_port" "90"
|
||||
readsh "请输入${appname}用于https穿透的端口号" "https_port" "91"
|
||||
readsh "请输入${appname}访问密钥" "token" "12345678"
|
||||
readsh "请输入${appname}子域名" "subdomain"
|
||||
read -p "是否启用${appname}的web控制面板?[1/0] " res
|
||||
[ -n "$res" ] && mbdb set $appname.main.dashboard="$res"
|
||||
if [ "$res" = '1' ]; then
|
||||
readsh "请输入${appname}控制面板端口号" "dashboard_port" "7500"
|
||||
readsh "请输入${appname}控制面板用户名" "dashboard_user" "admin"
|
||||
readsh "请输入${appname}控制面板密码" "dashboard_pwd" "admin"
|
||||
fi
|
||||
fi
|
||||
readsh "请输入${appname}外网访问配置[1/0]" "openport" "1"
|
||||
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh restart
|
||||
else
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
|
||||
fi
|
||||
|
||||
}
|
||||
#------------------【Frps】--------------------
|
||||
1
apps/frps/config/version.txt
Normal file
1
apps/frps/config/version.txt
Normal file
@@ -0,0 +1 @@
|
||||
1.0.4
|
||||
94
apps/frps/scripts/frps.sh
Normal file
94
apps/frps/scripts/frps.sh
Normal file
@@ -0,0 +1,94 @@
|
||||
#!/bin/sh
|
||||
source /etc/mixbox/bin/base
|
||||
eval `mbdb export frps`
|
||||
|
||||
open_ports() {
|
||||
[ -n "${port}" ] && open_port ${port}
|
||||
[ -n "$udp_port" ] && open_port $udp_port
|
||||
[ -n "$http_port" ] && open_port $http_port
|
||||
[ -n "$https_port" ] && open_port $https_port
|
||||
[ -n "$dashboard_port" ] && open_port $dashboard_port
|
||||
}
|
||||
|
||||
start() {
|
||||
|
||||
[ -n "$(pidof ${appname})" ] && logsh "【$service】" "${appname}已经在运行!" && exit 1
|
||||
logsh "【$service】" "正在启动${appname}服务... "
|
||||
# cru a "${appname}" "0 6 * * * ${mbroot}/apps/${appname}/scripts/${appname}.sh restart"
|
||||
# Scripts Here
|
||||
open_ports
|
||||
write_firewall_start
|
||||
cat > ${mbroot}/apps/${appname}/config/${appname}.conf <<-EOF
|
||||
[common]
|
||||
bind_addr = 0.0.0.0
|
||||
bind_port = ${port}
|
||||
bind_udp_port = $udp_port
|
||||
`[ "$kcp" = '1' ] && echo "kcp_bind_port = ${port}"`
|
||||
vhost_http_port = $http_port
|
||||
vhost_https_port = $https_port
|
||||
dashboard_addr = 0.0.0.0
|
||||
`[ "$dashboard" = '1' ] && echo "dashboard_port = $dashboard_port"`
|
||||
`[ "$dashboard" = '1' ] && echo "dashboard_user = $dashboard_user"`
|
||||
`[ "$dashboard" = '1' ] && echo "dashboard_pwd = $dashboard_pwd"`
|
||||
log_file = /var/log/${appname}.log
|
||||
log_level = info
|
||||
log_max_days = 3
|
||||
token = $token
|
||||
#max_pool_count = 5
|
||||
#max_ports_per_client = 0
|
||||
#authentication_timeout = 900
|
||||
`[ -n "$subdomain" ] && echo "subdomain_host = $subdomain"`
|
||||
tcp_mux = true
|
||||
EOF
|
||||
daemon ${mbroot}/apps/${appname}/bin/${appname} -c ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
if [ $? -ne 0 ]; then
|
||||
logsh "【$service】" "启动${appname}服务失败!"
|
||||
else
|
||||
logsh "【$service】" "启动${appname}服务完成!"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
stop() {
|
||||
|
||||
logsh "【$service】" "正在停止${appname}服务... "
|
||||
[ "$enable" == '0' ] && destroy
|
||||
close_port
|
||||
remove_firewall_start
|
||||
killall -9 ${appname} &> /dev/null
|
||||
|
||||
|
||||
}
|
||||
|
||||
destroy() {
|
||||
|
||||
# End app, Scripts here
|
||||
# cru d "${appname}"
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
end() {
|
||||
|
||||
mbdb set $appname.main.enable=0
|
||||
|
||||
stop && exit 1
|
||||
|
||||
}
|
||||
|
||||
status() {
|
||||
if [ -n "$(pidof ${appname})" ]; then
|
||||
status="运行端口号:${port}|1"
|
||||
else
|
||||
status="未运行|0"
|
||||
fi
|
||||
mbdb set $appname.main.status="$status"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start) start ;;
|
||||
stop) stop ;;
|
||||
restart) stop; start ;;
|
||||
reload) close_port && open_ports ;;
|
||||
status) status ;;
|
||||
esac
|
||||
7
apps/httpfile/config/httpfile.uci
Normal file
7
apps/httpfile/config/httpfile.uci
Normal file
@@ -0,0 +1,7 @@
|
||||
service="HttpFile"
|
||||
appname="httpfile"
|
||||
needver="0.0.1"
|
||||
supports="linux_arm,linux_mips,linux_x86_64"
|
||||
newinfo="脚本逻辑错误"
|
||||
appinfo="搭建简单的web文件浏览页面"
|
||||
version="0.0.3"
|
||||
56
apps/httpfile/config/mixbox.conf
Normal file
56
apps/httpfile/config/mixbox.conf
Normal file
@@ -0,0 +1,56 @@
|
||||
#------------------【HttpFile】--------------------
|
||||
httpfile() {
|
||||
|
||||
eval `mbdb export httpfile`
|
||||
source /etc/mixbox/bin/base
|
||||
echo "********* $service ***********"
|
||||
echo "[${appinfo}]"
|
||||
echo "[如需使用ONMP请停止本插件]"
|
||||
[ -z "$(mbdb show entware)" ] && echo "请先安装Entware插件!" && return
|
||||
readsh "启动${appname}服务[1/0] " "enable" "1"
|
||||
if [ "$enable" == '1' ]; then
|
||||
echo "${appname}全部配置: "
|
||||
allinfo=$(mbdb show $appname.web)
|
||||
[ -z "$allinfo" ] && echo "未添加配置!" || echo "$allinfo"
|
||||
read -p "是否要更改${appname}配置?[1/0] " res
|
||||
if [ "$res" == '1' ]; then
|
||||
read -p "添加${appname}配置?[1/0] " res
|
||||
if [ "$res" == '1' ]; then
|
||||
while(true)
|
||||
do
|
||||
read -p "请输入${appname}配置名称: " name
|
||||
read -p "请输入${appname}运行端口号: " port
|
||||
read -p "请输入${appname}访问路径: " path
|
||||
if [ -z "$name" -o -z "${port}" -o -z "$path" ]; then
|
||||
echo "配置不能为空,未添加!"
|
||||
else
|
||||
mbdb set $appname.web.$name="${port},$path"
|
||||
fi
|
||||
echo "已添加配置[$name $path ${port}]"
|
||||
read -p "继续添加配置?[1/0] " res
|
||||
[ "$res" == '0' -o -z "$res" ] && break
|
||||
done
|
||||
fi
|
||||
read -p "删除${appname}配置?[1/0] " res
|
||||
if [ "$res" == '1' ]; then
|
||||
read -p "清空配置再添加?[1/0] " res
|
||||
[ "$res" == '1' ] && mbdb clear $appname.web
|
||||
echo "["$(mbdb keys $appname.web)"]"
|
||||
while(true)
|
||||
do
|
||||
read -p "请输入要删除的配置名: " res
|
||||
[ ! -z "$res" ] && mbdb del $appname.web.$res
|
||||
read -p "继续删除配置?[1/0] " res
|
||||
[ "$res" == '0' -o -z "$res" ] && break
|
||||
done
|
||||
fi
|
||||
fi
|
||||
readsh "请输入${appname}外网访问配置[1/0]" "openport" "1"
|
||||
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh restart
|
||||
else
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
|
||||
fi
|
||||
|
||||
}
|
||||
#------------------【HttpFile】--------------------
|
||||
165
apps/httpfile/scripts/httpfile.sh
Normal file
165
apps/httpfile/scripts/httpfile.sh
Normal file
@@ -0,0 +1,165 @@
|
||||
#!/bin/sh
|
||||
source /etc/mixbox/bin/base
|
||||
eval `mbdb export httpfile`
|
||||
source /etc/mixbox/apps/entware/scripts/functions.sh
|
||||
|
||||
# port=
|
||||
BIN=/opt/sbin/nginx
|
||||
NGINXCONF=/opt/etc/nginx/nginx.conf
|
||||
CONF=/opt/etc/nginx/vhost/httpfile.conf
|
||||
ports=""
|
||||
|
||||
open_ports() {
|
||||
mbdb get $appname.main.ports | tr ',' '\n' | while read line; do
|
||||
[ -z "${line}" ] && continue
|
||||
open_port "${line}"
|
||||
done
|
||||
}
|
||||
|
||||
set_config() {
|
||||
|
||||
result=$(/opt/bin/opkg list-installed | grep -c "^nginx")
|
||||
[ "$result" == '0' ] && /opt/bin/opkg install nginx
|
||||
logsh "【$service】" "生成nginx配置信息..."
|
||||
#修改nginx配置文件
|
||||
[ ! -x "${mbroot}/apps/${appname}/bin" ] && logsh "【$service】" "nginx未安装!" && end
|
||||
cat > ${mbtmp}/nginx.conf <<-\EOF
|
||||
user root;
|
||||
pid /opt/var/run/nginx.pid;
|
||||
worker_processes auto;
|
||||
worker_rlimit_nofile 65535;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
|
||||
include mime.types;
|
||||
sendfile on;
|
||||
default_type application/octet-stream;
|
||||
keepalive_timeout 65;
|
||||
client_max_body_size 4G;
|
||||
include /opt/etc/nginx/vhost/*.conf;
|
||||
|
||||
}
|
||||
EOF
|
||||
umountsh $NGINXCONF
|
||||
mount --bind ${mbtmp}/nginx.conf $NGINXCONF
|
||||
|
||||
# 生成配置文件
|
||||
logsh "【$service】" "生成${appname}配置文件..."
|
||||
[ ! -d "/opt/etc/nginx/vhost" ] && mkdir -p /opt/etc/nginx/vhost
|
||||
[ -z "`mbdb keys $appname.web`" ] && logsh "【$service】" "未添加${appname}配置!" && end
|
||||
rm -rf ${mbtmp}/${appname}.conf
|
||||
mbdb keys $appname.web | while read line
|
||||
do
|
||||
port=$(mbdb get $appname.web.${line} | cutsh 1)
|
||||
path=$(mbdb get $appname.web.${line} | cutsh 2)
|
||||
cat >> ${mbtmp}/${appname}.conf <<-\EOF
|
||||
server {
|
||||
listen port;
|
||||
server_name httpfile;
|
||||
charset utf-8;
|
||||
location / {
|
||||
root directory;
|
||||
index index.php index.html index.htm;
|
||||
autoindex on;
|
||||
autoindex_exact_size off;
|
||||
autoindex_localtime on;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
sed -i "s/port/${port}/" ${mbtmp}/${appname}.conf
|
||||
sed -i "s#directory#$path#" ${mbtmp}/${appname}.conf
|
||||
logsh "【$service】" "加载${appname}配置:[端口号:${port}, 路径:$path]"
|
||||
ports="${port}s${port},"
|
||||
done
|
||||
mbdb set $appname.main.ports="$(mbdb values $appname.web | cutsh 1 | tr '\n' ',')"
|
||||
rm -rf ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
ln -s ${mbtmp}/${appname}.conf ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
}
|
||||
|
||||
start () {
|
||||
|
||||
result=$(ps | grep nginx | grep -v sysa | grep -v grep | wc -l)
|
||||
if [ "$result" != '0' ] && [ -f "${mbroot}/apps/${appname}/config/${appname}.conf" ];then
|
||||
logsh "【$service】" "${appname}已经在运行!"
|
||||
exit 1
|
||||
fi
|
||||
# result=$(ps | grep entware.sh | grep -v grep | wc -l)
|
||||
# if [ "$result" != '0' ];then
|
||||
# logsh "【$service】" "检测到【Entware】正在运行,现在启用${appname}可能会冲突"
|
||||
# exit 1
|
||||
# fi
|
||||
logsh "【$service】" "正在启动${appname}服务... "
|
||||
# 检查entware
|
||||
result1=$(mbdb show entware)
|
||||
result2=$(ls /opt | grep etc)
|
||||
if [ -z "$result1" ] || [ -z "$result2" ]; then
|
||||
logsh "【$service】" "检测到【Entware】服务未启动或未安装"
|
||||
end
|
||||
else
|
||||
result3=$(echo $PATH | grep opt)
|
||||
[ -z "$result3" ] && export PATH=/opt/bin/:/opt/sbin:$PATH
|
||||
fi
|
||||
|
||||
set_config
|
||||
open_ports
|
||||
write_firewall_start
|
||||
#添加entware识别
|
||||
auto_start_enable
|
||||
|
||||
[ ! -f "/opt/etc/init.d/S80nginx" ] && logsh "【$service】" "未找到启动脚本!" && exit
|
||||
/opt/etc/init.d/S80nginx stop &> /dev/null
|
||||
/opt/etc/init.d/S80nginx start > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
logsh "【$service】" "启动${appname}服务失败!"
|
||||
else
|
||||
logsh "【$service】" "启动${appname}服务完成!"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
stop () {
|
||||
|
||||
logsh "【$service】" "正在停止${appname}服务... "
|
||||
[ "$enable" == '0' ] && destroy
|
||||
close_port
|
||||
remove_firewall_start
|
||||
rm -rf ${mbtmp}/${appname}.conf ${mbroot}/apps/${appname}/config/${appname}.conf
|
||||
umountsh $NGINXCONF
|
||||
|
||||
}
|
||||
|
||||
destroy() {
|
||||
#清除entware识别
|
||||
auto_start_disable
|
||||
}
|
||||
|
||||
end() {
|
||||
|
||||
/opt/etc/init.d/S80nginx stop > /dev/null
|
||||
stop && exit 1
|
||||
|
||||
}
|
||||
|
||||
status() {
|
||||
|
||||
result=$(pssh | grep nginx | grep -v sysa | grep -v grep | wc -l)
|
||||
if [ "$result" != '0' ] && [ -f "${mbroot}/apps/${appname}/config/${appname}.conf" ]; then
|
||||
status="运行中|1"
|
||||
else
|
||||
status="未运行|0"
|
||||
fi
|
||||
mbdb set $appname.main.status="$status"
|
||||
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start) start ;;
|
||||
stop) stop ;;
|
||||
restart) stop; start ;;
|
||||
reload) close_port && open_ports ;;
|
||||
status) status ;;
|
||||
esac
|
||||
BIN
apps/jetbrains/bin/jetbrains_darwin_x86_64
Normal file
BIN
apps/jetbrains/bin/jetbrains_darwin_x86_64
Normal file
Binary file not shown.
BIN
apps/jetbrains/bin/jetbrains_linux_arm
Normal file
BIN
apps/jetbrains/bin/jetbrains_linux_arm
Normal file
Binary file not shown.
BIN
apps/jetbrains/bin/jetbrains_linux_mips
Normal file
BIN
apps/jetbrains/bin/jetbrains_linux_mips
Normal file
Binary file not shown.
BIN
apps/jetbrains/bin/jetbrains_linux_x86_64
Normal file
BIN
apps/jetbrains/bin/jetbrains_linux_x86_64
Normal file
Binary file not shown.
7
apps/jetbrains/config/jetbrains.uci
Normal file
7
apps/jetbrains/config/jetbrains.uci
Normal file
@@ -0,0 +1,7 @@
|
||||
service="JetBrains"
|
||||
appname="jetbrains"
|
||||
needver="0.0.1"
|
||||
supports="linux_arm,linux_mips,linux_x86_64,darwin_x86_64"
|
||||
appinfo="快速搭建JetBrains激活服务器"
|
||||
newinfo=""
|
||||
version="0.0.2"
|
||||
18
apps/jetbrains/config/mixbox.conf
Normal file
18
apps/jetbrains/config/mixbox.conf
Normal file
@@ -0,0 +1,18 @@
|
||||
#------------------【Jetbrains】--------------------
|
||||
jetbrains() {
|
||||
|
||||
eval `mbdb export jetbrains`
|
||||
source /etc/mixbox/bin/base
|
||||
echo "********* $service ***********"
|
||||
echo "[${appinfo}]"
|
||||
readsh "启动${appname}服务[1/0] " "enable" "1"
|
||||
if [ "$enable" == '1' ]; then
|
||||
readsh "请输入${appname}端口号" "port" "1001"
|
||||
readsh "请输入${appname}外网访问配置[1/0]" "openport" "1"
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh restart
|
||||
else
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
|
||||
fi
|
||||
|
||||
}
|
||||
#------------------【JetBrains】--------------------
|
||||
1
apps/jetbrains/config/version.txt
Normal file
1
apps/jetbrains/config/version.txt
Normal file
@@ -0,0 +1 @@
|
||||
1.0.3
|
||||
57
apps/jetbrains/scripts/jetbrains.sh
Normal file
57
apps/jetbrains/scripts/jetbrains.sh
Normal file
@@ -0,0 +1,57 @@
|
||||
#!/bin/sh
|
||||
source /etc/mixbox/bin/base
|
||||
eval `mbdb export jetbrains`
|
||||
|
||||
start () {
|
||||
|
||||
result=$(ps | grep ${mbroot}/apps/${appname}/bin/${appname} | grep -v grep | wc -l)
|
||||
if [ "$result" != '0' ];then
|
||||
logsh "【$service】" "${appname}已经在运行!"
|
||||
exit 1
|
||||
fi
|
||||
logsh "【$service】" "正在启动${appname}服务... "
|
||||
|
||||
open_port
|
||||
write_firewall_start
|
||||
daemon ${mbroot}/apps/${appname}/bin/${appname} -p ${port}
|
||||
if [ $? -ne 0 ]; then
|
||||
logsh "【$service】" "启动${appname}服务失败!"
|
||||
else
|
||||
logsh "【$service】" "启动${appname}服务完成!"
|
||||
logsh "【$service】" "激活服务器地址为:[http://$lanip:${port}]"
|
||||
fi
|
||||
|
||||
|
||||
}
|
||||
|
||||
stop () {
|
||||
|
||||
logsh "【$service】" "正在停止${appname}服务... "
|
||||
close_port
|
||||
remove_firewall_start
|
||||
killall -9 ${appname} &> /dev/null
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
status() {
|
||||
|
||||
result=$(pssh | grep ${mbroot}/apps/${appname}/bin/${appname} | grep -v grep | wc -l)
|
||||
if [ "$result" == '0' ]; then
|
||||
status="未运行|0"
|
||||
else
|
||||
status="运行端口号: ${port}|1"
|
||||
fi
|
||||
mbdb set $appname.main.status="$status"
|
||||
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start) start ;;
|
||||
stop) stop ;;
|
||||
restart) stop; start ;;
|
||||
reload) close_port && open_port ;;
|
||||
status) status ;;
|
||||
esac
|
||||
|
||||
BIN
apps/kms/bin/kms_darwin_x86_64
Normal file
BIN
apps/kms/bin/kms_darwin_x86_64
Normal file
Binary file not shown.
BIN
apps/kms/bin/kms_linux_arm
Normal file
BIN
apps/kms/bin/kms_linux_arm
Normal file
Binary file not shown.
BIN
apps/kms/bin/kms_linux_mips
Normal file
BIN
apps/kms/bin/kms_linux_mips
Normal file
Binary file not shown.
BIN
apps/kms/bin/kms_linux_x86_64
Normal file
BIN
apps/kms/bin/kms_linux_x86_64
Normal file
Binary file not shown.
7
apps/kms/config/kms.uci
Normal file
7
apps/kms/config/kms.uci
Normal file
@@ -0,0 +1,7 @@
|
||||
service="Kms"
|
||||
appname="kms"
|
||||
needver="0.0.1"
|
||||
supports="linux_arm,linux_mips,linux_x86_64,darwin_x86_64"
|
||||
appinfo="快速搭建Windows、Office激活服务器"
|
||||
newinfo="Support for Windows 10 1809, Windows Server 2019 and Office 2019 built-in"
|
||||
version="0.0.2"
|
||||
19
apps/kms/config/mixbox.conf
Normal file
19
apps/kms/config/mixbox.conf
Normal file
@@ -0,0 +1,19 @@
|
||||
#------------------【Kms】--------------------
|
||||
kms() {
|
||||
|
||||
eval `mbdb export kms`
|
||||
source /etc/mixbox/bin/base
|
||||
source /etc/mixbox/bin/base
|
||||
echo "********* $service ***********"
|
||||
echo "[${appinfo}]"
|
||||
readsh "启动${appname}服务[1/0] " "enable" "1"
|
||||
|
||||
if [ "$enable" == '1' ]; then
|
||||
readsh "请输入${appname}外网访问配置[1/0]" "openport" "1"
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh restart
|
||||
else
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
|
||||
fi
|
||||
|
||||
}
|
||||
#------------------【Kms】--------------------
|
||||
1
apps/kms/config/version.txt
Normal file
1
apps/kms/config/version.txt
Normal file
@@ -0,0 +1 @@
|
||||
1.1.5
|
||||
67
apps/kms/scripts/kms.sh
Normal file
67
apps/kms/scripts/kms.sh
Normal file
@@ -0,0 +1,67 @@
|
||||
#!/bin/sh
|
||||
source /etc/mixbox/bin/base
|
||||
eval `mbdb export kms`
|
||||
|
||||
port=1688
|
||||
|
||||
|
||||
set_config() {
|
||||
|
||||
echo -e "srv-host=_vlmcs._tcp,XiaoQiang,1688,0,100\ndomain=lan" > /tmp/etc/dnsmasq.d/kms.conf
|
||||
/etc/init.d/dnsmasq reload
|
||||
|
||||
}
|
||||
|
||||
start () {
|
||||
|
||||
result=$(ps | grep ${mbroot}/apps/${appname}/bin/${appname} | grep -v grep | wc -l)
|
||||
if [ "$result" != '0' ];then
|
||||
logsh "【$service】" "${appname}已经在运行!"
|
||||
exit 1
|
||||
fi
|
||||
logsh "【$service】" "正在启动${appname}服务... "
|
||||
|
||||
set_config
|
||||
|
||||
open_port
|
||||
write_firewall_start
|
||||
daemon ${mbroot}/apps/${appname}/bin/${appname} -l ${mbroot}/var/log/${appname}.log
|
||||
if [ $? -ne 0 ]; then
|
||||
logsh "【$service】" "启动${appname}服务失败!"
|
||||
else
|
||||
logsh "【$service】" "启动${appname}服务完成!"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
stop () {
|
||||
|
||||
logsh "【$service】" "正在停止${appname}服务... "
|
||||
close_port
|
||||
remove_firewall_start
|
||||
killall -9 ${appname} &> /dev/null
|
||||
rm -rf /tmp/etc/dnsmasq.d/kms.conf
|
||||
|
||||
}
|
||||
|
||||
|
||||
status() {
|
||||
|
||||
result=$(pssh | grep ${mbroot}/apps/${appname}/bin/${appname} | grep -v grep | wc -l)
|
||||
if [ "$result" == '0' ]; then
|
||||
status="未运行|0"
|
||||
else
|
||||
status="运行端口号: ${port}|1"
|
||||
fi
|
||||
mbdb set $appname.main.status="$status"
|
||||
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start) start ;;
|
||||
stop) stop ;;
|
||||
restart) stop; start ;;
|
||||
reload) close_port && open_port ;;
|
||||
status) status ;;
|
||||
esac
|
||||
|
||||
8
apps/kodexplorer/config/kodexplorer.uci
Normal file
8
apps/kodexplorer/config/kodexplorer.uci
Normal file
@@ -0,0 +1,8 @@
|
||||
service="KodExplorer"
|
||||
appname="kodexplorer"
|
||||
needver="0.0.1"
|
||||
supports="linux_arm,linux_mips,linux_x86_64"
|
||||
appinfo="可道云,在线文档管理器,需要entware环境"
|
||||
newinfo="修复unzip命令缺失"
|
||||
version="0.0.3"
|
||||
version="0.0.4"
|
||||
26
apps/kodexplorer/config/mixbox.conf
Normal file
26
apps/kodexplorer/config/mixbox.conf
Normal file
@@ -0,0 +1,26 @@
|
||||
#------------------【KodExplorer】--------------------
|
||||
kodexplorer() {
|
||||
|
||||
eval `mbdb export kodexplorer`
|
||||
source /etc/mixbox/bin/base
|
||||
echo "********* $service ***********"
|
||||
echo "[${appinfo}]"
|
||||
echo "[如需使用ONMP请停止本插件]"
|
||||
[ -z "$(mbdb show entware)" ] && echo "请先安装Entware插件!" && return
|
||||
readsh "启动${appname}服务[1/0] " "enable" "1"
|
||||
if [ "$enable" == '1' ]; then
|
||||
read -p "修改${appname}端口号(`mbdb get ${appname}.main.port || echo 81`)?[1/0] " res
|
||||
if [ "$res" == '1' ]; then
|
||||
read -p "请输入${appname}端口号(默认81):" res
|
||||
[ ! -z $res ] && mbdb set $appname.main.port="$res" || mbdb set $appname.main.port=81
|
||||
fi
|
||||
readsh "请输入${appname}管理目录" "path" "$mbdisk"
|
||||
readsh "请输入${appname}外网访问配置[1/0]" "openport" "1"
|
||||
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh restart
|
||||
else
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
|
||||
fi
|
||||
|
||||
}
|
||||
#------------------【KodExplorer】--------------------
|
||||
1
apps/kodexplorer/config/version.txt
Normal file
1
apps/kodexplorer/config/version.txt
Normal file
@@ -0,0 +1 @@
|
||||
1.4.1
|
||||
229
apps/kodexplorer/scripts/kodexplorer.sh
Normal file
229
apps/kodexplorer/scripts/kodexplorer.sh
Normal file
@@ -0,0 +1,229 @@
|
||||
#!/bin/sh
|
||||
source /etc/mixbox/bin/base
|
||||
eval `mbdb export kodexplorer`
|
||||
source /etc/mixbox/apps/entware/scripts/functions.sh
|
||||
|
||||
# port=81
|
||||
PHPBIN=/opt/bin/spawn-fcgi
|
||||
NGINXBIN=/opt/sbin/nginx
|
||||
NGINXCONF=/opt/etc/nginx/nginx.conf
|
||||
PHPCONF=/opt/etc/php.ini
|
||||
WWW=/opt/share/nginx/html/kodexplorer
|
||||
CONF="/opt/etc/nginx/vhost/kodexplorer.conf"
|
||||
path=$(mbdb get ${appname}.main.path)
|
||||
port=$(mbdb get ${appname}.main.port) || port=81
|
||||
lanip=$(uci get network.lan.ipaddr)
|
||||
opkg_list="php7-cgi php7-mod-curl php7-mod-gd php7-mod-iconv php7-mod-json php7-mod-mbstring php7-mod-opcache php7-mod-session php7-mod-zip nginx spawn-fcgi zoneinfo-core zoneinfo-asia libxml2 unzip"
|
||||
|
||||
|
||||
config_php() {
|
||||
logsh "【$service】" "修改php配置信息..."
|
||||
result=$(/opt/bin/opkg list-installed | grep -c "^php7-cgi")
|
||||
[ "$result" == '0' ] && logsh "【$service】" "php未安装!" && end
|
||||
cp $PHPCONF ${mbtmp}/php.ini
|
||||
sed -i "/doc_root/d" ${mbtmp}/php.ini
|
||||
sed -i "s#.*open_basedir.*#open_basedir = \"$WWW\"#" ${mbtmp}/php.ini
|
||||
sed -i 's/memory_limit = 8M/memory_limit = 20M/' ${mbtmp}/php.ini
|
||||
sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 2000M/' ${mbtmp}/php.ini
|
||||
umountsh $PHPCONF
|
||||
mount --bind ${mbtmp}/php.ini $PHPCONF
|
||||
# echo "<?php phpinfo(); ?>" > $WWW/info.php
|
||||
# rm -rf $WWW/index.html
|
||||
}
|
||||
|
||||
config_nginx() {
|
||||
logsh "【$service】" "生成nginx配置信息..."
|
||||
#修改nginx配置文件
|
||||
[ ! -x "$NGINXBIN" ] && logsh "【$service】" "nginx未安装!" && end
|
||||
cat > ${mbtmp}/nginx.conf <<-\EOF
|
||||
user root;
|
||||
pid /opt/var/run/nginx.pid;
|
||||
worker_processes auto;
|
||||
worker_rlimit_nofile 65535;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
|
||||
include mime.types;
|
||||
sendfile on;
|
||||
default_type application/octet-stream;
|
||||
keepalive_timeout 65;
|
||||
client_max_body_size 4G;
|
||||
include /opt/etc/nginx/vhost/*.conf;
|
||||
|
||||
}
|
||||
EOF
|
||||
umountsh $NGINXCONF
|
||||
mount --bind ${mbtmp}/nginx.conf $NGINXCONF
|
||||
|
||||
#生成配置文件
|
||||
[ ! -d "/opt/etc/nginx/vhost" ] && mkdir -p /opt/etc/nginx/vhost
|
||||
cat > ${mbtmp}/${appname}.conf <<-\EOF
|
||||
server {
|
||||
listen 81;
|
||||
server_name kodexplorer;
|
||||
|
||||
location / {
|
||||
root /opt/share/nginx/html/kodexplorer;
|
||||
index index.php index.html index.htm;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root html;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
root /opt/share/nginx/html/kodexplorer;
|
||||
fastcgi_pass 127.0.0.1:9009;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
sed -i "s/81/${port}/" ${mbtmp}/${appname}.conf
|
||||
rm -rf /opt/etc/nginx/vhost/${appname}.conf
|
||||
ln -s ${mbtmp}/${appname}.conf /opt/etc/nginx/vhost/${appname}.conf
|
||||
}
|
||||
|
||||
detect_webfiles() {
|
||||
if [ ! -d $WWW/app/kod/ ]; then
|
||||
logsh "【$service】" "未检测到${appname}文件,正在下载"
|
||||
[ ! -d $WWW ] && mkdir $WWW
|
||||
wgetsh $WWW/kodexplorer.zip $mburl/appsbin/kodexplorer.zip
|
||||
[ $? -ne 0 ] && logsh "【$service】" "${appname}文件下载失败" && stop
|
||||
unzip $WWW/kodexplorer.zip -d $WWW
|
||||
rm -rf $WWW/kodexplorer.zip
|
||||
fi
|
||||
}
|
||||
|
||||
detect_opkg() {
|
||||
for i in $opkg_list
|
||||
do
|
||||
result=$(/opt/bin/opkg list-installed | grep -c "^$i")
|
||||
[ "$result" == '0' ] && /opt/bin/opkg install $i
|
||||
done
|
||||
}
|
||||
|
||||
mount_admin_root() {
|
||||
if [ -n "$path" ]; then
|
||||
logsh "【$service】" "挂载${appname}管理目录"
|
||||
if [ -d $WWW/data/User/admin/home ]; then
|
||||
[ ! -d "$path" ] && mkdir -p $path
|
||||
umountsh $WWW/data/User/admin/home
|
||||
mount --bind "$path" $WWW/data/User/admin/home
|
||||
else
|
||||
logsh "【$service】" "检测到${appname}服务未配置,无法挂载管理目录"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
start () {
|
||||
|
||||
result=$(ps | grep -E 'nginx|php-cgi' | grep -v sysa | grep -v grep | wc -l)
|
||||
if [ "$result" != '0' -a -f /opt/etc/nginx/vhost/${appname}.conf ];then
|
||||
logsh "【$service】" "${appname}已经在运行!"
|
||||
exit 1
|
||||
fi
|
||||
# result=$(ps | grep entware.sh | grep -v grep | wc -l)
|
||||
# if [ "$result" != '0' ];then
|
||||
# logsh "【$service】" "检测到【Entware】正在运行,现在启用${appname}可能会冲突"
|
||||
# exit 1
|
||||
# fi
|
||||
logsh "【$service】" "正在启动${appname}服务... "
|
||||
#检查entware状态
|
||||
result1=$(mbdb show entware)
|
||||
result2=$(ls /opt | grep etc)
|
||||
if [ -z "$result1" ] || [ -z "$result2" ]; then
|
||||
logsh "【$service】" "检测到【Entware】服务未启动或未安装"
|
||||
end
|
||||
else
|
||||
result3=$(echo $PATH | grep opt)
|
||||
[ -z "$result3" ] && export PATH=/opt/bin/:/opt/sbin:$PATH
|
||||
fi
|
||||
|
||||
detect_opkg
|
||||
|
||||
config_nginx
|
||||
|
||||
config_php
|
||||
|
||||
detect_webfiles
|
||||
|
||||
mount_admin_root
|
||||
|
||||
#添加entware识别
|
||||
auto_start_enable
|
||||
|
||||
open_port
|
||||
write_firewall_start
|
||||
/opt/etc/init.d/S80nginx stop &> /dev/null
|
||||
|
||||
/opt/etc/init.d/S80nginx start > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
logsh "【$service】" "启动nginx服务失败!"
|
||||
fi
|
||||
daemon $PHPBIN -a 127.0.0.1 -p 9009 -C 2 -f /opt/bin/php-cgi > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
logsh "【$service】" "启动php服务失败!"
|
||||
fi
|
||||
logsh "【$service】" "${appname}服务启动完成"
|
||||
logsh "【$service】" "请在浏览器中访问[http://$lanip:${port}]配置"
|
||||
|
||||
}
|
||||
|
||||
stop () {
|
||||
|
||||
logsh "【$service】" "正在停止${appname}服务... "
|
||||
[ "$enable" == '0' ] && destroy
|
||||
result=$(mbdb get mixbox.httpfile.enable)
|
||||
killall php-cgi &> /dev/null
|
||||
# kill -9 $(ps | grep 'nginx' | grep -v sysa | grep -v grep | awk '{print$1}') > /dev/null 2>&1
|
||||
close_port
|
||||
remove_firewall_start
|
||||
#清除关于entware配置
|
||||
logsh "【$service】" "关闭或卸载不会删除opkg的软件包和${appname}的web文件!"
|
||||
umountsh $PHPCONF && rm -rf ${mbtmp}/php.ini
|
||||
umountsh $NGINXCONF && rm -rf ${mbtmp}/nginx.conf
|
||||
rm -rf ${mbtmp}/${appname}.conf /opt/etc/nginx/vhost/${appname}.conf
|
||||
umountsh $WWW/data/User/admin/home
|
||||
|
||||
}
|
||||
|
||||
end() {
|
||||
|
||||
/opt/etc/init.d/S80nginx stop > /dev/null
|
||||
stop && exit 1
|
||||
|
||||
}
|
||||
|
||||
destroy() {
|
||||
#清除entware识别
|
||||
auto_start_disable
|
||||
}
|
||||
|
||||
|
||||
status() {
|
||||
|
||||
result=$(pssh | grep -E 'nginx|php-cgi' | grep -v sysa | grep -v grep | wc -l)
|
||||
if [ "$result" -ge '5' ] && [ -f "/opt/etc/nginx/vhost/${appname}.conf" ]; then
|
||||
status="运行端口号: ${port}, 管理目录: $path|1"
|
||||
else
|
||||
status="未运行|0"
|
||||
fi
|
||||
mbdb set $appname.main.status="$status"
|
||||
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start) start ;;
|
||||
stop) stop ;;
|
||||
restart) stop; start ;;
|
||||
reload) close_port && open_port ;;
|
||||
status) status ;;
|
||||
esac
|
||||
|
||||
1631
apps/koolproxy/bin/data/dnsmasq.adblock
Normal file
1631
apps/koolproxy/bin/data/dnsmasq.adblock
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user