Compare commits

16 Commits

Author SHA1 Message Date
𝓜𝓪𝓬𝓮™
a7647f3c9b refactor: Update asset paths in header and footer for consistency and improved resource loading 2026-04-02 13:34:36 +02:00
𝓜𝓪𝓬𝓮™
0b4f57ed02 feat: Update footer with new "Privacy Policy" link for enhanced compliance and user awareness 2026-04-02 12:05:06 +02:00
𝓜𝓪𝓬𝓮™
9a213bdcc0 feat: Enhance product descriptions and call-to-action for VPC, VPS, Mail Gateway, and Webhosting services 2026-04-02 12:01:35 +02:00
𝓜𝓪𝓬𝓮™
3717a3248d feat: Add "Widerrufsbelehrung" link to footer for improved user information 2026-04-02 10:30:47 +02:00
986c57328d README.md aktualisiert 2026-04-01 10:36:19 +00:00
𝓜𝓪𝓬𝓮™
603044f2e4 Update frontend link in README.md 2026-03-20 11:23:50 +01:00
TheOnlyMace
bf5a87e672 deploy: Produktions-Update 2026-01-18 - Performance Improvements and Bug Fixes 2026-02-01 15:39:36 +01:00
TheOnlyMace
8a76070418 deploy: Produktions-Update 2026-01-17 2026-01-17 00:28:42 +01:00
TheOnlyMace
f65c1d29d3 refactor: Use mail-config.php as main config, deprecate config.php 2026-01-17 00:15:27 +01:00
TheOnlyMace
fc17400123 docs: Update README with new structure 2026-01-17 00:03:10 +01:00
TheOnlyMace
829a293a09 refactor: Move production files from dist/ to root for easier deployment 2026-01-17 00:01:14 +01:00
TheOnlyMace
98c408efd8 deploy: Produktions-Update 2026-01-16 - Accessibility & Bug Fixes 2026-01-16 23:55:37 +01:00
TheOnlyMace
aad6c3ea8a feat: Enhance security and SEO with new headers and metadata
- Added security headers to prevent clickjacking, MIME-type sniffing, and XSS attacks.
- Implemented Content Security Policy for resource management.
- Included Open Graph and Twitter Card metadata for improved social media sharing.
- Added structured data (JSON-LD) for better search engine visibility.
- Improved accessibility with a skip link for main content navigation.
2026-01-16 23:52:43 +01:00
𝓜𝓪𝓬𝓮™
4e0d64999e Update README.md 2026-01-16 22:47:15 +01:00
TheOnlyMace
028ca7b8f8 chore: Update LICENSE to Business Source License 1.1
- Replaced GNU Lesser General Public License with Business Source License 1.1
- Added specific terms and conditions in German for the licensed work
- Included details on additional usage permissions and warranty disclaimers
2026-01-16 20:26:51 +01:00
TheOnlyMace
78b341fa75 refactor: main Branch enthält nur noch Produktions-Dateien (dist/)
- Quellcode-Ordner entfernt (assets/, config/, includes/, scripts/)
- Build-Abhängigkeiten entfernt (package.json, package-lock.json)
- Nur dist/, README.md und LICENSE bleiben
- Entwicklung erfolgt im develop Branch
2026-01-16 20:03:21 +01:00
31 changed files with 2024 additions and 6425 deletions

31
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,31 @@
# Contributing
## Commit Message Standard
Bitte nutze fuer alle Commits dieses Format:
`<type>: <kurze beschreibung>`
Beispiele:
- `feat: add product metadata for hero sections`
- `fix: correct vat calculation in checkout`
- `refactor: split product config helper functions`
## Erlaubte Typen
- `feat` neue Funktionalitaet
- `fix` Bugfix
- `refactor` Umstrukturierung ohne Verhaltensaenderung
- `docs` Dokumentation
- `test` Tests
- `chore` Wartung/Tooling
- `perf` Performance
- `build` Build/Dependencies
- `ci` CI/CD-Aenderungen
- `revert` Ruecknahme eines Commits
## Regeln
- Subjekt im Imperativ und klein beginnen.
- Keine Punkte am Ende der Commit-Betreffzeile.
- Optional Scope nutzen, wenn sinnvoll: `fix(api): ...`, `feat(config): ...`.

533
LICENSE
View File

