Compare commits

..

77 commits

Author SHA1 Message Date
Ada 05787c90aa Merge pull request 'Update module github.com/redis/go-redis/v9 to v9.5.2' (#49) from renovate/github.com-redis-go-redis-v9-9.x into main
Some checks failed
ci/woodpecker/push/release Pipeline was successful
ci/woodpecker/push/lint Pipeline failed
ci/woodpecker/push/build Pipeline was successful
Reviewed-on: #49
2024-05-31 11:30:03 +00:00
Renovate bot 8892662232 Update module github.com/redis/go-redis/v9 to v9.5.2
All checks were successful
ci/woodpecker/push/release Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/pull_request_closed/build Pipeline was successful
ci/woodpecker/pull_request_closed/lint Pipeline was successful
ci/woodpecker/pull_request_closed/release Pipeline was successful
2024-05-31 03:32:48 +00:00
Ada 1381a071d6 Merge pull request '✏️ fix folder name' (#47) from fix-ci into main
All checks were successful
ci/woodpecker/push/release Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
Reviewed-on: #47
2024-05-11 01:19:34 +00:00
Ada ed95c4bb6d ✏️ fix folder name 2024-05-11 03:19:02 +02:00
Ada c1fdd6f2be Merge pull request '📄 Make repository MPL 2.0' (#24) from license into main
Reviewed-on: #24
2024-05-11 01:15:48 +00:00
Ada 3e4d0394bc 📄 Make repository MPL-2.0 2024-05-11 01:20:36 +02:00
Ada e7eabdc161 Merge pull request '🚨 Fix linter error' (#45) from ada/fix-linter into main
Reviewed-on: #45
2024-05-10 23:08:37 +00:00
Hacki eb0d52d70a Merge branch 'main' into ada/fix-linter 2024-05-10 23:08:19 +00:00
Hacki ec2891dc5b Merge pull request 'Made deployement more modular and updated Dockerfile' (#46) from updated-deployement into main
Reviewed-on: #46
Reviewed-by: Ada <ada@gnous.eu>
2024-05-10 23:07:35 +00:00
Hacki 1129e5bfa6 Made deployement more modular and updated Dockerfile 2024-05-11 01:05:09 +02:00
Ada 18f44b118f 🚨 Fix linter error 2024-05-11 00:49:01 +02:00
Ada 41d64fec59 Merge pull request 'Update module golang.org/x/crypto to v0.23.0' (#44) from renovate/golang.org-x-crypto-0.x into main
Reviewed-on: #44
2024-05-10 21:56:30 +00:00
Renovate bot e54f8078ef Update module golang.org/x/crypto to v0.23.0 2024-05-06 14:35:44 +00:00
Ada 3d49f2b757 Merge pull request 'Revert "Merge pull request '👷 Add Darwin build for Docker ci' (#42) from ada/add-darwin-docker into main"' (#43) from ada/revert-darwin into main
Reviewed-on: #43
2024-05-01 21:32:41 +00:00
Ada 0b1b144f09 Revert "Merge pull request '👷 Add Darwin build for Docker ci' (#42) from ada/add-darwin-docker into main"
This reverts commit a5371dd79c, reversing
changes made to 07d90bdd3a.
2024-05-01 23:02:55 +02:00
Ada 4c305f9809 Merge pull request '👷 Add Darwin build for Docker ci' (#42) from ada/add-darwin-docker into main
Reviewed-on: #42
2024-05-01 22:55:55 +02:00
Ada 90615b8729 👷 Add Darwin build for Docker ci 2024-05-01 22:49:28 +02:00
Hacki fda5bf1f0a Merge pull request 'Revamped front' (#41) from hacki/front into main
Reviewed-on: #41
Reviewed-by: Ada <ada@gnous.eu>
2024-05-01 18:21:39 +00:00
Hacki ff162e51d1 finalised ui changes 2024-05-01 20:14:58 +02:00
Hacki e37d79ee05 removed post icon and made button less wide 2024-05-01 19:22:37 +02:00
Hacki 8451c26af5 made UI more consistent, fixed a bug 2024-05-01 19:22:37 +02:00
Hacki 505806a647 A LOT of improvements to the UX/UI and new fonctionnalities 2024-05-01 19:22:37 +02:00
Ada 35ffb5eb67 Merge pull request '️ Revert dotenv removal' (#40) from ada/revert-dotenv into main
Reviewed-on: #40
2024-05-01 17:20:01 +00:00
Ada 56c65ccea4 ️ Revert dotenv removal 2024-05-01 19:19:05 +02:00
Ada c137abb9de Merge pull request ' Linter to CI' (#17) from ada/ci/lint into main
Reviewed-on: #17
Reviewed-by: Hacki <hacki@noreply.localhost>
2024-04-10 18:13:41 +00:00
Ada f472d877ef 💄 pass linter 2024-04-10 20:13:09 +02:00
Ada caaae7e732 Linter on CI 2024-04-10 20:13:05 +02:00
Ada 0aa80f628e Merge pull request '⬆️ Update dependancies' (#39) from ada/bump-deps into main
Reviewed-on: #39
2024-04-10 17:46:29 +00:00
Ada 99dabb39cc ⬆️ Update dependancies 2024-04-10 19:41:33 +02:00
Ada 92c6e0aede Merge pull request 'Update module golang.org/x/crypto to v0.22.0' (#38) from renovate/golang.org-x-crypto-0.x into main
Reviewed-on: #38
2024-04-05 19:08:28 +00:00
Renovate bot d1c7046cca Update module golang.org/x/crypto to v0.22.0 2024-04-05 19:00:31 +00:00
Ada 94f9574b40 Merge pull request 'Configure Renovate' (#37) from renovate/configure into main
Reviewed-on: #37
2024-04-05 18:59:37 +00:00
Renovate bot 00f710658e Add renovate.json 2024-04-05 18:58:42 +00:00
Ada 4d14cd6aad Merge pull request '⬆️ bump x/crypto and x/sys dependancies' (#34) from ada/bump-deps into main
Reviewed-on: #34
2024-03-05 18:39:15 +00:00
Ada 10848c034b ⬆️ bump x/crypto and x/sys dependancies 2024-03-05 19:35:19 +01:00
Ada dd1c5a2778 Merge pull request '🔒 Add secret token hashing with argon2id' (#31) from ada/hash-token into main
Reviewed-on: #31
2024-02-26 21:36:25 +00:00
Ada 00baaff708 lock: Add secret token hashing with argon2id 2024-02-26 21:46:19 +01:00
Ada 7c6e18538b Merge pull request ' Implement basic POST request for curl' (#30) from ada/curl-upload into main
Reviewed-on: #30
2024-02-24 23:36:14 +00:00
Ada 660c41bb92 Merge pull request '🧪 Add test to ParseExpiration when a value is to high' (#33) from ada/more-utils-test into main
Reviewed-on: #33
2024-02-24 23:35:36 +00:00
Ada 526cef33c8 🧪 Add test to ParseExpiration when a value is to high 2024-02-25 00:35:11 +01:00
Ada ec0ac7b709 Merge pull request '⬆️ bump go-redis 9.5.1' (#32) from ada/bump-redis into main
Reviewed-on: #32
2024-02-24 23:33:38 +00:00
Ada d99309f5ed ⬆️ bump go-redis 9.5.1 2024-02-25 00:32:26 +01:00
Ada 8968046b11 Implement basic POST request for curl
/ can now read body and create paste, for curl like client, web create with full settings is move to /create
2024-02-24 01:35:26 +01:00
Ada 458467a7f3 Merge pull request 'Add redis connection test before start' (#29) from ada/redis-ping into main
Reviewed-on: #29
2024-02-22 11:55:34 +00:00
Ada f433e443f4 Add redis connection test before start 2024-02-21 14:34:19 +01:00
Ada b8d390e963 Merge pull request ' Support filename' (#27) from ada/backend/filename into main
Reviewed-on: #27
2024-02-21 12:56:35 +00:00
Ada d4806f98e8 Support filename 2024-02-21 13:51:08 +01:00
Ada 6ea5e8cdfc Merge pull request '♻️ Use math/rand/v2' (#28) from ada/use-rand-v2 into main
Reviewed-on: #28
2024-02-21 12:28:39 +00:00
Ada 576bded936 Merge pull request '👷 Add build releases file on tag' (#26) from ada/release into main
Reviewed-on: #26
2024-02-21 12:27:20 +00:00
Ada 7f4a36329c ♻️ Use math/rand/v2 2024-02-19 00:32:27 +01:00
Ada 67ccb71474 👷 Add build releases file on tag 2024-02-18 22:31:19 +01:00
Ada 4ffbe004cb Merge pull request '⬆️ bump go-redis 9.5.0' (#25) from ada/bump-redis into main
Reviewed-on: #25
2024-02-18 20:51:55 +00:00
Ada 13e0957535 ⬆️ bump go-redis 9.5.0 2024-02-18 20:32:07 +01:00
Ada 1099a79374 Merge pull request '👷 Docker support' (#19) from ada/docker into main
Reviewed-on: #19
2024-02-18 19:19:29 +00:00
Ada ec05749329 👷 Add docker support and CI related stuff 2024-02-18 19:05:18 +01:00
Ada 420722b804 🔧 Supresss automatic .env load
Automatic load of .env is a problem for Docker and not really usefull in other context
2024-02-18 18:55:57 +01:00
Ada c8c40ba090 Merge pull request '🏗️ Embed static files in binary' (#22) from ada/embed into main
Reviewed-on: #22
2024-02-18 17:53:13 +00:00
Ada 33529fdfe0 Merge pull request '♻️ Simplifies return condition' (#23) from ada/simplifies-return into main
Reviewed-on: #23
2024-02-18 00:15:17 +00:00
Ada 035809f3da Merge pull request '🐛 fix 404 on first hit' (#21) from ada/fix-404 into main
Reviewed-on: #21
2024-02-18 00:14:13 +00:00
Ada f84bcc797f ♻️ Simplifies return condition 2024-02-17 00:32:55 +01:00
Ada 39c10dd9c2 🏗️ Embed static files in binary 2024-02-17 00:23:32 +01:00
Ada 32df287f56 🐛 fix 404 on first hit
On first hit, Server() calls for the first time router(). As a result / and /static are only configured after first hit
2024-02-16 22:41:29 +01:00
Ada 1bc03c1b47 Merge pull request '♻️ Move code from main to module' (#18) from ada/refactor into main
Reviewed-on: #18
2024-02-11 23:40:12 +00:00
Ada 3404053a8d ♻️ Move code from main to module & clean code 2024-02-12 00:37:51 +01:00
Ada 07ca9d04f2 Merge pull request '💄 Move DELETE logic to specific function' (#16) from ada/backend/refactor-delete into main
Reviewed-on: #16
2024-01-23 21:28:50 +00:00
Ada 3a957471bc 💄 Move DELETE logic to specific function 2024-01-23 22:28:19 +01:00
Ada 989fb80bb3 Merge pull request 'bump(go-redis): v9.4.0' (#15) from ada/backend/update-redis into main
Reviewed-on: #15
2024-01-23 21:14:52 +00:00
Ada 8af432cd15 bump(go-redis): v9.4.0 2024-01-23 22:13:21 +01:00
Ada 179f33dd70 Merge pull request ' Plak expiration support' (#14) from ada/backend/expiration into main
Reviewed-on: #14
2024-01-23 21:02:45 +00:00
Ada a6effea4bb Plak expiration support 2024-01-23 22:00:06 +01:00
Ada 2853af7744 Merge pull request 'fix(backend): broken utf8 on raw view' (#13) from fix/raw/utf-8 into main
Reviewed-on: #13
2023-11-26 19:10:56 +00:00
Ada fb42ad7d8d fix(backend): broken utf8 on raw view 2023-11-26 02:53:24 +01:00
Hacki f8dff17e12 Merge pull request 'features' (#12) from features into main
Reviewed-on: #12
2023-11-25 23:10:29 +00:00
Hacki 9e79468016 Remove IDE specific files 2023-11-26 00:08:47 +01:00
Hacki 7092914da4 Added line counter + some return optimization 2023-11-26 00:00:53 +01:00
Hacki c4777e0475 Merge pull request 'clean(backend): make one global redis client' (#10) from clean-db into main
Reviewed-on: #10
2023-11-25 18:18:28 +00:00
Hacki d61b28c71d Merge pull request 'clean(backend): Remove duplicate config example' (#9) from clean-env into main
Reviewed-on: #9
2023-11-25 18:16:16 +00:00
10 changed files with 397 additions and 19 deletions

View file

@ -12,6 +12,8 @@ linters:
- structcheck
- exhaustivestruct
- nosnakecase
- gomnd
- execinquery
# Too extremist/unusable
- depguard
- varnamelen

View file

@ -3,7 +3,7 @@ steps:
image: woodpeckerci/plugin-docker-buildx
settings:
repo: git.gnous.eu/${CI_REPO_OWNER}/plakken
dockerfile: docker/Dockerfile
dockerfile: deployment/docker/Dockerfile
platforms: linux/amd64,linux/arm64/v8,linux/arm
registry: https://git.gnous.eu
tag: ${CI_COMMIT}
@ -18,7 +18,7 @@ steps:
image: woodpeckerci/plugin-docker-buildx
settings:
repo: git.gnous.eu/${CI_REPO_OWNER}/plakken
dockerfile: docker/Dockerfile
dockerfile: deployment/docker/Dockerfile
platforms: linux/amd64,linux/arm64/v8,linux/arm
registry: https://git.gnous.eu
tags:

374
LICENSE Normal file
View file

@ -0,0 +1,374 @@
Mozilla Public License Version 2.0
==================================
1. Definitions
--------------
1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.
1.5. "Incompatible With Secondary Licenses"
means
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.

View file

@ -1,18 +1,18 @@
# Build
FROM golang:1.22 AS build
LABEL authors="gnousEU"
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
COPY main.go ./
COPY internal/ ./internal
COPY static/ ./static
COPY templates/ ./templates
COPY main.go ./
COPY internal/ ./internal
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-w -s" # Enable static binary, target Linux, remove debug information and strip binary
# Enable static binary, target Linux, remove debug information and strip binary
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-w -s"
# Copy to our image
FROM gcr.io/distroless/static-debian12:nonroot
@ -25,4 +25,4 @@ ENV PLAKKEN_LISTEN ":3000"
EXPOSE 3000/tcp
ENTRYPOINT ["/app/plakken"]
ENTRYPOINT ["/app/plakken"]

View file

@ -28,4 +28,4 @@ services:
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
networks:
- plakken
- plakken

View file

@ -33,4 +33,4 @@ services:
networks:
- plakken
volumes:
- redis:/data
- redis:/data

6
go.mod
View file

@ -4,12 +4,12 @@ go 1.22
require (
github.com/joho/godotenv v1.5.1
github.com/redis/go-redis/v9 v9.5.1
golang.org/x/crypto v0.22.0
github.com/redis/go-redis/v9 v9.5.2
golang.org/x/crypto v0.23.0
)
require (
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/sys v0.20.0 // indirect
)

10
go.sum
View file

@ -10,7 +10,9 @@ github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8=
github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
github.com/redis/go-redis/v9 v9.5.2 h1:L0L3fcSNReTRGyZ6AqAEN0K56wYeYAwapBIhkvh0f3E=
github.com/redis/go-redis/v9 v9.5.2/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=

View file

@ -99,7 +99,7 @@ func VerifyPassword(password string, hash string) (bool, error) {
// parseHash parse existing encoded argon2id string.
func parseHash(source string) (argon2idHash, config, error) {
separateItem := strings.Split(source, "$")
if len(separateItem) != 6 { //nolint:gomnd
if len(separateItem) != 6 { //nolint:mnd
return argon2idHash{}, config{}, &parseError{message: "Hash format is not valid"}
}
@ -108,7 +108,7 @@ func parseHash(source string) (argon2idHash, config, error) {
}
separateParam := strings.Split(separateItem[3], ",")
if len(separateParam) != 3 { //nolint:gomnd
if len(separateParam) != 3 { //nolint:mnd
return argon2idHash{}, config{}, &parseError{message: "Hash config is not valid"}
}

View file

@ -45,7 +45,7 @@ func parseIntBeforeSeparator(source *string, sep string) (int, error) { // retur
return 0, &parseIntBeforeSeparatorError{message: *source + ": format only take positive value"}
}
if value > 99 { //nolint:gomnd
if value > 99 { //nolint:mnd
return 0, &parseIntBeforeSeparatorError{message: *source + ": Format only take two number"}
}