mirror of
https://github.com/Starlio-app/StarlioX.git
synced 2025-04-07 03:35:27 +01:00
Compare commits
94 commits
Author | SHA1 | Date | |
---|---|---|---|
4a0f274fa1 | |||
937d9a8c98 | |||
cb9af7cfb0 | |||
e9bafe6aeb | |||
56f80e4bd8 | |||
![]() |
4d80b32ed7 | ||
2ab473064a | |||
9c703f1a90 | |||
1d78c3c14c | |||
f05fb8c9d3 | |||
39786d6484 | |||
25122c505c | |||
cf4f126436 | |||
be8e190c73 | |||
b07e2d0f2c | |||
0fa390c8ee | |||
de77b44647 | |||
b72629c751 | |||
dfa190056e | |||
3b0db4509a | |||
d80a36b8ae | |||
3463c8af8c | |||
b9ffe9611e | |||
4bd541c995 | |||
9d32f773f4 | |||
372999e446 | |||
d5e73252fc | |||
0e6cc4b2ba | |||
2da22b7501 | |||
4c205cf747 | |||
73b3ff0147 | |||
3fcca9493c | |||
18ba77815f | |||
1362b0545f | |||
778c83e85d | |||
52c3f9c28e | |||
f10489ef75 | |||
ddc7c20cb3 | |||
4a93aa8304 | |||
8b5f5377d2 | |||
1927a7fbd7 | |||
7dd476344c | |||
4a56a14478 | |||
d6798feaaa | |||
38f26a21d5 | |||
72a86a7db9 | |||
1ed4859ced | |||
2ff004f14f | |||
c4c937f6d9 | |||
7190223458 | |||
f52d082e60 | |||
2fee6712b9 | |||
6bab27fa72 | |||
323d83b298 | |||
779f897027 | |||
69e150979f | |||
a1cd1f74ee | |||
eabb8e5bf0 | |||
9de2230067 | |||
0193e2c170 | |||
f9022a5182 | |||
d054fb63a9 | |||
5f41bfcc78 | |||
20a1bdb2b3 | |||
ae354ff5d1 | |||
9abfd9f864 | |||
365caaeed0 | |||
62aca28ad6 | |||
418a6c184c | |||
36c1a116dc | |||
79555722ef | |||
11643aebfc | |||
8a53f5bdb4 | |||
626ea105c9 | |||
3b23eedc21 | |||
d8bc09074c | |||
a5561d76e6 | |||
760459b7f2 | |||
990b3e741f | |||
91d66ec17f | |||
b2f57872a0 | |||
e02981644a | |||
d0c4b6a40d | |||
38837471df | |||
9858848a02 | |||
b2e397efb2 | |||
3a0e41a393 | |||
b0dbd88b3f | |||
8a90465b0e | |||
23c9f691e5 | |||
64c46a8c4c | |||
6a76481c6d | |||
a4f581883a | |||
0bcff38828 |
46 changed files with 2056 additions and 616 deletions
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
|
@ -1 +0,0 @@
|
|||
custom: ["redume.live"]
|
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
|
@ -8,29 +8,29 @@ assignees: ''
|
|||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. Linux, Debian]
|
||||
- Version [e.g. 10]
|
||||
- Graphical shell [e.g. GNOME]
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. Linux, Debian]
|
||||
- Version [e.g. 10]
|
||||
- Graphical shell [e.g. GNOME]
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. Galaxy Z Fold 2]
|
||||
- OS: [e.g. Android 12]
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. Galaxy Z Fold 2]
|
||||
- OS: [e.g. Android 12]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
|
|
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -1,7 +1,7 @@
|
|||
# Other
|
||||
|
||||
.idea
|
||||
logger.log
|
||||
/logs
|
||||
|
||||
# Database files
|
||||
|
||||
|
@ -13,7 +13,3 @@ logger.log
|
|||
*.exe
|
||||
*.msi
|
||||
*.syso
|
||||
winres/*
|
||||
wix/*
|
||||
wix.json
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ representative at an online or offline event.
|
|||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
https://t.me/Redddume.
|
||||
https://t.me/Redume.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
|
|
811
LICENSE
811
LICENSE
|
@ -1,201 +1,674 @@
|
|||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
1. Definitions.
|
||||
Preamble
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
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.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
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.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
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.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
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.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
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.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
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.
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
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.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
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.
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
0. Definitions.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
"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.
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
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.
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
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.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
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.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
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.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
1. Source Code.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
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.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
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.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
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.
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
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.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
2. Basic Permissions.
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
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.
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://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
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
13
NOTICE
13
NOTICE
|
@ -1,13 +0,0 @@
|
|||
Copyright 2022 Redume
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
91
README.md
91
README.md
|
@ -1,61 +1,57 @@
|
|||
<p align="center"><img src="web/static/image/icons/banner.png" alt="EveryNasa banner" title="EveryNasa"></p>
|
||||
<p align="center"><img src="web/static/image/icons/favicon.png" alt="Starlio"></p>
|
||||
<h2 align="center"> Amazing wallpaper straight from space! </h2>
|
||||
|
||||
The program takes a picture from the NASA [website](https://apod.nasa.gov/apod) every day
|
||||
and sets it as a background for your workspace.
|
||||
**<p align="center">This version of the project is no longer maintained. See another: https://github.com/Starlio-app/Starlio</p>**
|
||||
|
||||
---
|
||||
|
||||
| OS | Status | Latest version | Download |
|
||||
|---------|-------------|----------------|----------------------------------------------------------------------------------------------------------------|
|
||||
| Windows | Available | 2.1 | [.msi](https://github.com/Redume/EveryNasa/releases/download/v2.0/EveryNasa.msi) |
|
||||
| Linux | Available | 2.1 | [There is no installation file but there is a separate branch](https://github.com/Redume/EveryNasa/tree/linux) |
|
||||
| Android | Available | 1.2.1 | [Play Market](https://play.google.com/store/apps/details?id=ru.murzify.everynasa) |
|
||||
| MacOS | Unavailable | | |
|
||||
| iOS | Unavailable | | |
|
||||
> **Note**
|
||||
> This app is not official from NASA
|
||||
|
||||
| Platform | Status | Get in on |
|
||||
|----------|--------|--------------------------------------------------|
|
||||
| Windows | 🟡 | [Github][windows-download] |
|
||||
| Linux | 🟡 | [Github][linux-download] |
|
||||
| Android | 🟢 | [Google Play][google-play] / [RuStore][rustore]* |
|
||||
| MacOS | 🔴 | N/A |
|
||||
| iOS | 🔴 | N/A |
|
||||
|
||||
<details>
|
||||
<summary>Explanation of designations</summary>
|
||||
|
||||
#### 🟢 — Development for the platform is supported to date
|
||||
#### 🟡 — Development was earlier, but was discontinued
|
||||
#### 🔴 — Not available for this platform
|
||||
#### * — Loaded an old version, to get the current version it is better to install from [Google Play][google-play]
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
### Solution or answers to possible problems
|
||||
Any bugs / problems that are not covered by these questions, please open an [issue](https://github.com/Redume/EveryNasa/issues/new?assignees=&labels=bug&template=bug_report.md&title=Bug)
|
||||
[windows-download]: https://github.com/Starlio-app/StarlioX/releases/latest
|
||||
[linux-download]: https://github.com/Starlio-app/StarlioX/releases/download/v1.6/Starlio
|
||||
|
||||
<details>
|
||||
<summary>Windows</summary>
|
||||
<li>To make all functions work correctly, install the program anywhere except Program Files(x86) / Program Files</li>
|
||||
</details>
|
||||
[google-play]: https://play.google.com/store/apps/details?id=ru.murzify.everynasa
|
||||
[rustore]: https://apps.rustore.ru/app/ru.murzify.everynasa
|
||||
|
||||
### License. The project is under the [GPLv3](https://www.gnu.org/licenses/gpl-3.0.html) license.
|
||||
|
||||
<details>
|
||||
<summary>Linux</summary>
|
||||
```
|
||||
EveryNasa Copyright (C) 2022-2023 Redume
|
||||
StarlioX Copyright (C) 2023 Redume
|
||||
|
||||
- If you have a mistake with `ayatana-appindicator3-0.1`
|
||||
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.
|
||||
|
||||
<details>
|
||||
<summary><b>Debian / Ubuntu / Mint</b></summary>
|
||||
<details>
|
||||
<summary><b>KDE Plasma</b></summary>
|
||||
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.
|
||||
|
||||
```shell
|
||||
$ sudo apt install gir1.2-appindicator3-0.1
|
||||
```
|
||||
|
||||
</details>
|
||||
<details>
|
||||
<summary><b>GNOME</b></summary>
|
||||
|
||||
- Install the package
|
||||
```shell
|
||||
$ sudo apt install gnome-shell-extension-appindicator
|
||||
```
|
||||
|
||||
- Open `Tweaks`
|
||||
- Go to `Extensions`
|
||||
- Enable `Kstatusnotifieritem/appindicator support`
|
||||
</details>
|
||||
</details>
|
||||
</details>
|
||||
|
||||
### License
|
||||
This project is licensed under the Apache-2.0 License - see the [LICENSE](LICENSE) file for 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/>.
|
||||
```
|
||||
|
||||
### Third-party library licenses
|
||||
- [getlantern/systray](https://github.com/getlantern/systray) — [Apache-2.0](https://github.com/getlantern/systray/blob/master/LICENSE)
|
||||
|
@ -63,5 +59,8 @@ This project is licensed under the Apache-2.0 License - see the [LICENSE](LICENS
|
|||
- [go-ole/go-ole](https://github.com/go-ole/go-ole) — [MIT](https://github.com/go-ole/go-ole/blob/master/LICENSE)
|
||||
- [mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) — [MIT](https://github.com/mattn/go-sqlite3/blob/master/LICENSE)
|
||||
- [rodkranz/fetch](https://github.com/rodkranz/fetch) — [MIT](https://github.com/rodkranz/fetch/blob/master/LICENSE)
|
||||
- [shirou/gopsutil](https://github.com/shirou/gopsutil) — [BSD-3-Clause](https://github.com/shirou/gopsutil/blob/master/LICENSE)
|
||||
- [shirou/gopsutil](https://github.com/shirou/gopsutil) — [BSD-3](https://github.com/shirou/gopsutil/blob/master/LICENSE)
|
||||
- [skratchdot/open-golang](https://github.com/skratchdot/open-golang) — [MIT](https://github.com/skratchdot/open-golang/blob/master/LICENSE)
|
||||
- [twbs/bootstrap](https://github.com/twbs/bootstrap) — [MIT](https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
- [LottieFiles/lottie-player](https://github.com/LottieFiles/lottie-player) — [MIT](https://github.com/LottieFiles/lottie-player/blob/master/LICENSE)
|
||||
- [jquery/jquery](https://github.com/jquery/jquery) — [MIT](https://github.com/jquery/jquery/blob/main/LICENSE.txt)
|
||||
|
|
19
SECURITY.md
Normal file
19
SECURITY.md
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Use this section to tell people about which versions of your project are
|
||||
currently being supported with security updates.
|
||||
|
||||
| Version | Status |
|
||||
|---------|--------|
|
||||
| < 2.4 | ❌ |
|
||||
| 2.4 | ✔️ |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Use this section to tell people how to report a vulnerability.
|
||||
|
||||
Tell them where to go, how often they can expect to get an update on a
|
||||
reported vulnerability, what to expect if the vulnerability is accepted or
|
||||
declined, etc.
|
135
api/controllers/favorite.go
Normal file
135
api/controllers/favorite.go
Normal file
|
@ -0,0 +1,135 @@
|
|||
package controllers
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"github.com/Redume/Starlio/utils"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
var GetFavorites = func(c *fiber.Ctx) error {
|
||||
FavoriteTitle := c.Query("title")
|
||||
|
||||
type Favorite struct {
|
||||
Title string `json:"title"`
|
||||
Explanation string `json:"explanation"`
|
||||
Copyright string `json:"copyright"`
|
||||
Date string `json:"date"`
|
||||
URL string `json:"url"`
|
||||
HDURL string `json:"hdurl"`
|
||||
MediaType string `json:"media_type"`
|
||||
}
|
||||
|
||||
var title, explanation, copyright, date, url, hdurl, media_type string
|
||||
db := utils.GetDatabase()
|
||||
|
||||
if FavoriteTitle != "" {
|
||||
queryFavorites, err := db.Query("SELECT * FROM favorite WHERE title LIKE ?", FavoriteTitle)
|
||||
if err != nil {
|
||||
utils.Logger(err.Error())
|
||||
}
|
||||
|
||||
defer func(query *sql.Rows) {
|
||||
err := query.Close()
|
||||
if err != nil {
|
||||
utils.Logger(err.Error())
|
||||
}
|
||||
}(queryFavorites)
|
||||
|
||||
for queryFavorites.Next() {
|
||||
err := queryFavorites.Scan(&title, &explanation, ©right, &date, &url, &hdurl, &media_type)
|
||||
if err != nil {
|
||||
utils.Logger(err.Error())
|
||||
}
|
||||
|
||||
return c.JSON(fiber.Map{
|
||||
"title": title,
|
||||
"explanation": explanation,
|
||||
"copyright": copyright,
|
||||
"date": date,
|
||||
"url": url,
|
||||
"hdurl": hdurl,
|
||||
"media_type": media_type,
|
||||
})
|
||||
}
|
||||
} else {
|
||||
queryFavorite, err := db.Query("SELECT * FROM favorite")
|
||||
if err != nil {
|
||||
utils.Logger(err.Error())
|
||||
}
|
||||
|
||||
defer func(query *sql.Rows) {
|
||||
err := query.Close()
|
||||
if err != nil {
|
||||
utils.Logger(err.Error())
|
||||
}
|
||||
}(queryFavorite)
|
||||
|
||||
var favorites []Favorite
|
||||
for queryFavorite.Next() {
|
||||
err := queryFavorite.Scan(&title, &explanation, ©right, &date, &url, &hdurl, &media_type)
|
||||
if err != nil {
|
||||
utils.Logger(err.Error())
|
||||
}
|
||||
|
||||
favorites = append(favorites, Favorite{
|
||||
Title: title,
|
||||
Explanation: explanation,
|
||||
Copyright: copyright,
|
||||
Date: date,
|
||||
URL: url,
|
||||
HDURL: hdurl,
|
||||
MediaType: media_type})
|
||||
}
|
||||
|
||||
return c.JSON(favorites)
|
||||
}
|
||||
|
||||
return c.SendString("No favorites found")
|
||||
}
|
||||
|
||||
var AddFavorite = func(c *fiber.Ctx) error {
|
||||
title := c.FormValue("title")
|
||||
explanation := c.FormValue("explanation")
|
||||
copyright := c.FormValue("copyright")
|
||||
date := c.FormValue("date")
|
||||
url := c.FormValue("url")
|
||||
hdurl := c.FormValue("hdurl")
|
||||
media_type := c.FormValue("media_type")
|
||||
|
||||
if title == "" && explanation == "" && date == "" && url == "" && hdurl == "" && media_type == "" {
|
||||
utils.Respond(c, utils.Message(false, "All fields are required"))
|
||||
return nil
|
||||
}
|
||||
|
||||
db := utils.GetDatabase()
|
||||
|
||||
_, err := db.Exec("INSERT INTO favorite (title, explanation, copyright, date, url, hdurl, media_type) VALUES (?, ?, ?, ?, ?, ?, ?)",
|
||||
title,
|
||||
explanation,
|
||||
copyright,
|
||||
date,
|
||||
url,
|
||||
hdurl,
|
||||
media_type)
|
||||
|
||||
if err != nil {
|
||||
utils.Logger(err.Error())
|
||||
}
|
||||
|
||||
utils.Respond(c, utils.Message(true, "Favorite added"))
|
||||
return nil
|
||||
}
|
||||
|
||||
var DeleteFavorite = func(c *fiber.Ctx) error {
|
||||
title := c.FormValue("title")
|
||||
|
||||
db := utils.GetDatabase()
|
||||
|
||||
_, err := db.Exec("DELETE FROM favorite WHERE title = ?", title)
|
||||
if err != nil {
|
||||
utils.Logger(err.Error())
|
||||
}
|
||||
|
||||
utils.Respond(c, utils.Message(true, "Favorite deleted"))
|
||||
return nil
|
||||
}
|
|
@ -5,27 +5,26 @@ import (
|
|||
"os/user"
|
||||
"strings"
|
||||
|
||||
"github.com/Redume/EveryNasa/api/utils"
|
||||
"github.com/Redume/EveryNasa/functions"
|
||||
"github.com/Redume/Starlio/utils"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
var CreateLabel = func(c *fiber.Ctx) error {
|
||||
u, err := user.Current()
|
||||
if err != nil {
|
||||
functions.Logger(err.Error())
|
||||
utils.Logger(err.Error())
|
||||
}
|
||||
|
||||
dir, err := os.Getwd()
|
||||
if err != nil {
|
||||
functions.Logger(err.Error())
|
||||
utils.Logger(err.Error())
|
||||
}
|
||||
|
||||
dir = strings.Replace(dir, "\\", "\\\\", -1) + "\\EveryNasa.exe"
|
||||
dir = strings.Replace(dir, "\\", "\\\\", -1) + "\\Starlio.exe"
|
||||
|
||||
err = functions.CreateLnk(dir, strings.Replace(u.HomeDir, "\\", "\\\\", -1)+"\\Desktop\\EveryNasa.lnk")
|
||||
err = utils.CreateLnk(dir, strings.Replace(u.HomeDir, "\\", "\\\\", -1)+"\\Desktop\\Starlio.lnk")
|
||||
if err != nil {
|
||||
functions.Logger(err.Error())
|
||||
utils.Logger(err.Error())
|
||||
}
|
||||
|
||||
utils.Respond(c, utils.Message(true, "The shortcut was successfully created"))
|
||||
|
|
|
@ -2,39 +2,44 @@ package controllers
|
|||
|
||||
import (
|
||||
"database/sql"
|
||||
"github.com/Redume/EveryNasa/api/utils"
|
||||
"github.com/Redume/EveryNasa/functions"
|
||||
"github.com/Redume/Starlio/utils"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
|
||||
var SettingsGet = func(c *fiber.Ctx) error {
|
||||
db, err := sql.Open("sqlite3", "EveryNasa.db")
|
||||
db, err := sql.Open("sqlite3", "Starlio.db")
|
||||
if err != nil {
|
||||
functions.Logger(err.Error())
|
||||
utils.Logger(err.Error())
|
||||
}
|
||||
|
||||
querySettings, err := db.Query("SELECT * FROM settings")
|
||||
|
||||
if err != nil {
|
||||
functions.Logger(err.Error())
|
||||
utils.Logger(err.Error())
|
||||
}
|
||||
|
||||
defer func(query *sql.Rows) {
|
||||
err := query.Close()
|
||||
if err != nil {
|
||||
functions.Logger(err.Error())
|
||||
utils.Logger(err.Error())
|
||||
}
|
||||
}(querySettings)
|
||||
|
||||
var startup, wallpaper int
|
||||
var startup, wallpaper, save_logg int
|
||||
|
||||
for querySettings.Next() {
|
||||
err := querySettings.Scan(&startup, &wallpaper)
|
||||
err := querySettings.Scan(&startup, &wallpaper, &save_logg)
|
||||
if err != nil {
|
||||
functions.Logger(err.Error())
|
||||
utils.Logger(err.Error())
|
||||
}
|
||||
var data = map[string]interface{}{"startup": startup, "wallpaper": wallpaper}
|
||||
|
||||
var data = map[string]interface{}{
|
||||
"startup": startup,
|
||||
"wallpaper": wallpaper,
|
||||
"save_logg": save_logg,
|
||||
}
|
||||
|
||||
utils.Respond(c, data)
|
||||
}
|
||||
|
||||
|
@ -42,15 +47,16 @@ var SettingsGet = func(c *fiber.Ctx) error {
|
|||
}
|
||||
|
||||
var SettingsUpdate = func(c *fiber.Ctx) error {
|
||||
db, err := sql.Open("sqlite3", "EveryNasa.db")
|
||||
db, err := sql.Open("sqlite3", "Starlio.db")
|
||||
if err != nil {
|
||||
functions.Logger(err.Error())
|
||||
utils.Logger(err.Error())
|
||||
}
|
||||
|
||||
startup := c.FormValue("startup")
|
||||
wallpaper := c.FormValue("wallpaper")
|
||||
save_logg := c.FormValue("save_logg")
|
||||
|
||||
if startup == "" && wallpaper == "" {
|
||||
if startup == "" && wallpaper == "" && save_logg == "" {
|
||||
utils.Respond(c, utils.Message(false, "All fields are required."))
|
||||
return nil
|
||||
}
|
||||
|
@ -58,18 +64,25 @@ var SettingsUpdate = func(c *fiber.Ctx) error {
|
|||
if wallpaper != "" {
|
||||
_, err := db.Exec("UPDATE settings SET wallpaper = ?", wallpaper)
|
||||
if err != nil {
|
||||
functions.Logger(err.Error())
|
||||
utils.Logger(err.Error())
|
||||
}
|
||||
|
||||
if wallpaper == "1" {
|
||||
go functions.StartWallpaper()
|
||||
go utils.StartWallpaper()
|
||||
}
|
||||
}
|
||||
|
||||
if startup != "" {
|
||||
_, err := db.Exec("UPDATE settings SET startup = ?", startup)
|
||||
if err != nil {
|
||||
functions.Logger(err.Error())
|
||||
utils.Logger(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
if save_logg != "" {
|
||||
_, err := db.Exec("UPDATE settings SET save_logg = ?", save_logg)
|
||||
if err != nil {
|
||||
utils.Logger(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,8 +6,7 @@ import (
|
|||
"os/user"
|
||||
"strings"
|
||||
|
||||
"github.com/Redume/EveryNasa/api/utils"
|
||||
"github.com/Redume/EveryNasa/functions"
|
||||
"github.com/Redume/Starlio/utils"
|
||||
)
|
||||
|
||||
var Startup = func(c *fiber.Ctx) error {
|
||||
|
@ -32,19 +31,19 @@ var Startup = func(c *fiber.Ctx) error {
|
|||
var SetStartup = func(c *fiber.Ctx) error {
|
||||
u, err := user.Current()
|
||||
if err != nil {
|
||||
functions.Logger(err.Error())
|
||||
utils.Logger(err.Error())
|
||||
}
|
||||
|
||||
dir, err := os.Getwd()
|
||||
if err != nil {
|
||||
functions.Logger(err.Error())
|
||||
utils.Logger(err.Error())
|
||||
}
|
||||
|
||||
dir = strings.Replace(dir, "\\", "\\\\", -1) + "\\EveryNasa.exe"
|
||||
dir = strings.Replace(dir, "\\", "\\\\", -1) + "\\Starlio.exe"
|
||||
|
||||
err = functions.CreateLnk(dir, strings.Replace(u.HomeDir, "\\", "\\\\", -1)+"\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\EveryNasa.lnk")
|
||||
err = utils.CreateLnk(dir, strings.Replace(u.HomeDir, "\\", "\\\\", -1)+"\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\Starlio.lnk")
|
||||
if err != nil {
|
||||
functions.Logger(err.Error())
|
||||
utils.Logger(err.Error())
|
||||
}
|
||||
|
||||
utils.Respond(c, utils.Message(true, "The settings have been applied successfully."))
|
||||
|
@ -54,12 +53,12 @@ var SetStartup = func(c *fiber.Ctx) error {
|
|||
var RemoveStartup = func(c *fiber.Ctx) error {
|
||||
u, err := user.Current()
|
||||
if err != nil {
|
||||
functions.Logger(err.Error())
|
||||
utils.Logger(err.Error())
|
||||
}
|
||||
|
||||
err = os.Remove(strings.Replace(u.HomeDir, "\\", "\\\\", -1) + "\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\EveryNasa.lnk")
|
||||
err = os.Remove(strings.Replace(u.HomeDir, "\\", "\\\\", -1) + "\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\Starlio.lnk")
|
||||
if err != nil {
|
||||
functions.Logger(err.Error())
|
||||
utils.Logger(err.Error())
|
||||
}
|
||||
|
||||
utils.Respond(c, utils.Message(true, "The settings have been applied successfully."))
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
package controllers
|
||||
|
||||
import (
|
||||
"github.com/Redume/EveryNasa/api/utils"
|
||||
"github.com/Redume/EveryNasa/functions"
|
||||
"github.com/Redume/Starlio/utils"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/reujab/wallpaper"
|
||||
)
|
||||
|
@ -17,7 +16,7 @@ var WallpaperUpdate = func(c *fiber.Ctx) error {
|
|||
|
||||
err := wallpaper.SetFromURL(url)
|
||||
if err != nil {
|
||||
functions.Logger(err.Error())
|
||||
utils.Logger(err.Error())
|
||||
utils.Respond(c, utils.Message(false, "An error occurred while setting the wallpaper"))
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
package functions
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
|
||||
func Database() {
|
||||
db, err := sql.Open("sqlite3", "EveryNasa.db")
|
||||
if err != nil {
|
||||
Logger(err.Error())
|
||||
}
|
||||
|
||||
var existsSettings bool
|
||||
err = db.QueryRow("SELECT EXISTS(SELECT name FROM sqlite_master WHERE type='table' AND name='settings')").Scan(&existsSettings)
|
||||
|
||||
if err != nil {
|
||||
Logger(err.Error())
|
||||
}
|
||||
|
||||
if existsSettings == false {
|
||||
sqlTable := `
|
||||
CREATE TABLE IF NOT EXISTS settings (
|
||||
startup INTEGER DEFAULT 0,
|
||||
wallpaper INTEGER DEFAULT 0
|
||||
);`
|
||||
|
||||
_, err = db.Exec(sqlTable)
|
||||
if err != nil {
|
||||
Logger(err.Error())
|
||||
}
|
||||
|
||||
stmt, err := db.Prepare("INSERT INTO settings(startup, wallpaper) values(?,?)")
|
||||
if err != nil {
|
||||
Logger(err.Error())
|
||||
}
|
||||
|
||||
_, err = stmt.Exec(0, 0)
|
||||
if err != nil {
|
||||
Logger(err.Error())
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
package functions
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func Logger(text string) {
|
||||
if !FileExists("logger.log") {
|
||||
err := CreateFile("logger.log")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
f, err := os.OpenFile("logger.log", os.O_APPEND|os.O_WRONLY, 0600)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
now := time.Now()
|
||||
|
||||
_, file, line, ok := runtime.Caller(1)
|
||||
|
||||
if !ok {
|
||||
file = "???"
|
||||
}
|
||||
|
||||
dir, err := os.Getwd()
|
||||
if err != nil {
|
||||
Logger(err.Error())
|
||||
}
|
||||
|
||||
if strings.Contains(file, dir) {
|
||||
file = strings.Replace(file, dir, "", -1)
|
||||
}
|
||||
|
||||
var lineString string
|
||||
if ok {
|
||||
lineString = fmt.Sprintf("%d", line)
|
||||
}
|
||||
|
||||
_, err = f.Write([]byte(now.Format("Mon Jan 2 15:04:05 2006") + " | " + text + " [" + file + "] [" + lineString + "]\n"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func FileExists(name string) bool {
|
||||
if _, err := os.Stat(name); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func CreateFile(name string) error {
|
||||
fo, err := os.Create(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
err := fo.Close()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}()
|
||||
return nil
|
||||
}
|
29
go.mod
29
go.mod
|
@ -1,21 +1,21 @@
|
|||
module github.com/Redume/EveryNasa
|
||||
module github.com/Redume/Starlio
|
||||
|
||||
go 1.19
|
||||
|
||||
require (
|
||||
github.com/getlantern/systray v1.2.1
|
||||
github.com/go-ole/go-ole v1.2.6
|
||||
github.com/gofiber/fiber/v2 v2.39.0
|
||||
github.com/gofiber/fiber/v2 v2.43.0
|
||||
github.com/jasonlvhit/gocron v0.0.1
|
||||
github.com/mattn/go-sqlite3 v1.14.16
|
||||
github.com/reujab/wallpaper v0.0.0-20210630195606-5f9f655b3740
|
||||
github.com/rodkranz/fetch v1.2.0
|
||||
github.com/shirou/gopsutil/v3 v3.22.9
|
||||
github.com/shirou/gopsutil/v3 v3.23.2
|
||||
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/andybalholm/brotli v1.0.4 // indirect
|
||||
github.com/andybalholm/brotli v1.0.5 // indirect
|
||||
github.com/getlantern/context v0.0.0-20190109183933-c447772a6520 // indirect
|
||||
github.com/getlantern/errors v0.0.0-20190325191628-abdb3e3e36f7 // indirect
|
||||
github.com/getlantern/golog v0.0.0-20190830074920-4ef2e798c2d7 // indirect
|
||||
|
@ -23,22 +23,27 @@ require (
|
|||
github.com/getlantern/hidden v0.0.0-20190325191715-f02dbb02be55 // indirect
|
||||
github.com/getlantern/ops v0.0.0-20190325191751-d70cb0d6f85f // indirect
|
||||
github.com/go-stack/stack v1.8.0 // indirect
|
||||
github.com/klauspost/compress v1.15.0 // indirect
|
||||
github.com/google/uuid v1.3.0 // indirect
|
||||
github.com/klauspost/compress v1.16.3 // indirect
|
||||
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.16 // indirect
|
||||
github.com/mattn/go-isatty v0.0.17 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.14 // indirect
|
||||
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect
|
||||
github.com/philhofer/fwd v1.1.2 // indirect
|
||||
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
|
||||
github.com/rivo/uniseg v0.2.0 // indirect
|
||||
github.com/tklauser/go-sysconf v0.3.10 // indirect
|
||||
github.com/tklauser/numcpus v0.4.0 // indirect
|
||||
github.com/savsgio/dictpool v0.0.0-20221023140959-7bf2e61cea94 // indirect
|
||||
github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee // indirect
|
||||
github.com/tinylib/msgp v1.1.8 // indirect
|
||||
github.com/tklauser/go-sysconf v0.3.11 // indirect
|
||||
github.com/tklauser/numcpus v0.6.0 // indirect
|
||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||
github.com/valyala/fasthttp v1.40.0 // indirect
|
||||
github.com/valyala/fasthttp v1.45.0 // indirect
|
||||
github.com/valyala/tcplisten v1.0.0 // indirect
|
||||
github.com/yusufpapurcu/wmi v1.2.2 // indirect
|
||||
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect
|
||||
gopkg.in/ini.v1 v1.62.0 // indirect
|
||||
golang.org/x/net v0.8.0 // indirect
|
||||
golang.org/x/sys v0.6.0 // indirect
|
||||
gopkg.in/ini.v1 v1.66.2 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
)
|
||||
|
|
102
go.sum
102
go.sum
|
@ -1,5 +1,5 @@
|
|||
github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY=
|
||||
github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
|
||||
github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=
|
||||
github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
|
@ -23,27 +23,28 @@ github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiU
|
|||
github.com/go-redis/redis v6.15.5+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
|
||||
github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
|
||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||
github.com/gofiber/fiber/v2 v2.39.0 h1:uhWpYQ6EHN8J7FOPYbI2hrdBD/KNZBC5CjbuOd4QUt4=
|
||||
github.com/gofiber/fiber/v2 v2.39.0/go.mod h1:Cmuu+elPYGqlvQvdKyjtYsjGMi69PDp8a1AY2I5B2gM=
|
||||
github.com/gofiber/fiber/v2 v2.43.0 h1:yit3E4kHf178B60p5CQBa/3v+WVuziWMa/G2ZNyLJB0=
|
||||
github.com/gofiber/fiber/v2 v2.43.0/go.mod h1:mpS1ZNE5jU+u+BA4FbM+KKnUzJ4wzTK+FT2tG3tU+6I=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
|
||||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
||||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/jasonlvhit/gocron v0.0.1 h1:qTt5qF3b3srDjeOIR4Le1LfeyvoYzJlYpqvG7tJX5YU=
|
||||
github.com/jasonlvhit/gocron v0.0.1/go.mod h1:k9a3TV8VcU73XZxfVHCHWMWF9SOqgoku0/QlY2yvlA4=
|
||||
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
|
||||
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||
github.com/klauspost/compress v1.15.0 h1:xqfchp4whNFxn5A4XFyyYtitiWI8Hy5EW59jEwcyL6U=
|
||||
github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
|
||||
github.com/klauspost/compress v1.16.3 h1:XuJt9zzcnaz6a16/OU53ZjWp/v7/42WcR5t2a0PcNQY=
|
||||
github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
|
||||
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4=
|
||||
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
|
||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||
github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ=
|
||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
|
||||
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=
|
||||
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||
github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y=
|
||||
|
@ -53,6 +54,9 @@ github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+
|
|||
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw=
|
||||
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0=
|
||||
github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
|
||||
github.com/philhofer/fwd v1.1.2 h1:bnDivRJ1EWPjUIRXV5KfORO897HTbpFAQddBdE8t7Gw=
|
||||
github.com/philhofer/fwd v1.1.2/go.mod h1:qkPdfjR2SIEbspLqpe1tO4n5yICnr2DY7mqEx2tUTP0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw=
|
||||
|
@ -63,72 +67,108 @@ github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
|
|||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rodkranz/fetch v1.2.0 h1:Yw9E7EOfNbCSEdAfNGu7HXJYkqEj/nRG5GQcnc7M1RI=
|
||||
github.com/rodkranz/fetch v1.2.0/go.mod h1:ojApfh+3ll3N2GP5dvYLGlxOrLS1ke5IRqpOUS7XGf4=
|
||||
github.com/shirou/gopsutil/v3 v3.22.9 h1:yibtJhIVEMcdw+tCTbOPiF1VcsuDeTE4utJ8Dm4c5eA=
|
||||
github.com/shirou/gopsutil/v3 v3.22.9/go.mod h1:bBYl1kjgEJpWpxeHmLI+dVHWtyAwfcmSBLDsp2TNT8A=
|
||||
github.com/savsgio/dictpool v0.0.0-20221023140959-7bf2e61cea94 h1:rmMl4fXJhKMNWl+K+r/fq4FbbKI+Ia2m9hYBLm2h4G4=
|
||||
github.com/savsgio/dictpool v0.0.0-20221023140959-7bf2e61cea94/go.mod h1:90zrgN3D/WJsDd1iXHT96alCoN2KJo6/4x1DZC3wZs8=
|
||||
github.com/savsgio/gotils v0.0.0-20220530130905-52f3993e8d6d/go.mod h1:Gy+0tqhJvgGlqnTF8CVGP0AaGRjwBtXs/a5PA0Y3+A4=
|
||||
github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee h1:8Iv5m6xEo1NR1AvpV+7XmhI4r39LGNzwUL4YpMuL5vk=
|
||||
github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee/go.mod h1:qwtSXrKuJh/zsFQ12yEE89xfCrGKK63Rr7ctU/uCo4g=
|
||||
github.com/shirou/gopsutil/v3 v3.23.2 h1:PAWSuiAszn7IhPMBtXsbSCafej7PqUOvY6YywlQUExU=
|
||||
github.com/shirou/gopsutil/v3 v3.23.2/go.mod h1:gv0aQw33GLo3pG8SiWKiQrbDzbRY1K80RyZJ7V4Th1M=
|
||||
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA=
|
||||
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
||||
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
|
||||
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw=
|
||||
github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk=
|
||||
github.com/tklauser/numcpus v0.4.0 h1:E53Dm1HjH1/R2/aoCtXtPgzmElmn51aOkhCFSuZq//o=
|
||||
github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ=
|
||||
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
|
||||
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/tinylib/msgp v1.1.6/go.mod h1:75BAfg2hauQhs3qedfdDZmWAPcFMAvJE5b9rGOMufyw=
|
||||
github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0=
|
||||
github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw=
|
||||
github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM=
|
||||
github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI=
|
||||
github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms=
|
||||
github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4=
|
||||
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
||||
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||
github.com/valyala/fasthttp v1.40.0 h1:CRq/00MfruPGFLTQKY8b+8SfdK60TxNztjRMnH0t1Yc=
|
||||
github.com/valyala/fasthttp v1.40.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I=
|
||||
github.com/valyala/fasthttp v1.45.0 h1:zPkkzpIn8tdHZUrVa6PzYd0i5verqiPSkgTd3bSUcpA=
|
||||
github.com/valyala/fasthttp v1.45.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA=
|
||||
github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8=
|
||||
github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg=
|
||||
github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/net v0.0.0-20180801234040-f4c29de78a2a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc=
|
||||
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
|
||||
golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
|
||||
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab h1:2QkjZIsXupsJbJIdSjjUOgWK3aEtzyuh2mPt3l/CkeU=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU=
|
||||
gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/ini.v1 v1.66.2 h1:XfR1dOYubytKy4Shzc2LHrrGhU0lDCfDGG1yLPmpgsI=
|
||||
gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
|
|
47
main.go
47
main.go
|
@ -1,20 +1,22 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/Redume/EveryNasa/api/controllers"
|
||||
"github.com/Redume/EveryNasa/functions"
|
||||
"github.com/Redume/EveryNasa/web/page"
|
||||
"github.com/Redume/Starlio/api/controllers"
|
||||
"github.com/Redume/Starlio/utils"
|
||||
"github.com/getlantern/systray"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v2/middleware/cors"
|
||||
"github.com/skratchdot/open-golang/open"
|
||||
)
|
||||
|
||||
func main() {
|
||||
go functions.Database()
|
||||
go systray.Run(functions.Tray, functions.Quit)
|
||||
go functions.StartWallpaper()
|
||||
go open.Run("http://localhost:3000")
|
||||
go utils.Database()
|
||||
go systray.Run(utils.Tray, utils.Quit)
|
||||
go utils.StartWallpaper()
|
||||
|
||||
app := fiber.New()
|
||||
|
||||
app = fiber.New(fiber.Config{
|
||||
ErrorHandler: func(ctx *fiber.Ctx, err error) error {
|
||||
code := fiber.StatusInternalServerError
|
||||
|
@ -35,19 +37,34 @@ func main() {
|
|||
app.Use(cors.New())
|
||||
|
||||
app.Get("/", func(c *fiber.Ctx) error {
|
||||
return page.Gallery(c)
|
||||
con := utils.Connected()
|
||||
if con == false {
|
||||
return c.SendFile("./web/errors/500.html")
|
||||
}
|
||||
|
||||
return c.SendFile("./web/page/gallery.html")
|
||||
})
|
||||
app.Get("/settings", func(c *fiber.Ctx) error {
|
||||
return page.Settings(c)
|
||||
con := utils.Connected()
|
||||
if con == false {
|
||||
return c.SendFile("./web/errors/500.html")
|
||||
}
|
||||
|
||||
return c.SendFile("./web/page/settings.html")
|
||||
})
|
||||
app.Get("/about", func(c *fiber.Ctx) error {
|
||||
return page.About(c)
|
||||
return c.SendFile("./web/page/about.html")
|
||||
})
|
||||
app.Get("/favorite", func(c *fiber.Ctx) error {
|
||||
return c.SendFile("./web/page/favorite.html")
|
||||
})
|
||||
|
||||
api := app.Group("/api")
|
||||
|
||||
update := api.Group("/update")
|
||||
get := api.Group("/get")
|
||||
add := api.Group("/add")
|
||||
del := api.Group("/del")
|
||||
create := api.Group("/create")
|
||||
|
||||
update.Post("/settings", func(c *fiber.Ctx) error {
|
||||
|
@ -68,8 +85,16 @@ func main() {
|
|||
return controllers.SettingsGet(c)
|
||||
})
|
||||
|
||||
get.Get("/settings", func(c *fiber.Ctx) error {
|
||||
return controllers.SettingsGet(c)
|
||||
get.Get("/favorites", func(c *fiber.Ctx) error {
|
||||
return controllers.GetFavorites(c)
|
||||
})
|
||||
|
||||
add.Post("/favorite", func(c *fiber.Ctx) error {
|
||||
return controllers.AddFavorite(c)
|
||||
})
|
||||
|
||||
del.Post("/favorite", func(c *fiber.Ctx) error {
|
||||
return controllers.DeleteFavorite(c)
|
||||
})
|
||||
|
||||
err := app.Listen(":3000")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package functions
|
||||
package utils
|
||||
|
||||
import "net/http"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package functions
|
||||
package utils
|
||||
|
||||
import (
|
||||
"os"
|
74
utils/database.go
Normal file
74
utils/database.go
Normal file
|
@ -0,0 +1,74 @@
|
|||
package utils
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
|
||||
func Database() {
|
||||
db, err := sql.Open("sqlite3", "Starlio.db")
|
||||
if err != nil {
|
||||
Logger(err.Error())
|
||||
}
|
||||
|
||||
if !TableExists(db, "settings") {
|
||||
sqlTable := `
|
||||
CREATE TABLE IF NOT EXISTS settings (
|
||||
startup INTEGER DEFAULT 0,
|
||||
wallpaper INTEGER DEFAULT 0,
|
||||
save_logg INTEGER DEFAULT 1
|
||||
);`
|
||||
|
||||
_, err = db.Exec(sqlTable)
|
||||
if err != nil {
|
||||
Logger(err.Error())
|
||||
}
|
||||
|
||||
stmt, err := db.Prepare("INSERT INTO settings(startup, wallpaper, save_logg) values(?,?,?)")
|
||||
if err != nil {
|
||||
Logger(err.Error())
|
||||
}
|
||||
|
||||
_, err = stmt.Exec(0, 0, 1)
|
||||
if err != nil {
|
||||
Logger(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
if !TableExists(db, "favorite") {
|
||||
sqlTable := `
|
||||
CREATE TABLE IF NOT EXISTS favorite (
|
||||
title TEXT,
|
||||
explanation TEXT,
|
||||
copyright TEXT,
|
||||
date TEXT,
|
||||
url TEXT,
|
||||
hdurl TEXT,
|
||||
media_type TEXT
|
||||
);`
|
||||
|
||||
_, err = db.Exec(sqlTable)
|
||||
if err != nil {
|
||||
Logger(err.Error())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func GetDatabase() *sql.DB {
|
||||
db, err := sql.Open("sqlite3", "Starlio.db")
|
||||
if err != nil {
|
||||
Logger(err.Error())
|
||||
}
|
||||
|
||||
return db
|
||||
}
|
||||
|
||||
func TableExists(db *sql.DB, name string) bool {
|
||||
var exists bool
|
||||
err := db.QueryRow("SELECT EXISTS(SELECT name FROM sqlite_master WHERE type='table' AND name=?)", name).Scan(&exists)
|
||||
if err != nil {
|
||||
Logger(err.Error())
|
||||
}
|
||||
|
||||
return exists
|
||||
}
|
123
utils/logger.go
Normal file
123
utils/logger.go
Normal file
|
@ -0,0 +1,123 @@
|
|||
package utils
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/rodkranz/fetch"
|
||||
)
|
||||
|
||||
func Logger(text string) {
|
||||
now := time.Now()
|
||||
|
||||
file := string(now.Format("02.01.2006")) + ".log"
|
||||
|
||||
if getDatabase() == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
if !FileExists("logs") {
|
||||
err := CreateFolder("logs")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
if !FileExists("./logs/" + file) {
|
||||
err := CreateFile(file)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
f, err := os.OpenFile("logs/"+file, os.O_APPEND|os.O_WRONLY, 0600)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
_, file, line, ok := runtime.Caller(1)
|
||||
|
||||
if !ok {
|
||||
file = "???"
|
||||
}
|
||||
|
||||
dir, err := os.Getwd()
|
||||
if err != nil {
|
||||
Logger(err.Error())
|
||||
}
|
||||
|
||||
if strings.Contains(file, dir) {
|
||||
file = strings.Replace(file, dir, "", -1)
|
||||
}
|
||||
|
||||
var lineString string
|
||||
if ok {
|
||||
lineString = fmt.Sprintf("%d", line)
|
||||
}
|
||||
|
||||
_, err = f.Write([]byte(now.Format("15:04:05") + " | " + text + " [" + file + "] [" + lineString + "]\n"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func FileExists(name string) bool {
|
||||
if _, err := os.Stat(name); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func CreateFile(name string) error {
|
||||
file, err := os.Create("logs/" + name)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
defer func(file *os.File) {
|
||||
err := file.Close()
|
||||
if err != nil {
|
||||
|
||||
}
|
||||
}(file)
|
||||
return nil
|
||||
}
|
||||
|
||||
func CreateFolder(name string) error {
|
||||
err := os.Mkdir(name, 0755)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func getDatabase() int {
|
||||
client := fetch.NewDefault()
|
||||
res, err := client.Get("http://localhost:3000/api/get/settings", nil)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
body, err := res.ToString()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
type DatabaseStruct struct {
|
||||
Save_logg int `json:"save_logg"`
|
||||
}
|
||||
|
||||
var Database DatabaseStruct
|
||||
err = json.Unmarshal([]byte(body), &Database)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return Database.Save_logg
|
||||
}
|
|
@ -3,7 +3,6 @@ package utils
|
|||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/Redume/EveryNasa/functions"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
|
@ -15,6 +14,6 @@ func Respond(c *fiber.Ctx, data map[string]interface{}) {
|
|||
c.Set("Content-Type", "application/json")
|
||||
err := json.NewEncoder(c).Encode(data)
|
||||
if err != nil {
|
||||
functions.Logger(err.Error())
|
||||
Logger(err.Error())
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package functions
|
||||
package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
@ -11,8 +11,8 @@ import (
|
|||
|
||||
func Tray() {
|
||||
systray.SetIcon(GetIcon("web/static/image/icons/icon.ico"))
|
||||
systray.SetTitle("EveryNasa")
|
||||
systray.SetTooltip("EveryNasa")
|
||||
systray.SetTitle("Starlio")
|
||||
systray.SetTooltip("Starlio")
|
||||
ui := systray.AddMenuItem("Open UI", "Open UI")
|
||||
exit := systray.AddMenuItem("Quit", "Quit the whole app")
|
||||
|
||||
|
@ -30,7 +30,7 @@ func Tray() {
|
|||
}
|
||||
|
||||
func Quit() {
|
||||
err := KillProcess("EveryNasa.exe")
|
||||
err := KillProcess("Starlio.exe")
|
||||
if err != nil {
|
||||
Logger(err.Error())
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package functions
|
||||
package utils
|
||||
|
||||
import (
|
||||
"encoding/json"
|
|
@ -2,7 +2,7 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>EveryNasa</title>
|
||||
<title>Starlio</title>
|
||||
<link rel="icon" href="/image/icons/favicon.png">
|
||||
</head>
|
||||
<style>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>EveryNasa</title>
|
||||
<title>Starlio</title>
|
||||
<link rel="icon" href="/static/image/icons/favicon.png">
|
||||
<style>
|
||||
lottie-player {
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
package page
|
||||
|
||||
import (
|
||||
"github.com/Redume/EveryNasa/functions"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
func About(c *fiber.Ctx) error {
|
||||
con := functions.Connected()
|
||||
if con == false {
|
||||
return c.SendFile("./web/errors/500.html")
|
||||
}
|
||||
|
||||
return c.SendFile("./web/src/about.html")
|
||||
}
|
File diff suppressed because one or more lines are too long
97
web/page/favorite.html
Normal file
97
web/page/favorite.html
Normal file
|
@ -0,0 +1,97 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Starlio</title>
|
||||
|
||||
<link rel="icon" href="/static/image/icons/favicon.png">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="/static/style/gallery.css" type="text/css">
|
||||
<link rel="stylesheet" href="/static/style/favorite.css" type="text/css">
|
||||
</head>
|
||||
<nav class="navbar navbar-expand-lg bg-dark navbar-dark">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="/" draggable="false">
|
||||
<img src="/static/image/icons/favicon.png" width="45" alt="Starlio">
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNavDropdown">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/">Gallery</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" aria-current="page" href="/favorite">Favorite</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/settings">Settings</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/about">About</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="modal fade" id="WallpaperModal" aria-hidden="true" aria-labelledby="WallpaperModal" tabindex="-1" style="color: black;">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="WallpaperModale">
|
||||
<span class="d-inline-block text-truncate w-modal-title" style="max-width: 429px;"></span>
|
||||
</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body"></div>
|
||||
<div class="modal-footer">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<header class="header-row"></header>
|
||||
</div>
|
||||
<div class="preloader">
|
||||
<lottie-player src="https://assets4.lottiefiles.com/datafiles/a3YH0ragZcwfKHS/data.json" background="transparent" speed="1" style="width: 600px; height: 600px;" loop autoplay></lottie-player>
|
||||
</div>
|
||||
<body>
|
||||
<script src="https://code.jquery.com/jquery-3.6.1.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.min.js" integrity="sha384-7VPbUDkoPSGFnVtYi0QogXtr74QeVeeIs99Qfg5YCF+TidwNdjvaKZX19NZ/e6oz" crossorigin="anonymous"></script>
|
||||
<script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script>
|
||||
<script src="/static/scripts/gallery.js" type="application/javascript"></script>
|
||||
<script type="application/javascript">
|
||||
$(document).ready(function () {
|
||||
$.ajax({
|
||||
url: "http://localhost:3000/api/get/favorites",
|
||||
type: "GET",
|
||||
success: function(data) {
|
||||
console.log(data);
|
||||
if(data === null) {
|
||||
$(".preloader").hide();
|
||||
$("body").append(`
|
||||
<lottie-player id="star"
|
||||
src="https://assets2.lottiefiles.com/private_files/lf30_rcvcAS.json"
|
||||
background="transparent"
|
||||
autoplay
|
||||
speed="1">
|
||||
</lottie-player>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h1 class="text-center" style="color: white; margin-top: -5%">You don't have any favorites</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
|
||||
wallpaperLoad(data);
|
||||
},
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,15 +0,0 @@
|
|||
package page
|
||||
|
||||
import (
|
||||
"github.com/Redume/EveryNasa/functions"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
func Gallery(c *fiber.Ctx) error {
|
||||
con := functions.Connected()
|
||||
if con == false {
|
||||
return c.SendFile("./web/errors/500.html")
|
||||
}
|
||||
|
||||
return c.SendFile("./web/src/gallery.html")
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>EveryNasa</title>
|
||||
<title>Starlio</title>
|
||||
<link rel="icon" href="/static/image/icons/favicon.png">
|
||||
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
|
@ -16,7 +16,7 @@
|
|||
<nav class="navbar navbar-expand-lg bg-dark navbar-dark">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="/">
|
||||
<img src="/static/image/icons/favicon.png" width="45" alt="EveryNasa">
|
||||
<img src="/static/image/icons/favicon.png" width="45" alt="Starlio">
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
|
@ -26,6 +26,9 @@
|
|||
<li class="nav-item">
|
||||
<a class="nav-link active" aria-current="page" href="/">Gallery</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/favorite">Favorite</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/settings">Settings</a>
|
||||
</li>
|
||||
|
@ -60,8 +63,8 @@
|
|||
<div class="toast-container position-fixed bottom-0 end-0 p-3">
|
||||
<div id="liveToast" class="toast" role="alert" aria-live="assertive" aria-atomic="true">
|
||||
<div class="toast-header">
|
||||
<img src="/static/image/icons/favicon.png" class="rounded me-2" alt="EveryNasa" width="30">
|
||||
<strong class="me-auto" style="color: black;">EveryNasa</strong>
|
||||
<img src="/static/image/icons/favicon.png" class="rounded me-2" alt="Starlio" width="30">
|
||||
<strong class="me-auto" style="color: black;">Starlio</strong>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="toast-body" style="color: black;"></div>
|
||||
|
@ -70,6 +73,25 @@
|
|||
<script src="https://code.jquery.com/jquery-3.6.1.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.min.js" integrity="sha384-7VPbUDkoPSGFnVtYi0QogXtr74QeVeeIs99Qfg5YCF+TidwNdjvaKZX19NZ/e6oz" crossorigin="anonymous"></script>
|
||||
<script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/bodymovin/5.10.0/lottie.min.js"></script>
|
||||
<script src="/static/scripts/gallery.js" type="application/javascript"></script>
|
||||
<script type="application/javascript">
|
||||
startDate.setDate(startDate.getUTCDate() - 17);
|
||||
$(document).ready(function() {
|
||||
$.ajax({
|
||||
url: "https://api.nasa.gov/planetary/apod",
|
||||
type: "GET",
|
||||
data: {
|
||||
api_key: apiKEY,
|
||||
start_date: `${startDate.getUTCFullYear()}-${startDate.getUTCMonth() + 1}-${startDate.getUTCDate()}`,
|
||||
end_date: `${endDate.getUTCFullYear()}-${endDate.getUTCMonth() + 1}-${endDate.getUTCDate()}`,
|
||||
},
|
||||
success: function(data) {
|
||||
data.reverse();
|
||||
wallpaperLoad(data);
|
||||
},
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,15 +0,0 @@
|
|||
package page
|
||||
|
||||
import (
|
||||
"github.com/Redume/EveryNasa/functions"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
func Settings(c *fiber.Ctx) error {
|
||||
con := functions.Connected()
|
||||
if con == false {
|
||||
return c.SendFile("./web/errors/500.html")
|
||||
}
|
||||
|
||||
return c.SendFile("./web/src/settings.html")
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>EveryNasa</title>
|
||||
<title>Starlio</title>
|
||||
<link rel="icon" href="/static/image/icons/favicon.png">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="/static/style/settings.css" type="text/css">
|
||||
|
@ -11,7 +11,7 @@
|
|||
<nav class="navbar navbar-expand-lg bg-dark navbar-dark">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="/" draggable="false">
|
||||
<img src="/static/image/icons/favicon.png" width="45" alt="EveryNasa">
|
||||
<img src="/static/image/icons/favicon.png" width="45" alt="Starlio">
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
|
@ -21,6 +21,9 @@
|
|||
<li class="nav-item">
|
||||
<a class="nav-link" href="/">Gallery</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/favorite">Favorite</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" aria-current="page" href="/settings">Settings</a>
|
||||
</li>
|
||||
|
@ -44,25 +47,32 @@
|
|||
</div>
|
||||
<div class="settings">
|
||||
<p class="title"><strong>Auto-change of desktop wallpaper</strong></p>
|
||||
<p class="desc">EveryNasa will automatically change the desktop wallpaper at startup as well as every day.</p>
|
||||
<p class="desc">Starlio will automatically change the desktop wallpaper at startup as well as every day.</p>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="settings_autoSetWallpaperSwitch">
|
||||
<label class="form-check-label" for="settings_autoSetWallpaperTogglerName" id="settings_autoSetWallpaperTogglerName">Off</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="settings">
|
||||
<p class="title"><strong>Create log files</strong></p>
|
||||
<p class="desc">Starlio will create files in which errors will be written that will help developers when correcting errors.</p>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="settings_saveLoggSwitch">
|
||||
<label class="form-check-label" for="settings_saveLoggTogglerName" id="settings_saveLoggTogglerName">Off</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="settings">
|
||||
<p class="title"><strong>Create an application shortcut</strong></p>
|
||||
<p class="desc">EveryNasa will create an application shortcut on your desktop.</p>
|
||||
<p class="desc">Starlio will create an application shortcut on your desktop.</p>
|
||||
<button type="button" class="btn btn-outline-primary" id="createLabelButton">Create</button>
|
||||
</div>
|
||||
</header>
|
||||
</header>
|
||||
</div>
|
||||
<div class="toast-container position-fixed bottom-0 end-0 p-3">
|
||||
<div id="liveToast" class="toast" role="alert" aria-live="assertive" aria-atomic="true">
|
||||
<div class="toast-header">
|
||||
<img src="/static/image/icons/favicon.png" class="rounded me-2" alt="EveryNasa" width="30">
|
||||
<strong class="me-auto" style="color: black;">EveryNasa</strong>
|
||||
<img src="/static/image/icons/favicon.png" class="rounded me-2" alt="Starlio" width="30">
|
||||
<strong class="me-auto" style="color: black;">Starlio</strong>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="toast-body" style="color: black;"></div>
|
Binary file not shown.
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 22 KiB |
|
@ -1,30 +1,13 @@
|
|||
let today = new Date();
|
||||
let endDate = new Date();
|
||||
const startDate = new Date();
|
||||
const endDate = new Date();
|
||||
|
||||
const ids = [];
|
||||
let id = 0;
|
||||
|
||||
const apiKEY = "1gI9G84ZafKDEnrbydviGknReOGiVK9jqrQBE3et";
|
||||
|
||||
today.setDate(today.getDate() - 17);
|
||||
$(document).ready(function() {
|
||||
$.ajax({
|
||||
url: "https://api.nasa.gov/planetary/apod",
|
||||
type: "GET",
|
||||
data: {
|
||||
api_key: apiKEY,
|
||||
start_date: `${today.getUTCFullYear()}-${today.getUTCMonth() + 1}-${today.getUTCDate()}`,
|
||||
end_date: `${endDate.getUTCFullYear()}-${endDate.getUTCMonth() + 1}-${endDate.getUTCDate()}`,
|
||||
},
|
||||
success: function(data) {
|
||||
wallpaper(data);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
function wallpaper(data) {
|
||||
function wallpaperLoad(data) {
|
||||
$(".preloader").hide();
|
||||
data = data.reverse();
|
||||
|
||||
for (let i = 0; i < data.length; i++, id++) {
|
||||
ids.push(data[i]);
|
||||
|
@ -48,7 +31,7 @@ function wallpaper(data) {
|
|||
$(".header-row").append(`
|
||||
<div class="card">
|
||||
<a data-bs-toggle="modal" href="#WallpaperModal" role="button">
|
||||
<img src="${ids[id]['url']}" alt="${ids[id]['title']}" class="card-img-top" id="${id}">
|
||||
<img src="${ids[id]['url']}" alt="${ids[id]['title']}" class="card-img-top shimmer" id="${id}">
|
||||
</a>
|
||||
</div>
|
||||
`);
|
||||
|
@ -59,7 +42,7 @@ function wallpaper(data) {
|
|||
<img src="http://localhost:3000/static/image/placeholder.png"
|
||||
data-src="https://img.youtube.com/vi/${ids[id]['url'].slice(30, 41)}/maxresdefault.jpg"
|
||||
alt="${ids[id]['title']}"
|
||||
class="card-img-top"
|
||||
class="card-img-top shimmer"
|
||||
id="${id}">
|
||||
</a>
|
||||
</div>
|
||||
|
@ -67,8 +50,11 @@ function wallpaper(data) {
|
|||
}
|
||||
}
|
||||
|
||||
$(".card-img-top").on("load", function() {
|
||||
$(this).removeClass("shimmer");
|
||||
});
|
||||
|
||||
let button_modal = document.querySelector(".header-row");
|
||||
const button_modal = document.querySelector(".header-row");
|
||||
button_modal.addEventListener("click", function (event) {
|
||||
if (event.target === button_modal) {
|
||||
return;
|
||||
|
@ -81,28 +67,61 @@ function wallpaper(data) {
|
|||
let button = document.querySelector(".modal-footer");
|
||||
|
||||
if($(`img#${id}.card-img-top`).attr("src") !== "http://localhost:3000/static/image/placeholder.png") {
|
||||
button.innerHTML = `<button type="button" class="btn btn-primary" id="setWallpaper">Set Wallpaper</button>`;
|
||||
button.innerHTML = `<lottie-player id="favorite"
|
||||
src="https://assets2.lottiefiles.com/private_files/lf30_rcvcAS.json"
|
||||
background="transparent"
|
||||
speed="1">
|
||||
</lottie-player>
|
||||
<button type="button" class="btn btn-primary" id="setWallpaper">Set Wallpaper</button>
|
||||
`;
|
||||
} else {
|
||||
button.innerHTML = `<button type="button"
|
||||
class="btn"
|
||||
id="setWallpaper"
|
||||
disabled
|
||||
style="background-color: grey; color: white;">
|
||||
Set Wallpaper
|
||||
</button>`;
|
||||
button.innerHTML = `<lottie-player id="favorite"
|
||||
src="https://assets2.lottiefiles.com/private_files/lf30_rcvcAS.json"
|
||||
background="transparent"
|
||||
speed="1">
|
||||
</lottie-player>
|
||||
<button type="button"
|
||||
class="btn"
|
||||
id="setWallpaper"
|
||||
disabled
|
||||
style="background-color: grey; color: white;">
|
||||
Set Wallpaper
|
||||
</button>
|
||||
`;
|
||||
}
|
||||
|
||||
let setWallpaper = document.querySelector("#setWallpaper");
|
||||
const setWallpaper = document.querySelector("#setWallpaper");
|
||||
const favorite = document.querySelector("#favorite");
|
||||
|
||||
$.ajax({
|
||||
url: "http://localhost:3000/api/get/favorites",
|
||||
type: "GET",
|
||||
data: {
|
||||
title: ids[id]['title'],
|
||||
},
|
||||
success: function (data) {
|
||||
if (data !== "No favorites found") {
|
||||
favorite.setDirection(1);
|
||||
favorite.play();
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
ids[id]['copyright'] = ids[id]['copyright'] === undefined ? "NASA" : ids[id]['copyright'];
|
||||
|
||||
const explanation = ids[id]['explanation'].length > 200 ?
|
||||
ids[id]['explanation'].slice(0, 200) + "..." :
|
||||
ids[id]['explanation'];
|
||||
|
||||
if (ids[id]['media_type'] === "image") {
|
||||
title.innerHTML = `<h5 class="modal-title">${ids[id]['title']}</h5>`;
|
||||
img.innerHTML = `
|
||||
<img src="${ids[id]['url']}" alt="${ids[id]['title']}" class="card-img">
|
||||
<p><strong>Author:</strong> ${ids[id]['copyright']}</p>
|
||||
<p><strong>Date of publication:</strong> ${ids[id]['date']}</p>
|
||||
<p><strong>Explanation:</strong> ${ids[id]['explanation']}</p>
|
||||
<p><strong>Explanation:</strong> ${explanation}</p>
|
||||
|
||||
<button type="button" class="show-more btn btn-primary" id="show-more">Show more</button>
|
||||
`;
|
||||
|
||||
setWallpaper.addEventListener("click", function () {
|
||||
|
@ -120,13 +139,66 @@ function wallpaper(data) {
|
|||
|
||||
<p><strong>Author:</strong> ${ids[id]['copyright']}</p>
|
||||
<p><strong>Date of publication:</strong> ${ids[id]['date']}</p>
|
||||
<p><strong>Explanation:</strong> ${ids[id]['explanation']}</p>
|
||||
<p><strong>Explanation:</strong> ${explanation}</p>
|
||||
<button type="button" class="show-more btn btn-primary" id="show-more">Show more</button>
|
||||
`;
|
||||
|
||||
setWallpaper.addEventListener("click", function () {
|
||||
wallpaperUpdate(`https://img.youtube.com/vi/${ids[id]['url'].slice(30, 41)}/maxresdefault.jpg`);
|
||||
});
|
||||
}
|
||||
|
||||
favorite.addEventListener("click", function() {
|
||||
$.ajax({
|
||||
url: "http://localhost:3000/api/get/favorites",
|
||||
type: "GET",
|
||||
data: {
|
||||
title: ids[id]['title'],
|
||||
},
|
||||
success: function(data) {
|
||||
if (data === "No favorites found") {
|
||||
if (ids[id]['media_type'] === "image") {
|
||||
favoriteAdd(ids[id]['title'],
|
||||
ids[id]['explanation'],
|
||||
ids[id]['copyright'],
|
||||
ids[id]['date'],
|
||||
ids[id]['url'],
|
||||
ids[id]['hdurl'],
|
||||
ids[id]['media_type'],
|
||||
);
|
||||
} else {
|
||||
favoriteAdd(ids[id]['title'],
|
||||
ids[id]['explanation'],
|
||||
ids[id]['copyright'],
|
||||
ids[id]['date'],
|
||||
`https://img.youtube.com/vi/${ids[id]['url'].slice(30, 41)}/0.jpg`,
|
||||
`https://img.youtube.com/vi/${ids[id]['url'].slice(30, 41)}/maxresdefault.jpg`,
|
||||
ids[id]['media_type'],
|
||||
);
|
||||
}
|
||||
|
||||
favorite.setDirection(1);
|
||||
favorite.play()
|
||||
} else {
|
||||
favoriteRemove(ids[id]['title']);
|
||||
favorite.setDirection(-1);
|
||||
favorite.play();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
let showMore = document.querySelector("#show-more");
|
||||
showMore.addEventListener("click", function () {
|
||||
let explanation = document.querySelector(".modal-body p:nth-child(4)");
|
||||
if(showMore.innerHTML === "Show more") {
|
||||
explanation.innerHTML = `<strong>Explanation:</strong> ${ids[id]['explanation']}`;
|
||||
showMore.innerHTML = "Show less";
|
||||
} else {
|
||||
explanation.innerHTML = `<strong>Explanation:</strong> ${ids[id]['explanation'].length > 200 ? ids[id]['explanation'].slice(0, 200) + "..." : ids[id]['explanation']}`;
|
||||
showMore.innerHTML = "Show more";
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(window).scroll(function () {
|
||||
|
@ -134,7 +206,7 @@ function wallpaper(data) {
|
|||
$(".preloader").show();
|
||||
$(window).off("scroll");
|
||||
|
||||
today.setDate(today.getDate() - 1);
|
||||
startDate.setDate(startDate.getDate() - 1);
|
||||
|
||||
endDate.setDate(endDate.getDate() - 15);
|
||||
endDate.setMonth(endDate.getMonth() - 1);
|
||||
|
@ -144,10 +216,10 @@ function wallpaper(data) {
|
|||
data: {
|
||||
api_key: apiKEY,
|
||||
start_date: `${endDate.getUTCFullYear()}-${endDate.getUTCMonth() + 1}-${endDate.getUTCDate()}`,
|
||||
end_date: `${today.getUTCFullYear()}-${today.getUTCMonth() + 1}-${today.getUTCDate()}`,
|
||||
end_date: `${startDate.getUTCFullYear()}-${startDate.getUTCMonth() + 1}-${startDate.getUTCDate()}`,
|
||||
},
|
||||
success: function (data) {
|
||||
wallpaper(data);
|
||||
wallpaperLoad(data);
|
||||
$(window).on("scroll");
|
||||
},
|
||||
});
|
||||
|
@ -155,6 +227,10 @@ function wallpaper(data) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param url {String} Url of the image to be set as wallpaper
|
||||
*/
|
||||
|
||||
function wallpaperUpdate(url) {
|
||||
$.ajax({
|
||||
url: "http://localhost:3000/api/update/wallpaper",
|
||||
|
@ -170,3 +246,54 @@ function wallpaperUpdate(url) {
|
|||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param title {String} Title of the image
|
||||
* @param explanation {String} Explanation of the image
|
||||
* @param copyright {String} Author of the image
|
||||
* @param date {String} Date of publication
|
||||
* @param url {String} Url of the image
|
||||
* @param hdurl {String} Url of the image in high definition
|
||||
* @param media_type {String} Type of media
|
||||
*/
|
||||
|
||||
function favoriteAdd(title, explanation, copyright, date, url, hdurl, media_type) {
|
||||
$.ajax({
|
||||
url: "http://localhost:3000/api/add/favorite",
|
||||
type: "POST",
|
||||
data: {
|
||||
title: title,
|
||||
explanation: explanation,
|
||||
date: date,
|
||||
url: url,
|
||||
hdurl: hdurl,
|
||||
media_type: media_type,
|
||||
},
|
||||
success: function (data) {
|
||||
$(".toast-body").text(data.message);
|
||||
let toastLiveExample = document.getElementById('liveToast');
|
||||
let toast = new bootstrap.Toast(toastLiveExample);
|
||||
toast.show();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param title {String} Title of the image
|
||||
*/
|
||||
|
||||
function favoriteRemove(title) {
|
||||
$.ajax({
|
||||
url: "http://localhost:3000/api/del/favorite",
|
||||
type: "POST",
|
||||
data: {
|
||||
title: title,
|
||||
},
|
||||
success: function (data) {
|
||||
$(".toast-body").text(data.message);
|
||||
let toastLiveExample = document.getElementById('liveToast');
|
||||
let toast = new bootstrap.Toast(toastLiveExample);
|
||||
toast.show();
|
||||
},
|
||||
});
|
||||
}
|
|
@ -5,22 +5,25 @@ $(document).ready(async function() {
|
|||
const $wallpaperSwitch = $("#settings_autoSetWallpaperSwitch");
|
||||
const $wallpaperSwitchTogglerName = $("#settings_autoSetWallpaperTogglerName");
|
||||
|
||||
$.ajax({
|
||||
url: "http://localhost:3000/api/get/settings",
|
||||
type: "GET",
|
||||
success: function(data) {
|
||||
if (data["wallpaper"] === 1) {
|
||||
$wallpaperSwitch.attr("checked", "true");
|
||||
$wallpaperSwitchTogglerName.text("On");
|
||||
}
|
||||
if (data["startup"] === 1) {
|
||||
$startupSwitch.attr("checked", "true");
|
||||
$startupSwitchTogglerName.text("On");
|
||||
}
|
||||
},
|
||||
const $loggingSwitch = $("#settings_saveLoggSwitch");
|
||||
const $loggingSwitchTogglerName = $("#settings_saveLoggTogglerName");
|
||||
|
||||
getSettings().then((data) => {
|
||||
if (data["wallpaper"] === 1) {
|
||||
$wallpaperSwitch.attr("checked", "true");
|
||||
$wallpaperSwitchTogglerName.text("On");
|
||||
}
|
||||
if (data["startup"] === 1) {
|
||||
$startupSwitch.attr("checked", "true");
|
||||
$startupSwitchTogglerName.text("On");
|
||||
}
|
||||
if (data["save_logg"] === 1) {
|
||||
$loggingSwitch.attr("checked", "true");
|
||||
$loggingSwitchTogglerName.text("On");
|
||||
}
|
||||
});
|
||||
|
||||
$wallpaperSwitch.click(async function() {
|
||||
$wallpaperSwitch.click(async function () {
|
||||
$.ajax({
|
||||
url: "http://localhost:3000/api/get/settings",
|
||||
type: "GET",
|
||||
|
@ -33,7 +36,7 @@ $(document).ready(async function() {
|
|||
"wallpaper": 0,
|
||||
},
|
||||
success: function (data) {
|
||||
if(data["status"]) {
|
||||
if (data["status"]) {
|
||||
$wallpaperSwitchTogglerName.text("Off");
|
||||
$wallpaperSwitch.removeAttr("checked");
|
||||
|
||||
|
@ -51,7 +54,7 @@ $(document).ready(async function() {
|
|||
"wallpaper": 1,
|
||||
},
|
||||
success: function (data) {
|
||||
if(data["status"]) {
|
||||
if (data["status"]) {
|
||||
$wallpaperSwitchTogglerName.text("On");
|
||||
$wallpaperSwitch.attr("checked", "true");
|
||||
|
||||
|
@ -66,8 +69,7 @@ $(document).ready(async function() {
|
|||
})
|
||||
});
|
||||
|
||||
|
||||
$startupSwitch.click(async function() {
|
||||
$startupSwitch.click(async function () {
|
||||
$.ajax({
|
||||
url: "http://localhost:3000/api/get/settings",
|
||||
type: "GET",
|
||||
|
@ -105,6 +107,51 @@ $(document).ready(async function() {
|
|||
|
||||
$startupSwitchTogglerName.text("On");
|
||||
$startupSwitch.attr("checked", "true");
|
||||
toast(data.message);
|
||||
} else {
|
||||
toast("Failed to apply settings.");
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
$loggingSwitch.click(async function () {
|
||||
$.ajax({
|
||||
url: "http://localhost:3000/api/get/settings",
|
||||
type: "GET",
|
||||
success: function (data) {
|
||||
if (data["save_logg"] === 1) {
|
||||
$.ajax({
|
||||
url: "http://localhost:3000/api/update/settings",
|
||||
type: "POST",
|
||||
data: {
|
||||
"save_logg": 0,
|
||||
},
|
||||
success: function (data) {
|
||||
if (data["status"]) {
|
||||
$loggingSwitchTogglerName.text("Off");
|
||||
$loggingSwitch.removeAttr("checked");
|
||||
|
||||
toast(data.message);
|
||||
} else {
|
||||
toast("Failed to apply settings.");
|
||||
}
|
||||
},
|
||||
});
|
||||
} else {
|
||||
$.ajax({
|
||||
url: "http://localhost:3000/api/update/settings",
|
||||
type: "POST",
|
||||
data: {
|
||||
"save_logg": 1,
|
||||
},
|
||||
success: function (data) {
|
||||
if (data["status"]) {
|
||||
$loggingSwitchTogglerName.text("On");
|
||||
$loggingSwitch.attr("checked", "true");
|
||||
|
||||
toast(data.message);
|
||||
} else {
|
||||
|
@ -119,6 +166,10 @@ $(document).ready(async function() {
|
|||
});
|
||||
|
||||
function toast(message) {
|
||||
if (message === null) {
|
||||
return "Required parameter 'message' is missing.";
|
||||
}
|
||||
|
||||
$(".toast-body").text(message);
|
||||
let toastLiveExample = document.getElementById('liveToast');
|
||||
let toast = new bootstrap.Toast(toastLiveExample);
|
||||
|
@ -126,6 +177,10 @@ function toast(message) {
|
|||
}
|
||||
|
||||
function editStartup(i) {
|
||||
if (i !== 1 || i !== 0 || i === null) {
|
||||
return "Required parameter 'i' is missing.";
|
||||
}
|
||||
|
||||
return $.ajax({
|
||||
url: "http://localhost:3000/api/update/startup",
|
||||
type: "POST",
|
||||
|
@ -134,3 +189,10 @@ function editStartup(i) {
|
|||
},
|
||||
});
|
||||
}
|
||||
|
||||
function getSettings() {
|
||||
return $.ajax({
|
||||
url: "http://localhost:3000/api/get/settings",
|
||||
type: "GET",
|
||||
});
|
||||
}
|
9
web/static/style/favorite.css
Normal file
9
web/static/style/favorite.css
Normal file
|
@ -0,0 +1,9 @@
|
|||
body {
|
||||
background-color: #131313;
|
||||
}
|
||||
|
||||
lottie-player {
|
||||
width: 30%;
|
||||
height: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
|
@ -1,32 +1,64 @@
|
|||
.card {
|
||||
border-radius: 2%;
|
||||
min-width: 350px;
|
||||
max-width: 400px;
|
||||
height: 200px;
|
||||
overflow: hidden;
|
||||
margin: 10px;
|
||||
background-color: #131313;
|
||||
border-radius: 34px;
|
||||
width: 359px;
|
||||
height: 237px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.header-row {
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
grid-template-rows: repeat(1, 1fr);
|
||||
grid-gap: 40px;
|
||||
padding: 10px;
|
||||
margin-left: -100px;
|
||||
}
|
||||
|
||||
.card-img-top {
|
||||
object-fit: none;
|
||||
object-position: center;
|
||||
min-width: 120%;
|
||||
min-height: 120%;
|
||||
|
||||
}
|
||||
|
||||
.card-img {
|
||||
border-radius: 16px;
|
||||
}
|
||||
|
||||
lottie-player {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
background-color: #131313;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.shimmer {
|
||||
display: inline-block;
|
||||
color: #333333;
|
||||
-webkit-mask: linear-gradient(-60deg, #000 30%, #0005, #000 70%) right/386% 100%;
|
||||
background-repeat: no-repeat;
|
||||
animation: shimmer 2.5s infinite;
|
||||
filter: blur(50px)
|
||||
}
|
||||
|
||||
@keyframes shimmer {
|
||||
100% {-webkit-mask-position: left}
|
||||
}
|
||||
|
||||
#show-more {
|
||||
background-color: #212529;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 16px;
|
||||
padding: 10px;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.modal-body p {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
|
@ -35,3 +67,26 @@ lottie-player {
|
|||
z-index: 100;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
#favorite {
|
||||
width: 130px;
|
||||
height: 130px;
|
||||
margin: -17px;
|
||||
}
|
||||
|
||||
#favorite:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#favorite:active {
|
||||
transform: scale(0.9);
|
||||
}
|
||||
|
||||
#setWallpaper:disabled {
|
||||
cursor: unset;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.btn-close{
|
||||
background-color: white;
|
||||
}
|
|
@ -23,3 +23,14 @@
|
|||
#createLabelButton {
|
||||
margin-left: -17.6em;
|
||||
}
|
||||
|
||||
.form-check-input {
|
||||
position: relative;
|
||||
left: 5px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.form-check-label {
|
||||
margin-left: 5px;
|
||||
margin-top: 2.2px;
|
||||
}
|
BIN
winres/icon.png
Normal file
BIN
winres/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
60
winres/winres.json
Normal file
60
winres/winres.json
Normal file
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
"RT_GROUP_ICON": {
|
||||
"APP": {
|
||||
"0000": [
|
||||
"icon.png"
|
||||
]
|
||||
}
|
||||
},
|
||||
"RT_MANIFEST": {
|
||||
"#1": {
|
||||
"0409": {
|
||||
"identity": {
|
||||
"name": "Starlio",
|
||||
"version": "2.3.3"
|
||||
},
|
||||
"description": "Automatic space wallpaper from Nasa",
|
||||
"minimum-os": "win10",
|
||||
"execution-level": "",
|
||||
"ui-access": false,
|
||||
"auto-elevate": false,
|
||||
"dpi-awareness": "system",
|
||||
"disable-theming": false,
|
||||
"disable-window-filtering": false,
|
||||
"high-resolution-scrolling-aware": false,
|
||||
"ultra-high-resolution-scrolling-aware": false,
|
||||
"long-path-aware": false,
|
||||
"printer-driver-isolation": false,
|
||||
"gdi-scaling": false,
|
||||
"segment-heap": false,
|
||||
"use-common-controls-v6": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"RT_VERSION": {
|
||||
"#1": {
|
||||
"0000": {
|
||||
"fixed": {
|
||||
"file_version": "2.3.2",
|
||||
"product_version": "2.3.2"
|
||||
},
|
||||
"info": {
|
||||
"0409": {
|
||||
"Comments": "",
|
||||
"CompanyName": "Redume",
|
||||
"FileDescription": "",
|
||||
"FileVersion": "3.2.1",
|
||||
"InternalName": "Starlio",
|
||||
"LegalCopyright": "Redume",
|
||||
"LegalTrademarks": "",
|
||||
"OriginalFilename": "Starlio.exe",
|
||||
"PrivateBuild": "",
|
||||
"ProductName": "Starlio",
|
||||
"ProductVersion": "2.3.2",
|
||||
"SpecialBuild": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
50
wix.json
Normal file
50
wix.json
Normal file
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
"product": "Starlio",
|
||||
"company": "Redume",
|
||||
"license": "LICENSE",
|
||||
"upgrade-code": "4165e562-ab60-4ac2-b27b-df2d62548dd9",
|
||||
"files": {
|
||||
"guid": "c68b679d-8199-4036-8ead-d509fad132c8",
|
||||
"items": [
|
||||
"Starlio.exe",
|
||||
"NOTICE"
|
||||
]
|
||||
},
|
||||
"directories": [
|
||||
"api",
|
||||
"web",
|
||||
"utils"
|
||||
],
|
||||
"env": {
|
||||
"guid": "24554370-7366-4725-8509-7aebb35da25a",
|
||||
"vars": [
|
||||
{
|
||||
"name": "PATH",
|
||||
"value": "[INSTALLDIR]",
|
||||
"permanent": "no",
|
||||
"system": "no",
|
||||
"action": "set",
|
||||
"part": "last"
|
||||
}
|
||||
]
|
||||
},
|
||||
"shortcuts": {
|
||||
"guid": "f2fb0dac-ddda-4c8e-bba4-3eb377150cde",
|
||||
"items": [
|
||||
{
|
||||
"name": "Starlio",
|
||||
"description": "Automatic space wallpaper from NASA",
|
||||
"target": "[INSTALLDIR]Starlio.exe",
|
||||
"wdir": "INSTALLDIR",
|
||||
"arguments": "",
|
||||
"icon": "web/static/image/icons/icon.ico"
|
||||
}
|
||||
]
|
||||
},
|
||||
"choco": {
|
||||
"description": "Automatic space wallpaper from NASA",
|
||||
"project-url": "https://github.com/Redume/Starlio",
|
||||
"tags": "Wallpaper, NASA, go, auto-wallpaper",
|
||||
"license-url": "https://github.com/Redume/Starlio/blob/main/NOTICE"
|
||||
}
|
||||
}
|
35
wix/LicenseAgreementDlg_HK.wxs
Normal file
35
wix/LicenseAgreementDlg_HK.wxs
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<UI>
|
||||
<Dialog Id="LicenseAgreementDlg_HK" Width="370" Height="270" Title="!(loc.LicenseAgreementDlg_Title)">
|
||||
<Control Id="LicenseAcceptedCheckBox" Type="CheckBox" X="20" Y="207" Width="330" Height="18" CheckBoxValue="1" Property="LicenseAccepted" Text="!(loc.LicenseAgreementDlgLicenseAcceptedCheckBox)" />
|
||||
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
|
||||
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)">
|
||||
<Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">CostingComplete = 1</Publish>
|
||||
<Condition Action="disable">
|
||||
<![CDATA[LicenseAccepted <> "1"]]>
|
||||
</Condition>
|
||||
<Condition Action="enable">LicenseAccepted = "1"</Condition>
|
||||
</Control>
|
||||
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
|
||||
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
|
||||
</Control>
|
||||
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.LicenseAgreementDlgBannerBitmap)" />
|
||||
<Control Id="LicenseText" Type="ScrollableText" X="20" Y="60" Width="330" Height="140" Sunken="yes" TabSkip="no">
|
||||
{{if gt (.License | len) 0}}
|
||||
<Text SourceFile="{{.License}}" />
|
||||
{{end}}
|
||||
</Control>
|
||||
<Control Id="Print" Type="PushButton" X="112" Y="243" Width="56" Height="17" Text="!(loc.WixUIPrint)">
|
||||
<Publish Event="DoAction" Value="WixUIPrintEula">1</Publish>
|
||||
</Control>
|
||||
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
|
||||
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
|
||||
<Control Id="Description" Type="Text" X="25" Y="23" Width="340" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.LicenseAgreementDlgDescription)" />
|
||||
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.LicenseAgreementDlgTitle)" />
|
||||
</Dialog>
|
||||
</UI>
|
||||
</Fragment>
|
||||
</Wix>
|
62
wix/WixUI_HK.wxs
Normal file
62
wix/WixUI_HK.wxs
Normal file
|
@ -0,0 +1,62 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<UI Id="WixUI_HK">
|
||||
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
|
||||
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
|
||||
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
|
||||
|
||||
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
|
||||
<Property Id="WixUI_Mode" Value="InstallDir" />
|
||||
|
||||
<DialogRef Id="BrowseDlg" />
|
||||
<DialogRef Id="DiskCostDlg" />
|
||||
<DialogRef Id="ErrorDlg" />
|
||||
<DialogRef Id="FatalError" />
|
||||
<DialogRef Id="FilesInUse" />
|
||||
<DialogRef Id="MsiRMFilesInUse" />
|
||||
<DialogRef Id="PrepareDlg" />
|
||||
<DialogRef Id="ProgressDlg" />
|
||||
<DialogRef Id="ResumeDlg" />
|
||||
<DialogRef Id="UserExit" />
|
||||
|
||||
<!-- Make sure to include custom dialogs in the installer database via a DialogRef command,
|
||||
especially if they are not included explicitly in the publish chain below -->
|
||||
<DialogRef Id="LicenseAgreementDlg_HK" />
|
||||
|
||||
<Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath" Order="3">1</Publish>
|
||||
<Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4">
|
||||
<![CDATA[WIXUI_INSTALLDIR_VALID<>"1"]]>
|
||||
</Publish>
|
||||
|
||||
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
|
||||
|
||||
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" {{if gt (.License | len) 0}} Value="LicenseAgreementDlg_HK" {{else}} Value="InstallDirDlg" {{end}}>NOT Installed</Publish>
|
||||
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
|
||||
|
||||
<Publish Dialog="LicenseAgreementDlg_HK" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
|
||||
<Publish Dialog="LicenseAgreementDlg_HK" Control="Next" Event="NewDialog" Value="InstallDirDlg">LicenseAccepted = "1"</Publish>
|
||||
|
||||
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg_HK">1</Publish>
|
||||
<Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
|
||||
<Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
|
||||
<Publish Dialog="InstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3">
|
||||
<![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]>
|
||||
</Publish>
|
||||
<Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
|
||||
|
||||
<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
|
||||
<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
|
||||
|
||||
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed</Publish>
|
||||
|
||||
<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
|
||||
|
||||
<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
|
||||
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
|
||||
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
|
||||
</UI>
|
||||
|
||||
<UIRef Id="WixUI_Common" />
|
||||
</Fragment>
|
||||
</Wix>
|
115
wix/product.wxs
Normal file
115
wix/product.wxs
Normal file
|
@ -0,0 +1,115 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<?if $(sys.BUILDARCH)="x86" ?>
|
||||
<?define Program_Files="ProgramFilesFolder" ?>
|
||||
<?elseif $(sys.BUILDARCH)="x64" ?>
|
||||
<?define Program_Files="ProgramFiles64Folder" ?>
|
||||
<?else ?>
|
||||
<?error Unsupported value of sys.BUILDARCH=$(sys.BUILDARCH) ?>
|
||||
<?endif ?>
|
||||
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
|
||||
<Product Id="*" UpgradeCode="{{.UpgradeCode}}" Name="{{.Product}}" Version="{{.VersionOk}}" Manufacturer="{{.Company}}" Language="1033">
|
||||
|
||||
<Package InstallerVersion="200" Compressed="yes" Comments="Windows Installer Package" InstallScope="perMachine" />
|
||||
|
||||
<Media Id="1" Cabinet="product.cab" EmbedCab="yes" />
|
||||
|
||||
<Upgrade Id="{{.UpgradeCode}}">
|
||||
<UpgradeVersion Minimum="{{.VersionOk}}" OnlyDetect="yes" Property="NEWERVERSIONDETECTED" />
|
||||
<UpgradeVersion Minimum="0.0.0" Maximum="{{.VersionOk}}" IncludeMinimum="yes" IncludeMaximum="no" Property="OLDERVERSIONBEINGUPGRADED" />
|
||||
</Upgrade>
|
||||
<Condition Message="A newer version of this software is already installed.">NOT NEWERVERSIONDETECTED</Condition>
|
||||
|
||||
<Directory Id="TARGETDIR" Name="SourceDir">
|
||||
|
||||
<Directory Id="$(var.Program_Files)">
|
||||
<Directory Id="INSTALLDIR" Name="{{.Product}}">
|
||||
{{if gt (.Files.Items | len) 0}}
|
||||
<Component Id="ApplicationFiles" Guid="{{.Files.GUID}}">
|
||||
{{range $i, $e := .Files.Items}}
|
||||
<File Id="ApplicationFile{{$i}}" Source="{{$e}}" />
|
||||
{{end}}
|
||||
</Component>
|
||||
{{end}}
|
||||
{{if gt (.Directories | len) 0}}
|
||||
{{range $i, $e := .Directories}}
|
||||
<Directory Id="APPDIR{{$i}}" Name="{{$e}}" />
|
||||
{{end}}
|
||||
{{end}}
|
||||
</Directory>
|
||||
</Directory>
|
||||
{{if gt (.Env.Vars | len) 0}}
|
||||
<Component Id="ENVS" Guid="{{.Env.GUID}}">
|
||||
{{range $i, $e := .Env.Vars}}
|
||||
<Environment Id="ENV{{$i}}" Name="{{$e.Name}}" Value="{{$e.Value}}" Permanent="{{$e.Permanent}}" Part="{{$e.Part}}" Action="{{$e.Action}}" System="{{$e.System}}" />
|
||||
{{end}}
|
||||
</Component>
|
||||
{{end}}
|
||||
|
||||
{{if gt (.Shortcuts.Items | len) 0}}
|
||||
<Directory Id="ProgramMenuFolder">
|
||||
<Directory Id="ProgramMenuSubfolder" Name="{{.Product}}">
|
||||
<Component Id="ApplicationShortcuts" Guid="{{.Shortcuts.GUID}}">
|
||||
{{range $i, $e := .Shortcuts.Items}}
|
||||
<Shortcut Id="ApplicationShortcut{{$i}}" Name="{{$e.Name}}" Description="{{$e.Description}}" Target="{{$e.Target}}" WorkingDirectory="{{$e.WDir}}" {{if gt ($e.Arguments | len) 0}} Arguments="{{$e.Arguments}}" {{end}}>
|
||||
{{if gt ($e.Icon | len) 0}}
|
||||
<Icon Id="Icon{{$i}}" SourceFile="{{$e.Icon}}" />
|
||||
{{end}}
|
||||
</Shortcut>
|
||||
<RegistryValue Root="HKCU" Key="Software\{{$.Company}}\{{$.Product}}" Name="installed{{$i}}" Type="integer" Value="1" KeyPath="yes" />
|
||||
{{end}}
|
||||
<RemoveFolder Id="ProgramMenuSubfolder" On="uninstall" />
|
||||
</Component>
|
||||
</Directory>
|
||||
</Directory>
|
||||
{{end}}
|
||||
</Directory>
|
||||
{{range $i, $e := .InstallHooks}}
|
||||
<SetProperty Id="CustomInstallExec{{$i}}" Value="{{$e.CookedCommand}}" Before="CustomInstallExec{{$i}}" Sequence="execute" />
|
||||
<CustomAction Id="CustomInstallExec{{$i}}" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="deferred" Return="check" Impersonate="no" />
|
||||
{{end}}
|
||||
{{range $i, $e := .UninstallHooks}}
|
||||
<SetProperty Id="CustomUninstallExec{{$i}}" Value="{{$e.CookedCommand}}" Before="CustomUninstallExec{{$i}}" Sequence="execute" />
|
||||
<CustomAction Id="CustomUninstallExec{{$i}}" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="deferred" Return="check" Impersonate="no" />
|
||||
{{end}}
|
||||
<InstallExecuteSequence>
|
||||
<RemoveExistingProducts After="InstallValidate" />
|
||||
{{range $i, $e := .InstallHooks}}
|
||||
<Custom Action="CustomInstallExec{{$i}}" After="{{if eq $i 0}}InstallFiles{{else}}CustomInstallExec{{dec $i}}{{end}}">NOT Installed AND NOT REMOVE</Custom>
|
||||
{{end}}
|
||||
{{range $i, $e := .UninstallHooks}}
|
||||
<Custom Action="CustomUninstallExec{{$i}}" After="{{if eq $i 0}}InstallInitialize{{else}}CustomUninstallExec{{dec $i}}{{end}}">REMOVE ~= "ALL"</Custom>
|
||||
{{end}}
|
||||
</InstallExecuteSequence>
|
||||
|
||||
<Feature Id="DefaultFeature" Level="1">
|
||||
{{if gt (.Env.Vars | len) 0}}
|
||||
<ComponentRef Id="ENVS" />
|
||||
{{end}}
|
||||
{{if gt (.Files.Items | len) 0}}
|
||||
<ComponentRef Id="ApplicationFiles" />
|
||||
{{end}}
|
||||
{{if gt (.Shortcuts.Items | len) 0}}
|
||||
<ComponentRef Id="ApplicationShortcuts" />
|
||||
{{end}}
|
||||
{{range $i, $e := .Directories}}
|
||||
<ComponentGroupRef Id="AppFiles{{$i}}" />
|
||||
{{end}}
|
||||
</Feature>
|
||||
|
||||
<UI>
|
||||
<!-- Define the installer UI -->
|
||||
<UIRef Id="WixUI_HK" />
|
||||
</UI>
|
||||
|
||||
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
|
||||
|
||||
<!-- this should help to propagate env var changes -->
|
||||
<CustomActionRef Id="WixBroadcastEnvironmentChange" />
|
||||
|
||||
</Product>
|
||||
|
||||
</Wix>
|
||||
|
Loading…
Add table
Reference in a new issue