@@ -1,504 +1,67 @@
GNU LESSER GENERAL PUBLIC LICENSE Business Source License 1.1
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc. Lizenzgeber: HexaHost.de
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Lizenzierte Arbeit: HexaHost Backend
Everyone is permitted to copy and distribute verbatim copies Die lizenzierte Arbeit ist urheberrechtlich geschützt
of this license document, but changing it is not allowed. © 2026 HexaHost.de
[This is the first released version of the Lesser GPL. It also counts Zusätzliche Nutzungsbewilligung: Keine
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble Änderungsdatum: 2030-01-16
The licenses for most software are designed to take away your Änderungslizenz: GNU General Public License v3.0 oder später
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some -----------------------------------------------------------------------------
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use, Business Source License 1.1
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 this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid Lizenz-Text
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis Der Lizenzgeber gewährt Ihnen hiermit das Recht, die lizenzierte Arbeit zu
or for a fee, you must give the recipients all the rights that we gave kopieren, zu modifizieren, abgeleitete Werke zu erstellen, weiterzuverbreiten
you. You must make sure that they, too, receive or can get the source und die lizenzierte Arbeit nicht-produktiv zu nutzen. Der Lizenzgeber kann eine
code. If you link other code with the library, you must provide "Zusätzliche Nutzungsbewilligung" (siehe oben) erteilen, die bestimmte
complete object files to the recipients, so that they can relink them produktive Nutzungen erlaubt.
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the Mit Wirkung zum Änderungsdatum (siehe oben) oder zum vierten Jahrestag der
library, and (2) we offer you this license, which gives you legal ersten öffentlichen Veröffentlichung einer spezifischen Version der lizenzierten
permission to copy, distribute and/or modify the library. Arbeit, je nachdem, welcher Zeitpunkt später eintritt, wechselt die hier
erteilte Lizenz automatisch zur Änderungslizenz (siehe oben), und Sie sind
berechtigt, die lizenzierte Arbeit zu jedem Zweck zu nutzen.
To protect each distributor, we want to make it very clear that BEGRIFFSBESTIMMUNGEN
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of "Lizenzierte Arbeit" bezeichnet alle urheberrechtlich geschützten Werke, die
any free program. We wish to make sure that a company cannot unter dieser Lizenz lizenziert sind.
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the "Änderungslizenz" bezeichnet die Lizenz, die nach dem Änderungsdatum auf die
ordinary GNU General Public License. This license, the GNU Lesser lizenzierte Arbeit anwendbar ist.
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using "Zusätzliche Nutzungsbewilligung" bezeichnet jede zusätzliche Genehmigung, die
a shared library, the combination of the two is legally speaking a der Lizenzgeber gewährt und die bestimmte produktive Nutzungen erlaubt.
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it "Produktive Nutzung" bezeichnet jede Nutzung der lizenzierten Arbeit für einen
does Less to protect the user's freedom than the ordinary General Zweck, der über die persönliche, nicht-kommerzielle Nutzung hinausgeht. Dies
Public License. It also provides other free software developers Less umfasst, ist aber nicht beschränkt auf:
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to (a) Nutzung der lizenzierten Arbeit zur Erbringung von Dienstleistungen für
encourage the widest possible use of a certain library, so that it becomes Dritte;
a de-facto standard. To achieve this, non-free programs must be (b) Nutzung der lizenzierten Arbeit als Teil eines kommerziellen Produkts
allowed to use the library. A more frequent case is that a free oder einer kommerziellen Dienstleistung;
library does the same job as widely used non-free libraries. In this (c) Nutzung der lizenzierten Arbeit zur Generierung von Einnahmen;
case, there is little to gain by limiting the free library to free (d) Nutzung der lizenzierten Arbeit in einer Unternehmensumgebung.
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free GEWÄHRLEISTUNGSAUSSCHLUSS
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the DIE LIZENZIERTE ARBEIT WIRD "WIE BESEHEN" ZUR VERFÜGUNG GESTELLT, OHNE
users' freedom, it does ensure that the user of a program that is JEGLICHE GEWÄHRLEISTUNG, WEDER AUSDRÜCKLICH NOCH STILLSCHWEIGEND,
linked with the Library has the freedom and the wherewithal to run EINSCHLIEßLICH, ABER NICHT BESCHRÄNKT AUF DIE GEWÄHRLEISTUNG DER
that program using a modified version of the Library. MARKTGÄNGIGKEIT, EIGNUNG FÜR EINEN BESTIMMTEN ZWECK UND NICHTVERLETZUNG VON
RECHTEN DRITTER. IN KEINEM FALL HAFTET DER LIZENZGEBER FÜR ANSPRÜCHE, SCHÄDEN
ODER ANDERE VERBINDLICHKEITEN, OB IN EINER VERTRAGS- ODER DELIKTKLAGE ODER
ANDERWEITIG, DIE SICH AUS DER LIZENZIERTEN ARBEIT ODER DER NUTZUNG ODER
ANDEREN GESCHÄFTEN MIT DER LIZENZIERTEN ARBEIT ERGEBEN.
The precise terms and conditions for copying, distribution and -----------------------------------------------------------------------------
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE Für kommerzielle Lizenzen kontaktieren Sie bitte: kontakt@hexahost.de
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
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
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser 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 Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "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
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY 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
LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey 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 library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random
Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@@ -2,7 +2,7 @@
Shared Backend-Komponenten für die HexaHost.de Website. Dieses Repository enthält wiederverwendbare PHP-Templates, JavaScript-Module, CSS-Styles und Konfigurationsdateien. Shared Backend-Komponenten für die HexaHost.de Website. Dieses Repository enthält wiederverwendbare PHP-Templates, JavaScript-Module, CSS-Styles und Konfigurationsdateien.
> ⚠️ **Wichtig:** Dieses Repository ist abhängig vom [HexaHost-Frontend](../HexaHost-Frontend) und muss in dessen `public/`-Verzeichnis integriert werden, um zu funktionieren. > ⚠️ **Wichtig:** Dieses Repository ist abhängig vom [HexaHost-Frontend](https://git.hexahost.dev/smueller/HexaHost-Frontend) und muss in dessen `public/`-Verzeichnis integriert werden, um zu funktionieren.
## 📦 Inhalt ## 📦 Inhalt
@@ -22,7 +22,7 @@ HexaHost-Backend/
│ ├── header.php # HTML-Header-Template │ ├── header.php # HTML-Header-Template
│ ├── footer.php # HTML-Footer-Template │ ├── footer.php # HTML-Footer-Template
│ └── functions.php # PHP-Hilfsfunktionen │ └── functions.php # PHP-Hilfsfunktionen
├── LICENSE # LGPL-2.1 Lizenz ├── LICENSE # BSL-1.1 Lizenz
└── README.md # Diese Datei └── README.md # Diese Datei
``` ```
@@ -30,11 +30,19 @@ HexaHost-Backend/
Die Backend-Dateien müssen in das Frontend-Repository integriert werden: Die Backend-Dateien müssen in das Frontend-Repository integriert werden:
```bash
# Vom main Branch die Produktionsdateien kopieren
cd HexaHost-Backend
git checkout main
cp -r assets config includes ../HexaHost-Frontend/public/
git checkout develop
```
Oder mit einem Befehl:
```bash ```bash
# Aus dem Projekt-Root-Verzeichnis # Aus dem Projekt-Root-Verzeichnis
cp -r HexaHost-Backend/assets/* HexaHost-Frontend/public/assets/ cd HexaHost-Backend && git checkout main && cp -r assets config includes ../HexaHost-Frontend/public/ && git checkout develop
cp -r HexaHost-Backend/config/* HexaHost-Frontend/public/config/
cp -r HexaHost-Backend/includes/* HexaHost-Frontend/public/includes/
``` ```
### Zielstruktur im Frontend ### Zielstruktur im Frontend
@@ -270,14 +278,27 @@ $debug_config = [
``` ```
Branches: Branches:
├── main → Produktions-Code (mit obfuscated dist/) ├── main → Produktions-Code (optimierte Dateien direkt im Root)
└── develop → Entwicklungs-Code (lesbarer Source) └── develop → Entwicklungs-Code (lesbarer Source + Build-System)
``` ```
| Branch | Inhalt | Verwendung | | Branch | Inhalt | Verwendung |
|--------|--------|------------| |--------|--------|------------|
| `main` | Lesbare Quellen + `dist/` Ordner | Für Produktion: Dateien aus `dist/` verwenden | | `main` | Optimierte `assets/`, `config/`, `includes/` im Root | Für Produktion: direkt kopieren |
| `develop` | Nur lesbare Quellen + Build-System | Für Entwicklung | | `develop` | Lesbare Quellen + `dist/` Build-Output | Für Entwicklung |
### Struktur im `main` Branch
```
HexaHost-Backend/ (main)
├── assets/ ← Minifiziertes CSS, obfusciertes JS
│ ├── css/
│ └── js/
├── config/ ← PHP-Konfiguration
├── includes/ ← PHP-Templates
├── README.md
└── LICENSE
```
### Workflow ### Workflow
@@ -289,12 +310,24 @@ npm run build # dist/ neu generieren
git add . git add .
git commit -m "feat: ..." git commit -m "feat: ..."
# Release # Release (automatisch mit deploy script)
npm run deploy # Build + Copy to main + Push
```
### Manueller Release
```bash
git checkout develop
npm run build
git add dist/ && git commit -m "build: ..."
git checkout main git checkout main
git merge develop git checkout develop -- dist/
npm run build # dist/ aktualisieren # Dateien von dist/ ins Root verschieben
git add dist/ mv dist/assets dist/config dist/includes .
git commit -m "build: Update production files" rm -rf dist/
git add -A && git commit -m "deploy: Update"
git push origin main
git checkout develop
``` ```
## 🔨 Build-System ## 🔨 Build-System
@@ -311,20 +344,21 @@ npm install
npm run build # Alles bauen (JS + CSS + PHP) npm run build # Alles bauen (JS + CSS + PHP)
npm run build:js # Nur JavaScript obfuscieren npm run build:js # Nur JavaScript obfuscieren
npm run build:css # Nur CSS minifizieren npm run build:css # Nur CSS minifizieren
npm run deploy # Build + Deploy zu main Branch
npm run clean # dist/ Ordner löschen npm run clean # dist/ Ordner löschen
``` ```
### Ausgabe ### Build-Ausgabe (`dist/`)
Nach dem Build enthält der `dist/` Ordner: Nach dem Build enthält der `dist/` Ordner im develop Branch:
``` ```
dist/ dist/
├── assets/ ├── assets/
│ ├── css/ │ ├── css/
│ │ └── style.css # Minifiziert │ │ └── style.css # Minifiziert (-25%)
│ └── js/ │ └── js/
│ ├── main.js # Obfusciert │ ├── main.js # Obfusciert (Code-Schutz)
│ ├── contact.js # Obfusciert │ ├── contact.js # Obfusciert
│ └── cookie-consent.js # Obfusciert │ └── cookie-consent.js # Obfusciert
├── config/ ├── config/
@@ -336,6 +370,16 @@ dist/
└── functions.php # Kopiert └── functions.php # Kopiert
``` ```
### Deploy-Prozess
Das `npm run deploy` Script:
1. Prüft ob du auf `develop` bist
2. Führt `npm run build` aus
3. Wechselt zu `main`
4. Kopiert `dist/` Inhalte direkt ins Root
5. Committed und pusht zu `origin/main`
6. Wechselt zurück zu `develop`
## 📋 Voraussetzungen ## 📋 Voraussetzungen
- **Node.js 18+** (für Build-System) - **Node.js 18+** (für Build-System)
@@ -345,7 +389,22 @@ dist/
## 📄 Lizenz ## 📄 Lizenz
GNU Lesser General Public License v2.1 (LGPL-2.1) Dieses Projekt ist unter der **Business Source License 1.1 (BSL)** lizenziert.
### Was bedeutet das?
| Erlaubt | Nicht erlaubt (ohne kommerzielle Lizenz) |
|---------|------------------------------------------|
| ✅ Code ansehen & lernen | ❌ Kommerzieller Einsatz |
| ✅ Privater, nicht-kommerzieller Gebrauch | ❌ Nutzung für SaaS/Hosting-Dienste |
| ✅ Modifikationen für persönliche Zwecke | ❌ Unternehmensnutzung |
| ✅ Akademische/Bildungszwecke | ❌ Weiterverkauf oder Sublizenzierung |
**Änderungsdatum:** Am 16. Januar 2030 wird der Code automatisch unter der **GPL v3** verfügbar.
**Kommerzielle Lizenz:** Für kommerzielle Nutzung kontaktieren Sie bitte kontakt@hexahost.de
Siehe [LICENSE](LICENSE) für den vollständigen Lizenztext.
--- ---

161
api/dns-lookup.php Normal file
View File

@@ -0,0 +1,161 @@
<?php
/**
* HexaDNS - DNS Lookup API
*
* Führt echte DNS-Abfragen durch und gibt die Ergebnisse als JSON zurück.
*
* Verwendung: GET /api/dns-lookup.php?domain=example.com
*/
// CORS Headers für Frontend-Zugriff
header('Content-Type: application/json; charset=utf-8');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, OPTIONS');
header('Access-Control-Allow-Headers: Content-Type');
// Preflight request handling
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
http_response_code(200);
exit;
}
// Nur GET-Anfragen erlauben
if ($_SERVER['REQUEST_METHOD'] !== 'GET') {
http_response_code(405);
echo json_encode(['error' => 'Nur GET-Anfragen erlaubt']);
exit;
}
// Domain-Parameter prüfen
$domain = isset($_GET['domain']) ? trim($_GET['domain']) : '';
if (empty($domain)) {
http_response_code(400);
echo json_encode(['error' => 'Domain-Parameter fehlt']);
exit;
}
// Domain validieren (einfache Prüfung)
if (!preg_match('/^[a-zA-Z0-9][a-zA-Z0-9\-\.]*\.[a-zA-Z]{2,}$/', $domain)) {
http_response_code(400);
echo json_encode(['error' => 'Ungültiges Domain-Format']);
exit;
}
// DNS-Abfrage durchführen
$startTime = microtime(true);
$result = performDnsLookup($domain);
$queryTime = round((microtime(true) - $startTime) * 1000, 2);
// Ergebnis zurückgeben
echo json_encode([
'success' => true,
'domain' => $domain,
'query_time_ms' => $queryTime,
'timestamp' => date('Y-m-d H:i:s'),
'records' => $result
], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
/**
* Führt DNS-Lookup für verschiedene Record-Typen durch
*/
function performDnsLookup(string $domain): array {
$records = [
'A' => [],
'AAAA' => [],
'MX' => [],
'NS' => [],
'TXT' => [],
'CNAME' => [],
'SOA' => []
];
// A-Records (IPv4)
$aRecords = @dns_get_record($domain, DNS_A);
if ($aRecords) {
foreach ($aRecords as $record) {
$records['A'][] = [
'ip' => $record['ip'],
'ttl' => $record['ttl']
];
}
}
// AAAA-Records (IPv6)
$aaaaRecords = @dns_get_record($domain, DNS_AAAA);
if ($aaaaRecords) {
foreach ($aaaaRecords as $record) {
$records['AAAA'][] = [
'ipv6' => $record['ipv6'],
'ttl' => $record['ttl']
];
}
}
// MX-Records (Mail)
$mxRecords = @dns_get_record($domain, DNS_MX);
if ($mxRecords) {
foreach ($mxRecords as $record) {
$records['MX'][] = [
'target' => $record['target'],
'priority' => $record['pri'],
'ttl' => $record['ttl']
];
}
// Nach Priorität sortieren
usort($records['MX'], fn($a, $b) => $a['priority'] <=> $b['priority']);
}
// NS-Records (Nameserver)
$nsRecords = @dns_get_record($domain, DNS_NS);
if ($nsRecords) {
foreach ($nsRecords as $record) {
$records['NS'][] = [
'target' => $record['target'],
'ttl' => $record['ttl']
];
}
}
// TXT-Records
$txtRecords = @dns_get_record($domain, DNS_TXT);
if ($txtRecords) {
foreach ($txtRecords as $record) {
$records['TXT'][] = [
'txt' => $record['txt'],
'ttl' => $record['ttl']
];
}
}
// CNAME-Records
$cnameRecords = @dns_get_record($domain, DNS_CNAME);
if ($cnameRecords) {
foreach ($cnameRecords as $record) {
$records['CNAME'][] = [
'target' => $record['target'],
'ttl' => $record['ttl']
];
}
}
// SOA-Record (Start of Authority)
$soaRecords = @dns_get_record($domain, DNS_SOA);
if ($soaRecords) {
foreach ($soaRecords as $record) {
$records['SOA'][] = [
'mname' => $record['mname'] ?? '',
'rname' => $record['rname'] ?? '',
'serial' => $record['serial'] ?? 0,
'refresh' => $record['refresh'] ?? 0,
'retry' => $record['retry'] ?? 0,
'expire' => $record['expire'] ?? 0,
'minimum_ttl' => $record['minimum-ttl'] ?? 0,
'ttl' => $record['ttl']
];
}
}
// Leere Arrays entfernen
return array_filter($records, fn($arr) => !empty($arr));
}

175
api/dns-propagation.php Normal file
View File

@@ -0,0 +1,175 @@
<?php
/**
* HexaDNS - DNS Propagation Check API
*
* Prüft DNS-Records bei verschiedenen öffentlichen DNS-Servern
*
* Verwendung: GET /api/dns-propagation.php?domain=example.com&type=A
*/
header('Content-Type: application/json; charset=utf-8');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, OPTIONS');
header('Access-Control-Allow-Headers: Content-Type');
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
http_response_code(200);
exit;
}
// Öffentliche DNS-Server für Propagation-Check
$dnsServers = [
['name' => 'Google', 'ip' => '8.8.8.8', 'location' => 'Global'],
['name' => 'Google Secondary', 'ip' => '8.8.4.4', 'location' => 'Global'],
['name' => 'Cloudflare', 'ip' => '1.1.1.1', 'location' => 'Global'],
['name' => 'Cloudflare Secondary', 'ip' => '1.0.0.1', 'location' => 'Global'],
['name' => 'Quad9', 'ip' => '9.9.9.9', 'location' => 'Global'],
['name' => 'OpenDNS', 'ip' => '208.67.222.222', 'location' => 'USA'],
['name' => 'Comodo', 'ip' => '8.26.56.26', 'location' => 'USA'],
['name' => 'Level3', 'ip' => '4.2.2.1', 'location' => 'USA'],
];
$domain = isset($_GET['domain']) ? trim($_GET['domain']) : '';
$type = isset($_GET['type']) ? strtoupper(trim($_GET['type'])) : 'A';
if (empty($domain)) {
http_response_code(400);
echo json_encode(['error' => 'Domain-Parameter fehlt']);
exit;
}
if (!preg_match('/^[a-zA-Z0-9][a-zA-Z0-9\-\.]*\.[a-zA-Z]{2,}$/', $domain)) {
http_response_code(400);
echo json_encode(['error' => 'Ungültiges Domain-Format']);
exit;
}
// Erlaubte Record-Typen
$allowedTypes = ['A', 'AAAA', 'MX', 'NS', 'TXT', 'CNAME'];
if (!in_array($type, $allowedTypes)) {
$type = 'A';
}
$results = [];
$startTime = microtime(true);
foreach ($dnsServers as $server) {
$serverResult = [
'server' => $server['name'],
'ip' => $server['ip'],
'location' => $server['location'],
'records' => [],
'status' => 'success',
'response_time' => 0
];
$queryStart = microtime(true);
// DNS-Abfrage mit spezifischem Server via dig (falls verfügbar) oder dns_get_record
$records = queryDnsServer($domain, $type, $server['ip']);
$serverResult['response_time'] = round((microtime(true) - $queryStart) * 1000, 2);
$serverResult['records'] = $records;
if (empty($records)) {
$serverResult['status'] = 'no_records';
}
$results[] = $serverResult;
}
$totalTime = round((microtime(true) - $startTime) * 1000, 2);
// Propagation-Status berechnen
$propagationStatus = calculatePropagationStatus($results);
echo json_encode([
'success' => true,
'domain' => $domain,
'record_type' => $type,
'propagation_status' => $propagationStatus,
'total_time_ms' => $totalTime,
'timestamp' => date('Y-m-d H:i:s'),
'servers' => $results
], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
/**
* DNS-Abfrage bei spezifischem Server
*/
function queryDnsServer(string $domain, string $type, string $server): array {
$records = [];
// Versuche zuerst dig zu verwenden (genauer)
$digResult = @shell_exec("dig @{$server} {$domain} {$type} +short +time=2 +tries=1 2>/dev/null");
if ($digResult !== null && trim($digResult) !== '') {
$lines = array_filter(explode("\n", trim($digResult)));
foreach ($lines as $line) {
$records[] = trim($line);
}
return $records;
}
// Fallback auf PHP dns_get_record (verwendet System-DNS)
$dnsType = constant('DNS_' . $type);
$result = @dns_get_record($domain, $dnsType);
if ($result) {
foreach ($result as $record) {
switch ($type) {
case 'A':
$records[] = $record['ip'] ?? '';
break;
case 'AAAA':
$records[] = $record['ipv6'] ?? '';
break;
case 'MX':
$records[] = ($record['pri'] ?? '') . ' ' . ($record['target'] ?? '');
break;
case 'NS':
case 'CNAME':
$records[] = $record['target'] ?? '';
break;
case 'TXT':
$records[] = $record['txt'] ?? '';
break;
}
}
}
return array_filter($records);
}
/**
* Berechnet den Propagation-Status
*/
function calculatePropagationStatus(array $results): array {
$totalServers = count($results);
$serversWithRecords = 0;
$allRecords = [];
foreach ($results as $result) {
if (!empty($result['records'])) {
$serversWithRecords++;
foreach ($result['records'] as $record) {
$allRecords[] = $record;
}
}
}
// Einzigartige Records
$uniqueRecords = array_unique($allRecords);
// Konsistenz prüfen (haben alle Server die gleichen Records?)
$isConsistent = count($uniqueRecords) <= 1 || $serversWithRecords === 0;
$percentage = $totalServers > 0 ? round(($serversWithRecords / $totalServers) * 100) : 0;
return [
'percentage' => $percentage,
'servers_responding' => $serversWithRecords,
'total_servers' => $totalServers,
'is_consistent' => $isConsistent,
'unique_values' => array_values($uniqueRecords)
];
}

179
api/ping-check.php Normal file
View File

@@ -0,0 +1,179 @@
<?php
/**
* HexaDNS - Ping/Verfügbarkeitstest API
*
* Prüft die Erreichbarkeit einer Domain
*
* Verwendung: GET /api/ping-check.php?domain=example.com
*/
header('Content-Type: application/json; charset=utf-8');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, OPTIONS');
header('Access-Control-Allow-Headers: Content-Type');
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
http_response_code(200);
exit;
}
$domain = isset($_GET['domain']) ? trim($_GET['domain']) : '';
if (empty($domain)) {
http_response_code(400);
echo json_encode(['error' => 'Domain-Parameter fehlt']);
exit;
}
// Protokoll und Pfad entfernen
$domain = preg_replace('/^(https?:\/\/)?/', '', $domain);
$domain = explode('/', $domain)[0];
if (!preg_match('/^[a-zA-Z0-9][a-zA-Z0-9\-\.]*\.[a-zA-Z]{2,}$/', $domain)) {
http_response_code(400);
echo json_encode(['error' => 'Ungültiges Domain-Format']);
exit;
}
$startTime = microtime(true);
$results = performConnectivityCheck($domain);
$totalTime = round((microtime(true) - $startTime) * 1000, 2);
echo json_encode([
'success' => true,
'domain' => $domain,
'total_time_ms' => $totalTime,
'timestamp' => date('Y-m-d H:i:s'),
'results' => $results
], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
/**
* Führt verschiedene Erreichbarkeitstests durch
*/
function performConnectivityCheck(string $domain): array {
$results = [
'dns_resolution' => checkDnsResolution($domain),
'icmp_ping' => checkIcmpPing($domain),
'http' => checkHttpConnection($domain, false),
'https' => checkHttpConnection($domain, true),
'overall_status' => 'offline'
];
// Overall-Status bestimmen
if ($results['https']['reachable'] || $results['http']['reachable']) {
$results['overall_status'] = 'online';
} elseif ($results['icmp_ping']['reachable']) {
$results['overall_status'] = 'partial';
} elseif ($results['dns_resolution']['resolved']) {
$results['overall_status'] = 'dns_only';
}
return $results;
}
/**
* DNS-Auflösung prüfen
*/
function checkDnsResolution(string $domain): array {
$start = microtime(true);
$ip = gethostbyname($domain);
$time = round((microtime(true) - $start) * 1000, 2);
$resolved = $ip !== $domain;
return [
'resolved' => $resolved,
'ip' => $resolved ? $ip : null,
'response_time_ms' => $time
];
}
/**
* ICMP Ping (falls verfügbar)
*/
function checkIcmpPing(string $domain): array {
$result = [
'reachable' => false,
'response_time_ms' => null,
'packet_loss' => null
];
// Versuche ping-Kommando
$pingResult = @shell_exec("ping -c 3 -W 2 {$domain} 2>/dev/null");
if ($pingResult) {
// Prüfe auf erfolgreiche Antworten
if (preg_match('/(\d+)% packet loss/', $pingResult, $lossMatch)) {
$result['packet_loss'] = (int)$lossMatch[1];
$result['reachable'] = $result['packet_loss'] < 100;
}
// Durchschnittliche Zeit extrahieren
if (preg_match('/avg.*?=.*?[\d.]+\/([\d.]+)\//', $pingResult, $timeMatch)) {
$result['response_time_ms'] = (float)$timeMatch[1];
} elseif (preg_match('/time[=<]([\d.]+)\s*ms/', $pingResult, $timeMatch)) {
$result['response_time_ms'] = (float)$timeMatch[1];
}
}
return $result;
}
/**
* HTTP(S)-Verbindung prüfen
*/
function checkHttpConnection(string $domain, bool $https = false): array {
$protocol = $https ? 'https' : 'http';
$port = $https ? 443 : 80;
$url = "{$protocol}://{$domain}";
$result = [
'reachable' => false,
'status_code' => null,
'response_time_ms' => null,
'redirect_url' => null,
'server' => null
];
$start = microtime(true);
// cURL verwenden
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => true,
CURLOPT_NOBODY => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_CONNECTTIMEOUT => 5,
CURLOPT_FOLLOWLOCATION => false,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_USERAGENT => 'HexaDNS Ping Check/1.0'
]);
$response = curl_exec($ch);
$result['response_time_ms'] = round((microtime(true) - $start) * 1000, 2);
if ($response !== false) {
$result['status_code'] = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$result['reachable'] = $result['status_code'] > 0;
// Redirect-URL
$redirectUrl = curl_getinfo($ch, CURLINFO_REDIRECT_URL);
if (!empty($redirectUrl)) {
$result['redirect_url'] = $redirectUrl;
}
// Server-Header
if (preg_match('/Server:\s*([^\r\n]+)/i', $response, $serverMatch)) {
$result['server'] = trim($serverMatch[1]);
}
} else {
$result['error'] = curl_error($ch);
}
curl_close($ch);
return $result;
}

