🌻👗 Updated with Glitch
parent
0d2f38af37
commit
011a02a41a
|
@ -1,4 +0,0 @@
|
|||
<?php $configs = '
|
||||
{
|
||||
}
|
||||
';
|
|
@ -0,0 +1,19 @@
|
|||
{"name":"Gemshin32x.ico","date":"2021-09-10T10:04:04.786Z","url":"https://cdn.glitch.com/56780e99-9afe-4d79-9ff3-93d5eed7f45c%2FGemshin32x.ico","type":"image/x-icon","size":2238,"imageWidth":32,"imageHeight":64,"thumbnail":"https://cdn.glitch.com/56780e99-9afe-4d79-9ff3-93d5eed7f45c%2FGemshin32x.ico","thumbnailWidth":32,"thumbnailHeight":64,"uuid":"fRzDhp94hES3VGD4"}
|
||||
{"name":"favicon.ico","date":"2021-09-10T10:05:16.106Z","url":"https://cdn.glitch.com/56780e99-9afe-4d79-9ff3-93d5eed7f45c%2Ffavicon.ico","type":"image/x-icon","size":2238,"imageWidth":32,"imageHeight":64,"thumbnail":"https://cdn.glitch.com/56780e99-9afe-4d79-9ff3-93d5eed7f45c%2Ffavicon.ico","thumbnailWidth":32,"thumbnailHeight":64,"uuid":"AeiSowroVduBYoev"}
|
||||
{"name":"favicon.ic","date":"2021-09-10T10:07:01.165Z","url":"https://cdn.glitch.com/56780e99-9afe-4d79-9ff3-93d5eed7f45c%2Ffavicon.ic","type":"","size":2238,"thumbnail":"https://cdn.glitch.com/56780e99-9afe-4d79-9ff3-93d5eed7f45c%2Fthumbnails%2Ffavicon.ic","thumbnailWidth":210,"thumbnailHeight":210,"uuid":"2f6d8stm44ljLxmu"}
|
||||
{"uuid":"2f6d8stm44ljLxmu","deleted":true}
|
||||
{"uuid":"fRzDhp94hES3VGD4","deleted":true}
|
||||
{"uuid":"AeiSowroVduBYoev","deleted":true}
|
||||
{"name":"favicon.ic","date":"2021-09-10T10:07:24.661Z","url":"https://cdn.glitch.com/56780e99-9afe-4d79-9ff3-93d5eed7f45c%2Ffavicon.ic","type":"","size":2238,"thumbnail":"https://cdn.glitch.com/56780e99-9afe-4d79-9ff3-93d5eed7f45c%2Fthumbnails%2Ffavicon.ic","thumbnailWidth":210,"thumbnailHeight":210,"uuid":"1wKtA5ek8KRDHeCm"}
|
||||
{"uuid":"1wKtA5ek8KRDHeCm","deleted":true}
|
||||
{"name":"favicon.ic","date":"2021-09-10T10:07:50.198Z","url":"https://cdn.glitch.com/56780e99-9afe-4d79-9ff3-93d5eed7f45c%2Ffavicon.ic","type":"","size":2238,"thumbnail":"https://cdn.glitch.com/56780e99-9afe-4d79-9ff3-93d5eed7f45c%2Fthumbnails%2Ffavicon.ic","thumbnailWidth":210,"thumbnailHeight":210,"uuid":"KkqYCrT5h2qV6R4u"}
|
||||
{"uuid":"KkqYCrT5h2qV6R4u","deleted":true}
|
||||
{"name":"favicon.ico","date":"2021-09-10T10:08:50.241Z","url":"https://cdn.glitch.com/56780e99-9afe-4d79-9ff3-93d5eed7f45c%2Ffavicon.ico","type":"image/x-icon","size":2238,"imageWidth":32,"imageHeight":64,"thumbnail":"https://cdn.glitch.com/56780e99-9afe-4d79-9ff3-93d5eed7f45c%2Ffavicon.ico","thumbnailWidth":32,"thumbnailHeight":64,"uuid":"Tbxpmpsd7iogHrA8"}
|
||||
{"uuid":"Tbxpmpsd7iogHrA8","deleted":true}
|
||||
{"name":"favicon.ico","date":"2021-09-10T10:09:25.141Z","url":"https://cdn.glitch.com/56780e99-9afe-4d79-9ff3-93d5eed7f45c%2Ffavicon.ico","type":"image/x-icon","size":2238,"imageWidth":32,"imageHeight":64,"thumbnail":"https://cdn.glitch.com/56780e99-9afe-4d79-9ff3-93d5eed7f45c%2Ffavicon.ico","thumbnailWidth":32,"thumbnailHeight":64,"uuid":"pfqKpyi43K8B7f07"}
|
||||
{"name":"favicon.php","date":"2021-09-10T10:10:12.455Z","url":"https://cdn.glitch.com/56780e99-9afe-4d79-9ff3-93d5eed7f45c%2Ffavicon.php","type":"","size":2238,"thumbnail":"https://cdn.glitch.com/56780e99-9afe-4d79-9ff3-93d5eed7f45c%2Fthumbnails%2Ffavicon.php","thumbnailWidth":210,"thumbnailHeight":210,"uuid":"2jJTl6baTINMDRkK"}
|
||||
{"uuid":"2jJTl6baTINMDRkK","deleted":true}
|
||||
{"uuid":"pfqKpyi43K8B7f07","deleted":true}
|
||||
{"name":"favicon.ico","date":"2021-09-10T11:56:17.862Z","url":"https://cdn.glitch.com/56780e99-9afe-4d79-9ff3-93d5eed7f45c%2Ffavicon.ico","type":"image/x-icon","size":2238,"imageWidth":32,"imageHeight":64,"thumbnail":"https://cdn.glitch.com/56780e99-9afe-4d79-9ff3-93d5eed7f45c%2Ffavicon.ico","thumbnailWidth":32,"thumbnailHeight":64,"uuid":"byl6zxO9h4QOFt0N"}
|
||||
{"uuid":"byl6zxO9h4QOFt0N","deleted":true}
|
||||
{"name":"favicon.ico","date":"2021-10-29T14:15:08.384Z","url":"https://cdn.glitch.me/56780e99-9afe-4d79-9ff3-93d5eed7f45c%2Ffavicon.ico","type":"image/x-icon","size":4286,"imageWidth":32,"imageHeight":32,"thumbnail":"https://cdn.glitch.me/56780e99-9afe-4d79-9ff3-93d5eed7f45c%2Ffavicon.ico","thumbnailWidth":32,"thumbnailHeight":32,"uuid":"kYbWeyFwMyK10fT0"}
|
|
@ -1,113 +0,0 @@
|
|||
|
||||
// Hosts Array
|
||||
// 服务器数组
|
||||
const H = [
|
||||
'https://herooneindex.herokuapp.com/',
|
||||
'https://onemanager.glitch.me/',
|
||||
'https://onemanager-php.vercel.app/'
|
||||
]
|
||||
|
||||
// View Type
|
||||
// 1 , only first host,
|
||||
// 只第一条Host记录有用
|
||||
// 2 , view top 2 host as odd/even days,
|
||||
// 只有前两条记录有效,分别单双日运行
|
||||
// 3 , view random host
|
||||
// 所有记录随机访问
|
||||
const T = 1
|
||||
|
||||
// CF proxy all, true/false
|
||||
// 一切给CF代理,true或false
|
||||
const CFproxy = true
|
||||
|
||||
// Used in cloudflare workers
|
||||
// // // // // //
|
||||
|
||||
addEventListener('fetch', event => {
|
||||
let url=new URL(event.request.url);
|
||||
if (url.protocol == 'http:') {
|
||||
// force HTTPS
|
||||
url.protocol = 'https:'
|
||||
event.respondWith( Response.redirect(url.href) )
|
||||
} else {
|
||||
let host = null;
|
||||
if (T===1) {
|
||||
host = H[0];
|
||||
}
|
||||
if (T===2) {
|
||||
host = H[new Date().getDate()%2];
|
||||
}
|
||||
if (T===3) {
|
||||
let n = H.length;
|
||||
host = H[Math.round(Math.random()*n*10)%n];
|
||||
}
|
||||
//console.log(host)
|
||||
if (host.substr(0, 7)!='http://'&&host.substr(0, 8)!='https://') host = 'http://' + host;
|
||||
|
||||
let response = fetchAndApply(host, event.request);
|
||||
|
||||
event.respondWith( response );
|
||||
}
|
||||
})
|
||||
|
||||
async function fetchAndApply(host, request) {
|
||||
let f_url = new URL(request.url);
|
||||
let a_url = new URL(host);
|
||||
let replace_path = a_url.pathname;
|
||||
if (replace_path.substr(replace_path.length-1)!='/') replace_path += '/';
|
||||
let replaced_path = '/';
|
||||
let query = f_url.search;
|
||||
let path = f_url.pathname;
|
||||
if (host.substr(host.length-1)=='/') path = path.substr(1);
|
||||
f_url.href = host + path + query;
|
||||
|
||||
let response = null;
|
||||
if (!CFproxy) {
|
||||
response = await fetch(f_url, request);
|
||||
} else {
|
||||
let method = request.method;
|
||||
let body = request.body;
|
||||
let request_headers = request.headers;
|
||||
let new_request_headers = new Headers(request_headers);
|
||||
new_request_headers.set('Host', f_url.host);
|
||||
new_request_headers.set('Referer', request.url);
|
||||
response = await fetch(f_url.href, {
|
||||
/*cf: {
|
||||
cacheEverything: true,
|
||||
cacheTtl: 1000,
|
||||
mirage: true,
|
||||
polish: "on",
|
||||
minify: {
|
||||
javascript: true,
|
||||
css: true,
|
||||
html: true,
|
||||
}
|
||||
},*/
|
||||
method: method,
|
||||
body: body,
|
||||
headers: new_request_headers
|
||||
});
|
||||
}
|
||||
|
||||
let out_headers = new Headers(response.headers);
|
||||
if (out_headers.get('Content-Disposition')=='attachment') out_headers.delete('Content-Disposition');
|
||||
let out_body = null;
|
||||
let contentType = out_headers.get('Content-Type');
|
||||
if (contentType.includes("application/text")) {
|
||||
out_body = await response.text();
|
||||
while (replace_path!='/'&&out_body.includes(replace_path)) out_body = out_body.replace(replace_path, replaced_path);
|
||||
} else if (contentType.includes("text/html")) {
|
||||
//f_url.href +
|
||||
out_body = await response.text();
|
||||
while (replace_path!='/'&&out_body.includes(replace_path)) out_body = out_body.replace(replace_path, replaced_path);
|
||||
} else {
|
||||
out_body = await response.body;
|
||||
}
|
||||
|
||||
let out_response = new Response(out_body, {
|
||||
status: response.status,
|
||||
headers: out_headers
|
||||
})
|
||||
|
||||
return out_response;
|
||||
}
|
|
@ -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.
|
||||
|
||||
download page of MCGenshin
|
||||
Copyright (C) 2021 null
|
||||
|
||||
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:
|
||||
|
||||
mcgenshindl Copyright (C) 2021 null
|
||||
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>.
|
266
common.php
266
common.php
|
@ -174,23 +174,19 @@ function main($path)
|
|||
$adminloginpage = getConfig('adminloginpage');
|
||||
}
|
||||
if (isset($_GET[$adminloginpage])) {
|
||||
/*if (isset($_GET['preview'])) {
|
||||
if (isset($_GET['preview'])) {
|
||||
$url = $_SERVER['PHP_SELF'] . '?preview';
|
||||
} else {
|
||||
$url = path_format($_SERVER['PHP_SELF'] . '/');
|
||||
}*/
|
||||
}
|
||||
if (isset($_POST['password1'])) {
|
||||
$compareresult = compareadminsha1($_POST['password1'], $_POST['timestamp'], getConfig('admin'));
|
||||
if ($compareresult=='') {
|
||||
$timestamp = time()+7*24*60*60;
|
||||
$randnum = rand(10, 99999);
|
||||
$admincookie = adminpass2cookie('admin', getConfig('admin'), $timestamp, $randnum);
|
||||
$adminlocalstorage = adminpass2storage('admin', getConfig('admin'), $timestamp, $randnum);
|
||||
return adminform('admin', $admincookie, $adminlocalstorage);
|
||||
return adminform('admin', adminpass2cookie('admin', getConfig('admin')), $url);
|
||||
} else return adminform($compareresult);
|
||||
} else return adminform();
|
||||
}
|
||||
if ( isset($_COOKIE['admin'])&&compareadminmd5('admin', getConfig('admin'), $_COOKIE['admin']) ) {
|
||||
if ( isset($_COOKIE['admin'])&&compareadminmd5($_COOKIE['admin'], 'admin', getConfig('admin')) ) {
|
||||
$_SERVER['admin']=1;
|
||||
$_SERVER['needUpdate'] = needUpdate();
|
||||
} else {
|
||||
|
@ -262,17 +258,13 @@ function main($path)
|
|||
|
||||
// Add disk
|
||||
if (isset($_GET['AddDisk'])) {
|
||||
if ($_GET['AddDisk']===true) {
|
||||
$tmp = path_format($_SERVER['base_path'] . '/' . $path);
|
||||
return output('Please visit <a href="' . $tmp . '">' . $tmp . '</a>.', 301, [ 'Location' => $tmp ]);
|
||||
}
|
||||
if ($_SERVER['admin']) {
|
||||
if (!class_exists($_GET['AddDisk'])) require 'disk' . $slash . $_GET['AddDisk'] . '.php';
|
||||
$drive = new $_GET['AddDisk']($_GET['disktag']);
|
||||
return $drive->AddDisk();
|
||||
} else {
|
||||
$url = $_SERVER['PHP_SELF'];
|
||||
/*if ($_GET) {
|
||||
if ($_GET) {
|
||||
$tmp = null;
|
||||
$tmp = '';
|
||||
foreach ($_GET as $k => $v) {
|
||||
|
@ -283,8 +275,7 @@ function main($path)
|
|||
}
|
||||
$tmp = substr($tmp, 1);
|
||||
if ($tmp!='') $url .= '?' . $tmp;
|
||||
}*/
|
||||
// not need GET adddisk, remove it
|
||||
}
|
||||
return output('<script>alert(\''.getconstStr('SetSecretsFirst').'\');</script>', 302, [ 'Location' => $url ]);
|
||||
}
|
||||
}
|
||||
|
@ -377,16 +368,8 @@ function main($path)
|
|||
return output(json_encode($files), 200, ['Content-Type' => 'application/json']);
|
||||
}
|
||||
// random file
|
||||
if (isset($_GET['random']))
|
||||
if ($_GET['random']!==true) {
|
||||
if (isset($_GET['random'])&&$_GET['random']!=='') {
|
||||
if ($_SERVER['ishidden']<4) {
|
||||
if (!isset($files['list'])) {
|
||||
$distfolder = splitlast($path, '/');
|
||||
if ($distfolder[1]=='') $tmpfolder = splitlast($distfolder[0], '/')[1];
|
||||
else $tmpfolder = $distfolder[1];
|
||||
if ($tmpfolder=='') $tmpfolder = '/';
|
||||
return output('No files in folder " ' . htmlspecialchars($tmpfolder) . ' ".', 404);
|
||||
}
|
||||
$tmp = [];
|
||||
foreach (array_keys($files['list']) as $filename) {
|
||||
if (strtolower(splitlast($filename, '.')[1])==strtolower($_GET['random'])) $tmp[$filename] = $files['list'][$filename]['url'];
|
||||
|
@ -402,17 +385,15 @@ function main($path)
|
|||
$url = proxy_replace_domain($url, $domainforproxy, $header);
|
||||
}
|
||||
return output('', 302, $header);
|
||||
} else return output('No "' . htmlspecialchars($_GET['random']) . '" files', 404);
|
||||
} else return output('No ' . $_GET['random'] . 'file', 404);
|
||||
} else return output('Hidden', 401);
|
||||
} else return output('must provide a suffix, like "?random=gif".', 401);
|
||||
|
||||
}
|
||||
// is file && not preview mode, download file
|
||||
if ($files['type']=='file' && !isset($_GET['preview'])) {
|
||||
if ( $_SERVER['ishidden']<4 || (!!getConfig('downloadencrypt', $_SERVER['disktag'])&&$files['name']!=getConfig('passfile')) ) {
|
||||
$url = $files['url'];
|
||||
if ( strtolower(splitlast($files['name'], '.')[1])=='html' ) return output($files['content']['body'], $files['content']['stat']);
|
||||
else {
|
||||
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && strtotime($files['time'])==strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE'])) return output('', 304);
|
||||
$fileConduitSize = getConfig('fileConduitSize', $_SERVER['disktag']);
|
||||
$fileConduitCacheTime = getConfig('fileConduitCacheTime', $_SERVER['disktag']);
|
||||
if (!!$fileConduitSize || !!$fileConduitCacheTime) {
|
||||
|
@ -420,27 +401,10 @@ function main($path)
|
|||
else $fileConduitSize = 1024*1024;
|
||||
if ($fileConduitCacheTime>1) $fileConduitCacheTime *= 3600;
|
||||
else $fileConduitCacheTime = 3600;
|
||||
/*if ($_SERVER['HTTP_RANGE']!='') {
|
||||
$header['Range'] = $_SERVER['HTTP_RANGE'];
|
||||
$response = curl('GET', $files['url'], '', $header, 1);
|
||||
//return output($header['Range'] . json_encode($response['returnhead']));
|
||||
return output(
|
||||
$response['body'],
|
||||
$response['stat'],
|
||||
//$response['returnhead'],
|
||||
['Content-Type' => $files['mime'], 'Cache-Control' => 'max-age=' . $fileConduitCacheTime],
|
||||
false
|
||||
);
|
||||
}*/
|
||||
if ($files['size']<$fileConduitSize) return output(
|
||||
base64_encode(file_get_contents($files['url'])),
|
||||
200,
|
||||
[
|
||||
'Content-Type' => $files['mime'],
|
||||
'Cache-Control' => 'max-age=' . $fileConduitCacheTime,
|
||||
//'Cache-Control' => 'max-age=0',
|
||||
'Last-Modified' => gmdate('D, d M Y H:i:s T', strtotime($files['time']))
|
||||
],
|
||||
['Content-Type' => $files['mime'], 'Cache-Control' => 'max-age=' . $fileConduitCacheTime],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
@ -518,31 +482,20 @@ function isreferhost() {
|
|||
return false;
|
||||
}
|
||||
|
||||
function adminpass2cookie($name, $pass, $timestamp)
|
||||
function adminpass2cookie($name, $pass)
|
||||
{
|
||||
$timestamp = time()+7*24*60*60;
|
||||
return md5($name . ':' . md5($pass) . '@' . $timestamp) . "(" . $timestamp . ")";
|
||||
}
|
||||
function adminpass2storage($name, $pass, $timestamp, $rand) {
|
||||
return md5($timestamp . '/' . $pass . '^' . $name . '*' . $rand) . "(" . $rand . ")";
|
||||
}
|
||||
function compareadminmd5($name, $pass, $cookie, $storage = 'default')
|
||||
function compareadminmd5($admincookie, $name, $pass)
|
||||
{
|
||||
$c = splitfirst($cookie, '(');
|
||||
$c = splitfirst($admincookie, '(');
|
||||
$c_md5 = $c[0];
|
||||
$c_time = substr($c[1], 0, -1);
|
||||
if (!is_numeric($c_time)) return false;
|
||||
if (time() > $c_time) return false;
|
||||
if ($storage == 'default') {
|
||||
if (md5($name . ':' . md5($pass) . '@' . $c_time) == $c_md5) return true;
|
||||
else return false;
|
||||
} else {
|
||||
$s = splitfirst($storage, '(');
|
||||
$s_md5 = $s[0];
|
||||
$s_rand = substr($s[1], 0, -1);
|
||||
if (md5($c_time . '/' . $pass . '^' . $name . '*' . $s_rand) == $s_md5) return true;
|
||||
else return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function compareadminsha1($adminsha1, $timestamp, $pass)
|
||||
|
@ -767,7 +720,6 @@ function curl($method, $url, $data = '', $headers = [], $returnheader = 0, $loca
|
|||
//$response['body'] = curl_exec($ch);
|
||||
if ($returnheader) {
|
||||
list($returnhead, $response['body']) = explode("\r\n\r\n", curl_exec($ch));
|
||||
//echo "HEAD:" . $returnhead;
|
||||
foreach (explode("\r\n", $returnhead) as $head) {
|
||||
$tmp = explode(': ', $head);
|
||||
$heads[$tmp[0]] = $tmp[1];
|
||||
|
@ -826,7 +778,7 @@ function gethiddenpass($path,$passfile)
|
|||
$path1 = path_format($_SERVER['list_path'] . path_format($path));
|
||||
if ($path1!='/'&&substr($path1,-1)=='/') $path1=substr($path1,0,-1);
|
||||
$password=getcache('path_' . $path1 . '/?password', $_SERVER['disktag']);
|
||||
if ($password===false) {
|
||||
if ($password=='') {
|
||||
$ispassfile = get_content(path_format($path . '/' . urlencode($passfile)));
|
||||
//echo $path . '<pre>' . json_encode($ispassfile, JSON_PRETTY_PRINT) . '</pre>';
|
||||
if ($ispassfile['type']=='file') {
|
||||
|
@ -981,11 +933,11 @@ function output($body, $statusCode = 200, $headers = ['Content-Type' => 'text/ht
|
|||
function passhidden($path)
|
||||
{
|
||||
if ($_SERVER['admin']) return 0;
|
||||
//$path = str_replace('+','%2B',$path);
|
||||
//$path = str_replace('&','&', path_format(urldecode($path)));
|
||||
$path = str_replace('+','%2B',$path);
|
||||
$path = str_replace('&','&', path_format(urldecode($path)));
|
||||
if (getConfig('passfile') != '') {
|
||||
//$path = spurlencode($path,'/');
|
||||
//if (substr($path,-1)=='/') $path=substr($path,0,-1);
|
||||
$path = spurlencode($path,'/');
|
||||
if (substr($path,-1)=='/') $path=substr($path,0,-1);
|
||||
$hiddenpass=gethiddenpass($path, getConfig('passfile'));
|
||||
if ($hiddenpass != '') {
|
||||
return comppass($hiddenpass);
|
||||
|
@ -1019,44 +971,29 @@ function time_format($ISO)
|
|||
return date('Y-m-d H:i:s',strtotime($ISO . " UTC"));
|
||||
}
|
||||
|
||||
function adminform($name = '', $pass = '', $storage = '', $path = '')
|
||||
function adminform($name = '', $pass = '', $path = '')
|
||||
{
|
||||
$html = '<html>
|
||||
<head>
|
||||
<title>' . getconstStr('AdminLogin') . '</title>
|
||||
<meta charset=utf-8>
|
||||
<meta name=viewport content="width=device-width,initial-scale=1">
|
||||
</head>';
|
||||
$html = '<html><head><title>' . getconstStr('AdminLogin') . '</title><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"></head>';
|
||||
if ($name=='admin'&&$pass!='') {
|
||||
$html .= '
|
||||
<!--<meta http-equiv="refresh" content="3;URL=' . $path . '">-->
|
||||
<body>
|
||||
' . getconstStr('LoginSuccess') . '
|
||||
<script>
|
||||
localStorage.setItem("admin", "' . $storage . '");
|
||||
var url = location.href;
|
||||
var search = location.search;
|
||||
url = url.substr(0, url.length-search.length);
|
||||
if (search.indexOf("preview")>0) url += "?preview";
|
||||
location = url;
|
||||
</script>
|
||||
</body>
|
||||
</html>';
|
||||
$html .= '<meta http-equiv="refresh" content="3;URL=' . $path . '">
|
||||
<body>' . getconstStr('LoginSuccess') . '</body></html>';
|
||||
$statusCode = 201;
|
||||
date_default_timezone_set('UTC');
|
||||
$_SERVER['Set-Cookie'] = $name . '=' . $pass . '; path=' . $_SERVER['base_path'] . '; expires=' . date(DATE_COOKIE, strtotime('+7day'));
|
||||
$_SERVER['Set-Cookie'] = $name . '=' . $pass . '; path=/; expires=' . date(DATE_COOKIE, strtotime('+7day'));
|
||||
return output($html, $statusCode);
|
||||
}
|
||||
$statusCode = 401;
|
||||
$html .= '
|
||||
<style>body{background-image:linear-gradient(62deg,#E0C3FC 0%,#8EC5FC 100%);background-attachment:fixed;color:#80D0C7}body>div{position:absolute;text-align:center;background-color:rgba(221,221,221,.5);border-radius:20px;width:75vw;max-width:500px;height:350px;margin:auto;top:25%;bottom:50%;left:0;right:0}body>div:hover{box-shadow:3px 3px 6px 3px rgba(217,175,217,.3)}h4{font-size:35px}input{font-size:20px;margin:2%auto;border:#9599E2 2px solid;border-radius:10px;padding:10px;height:50px;text-align:center}input:last-of-type{color:#D9AFD9;height:50px;width:80px;font-weight:800}input:hover:last-of-type{cursor:pointer;color:#ddd;background-color:#8BC6EC}</style>
|
||||
<body>
|
||||
<div>
|
||||
<center><h4>' . getconstStr('InputPassword') . '</h4>
|
||||
' . $name . '
|
||||
<form action="" method="post" onsubmit="return sha1loginpass(this);">
|
||||
<div>
|
||||
<input id="password1" name="password1" type="password"/>
|
||||
</br>
|
||||
<input name="timestamp" type="hidden"/>
|
||||
</br>
|
||||
<input type="submit" value="' . getconstStr('Login') . '">
|
||||
</div>
|
||||
</form>
|
||||
|
@ -1088,23 +1025,12 @@ function adminform($name = '', $pass = '', $storage = '', $path = '')
|
|||
function adminoperate($path)
|
||||
{
|
||||
global $drive;
|
||||
$path1 = path_format($_SERVER['list_path'] . '/' . $path);
|
||||
$path1 = path_format($_SERVER['list_path'] . path_format($path));
|
||||
if (substr($path1, -1)=='/') $path1=substr($path1, 0, -1);
|
||||
$tmpget = $_GET;
|
||||
$tmppost = $_POST;
|
||||
$tmparr['statusCode'] = 0;
|
||||
|
||||
if (isset($tmpget['RefreshCache'])) {
|
||||
//$path1 = path_format($_SERVER['list_path'] . path_format($path));
|
||||
//if ($path1!='/'&&substr($path1, -1)=='/') $path1=substr($path1, 0, -1);
|
||||
savecache('path_' . $path1 . '/?password', '', $_SERVER['disktag'], 1);
|
||||
savecache('customTheme', '', '', 1);
|
||||
return message('<meta http-equiv="refresh" content="2;URL=./">
|
||||
<meta name=viewport content="width=device-width,initial-scale=1">', getconstStr('RefreshCache'), 202);
|
||||
}
|
||||
|
||||
if ( (isset($tmpget['rename_newname'])&&$tmpget['rename_newname']!=$tmpget['rename_oldname'] && $tmpget['rename_newname']!='') || (isset($tmppost['rename_newname'])&&$tmppost['rename_newname']!=$tmppost['rename_oldname'] && $tmppost['rename_newname']!='') ) {
|
||||
if (!compareadminmd5('admin', getConfig('admin'), $_COOKIE['admin'], $_POST['_admin'])) return ['statusCode'=>403];
|
||||
if (isset($tmppost['rename_newname'])) $VAR = 'tmppost';
|
||||
else $VAR = 'tmpget';
|
||||
// rename 重命名
|
||||
|
@ -1114,7 +1040,6 @@ function adminoperate($path)
|
|||
return $drive->Rename($file, ${$VAR}['rename_newname']);
|
||||
}
|
||||
if (isset($tmpget['delete_name']) || isset($tmppost['delete_name'])) {
|
||||
if (!compareadminmd5('admin', getConfig('admin'), $_COOKIE['admin'], $_POST['_admin'])) return ['statusCode'=>403];
|
||||
if (isset($tmppost['delete_name'])) $VAR = 'tmppost';
|
||||
else $VAR = 'tmpget';
|
||||
// delete 删除
|
||||
|
@ -1124,7 +1049,6 @@ function adminoperate($path)
|
|||
return $drive->Delete($file);
|
||||
}
|
||||
if ( (isset($tmpget['operate_action'])&&$tmpget['operate_action']==getconstStr('Encrypt')) || (isset($tmppost['operate_action'])&&$tmppost['operate_action']==getconstStr('Encrypt')) ) {
|
||||
if (!compareadminmd5('admin', getConfig('admin'), $_COOKIE['admin'], $_POST['_admin'])) return ['statusCode'=>403];
|
||||
if (isset($tmppost['operate_action'])) $VAR = 'tmppost';
|
||||
else $VAR = 'tmpget';
|
||||
// encrypt 加密
|
||||
|
@ -1132,11 +1056,10 @@ function adminoperate($path)
|
|||
if (${$VAR}['encrypt_folder']=='/') ${$VAR}['encrypt_folder']=='';
|
||||
$folder['path'] = path_format($path1 . '/' . spurlencode(${$VAR}['encrypt_folder'], '/'));
|
||||
$folder['name'] = ${$VAR}['encrypt_folder'];
|
||||
$folder['id'] = ${$VAR}['encrypt_fileid'];
|
||||
$folder['id'] = ${$VAR}['id'];
|
||||
return $drive->Encrypt($folder, getConfig('passfile'), ${$VAR}['encrypt_newpass']);
|
||||
}
|
||||
if (isset($tmpget['move_folder']) || isset($tmppost['move_folder'])) {
|
||||
if (!compareadminmd5('admin', getConfig('admin'), $_COOKIE['admin'], $_POST['_admin'])) return ['statusCode'=>403];
|
||||
if (isset($tmppost['move_folder'])) $VAR = 'tmppost';
|
||||
else $VAR = 'tmpget';
|
||||
// move 移动
|
||||
|
@ -1161,7 +1084,6 @@ function adminoperate($path)
|
|||
}
|
||||
}
|
||||
if (isset($tmpget['copy_name']) || isset($tmppost['copy_name'])) {
|
||||
if (!compareadminmd5('admin', getConfig('admin'), $_COOKIE['admin'], $_POST['_admin'])) return ['statusCode'=>403];
|
||||
if (isset($tmppost['copy_name'])) $VAR = 'tmppost';
|
||||
else $VAR = 'tmpget';
|
||||
// copy 复制
|
||||
|
@ -1171,7 +1093,6 @@ function adminoperate($path)
|
|||
return $drive->Copy($file);
|
||||
}
|
||||
if (isset($tmppost['editfile'])) {
|
||||
if (!compareadminmd5('admin', getConfig('admin'), $_COOKIE['admin'], $_POST['_admin'])) return ['statusCode'=>403];
|
||||
// edit 编辑
|
||||
$file['path'] = $path1;
|
||||
$file['name'] = '';
|
||||
|
@ -1179,7 +1100,6 @@ function adminoperate($path)
|
|||
return $drive->Edit($file, $tmppost['editfile']);
|
||||
}
|
||||
if (isset($tmpget['create_name']) || isset($tmppost['create_name'])) {
|
||||
if (!compareadminmd5('admin', getConfig('admin'), $_COOKIE['admin'], $_POST['_admin'])) return ['statusCode'=>403];
|
||||
if (isset($tmppost['create_name'])) $VAR = 'tmppost';
|
||||
else $VAR = 'tmpget';
|
||||
// create 新建
|
||||
|
@ -1188,6 +1108,14 @@ function adminoperate($path)
|
|||
$parent['id'] = ${$VAR}['create_fileid'];
|
||||
return $drive->Create($parent, ${$VAR}['create_type'], ${$VAR}['create_name'], ${$VAR}['create_text']);
|
||||
}
|
||||
if (isset($tmpget['RefreshCache'])) {
|
||||
//$path1 = path_format($_SERVER['list_path'] . path_format($path));
|
||||
//if ($path1!='/'&&substr($path1, -1)=='/') $path1=substr($path1, 0, -1);
|
||||
savecache('path_' . $path1 . '/?password', '', $_SERVER['disktag'], 1);
|
||||
savecache('customTheme', '', '', 1);
|
||||
return message('<meta http-equiv="refresh" content="2;URL=./">
|
||||
<meta name=viewport content="width=device-width,initial-scale=1">', getconstStr('RefreshCache'), 202);
|
||||
}
|
||||
return $tmparr;
|
||||
}
|
||||
|
||||
|
@ -1248,7 +1176,7 @@ function EnvOpt($needUpdate = 0)
|
|||
$envs = substr(json_encode(array_keys ($EnvConfigs)), 1, -1);
|
||||
|
||||
$html = '<title>OneManager '.getconstStr('Setup').'</title>';
|
||||
if (isset($_POST['updateProgram'])&&$_POST['updateProgram']==getconstStr('updateProgram')) if (compareadminmd5('admin', getConfig('admin'), $_COOKIE['admin'], $_POST['_admin'])) {
|
||||
if (isset($_POST['updateProgram'])&&$_POST['updateProgram']==getconstStr('updateProgram')) {
|
||||
$response = setConfigResponse(OnekeyUpate($_POST['auth'], $_POST['project'], $_POST['branch']));
|
||||
if (api_error($response)) {
|
||||
$html = api_error_msg($response);
|
||||
|
@ -1260,8 +1188,8 @@ function EnvOpt($needUpdate = 0)
|
|||
$title = getconstStr('Setup');
|
||||
return message($html, $title, 202, 1);
|
||||
}
|
||||
} else return message('please login again', 'Need login', 403);
|
||||
if (isset($_POST['submit1'])) if (compareadminmd5('admin', getConfig('admin'), $_COOKIE['admin'], $_POST['_admin'])) {
|
||||
}
|
||||
if (isset($_POST['submit1'])) {
|
||||
$_SERVER['disk_oprating'] = '';
|
||||
foreach ($_POST as $k => $v) {
|
||||
if (isShowedEnv($k) || $k=='disktag_del' || $k=='disktag_add' || $k=='disktag_rename' || $k=='disktag_copy') {
|
||||
|
@ -1311,8 +1239,8 @@ function EnvOpt($needUpdate = 0)
|
|||
$title = getconstStr('Setup');
|
||||
return message($html, $title, 200, 1);
|
||||
}
|
||||
} else return message('please login again', 'Need login', 403);
|
||||
if (isset($_POST['config_b'])) if (compareadminmd5('admin', getConfig('admin'), $_COOKIE['admin'], $_POST['_admin'])) {
|
||||
}
|
||||
if (isset($_POST['config_b'])) {
|
||||
if (!$_POST['pass']) return output("{\"Error\": \"No admin pass\"}", 403);
|
||||
if (!is_numeric($_POST['timestamp'])) return output("{\"Error\": \"Error time\"}", 403);
|
||||
if (abs(time() - $_POST['timestamp']/1000) > 5*60) return output("{\"Error\": \"Timeout\"}", 403);
|
||||
|
@ -1369,8 +1297,8 @@ function EnvOpt($needUpdate = 0)
|
|||
} else {
|
||||
return output("{\"Error\": \"Admin pass error\"}", 403);
|
||||
}
|
||||
} else return message('please login again', 'Need login', 403);
|
||||
if (isset($_POST['changePass'])) if (compareadminmd5('admin', getConfig('admin'), $_COOKIE['admin'], $_POST['_admin'])) {
|
||||
}
|
||||
if (isset($_POST['changePass'])) {
|
||||
if (!is_numeric($_POST['timestamp'])) return message("Error time<a href=\"\">" . getconstStr('Back') . "</a>", "Error", 403);
|
||||
if (abs(time() - $_POST['timestamp']/1000) > 5*60) return message("Timeout<a href=\"\">" . getconstStr('Back') . "</a>", "Error", 403);
|
||||
if ($_POST['newPass1']==''||$_POST['newPass2']=='') return message("Empty new pass<a href=\"\">" . getconstStr('Back') . "</a>", "Error", 403);
|
||||
|
@ -1387,7 +1315,7 @@ function EnvOpt($needUpdate = 0)
|
|||
} else {
|
||||
return message("Old pass error<a href=\"\">" . getconstStr('Back') . "</a>", "Error", 403);
|
||||
}
|
||||
} else return message('please login again', 'Need login', 403);
|
||||
}
|
||||
|
||||
if (isset($_GET['preview'])) {
|
||||
$preurl = $_SERVER['PHP_SELF'] . '?preview';
|
||||
|
@ -1426,7 +1354,7 @@ output:
|
|||
let inputarea = document.getElementById(\'inputarea\');
|
||||
//console.log(a + ", " + inputarea.value);
|
||||
inputarea.focus();
|
||||
inputarea.setSelectionRange(inputarea.value.length, inputarea.value.length);
|
||||
inputarea.setSelectionRange(0, inputarea.value.length);
|
||||
}, 500);
|
||||
</script>';
|
||||
return message($html, 'Run cmd', $statusCode);
|
||||
|
@ -1434,8 +1362,7 @@ output:
|
|||
if ($_GET['setup']==='platform') {
|
||||
$frame .= '
|
||||
<table border=1 width=100%>
|
||||
<form name="common" action="" method="post">
|
||||
<input name="_admin" type="hidden" value="">';
|
||||
<form name="common" action="" method="post">';
|
||||
foreach ($EnvConfigs as $key => $val) if (isCommonEnv($key) && isShowedEnv($key)) {
|
||||
$frame .= '
|
||||
<tr>
|
||||
|
@ -1485,7 +1412,7 @@ output:
|
|||
<tr><td><input type="submit" name="submit1" value="' . getconstStr('Setup') . '"></td><td></td></tr>
|
||||
</form>
|
||||
</table><br>';
|
||||
} elseif (isset($_GET['disktag'])&&$_GET['disktag']!==true&&in_array($_GET['disktag'], $disktags)) {
|
||||
} elseif (isset($_GET['disktag'])&&in_array($_GET['disktag'], $disktags)) {
|
||||
$disktag = $_GET['disktag'];
|
||||
$disk_tmp = null;
|
||||
$diskok = driveisfine($disktag, $disk_tmp);
|
||||
|
@ -1495,7 +1422,6 @@ output:
|
|||
<td>
|
||||
<form action="" method="post" style="margin: 0" onsubmit="return renametag(this);">
|
||||
<input type="hidden" name="disktag_rename" value="' . $disktag . '">
|
||||
<input name="_admin" type="hidden" value="">
|
||||
<input type="text" name="disktag_newname" value="' . $disktag . '" placeholder="' . getconstStr('EnvironmentsDescription')['disktag'] . '">
|
||||
<input type="submit" name="submit1" value="' . getconstStr('RenameDisk') . '">
|
||||
</form>
|
||||
|
@ -1507,14 +1433,12 @@ output:
|
|||
<td>
|
||||
<form action="" method="post" style="margin: 0" onsubmit="return deldiskconfirm(this);">
|
||||
<input type="hidden" name="disktag_del" value="' . $disktag . '">
|
||||
<input name="_admin" type="hidden" value="">
|
||||
<input type="submit" name="submit1" value="' . getconstStr('DelDisk') . '">
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
<form action="" method="post" style="margin: 0" onsubmit="return cpdiskconfirm(this);">
|
||||
<input type="hidden" name="disktag_copy" value="' . $disktag . '">
|
||||
<input name="_admin" type="hidden" value="">
|
||||
<input type="submit" name="submit1" value="' . getconstStr('CopyDisk') . '">
|
||||
</form>
|
||||
</td>
|
||||
|
@ -1542,7 +1466,6 @@ output:
|
|||
|
||||
$frame .= '
|
||||
<form name="' . $disktag . '" action="" method="post">
|
||||
<input name="_admin" type="hidden" value="">
|
||||
<input type="hidden" name="disk" value="' . $disktag . '">';
|
||||
foreach ($EnvConfigs as $key => $val) if (isInnerEnv($key) && isShowedEnv($key)) {
|
||||
$frame .= '
|
||||
|
@ -1625,7 +1548,6 @@ output:
|
|||
}
|
||||
}
|
||||
$frame .= '
|
||||
<input name="_admin" type="hidden" value="">
|
||||
</tr>
|
||||
<tr><td colspan="' . $num . '">' . getconstStr('DragSort') . '<input type="submit" name="submit1" value="' . getconstStr('SubmitSortdisks') . '"></td></tr>
|
||||
</form>
|
||||
|
@ -1721,7 +1643,6 @@ output:
|
|||
} else {
|
||||
$frame .= '
|
||||
<form name="updateform" action="" method="post">
|
||||
<input name="_admin" type="hidden" value="">
|
||||
<input type="text" name="auth" size="6" placeholder="auth" value="qkqpttgf">
|
||||
<input type="text" name="project" size="12" placeholder="project" value="OneManager-php">
|
||||
<button name="QueryBranchs" onclick="querybranchs();return false;">' . getconstStr('QueryBranchs') . '</button>
|
||||
|
@ -1772,7 +1693,6 @@ output:
|
|||
<script src="https://cdn.bootcss.com/js-sha1/0.6.0/sha1.min.js"></script>
|
||||
<table>
|
||||
<form id="change_pass" name="change_pass" action="" method="POST" onsubmit="return changePassword(this);">
|
||||
<input name="_admin" type="hidden" value="">
|
||||
<tr>
|
||||
<td>' . getconstStr('OldPassword') . ':</td><td><input type="password" name="oldPass">
|
||||
<input type="hidden" name="timestamp"></td>
|
||||
|
@ -1832,7 +1752,7 @@ output:
|
|||
xhr.onerror = function(e){
|
||||
alert("Network Error "+xhr.status);
|
||||
}
|
||||
xhr.send("pass=" + sha1(config_f.pass.value + "" + timestamp) + "&config_b=" + b.value + "×tamp=" + timestamp + "&_admin=" + localStorage.getItem("admin"));
|
||||
xhr.send("pass=" + sha1(config_f.pass.value + "" + timestamp) + "&config_b=" + b.value + "×tamp=" + timestamp);
|
||||
}
|
||||
function importConfig(b) {
|
||||
if (config_f.pass.value=="") {
|
||||
|
@ -1872,7 +1792,7 @@ output:
|
|||
xhr.onerror = function(e){
|
||||
alert("Network Error "+xhr.status);
|
||||
}
|
||||
xhr.send("pass=" + sha1(config_f.pass.value + "" + timestamp) + "&config_t=" + encodeURIComponent(config_f.config_t.value) + "&config_b=" + b.value + "×tamp=" + timestamp + "&_admin=" + localStorage.getItem("admin"));
|
||||
xhr.send("pass=" + sha1(config_f.pass.value + "" + timestamp) + "&config_t=" + encodeURIComponent(config_f.config_t.value) + "&config_b=" + b.value + "×tamp=" + timestamp);
|
||||
}
|
||||
function changePassword(f) {
|
||||
if (f.oldPass.value==""||f.newPass1.value==""||f.newPass2.value=="") {
|
||||
|
@ -1906,7 +1826,7 @@ output:
|
|||
</style>
|
||||
<table border=0>
|
||||
<tr class="tabs">';
|
||||
if ($_GET['disktag']==''||$_GET['disktag']===true||!in_array($_GET['disktag'], $disktags)) {
|
||||
if ($_GET['disktag']=='') {
|
||||
if ($_GET['setup']==='platform') $html .= '
|
||||
<td><a href="?setup">' . getconstStr('Home') . '</a></td>
|
||||
<td>' . getconstStr('PlatformConfig') . '</td>';
|
||||
|
@ -1918,7 +1838,7 @@ output:
|
|||
<td><a href="?setup=platform">' . getconstStr('PlatformConfig') . '</a></td>';
|
||||
foreach ($disktags as $disktag) {
|
||||
if ($disktag!='') {
|
||||
if ($_GET['disktag']===$disktag) $html .= '
|
||||
if ($_GET['disktag']==$disktag) $html .= '
|
||||
<td>' . $disktag . '</td>';
|
||||
else $html .= '
|
||||
<td><a href="?setup&disktag=' . $disktag . '">' . $disktag . '</a></td>';
|
||||
|
@ -1928,12 +1848,6 @@ output:
|
|||
</tr>
|
||||
</table><br>';
|
||||
$html .= $frame;
|
||||
$html .= '<script>
|
||||
var inputAdminStorage = document.getElementsByName("_admin");
|
||||
for (i=0;i<inputAdminStorage.length;i++) {
|
||||
inputAdminStorage[i].value = localStorage.getItem("admin");
|
||||
}
|
||||
</script>';
|
||||
return message($html, getconstStr('Setup'));
|
||||
}
|
||||
|
||||
|
@ -1944,30 +1858,29 @@ function render_list($path = '', $files = [])
|
|||
global $slash;
|
||||
|
||||
if (isset($files['list']['index.html']) && !$_SERVER['admin']) {
|
||||
$htmlcontent = get_content(path_format($path . '/index.html'))['content'];
|
||||
//$htmlcontent = fetch_files(spurlencode(path_format(urldecode($path) . '/index.html'), '/'))['content'];
|
||||
$htmlcontent = get_content(spurlencode(path_format(urldecode($path) . '/index.html'), '/'))['content'];
|
||||
return output($htmlcontent['body'], $htmlcontent['stat']);
|
||||
}
|
||||
//$path = str_replace('%20','%2520',$path);
|
||||
//$path = str_replace('+','%2B',$path);
|
||||
$path1 = path_format(urldecode($path));
|
||||
//$path = str_replace('&','&', $path) ;
|
||||
//$path = str_replace('%20',' ',$path);
|
||||
//$path = str_replace('#','%23',$path);
|
||||
$path = str_replace('%20','%2520',$path);
|
||||
$path = str_replace('+','%2B',$path);
|
||||
$path = str_replace('&','&',path_format(urldecode($path))) ;
|
||||
$path = str_replace('%20',' ',$path);
|
||||
$path = str_replace('#','%23',$path);
|
||||
$p_path='';
|
||||
if ($path1 !== '/') {
|
||||
if ($path !== '/') {
|
||||
if ($files['type']=='file') {
|
||||
$pretitle = str_replace('&','&', $files['name']);
|
||||
$n_path = $pretitle;
|
||||
$tmp = splitlast(splitlast($path1,'/')[0],'/');
|
||||
$tmp = splitlast(splitlast($path,'/')[0],'/');
|
||||
if ($tmp[1]=='') {
|
||||
$p_path = $tmp[0];
|
||||
} else {
|
||||
$p_path = $tmp[1];
|
||||
}
|
||||
} else {
|
||||
if (substr($path1, 0, 1)=='/') $pretitle = substr($path1, 1);
|
||||
if (substr($path1, -1)=='/') $pretitle = substr($pretitle, 0, -1);
|
||||
$pretitle = str_replace('&','&', $pretitle);
|
||||
if (substr($path, 0, 1)=='/') $pretitle = substr($path, 1);
|
||||
if (substr($path, -1)=='/') $pretitle = substr($pretitle, 0, -1);
|
||||
$tmp=splitlast($pretitle,'/');
|
||||
if ($tmp[1]=='') {
|
||||
$n_path = $tmp[0];
|
||||
|
@ -1987,7 +1900,7 @@ function render_list($path = '', $files = [])
|
|||
}
|
||||
$n_path = str_replace('&','&',$n_path);
|
||||
$p_path = str_replace('&','&',$p_path);
|
||||
//$pretitle = str_replace('%23','#',$pretitle);
|
||||
$pretitle = str_replace('%23','#',$pretitle);
|
||||
$statusCode = 200;
|
||||
date_default_timezone_set(get_timezone($_SERVER['timezone']));
|
||||
$authinfo = '
|
||||
|
@ -2322,9 +2235,8 @@ function render_list($path = '', $files = [])
|
|||
$html = str_replace('<!--IsFileStart-->', '', $html);
|
||||
$html = str_replace('<!--IsFileEnd-->', '', $html);
|
||||
}
|
||||
//$html = str_replace('<!--FileEncodeUrl-->', encode_str_replace(path_format($_SERVER['base_disk_path'] . '/' . $path)), $html);
|
||||
$html = str_replace('<!--FileEncodeUrl-->', encode_str_replace(splitlast($path1, '/')[1]), $html);
|
||||
$html = str_replace('<!--FileUrl-->', (path_format($_SERVER['base_disk_path'] . '/' . $path1)), $html);
|
||||
$html = str_replace('<!--FileEncodeUrl-->', encode_str_replace(path_format($_SERVER['base_disk_path'] . '/' . str_replace('&', '&', $path))), $html);
|
||||
$html = str_replace('<!--FileUrl-->', encode_str_replace(path_format($_SERVER['base_disk_path'] . '/' . str_replace('&', '&', $path))), $html);
|
||||
|
||||
$ext = strtolower(substr($path, strrpos($path, '.') + 1));
|
||||
if (in_array($ext, $exts['img'])) $ext = 'img';
|
||||
|
@ -2351,23 +2263,16 @@ function render_list($path = '', $files = [])
|
|||
$html = str_replace('<!--Is'.$ext.'FileEnd-->', '', $html);
|
||||
}
|
||||
//while (strpos($html, '<!--FileDownUrl-->')) $html = str_replace('<!--FileDownUrl-->', $files['url'], $html);
|
||||
//while (strpos($html, '<!--FileDownUrl-->')) $html = str_replace('<!--FileDownUrl-->', (path_format($_SERVER['base_disk_path'] . '/' . $path)), $html);
|
||||
while (strpos($html, '<!--FileDownUrl-->')) $html = str_replace('<!--FileDownUrl-->', encode_str_replace(splitlast($path1, '/')[1]), $html);
|
||||
//echo $path . "<br>\n";
|
||||
//while (strpos($html, '<!--FileEncodeReplaceUrl-->')) $html = str_replace('<!--FileEncodeReplaceUrl-->', (path_format($_SERVER['base_disk_path'] . '/' . str_replace('&', '&', $path))), $html);
|
||||
while (strpos($html, '<!--FileEncodeReplaceUrl-->')) $html = str_replace('<!--FileEncodeReplaceUrl-->', encode_str_replace(splitlast($path1, '/')[1]), $html);
|
||||
while (strpos($html, '<!--FileDownUrl-->')) $html = str_replace('<!--FileDownUrl-->', encode_str_replace(path_format($_SERVER['base_disk_path'] . '/' . $path)), $html);
|
||||
while (strpos($html, '<!--FileEncodeReplaceUrl-->')) $html = str_replace('<!--FileEncodeReplaceUrl-->', encode_str_replace(path_format($_SERVER['base_disk_path'] . '/' . $path)), $html);
|
||||
while (strpos($html, '<!--FileName-->')) $html = str_replace('<!--FileName-->', $files['name'], $html);
|
||||
while (strpos($html, '<!--FileEncodeDownUrl-->')) $html = str_replace('<!--FileEncodeDownUrl-->', urlencode($files['url']), $html);
|
||||
//while (strpos($html, '<!--FileEncodeDownUrl-->')) $html = str_replace('<!--FileEncodeDownUrl-->', urlencode($_SERVER['host'] . path_format($_SERVER['base_disk_path'] . '/' . $path)), $html);
|
||||
//while (strpos($html, '<!--FileEncodeDownUrl-->')) $html = str_replace('<!--FileEncodeDownUrl-->', urlencode(path_format($_SERVER['base_disk_path'] . '/' . $path)), $html);
|
||||
$html = str_replace('<!--constStr@ClicktoEdit-->', getconstStr('ClicktoEdit'), $html);
|
||||
$html = str_replace('<!--constStr@CancelEdit-->', getconstStr('CancelEdit'), $html);
|
||||
$html = str_replace('<!--constStr@Save-->', getconstStr('Save'), $html);
|
||||
if (strpos($html, '<!--TxtContent-->')) {
|
||||
//$tmp_content = get_content(spurlencode(path_format(urldecode($path)), '/'))['content']['body'];
|
||||
$tmp_content = $files['content']['body'];
|
||||
if (strlen($tmp_content)==$files['size']) $html = str_replace('<!--TxtContent-->', htmlspecialchars($tmp_content), $html);
|
||||
else $html = str_replace('<!--TxtContent-->', $files['size']<1024*1024?htmlspecialchars(curl('GET', $files['url'], '', [], 0, 1)['body']):"File too large: " . $files['size'] . " B.", $html);
|
||||
}
|
||||
//while (strpos($html, '<!--TxtContent-->')) $html = str_replace('<!--TxtContent-->', htmlspecialchars(curl('GET', $files['url'], '', [], 0, 1)['body']), $html);
|
||||
while (strpos($html, '<!--TxtContent-->')) $html = str_replace('<!--TxtContent-->', htmlspecialchars(get_content(spurlencode(path_format(urldecode($path)), '/'))['content']['body']), $html);
|
||||
$html = str_replace('<!--constStr@FileNotSupport-->', getconstStr('FileNotSupport'), $html);
|
||||
|
||||
//$html = str_replace('<!--constStr@File-->', getconstStr('File'), $html);
|
||||
|
@ -2409,8 +2314,7 @@ function render_list($path = '', $files = [])
|
|||
if ($file['type']=='folder') {
|
||||
if ($_SERVER['admin'] or !isHideFile($file['name'])) {
|
||||
$filenum++;
|
||||
//$FolderListStr = str_replace('<!--FileEncodeReplaceUrl-->', encode_str_replace(path_format($_SERVER['base_disk_path'] . '/' . str_replace('&', '&', $path) . '/' . $file['name'])), $FolderList);
|
||||
$FolderListStr = str_replace('<!--FileEncodeReplaceUrl-->', encode_str_replace($file['name']), $FolderList);
|
||||
$FolderListStr = str_replace('<!--FileEncodeReplaceUrl-->', encode_str_replace(path_format($_SERVER['base_disk_path'] . '/' . str_replace('&', '&', $path) . '/' . $file['name'])), $FolderList);
|
||||
$FolderListStr = str_replace('<!--FileId-->', $file['id'], $FolderListStr);
|
||||
$FolderListStr = str_replace('<!--FileEncodeReplaceName-->', str_replace('&','&', $file['showname']?$file['showname']:$file['name']), $FolderListStr);
|
||||
$FolderListStr = str_replace('<!--lastModifiedDateTime-->', time_format($file['time']), $FolderListStr);
|
||||
|
@ -2432,8 +2336,7 @@ function render_list($path = '', $files = [])
|
|||
$filenum++;
|
||||
$ext = strtolower(substr($file['name'], strrpos($file['name'], '.') + 1));
|
||||
$FolderListStr = $FolderList;
|
||||
//while (strpos($FolderListStr, '<!--FileEncodeReplaceUrl-->')) $FolderListStr = str_replace('<!--FileEncodeReplaceUrl-->', encode_str_replace(path_format($_SERVER['base_disk_path'] . '/' . str_replace('&', '&', $path) . '/' . $file['name'])), $FolderListStr);
|
||||
while (strpos($FolderListStr, '<!--FileEncodeReplaceUrl-->')) $FolderListStr = str_replace('<!--FileEncodeReplaceUrl-->', encode_str_replace($file['name']), $FolderListStr);
|
||||
while (strpos($FolderListStr, '<!--FileEncodeReplaceUrl-->')) $FolderListStr = str_replace('<!--FileEncodeReplaceUrl-->', encode_str_replace(path_format($_SERVER['base_disk_path'] . '/' . str_replace('&', '&', $path) . '/' . $file['name'])), $FolderListStr);
|
||||
$FolderListStr = str_replace('<!--FileExt-->', $ext, $FolderListStr);
|
||||
if (in_array($ext, $exts['music'])) $FolderListStr = str_replace('<!--FileExtType-->', 'audio', $FolderListStr);
|
||||
elseif (in_array($ext, $exts['video'])) $FolderListStr = str_replace('<!--FileExtType-->', 'iframe', $FolderListStr);
|
||||
|
@ -2556,7 +2459,7 @@ function render_list($path = '', $files = [])
|
|||
|
||||
while (strpos($html, '<!--base_disk_path-->')) $html = str_replace('<!--base_disk_path-->', (substr($_SERVER['base_disk_path'],-1)=='/'?substr($_SERVER['base_disk_path'],0,-1):$_SERVER['base_disk_path']), $html);
|
||||
while (strpos($html, '<!--base_path-->')) $html = str_replace('<!--base_path-->', $_SERVER['base_path'], $html);
|
||||
while (strpos($html, '<!--Path-->')) $html = str_replace('<!--Path-->', str_replace('%23', '#', str_replace('&','&', path_format($path1.'/'))), $html);
|
||||
while (strpos($html, '<!--Path-->')) $html = str_replace('<!--Path-->', str_replace('%23', '#', str_replace('&','&', path_format($path.'/'))), $html);
|
||||
while (strpos($html, '<!--constStr@Home-->')) $html = str_replace('<!--constStr@Home-->', getconstStr('Home'), $html);
|
||||
|
||||
$html = str_replace('<!--customCss-->', getConfig('customCss'), $html);
|
||||
|
@ -2616,11 +2519,11 @@ function render_list($path = '', $files = [])
|
|||
$tmp_path = str_replace('&','&', substr(urldecode($_SERVER['PHP_SELF']), strlen($tmp_url)));
|
||||
while ($tmp_path!='') {
|
||||
$tmp1 = splitfirst($tmp_path, '/');
|
||||
$folder1 = str_replace('&', '&', $tmp1[0]);
|
||||
$folder1 = $tmp1[0];
|
||||
if ($folder1!='') {
|
||||
$tmp_url .= $folder1 . '/';
|
||||
$tmp_url .= str_replace('&', '&', $folder1) . '/';
|
||||
$PathArrayStr1 = str_replace('<!--PathArrayLink-->', encode_str_replace($folder1==$files['name']?'':$tmp_url), $PathArrayStr);
|
||||
$PathArrayStr1 = str_replace('<!--PathArrayName-->', str_replace('&', '&', $folder1), $PathArrayStr1);
|
||||
$PathArrayStr1 = str_replace('<!--PathArrayName-->', $folder1, $PathArrayStr1);
|
||||
$html .= $PathArrayStr1;
|
||||
}
|
||||
$tmp_path = $tmp1[1];
|
||||
|
@ -2637,11 +2540,11 @@ function render_list($path = '', $files = [])
|
|||
$tmp_path = str_replace('&','&', substr(urldecode($_SERVER['PHP_SELF']), strlen($tmp_url)));
|
||||
while ($tmp_path!='') {
|
||||
$tmp1 = splitfirst($tmp_path, '/');
|
||||
$folder1 = str_replace('&', '&', $tmp1[0]);
|
||||
$folder1 = $tmp1[0];
|
||||
if ($folder1!='') {
|
||||
$tmp_url .= $folder1 . '/';
|
||||
$tmp_url .= str_replace('&', '&', $folder1) . '/';
|
||||
$PathArrayStr1 = str_replace('<!--PathArrayLink-->', encode_str_replace($folder1==$files['name']?'':$tmp_url), $PathArrayStr);
|
||||
$PathArrayStr1 = str_replace('<!--PathArrayName-->', str_replace('&', '&', $folder1==$_SERVER['disktag']?(getConfig('diskname')==''?$_SERVER['disktag']:getConfig('diskname')):$folder1), $PathArrayStr1);
|
||||
$PathArrayStr1 = str_replace('<!--PathArrayName-->', ($folder1==$_SERVER['disktag']?(getConfig('diskname')==''?$_SERVER['disktag']:getConfig('diskname')):$folder1), $PathArrayStr1);
|
||||
$html .= $PathArrayStr1;
|
||||
}
|
||||
$tmp_path = $tmp1[1];
|
||||
|
@ -2734,7 +2637,7 @@ function render_list($path = '', $files = [])
|
|||
$html = $tmp[0];
|
||||
$tmp = splitfirst($tmp[1], '<!--HeadomfEnd-->');
|
||||
if (isset($files['list']['head.omf'])) {
|
||||
$headomf = str_replace('<!--HeadomfContent-->', get_content(path_format($path . '/' . $files['list']['head.omf']['name']))['content']['body'], $tmp[0]);
|
||||
$headomf = str_replace('<!--HeadomfContent-->', get_content(spurlencode(path_format($path . '/' . $files['list']['head.omf']['name']), '/'))['content']['body'], $tmp[0]);
|
||||
}
|
||||
$html .= $headomf . $tmp[1];
|
||||
|
||||
|
@ -2742,7 +2645,7 @@ function render_list($path = '', $files = [])
|
|||
$html = $tmp[0];
|
||||
$tmp = splitfirst($tmp[1], '<!--HeadmdEnd-->');
|
||||
if (isset($files['list']['head.md'])) {
|
||||
$headmd = str_replace('<!--HeadmdContent-->', get_content(path_format($path . '/' . $files['list']['head.md']['name']))['content']['body'], $tmp[0]);
|
||||
$headmd = str_replace('<!--HeadmdContent-->', get_content(spurlencode(path_format($path . '/' . $files['list']['head.md']['name']), '/'))['content']['body'], $tmp[0]);
|
||||
$html .= $headmd . $tmp[1];
|
||||
while (strpos($html, '<!--HeadmdStart-->')) {
|
||||
$html = str_replace('<!--HeadmdStart-->', '', $html);
|
||||
|
@ -2775,8 +2678,7 @@ function render_list($path = '', $files = [])
|
|||
$html = $tmp[0];
|
||||
$tmp = splitfirst($tmp[1], '<!--ReadmemdEnd-->');
|
||||
if (isset($files['list']['readme.md'])) {
|
||||
//$Readmemd = str_replace('<!--ReadmemdContent-->', get_content(spurlencode(path_format($path1 . '/' . $files['list']['readme.md']['name']),'/'))['content']['body'], $tmp[0]);
|
||||
$Readmemd = str_replace('<!--ReadmemdContent-->', get_content(path_format($path . '/' . $files['list']['readme.md']['name']))['content']['body'], $tmp[0]);
|
||||
$Readmemd = str_replace('<!--ReadmemdContent-->', get_content(spurlencode(path_format($path . '/' . $files['list']['readme.md']['name']),'/'))['content']['body'], $tmp[0]);
|
||||
$html .= $Readmemd . $tmp[1];
|
||||
while (strpos($html, '<!--ReadmemdStart-->')) {
|
||||
$html = str_replace('<!--ReadmemdStart-->', '', $html);
|
||||
|
@ -2798,7 +2700,7 @@ function render_list($path = '', $files = [])
|
|||
$html = $tmp[0];
|
||||
$tmp = splitfirst($tmp[1], '<!--FootomfEnd-->');
|
||||
if (isset($files['list']['foot.omf'])) {
|
||||
$Footomf = str_replace('<!--FootomfContent-->', get_content(path_format($path . '/' . $files['list']['foot.omf']['name']))['content']['body'], $tmp[0]);
|
||||
$Footomf = str_replace('<!--FootomfContent-->', get_content(spurlencode(path_format($path . '/' . $files['list']['foot.omf']['name']),'/'))['content']['body'], $tmp[0]);
|
||||
}
|
||||
$html .= $Footomf . $tmp[1];
|
||||
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
<?php
|
||||
// https://docs.microsoft.com/en-us/graph/api/driveitem-get?view=graph-rest-1.0
|
||||
// https://docs.microsoft.com/zh-cn/graph/api/driveitem-put-content?view=graph-rest-1.0&tabs=http
|
||||
// https://developer.microsoft.com/zh-cn/graph/graph-explorer
|
||||
|
||||
class Onedrive {
|
||||
protected $access_token;
|
||||
|
@ -49,6 +46,9 @@ class Onedrive {
|
|||
{
|
||||
global $exts;
|
||||
if (!($files = getcache('path_' . $path, $this->disktag))) {
|
||||
// https://docs.microsoft.com/en-us/graph/api/driveitem-get?view=graph-rest-1.0
|
||||
// https://docs.microsoft.com/zh-cn/graph/api/driveitem-put-content?view=graph-rest-1.0&tabs=http
|
||||
// https://developer.microsoft.com/zh-cn/graph/graph-explorer
|
||||
$pos = splitlast($path, '/');
|
||||
$parentpath = $pos[0];
|
||||
if ($parentpath=='') $parentpath = '/';
|
||||
|
@ -131,7 +131,7 @@ class Onedrive {
|
|||
} else {
|
||||
$files['error']['stat'] = 503;
|
||||
$files['error']['code'] = 'unknownError';
|
||||
$files['error']['message'] = 'unknownError ' . $arr['body'] . " ~";
|
||||
$files['error']['message'] = 'unknownError';
|
||||
}
|
||||
//$files = json_decode( '{"unknownError":{ "stat":'.$arr['stat'].',"message":"'.$arr['body'].'"}}', true);
|
||||
//error_log1(json_encode($files, JSON_PRETTY_PRINT));
|
||||
|
@ -180,7 +180,6 @@ class Onedrive {
|
|||
return $files;
|
||||
}
|
||||
//error_log1(json_encode($tmp));
|
||||
//echo '<pre>' . json_encode($tmp, JSON_PRETTY_PRINT) . '</pre>';
|
||||
return $tmp;
|
||||
}
|
||||
|
||||
|
@ -351,16 +350,15 @@ class Onedrive {
|
|||
$filename = spurlencode($file['name']);
|
||||
$filename = path_format($file['path'] . '/' . $filename);
|
||||
//echo $filename;
|
||||
if ($file['id']) $result = $this->MSAPI('DELETE', "/items/" . $file['id']);
|
||||
else $result = $this->MSAPI('DELETE', $filename);
|
||||
$result = $this->MSAPI('DELETE', $filename);
|
||||
if ($result['stat']!=204) $r_body = json_encode($this->files_format(json_decode($result['body'], true)));
|
||||
return output($r_body, $result['stat']);
|
||||
//return output($result['body'], $result['stat']);
|
||||
}
|
||||
public function Encrypt($folder, $passfilename, $pass) {
|
||||
$filename = '/items/' . $folder['id'] . ':/' . urlencode($passfilename);
|
||||
$filename = path_format($folder['path'] . '/' . urlencode($passfilename));
|
||||
if ($pass==='') {
|
||||
$result = $this->MSAPI('DELETE', $filename);
|
||||
$result = $this->MSAPI('DELETE', $filename, '');
|
||||
} else {
|
||||
$result = $this->MSAPI('PUT', $filename, $pass);
|
||||
}
|
||||
|
@ -374,8 +372,7 @@ class Onedrive {
|
|||
$filename = spurlencode($file['name']);
|
||||
$filename = path_format($file['path'] . '/' . $filename);
|
||||
$data = '{"parentReference":{"path": "/drive/root:' . $folder['path'] . '"}}';
|
||||
if ($file['id']) $result = $this->MSAPI('PATCH', "/items/" . $file['id'], $data);
|
||||
else $result = $this->MSAPI('PATCH', $filename, $data);
|
||||
$result = $this->MSAPI('PATCH', $filename, $data);
|
||||
$path2 = spurlencode($folder['path'], '/');
|
||||
if ($path2!='/'&&substr($path2, -1)=='/') $path2 = substr($path2, 0, -1);
|
||||
savecache('path_' . $path2, json_decode('{}', true), $this->disktag, 1);
|
||||
|
@ -394,8 +391,7 @@ class Onedrive {
|
|||
$newname = '.' . $namearr[1] . ' (' . date("Ymd\THis\Z") . ')';
|
||||
}
|
||||
$data = '{ "name": "' . $newname . '" }';
|
||||
if ($file['id']) $result = $this->MSAPI('copy', "/items/" . $file['id'], $data);
|
||||
else $result = $this->MSAPI('copy', $filename, $data);
|
||||
$result = $this->MSAPI('copy', $filename, $data);
|
||||
/*$num = 0;
|
||||
while ($result['stat']==409 && json_decode($result['body'], true)['error']['code']=='nameAlreadyExists') {
|
||||
$num++;
|
||||
|
@ -1011,8 +1007,6 @@ class Onedrive {
|
|||
} else {
|
||||
if ($path=='' or $path=='/') {
|
||||
$url .= $method;
|
||||
} elseif (substr($path, 0, 6)=="/items") {
|
||||
$url .= '/' . $method;
|
||||
} else {
|
||||
$url .= ':/' . $method;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ error_reporting(0);
|
|||
include 'vendor/autoload.php';
|
||||
include 'conststr.php';
|
||||
include 'common.php';
|
||||
|
||||
header("Strict-Transport-Security: max-age=63072000; includeSubdomains; preload");
|
||||
//echo '<pre>'. json_encode($_SERVER, JSON_PRETTY_PRINT).'</pre>';
|
||||
//echo '<pre>'. json_encode($_ENV, JSON_PRETTY_PRINT).'</pre>';
|
||||
if (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud') {
|
||||
|
@ -108,7 +108,7 @@ function handler($event, $context)
|
|||
|
||||
$re = main($path);
|
||||
|
||||
return new RingCentral\Psr7\Response($re['statusCode'], $re['headers'], $re['isBase64Encoded']?base64_decode($re['body']):$re['body']);
|
||||
return new RingCentral\Psr7\Response($re['statusCode'], $re['headers'], $re['body']);
|
||||
|
||||
} elseif ($_SERVER['_APP_SHARE_DIR']=='/var/share/CFF/processrouter') {
|
||||
// Huawei FG
|
||||
|
|
|
@ -37,23 +37,14 @@ function GetPathSetting($event, $context)
|
|||
$_SERVER['region'] = $context['region'];
|
||||
$_SERVER['service_name'] = $context['service']['name'];
|
||||
$_SERVER['function_name'] = $context['function']['name'];
|
||||
//$path = str_replace('%5D', ']', str_replace('%5B', '[', $event['path']));//%5B
|
||||
//$path = $event['path'];
|
||||
$path = $event['requestURI'];
|
||||
if (strpos($path, '?')) $path = substr($path, 0, strpos($path, '?'));
|
||||
$tmp = urldecode($event['requestURI']);
|
||||
$path = $event['path'];
|
||||
$tmp = $event['requestURI'];
|
||||
if (strpos($tmp, '?')) $tmp = substr($tmp, 0, strpos($tmp, '?'));
|
||||
if ($path=='/'||$path=='') {
|
||||
$_SERVER['base_path'] = $tmp;
|
||||
} else {
|
||||
$tmp = str_replace('&', '&', $tmp);
|
||||
while ($tmp!=urldecode($tmp)) $tmp = urldecode($tmp);
|
||||
$tmp1 = urldecode($event['path']);
|
||||
while ($tmp1!=urldecode($tmp1)) $tmp1 = urldecode($tmp1);
|
||||
$_SERVER['base_path'] = substr($tmp, 0, strlen($tmp)-strlen($tmp1)+1);
|
||||
//$_SERVER['base_path'] = substr($tmp, 0, strlen(urldecode($event['path'])));
|
||||
$_SERVER['base_path'] = substr($tmp, 0, strlen($tmp)-strlen($path)+1);
|
||||
}
|
||||
$_SERVER['base_path'] = spurlencode($_SERVER['base_path'], '/');
|
||||
|
||||
if (substr($path,-1)=='/') $path=substr($path,0,-1);
|
||||
$_SERVER['is_guestup_path'] = is_guestup_path($path);
|
||||
|
@ -69,10 +60,8 @@ function GetPathSetting($event, $context)
|
|||
$_SERVER['REQUEST_SCHEME'] = $event['headers']['X-Forwarded-Proto'][0];
|
||||
$_SERVER['host'] = $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'];
|
||||
$_SERVER['referhost'] = explode('/', $event['headers']['Referer'][0])[2];
|
||||
$_SERVER['HTTP_IF_MODIFIED_SINCE'] = $event['headers']['If-Modified-Since'][0];
|
||||
$_SERVER['FC_SERVER_PATH'] = '/var/fc/runtime/php7.2';
|
||||
return $path;
|
||||
//return spurlencode($path, '/');
|
||||
}
|
||||
|
||||
function getConfig($str, $disktag = '')
|
||||
|
|
|
@ -50,7 +50,6 @@ function GetPathSetting($event, $context)
|
|||
$_SERVER['host'] = $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'];
|
||||
$_SERVER['referhost'] = explode('/', $event['headers']['Referer'])[2];
|
||||
$_SERVER['HTTP_TRANSLATE'] = $event['headers']['translate'];//'f'
|
||||
$_SERVER['HTTP_IF_MODIFIED_SINCE'] = $event['headers']['If-Modified-Since'];
|
||||
$_SERVER['BCE_CFC_RUNTIME_NAME'] = 'php7';
|
||||
return $path;
|
||||
}
|
||||
|
|
|
@ -49,7 +49,6 @@ function GetPathSetting($event, $context)
|
|||
$host_name = $event['headers']['host'];
|
||||
$_SERVER['HTTP_HOST'] = $host_name;
|
||||
$path = path_format($event['pathParameters'][''].'/');
|
||||
$path = str_replace('+', '%2B', $path);
|
||||
$_SERVER['base_path'] = path_format($event['path'].'/');
|
||||
if ( $_SERVER['base_path'] == $path ) {
|
||||
$_SERVER['base_path'] = '/';
|
||||
|
@ -72,7 +71,6 @@ function GetPathSetting($event, $context)
|
|||
$_SERVER['host'] = $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'];
|
||||
$_SERVER['referhost'] = explode('/', $event['headers']['referer'])[2];
|
||||
$_SERVER['HTTP_TRANSLATE'] = $event['headers']['translate'];//'f'
|
||||
$_SERVER['HTTP_IF_MODIFIED_SINCE'] = $event['headers']['if-modified-since'];
|
||||
$_SERVER['_APP_SHARE_DIR'] = '/var/share/CFF/processrouter';
|
||||
return $path;
|
||||
}
|
||||
|
|
|
@ -49,7 +49,6 @@ function GetPathSetting($event, $context)
|
|||
$host_name = $event['headers']['host'];
|
||||
$_SERVER['HTTP_HOST'] = $host_name;
|
||||
$path = path_format($event['pathParameters'][''].'/');
|
||||
$path = str_replace('+', '%2B', $path);
|
||||
$_SERVER['base_path'] = path_format($event['path'].'/');
|
||||
if ( $_SERVER['base_path'] == $path ) {
|
||||
$_SERVER['base_path'] = '/';
|
||||
|
@ -72,7 +71,6 @@ function GetPathSetting($event, $context)
|
|||
$_SERVER['host'] = $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'];
|
||||
$_SERVER['referhost'] = explode('/', $event['headers']['referer'])[2];
|
||||
$_SERVER['HTTP_TRANSLATE'] = $event['headers']['translate'];//'f'
|
||||
$_SERVER['HTTP_IF_MODIFIED_SINCE'] = $event['headers']['if-modified-since'];
|
||||
$_SERVER['_APP_SHARE_DIR'] = '/var/share/CFF/processrouter';
|
||||
return $path;
|
||||
}
|
||||
|
|
|
@ -56,8 +56,7 @@ function GetPathSetting($event, $context)
|
|||
//$_SERVER['REQUEST_SCHEME'] = $event['headers']['x-forwarded-proto'];
|
||||
$_SERVER['host'] = $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'];
|
||||
$_SERVER['referhost'] = explode('/', $event['headers']['referer'])[2];
|
||||
$_SERVER['HTTP_TRANSLATE'] = $event['headers']['translate'];//'f'
|
||||
$_SERVER['HTTP_IF_MODIFIED_SINCE'] = $event['headers']['if-modified-since'];
|
||||
$_SERVER['HTTP_TRANSLATE']==$event['headers']['translate'];//'f'
|
||||
$_SERVER['USER'] = 'qcloud';
|
||||
return $path;
|
||||
}
|
||||
|
|
|
@ -56,8 +56,7 @@ function GetPathSetting($event, $context)
|
|||
//$_SERVER['REQUEST_SCHEME'] = $event['headers']['x-forwarded-proto'];
|
||||
$_SERVER['host'] = $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'];
|
||||
$_SERVER['referhost'] = explode('/', $event['headers']['referer'])[2];
|
||||
$_SERVER['HTTP_TRANSLATE'] = $event['headers']['translate'];//'f'
|
||||
$_SERVER['HTTP_IF_MODIFIED_SINCE'] = $event['headers']['if-modified-since'];
|
||||
$_SERVER['HTTP_TRANSLATE']==$event['headers']['translate'];//'f'
|
||||
$_SERVER['USER'] = 'qcloud';
|
||||
return $path;
|
||||
}
|
||||
|
|
240
readme.md
240
readme.md
|
@ -1,206 +1,136 @@
|
|||
[中文readme](readme_cn.md)
|
||||
|
||||
# NOTICE:
|
||||
|
||||
The release is used as archive.
|
||||
|
||||
# NOTICE: the release is used as archive.
|
||||
# 注意:release只是用来存档的。
|
||||
Please read the descriptions of settings before raising an issue.
|
||||
|
||||
---
|
||||
请将设置中所有的设置项的说明都读一遍,有些问题就不用问了。
|
||||
|
||||
# Deploy to Heroku
|
||||
Official: https://heroku.com
|
||||
Demo: https://herooneindex.herokuapp.com/
|
||||
|
||||
### Official
|
||||
|
||||
https://heroku.com
|
||||
|
||||
### Demo
|
||||
|
||||
https://herooneindex.herokuapp.com/
|
||||
|
||||
### How to Install
|
||||
|
||||
How to Install:
|
||||
> ~~Click the button [](https://heroku.com/deploy) to Deploy a new app~~(`"We couldn't deploy your app because the source code violates the Salesforce Acceptable Use and External-Facing Services Policy."`)
|
||||
>
|
||||
> Star this project, then Fork, create a app in Heroku, then turn to the Deploy tab, "Deployment method" via "Connect GitHub", select your github fork.
|
||||
> Fork this project, create a heroku app, then turn to Deploy tab, deploy via connect to your github fork.
|
||||
|
||||
---
|
||||
|
||||
# Deploy to Glitch
|
||||
Official: https://glitch.com/
|
||||
Demo: https://onemanager.glitch.me/
|
||||
|
||||
### Official
|
||||
How to Install: New Project -> Import form Github -> paste "https://github.com/qkqpttgf/OneManager-php", after done, Show -> In a New Window.
|
||||
|
||||
https://glitch.com/
|
||||
|
||||
### Demo
|
||||
|
||||
https://onemanager.glitch.me/
|
||||
|
||||
### How to Install
|
||||
|
||||
[New Project] -> [Import form Github] -> paste "https://github.com/qkqpttgf/OneManager-php" , after done, [Show] -> [In a New Window].
|
||||
|
||||
---
|
||||
|
||||
# Deploy to Vercel
|
||||
Official: https://vercel.com/
|
||||
Demo: null
|
||||
Notice:
|
||||
> 1, you must wait 30-50s to make sure deploy READY after change config;
|
||||
> 2, Vercel limit 100 deploy every day.
|
||||
|
||||
### Official
|
||||
|
||||
https://vercel.com/
|
||||
|
||||
### Demo
|
||||
|
||||
https://onemanager-php.vercel.app/
|
||||
|
||||
### Notice
|
||||
|
||||
> 1. you must wait 30-50s to make sure deploy READY after change config;
|
||||
>
|
||||
> 2. Vercel limit 100 deploy every day.
|
||||
|
||||
### How to Install
|
||||
|
||||
https://scfonedrive.github.io/Vercel/Deploy.html .
|
||||
|
||||
---
|
||||
|
||||
# Deploy to Tencent Serverless Cloud Function (SCF)
|
||||
|
||||
### Official
|
||||
|
||||
https://cloud.tencent.com/product/scf
|
||||
|
||||
### DEMO
|
||||
|
||||
null
|
||||
|
||||
### How to Install
|
||||
|
||||
see CN readme.
|
||||
|
||||
----
|
||||
How to Install: https://scfonedrive.github.io/Vercel/Deploy.html .
|
||||
|
||||
|
||||
# Deploy to Huawei cloud Function Graph (FG)
|
||||
# Deploy to Tencent Serverless Cloud Function (SCF 腾讯无服务器云函数)
|
||||
Official: https://cloud.tencent.com/product/scf
|
||||
DEMO: 无
|
||||
注意:SCF新增限制,环境变量整体最大4KB,所以最多添加4个盘。
|
||||
|
||||
### Official
|
||||
How to Install:
|
||||
1,进入函数服务,上方选择地区,然后点击新建。
|
||||
2,输入函数名称,选择模板函数,在模糊搜索中输入onedrive,大小写随意,选择那个【获取onedrive信息.....】,点下一步,在代码界面不用动,直接点完成。
|
||||
3,点击触发管理,创建触发器,触发方式改成API网关触发,底下勾选启用集成响应,提交。
|
||||
4,在触发管理中可以看到一个 访问路径,访问它,开始安装。
|
||||
|
||||
https://console.huaweicloud.com/functiongraph/
|
||||
(重点:勾选集成响应)
|
||||
|
||||
### DEMO
|
||||
添加网盘时,SCF可能会反应不过来,不跳转到微软,导致添加失败,请不要删除这个盘,再添加一次相同标签的盘就可以了。
|
||||
|
||||
null
|
||||
|
||||
### How to Install
|
||||
# Deploy to Huawei cloud Function Graph (FG 华为云函数工作流)
|
||||
Official: https://console.huaweicloud.com/functiongraph/
|
||||
DEMO: 无
|
||||
注意:FG中,环境变量整体大小为2KB,所以最多添加2个盘(一个onedrive一个aliyundrive)。
|
||||
|
||||
see CN readme.
|
||||
How to Install:
|
||||
1,在函数列表,点右边创建函数
|
||||
2,输入名称,选择运行时语言为PHP7.3,点上传ZIP文件,选择文件,然后点右边的创建函数(这里的ZIP文件不能直接用从Github上下载的ZIP文件,要将它解压后,去掉外层文件夹后,再压缩为ZIP。)
|
||||
3,创建触发器:选API网关,安全认证选None,后端超时(毫秒)将5000改成30000,上面创建分组一下,其它的点点点
|
||||
4,访问触发器给的url,开始安装
|
||||
5,在触发器界面点触发器名称,跳到API网关管理,右边更多URL,可以添加自定义域名,自定义域名后发现还是要 xxxx.com/函数名 来访问,点上方的编辑,第1页不用改,点下一步,请求Path改成/,注意匹配模式是前缀匹配,Method为ANY,然后不用点下一步了,点立即完成,然后去发布生效
|
||||
|
||||
----
|
||||
|
||||
# Deploy to Aliyun Function Compute (FC)
|
||||
# Deploy to Aliyun Function Compute (FC 阿里云函数计算)
|
||||
Official: https://fc.console.aliyun.com/
|
||||
DEMO: 无
|
||||
|
||||
### Official:
|
||||
How to Install:
|
||||
1,新建函数 -- HTTP函数
|
||||
2,运行环境选择php7.2
|
||||
3,触发器认证方式选择anonymous,请求方式里面,点一下GET,再点一下POST,最终框框里面有这2个
|
||||
4,上传代码
|
||||
5,触发器中点进去,找到配置自定义域名,点击前往,创建,路径中填 /* ,其它下拉选择。
|
||||
6,访问你的域名,开始安装
|
||||
|
||||
https://fc.console.aliyun.com/
|
||||
|
||||
### DEMO
|
||||
# Deploy to Baidu Cloud Function Compute (CFC 百度云函数计算)
|
||||
Official: https://console.bce.baidu.com/cfc/#/cfc/functions
|
||||
DEMO: 无
|
||||
自定义域名需要另外使用API网关,并备案。
|
||||
|
||||
null
|
||||
How to Install:
|
||||
1,在函数列表,点创建函数
|
||||
2,创建方式改为空白函数,点下一步
|
||||
3,输入名称,选择运行时为PHP7.2,点下一步
|
||||
4,触发器:下拉选择HTTP触发器,URL路径填 /{filepath+} ,HTTP方法全选,身份验证:不验证,点提交
|
||||
5,进入代码编辑页,编辑类型改上传函数ZIP包,选择文件(这里的ZIP文件不能直接用从Github上下载的ZIP文件,要将它解压后,去掉外层文件夹后,再压缩为ZIP。),开始上传
|
||||
6,点击右边触发器,复制并访问提供的url,开始安装
|
||||
|
||||
### How to Install
|
||||
|
||||
see CN readme.
|
||||
|
||||
---
|
||||
|
||||
# Deploy to Baidu Cloud Function Compute (CFC)
|
||||
|
||||
### Official
|
||||
|
||||
https://console.bce.baidu.com/cfc/#/cfc/functions
|
||||
|
||||
### DEMO
|
||||
|
||||
null
|
||||
|
||||
### How to Install
|
||||
|
||||
see CN readme.
|
||||
|
||||
---
|
||||
|
||||
# Deploy to Virtual Private Server (VPS) or php host
|
||||
|
||||
### DEMO
|
||||
|
||||
null
|
||||
|
||||
### How to Install
|
||||
|
||||
# Deploy to Virtual Private Server (VPS 或空间)
|
||||
DEMO: 无
|
||||
How to Install:
|
||||
1.Start web service on your server (httpd or other), make sure you can visit it.
|
||||
|
||||
启动web服务器,确保你能访问到。
|
||||
2.Make the rewrite works, the rule is in .htaccess file, make sure any query redirect to index.php.
|
||||
|
||||
开启伪静态(重写)功能,规则在.htaccess文件中,ngnix从里面复制,我们的目的是不管访问什么都让index.php来处理。
|
||||
3.Upload code.
|
||||
|
||||
上传好代码。
|
||||
4.Change the file .data/config.php can be read&write (666 is suggested).
|
||||
|
||||
使web身份可读写代码中的.data/config.php文件,推荐chmod 666 .data/config.php。
|
||||
5.View the website in chrome or other.
|
||||
在浏览器中访问。
|
||||
|
||||
----
|
||||
|
||||
# Features
|
||||
|
||||
# Features 特性
|
||||
When downloading files, the program produce a direct url, visitor download files from MS OFFICE via the direct url, the server expend a few bandwidth in produce.
|
||||
|
||||
下载时,由程序解析出直链,浏览器直接从微软Onedrive服务器下载文件,服务器只消耗与微软通信的少量流量。
|
||||
When uploading files, the program produce a direct url, visitor upload files to MS OFFICE via the direct url, the server expend a few bandwidth in produce.
|
||||
|
||||
上传时,由程序生成上传url,浏览器直接向微软Onedrive的这个url上传文件,服务器只消耗与微软通信的少量流量。
|
||||
The XXX_path in setting is the path in Onedrive, not in url, program will find the path in Onedrive.
|
||||
|
||||
设置中的 XXX_path 是Onedrive里面的路径,并不是你url里面的,程序会去你Onedrive里面找这个路径。
|
||||
LOGO ICON: put your 'favicon.ico' in the path you showed, make sure xxxxx.com/favicon.ico can be visited.
|
||||
|
||||
网站图标:将favicon.ico文件放在你要展示的目录中,确保 xxxxx.com/favicon.ico 可以访问到。
|
||||
Program will show content of 'readme.md' & 'head.md'.
|
||||
|
||||
guest upload path, is a folder that the guest can upload files, but can not be list (exclude admin).
|
||||
|
||||
可以在文件列表显示head.md跟readme.md文件的内容。
|
||||
guest up path, is a folder that the guest can upload files, but can not be list (exclude admin).
|
||||
游客上传目录(也叫图床目录),是指定一个目录,让游客可以上传文件,不限格式,不限大小。这个目录里面的内容不列清单(除非管理登录)。
|
||||
If there is 'index.html' file, program will only show the content of 'index.html', not list the files.
|
||||
|
||||
如果目录中有index.html文件,只会输出显示html文件,不显示程序框架。
|
||||
Click 'EditTime' or 'Size', the list will sort by time or size, Click 'File' can resume sort.
|
||||
点击“时间”、“大小”,可以排序显示,点“文件”恢复原样。
|
||||
|
||||
----
|
||||
|
||||
# Functional files
|
||||
|
||||
# Functional files 功能性文件
|
||||
### favicon.ico
|
||||
|
||||
put it in the showing home folder of FIRST disk (maybe not root of onedrive).
|
||||
|
||||
put it in the showing home folder of FIRST disk (maybe not root of onedrive). 放在第一个盘的显示目录(不一定是onedrive根目录)。
|
||||
### index.html
|
||||
|
||||
show content of index.html as html.
|
||||
|
||||
### head.md
|
||||
|
||||
### readme.md
|
||||
|
||||
it will showed at top or bottom as markdown.
|
||||
|
||||
### head.omf
|
||||
|
||||
### foot.omf
|
||||
|
||||
it will showed at top or bottom as html (javascript works!).
|
||||
|
||||
----
|
||||
show content of index.html as html. 将index.html以静态网页显示出来。
|
||||
### head.md readme.md
|
||||
it will showed at top or bottom as markdown. 以MD语法显示在顶部或底部。
|
||||
### head.omf foot.omf
|
||||
it will showed at top or bottom as html (javascript works!). 以html显示在顶部或底部(可以跑js)。
|
||||
|
||||
# A cup of coffee
|
||||
|
||||
https://paypal.me/qkqpttgf
|
||||
|
||||
-----
|
||||
|
||||
# Chat
|
||||
|
||||
### Telegram Group
|
||||
|
||||
https://t.me/joinchat/I_RVc0bqxuxlT-d0cO7ozw
|
||||
QQ Group: 212088653 (请看完上面的中英双语再加群,谢谢!)
|
||||
Telegram Group: https://t.me/joinchat/I_RVc0bqxuxlT-d0cO7ozw
|
||||
|
|
246
readme_cn.md
246
readme_cn.md
|
@ -1,246 +0,0 @@
|
|||
[Readme EN](readme.md)
|
||||
|
||||
# 注意:
|
||||
|
||||
release只是当存档用的。
|
||||
|
||||
请将设置中所有的设置项的说明都读一遍,有些问题就不用问了。
|
||||
|
||||
---
|
||||
|
||||
# 部署到 Heroku
|
||||
|
||||
### 官网
|
||||
|
||||
https://heroku.com
|
||||
|
||||
### Demo
|
||||
|
||||
https://herooneindex.herokuapp.com/
|
||||
|
||||
### 安装
|
||||
|
||||
> 给这个项目点star,然后fork,在Heroku创建一个app,然后点进Deploy页,在"Deployment method"处点"Connect GitHub",选择你的fork。
|
||||
|
||||
---
|
||||
|
||||
# 部署到 Glitch
|
||||
|
||||
### 官网
|
||||
|
||||
https://glitch.com/
|
||||
|
||||
### Demo
|
||||
|
||||
https://onemanager.glitch.me/
|
||||
|
||||
### 安装
|
||||
|
||||
点 [New Project] -> 点 [Import form Github] -> 粘贴 "https://github.com/qkqpttgf/OneManager-php" ,结束后,左上角点 [Show] -> [In a New Window]。
|
||||
|
||||
---
|
||||
|
||||
# 部署到 Vercel
|
||||
|
||||
### 官网
|
||||
|
||||
https://vercel.com/
|
||||
|
||||
### Demo
|
||||
|
||||
https://onemanager-php.vercel.app/
|
||||
|
||||
### 注意
|
||||
|
||||
> 1. 每次更改配置后都要等 30-50s 来确保部署成功;
|
||||
>
|
||||
> 2. Vercel 每天限制 100 次部署。
|
||||
|
||||
### 安装(英文)
|
||||
|
||||
https://scfonedrive.github.io/Vercel/Deploy.html
|
||||
|
||||
---
|
||||
|
||||
# 部署到腾讯无服务器云函数 Serverless Cloud Function (SCF)
|
||||
|
||||
### 官网
|
||||
|
||||
https://cloud.tencent.com/product/scf
|
||||
|
||||
### DEMO
|
||||
|
||||
暂无
|
||||
|
||||
### 注意事项
|
||||
|
||||
SCF新增限制,环境变量整体最大4KB,所以最多添加4个盘(可以在安装时选择将配置保存在文件来避开限制)。
|
||||
|
||||
### 安装
|
||||
|
||||
1. 进入函数服务,上方选择地区,然后点击新建。
|
||||
|
||||
2. 输入函数名称,选择模板函数,在模糊搜索中输入onedrive,大小写随意,选择那个【获取onedrive信息.....】,点下一步,在代码界面不用动,直接点完成。
|
||||
|
||||
3. 点击触发管理,创建触发器,触发方式改成API网关触发,底下勾选启用集成响应,提交。
|
||||
|
||||
4. 在触发管理中可以看到一个 访问路径,访问它,开始安装。
|
||||
|
||||
(重点:**勾选集成响应**)
|
||||
|
||||
> **添加网盘时,SCF可能会反应不过来,不跳转到微软,导致添加失败,请不要删除这个盘,再添加一次相同标签的盘就可以了。**
|
||||
|
||||
----
|
||||
|
||||
|
||||
# 部署到华为云函数工作流 Function Graph (FG)
|
||||
|
||||
### 官网
|
||||
|
||||
https://console.huaweicloud.com/functiongraph/
|
||||
|
||||
### DEMO
|
||||
|
||||
暂无
|
||||
|
||||
### 注意事项
|
||||
|
||||
FG中,环境变量整体大小为2KB,所以最多添加2个盘(一个onedrive一个aliyundrive)(可以在安装时选择将配置保存在文件来避开限制)。
|
||||
|
||||
### 安装
|
||||
|
||||
1. 在函数列表,点右边创建函数
|
||||
2. 输入名称,选择运行时语言为PHP7.3,点上传ZIP文件,选择文件,然后点右边的创建函数(这里的ZIP文件不能直接用从Github上下载的ZIP文件,要将它解压后,去掉外层文件夹后,再压缩为ZIP。)
|
||||
3. 创建触发器:选API网关,安全认证选None,后端超时(毫秒)将5000改成30000,上面创建分组一下,其它的点点点
|
||||
4. 访问触发器给的url,开始安装
|
||||
5. 在【触发器界面】点【触发器名称】,跳到API网关管理,右边【更多URL】,可以添加自定义域名,自定义域名后发现还是要 xxxx.com/函数名 来访问,点上方的【编辑】,第1页不用改,点【下一步】,**请求Path改成/**,注意匹配模式是前缀匹配,Method为ANY,然后不用点下一步了,点【立即完成】,然后去【发布】生效
|
||||
|
||||
----
|
||||
|
||||
# 部署到阿里云函数计算 Function Compute (FC)
|
||||
|
||||
### 官网
|
||||
|
||||
https://fc.console.aliyun.com/
|
||||
|
||||
### DEMO
|
||||
|
||||
无
|
||||
|
||||
### 安装
|
||||
|
||||
1. 新建函数 -- HTTP函数
|
||||
2. 运行环境选择php7.2
|
||||
3. 触发器认证方式选择anonymous,请求方式里面,点一下GET,再点一下POST,最终框框里面有这2个
|
||||
4. 上传代码
|
||||
5. 触发器中点进去,找到配置自定义域名,点击前往,创建,路径中填 /* ,其它下拉选择。
|
||||
6. 访问你的域名,开始安装
|
||||
|
||||
---
|
||||
|
||||
# 部署到百度云函数计算 Cloud Function Compute (CFC)
|
||||
|
||||
### 官网
|
||||
|
||||
https://console.bce.baidu.com/cfc/#/cfc/functions
|
||||
|
||||
### DEMO
|
||||
|
||||
暂无
|
||||
|
||||
### 注意事项
|
||||
|
||||
**自定义域名需要另外使用API网关,并备案。**
|
||||
|
||||
### 安装
|
||||
|
||||
1. 在函数列表,点创建函数
|
||||
2. 创建方式改为空白函数,点下一步
|
||||
3. 输入名称,选择运行时为PHP7.2,点下一步
|
||||
4. 触发器:下拉选择HTTP触发器,URL路径填 /{filepath+} ,HTTP方法全选,身份验证:不验证,点提交
|
||||
5. 进入代码编辑页,编辑类型改上传函数ZIP包,选择文件(这里的ZIP文件不能直接用从Github上下载的ZIP文件,要将它解压后,去掉外层文件夹后,再压缩为ZIP。),开始上传
|
||||
6. 点击右边触发器,复制并访问提供的url,开始安装
|
||||
|
||||
---
|
||||
|
||||
# 部署到VPS (Virtual Private Server) 或 空间
|
||||
|
||||
### DEMO
|
||||
|
||||
暂无
|
||||
|
||||
### 安装
|
||||
|
||||
1. 启动web服务器,确保你能访问到。
|
||||
|
||||
2. 开启伪静态(重写)功能,规则在.htaccess文件中,ngnix从里面复制,我们的目的是不管访问什么都让index.php来处理。
|
||||
|
||||
3. 上传好代码。
|
||||
|
||||
4. 使web身份可读写代码中的.data/config.php文件,推荐chmod 666 .data/config.php。
|
||||
|
||||
5. 在浏览器中访问。
|
||||
|
||||
----
|
||||
|
||||
# 特性
|
||||
|
||||
下载时,由程序解析出直链,浏览器直接从微软Onedrive服务器下载文件,服务器只消耗与微软通信的少量流量。
|
||||
|
||||
上传时,由程序生成上传url,浏览器直接向微软Onedrive的这个url上传文件,服务器只消耗与微软通信的少量流量。
|
||||
|
||||
设置中的 XXX_path 是Onedrive里面的路径,并不是你url里面的,程序会去你Onedrive里面找这个路径。
|
||||
|
||||
网站图标:将favicon.ico文件放在你要展示的目录中,确保 xxxxx.com/favicon.ico 可以访问到。
|
||||
|
||||
可以在文件列表显示head.md跟readme.md文件的内容。
|
||||
|
||||
游客上传目录(也叫图床目录),是指定一个目录,让游客可以上传文件,不限格式,不限大小。这个目录里面的内容不列清单(除非管理登录)。
|
||||
|
||||
如果目录中有index.html文件,只会输出显示html文件,不显示程序框架。
|
||||
|
||||
点击“时间”、“大小”,可以排序显示,点“文件”恢复原样。
|
||||
|
||||
----
|
||||
|
||||
# 功能性文件
|
||||
|
||||
### favicon.ico
|
||||
|
||||
放在第一个盘的显示目录(不一定是onedrive根目录)。
|
||||
|
||||
### index.html
|
||||
|
||||
将index.html以静态网页显示出来。
|
||||
|
||||
### head.md
|
||||
|
||||
### readme.md
|
||||
|
||||
以MD语法显示在顶部或底部。
|
||||
|
||||
### head.omf
|
||||
|
||||
### foot.omf
|
||||
|
||||
以html显示在顶部或底部(可以跑js)。
|
||||
|
||||
----
|
||||
|
||||
# 捐赠
|
||||
|
||||
https://paypal.me/qkqpttgf
|
||||
|
||||
-----
|
||||
|
||||
# 群聊
|
||||
|
||||
**请看完上面的中英双语再加群,谢谢!**
|
||||
|
||||
### QQ 群:
|
||||
|
||||
212088653
|
||||
|
||||
### Telegram Group
|
||||
|
||||
https://t.me/joinchat/I_RVc0bqxuxlT-d0cO7ozw
|
|
@ -94,12 +94,12 @@
|
|||
</ul></li>
|
||||
<!--AdminEnd-->
|
||||
|
||||
<!--<select class="changelanguage" name="language" onchange="changelanguage(this.options[this.options.selectedIndex].value)">
|
||||
<select class="changelanguage" name="language" onchange="changelanguage(this.options[this.options.selectedIndex].value)">
|
||||
<option value="">Language</option>
|
||||
<!--SelectLanguageStart-->
|
||||
<option value="<!--SelectLanguageKey-->" <!--SelectLanguageSelected-->><!--SelectLanguageValue--></option>
|
||||
<!--SelectLanguageEnd-->
|
||||
</select>-->
|
||||
</select>
|
||||
</div>
|
||||
<!--NeedUpdateStart-->
|
||||
<div style='position:absolute;'><font color='red'><!--constStr@NeedUpdate--></font></div>
|
||||
|
@ -202,7 +202,6 @@
|
|||
<div id="txt">
|
||||
<!--AdminStart-->
|
||||
<form id="txt-form" action="" method="POST">
|
||||
<input name="_admin" type="hidden" value="">
|
||||
<a onclick="document.getElementById('txt-a').readOnly='';document.getElementById('txt-save').style.display='';document.getElementById('txt-editbutton').style.display='none';document.getElementById('txt-cancelbutton').style.display='';" id="txt-editbutton"><ion-icon name="create"></ion-icon><!--constStr@ClicktoEdit--></a>
|
||||
<a onclick="document.getElementById('txt-a').readOnly='readonly';document.getElementById('txt-save').style.display='none';document.getElementById('txt-editbutton').style.display='';document.getElementById('txt-cancelbutton').style.display='none';" id="txt-cancelbutton" style="display:none"><ion-icon name="close"></ion-icon><!--constStr@CancelEdit--></a>
|
||||
<a id="txt-save" style="display:none"><ion-icon name="save"></ion-icon><!--constStr@Save--></a>
|
||||
|
@ -210,12 +209,6 @@
|
|||
<textarea id="txt-a" name="editfile" readonly style="width: 100%; margin-top: 2px;" <!--AdminStart-->onchange="document.getElementById('txt-save').onclick=function(){document.getElementById('txt-form').submit();}"<!--AdminEnd--> ><!--TxtContent--></textarea>
|
||||
<!--AdminStart-->
|
||||
</form>
|
||||
<script>
|
||||
var inputAdminStorage = document.getElementsByName("_admin");
|
||||
for (i=0;i<inputAdminStorage.length;i++) {
|
||||
inputAdminStorage[i].value = localStorage.getItem("admin");
|
||||
}
|
||||
</script>
|
||||
<!--AdminEnd-->
|
||||
</div>
|
||||
<!--IstxtFileEnd-->
|
||||
|
@ -529,10 +522,7 @@
|
|||
<!--IsFileStart-->
|
||||
var $url = document.getElementById('url');
|
||||
if ($url) {
|
||||
//$url.innerHTML = location.protocol + '//' + location.host + $url.innerHTML;
|
||||
let url = location.href;
|
||||
url = url.substr(0, url.length-8);
|
||||
$url.innerHTML = url.replace(/&/g, '&amp;');
|
||||
$url.innerHTML = location.protocol + '//' + location.host + $url.innerHTML;
|
||||
$url.style.height = $url.scrollHeight + 'px';
|
||||
}
|
||||
<!--IsofficeFileStart-->
|
||||
|
@ -998,7 +988,7 @@
|
|||
delete uploading[upbigfilename];
|
||||
}
|
||||
}
|
||||
xhr1.send('upbigfilename='+ upbigfilename +'&filesize='+ file.size +'&filelastModified='+ file.lastModified +'&filemd5='+ filemd5 + '&_admin=' + localStorage.getItem("admin"));
|
||||
xhr1.send('upbigfilename='+ upbigfilename +'&filesize='+ file.size +'&filelastModified='+ file.lastModified +'&filemd5='+ filemd5);
|
||||
<!--GuestStart-->
|
||||
}
|
||||
}
|
||||
|
@ -1249,7 +1239,7 @@
|
|||
getuplink(i);
|
||||
}*/
|
||||
}
|
||||
xhr1.send('upbigfilename='+ upbigfilename +'&filesize='+ file.size +'&filelastModified='+ file.lastModified + '&filesha1=' + filesha1 + '&chunksize=' + chunksize + '&_admin=' + localStorage.getItem("admin"));
|
||||
xhr1.send('upbigfilename='+ upbigfilename +'&filesize='+ file.size +'&filelastModified='+ file.lastModified + '&filesha1=' + filesha1 + '&chunksize=' + chunksize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1335,7 +1325,7 @@
|
|||
}
|
||||
delete uploading[filename];
|
||||
}
|
||||
xhr1.send('uploadid=' + uploadid + '&fileid=' + fileid + '&etag=' + JSON.stringify(res['ETag']) + '&_admin=' + localStorage.getItem("admin"));
|
||||
xhr1.send('uploadid=' + uploadid + '&fileid=' + fileid + '&etag=' + JSON.stringify(res['ETag']));
|
||||
} else {
|
||||
var binary = this.result;
|
||||
var xhr = new XMLHttpRequest();
|
||||
|
@ -1406,7 +1396,7 @@
|
|||
}
|
||||
delete uploading[filename];
|
||||
}
|
||||
xhr1.send('uploadid=' + uploadid + '&fileid=' + fileid + '&etag=' + JSON.stringify(res['ETag']) + '&_admin=' + localStorage.getItem("admin"));
|
||||
xhr1.send('uploadid=' + uploadid + '&fileid=' + fileid + '&etag=' + JSON.stringify(res['ETag']));
|
||||
// uploadbuttonshow();
|
||||
} else {
|
||||
readblob(asize);
|
||||
|
@ -1449,7 +1439,7 @@
|
|||
var expd = new Date();
|
||||
expd.setTime(expd.getTime()+1000);
|
||||
var expires = "expires="+expd.toGMTString();
|
||||
document.cookie = "admin=; path=<!--base_path-->; "+expires;
|
||||
document.cookie = "admin=; path=/; "+expires;
|
||||
location.href = location.href;
|
||||
}
|
||||
/*for some mobile browser*/
|
||||
|
@ -1543,7 +1533,7 @@
|
|||
document.getElementById(str+'_div').style.display='none';
|
||||
document.getElementById('mask').style.display='none';
|
||||
}
|
||||
xhr.send(serializeForm(str+'_form') + '&_admin=' + localStorage.getItem("admin"));
|
||||
xhr.send(serializeForm(str+'_form'));
|
||||
return false;
|
||||
}
|
||||
function addelement(html) {
|
||||
|
|
|
@ -49,29 +49,14 @@
|
|||
.more-disk a{flex-grow: 1;text-align: center;font-size: 15px;padding:14px 20px;transition-duration: 0.4s;background-color: #f4f5f8; color: #353535;display: inline-block;}
|
||||
.more-disk a:hover, .more-disk a[now]{ background-color: rgb(79 116 220); color: white; }
|
||||
.list-table{width:100%;padding:0 20px 20px 20px;border-spacing:0}
|
||||
.list-table tr{height:2rem; line-height: 1.5rem;}
|
||||
.list-table tr{height:33px}
|
||||
.list-table tr[data-to]:hover{background: rgb(79 116 220);color:white;}
|
||||
.list-table tr[data-to]:hover a{color:white}
|
||||
.list-table tr:first-child{background:rgba(245,245,245,0)}
|
||||
.list-table tr[data-to]:hover .operate ul li a{color:black}
|
||||
.list-table tr ion-icon {vertical-align: middle; height: 2rem;}
|
||||
.list-table td,.list-table th{padding:0 10px;text-align:left}
|
||||
.list-table td.file a {vertical-align: middle;}
|
||||
.list-table .size,.list-table .updated_at{text-align:right}
|
||||
.updated_at{width:25%}
|
||||
.size{width:15%}
|
||||
.list-table tbody.grid-view {display: flex;flex-wrap: wrap;position: relative;width: 100%;grid-template: repeat(auto-fill, 100px) / repeat(auto-fill, minmax(100px, 50%));grid-auto-rows: 100px;}
|
||||
.list-table tbody.grid-view td, .list-table tbody.grid-view th {padding:0;}
|
||||
.list-table tbody.grid-view img {height: 150px;width: 100%;object-fit: cover;position:relative;}
|
||||
.list-table tbody.grid-view #tr0{width: 100%;height: 33px;background-color: unset !important;}
|
||||
.list-table tbody.grid-view tr {width: unset;height: 150px;background-color: #efefef;margin: 2px;position: relative;flex-grow: 1;min-width: 100px;}
|
||||
.list-table tbody.grid-view td.file {display: block;width: 100%;height: 100%;}
|
||||
.list-table tbody.grid-view td.file a {width: 100%;height: 100%;display: inline-block;position:relative}
|
||||
.list-table tbody.grid-view td.file a > span {position: absolute;left: 3px;}
|
||||
.list-table tbody.grid-view td.file .download {display: none;}
|
||||
.list-table tbody.grid-view td.file ion-icon{position: absolute;top: calc(50% - 25px);left: calc(50% - 25px);width: 50px;height: 50px;color: #0002}
|
||||
.list-table tbody.grid-view td.updated_at {position: absolute;bottom: 0px;height: 1.5em;overflow-y: hidden;width: 100%;background-image: linear-gradient(#ffffff00, #0000008f);color: #fffc;z-index: 3;}
|
||||
.list-table tbody.grid-view td.size {display: none;}
|
||||
.mask{position:absolute;left:0px;top:0px;width:100%;background-color:#000;filter:alpha(opacity=50);opacity:0.5;z-index:2;}
|
||||
<!--AdminStart-->
|
||||
#top-op {position: absolute;color: white;font-size: 12px;}
|
||||
|
@ -81,6 +66,7 @@
|
|||
body .active ul{position:absolute;display:inline-table;} /*for some mobile browser */
|
||||
.operate ul li{padding:7px;list-style:none;display:block;}
|
||||
.operate ul li:hover {background-color: #f4f5f8;}
|
||||
.list-table tr[data-to]:hover .operate ul li a{color:black}
|
||||
#tr0{height: 40px;}
|
||||
<!--AdminEnd-->
|
||||
.operatediv{position:absolute;border-radius: 8px;background-color:#ffffff;z-index:2;box-shadow: 5px 5px 10px 0 #00000033;padding: 15px 4px;}
|
||||
|
@ -691,39 +677,9 @@
|
|||
}
|
||||
<!--ReadmemdEnd-->
|
||||
<!--ShowThumbnailsStart-->
|
||||
var isGrid = false;
|
||||
var isthumbLoaded = false;
|
||||
function showthumbnails(obj) {
|
||||
|
||||
images = [<!--ImgExts-->];
|
||||
var files=document.getElementsByName('filelist');
|
||||
|
||||
if (document.getElementById('originalpic').checked==true){
|
||||
if(isGrid){
|
||||
var list_body = document.getElementById('list-table').firstElementChild
|
||||
list_body.classList.remove('grid-view')
|
||||
isGrid = false
|
||||
}
|
||||
}else {
|
||||
if(!isGrid){
|
||||
// turn to grid view
|
||||
var list_body = document.getElementById('list-table').firstElementChild
|
||||
list_body.classList.add('grid-view')
|
||||
isGrid = true
|
||||
if (isthumbLoaded) {
|
||||
return
|
||||
}else {
|
||||
isthumbLoaded = true
|
||||
}
|
||||
} else {
|
||||
var list_body = document.getElementById('list-table').firstElementChild
|
||||
list_body.classList.remove('grid-view')
|
||||
isGrid = false
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for ($i=0;$i<files.length;$i++) {
|
||||
str=files[$i].innerText;
|
||||
if (str.substr(-1)==' ') str=str.substr(0,str.length-1);
|
||||
|
@ -742,7 +698,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
// obj.disabled='disabled';
|
||||
obj.disabled='disabled';
|
||||
}
|
||||
function get_thumbnails_url(url, name, filea) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
|
@ -750,7 +706,7 @@
|
|||
xhr.send('');
|
||||
xhr.onload = function(e){
|
||||
if (xhr.status==200) {
|
||||
if (xhr.responseText!='') filea.innerHTML= '<span>' + filea.innerHTML + '</span>' + '<img src="'+xhr.responseText+'" alt="'+name+'">';
|
||||
if (xhr.responseText!='') filea.innerHTML='<img src="'+xhr.responseText+'" alt="'+name+'">';
|
||||
} else console.log(xhr.status+'\n'+xhr.responseText);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,12 @@
|
|||
<!--BackgroundMEnd-->
|
||||
<script type="text/javascript">if(window.console&&window.console.log){console.log("%c Onemoe Theme %c https://github.com/kizx/onemoe-theme ","color: #fff; margin: 1em 0; padding: 5px 0; background: #673ab7;","margin: 1em 0; padding: 5px 0; background: #efefef;")}</script>
|
||||
<!--customCss-->
|
||||
<style>
|
||||
|
||||
<style>.file button {display: none;}<style>
|
||||
<style>.changelanguage {display: none;}<style>
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
Loading…
Reference in New Issue