209
api/reverse-dns.php Normal file
View File

@@ -0,0 +1,209 @@
<?php
/**
* HexaDNS - Reverse DNS Lookup API
*
* Löst eine IP-Adresse zu einem Hostnamen auf
*
* Verwendung: GET /api/reverse-dns.php?ip=8.8.8.8
*/
header('Content-Type: application/json; charset=utf-8');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, OPTIONS');
header('Access-Control-Allow-Headers: Content-Type');
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
http_response_code(200);
exit;
}
$ip = isset($_GET['ip']) ? trim($_GET['ip']) : '';
if (empty($ip)) {
http_response_code(400);
echo json_encode(['error' => 'IP-Parameter fehlt']);
exit;
}
// IPv4 oder IPv6 validieren
$isIPv4 = filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);
$isIPv6 = filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);
if (!$isIPv4 && !$isIPv6) {
http_response_code(400);
echo json_encode(['error' => 'Ungültiges IP-Format']);
exit;
}
$startTime = microtime(true);
$result = performReverseLookup($ip, $isIPv6 ? 'IPv6' : 'IPv4');
$queryTime = round((microtime(true) - $startTime) * 1000, 2);
echo json_encode([
'success' => true,
'ip' => $ip,
'ip_version' => $isIPv6 ? 'IPv6' : 'IPv4',
'query_time_ms' => $queryTime,
'timestamp' => date('Y-m-d H:i:s'),
'result' => $result
], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
/**
* Führt Reverse DNS Lookup durch
*/
function performReverseLookup(string $ip, string $version): array {
$result = [
'hostname' => null,
'ptr_record' => null,
'additional_info' => []
];
// PHP gethostbyaddr
$hostname = @gethostbyaddr($ip);
if ($hostname && $hostname !== $ip) {
$result['hostname'] = $hostname;
// Verifizieren durch Forward-Lookup
$forwardIp = gethostbyname($hostname);
$result['forward_verified'] = ($forwardIp === $ip);
// Zusätzliche Infos über den Host sammeln
$result['additional_info'] = getHostInfo($hostname);
} else {
$result['error'] = 'Kein PTR-Record gefunden';
}
// PTR-Record direkt abfragen
$ptrRecord = getPtrRecord($ip, $version);
if ($ptrRecord) {
$result['ptr_record'] = $ptrRecord;
}
// IP-Info (GeoIP wenn verfügbar, sonst Basic-Infos)
$result['ip_info'] = getIpInfo($ip);
return $result;
}
/**
* PTR-Record direkt abfragen
*/
function getPtrRecord(string $ip, string $version): ?string {
if ($version === 'IPv4') {
// IPv4: Reverse die Oktette
$parts = array_reverse(explode('.', $ip));
$ptrDomain = implode('.', $parts) . '.in-addr.arpa';
} else {
// IPv6: Komplexer - jedes Nibble umkehren
$expanded = expandIPv6($ip);
$nibbles = str_replace(':', '', $expanded);
$reversed = implode('.', array_reverse(str_split($nibbles)));
$ptrDomain = $reversed . '.ip6.arpa';
}
$records = @dns_get_record($ptrDomain, DNS_PTR);
if ($records && !empty($records[0]['target'])) {
return $records[0]['target'];
}
return null;
}
/**
* Expandiert eine IPv6-Adresse
*/
function expandIPv6(string $ip): string {
// Ersetze :: mit der richtigen Anzahl von 0000
if (strpos($ip, '::') !== false) {
$parts = explode('::', $ip);
$left = $parts[0] ? explode(':', $parts[0]) : [];
$right = isset($parts[1]) && $parts[1] ? explode(':', $parts[1]) : [];
$missing = 8 - count($left) - count($right);
$middle = array_fill(0, $missing, '0000');
$all = array_merge($left, $middle, $right);
} else {
$all = explode(':', $ip);
}
// Jedes Segment auf 4 Zeichen auffüllen
$all = array_map(function($segment) {
return str_pad($segment, 4, '0', STR_PAD_LEFT);
}, $all);
return implode(':', $all);
}
/**
* Sammelt Infos über einen Hostnamen
*/
function getHostInfo(string $hostname): array {
$info = [];
// Domain-Teile analysieren
$parts = explode('.', $hostname);
$tld = end($parts);
$info['tld'] = $tld;
// Bekannte Hosting-Provider erkennen
$providerPatterns = [
'amazonaws.com' => 'Amazon AWS',
'googleusercontent.com' => 'Google Cloud',
'cloudfront.net' => 'Amazon CloudFront',
'azure' => 'Microsoft Azure',
'hetzner' => 'Hetzner',
'ovh' => 'OVH',
'digitalocean' => 'DigitalOcean',
'linode' => 'Linode',
'vultr' => 'Vultr',
'contabo' => 'Contabo',
'netcup' => 'Netcup',
'strato' => 'Strato',
'ionos' => 'IONOS',
'1und1' => '1&1',
'telekom' => 'Deutsche Telekom',
'vodafone' => 'Vodafone',
];
foreach ($providerPatterns as $pattern => $provider) {
if (stripos($hostname, $pattern) !== false) {
$info['provider'] = $provider;
break;
}
}
return $info;
}
/**
* Basis-Infos zur IP
*/
function getIpInfo(string $ip): array {
$info = [
'type' => 'unknown'
];
// Private IP-Bereiche prüfen
if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
if (preg_match('/^(10\.|172\.(1[6-9]|2[0-9]|3[01])\.|192\.168\.)/', $ip)) {
$info['type'] = 'private';
} elseif (preg_match('/^(127\.)/', $ip)) {
$info['type'] = 'loopback';
} else {
$info['type'] = 'public';
}
} else {
// IPv6
if (preg_match('/^(fc|fd)/i', $ip)) {
$info['type'] = 'private';
} elseif (preg_match('/^::1$/', $ip) || preg_match('/^fe80:/i', $ip)) {
$info['type'] = 'loopback/link-local';
} else {
$info['type'] = 'public';
}
}
return $info;
}

164
api/ssl-check.php Normal file
View File

@@ -0,0 +1,164 @@
<?php
/**
* HexaDNS - SSL Certificate Check API
*
* Prüft SSL-Zertifikat-Informationen einer Domain
*
* Verwendung: GET /api/ssl-check.php?domain=example.com
*/
header('Content-Type: application/json; charset=utf-8');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, OPTIONS');
header('Access-Control-Allow-Headers: Content-Type');
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
http_response_code(200);
exit;
}
$domain = isset($_GET['domain']) ? trim($_GET['domain']) : '';
if (empty($domain)) {
http_response_code(400);
echo json_encode(['error' => 'Domain-Parameter fehlt']);
exit;
}
// Protokoll und Pfad entfernen
$domain = preg_replace('/^(https?:\/\/)?/', '', $domain);
$domain = explode('/', $domain)[0];
$domain = explode(':', $domain)[0]; // Port entfernen
if (!preg_match('/^[a-zA-Z0-9][a-zA-Z0-9\-\.]*\.[a-zA-Z]{2,}$/', $domain)) {
http_response_code(400);
echo json_encode(['error' => 'Ungültiges Domain-Format']);
exit;
}
$startTime = microtime(true);
$sslData = checkSslCertificate($domain);
$queryTime = round((microtime(true) - $startTime) * 1000, 2);
echo json_encode([
'success' => $sslData['success'],
'domain' => $domain,
'query_time_ms' => $queryTime,
'timestamp' => date('Y-m-d H:i:s'),
'ssl' => $sslData
], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
/**
* Prüft SSL-Zertifikat einer Domain
*/
function checkSslCertificate(string $domain): array {
$result = [
'success' => false,
'has_ssl' => false,
'is_valid' => false,
'error' => null,
'certificate' => null
];
// Stream Context für SSL
$context = stream_context_create([
'ssl' => [
'capture_peer_cert' => true,
'verify_peer' => false,
'verify_peer_name' => false,
]
]);
// Verbindung herstellen
$socket = @stream_socket_client(
"ssl://{$domain}:443",
$errno,
$errstr,
10, // Timeout
STREAM_CLIENT_CONNECT,
$context
);
if (!$socket) {
// Versuche ohne SSL (um zu prüfen ob Server erreichbar)
$httpSocket = @fsockopen($domain, 80, $errno, $errstr, 5);
if ($httpSocket) {
fclose($httpSocket);
$result['error'] = 'Kein SSL-Zertifikat auf Port 443 gefunden';
} else {
$result['error'] = "Verbindung fehlgeschlagen: {$errstr}";
}
return $result;
}
$result['has_ssl'] = true;
$result['success'] = true;
// Zertifikat extrahieren
$params = stream_context_get_params($socket);
$cert = $params['options']['ssl']['peer_certificate'] ?? null;
if ($cert) {
$certInfo = openssl_x509_parse($cert);
if ($certInfo) {
$validFrom = $certInfo['validFrom_time_t'] ?? 0;
$validTo = $certInfo['validTo_time_t'] ?? 0;
$now = time();
$isExpired = $now > $validTo;
$isNotYetValid = $now < $validFrom;
$result['is_valid'] = !$isExpired && !$isNotYetValid;
// Tage bis Ablauf
$daysUntilExpiry = floor(($validTo - $now) / 86400);
// Subject Alternative Names (SANs)
$sans = [];
if (isset($certInfo['extensions']['subjectAltName'])) {
$sanStr = $certInfo['extensions']['subjectAltName'];
preg_match_all('/DNS:([^,\s]+)/', $sanStr, $matches);
$sans = $matches[1] ?? [];
}
// Issuer aufbereiten
$issuer = [];
if (isset($certInfo['issuer'])) {
if (isset($certInfo['issuer']['O'])) $issuer['organization'] = $certInfo['issuer']['O'];
if (isset($certInfo['issuer']['CN'])) $issuer['common_name'] = $certInfo['issuer']['CN'];
if (isset($certInfo['issuer']['C'])) $issuer['country'] = $certInfo['issuer']['C'];
}
// Subject aufbereiten
$subject = [];
if (isset($certInfo['subject'])) {
if (isset($certInfo['subject']['CN'])) $subject['common_name'] = $certInfo['subject']['CN'];
if (isset($certInfo['subject']['O'])) $subject['organization'] = $certInfo['subject']['O'];
}
$result['certificate'] = [
'subject' => $subject,
'issuer' => $issuer,
'valid_from' => date('Y-m-d H:i:s', $validFrom),
'valid_to' => date('Y-m-d H:i:s', $validTo),
'days_until_expiry' => $daysUntilExpiry,
'is_expired' => $isExpired,
'serial_number' => $certInfo['serialNumberHex'] ?? null,
'signature_algorithm' => $certInfo['signatureTypeSN'] ?? null,
'san_domains' => $sans,
'version' => $certInfo['version'] ?? null,
];
// Warnung wenn bald ablaufend
if ($daysUntilExpiry <= 30 && $daysUntilExpiry > 0) {
$result['warning'] = "Zertifikat läuft in {$daysUntilExpiry} Tagen ab!";
} elseif ($isExpired) {
$result['error'] = 'Zertifikat ist abgelaufen!';
$result['is_valid'] = false;
}
}
}
fclose($socket);
return $result;
}

365
api/whois-lookup.php Normal file
View File

@@ -0,0 +1,365 @@
<?php
/**
* HexaDNS - WHOIS Lookup API
*
* Ruft WHOIS-Informationen für eine Domain ab
*
* Verwendung: GET /api/whois-lookup.php?domain=example.com
*/
header('Content-Type: application/json; charset=utf-8');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, OPTIONS');
header('Access-Control-Allow-Headers: Content-Type');
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
http_response_code(200);
exit;
}
$domain = isset($_GET['domain']) ? trim($_GET['domain']) : '';
if (empty($domain)) {
http_response_code(400);
echo json_encode(['error' => 'Domain-Parameter fehlt']);
exit;
}
// Nur Root-Domain extrahieren
$domain = extractRootDomain($domain);
if (!preg_match('/^[a-zA-Z0-9][a-zA-Z0-9\-]*\.[a-zA-Z]{2,}$/', $domain)) {
http_response_code(400);
echo json_encode(['error' => 'Ungültiges Domain-Format']);
exit;
}
$startTime = microtime(true);
$whoisData = performWhoisLookup($domain);
$queryTime = round((microtime(true) - $startTime) * 1000, 2);
if ($whoisData === null) {
http_response_code(500);
echo json_encode(['error' => 'WHOIS-Abfrage fehlgeschlagen']);
exit;
}
echo json_encode([
'success' => true,
'domain' => $domain,
'query_time_ms' => $queryTime,
'timestamp' => date('Y-m-d H:i:s'),
'whois' => $whoisData
], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
/**
* Extrahiert die Root-Domain (ohne Subdomain)
*/
function extractRootDomain(string $domain): string {
$domain = strtolower($domain);
$domain = preg_replace('/^(https?:\/\/)?(www\.)?/', '', $domain);
$domain = explode('/', $domain)[0];
$parts = explode('.', $domain);
if (count($parts) > 2) {
// Einfache Logik: nimm die letzten 2 Teile
// (funktioniert nicht perfekt für .co.uk etc., aber gut genug)
return implode('.', array_slice($parts, -2));
}
return $domain;
}
/**
* Führt WHOIS-Lookup durch
*/
function performWhoisLookup(string $domain): ?array {
// Primär: Socket-basierte Abfrage (funktioniert ohne shell_exec)
$whoisRaw = whoisViaSocket($domain);
// Fallback: Shell-Kommando (sicher escaped)
if (empty($whoisRaw) && function_exists('shell_exec')) {
$escapedDomain = escapeshellarg($domain);
$whoisRaw = @shell_exec("whois {$escapedDomain} 2>/dev/null");
}
if (empty($whoisRaw)) {
return null;
}
// Parse WHOIS-Daten
return parseWhoisData($whoisRaw, $domain);
}
/**
* WHOIS-Abfrage über Socket (unabhängig von shell_exec)
*/
function whoisViaSocket(string $domain): ?string {
$whoisServer = getWhoisServer($domain);
if (!$whoisServer) {
return null;
}
$result = queryWhoisServer($whoisServer, $domain);
// Prüfe auf Weiterleitungen zu anderen WHOIS-Servern
if ($result && preg_match('/Registrar WHOIS Server:\s*(\S+)/i', $result, $matches)) {
$referralServer = trim($matches[1]);
if ($referralServer && $referralServer !== $whoisServer) {
$referralResult = queryWhoisServer($referralServer, $domain);
if ($referralResult) {
$result = $referralResult;
}
}
}
return $result;
}
/**
* Abfrage an einen spezifischen WHOIS-Server
*/
function queryWhoisServer(string $server, string $domain): ?string {
$port = 43;
$timeout = 10;
$socket = @fsockopen($server, $port, $errno, $errstr, $timeout);
if (!$socket) {
return null;
}
// Setze Stream-Timeout
stream_set_timeout($socket, $timeout);
// Sende Anfrage
fwrite($socket, $domain . "\r\n");
// Lese Antwort
$response = '';
while (!feof($socket)) {
$response .= fread($socket, 8192);
}
fclose($socket);
return !empty($response) ? $response : null;
}
/**
* Ermittelt den zuständigen WHOIS-Server für eine TLD
*/
function getWhoisServer(string $domain): ?string {
$parts = explode('.', $domain);
$tld = strtolower(end($parts));
// Bekannte WHOIS-Server nach TLD
$whoisServers = [
// Generische TLDs
'com' => 'whois.verisign-grs.com',
'net' => 'whois.verisign-grs.com',
'org' => 'whois.pir.org',
'info' => 'whois.afilias.net',
'biz' => 'whois.biz',
'name' => 'whois.nic.name',
'mobi' => 'whois.dotmobiregistry.net',
'pro' => 'whois.registrypro.pro',
'aero' => 'whois.aero',
'asia' => 'whois.nic.asia',
'cat' => 'whois.nic.cat',
'coop' => 'whois.nic.coop',
'edu' => 'whois.educause.edu',
'gov' => 'whois.dotgov.gov',
'int' => 'whois.iana.org',
'jobs' => 'whois.nic.jobs',
'mil' => 'whois.nic.mil',
'museum' => 'whois.museum',
'post' => 'whois.dotpostregistry.net',
'tel' => 'whois.nic.tel',
'travel' => 'whois.nic.travel',
'xxx' => 'whois.nic.xxx',
// Neue gTLDs
'app' => 'whois.nic.google',
'dev' => 'whois.nic.google',
'page' => 'whois.nic.google',
'blog' => 'whois.nic.blog',
'cloud' => 'whois.nic.cloud',
'shop' => 'whois.nic.shop',
'store' => 'whois.nic.store',
'online' => 'whois.nic.online',
'site' => 'whois.nic.site',
'website' => 'whois.nic.website',
'tech' => 'whois.nic.tech',
'io' => 'whois.nic.io',
'co' => 'whois.nic.co',
'me' => 'whois.nic.me',
'tv' => 'whois.nic.tv',
'cc' => 'ccwhois.verisign-grs.com',
'ws' => 'whois.website.ws',
// Europäische ccTLDs
'de' => 'whois.denic.de',
'at' => 'whois.nic.at',
'ch' => 'whois.nic.ch',
'li' => 'whois.nic.li',
'uk' => 'whois.nic.uk',
'fr' => 'whois.nic.fr',
'it' => 'whois.nic.it',
'es' => 'whois.nic.es',
'pt' => 'whois.dns.pt',
'nl' => 'whois.domain-registry.nl',
'be' => 'whois.dns.be',
'pl' => 'whois.dns.pl',
'cz' => 'whois.nic.cz',
'sk' => 'whois.sk-nic.sk',
'hu' => 'whois.nic.hu',
'ro' => 'whois.rotld.ro',
'bg' => 'whois.register.bg',
'hr' => 'whois.dns.hr',
'si' => 'whois.register.si',
'rs' => 'whois.rnids.rs',
'gr' => 'grwhois.ics.forth.gr',
'dk' => 'whois.punktum.dk',
'se' => 'whois.iis.se',
'no' => 'whois.norid.no',
'fi' => 'whois.fi',
'ie' => 'whois.iedr.ie',
'eu' => 'whois.eu',
'lu' => 'whois.dns.lu',
// Andere ccTLDs
'ru' => 'whois.tcinet.ru',
'ua' => 'whois.ua',
'us' => 'whois.nic.us',
'ca' => 'whois.cira.ca',
'mx' => 'whois.mx',
'br' => 'whois.registro.br',
'ar' => 'whois.nic.ar',
'au' => 'whois.auda.org.au',
'nz' => 'whois.srs.net.nz',
'jp' => 'whois.jprs.jp',
'kr' => 'whois.kr',
'cn' => 'whois.cnnic.cn',
'in' => 'whois.registry.in',
'sg' => 'whois.sgnic.sg',
'hk' => 'whois.hkirc.hk',
'tw' => 'whois.twnic.net.tw',
'za' => 'whois.registry.net.za',
];
// Spezielle Behandlung für .co.uk, .com.au etc.
if (count($parts) >= 2) {
$sld = $parts[count($parts) - 2];
$combinedTld = $sld . '.' . $tld;
$secondLevelTlds = [
'co.uk' => 'whois.nic.uk',
'org.uk' => 'whois.nic.uk',
'me.uk' => 'whois.nic.uk',
'com.au' => 'whois.auda.org.au',
'net.au' => 'whois.auda.org.au',
'org.au' => 'whois.auda.org.au',
'co.nz' => 'whois.srs.net.nz',
'com.br' => 'whois.registro.br',
];
if (isset($secondLevelTlds[$combinedTld])) {
return $secondLevelTlds[$combinedTld];
}
}
return $whoisServers[$tld] ?? 'whois.iana.org';
}
/**
* Parsed WHOIS-Rohdaten in strukturiertes Format
*/
function parseWhoisData(string $raw, string $domain): array {
$data = [
'raw' => $raw,
'parsed' => [
'domain_name' => $domain,
'registrar' => null,
'registrar_url' => null,
'creation_date' => null,
'expiration_date' => null,
'updated_date' => null,
'status' => [],
'nameservers' => [],
'dnssec' => null,
]
];
$lines = explode("\n", $raw);
foreach ($lines as $line) {
$line = trim($line);
if (empty($line) || strpos($line, '%') === 0 || strpos($line, '#') === 0) {
continue;
}
// Key: Value Format
if (strpos($line, ':') !== false) {
list($key, $value) = array_map('trim', explode(':', $line, 2));
$keyLower = strtolower($key);
// Registrar
if (strpos($keyLower, 'registrar') !== false && strpos($keyLower, 'abuse') === false && strpos($keyLower, 'url') === false) {
if (empty($data['parsed']['registrar'])) {
$data['parsed']['registrar'] = $value;
}
}
// Registrar URL
if (strpos($keyLower, 'registrar') !== false && strpos($keyLower, 'url') !== false) {
$data['parsed']['registrar_url'] = $value;
}
// Erstellungsdatum
if (preg_match('/(creation|created|registered)/i', $keyLower) && strpos($keyLower, 'registrar') === false) {
if (empty($data['parsed']['creation_date'])) {
$data['parsed']['creation_date'] = $value;
}
}
// Ablaufdatum
if (preg_match('/(expir|paid-till)/i', $keyLower)) {
if (empty($data['parsed']['expiration_date'])) {
$data['parsed']['expiration_date'] = $value;
}
}
// Aktualisierungsdatum
if (preg_match('/(updated|modified|changed)/i', $keyLower) && strpos($keyLower, 'registrar') === false) {
if (empty($data['parsed']['updated_date'])) {
$data['parsed']['updated_date'] = $value;
}
}
// Status
if (preg_match('/(status|state)/i', $keyLower) && !empty($value)) {
$data['parsed']['status'][] = $value;
}
// Nameserver
if (preg_match('/^(name.?server|nserver)/i', $keyLower) && !empty($value)) {
$ns = strtolower(explode(' ', $value)[0]);
if (!in_array($ns, $data['parsed']['nameservers'])) {
$data['parsed']['nameservers'][] = $ns;
}
}
// DNSSEC
if (strpos($keyLower, 'dnssec') !== false) {
$data['parsed']['dnssec'] = $value;
}
}
}
// Status einzigartig machen
$data['parsed']['status'] = array_unique($data['parsed']['status']);
return $data;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,171 +1,17 @@
<?php <?php
/** /**
* HexaHost.de SMTP Konfiguration * HexaHost.de Konfiguration
* *
* WICHTIG: Ändern Sie diese Werte entsprechend Ihren SMTP-Einstellungen! * HINWEIS: Diese Datei ist veraltet!
* *
* Beispiele für verschiedene E-Mail-Provider: * Die Konfiguration wurde nach mail-config.php verschoben.
* Bitte verwenden Sie stattdessen:
* *
* Gmail: * require_once 'config/mail-config.php';
* - smtp_host: smtp.gmail.com
* - smtp_port: 587
* - smtp_encryption: tls
* *
* Outlook/Hotmail: * Diese Datei wird nur aus Kompatibilitätsgründen beibehalten.
* - smtp_host: smtp-mail.outlook.com
* - smtp_port: 587
* - smtp_encryption: tls
*
* GMX:
* - smtp_host: mail.gmx.net
* - smtp_port: 587
* - smtp_encryption: tls
*
* Web.de:
* - smtp_host: smtp.web.de
* - smtp_port: 587
* - smtp_encryption: tls
*
* Eigener Mail-Server:
* - smtp_host: mail.ihre-domain.de
* - smtp_port: 587 (oder 465 für SSL)
* - smtp_encryption: tls (oder ssl)
*/ */
// SMTP Konfiguration - HIER IHRE WERTE EINTRAGEN // Lade die neue Konfiguration
$smtp_config = [ require_once __DIR__ . '/mail-config.php';
// SMTP Server-Einstellungen
'smtp_host' => 'smtp.gmail.com', // z.B. smtp.gmail.com
'smtp_port' => 587, // 587 für TLS, 465 für SSL
'smtp_username' => 'test@hexahost.de', // z.B. info@hexahost.de
'smtp_password' => 'your-app-password', // Ihr SMTP-Passwort
'smtp_encryption' => 'tls', // 'tls' oder 'ssl'
// Absender-Einstellungen
'from_email' => 'test@hexahost.de', // Absender-E-Mail
'from_name' => 'HexaHost.de Kontaktformular', // Absender-Name
// Empfänger-Einstellungen
'to_email' => 'info@hexahost.de', // Empfänger-E-Mail
'to_name' => 'HexaHost Support', // Empfänger-Name
// Sicherheitseinstellungen
'max_requests_per_hour' => 5, // Max. Anfragen pro Stunde pro IP
'honeypot_field' => 'website', // Verstecktes Feld für Bot-Schutz
// E-Mail-Template-Einstellungen
'email_template' => 'html', // 'html' oder 'text'
'include_ip_address' => true, // IP-Adresse in E-Mail anzeigen
'include_timestamp' => true, // Zeitstempel in E-Mail anzeigen
];
// DNS-Einstellungen für Spam-Schutz (werden über DNS konfiguriert)
$dns_config = [
// SPF Record (TXT Record in DNS)
'spf_record' => 'v=spf1 include:_spf.hexahost.de ~all',
// DMARC Record (TXT Record in DNS)
'dmarc_record' => 'v=DMARC1; p=quarantine; rua=mailto:dmarc@hexahost.de',
// DKIM wird über den Mail-Server konfiguriert
];
// Debug-Einstellungen (nur für Entwicklung)
$debug_config = [
'debug_mode' => false, // Debug-Modus aktivieren
'log_errors' => true, // Fehler loggen
'log_file' => 'contact_form_errors.log', // Log-Datei
];
// Exportiere Konfiguration für andere Dateien
if (!defined('HEXAHOST_CONFIG_LOADED')) {
define('HEXAHOST_CONFIG_LOADED', true);
// Globale Variablen für andere Dateien
$GLOBALS['hexahost_smtp_config'] = $smtp_config;
$GLOBALS['hexahost_dns_config'] = $dns_config;
$GLOBALS['hexahost_debug_config'] = $debug_config;
}
// Hilfsfunktion zum Abrufen der Konfiguration
function getHexaHostConfig($key = null) {
global $smtp_config, $dns_config, $debug_config;
if ($key === null) {
return array_merge($smtp_config, $dns_config, $debug_config);
}
if (isset($smtp_config[$key])) {
return $smtp_config[$key];
}
if (isset($dns_config[$key])) {
return $dns_config[$key];
}
if (isset($debug_config[$key])) {
return $debug_config[$key];
}
return null;
}
// Debug-Funktion
function hexahostDebug($message, $type = 'info') {
global $debug_config;
if (!$debug_config['debug_mode']) {
return;
}
$timestamp = date('Y-m-d H:i:s');
$log_message = "[$timestamp] [$type] $message" . PHP_EOL;
if ($debug_config['log_errors']) {
error_log($log_message, 3, $debug_config['log_file']);
}
if ($debug_config['debug_mode']) {
echo "<!-- HexaHost Debug: $message -->\n";
}
}
// Validierung der SMTP-Konfiguration
function validateSMTPConfig() {
$config = getHexaHostConfig();
$errors = [];
// Prüfe ob alle erforderlichen Felder ausgefüllt sind
$required_fields = ['smtp_host', 'smtp_username', 'smtp_password', 'from_email', 'to_email'];
foreach ($required_fields as $field) {
if (empty($config[$field]) || $config[$field] === 'YOUR_SMTP_' . strtoupper(substr($field, 5))) {
$errors[] = "Konfigurationsfehler: $field ist nicht korrekt eingestellt.";
}
}
// Prüfe SMTP-Port
if (!is_numeric($config['smtp_port']) || $config['smtp_port'] < 1 || $config['smtp_port'] > 65535) {
$errors[] = "Konfigurationsfehler: Ungültiger SMTP-Port.";
}
// Prüfe E-Mail-Format
if (!filter_var($config['from_email'], FILTER_VALIDATE_EMAIL)) {
$errors[] = "Konfigurationsfehler: Ungültige Absender-E-Mail.";
}
if (!filter_var($config['to_email'], FILTER_VALIDATE_EMAIL)) {
$errors[] = "Konfigurationsfehler: Ungültige Empfänger-E-Mail.";
}
return $errors;
}
// Zeige Konfigurationsfehler an (nur im Debug-Modus)
if (getHexaHostConfig('debug_mode')) {
$config_errors = validateSMTPConfig();
if (!empty($config_errors)) {
hexahostDebug('SMTP-Konfigurationsfehler: ' . implode(', ', $config_errors), 'error');
}
}
?> ?>

View File

@@ -140,16 +140,59 @@ function isValidEmail($email) {
return true; return true;
} }
// CSRF Token generieren // CSRF Token generieren (wird in functions.php verwendet)
// Hinweis: Diese Funktion existiert auch in functions.php - hier nur als Fallback
if (!function_exists('generateCSRFToken')) {
function generateCSRFToken() { function generateCSRFToken() {
if (!isset($_SESSION['csrf_token'])) { if (!isset($_SESSION['csrf_token'])) {
$_SESSION['csrf_token'] = bin2hex(random_bytes(32)); $_SESSION['csrf_token'] = bin2hex(random_bytes(32));
} }
return $_SESSION['csrf_token']; return $_SESSION['csrf_token'];
} }
}
// CSRF Token validieren // CSRF Token validieren
if (!function_exists('validateCSRFToken')) {
function validateCSRFToken($token) { function validateCSRFToken($token) {
return isset($_SESSION['csrf_token']) && hash_equals($_SESSION['csrf_token'], $token); return isset($_SESSION['csrf_token']) && hash_equals($_SESSION['csrf_token'], $token);
} }
}
/**
* Hilfsfunktion zum Abrufen der Konfiguration als Array
* Kompatibilität mit contact-handler.php
*
* @param string|null $key Optional: einzelner Schlüssel
* @return mixed Konfigurationsarray oder einzelner Wert
*/
function getHexaHostConfig($key = null) {
$config = [
// SMTP Server-Einstellungen
'smtp_host' => SMTP_HOST,
'smtp_port' => SMTP_PORT,
'smtp_username' => SMTP_USERNAME,
'smtp_password' => SMTP_PASSWORD,
'smtp_encryption' => 'tls',
// Absender/Empfänger
'from_email' => SMTP_FROM_EMAIL,
'from_name' => 'HexaHost.de Kontaktformular',
'to_email' => SMTP_TO_EMAIL,
'to_name' => 'HexaHost Support',
// Sicherheit
'max_requests_per_hour' => MAX_REQUESTS_PER_HOUR,
'honeypot_field' => 'website',
// Debug
'debug_mode' => DEBUG_MODE,
'log_errors' => LOG_EMAILS,
];
if ($key === null) {
return $config;
}
return $config[$key] ?? null;
}
?> ?>

541
config/products-config.php Normal file
View File

@@ -0,0 +1,541 @@
<?php
/**
* HexaHost.de Produkt-Konfiguration
*
* Hier können Sie alle Preise und Produktinformationen zentral verwalten.
* Nach Änderungen: npm run build && npm run deploy
*
* Verwendung in PHP-Seiten:
* require_once 'config/products-config.php';
* $packages = getProductPackages('vpc');
*/
// ============================================================================
// VIRTUAL PRIVATE CONTAINER (VPC)
// ============================================================================
$PRODUCTS['vpc'] = [
'name' => 'Virtual Private Container',
'short_name' => 'VPC',
'description' => 'Effiziente LXC-Container auf Proxmox-Basis',
'min_price' => '4,99',
'hero_highlight' => 'auf Proxmox LXC',
'hero_description' => 'Erleben Sie die Effizienz von Linux-Containern mit der Zuverlässigkeit von Proxmox. Unsere VPC-Lösungen bieten optimale Performance bei minimalem Ressourcenverbrauch.',
'packages_title' => 'VPC Pakete',
'packages_description' => 'Wählen Sie das perfekte Container-Paket für Ihre Anforderungen',
'cta_title' => 'Bereit für Ihren VPC?',
'cta_description' => 'Starten Sie noch heute mit einem Virtual Private Container',
'page_title' => 'Virtual Private Container - Effiziente LXC Container | HexaHost.de',
'page_description' => 'Virtual Private Container auf Proxmox LXC-Basis. Effiziente und preiswerte Container-Lösungen ab 4,99€/Monat bei HexaHost.de',
'packages' => [
'starter' => [
'name' => 'VPC Starter',
'price' => '4,99',
'featured' => false,
'specs' => [
['label' => 'CPU Kerne', 'value' => '1 vCore'],
['label' => 'RAM', 'value' => '1 GB'],
['label' => 'SSD Speicher', 'value' => '20 GB'],
['label' => 'Traffic', 'value' => '1 TB'],
['label' => 'IPv4 Adressen', 'value' => '1'],
],
'features' => [
'Proxmox LXC Container',
'Root-Zugriff',
'SSH-Zugang',
'Backup inklusive',
'24/7 Monitoring',
],
],
'business' => [
'name' => 'VPC Business',
'price' => '9,99',
'featured' => true,
'specs' => [
['label' => 'CPU Kerne', 'value' => '2 vCores'],
['label' => 'RAM', 'value' => '4 GB'],
['label' => 'SSD Speicher', 'value' => '80 GB'],
['label' => 'Traffic', 'value' => '3 TB'],
['label' => 'IPv4 Adressen', 'value' => '1'],
],
'features' => [
'Proxmox LXC Container',
'Root-Zugriff',
'SSH-Zugang',
'Tägliches Backup',
'24/7 Monitoring',
'Snapshot-Funktion',
],
],
'professional' => [
'name' => 'VPC Professional',
'price' => '19,99',
'featured' => false,
'specs' => [
['label' => 'CPU Kerne', 'value' => '4 vCores'],
['label' => 'RAM', 'value' => '8 GB'],
['label' => 'SSD Speicher', 'value' => '160 GB'],
['label' => 'Traffic', 'value' => '5 TB'],
['label' => 'IPv4 Adressen', 'value' => '2'],
],
'features' => [
'Proxmox LXC Container',
'Root-Zugriff',
'SSH-Zugang',
'Stündliches Backup',
'24/7 Monitoring',
'Snapshot-Funktion',
'Priority Support',
],
],
'enterprise' => [
'name' => 'VPC Enterprise',
'price' => '39,99',
'featured' => false,
'specs' => [
['label' => 'CPU Kerne', 'value' => '8 vCores'],
['label' => 'RAM', 'value' => '16 GB'],
['label' => 'SSD Speicher', 'value' => '320 GB'],
['label' => 'Traffic', 'value' => '10 TB'],
['label' => 'IPv4 Adressen', 'value' => '3'],
],
'features' => [
'Proxmox LXC Container',
'Root-Zugriff',
'SSH-Zugang',
'Stündliches Backup',
'24/7 Monitoring',
'Snapshot-Funktion',
'Priority Support',
'Individuelle Konfiguration',
],
],
],
];
// ============================================================================
// VIRTUAL PRIVATE SERVER (VPS)
// ============================================================================
$PRODUCTS['vps'] = [
'name' => 'Virtual Private Server',
'short_name' => 'VPS',
'description' => 'Vollwertige KVM-Virtualisierung mit Root-Zugriff',
'min_price' => '9,99',
'hero_highlight' => 'auf Proxmox KVM',
'hero_description' => 'Maximale Flexibilität und Kontrolle mit vollwertiger KVM-Virtualisierung. Installieren Sie jedes Betriebssystem und genießen Sie vollständigen Root-Zugriff.',
'packages_title' => 'VPS Pakete',
'packages_description' => 'Wählen Sie das perfekte VPS-Paket für Ihre Anforderungen',
'cta_title' => 'Bereit für Ihren VPS?',
'cta_description' => 'Starten Sie noch heute mit einem Virtual Private Server',
'page_title' => 'Virtual Private Server - KVM Virtualisierung | HexaHost.de',
'page_description' => 'Virtual Private Server auf Proxmox KVM-Basis. Vollwertige Virtualisierung mit Root-Zugriff ab 9,99€/Monat bei HexaHost.de',
'packages' => [
'starter' => [
'name' => 'VPS Starter',
'price' => '9,99',
'featured' => false,
'specs' => [
['label' => 'CPU Kerne', 'value' => '1 vCore'],
['label' => 'RAM', 'value' => '2 GB'],
['label' => 'SSD Speicher', 'value' => '40 GB'],
['label' => 'Traffic', 'value' => '2 TB'],
['label' => 'IPv4 Adressen', 'value' => '1'],
],
'features' => [
'Proxmox KVM Virtualisierung',
'Root-Zugriff',
'SSH-Zugang',
'Backup inklusive',
'24/7 Monitoring',
],
],
'business' => [
'name' => 'VPS Business',
'price' => '19,99',
'featured' => true,
'specs' => [
['label' => 'CPU Kerne', 'value' => '2 vCores'],
['label' => 'RAM', 'value' => '4 GB'],
['label' => 'SSD Speicher', 'value' => '80 GB'],
['label' => 'Traffic', 'value' => '4 TB'],
['label' => 'IPv4 Adressen', 'value' => '1'],
],
'features' => [
'Proxmox KVM Virtualisierung',
'Root-Zugriff',
'SSH-Zugang',
'Tägliches Backup',
'24/7 Monitoring',
'Snapshot-Funktion',
],
],
'professional' => [
'name' => 'VPS Professional',
'price' => '39,99',
'featured' => false,
'specs' => [
['label' => 'CPU Kerne', 'value' => '4 vCores'],
['label' => 'RAM', 'value' => '8 GB'],
['label' => 'SSD Speicher', 'value' => '160 GB'],
['label' => 'Traffic', 'value' => '8 TB'],
['label' => 'IPv4 Adressen', 'value' => '2'],
],
'features' => [
'Proxmox KVM Virtualisierung',
'Root-Zugriff',
'SSH-Zugang',
'Stündliches Backup',
'24/7 Monitoring',
'Snapshot-Funktion',
'Priority Support',
],
],
'enterprise' => [
'name' => 'VPS Enterprise',
'price' => '79,99',
'featured' => false,
'specs' => [
['label' => 'CPU Kerne', 'value' => '8 vCores'],
['label' => 'RAM', 'value' => '16 GB'],
['label' => 'SSD Speicher', 'value' => '320 GB'],
['label' => 'Traffic', 'value' => '15 TB'],
['label' => 'IPv4 Adressen', 'value' => '3'],
],
'features' => [
'Proxmox KVM Virtualisierung',
'Root-Zugriff',
'SSH-Zugang',
'Stündliches Backup',
'24/7 Monitoring',
'Snapshot-Funktion',
'Priority Support',
'Individuelle Konfiguration',
],
],
],
];
// ============================================================================
// MAIL GATEWAY
// ============================================================================
$PRODUCTS['mail-gateway'] = [
'name' => 'Mail Gateway',
'short_name' => 'Mail',
'description' => 'Professioneller E-Mail-Schutz für Unternehmen',
'min_price' => '4,99',
'hero_highlight' => 'für Unternehmen',
'hero_description' => 'Professionelle E-Mail-Infrastruktur mit maximalem Schutz vor Spam und Malware. Sichern Sie Ihre geschäftliche Kommunikation mit unseren Mail Gateway Lösungen.',
'packages_title' => 'Mail Gateway Pakete',
'packages_description' => 'Wählen Sie das passende Mail Gateway Paket für Ihr Unternehmen',
'cta_title' => 'Bereit für professionelle E-Mail-Kommunikation?',
'cta_description' => 'Starten Sie noch heute mit unserem Mail Gateway',
'page_title' => 'Mail Gateway - Professionelle E-Mail-Lösungen | HexaHost.de',
'page_description' => 'Professionelle Mail Gateway Lösungen für Unternehmen. Spam-Schutz, E-Mail-Archivierung und sichere E-Mail-Kommunikation bei HexaHost.de',
'packages' => [
'starter' => [
'name' => 'Mail Starter',
'price' => '4,99',
'featured' => false,
'specs' => [
['label' => 'Postfächer', 'value' => '5'],
['label' => 'Speicher/Postfach', 'value' => '5 GB'],
['label' => 'Domains', 'value' => '1'],
['label' => 'E-Mails/Tag', 'value' => '500'],
],
'features' => [
'Spam-Filter',
'Virus-Schutz',
'Webmail',
'IMAP/POP3',
'SSL/TLS Verschlüsselung',
],
],
'business' => [
'name' => 'Mail Business',
'price' => '14,99',
'featured' => true,
'specs' => [
['label' => 'Postfächer', 'value' => '25'],
['label' => 'Speicher/Postfach', 'value' => '10 GB'],
['label' => 'Domains', 'value' => '3'],
['label' => 'E-Mails/Tag', 'value' => '2.000'],
],
'features' => [
'Spam-Filter (erweitert)',
'Virus-Schutz',
'Webmail',
'IMAP/POP3',
'SSL/TLS Verschlüsselung',
'E-Mail Archivierung (30 Tage)',
'Kalender & Kontakte',
],
],
'professional' => [
'name' => 'Mail Professional',
'price' => '29,99',
'featured' => false,
'specs' => [
['label' => 'Postfächer', 'value' => '100'],
['label' => 'Speicher/Postfach', 'value' => '25 GB'],
['label' => 'Domains', 'value' => '10'],
['label' => 'E-Mails/Tag', 'value' => '10.000'],
],
'features' => [
'Spam-Filter (KI-gestützt)',
'Virus-Schutz',
'Webmail',
'IMAP/POP3',
'SSL/TLS Verschlüsselung',
'E-Mail Archivierung (1 Jahr)',
'Kalender & Kontakte',
'ActiveSync für Mobile',
],
],
'enterprise' => [
'name' => 'Mail Enterprise',
'price' => '59,99',
'featured' => false,
'specs' => [
['label' => 'Postfächer', 'value' => 'Unbegrenzt'],
['label' => 'Speicher/Postfach', 'value' => '50 GB'],
['label' => 'Domains', 'value' => 'Unbegrenzt'],
['label' => 'E-Mails/Tag', 'value' => 'Unbegrenzt'],
],
'features' => [
'Spam-Filter (KI-gestützt)',
'Virus-Schutz',
'Webmail',
'IMAP/POP3',
'SSL/TLS Verschlüsselung',
'E-Mail Archivierung (10 Jahre)',
'Kalender & Kontakte',
'ActiveSync für Mobile',
'Dedizierte IP',
'Priority Support',
],
],
],
];
// ============================================================================
// WEBHOSTING
// ============================================================================
$PRODUCTS['webhosting'] = [
'name' => 'Webhosting',
'short_name' => 'Webhosting',
'description' => 'Klassisches Hosting mit PHP, MySQL und SSL',
'min_price' => '1,99',
'hero_highlight' => 'Alles für Ihre Website',
'hero_description' => 'Klassisches Webhosting mit allem, was Sie für eine erfolgreiche Website benötigen. PHP, MySQL, SSL-Zertifikate und E-Mail-Postfächer - alles inklusive.',
'packages_title' => 'Webhosting Pakete',
'packages_description' => 'Von der ersten Website bis zum professionellen Online-Shop',
'cta_title' => 'Bereit für Ihr Webhosting?',
'cta_description' => 'Starten Sie noch heute mit professionellem Webhosting',
'page_title' => 'Webhosting - Klassisches Hosting für Websites | HexaHost.de',
'page_description' => 'Webhosting mit PHP, MySQL und SSL-Zertifikaten. Klassisches Hosting für Websites ab 1,99€/Monat bei HexaHost.de',
'packages' => [
'starter' => [
'name' => 'Webhosting Starter',
'price' => '1,99',
'featured' => false,
'specs' => [
['label' => 'Webspace', 'value' => '5 GB'],
['label' => 'Domains', 'value' => '1'],
['label' => 'E-Mail-Postfächer', 'value' => '5'],
['label' => 'Datenbanken', 'value' => '1 MySQL'],
['label' => 'Traffic', 'value' => '10 GB'],
],
'features' => [
'cPanel/Webmin',
'PHP 8.1',
'SSL-Zertifikat',
'E-Mail-Postfächer',
'MySQL Datenbank',
],
],
'business' => [
'name' => 'Webhosting Business',
'price' => '4,99',
'featured' => true,
'specs' => [
['label' => 'Webspace', 'value' => '20 GB'],
['label' => 'Domains', 'value' => '5'],
['label' => 'E-Mail-Postfächer', 'value' => '25'],
['label' => 'Datenbanken', 'value' => '5 MySQL'],
['label' => 'Traffic', 'value' => '50 GB'],
],
'features' => [
'cPanel/Webmin',
'PHP 8.1',
'SSL-Zertifikat',
'E-Mail-Postfächer',
'MySQL Datenbanken',
'Backup-Service',
],
],
'professional' => [
'name' => 'Webhosting Professional',
'price' => '9,99',
'featured' => false,
'specs' => [
['label' => 'Webspace', 'value' => '50 GB'],
['label' => 'Domains', 'value' => 'Unbegrenzt'],
['label' => 'E-Mail-Postfächer', 'value' => '100'],
['label' => 'Datenbanken', 'value' => 'Unbegrenzt'],
['label' => 'Traffic', 'value' => '200 GB'],
],
'features' => [
'cPanel/Webmin',
'PHP 8.1',
'SSL-Zertifikat',
'E-Mail-Postfächer',
'MySQL Datenbanken',
'Backup-Service',
'Priority Support',
],
],
'enterprise' => [
'name' => 'Webhosting Enterprise',
'price' => '19,99',
'featured' => false,
'specs' => [
['label' => 'Webspace', 'value' => '100 GB'],
['label' => 'Domains', 'value' => 'Unbegrenzt'],
['label' => 'E-Mail-Postfächer', 'value' => 'Unbegrenzt'],
['label' => 'Datenbanken', 'value' => 'Unbegrenzt'],
['label' => 'Traffic', 'value' => '500 GB'],
],
'features' => [
'cPanel/Webmin',
'PHP 8.1',
'SSL-Zertifikat',
'E-Mail-Postfächer',
'MySQL Datenbanken',
'Backup-Service',
'Priority Support',
'Individuelle Konfiguration',
],
],
],
];
// ============================================================================
// HILFSFUNKTIONEN
// ============================================================================
/**
* Alle Produkte abrufen
*/
function getAllProducts() {
global $PRODUCTS;
return $PRODUCTS;
}
/**
* Ein Produkt abrufen
*/
function getProduct($productId) {
global $PRODUCTS;
return $PRODUCTS[$productId] ?? null;
}
/**
* Alle Pakete eines Produkts abrufen
*/
function getProductPackages($productId) {
global $PRODUCTS;
return $PRODUCTS[$productId]['packages'] ?? [];
}
/**
* Ein bestimmtes Paket abrufen
*/
function getPackage($productId, $packageId) {
global $PRODUCTS;
return $PRODUCTS[$productId]['packages'][$packageId] ?? null;
}
/**
* Preis eines Pakets abrufen
*/
function getPackagePrice($productId, $packageId) {
$package = getPackage($productId, $packageId);
return $package['price'] ?? null;
}
/**
* Minimalen Preis eines Produkts abrufen
*/
function getMinPrice($productId) {
global $PRODUCTS;
return $PRODUCTS[$productId]['min_price'] ?? null;
}
/**
* Preis formatiert ausgeben
*/
function formatPrice($price, $withCurrency = true) {
return $withCurrency ? $price . '€' : $price;
}
/**
* Generiert HTML für eine Paket-Karte
*/
function renderPackageCard($productId, $packageId, $package) {
$featuredClass = $package['featured'] ? ' featured' : '';
$featuredBadge = $package['featured'] ? '<div class="featured-badge">Beliebt</div>' : '';
$specsHtml = '';
foreach ($package['specs'] as $spec) {
$specsHtml .= sprintf(
'<div class="spec-item"><span class="spec-label">%s:</span><span class="spec-value">%s</span></div>',
htmlspecialchars($spec['label']),
htmlspecialchars($spec['value'])
);
}
$featuresHtml = '';
foreach ($package['features'] as $feature) {
$featuresHtml .= sprintf('<div class="feature">✓ %s</div>', htmlspecialchars($feature));
}
return sprintf('
<div class="package-card glass-card%s">
%s
<div class="package-header">
<h3 class="package-name">%s</h3>
<div class="package-price">
<span class="price">%s€</span>
<span class="period">/Monat</span>
</div>
</div>
<div class="package-specs">
%s
</div>
<div class="package-features">
%s
</div>
<a href="contact.php?package=%s-%s" class="btn btn-primary">Jetzt bestellen</a>
</div>',
$featuredClass,
$featuredBadge,
htmlspecialchars($package['name']),
$package['price'],
$specsHtml,
$featuresHtml,
$productId,
$packageId
);
}
/**
* Generiert HTML für alle Pakete eines Produkts
*/
function renderAllPackages($productId) {
$packages = getProductPackages($productId);
$html = '';
foreach ($packages as $packageId => $package) {
$html .= renderPackageCard($productId, $packageId, $package);
}
return $html;
}
?>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

171
dist/config/config.php vendored
View File

@@ -1,171 +0,0 @@
<?php
/**
* HexaHost.de SMTP Konfiguration
*
* WICHTIG: Ändern Sie diese Werte entsprechend Ihren SMTP-Einstellungen!
*
* Beispiele für verschiedene E-Mail-Provider:
*
* Gmail:
* - smtp_host: smtp.gmail.com
* - smtp_port: 587
* - smtp_encryption: tls
*
* Outlook/Hotmail:
* - smtp_host: smtp-mail.outlook.com
* - smtp_port: 587
* - smtp_encryption: tls
*
* GMX:
* - smtp_host: mail.gmx.net
* - smtp_port: 587
* - smtp_encryption: tls
*
* Web.de:
* - smtp_host: smtp.web.de
* - smtp_port: 587
* - smtp_encryption: tls
*
* Eigener Mail-Server:
* - smtp_host: mail.ihre-domain.de
* - smtp_port: 587 (oder 465 für SSL)
* - smtp_encryption: tls (oder ssl)
*/
// SMTP Konfiguration - HIER IHRE WERTE EINTRAGEN
$smtp_config = [
// SMTP Server-Einstellungen
'smtp_host' => 'smtp.gmail.com', // z.B. smtp.gmail.com
'smtp_port' => 587, // 587 für TLS, 465 für SSL
'smtp_username' => 'test@hexahost.de', // z.B. info@hexahost.de
'smtp_password' => 'your-app-password', // Ihr SMTP-Passwort
'smtp_encryption' => 'tls', // 'tls' oder 'ssl'
// Absender-Einstellungen
'from_email' => 'test@hexahost.de', // Absender-E-Mail
'from_name' => 'HexaHost.de Kontaktformular', // Absender-Name
// Empfänger-Einstellungen
'to_email' => 'info@hexahost.de', // Empfänger-E-Mail
'to_name' => 'HexaHost Support', // Empfänger-Name
// Sicherheitseinstellungen
'max_requests_per_hour' => 5, // Max. Anfragen pro Stunde pro IP
'honeypot_field' => 'website', // Verstecktes Feld für Bot-Schutz
// E-Mail-Template-Einstellungen
'email_template' => 'html', // 'html' oder 'text'
'include_ip_address' => true, // IP-Adresse in E-Mail anzeigen
'include_timestamp' => true, // Zeitstempel in E-Mail anzeigen
];
// DNS-Einstellungen für Spam-Schutz (werden über DNS konfiguriert)
$dns_config = [
// SPF Record (TXT Record in DNS)
'spf_record' => 'v=spf1 include:_spf.hexahost.de ~all',
// DMARC Record (TXT Record in DNS)
'dmarc_record' => 'v=DMARC1; p=quarantine; rua=mailto:dmarc@hexahost.de',
// DKIM wird über den Mail-Server konfiguriert
];
// Debug-Einstellungen (nur für Entwicklung)
$debug_config = [
'debug_mode' => false, // Debug-Modus aktivieren
'log_errors' => true, // Fehler loggen
'log_file' => 'contact_form_errors.log', // Log-Datei
];
// Exportiere Konfiguration für andere Dateien
if (!defined('HEXAHOST_CONFIG_LOADED')) {
define('HEXAHOST_CONFIG_LOADED', true);
// Globale Variablen für andere Dateien
$GLOBALS['hexahost_smtp_config'] = $smtp_config;
$GLOBALS['hexahost_dns_config'] = $dns_config;
$GLOBALS['hexahost_debug_config'] = $debug_config;
}
// Hilfsfunktion zum Abrufen der Konfiguration
function getHexaHostConfig($key = null) {
global $smtp_config, $dns_config, $debug_config;
if ($key === null) {
return array_merge($smtp_config, $dns_config, $debug_config);
}
if (isset($smtp_config[$key])) {
return $smtp_config[$key];
}
if (isset($dns_config[$key])) {
return $dns_config[$key];
}
if (isset($debug_config[$key])) {
return $debug_config[$key];
}
return null;
}
// Debug-Funktion
function hexahostDebug($message, $type = 'info') {
global $debug_config;
if (!$debug_config['debug_mode']) {
return;
}
$timestamp = date('Y-m-d H:i:s');
$log_message = "[$timestamp] [$type] $message" . PHP_EOL;
if ($debug_config['log_errors']) {
error_log($log_message, 3, $debug_config['log_file']);
}
if ($debug_config['debug_mode']) {
echo "<!-- HexaHost Debug: $message -->\n";
}
}
// Validierung der SMTP-Konfiguration
function validateSMTPConfig() {
$config = getHexaHostConfig();
$errors = [];
// Prüfe ob alle erforderlichen Felder ausgefüllt sind
$required_fields = ['smtp_host', 'smtp_username', 'smtp_password', 'from_email', 'to_email'];
foreach ($required_fields as $field) {
if (empty($config[$field]) || $config[$field] === 'YOUR_SMTP_' . strtoupper(substr($field, 5))) {
$errors[] = "Konfigurationsfehler: $field ist nicht korrekt eingestellt.";
}
}
// Prüfe SMTP-Port
if (!is_numeric($config['smtp_port']) || $config['smtp_port'] < 1 || $config['smtp_port'] > 65535) {
$errors[] = "Konfigurationsfehler: Ungültiger SMTP-Port.";
}
// Prüfe E-Mail-Format
if (!filter_var($config['from_email'], FILTER_VALIDATE_EMAIL)) {
$errors[] = "Konfigurationsfehler: Ungültige Absender-E-Mail.";
}
if (!filter_var($config['to_email'], FILTER_VALIDATE_EMAIL)) {
$errors[] = "Konfigurationsfehler: Ungültige Empfänger-E-Mail.";
}
return $errors;
}
// Zeige Konfigurationsfehler an (nur im Debug-Modus)
if (getHexaHostConfig('debug_mode')) {
$config_errors = validateSMTPConfig();
if (!empty($config_errors)) {
hexahostDebug('SMTP-Konfigurationsfehler: ' . implode(', ', $config_errors), 'error');
}
}
?>

View File

@@ -1,155 +0,0 @@
<?php
/**
* HexaHost.de Mail Configuration
*
* Bitte passen Sie die folgenden SMTP-Einstellungen an Ihre E-Mail-Provider an.
*
* Beispiele für gängige Provider:
*
* Gmail:
* - SMTP_HOST = 'smtp.gmail.com'
* - SMTP_PORT = 587
* - SMTP_USERNAME = 'ihre-email@gmail.com'
* - SMTP_PASSWORD = 'ihr-app-passwort'
*
* Outlook/Hotmail:
* - SMTP_HOST = 'smtp-mail.outlook.com'
* - SMTP_PORT = 587
*
* GMX:
* - SMTP_HOST = 'mail.gmx.net'
* - SMTP_PORT = 587
*
* Web.de:
* - SMTP_HOST = 'smtp.web.de'
* - SMTP_PORT = 587
*
* 1&1:
* - SMTP_HOST = 'smtp.1und1.de'
* - SMTP_PORT = 587
*
* Strato:
* - SMTP_HOST = 'smtp.strato.de'
* - SMTP_PORT = 587
*
* Ionos:
* - SMTP_HOST = 'smtp.ionos.de'
* - SMTP_PORT = 587
*/
// SMTP Server Einstellungen
define('SMTP_HOST', 'smtp.ihre-domain.de'); // Ihr SMTP-Server
define('SMTP_PORT', 587); // SMTP-Port (meist 587 oder 465)
define('SMTP_USERNAME', 'kontakt@ihre-domain.de'); // Ihr SMTP-Benutzername
define('SMTP_PASSWORD', 'ihr-smtp-passwort'); // Ihr SMTP-Passwort
// E-Mail Adressen
define('SMTP_FROM_EMAIL', 'kontakt@hexahost.de'); // Absender-E-Mail (muss zu SMTP_USERNAME passen)
define('SMTP_TO_EMAIL', 'info@hexahost.de'); // Empfänger-E-Mail für Kontaktformular
// Sicherheitseinstellungen
define('ENABLE_CSRF_PROTECTION', true); // CSRF-Schutz aktivieren
define('ENABLE_RATE_LIMITING', true); // Rate-Limiting aktivieren
define('MAX_REQUESTS_PER_HOUR', 10); // Max. Anfragen pro Stunde
// Spam-Schutz Einstellungen
define('ENABLE_SPAM_PROTECTION', true); // Spam-Schutz aktivieren
define('MAX_MESSAGE_LENGTH', 5000); // Max. Nachrichtenlänge
define('MIN_MESSAGE_LENGTH', 10); // Min. Nachrichtenlänge
// Debug-Einstellungen (nur für Entwicklung)
define('DEBUG_MODE', false); // Debug-Modus (true/false)
define('LOG_EMAILS', true); // E-Mails loggen (true/false)
// Zusätzliche Sicherheitsheader
define('ADDITIONAL_HEADERS', [
'X-Mailer' => 'HexaHost.de Contact Form',
'X-Priority' => '3',
'X-MSMail-Priority' => 'Normal',
'Importance' => 'Normal',
'X-Report-Abuse' => 'Please report abuse here: abuse@hexahost.de',
'List-Unsubscribe' => '<mailto:unsubscribe@hexahost.de>',
'Precedence' => 'bulk'
]);
// Erlaubte Domains für E-Mail-Adressen (optional)
define('ALLOWED_EMAIL_DOMAINS', [
// Leer lassen für alle Domains zu erlauben
// 'gmail.com',
// 'outlook.com',
// 'web.de',
// 'gmx.de'
]);
// Blacklist für E-Mail-Adressen (optional)
define('BLACKLISTED_EMAILS', [
// 'spam@example.com',
// 'test@test.com'
]);
// Validierung der Konfiguration
if (!defined('SMTP_HOST') || !defined('SMTP_USERNAME') || !defined('SMTP_PASSWORD')) {
die('SMTP-Konfiguration ist unvollständig. Bitte überprüfen Sie die mail-config.php');
}
// Überprüfung der E-Mail-Adressen
if (!filter_var(SMTP_FROM_EMAIL, FILTER_VALIDATE_EMAIL)) {
die('Ungültige SMTP_FROM_EMAIL Adresse');
}
if (!filter_var(SMTP_TO_EMAIL, FILTER_VALIDATE_EMAIL)) {
die('Ungültige SMTP_TO_EMAIL Adresse');
}
// Logging-Funktion
function logEmail($type, $data) {
if (!LOG_EMAILS) return;
$logFile = __DIR__ . '/../logs/email.log';
$logDir = dirname($logFile);
if (!is_dir($logDir)) {
mkdir($logDir, 0755, true);
}
$timestamp = date('Y-m-d H:i:s');
$logEntry = "[$timestamp] $type: " . json_encode($data) . "\n";
file_put_contents($logFile, $logEntry, FILE_APPEND | LOCK_EX);
}
// Hilfsfunktion für E-Mail-Validierung
function isValidEmail($email) {
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
return false;
}
// Prüfe Blacklist
if (in_array($email, BLACKLISTED_EMAILS)) {
return false;
}
// Prüfe Domain-Whitelist (falls gesetzt)
if (!empty(ALLOWED_EMAIL_DOMAINS)) {
$domain = substr(strrchr($email, "@"), 1);
if (!in_array($domain, ALLOWED_EMAIL_DOMAINS)) {
return false;
}
}
return true;
}
// CSRF Token generieren
function generateCSRFToken() {
if (!isset($_SESSION['csrf_token'])) {
$_SESSION['csrf_token'] = bin2hex(random_bytes(32));
}
return $_SESSION['csrf_token'];
}
// CSRF Token validieren
function validateCSRFToken($token) {
return isset($_SESSION['csrf_token']) && hash_equals($_SESSION['csrf_token'], $token);
}
?>

View File

@@ -1,131 +0,0 @@
<footer class="footer">
<div class="container">
<div class="footer-content">
<div class="footer-section">
<h4>HexaHost.de</h4>
<p>Zuverlässiges Hosting aus Niederbayern</p>
<div class="footer-location">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/>
<circle cx="12" cy="10" r="3"/>
</svg>
<span>Niederbayern, Deutschland</span>
</div>
</div>
<div class="footer-section">
<h4>Produkte</h4>
<ul>
<li><a href="/vpc">Virtual Private Container</a></li>
<li><a href="/vps">Virtual Private Server</a></li>
<li><a href="/mail-gateway">Mail Gateway</a></li>
<li><a href="/webhosting">Webhosting</a></li>
</ul>
</div>
<div class="footer-section">
<h4>Unternehmen</h4>
<ul>
<li><a href="/about">Über uns</a></li>
<li><a href="/contact">Kontakt</a></li>
<li><a href="/impressum">Impressum</a></li>
<li><a href="/datenschutz">Datenschutz</a></li>
<li><a href="/agb">AGB</a></li>
<li><a href="#" id="openCookieSettings" onclick="CookieConsent.resetConsent(); return false;">Cookie-Einstellungen</a></li>
</ul>
</div>
<div class="footer-section">
<h4>Support</h4>
<ul>
<li><a href="https://shop.hexahost.de/clientarea.php">Kunden-Center</a></li>
<li><a href="https://shop.hexahost.de/serverstatus.php">Status</a></li>
<li><a href="https://shop.hexahost.de/supporttickets.php">Support-Ticket</a></li>
<li><a href="#">FAQ</a></li>
</ul>
</div>
</div>
<div class="footer-bottom">
<p>&copy; <?php echo date('Y'); ?> HexaHost.de - Alle Rechte vorbehalten</p>
</div>
</div>
</footer>
<!-- Cookie Consent Banner -->
<div id="cookieConsent" class="cookie-consent" role="dialog" aria-labelledby="cookieConsentTitle" aria-describedby="cookieConsentDesc">
<div class="cookie-consent-container">
<div class="cookie-consent-content">
<div class="cookie-consent-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"/>
<circle cx="8" cy="9" r="1" fill="currentColor"/>
<circle cx="15" cy="8" r="1" fill="currentColor"/>
<circle cx="10" cy="14" r="1" fill="currentColor"/>
<circle cx="16" cy="13" r="1" fill="currentColor"/>
<circle cx="13" cy="17" r="1" fill="currentColor"/>
</svg>
</div>
<div class="cookie-consent-text">
<h3 id="cookieConsentTitle">Cookie-Einstellungen</h3>
<p id="cookieConsentDesc">
Wir verwenden Cookies, um Ihnen die bestmögliche Erfahrung auf unserer Website zu bieten.
Technisch notwendige Cookies sind für die Funktionalität erforderlich.
<a href="/datenschutz">Mehr erfahren</a>
</p>
</div>
</div>
<div class="cookie-consent-actions">
<button type="button" id="cookieAcceptAll" class="btn btn-primary">Alle akzeptieren</button>
<button type="button" id="cookieAcceptEssential" class="btn btn-secondary">Nur notwendige</button>
<button type="button" id="cookieSettings" class="btn btn-text">Einstellungen</button>
</div>
</div>
<!-- Erweiterte Cookie-Einstellungen (standardmäßig versteckt) -->
<div id="cookieSettingsPanel" class="cookie-settings-panel" style="display: none;">
<div class="cookie-settings-content">
<h4>Cookie-Einstellungen</h4>
<div class="cookie-option">
<div class="cookie-option-info">
<strong>Notwendige Cookies</strong>
<p>Diese Cookies sind für die Grundfunktionen der Website erforderlich.</p>
</div>
<label class="cookie-toggle disabled">
<input type="checkbox" checked disabled>
<span class="cookie-toggle-slider"></span>
</label>
</div>
<div class="cookie-option">
<div class="cookie-option-info">
<strong>Analyse-Cookies</strong>
<p>Helfen uns zu verstehen, wie Besucher unsere Website nutzen.</p>
</div>
<label class="cookie-toggle">
<input type="checkbox" id="cookieAnalytics">
<span class="cookie-toggle-slider"></span>
</label>
</div>
<div class="cookie-option">
<div class="cookie-option-info">
<strong>Marketing-Cookies</strong>
<p>Werden verwendet, um relevante Werbung anzuzeigen.</p>
</div>
<label class="cookie-toggle">
<input type="checkbox" id="cookieMarketing">
<span class="cookie-toggle-slider"></span>
</label>
</div>
<div class="cookie-settings-actions">
<button type="button" id="cookieSaveSettings" class="btn btn-primary">Einstellungen speichern</button>
<button type="button" id="cookieCloseSettings" class="btn btn-secondary">Abbrechen</button>
</div>
</div>
</div>
</div>
<script src="assets/js/main.js" defer></script>
<script src="assets/js/cookie-consent.js" defer></script>
<?php if (isset($additional_scripts)): ?>
<?php foreach ($additional_scripts as $script): ?>
<script src="<?php echo $script; ?>" defer></script>
<?php endforeach; ?>
<?php endif; ?>
</body>
</html>

View File

@@ -1,98 +0,0 @@
<?php
/**
* Helper functions for HexaHost.de
*/
// Sichere Session-Konfiguration
if (session_status() === PHP_SESSION_NONE) {
// Session-Cookie-Sicherheit
ini_set('session.cookie_httponly', 1);
ini_set('session.cookie_secure', isset($_SERVER['HTTPS']) ? 1 : 0);
ini_set('session.cookie_samesite', 'Strict');
ini_set('session.use_strict_mode', 1);
ini_set('session.use_only_cookies', 1);
session_start();
// Session-ID regenerieren bei Login/wichtigen Aktionen (Schutz vor Session Fixation)
if (!isset($_SESSION['initiated'])) {
session_regenerate_id(true);
$_SESSION['initiated'] = true;
}
}
// PHP Error Display in Produktion deaktivieren
if (!defined('DEBUG_MODE') || !DEBUG_MODE) {
ini_set('display_errors', 0);
ini_set('display_startup_errors', 0);
error_reporting(E_ALL);
ini_set('log_errors', 1);
}
/**
* Set page configuration and include header
*
* @param string $title The page title
* @param string $description The page description
* @param string $page The current page identifier
* @param array $scripts Additional scripts to include
*/
function includeHeader($title = '', $description = '', $page = '', $scripts = []) {
global $page_title, $page_description, $current_page, $additional_scripts;
// Set page configuration from parameters
$page_title = !empty($title)
? $title
: 'HexaHost.de - Zuverlässiges Hosting aus Niederbayern';
$page_description = !empty($description)
? $description
: 'HexaHost.de - Zuverlässiges und preiswertes Hosting aus Niederbayern. VPS, VPC, Mail Gateway und Webhosting Lösungen.';
$current_page = $page;
$additional_scripts = $scripts;
include 'includes/header.php';
}
/**
* Include footer
*/
function includeFooter() {
include 'includes/footer.php';
}
/**
* Generate breadcrumb navigation
*
* @param array $breadcrumbs Array of breadcrumb items [['title' => 'Home', 'url' => 'index.html'], ...]
*/
function generateBreadcrumbs($breadcrumbs) {
echo '<div class="breadcrumb">';
$last_index = count($breadcrumbs) - 1;
foreach ($breadcrumbs as $index => $item) {
if ($index === $last_index) {
// Last item (current page)
echo '<span>' . htmlspecialchars($item['title']) . '</span>';
} else {
// Link to other pages
echo '<a href="' . htmlspecialchars($item['url']) . '">' . htmlspecialchars($item['title']) . '</a>';
echo '<span>/</span>';
}
}
echo '</div>';
}
/**
* Generate CSRF token for form security
*
* @return string CSRF token
*/
function generateCSRFToken() {
if (!isset($_SESSION['csrf_token'])) {
$_SESSION['csrf_token'] = bin2hex(random_bytes(32));
}
return $_SESSION['csrf_token'];
}
?>

View File

@@ -1,79 +0,0 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Performance: DNS Prefetch & Preconnect -->
<link rel="dns-prefetch" href="//fonts.googleapis.com">
<link rel="dns-prefetch" href="//fonts.gstatic.com">
<link rel="dns-prefetch" href="//cdn.hexahost.de">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="preconnect" href="https://cdn.hexahost.de" crossorigin>
<!-- Performance: Preload kritischer Ressourcen -->
<link rel="preload" href="assets/css/style.css" as="style">
<link rel="preload" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" as="style">
<title><?php echo isset($page_title) ? htmlspecialchars($page_title) : 'HexaHost.de - Zuverlässiges Hosting aus Niederbayern'; ?></title>
<!-- SEO Meta Tags -->
<meta name="description" content="<?php echo isset($page_description) ? htmlspecialchars($page_description) : 'HexaHost.de - Zuverlässiges und preiswertes Hosting aus Niederbayern. VPS, VPC, Mail Gateway und Webhosting Lösungen.'; ?>">
<meta name="robots" content="index, follow">
<meta name="author" content="HexaHost.de">
<meta name="theme-color" content="#0d0821">
<!-- Open Graph / Social Media -->
<meta property="og:type" content="website">
<meta property="og:site_name" content="HexaHost.de">
<meta property="og:title" content="<?php echo isset($page_title) ? htmlspecialchars($page_title) : 'HexaHost.de'; ?>">
<meta property="og:description" content="<?php echo isset($page_description) ? htmlspecialchars($page_description) : 'Zuverlässiges Hosting aus Niederbayern'; ?>">
<meta property="og:locale" content="de_DE">
<!-- Main Stylesheet -->
<link rel="stylesheet" href="assets/css/style.css">
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Russo+One&family=Source+Sans+Pro:wght@300;400;600;700&display=swap" rel="stylesheet">
<!-- Favicon -->
<link rel="icon" type="image/svg+xml" href="favicon.svg">
<link rel="apple-touch-icon" href="favicon.svg">
<!-- Canonical URL (falls gesetzt) -->
<?php if (isset($canonical_url)): ?>
<link rel="canonical" href="<?php echo htmlspecialchars($canonical_url); ?>">
<?php endif; ?>
</head>
<body>
<header class="header">
<nav class="nav">
<div class="nav-container">
<div class="nav-logo">
<a href="/">
<img src="https://cdn.hexahost.de/assets/img/logo/8iFs123BynHQWHI5.png" alt="HexaHost.de Logo" class="logo-image">
</a>
</div>
<ul class="nav-menu">
<li><a href="/" class="nav-link <?php echo ($current_page === 'home') ? 'active' : ''; ?>">Home</a></li>
<li class="nav-dropdown">
<a href="#" class="nav-link <?php echo (in_array($current_page, ['vpc', 'vps', 'mail-gateway', 'webhosting'])) ? 'active' : ''; ?>">Produkte</a>
<ul class="dropdown-menu">
<li><a href="/vpc" class="<?php echo ($current_page === 'vpc') ? 'active' : ''; ?>">Virtual Private Container</a></li>
<li><a href="/vps" class="<?php echo ($current_page === 'vps') ? 'active' : ''; ?>">Virtual Private Server</a></li>
<li><a href="/mail-gateway" class="<?php echo ($current_page === 'mail-gateway') ? 'active' : ''; ?>">Mail Gateway</a></li>
<li><a href="/webhosting" class="<?php echo ($current_page === 'webhosting') ? 'active' : ''; ?>">Webhosting</a></li>
</ul>
</li>
<li><a href="/about" class="nav-link <?php echo ($current_page === 'about') ? 'active' : ''; ?>">Über uns</a></li>
<li><a href="/contact" class="nav-link <?php echo ($current_page === 'contact') ? 'active' : ''; ?>">Kontakt</a></li>
</ul>
<div class="nav-toggle">
<span></span>
<span></span>
<span></span>
</div>
</div>
</nav>
</header>

View File

@@ -29,6 +29,7 @@
<li><a href="/impressum">Impressum</a></li> <li><a href="/impressum">Impressum</a></li>
<li><a href="/datenschutz">Datenschutz</a></li> <li><a href="/datenschutz">Datenschutz</a></li>
<li><a href="/agb">AGB</a></li> <li><a href="/agb">AGB</a></li>
<li><a href="/widerruf">Widerrufsbelehrung</a></li>
<li><a href="#" id="openCookieSettings" onclick="CookieConsent.resetConsent(); return false;">Cookie-Einstellungen</a></li> <li><a href="#" id="openCookieSettings" onclick="CookieConsent.resetConsent(); return false;">Cookie-Einstellungen</a></li>
</ul> </ul>
</div> </div>
@@ -120,8 +121,8 @@
</div> </div>
</div> </div>
<script src="assets/js/main.js" defer></script> <script src="/assets/js/main.js" defer></script>
<script src="assets/js/cookie-consent.js" defer></script> <script src="/assets/js/cookie-consent.js" defer></script>
<?php if (isset($additional_scripts)): ?> <?php if (isset($additional_scripts)): ?>
<?php foreach ($additional_scripts as $script): ?> <?php foreach ($additional_scripts as $script): ?>
<script src="<?php echo $script; ?>" defer></script> <script src="<?php echo $script; ?>" defer></script>

View File

@@ -52,14 +52,14 @@ function includeHeader($title = '', $description = '', $page = '', $scripts = []
$current_page = $page; $current_page = $page;
$additional_scripts = $scripts; $additional_scripts = $scripts;
include 'includes/header.php'; include __DIR__ . '/header.php';
} }
/** /**
* Include footer * Include footer
*/ */
function includeFooter() { function includeFooter() {
include 'includes/footer.php'; include __DIR__ . '/footer.php';
} }
/** /**

View File

@@ -13,7 +13,7 @@
<link rel="preconnect" href="https://cdn.hexahost.de" crossorigin> <link rel="preconnect" href="https://cdn.hexahost.de" crossorigin>
<!-- Performance: Preload kritischer Ressourcen --> <!-- Performance: Preload kritischer Ressourcen -->
<link rel="preload" href="assets/css/style.css" as="style"> <link rel="preload" href="/assets/css/style.css" as="style">
<link rel="preload" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" as="style"> <link rel="preload" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" as="style">
<title><?php echo isset($page_title) ? htmlspecialchars($page_title) : 'HexaHost.de - Zuverlässiges Hosting aus Niederbayern'; ?></title> <title><?php echo isset($page_title) ? htmlspecialchars($page_title) : 'HexaHost.de - Zuverlässiges Hosting aus Niederbayern'; ?></title>
@@ -32,14 +32,14 @@
<meta property="og:locale" content="de_DE"> <meta property="og:locale" content="de_DE">
<!-- Main Stylesheet --> <!-- Main Stylesheet -->
<link rel="stylesheet" href="assets/css/style.css"> <link rel="stylesheet" href="/assets/css/style.css">
<!-- Fonts --> <!-- Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Russo+One&family=Source+Sans+Pro:wght@300;400;600;700&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Russo+One&family=Source+Sans+Pro:wght@300;400;600;700&display=swap" rel="stylesheet">
<!-- Favicon --> <!-- Favicon -->
<link rel="icon" type="image/svg+xml" href="favicon.svg"> <link rel="icon" type="image/svg+xml" href="/favicon.svg">
<link rel="apple-touch-icon" href="favicon.svg"> <link rel="apple-touch-icon" href="/favicon.svg">
<!-- Canonical URL (falls gesetzt) --> <!-- Canonical URL (falls gesetzt) -->
<?php if (isset($canonical_url)): ?> <?php if (isset($canonical_url)): ?>

1686
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,26 +0,0 @@
{
"name": "hexahost-backend",
"version": "1.0.0",
"description": "HexaHost.de Backend - Build-System für Obfuscation und Minification",
"scripts": {
"build": "node scripts/build.js",
"build:js": "node scripts/build.js --js-only",
"build:css": "node scripts/build.js --css-only",
"clean": "rm -rf dist",
"watch": "node scripts/watch.js"
},
"devDependencies": {
"javascript-obfuscator": "^4.1.1",
"clean-css": "^5.3.3",
"chokidar": "^3.6.0",
"chalk": "^4.1.2"
},
"keywords": [
"hexahost",
"obfuscation",
"minification",
"build"
],
"author": "HexaHost.de",
"license": "LGPL-2.1"
}

View File

@@ -1,293 +0,0 @@
#!/usr/bin/env node
/**
* HexaHost.de Build Script
*
* Obfusciert JavaScript und minifiziert CSS für die Produktion
*
* Verwendung:
* npm run build - Alles bauen
* npm run build:js - Nur JavaScript
* npm run build:css - Nur CSS
*/
const fs = require('fs');
const path = require('path');
const JavaScriptObfuscator = require('javascript-obfuscator');
const CleanCSS = require('clean-css');
// Konfiguration
const config = {
srcDir: path.join(__dirname, '..'),
distDir: path.join(__dirname, '..', 'dist'),
// JavaScript-Dateien zum Obfuscieren
jsFiles: [
'assets/js/main.js',
'assets/js/contact.js',
'assets/js/cookie-consent.js'
],
// CSS-Dateien zum Minifizieren
cssFiles: [
'assets/css/style.css'
],
// PHP-Dateien (nur kopieren)
phpFiles: [
'config/config.php',
'config/mail-config.php',
'includes/header.php',
'includes/footer.php',
'includes/functions.php'
],
// JavaScript Obfuscator Optionen
jsObfuscatorOptions: {
compact: true,
controlFlowFlattening: true,
controlFlowFlatteningThreshold: 0.7,
deadCodeInjection: true,
deadCodeInjectionThreshold: 0.4,
debugProtection: false,
disableConsoleOutput: true,
identifierNamesGenerator: 'hexadecimal',
log: false,
numbersToExpressions: true,
renameGlobals: false,
selfDefending: true,
simplify: true,
splitStrings: true,
splitStringsChunkLength: 10,
stringArray: true,
stringArrayCallsTransform: true,
stringArrayEncoding: ['base64'],
stringArrayIndexShift: true,
stringArrayRotate: true,
stringArrayShuffle: true,
stringArrayWrappersCount: 2,
stringArrayWrappersChainedCalls: true,
stringArrayWrappersParametersMaxCount: 4,
stringArrayWrappersType: 'function',
stringArrayThreshold: 0.75,
transformObjectKeys: true,
unicodeEscapeSequence: false
},
// Clean-CSS Optionen
cssMinifyOptions: {
level: {
1: {
specialComments: 0
},
2: {
mergeMedia: true,
removeEmpty: true,
removeDuplicateFontRules: true,
removeDuplicateMediaBlocks: true,
removeDuplicateRules: true
}
}
}
};
// Hilfsfunktionen
function ensureDir(dir) {
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir, { recursive: true });
}
}
function copyFile(src, dest) {
ensureDir(path.dirname(dest));
fs.copyFileSync(src, dest);
}
function formatBytes(bytes) {
if (bytes === 0) return '0 Bytes';
const k = 1024;
const sizes = ['Bytes', 'KB', 'MB'];
const i = Math.floor(Math.log(bytes) / Math.log(k));
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
}
function getCompressionRatio(original, compressed) {
return ((1 - compressed / original) * 100).toFixed(1);
}
// JavaScript obfuscieren
function obfuscateJS(filePath) {
const srcPath = path.join(config.srcDir, filePath);
const destPath = path.join(config.distDir, filePath);
if (!fs.existsSync(srcPath)) {
console.log(` ⚠️ Datei nicht gefunden: ${filePath}`);
return null;
}
const originalCode = fs.readFileSync(srcPath, 'utf8');
const originalSize = Buffer.byteLength(originalCode, 'utf8');
try {
const obfuscatedCode = JavaScriptObfuscator.obfuscate(
originalCode,
config.jsObfuscatorOptions
).getObfuscatedCode();
const obfuscatedSize = Buffer.byteLength(obfuscatedCode, 'utf8');
ensureDir(path.dirname(destPath));
fs.writeFileSync(destPath, obfuscatedCode);
return {
file: filePath,
originalSize,
newSize: obfuscatedSize,
ratio: getCompressionRatio(originalSize, obfuscatedSize)
};
} catch (error) {
console.log(` ❌ Fehler bei ${filePath}: ${error.message}`);
return null;
}
}
// CSS minifizieren
function minifyCSS(filePath) {
const srcPath = path.join(config.srcDir, filePath);
const destPath = path.join(config.distDir, filePath);
if (!fs.existsSync(srcPath)) {
console.log(` ⚠️ Datei nicht gefunden: ${filePath}`);
return null;
}
const originalCode = fs.readFileSync(srcPath, 'utf8');
const originalSize = Buffer.byteLength(originalCode, 'utf8');
try {
const minified = new CleanCSS(config.cssMinifyOptions).minify(originalCode);
if (minified.errors.length > 0) {
console.log(` ❌ Fehler bei ${filePath}: ${minified.errors.join(', ')}`);
return null;
}
const minifiedSize = Buffer.byteLength(minified.styles, 'utf8');
ensureDir(path.dirname(destPath));
fs.writeFileSync(destPath, minified.styles);
return {
file: filePath,
originalSize,
newSize: minifiedSize,
ratio: getCompressionRatio(originalSize, minifiedSize)
};
} catch (error) {
console.log(` ❌ Fehler bei ${filePath}: ${error.message}`);
return null;
}
}
// PHP-Dateien kopieren (keine Obfuscation)
function copyPHP(filePath) {
const srcPath = path.join(config.srcDir, filePath);
const destPath = path.join(config.distDir, filePath);
if (!fs.existsSync(srcPath)) {
console.log(` ⚠️ Datei nicht gefunden: ${filePath}`);
return null;
}
try {
copyFile(srcPath, destPath);
const size = fs.statSync(srcPath).size;
return {
file: filePath,
originalSize: size,
newSize: size,
ratio: '0'
};
} catch (error) {
console.log(` ❌ Fehler bei ${filePath}: ${error.message}`);
return null;
}
}
// Hauptfunktion
function build() {
const args = process.argv.slice(2);
const jsOnly = args.includes('--js-only');
const cssOnly = args.includes('--css-only');
console.log('\n╔════════════════════════════════════════════════════════════╗');
console.log('║ HexaHost.de - Build System ║');
console.log('║ Obfuscation & Minification ║');
console.log('╚════════════════════════════════════════════════════════════╝\n');
// dist-Verzeichnis erstellen/leeren
if (fs.existsSync(config.distDir)) {
fs.rmSync(config.distDir, { recursive: true });
}
ensureDir(config.distDir);
const results = [];
// JavaScript obfuscieren
if (!cssOnly) {
console.log('📦 JavaScript obfuscieren...\n');
config.jsFiles.forEach(file => {
process.stdout.write(`${file}... `);
const result = obfuscateJS(file);
if (result) {
console.log(`✓ (${formatBytes(result.originalSize)}${formatBytes(result.newSize)}, -${result.ratio}%)`);
results.push(result);
}
});
console.log();
}
// CSS minifizieren
if (!jsOnly) {
console.log('🎨 CSS minifizieren...\n');
config.cssFiles.forEach(file => {
process.stdout.write(`${file}... `);
const result = minifyCSS(file);
if (result) {
console.log(`✓ (${formatBytes(result.originalSize)}${formatBytes(result.newSize)}, -${result.ratio}%)`);
results.push(result);
}
});
console.log();
}
// PHP-Dateien kopieren
if (!jsOnly && !cssOnly) {
console.log('📄 PHP-Dateien kopieren...\n');
config.phpFiles.forEach(file => {
process.stdout.write(`${file}... `);
const result = copyPHP(file);
if (result) {
console.log(`✓ (${formatBytes(result.originalSize)})`);
results.push(result);
}
});
console.log();
}
// Zusammenfassung
const totalOriginal = results.reduce((sum, r) => sum + r.originalSize, 0);
const totalNew = results.reduce((sum, r) => sum + r.newSize, 0);
console.log('═══════════════════════════════════════════════════════════════');
console.log(`✅ Build abgeschlossen!`);
console.log(` Dateien: ${results.length}`);
console.log(` Original: ${formatBytes(totalOriginal)}`);
console.log(` Optimiert: ${formatBytes(totalNew)}`);
console.log(` Ersparnis: ${formatBytes(totalOriginal - totalNew)} (${getCompressionRatio(totalOriginal, totalNew)}%)`);
console.log(` Ausgabe: ${config.distDir}`);
console.log('═══════════════════════════════════════════════════════════════\n');
}
// Build starten
build();