Compare commits

...

83 Commits

Author SHA1 Message Date
b87921c811
README update.
All checks were successful
continuous-integration/drone/push Build is passing
2022-08-14 16:51:17 +05:00
74ea9b6863
Prepare to release 0.4.1.
All checks were successful
continuous-integration/drone/push Build is passing
2022-08-14 16:26:11 +05:00
30f8b4975c
Get rid of flagger.
All checks were successful
continuous-integration/drone/push Build is passing
2022-08-14 16:20:16 +05:00
dcd361de1f
Update dependencies, fix footer link.
All checks were successful
continuous-integration/drone/push Build is passing
2022-08-14 16:02:16 +05:00
2ec0e28243
Make linter happy and move to os from io/ioutil for reading/writing.
All checks were successful
continuous-integration/drone/push Build is passing
2022-08-14 15:49:05 +05:00
df5671586e
Update images used for building containers and code test/lint, fill CHANGELOG.
Some checks failed
continuous-integration/drone/push Build is failing
2022-08-14 15:34:47 +05:00
59dafc373f
Update chroma to 2.2.0, line number links appeared.
Some checks failed
continuous-integration/drone/push Build is failing
2022-08-14 14:57:54 +05:00
25489dc103
Forgotten files for previous commit.
Some checks failed
continuous-integration/drone/push Build is failing
2022-08-14 14:49:31 +05:00
1dc6dfe00e
Update README and mention where bugreporting should take place.
Some checks failed
continuous-integration/drone/push Build is failing
Also added markdownlint configuration.
2022-08-14 14:47:28 +05:00
02e933efed
Use mirrorred images in Dockerfile.
All checks were successful
continuous-integration/drone/push Build is passing
2022-06-28 22:19:42 +05:00
d2b3304a5a
As it isn't Drone official plugins now, containers with dind should be privileged.
Some checks failed
continuous-integration/drone/push Build is failing
2022-06-28 21:44:23 +05:00
9164c53c54
Force docker plugin version.
Some checks failed
continuous-integration/drone/push Build is failing
2022-06-28 21:38:09 +05:00
18734ebd18
Switch to mirrorred images for Drone CI.
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2022-06-28 21:19:35 +05:00
6b04a1dcd5
Update Dockerfile to use latest versions of Golang and Alpine.
All checks were successful
continuous-integration/drone/push Build is passing
2022-06-26 22:52:50 +05:00
1cb93c7d97
Update Drone configuration.
All checks were successful
continuous-integration/drone/push Build is passing
2022-06-26 22:49:37 +05:00
f8f0302564
Make linter happy and update dependencies.
Some checks failed
continuous-integration/drone/push Build is failing
2022-06-26 22:26:39 +05:00
7b6a425908
Update Drone configuration. 2022-06-26 22:10:53 +05:00
591c24bab7
Update Drone configuration. 2022-06-26 22:08:23 +05:00
d85c9cb53c
Update Drone configuration. 2022-06-26 22:04:03 +05:00
2b44a60ee7
The Great Linting Fixes, Drone configuration fix (again) and flatfile changes.
Great linting fixes has been applied, thanks to golangci-lint for
extensive reporting.

Fixed Drone configuration to use array for when-branch statement in
Docker plugin.

Flatfile storage from now will write files with 0600 permission for
greater security.
2021-11-20 22:19:58 +05:00
218e0bf667
Remove -mod=vendor from golangci-lint GOFLAGS. 2021-11-20 22:00:52 +05:00
006eb6e72a
Use newer golang with Drone and update badge in README. 2021-11-20 22:00:02 +05:00
5eae5595e9
Drone fixes. 2021-11-20 02:23:47 +05:00
0f47434f60
Move from fileb0x to embed.FS. Fixes #22.
Also removed unused fontawesome JS.
2021-06-16 06:22:33 +05:00
383233202e
Fix registry logging in by CI when uploading Docker image. 2021-06-15 00:16:44 +05:00
968d945205
More Greater Linting. 2021-06-15 00:11:58 +05:00
6ea6e2e144
The Great Sources Linting. 2021-06-14 23:48:34 +05:00
3265c5a4b2
Proper image-alias for DIND service in CI. 2021-06-14 23:10:35 +05:00
1210ecb510
Fix CI config. 2021-06-14 23:08:54 +05:00
dec022e460
Update CI configuration. 2021-06-14 23:05:59 +05:00
79791ef228
Update golang versions everywhere, use alpine 3.13 for image, remove vendor dir. 2021-06-14 22:59:21 +05:00
a0f896dc53
CI config update. 2021-01-09 06:23:28 +05:00
fa7a79310d
Assets update. 2021-01-09 06:15:38 +05:00
ce962ddd00
Version bump. 2021-01-09 06:14:16 +05:00
164a37d41f
A pretty basic pastes cleanup procedure.
Fixes #16.
2021-01-09 06:09:26 +05:00
3ebff29113
Linting fixes about struct alignment. 2021-01-08 12:01:53 +05:00
7f04a9a7bb
Typo fix and missed dependencies files. 2021-01-08 12:00:38 +05:00
a2a21482e2
Dependencies update and fix for line linking.
Fixes #20.
2021-01-08 11:56:35 +05:00
ffb42f43eb
README update. 2020-02-29 23:51:23 +05:00
3f9801b1bd
Update chroma and make line numbers linkable.
Yet no links will be generated.

Related to #20.
2020-02-29 23:39:09 +05:00
825fd724ff
Some logging refactoring.
Fixes #14.
2020-02-29 23:30:44 +05:00
5f58741159
Added maximum request body size limiting.
Fixes #19.
2020-02-29 22:49:44 +05:00
47672c586d
Linter configuration fixes and linting issues fixes.
Fixes #17.
2020-02-29 22:41:06 +05:00
11897d0e1a
Drone CI recipe fix. 2019-12-22 01:24:13 +05:00
02cea49fc4 Merge branch 'linting' of fastpastebin/fastpastebin into master 2019-12-21 20:19:21 +00:00
a52b18ffe4
Linting. 2019-12-22 01:17:18 +05:00
da4bc379d8
Typo in commend and switching to discordrone for notifications. 2019-12-22 00:56:43 +05:00
9c9f0c1f68 Merge branch 'linting' of fastpastebin/fastpastebin into master 2019-10-13 11:28:15 +00:00
6a787e7e23
Linting things. 2019-10-13 16:26:52 +05:00
cdc8ecf49b Merge branch 'readme-update' of fastpastebin/fastpastebin into master 2019-10-13 09:52:06 +00:00
bd981023da
README update. 2019-10-13 14:50:11 +05:00
a982e07faf Fixed improper tooltip (popups) rendering. Fixes #8. (#11) 2019-10-13 09:25:29 +00:00
0bbb415852
Drone pipelines update. 2019-10-13 14:02:33 +05:00
6207229e9b Move to Go modules (#10) 2019-10-13 08:55:38 +00:00
2159aadfcb
Fixed Safari stuck when clicking on dropdowns by updating Bulma.
Fixes #4.
2019-10-12 15:10:13 +05:00
3ebf9b653e
Put docker image into approriate repo. Related to #6. 2019-10-12 14:30:20 +05:00
4d60a9b1b6
Switching to Drone CI and giredore. 2019-10-12 14:26:46 +05:00
e042c4414f
Moved from gitlab.com to Gitea with giredore. 2019-10-12 14:18:35 +05:00
333fc1d12a
CI configuration. 2019-09-25 18:47:51 +05:00
7f2174a33e
Moved Dockerfile and docker-compose.yml to top directory. 2019-09-25 18:45:50 +05:00
e26a466efc Merge branch 'feature/docker' into 'master'
Dockerize the app

See merge request pztrn/fastpastebin!1
2019-07-23 04:30:22 +00:00
Timur Demin
d9a46aa5b3
Make changes proposed by @pztrn 2019-07-20 14:16:06 +05:00
Timur Demin
dbf82e213b
Dockerize the app 2019-07-08 08:41:03 +05:00
4f01e2f5ce
Logger refactoring, part 1. 2019-04-13 00:05:22 +05:00
7281b9be65
Refactoring for pastes domain for code reusing and better structuring. 2019-04-12 23:29:42 +05:00
19b5ef3d9f
Fastfix for previous two commits (sorry) and chroma update.
Well, doing "git add ." not from repository's root is a bad idea.

Updated chroma dependency, added more languages to syntax highlighting.
2019-03-07 08:43:28 +05:00
3fe51fc6c5
Dependencies update and database not available crash fix.
Added forgotten dependencies update.

Fixed fastpastebin crash when database isn't available and added cute
error screen for informing users about such condition (both HTML and raw).
2019-03-07 08:39:12 +05:00
19a3a5004c
The Huge Refactoring. 2019-03-07 07:56:50 +05:00
0bf20cd2c9
Assets update. 2018-12-01 04:46:27 +05:00
35c217fe46
Builder script and gitignore update. 2018-12-01 04:23:15 +05:00
849c72b238
Version bump. 2018-12-01 03:55:11 +05:00
c565ec8f21 Fixed timezone things with postgresql and made "Forever" work. 2018-12-01 03:49:04 +05:00
aa5e11329f PostgreSQL support. 2018-12-01 03:23:52 +05:00
b6556d6e90 Moved database migrations for MySQL dialect into approriate package. 2018-12-01 02:29:14 +05:00
400ce0db0c Quick and dirty fix to get database connection reestablish if connection was lost. 2018-12-01 02:23:36 +05:00
fc8f4e9d8b Switch to Gitlab. 2018-12-01 02:16:06 +05:00
2beb9ecef9 Version bump - we're 0.2.0! 2018-05-27 12:27:43 +05:00
0cca0f453f Database dialects, proper database shutdown, pagination in configuration.
Added possibility to use different database (storage) backends. Currently
supported: flatfiles and mysql. Fixes #2.

Added database shutdown call. This call will properly shutdown database
connections (in case of RDBMS) or flush pastes index cache on disk (in
case of flatfiles).

De-hardcoded pagination count. Fixes #12.
2018-05-27 12:25:01 +05:00
296e2771d6 Version 0.1.1. 2018-05-26 16:10:38 +05:00
c8005a4836 Navbar burger isn't used, removed. 2018-05-26 13:58:50 +05:00
342a4d1d7c Templates and templater, added footer with application data. Fixes #8 and #7. 2018-05-26 13:50:13 +05:00
d7e9865c91 Proper check for paste's password input. Fixes #4 and should also fix #5. 2018-05-26 12:09:53 +05:00
9f0beb7e3e Set proper logger level, fixes #6. 2018-05-26 12:05:37 +05:00
820 changed files with 3532 additions and 243930 deletions

58
.drone.yml Normal file
View File

@ -0,0 +1,58 @@
---
kind: pipeline
type: docker
name: lint and test
steps:
- name: lint
image: code.pztrn.name/containers/mirror/golangci/golangci-lint:v1.48.0
pull: if-not-exists
environment:
CGO_ENABLED: 0
commands:
- golangci-lint run
- name: test
image: code.pztrn.name/containers/mirror/golang:1.19.0-alpine
pull: if-not-exists
environment:
CGO_ENABLED: 0
commands:
- go test ./...
---
kind: pipeline
type: docker
name: build docker images
depends_on:
- "lint and test"
steps:
- name: build master image
image: code.pztrn.name/containers/mirror/plugins/docker:20.13.0
pull: if-not-exists
privileged: true
when:
branch: ["master"]
settings:
registry: code.pztrn.name
username: drone
password:
from_secret: drone_secret
repo: code.pztrn.name/apps/fastpastebin
auto_tag: true
- name: build tagged image
image: code.pztrn.name/containers/mirror/plugins/docker:20.13.0
pull: if-not-exists
privileged: true
when:
event: ["tag"]
settings:
registry: code.pztrn.name
username: drone
password:
from_secret: drone_secret
repo: code.pztrn.name/apps/fastpastebin
auto_tag: true

8
.gitignore vendored
View File

@ -1 +1,7 @@
examples/fastpastebin.yaml
examples/fastpastebin.yaml
dist/
data/
vendor/
.idea
.vscode
*DS_Store*

38
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,38 @@
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
DOCKER_TCP_PORT: 2375
DOCKER_TLS_CERTDIR: ""
CONTAINER_NAME: registry.gitlab.pztrn.name/fastpastebin/fastpastebin
DIND_IMAGE: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/docker:dind
GOLANGCILINT_IMAGE: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/golangci/golangci-lint:v1.40.1-alpine
services:
- name: ${DIND_IMAGE}
alias: docker
stages:
- test
- build
lint:
stage: test
image: ${GOLANGCILINT_IMAGE}
tags:
- docker
script:
- golangci-lint run ./...
build:
stage: build
image: $DIND_IMAGE
tags:
- docker
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- source docker/set_docker_tag.sh
- docker build -t $CONTAINER_NAME:$DOCKER_TAG .
- docker push $CONTAINER_NAME:$DOCKER_TAG
only:
- tags
- master

35
.golangci.yml Normal file
View File

@ -0,0 +1,35 @@
run:
deadline: 5m
linters:
enable-all: true
disable:
# Because globals might exist, but according to our codestyle they
# should be lowercased and considered as unexported.
- gochecknoglobals
# While it might be useful it'll create more problems that will solve.
- gocritic
# Complains about main() lengths, which isn't an issue.
- funlen
# Magic numbers everywhere and we can't get rid of them.
- gomnd
# This linter MIGHT BE good, but who decided that I want keepFor in
# JSON instead of keep_for for KeepFor field?
- tagliatelle
# Deprecated.
- exhaustivestruct
linters-settings:
lll:
line-length: 420
gocognit:
min-complexity: 50
gocyclo:
min-complexity: 40
cyclop:
max-complexity: 40
issues:
exclude-rules:
# There will be some ToDos.
- linters:
- godox
text: "TODO"

5
.markdownlint.json Normal file
View File

@ -0,0 +1,5 @@
{
"line-length": false,
"first-line-h1": false,
"no-duplicate-header": false
}

View File

@ -1,12 +1,84 @@
# Changelog
``[A]`` - added
``[F]`` - fixed
``[R]`` - removed
All notable changes to this project will be documented in this file.
---
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## 0.1.0
## [Unreleased]
## [0.4.1] - 2022-08-14
### Changed
* Update docker images - alpine to 3.16.1, golang to 1.19, golangci-lint to 1.48.0.
* Update chroma to v2.2.0.
* Update bulma to 0.9.4.
* Update bulma-tooltip to 1.2 (was 3.0.0, but repo was switched to CreativeBulma).
* Update github.com/dchest/captcha to v1.0.0.
### Fixed
* Put valid repository's link in footer.
### Removed
* Removed `flagger` dependency.
## [0.4.0] - 2021-01-09
### Added
* PostgreSQL support.
* Docker containerization for every commit and tag.
* Pastes cleanup procedure.
### Changed
* Updated bulma to v 0.7.5.
* Moved from `io/ioutil` to `os` package for reading/writing files and directories.
### Fixed
* Dirty hack to get database connection reestablish (for sure).
## 0.3.0
Release changelogs lost :(.
## [0.2.0] - 2018-05-27
### Added
* Possibility to create different database backends. Currently `mysql` and `flatfiles` are available.
### Changed
* De-hardcoded pagination configuration, it is now configurable via configuration file.
## [0.1.1] - 2018-05-26
### Added
* Footer copyrights.
### Changed
* Refactored templates: now they're included in each other if neccessary.
### Fixed
* Fixed nasty bugs with private pastes that causing fastpastebin to crash.
* Logger level from configuration now properly set.
## [0.1.0] - 2018-05-19
First normal release. Fast Paste Bin is able to handle public, private
and passworded pastes.
and passworded pastes.
[Unreleased]: https://code.pztrn.name/apps/fastpastebin/compare/v0.4.1...HEAD
[0.4.1]: https://code.pztrn.name/apps/fastpastebin/compare/0.4.0...v0.4.1
[0.4.0]: https://code.pztrn.name/apps/fastpastebin/compare/v0.2.0...0.4.0
[0.2.0]: https://code.pztrn.name/apps/fastpastebin/compare/v0.1.1...v0.2.0
[0.1.1]: https://code.pztrn.name/apps/fastpastebin/compare/v0.1.0...v0.1.1
[0.1.0]: https://code.pztrn.name/apps/fastpastebin/src/tag/v0.1.0

17
Dockerfile Normal file
View File

@ -0,0 +1,17 @@
FROM code.pztrn.name/containers/mirror/golang:1.19.0-alpine AS build
WORKDIR /fastpastebin
COPY . .
WORKDIR /fastpastebin/cmd/fastpastebin
RUN CGO_ENABLED=0 go build -tags netgo
FROM code.pztrn.name/containers/mirror/alpine:3.16.1
LABEL maintainer "Stanislav N. <pztrn@pztrn.name>"
COPY --from=build /fastpastebin/cmd/fastpastebin/fastpastebin /app/fastpastebin
COPY docker/fastpastebin.docker.yaml /app/fastpastebin.yaml
EXPOSE 25544
ENTRYPOINT [ "/app/fastpastebin", "-config", "/app/fastpastebin.yaml" ]

187
Gopkg.lock generated
View File

@ -1,187 +0,0 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/alecthomas/chroma"
packages = [
".",
"formatters",
"formatters/html",
"lexers",
"lexers/a",
"lexers/b",
"lexers/c",
"lexers/d",
"lexers/e",
"lexers/f",
"lexers/g",
"lexers/h",
"lexers/i",
"lexers/internal",
"lexers/j",
"lexers/k",
"lexers/l",
"lexers/m",
"lexers/n",
"lexers/o",
"lexers/p",
"lexers/q",
"lexers/r",
"lexers/s",
"lexers/t",
"lexers/v",
"lexers/w",
"lexers/x",
"lexers/y",
"styles"
]
revision = "3020e2ea8c6b1a9c2336022d847c4392c3997f02"
version = "v0.4.0"
[[projects]]
branch = "master"
name = "github.com/danwakefield/fnmatch"
packages = ["."]
revision = "cbb64ac3d964b81592e64f957ad53df015803288"
[[projects]]
branch = "master"
name = "github.com/dchest/captcha"
packages = ["."]
revision = "6a29415a8364ec2971fdc62d9e415ed53fc20410"
[[projects]]
name = "github.com/dgrijalva/jwt-go"
packages = ["."]
revision = "06ea1031745cb8b3dab3f6a236daf2b0aa468b7e"
version = "v3.2.0"
[[projects]]
name = "github.com/dlclark/regexp2"
packages = [
".",
"syntax"
]
revision = "487489b64fb796de2e55f4e8a4ad1e145f80e957"
version = "v1.1.6"
[[projects]]
name = "github.com/go-sql-driver/mysql"
packages = ["."]
revision = "a0583e0143b1624142adab07e0e97fe106d99561"
version = "v1.3"
[[projects]]
branch = "master"
name = "github.com/jmoiron/sqlx"
packages = [
".",
"reflectx"
]
revision = "2aeb6a910c2b94f2d5eb53d9895d80e27264ec41"
[[projects]]
name = "github.com/labstack/echo"
packages = [
".",
"middleware"
]
revision = "6d227dfea4d2e52cb76856120b3c17f758139b4e"
version = "3.3.5"
[[projects]]
name = "github.com/labstack/gommon"
packages = [
"bytes",
"color",
"log",
"random"
]
revision = "588f4e8bddc6cb45c27b448e925c7fd6a5545434"
version = "0.2.5"
[[projects]]
name = "github.com/mattn/go-colorable"
packages = ["."]
revision = "167de6bfdfba052fa6b2d3664c8f5272e23c9072"
version = "v0.0.9"
[[projects]]
name = "github.com/mattn/go-isatty"
packages = ["."]
revision = "0360b2af4f38e8d38c7fce2a9f4e702702d73a39"
version = "v0.0.3"
[[projects]]
name = "github.com/pressly/goose"
packages = ["."]
revision = "056a4d47dcc4d67fa3947a4f13945a5c690e568b"
version = "v2.1.0"
[[projects]]
branch = "master"
name = "github.com/pztrn/flagger"
packages = ["."]
revision = "1330c5f1b64f253b0505ee4a2417fb8be856b87d"
[[projects]]
name = "github.com/rs/zerolog"
packages = [
".",
"internal/cbor",
"internal/json"
]
revision = "05eafee0eb17d0150591a8f30f0fa592cc9b7471"
version = "v1.6.0"
[[projects]]
branch = "master"
name = "github.com/valyala/bytebufferpool"
packages = ["."]
revision = "e746df99fe4a3986f4d4f79e13c1e0117ce9c2f7"
[[projects]]
branch = "master"
name = "github.com/valyala/fasttemplate"
packages = ["."]
revision = "dcecefd839c4193db0d35b88ec65b4c12d360ab0"
[[projects]]
branch = "master"
name = "golang.org/x/crypto"
packages = [
"acme",
"acme/autocert",
"pbkdf2",
"scrypt"
]
revision = "b49d69b5da943f7ef3c9cf91c8777c1f78a0cc3c"
[[projects]]
branch = "master"
name = "golang.org/x/net"
packages = [
"context",
"webdav",
"webdav/internal/xml"
]
revision = "5f9ae10d9af5b1c89ae6904293b14b064d4ada23"
[[projects]]
branch = "master"
name = "golang.org/x/sys"
packages = ["unix"]
revision = "cbbc999da32df943dac6cd71eb3ee39e1d7838b9"
[[projects]]
name = "gopkg.in/yaml.v2"
packages = ["."]
revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183"
version = "v2.2.1"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "aea0cd48405b88f2c799a3d994b952758f29e06ada92b4bbe6cc4ff105d95d59"
solver-name = "gps-cdcl"
solver-version = 1

View File

@ -1,34 +0,0 @@
# Gopkg.toml example
#
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true
[[constraint]]
name = "github.com/rs/zerolog"
version = "1.6.0"
[prune]
go-tests = true
unused-packages = true

102
README.md
View File

@ -1,80 +1,90 @@
[Chat on Keybase.io](https://keybase.io/team/fastpastebin)
# Fast Pastebin
Easy-to-use-and-install pastebin software written in Go. No bells or
whistles, no websockets and even NO JAVASCRIPT!(*)
[![Build Status](https://ci.code.pztrn.name/api/badges/apps/fastpastebin/status.svg)](https://ci.code.pztrn.name/apps/fastpastebin)
(*) Except fontawesome, because it's awesome :).
Easy-to-use-and-install pastebin software written in Go. No bells or whistles, no websockets and even NO JAVASCRIPT!
# Current functionality.
**Please, use [my gitea](https://code.pztrn.name/apps/fastpastebin) for bug reporting. All other places are mirrors!**
Also, [join Matrix room](https://matrix.to/#/%23fastpastebin:pztrn.online?via=matrix.org) for near-realtime chat.
## Current functionality
* Create and view public and private pastes.
* Syntax highlighting.
* Pastes expiration.
* Passwords for pastes.
* Multiple storage backends. Currently: ``flatfiles``, ``mysql`` and ``postgresql``.
# Caveats.
## Caveats
* No links at lines numbers. See https://github.com/alecthomas/chroma/issues/132
* Not known at this moment.
# Installation and updating
## Installation and updating
Just issue:
```bash
CGO_ENABLED=0 go install go.dev.pztrn.name/fastpastebin/cmd/fastpastebin@VERSION
```
go get -u -v github.com/pztrn/fastpastebin/cmd/fastpastebin
```
Replace `VERSION` with a [tag of your choice](https://code.pztrn.name/apps/fastpastebin/releases).
This command can be used to update Fast Paste Bin.
**WARNING:** installation by compiling Fast Paste Bin from sources **require**
at least 300 megabytes of free RAM! Eventually it'll run even on 64MB-powered
VM, it's only a compilation issue.
Also Fast Paste Bin is dockerized, see [here](https://code.pztrn.name/apps/-/packages/container/fastpastebin) for instructions.
# Configuration.
Compose file with resources limits, as used by me:
Take a look at [example configuration file](examples/fastpastebin.yaml.dist)
which contains all supported options and their descriptions.
```yaml
---
version: "2.4"
Configuration file position is irrelevant, there is no hardcoded paths where
Fast Paste Bin looking for it's configuration. Use ``-config`` CLI parameter
or ``FASTPASTEBIN_CONFIG`` environment variable to specify path.
# Developing
Developers should install https://github.com/UnnoTed/fileb0x/ which is used
as replacement to go-bindata for embedding assets into binary. After changing
assets they should be recompiled into Go code. At repository root execute
this command and you'll be fine:
```
fileb0x fileb0x.yml
services:
fastpastebin:
restart: always
image: code.pztrn.name/apps/fastpastebin:0.4.1
volumes:
- "./fastpastebin.yaml:/app/fastpastebin.yaml"
ports:
- "25544:25544"
cpus: 2
mem_limit: 1G
memswap_limit: 0
```
Also if you're changed list of assets (by creating or deleting them) be sure
to fix files list in ``fileb0x.yml`` file!
## Configuration
The rest is default - use linters, formatters, etc. VSCode with Go plugin is
recommended for developing as it will perform most of linting-formatting
actions automagically. Try to follow https://github.com/golang/go/wiki/CodeReviewComments
with few exceptions:
Take a look at [example configuration file](examples/fastpastebin.yaml.dist) which contains all supported options and their descriptions.
* Imports should be organized in 3 groups: stdlib, local, other. See
https://github.com/pztrn/fastpastebin/blob/master/pastes/api_http.go for
example.
Configuration file position is irrelevant, there is no hardcoded paths where Fast Paste Bin looking for it's configuration. Use ``-config`` CLI parameter or ``FASTPASTEBIN_CONFIG`` environment variable to specify path.
* We're not forcing any limits on line length for code, only for comments,
they should be 72-76 chars long.
## Developing
# ToDo
### Branching, versions, etc
This is a ToDo list which isn't sorted by any parameter at all. Just a list
of tasks you can help with.
There is a `develop` branch which represents current development state. **All new commits (by me) and merge requests (by others) should go to that branch**.
Branch `master` represents "latest version" state and always stable.
### Code
Use linters, formatters, etc. VSCode with Go plugin is recommended for developing as it will perform most of linting-formatting
actions automagically.
Also, Sublime Text with LSP-gopls will also work just fine.
Try to follow [Go's code review comments](https://github.com/golang/go/wiki/CodeReviewComments) with few exceptions:
* We're not forcing any limits on line length for code, only for comments, they should be 72-76 chars long.
## ToDo
This is a ToDo list which isn't sorted by any parameter at all. Just a list of tasks you can help with.
* User CP.
* Files uploading.
* Passwords for files.
* Pastes forking and revisioning (like git or github gists).
* Possibility to copy-paste-edit WISYWIG content.
* CLI client for pastes and files uploading.
* Possibility to copy-paste-edit WYSIWYG content.
* CLI client for pastes and files uploading.

View File

@ -1,51 +0,0 @@
// Fast Paste Bin - uberfast and easy-to-use pastebin.
//
// Copyright (c) 2018, Stanislav N. aka pztrn and Fast Paste Bin
// developers.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject
// to the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
// OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package http
import (
// local
"github.com/pztrn/fastpastebin/api/http/static"
"github.com/pztrn/fastpastebin/context"
// other
"github.com/labstack/echo"
)
var (
c *context.Context
)
// New initializes basic HTTP API, which shows only index page and serves
// static files.
func New(cc *context.Context) {
c = cc
c.Logger.Info().Msg("Initializing HTTP API...")
// Static files.
c.Echo.GET("/static/*", echo.WrapHandler(static.Handler))
// Index.
c.Echo.GET("/", indexGet)
}

View File

@ -1,182 +0,0 @@
// Code generated by fileb0x at "2018-05-18 22:25:13.180720675 +0500 +05 m=+0.030971779" from config file "fileb0x.yml" DO NOT EDIT.
// modification hash(1679c5529785a2e624071b2679319ecb.608888160ddb195ed89fce5ab290ff92)
package static
import (
"bytes"
"io"
"net/http"
"os"
"path"
"golang.org/x/net/webdav"
"context"
)
var (
// CTX is a context for webdav vfs
CTX = context.Background()
// FS is a virtual memory file system
FS = webdav.NewMemFS()
// Handler is used to server files through a http handler
Handler *webdav.Handler
// HTTP is the http file system
HTTP http.FileSystem = new(HTTPFS)
)
// HTTPFS implements http.FileSystem
type HTTPFS struct {}
func init() {
if CTX.Err() != nil {
panic(CTX.Err())
}
var err error
err = FS.Mkdir(CTX, "static/", 0777)
if err != nil && err != os.ErrExist {
panic(err)
}
err = FS.Mkdir(CTX, "static/css/", 0777)
if err != nil && err != os.ErrExist {
panic(err)
}
err = FS.Mkdir(CTX, "static/js/", 0777)
if err != nil && err != os.ErrExist {
panic(err)
}
Handler = &webdav.Handler{
FileSystem: FS,
LockSystem: webdav.NewMemLS(),
}
}
// Open a file
func (hfs *HTTPFS) Open(path string) (http.File, error) {
f, err := FS.OpenFile(CTX, path, os.O_RDONLY, 0644)
if err != nil {
return nil, err
}
return f, nil
}
// ReadFile is adapTed from ioutil
func ReadFile(path string) ([]byte, error) {
f, err := FS.OpenFile(CTX, path, os.O_RDONLY, 0644)
if err != nil {
return nil, err
}
buf := bytes.NewBuffer(make([]byte, 0, bytes.MinRead))
// If the buffer overflows, we will get bytes.ErrTooLarge.
// Return that as an error. Any other panic remains.
defer func() {
e := recover()
if e == nil {
return
}
if panicErr, ok := e.(error); ok && panicErr == bytes.ErrTooLarge {
err = panicErr
} else {
panic(e)
}
}()
_, err = buf.ReadFrom(f)
return buf.Bytes(), err
}
// WriteFile is adapTed from ioutil
func WriteFile(filename string, data []byte, perm os.FileMode) error {
f, err := FS.OpenFile(CTX, filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, perm)
if err != nil {
return err
}
n, err := f.Write(data)
if err == nil && n < len(data) {
err = io.ErrShortWrite
}
if err1 := f.Close(); err == nil {
err = err1
}
return err
}
// WalkDirs looks for files in the given dir and returns a list of files in it
// usage for all files in the b0x: WalkDirs("", false)
func WalkDirs(name string, includeDirsInList bool, files ...string) ([]string, error) {
f, err := FS.OpenFile(CTX, name, os.O_RDONLY, 0)
if err != nil {
return nil, err
}
fileInfos, err := f.Readdir(0)
if err != nil {
return nil, err
}
err = f.Close()
if err != nil {
return nil, err
}
for _, info := range fileInfos {
filename := path.Join(name, info.Name())
if includeDirsInList || !info.IsDir() {
files = append(files, filename)
}
if info.IsDir() {
files, err = WalkDirs(filename, includeDirsInList, files...)
if err != nil {
return nil, err
}
}
}
return files, nil
}

View File

@ -1,35 +0,0 @@
// Code generaTed by fileb0x at "2018-05-01 18:35:23.702577304 +0500 +05 m=+0.047872409" from config file "fileb0x.yml" DO NOT EDIT.
// modified(2018-05-01 18:35:02 +0500 +05)
// original path: assets/error.html
package static
import (
"os"
)
// FileErrorHTML is "/error.html"
var FileErrorHTML = []byte("\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x68\x74\x6d\x6c\x3e\x0a\x3c\x68\x74\x6d\x6c\x3e\x0a\x0a\x3c\x68\x65\x61\x64\x3e\x0a\x20\x20\x20\x20\x3c\x6d\x65\x74\x61\x20\x63\x68\x61\x72\x73\x65\x74\x3d\x22\x75\x74\x66\x2d\x38\x22\x3e\x0a\x20\x20\x20\x20\x3c\x6d\x65\x74\x61\x20\x6e\x61\x6d\x65\x3d\x22\x76\x69\x65\x77\x70\x6f\x72\x74\x22\x20\x63\x6f\x6e\x74\x65\x6e\x74\x3d\x22\x77\x69\x64\x74\x68\x3d\x64\x65\x76\x69\x63\x65\x2d\x77\x69\x64\x74\x68\x2c\x20\x69\x6e\x69\x74\x69\x61\x6c\x2d\x73\x63\x61\x6c\x65\x3d\x31\x22\x3e\x0a\x20\x20\x20\x20\x3c\x74\x69\x74\x6c\x65\x3e\x46\x61\x73\x74\x20\x50\x61\x73\x74\x65\x20\x42\x69\x6e\x20\x2d\x20\x45\x52\x52\x4f\x52\x21\x3c\x2f\x74\x69\x74\x6c\x65\x3e\x0a\x20\x20\x20\x20\x3c\x6c\x69\x6e\x6b\x20\x72\x65\x6c\x3d\x22\x73\x74\x79\x6c\x65\x73\x68\x65\x65\x74\x22\x20\x68\x72\x65\x66\x3d\x22\x2f\x73\x74\x61\x74\x69\x63\x2f\x63\x73\x73\x2f\x62\x75\x6c\x6d\x61\x2d\x30\x2e\x37\x2e\x30\x2e\x6d\x69\x6e\x2e\x63\x73\x73\x22\x3e\x0a\x20\x20\x20\x20\x3c\x73\x63\x72\x69\x70\x74\x20\x64\x65\x66\x65\x72\x20\x73\x72\x63\x3d\x22\x2f\x73\x74\x61\x74\x69\x63\x2f\x6a\x73\x2f\x66\x6f\x6e\x74\x61\x77\x65\x73\x6f\x6d\x65\x2d\x35\x2e\x30\x2e\x37\x2e\x6a\x73\x22\x3e\x3c\x2f\x73\x63\x72\x69\x70\x74\x3e\x0a\x20\x20\x20\x20\x3c\x6c\x69\x6e\x6b\x20\x72\x65\x6c\x3d\x22\x73\x74\x79\x6c\x65\x73\x68\x65\x65\x74\x22\x20\x68\x72\x65\x66\x3d\x22\x2f\x73\x74\x61\x74\x69\x63\x2f\x63\x73\x73\x2f\x73\x74\x79\x6c\x65\x2e\x63\x73\x73\x22\x3e\x0a\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x0a\x3c\x62\x6f\x64\x79\x3e\x0a\x20\x20\x20\x20\x3c\x6e\x61\x76\x20\x63\x6c\x61\x73\x73\x3d\x22\x6e\x61\x76\x62\x61\x72\x20\x69\x73\x2d\x64\x61\x72\x6b\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x69\x76\x20\x63\x6c\x61\x73\x73\x3d\x22\x6e\x61\x76\x62\x61\x72\x2d\x62\x72\x61\x6e\x64\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x61\x20\x63\x6c\x61\x73\x73\x3d\x22\x6e\x61\x76\x62\x61\x72\x2d\x69\x74\x65\x6d\x22\x20\x68\x72\x65\x66\x3d\x22\x2f\x22\x3e\x46\x61\x73\x74\x20\x50\x61\x73\x74\x65\x20\x42\x69\x6e\x3c\x2f\x61\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x61\x20\x63\x6c\x61\x73\x73\x3d\x22\x6e\x61\x76\x62\x61\x72\x2d\x69\x74\x65\x6d\x22\x20\x68\x72\x65\x66\x3d\x22\x2f\x70\x61\x73\x74\x65\x73\x2f\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x50\x61\x73\x74\x65\x73\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x2f\x61\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x69\x76\x20\x63\x6c\x61\x73\x73\x3d\x22\x6e\x61\x76\x62\x61\x72\x2d\x62\x75\x72\x67\x65\x72\x20\x62\x75\x72\x67\x65\x72\x22\x20\x64\x61\x74\x61\x2d\x74\x61\x72\x67\x65\x74\x3d\x22\x6e\x61\x76\x62\x61\x72\x49\x74\x65\x6d\x73\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x73\x70\x61\x6e\x3e\x3c\x2f\x73\x70\x61\x6e\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x73\x70\x61\x6e\x3e\x3c\x2f\x73\x70\x61\x6e\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x73\x70\x61\x6e\x3e\x3c\x2f\x73\x70\x61\x6e\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x2f\x64\x69\x76\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x2f\x64\x69\x76\x3e\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x69\x76\x20\x69\x64\x3d\x22\x6e\x61\x76\x62\x61\x72\x49\x74\x65\x6d\x73\x22\x20\x63\x6c\x61\x73\x73\x3d\x22\x6e\x61\x76\x62\x61\x72\x2d\x6d\x65\x6e\x75\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x69\x76\x20\x63\x6c\x61\x73\x73\x3d\x22\x6e\x61\x76\x62\x61\x72\x2d\x73\x74\x61\x72\x74\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x2f\x64\x69\x76\x3e\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x69\x76\x20\x63\x6c\x61\x73\x73\x3d\x22\x6e\x61\x76\x62\x61\x72\x2d\x65\x6e\x64\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x2f\x64\x69\x76\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x2f\x64\x69\x76\x3e\x0a\x20\x20\x20\x20\x3c\x2f\x6e\x61\x76\x3e\x0a\x20\x20\x20\x20\x3c\x73\x65\x63\x74\x69\x6f\x6e\x20\x63\x6c\x61\x73\x73\x3d\x22\x73\x65\x63\x74\x69\x6f\x6e\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x70\x3e\x7b\x65\x72\x72\x6f\x72\x7d\x3c\x2f\x70\x3e\x0a\x20\x20\x20\x20\x3c\x2f\x73\x65\x63\x74\x69\x6f\x6e\x3e\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x0a\x0a\x3c\x2f\x68\x74\x6d\x6c\x3e")
func init() {
f, err := FS.OpenFile(CTX, "/error.html", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0777)
if err != nil {
panic(err)
}
_, err = f.Write(FileErrorHTML)
if err != nil {
panic(err)
}
err = f.Close()
if err != nil {
panic(err)
}
}

File diff suppressed because one or more lines are too long

View File

@ -1,35 +0,0 @@
// Code generaTed by fileb0x at "2018-05-01 00:41:18.339400139 +0500 +05 m=+0.041230393" from config file "fileb0x.yml" DO NOT EDIT.
// modified(2018-05-01 00:32:51 +0500 +05)
// original path: assets/pagination.html
package static
import (
"os"
)
// FilePaginationHTML is "/pagination.html"
var FilePaginationHTML = []byte("\x3c\x73\x65\x63\x74\x69\x6f\x6e\x20\x63\x6c\x61\x73\x73\x3d\x22\x73\x65\x63\x74\x69\x6f\x6e\x22\x3e\x0a\x20\x20\x20\x20\x3c\x6e\x61\x76\x20\x63\x6c\x61\x73\x73\x3d\x22\x70\x61\x67\x69\x6e\x61\x74\x69\x6f\x6e\x20\x69\x73\x2d\x63\x65\x6e\x74\x65\x72\x65\x64\x22\x20\x72\x6f\x6c\x65\x3d\x22\x6e\x61\x76\x69\x67\x61\x74\x69\x6f\x6e\x22\x20\x61\x72\x69\x61\x2d\x6c\x61\x62\x65\x6c\x3d\x22\x70\x61\x67\x69\x6e\x61\x74\x69\x6f\x6e\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x61\x20\x63\x6c\x61\x73\x73\x3d\x22\x70\x61\x67\x69\x6e\x61\x74\x69\x6f\x6e\x2d\x70\x72\x65\x76\x69\x6f\x75\x73\x22\x20\x68\x72\x65\x66\x3d\x22\x7b\x70\x72\x65\x76\x69\x6f\x75\x73\x50\x61\x67\x65\x4c\x69\x6e\x6b\x7d\x22\x3e\x50\x72\x65\x76\x69\x6f\x75\x73\x20\x70\x61\x67\x65\x3c\x2f\x61\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x75\x6c\x20\x63\x6c\x61\x73\x73\x3d\x22\x70\x61\x67\x69\x6e\x61\x74\x69\x6f\x6e\x2d\x6c\x69\x73\x74\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7b\x70\x61\x67\x69\x6e\x61\x74\x69\x6f\x6e\x4c\x69\x6e\x6b\x73\x7d\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x2f\x75\x6c\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x61\x20\x63\x6c\x61\x73\x73\x3d\x22\x70\x61\x67\x69\x6e\x61\x74\x69\x6f\x6e\x2d\x6e\x65\x78\x74\x22\x20\x68\x72\x65\x66\x3d\x22\x7b\x6e\x65\x78\x74\x50\x61\x67\x65\x4c\x69\x6e\x6b\x7d\x22\x3e\x4e\x65\x78\x74\x20\x70\x61\x67\x65\x3c\x2f\x61\x3e\x0a\x20\x20\x20\x20\x3c\x2f\x6e\x61\x76\x3e\x0a\x3c\x2f\x73\x65\x63\x74\x69\x6f\x6e\x3e")
func init() {
f, err := FS.OpenFile(CTX, "/pagination.html", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0777)
if err != nil {
panic(err)
}
_, err = f.Write(FilePaginationHTML)
if err != nil {
panic(err)
}
err = f.Close()
if err != nil {
panic(err)
}
}

View File

@ -1,35 +0,0 @@
// Code generaTed by fileb0x at "2018-04-30 23:41:29.363654393 +0500 +05 m=+0.033742092" from config file "fileb0x.yml" DO NOT EDIT.
// modified(2018-04-30 23:39:44.086392054 +0500 +05)
// original path: assets/pagination_ellipsis.html
package static
import (
"os"
)
// FilePaginationEllipsisHTML is "/pagination_ellipsis.html"
var FilePaginationEllipsisHTML = []byte("\x3c\x6c\x69\x3e\x0a\x20\x20\x20\x20\x3c\x73\x70\x61\x6e\x20\x63\x6c\x61\x73\x73\x3d\x22\x70\x61\x67\x69\x6e\x61\x74\x69\x6f\x6e\x2d\x65\x6c\x6c\x69\x70\x73\x69\x73\x22\x3e\x26\x68\x65\x6c\x6c\x69\x70\x3b\x3c\x2f\x73\x70\x61\x6e\x3e\x0a\x3c\x2f\x6c\x69\x3e")
func init() {
f, err := FS.OpenFile(CTX, "/pagination_ellipsis.html", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0777)
if err != nil {
panic(err)
}
_, err = f.Write(FilePaginationEllipsisHTML)
if err != nil {
panic(err)
}
err = f.Close()
if err != nil {
panic(err)
}
}

View File

@ -1,35 +0,0 @@
// Code generaTed by fileb0x at "2018-05-01 00:26:24.973087795 +0500 +05 m=+0.032533011" from config file "fileb0x.yml" DO NOT EDIT.
// modified(2018-04-30 23:54:11 +0500 +05)
// original path: assets/pagination_link.html
package static
import (
"os"
)
// FilePaginationLinkHTML is "/pagination_link.html"
var FilePaginationLinkHTML = []byte("\x3c\x6c\x69\x3e\x0a\x20\x20\x20\x20\x3c\x61\x20\x63\x6c\x61\x73\x73\x3d\x22\x70\x61\x67\x69\x6e\x61\x74\x69\x6f\x6e\x2d\x6c\x69\x6e\x6b\x22\x20\x61\x72\x69\x61\x2d\x6c\x61\x62\x65\x6c\x3d\x22\x47\x6f\x20\x74\x6f\x20\x70\x61\x67\x65\x20\x7b\x70\x61\x67\x65\x4e\x75\x6d\x7d\x22\x20\x68\x72\x65\x66\x3d\x22\x7b\x70\x61\x67\x69\x6e\x61\x74\x69\x6f\x6e\x4c\x69\x6e\x6b\x7d\x22\x3e\x7b\x70\x61\x67\x65\x4e\x75\x6d\x7d\x3c\x2f\x61\x3e\x0a\x3c\x2f\x6c\x69\x3e")
func init() {
f, err := FS.OpenFile(CTX, "/pagination_link.html", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0777)
if err != nil {
panic(err)
}
_, err = f.Write(FilePaginationLinkHTML)
if err != nil {
panic(err)
}
err = f.Close()
if err != nil {
panic(err)
}
}

View File

@ -1,35 +0,0 @@
// Code generaTed by fileb0x at "2018-05-01 00:26:24.971847954 +0500 +05 m=+0.031293214" from config file "fileb0x.yml" DO NOT EDIT.
// modified(2018-04-30 23:54:14 +0500 +05)
// original path: assets/pagination_link_current.html
package static
import (
"os"
)
// FilePaginationLinkCurrentHTML is "/pagination_link_current.html"
var FilePaginationLinkCurrentHTML = []byte("\x3c\x6c\x69\x3e\x0a\x20\x20\x20\x20\x3c\x61\x20\x63\x6c\x61\x73\x73\x3d\x22\x70\x61\x67\x69\x6e\x61\x74\x69\x6f\x6e\x2d\x6c\x69\x6e\x6b\x20\x69\x73\x2d\x63\x75\x72\x72\x65\x6e\x74\x22\x20\x61\x72\x69\x61\x2d\x6c\x61\x62\x65\x6c\x3d\x22\x50\x61\x67\x65\x20\x7b\x70\x61\x67\x65\x4e\x75\x6d\x7d\x22\x20\x61\x72\x69\x61\x2d\x63\x75\x72\x72\x65\x6e\x74\x3d\x22\x70\x61\x67\x65\x22\x3e\x7b\x70\x61\x67\x65\x4e\x75\x6d\x7d\x3c\x2f\x61\x3e\x0a\x3c\x2f\x6c\x69\x3e")
func init() {
f, err := FS.OpenFile(CTX, "/pagination_link_current.html", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0777)
if err != nil {
panic(err)
}
_, err = f.Write(FilePaginationLinkCurrentHTML)
if err != nil {
panic(err)
}
err = f.Close()
if err != nil {
panic(err)
}
}

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,35 +0,0 @@
// Code generaTed by fileb0x at "2018-05-18 22:25:13.191256649 +0500 +05 m=+0.041507879" from config file "fileb0x.yml" DO NOT EDIT.
// modified(2018-05-18 22:17:55.447214662 +0500 +05)
// original path: assets/pastelist_list.html
package static
import (
"os"
)
// FilePastelistListHTML is "/pastelist_list.html"
var FilePastelistListHTML = []byte("\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x68\x74\x6d\x6c\x3e\x0a\x3c\x68\x74\x6d\x6c\x3e\x0a\x0a\x3c\x68\x65\x61\x64\x3e\x0a\x20\x20\x20\x20\x3c\x6d\x65\x74\x61\x20\x63\x68\x61\x72\x73\x65\x74\x3d\x22\x75\x74\x66\x2d\x38\x22\x3e\x0a\x20\x20\x20\x20\x3c\x6d\x65\x74\x61\x20\x6e\x61\x6d\x65\x3d\x22\x76\x69\x65\x77\x70\x6f\x72\x74\x22\x20\x63\x6f\x6e\x74\x65\x6e\x74\x3d\x22\x77\x69\x64\x74\x68\x3d\x64\x65\x76\x69\x63\x65\x2d\x77\x69\x64\x74\x68\x2c\x20\x69\x6e\x69\x74\x69\x61\x6c\x2d\x73\x63\x61\x6c\x65\x3d\x31\x22\x3e\x0a\x20\x20\x20\x20\x3c\x74\x69\x74\x6c\x65\x3e\x46\x61\x73\x74\x20\x50\x61\x73\x74\x65\x20\x42\x69\x6e\x20\x2d\x20\x50\x61\x73\x74\x65\x73\x3c\x2f\x74\x69\x74\x6c\x65\x3e\x0a\x20\x20\x20\x20\x3c\x6c\x69\x6e\x6b\x20\x72\x65\x6c\x3d\x22\x73\x74\x79\x6c\x65\x73\x68\x65\x65\x74\x22\x20\x68\x72\x65\x66\x3d\x22\x2f\x73\x74\x61\x74\x69\x63\x2f\x63\x73\x73\x2f\x62\x75\x6c\x6d\x61\x2d\x30\x2e\x37\x2e\x30\x2e\x6d\x69\x6e\x2e\x63\x73\x73\x22\x3e\x0a\x20\x20\x20\x20\x3c\x73\x63\x72\x69\x70\x74\x20\x64\x65\x66\x65\x72\x20\x73\x72\x63\x3d\x22\x2f\x73\x74\x61\x74\x69\x63\x2f\x6a\x73\x2f\x66\x6f\x6e\x74\x61\x77\x65\x73\x6f\x6d\x65\x2d\x35\x2e\x30\x2e\x37\x2e\x6a\x73\x22\x3e\x3c\x2f\x73\x63\x72\x69\x70\x74\x3e\x0a\x20\x20\x20\x20\x3c\x6c\x69\x6e\x6b\x20\x72\x65\x6c\x3d\x22\x73\x74\x79\x6c\x65\x73\x68\x65\x65\x74\x22\x20\x68\x72\x65\x66\x3d\x22\x2f\x73\x74\x61\x74\x69\x63\x2f\x63\x73\x73\x2f\x73\x74\x79\x6c\x65\x2e\x63\x73\x73\x22\x3e\x0a\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x0a\x3c\x62\x6f\x64\x79\x3e\x0a\x20\x20\x20\x20\x3c\x6e\x61\x76\x20\x63\x6c\x61\x73\x73\x3d\x22\x6e\x61\x76\x62\x61\x72\x20\x69\x73\x2d\x64\x61\x72\x6b\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x69\x76\x20\x63\x6c\x61\x73\x73\x3d\x22\x6e\x61\x76\x62\x61\x72\x2d\x62\x72\x61\x6e\x64\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x61\x20\x63\x6c\x61\x73\x73\x3d\x22\x6e\x61\x76\x62\x61\x72\x2d\x69\x74\x65\x6d\x22\x20\x68\x72\x65\x66\x3d\x22\x2f\x22\x3e\x46\x61\x73\x74\x20\x50\x61\x73\x74\x65\x20\x42\x69\x6e\x3c\x2f\x61\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x61\x20\x63\x6c\x61\x73\x73\x3d\x22\x6e\x61\x76\x62\x61\x72\x2d\x69\x74\x65\x6d\x22\x20\x68\x72\x65\x66\x3d\x22\x2f\x70\x61\x73\x74\x65\x73\x2f\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x50\x61\x73\x74\x65\x73\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x2f\x61\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x69\x76\x20\x63\x6c\x61\x73\x73\x3d\x22\x6e\x61\x76\x62\x61\x72\x2d\x62\x75\x72\x67\x65\x72\x20\x62\x75\x72\x67\x65\x72\x22\x20\x64\x61\x74\x61\x2d\x74\x61\x72\x67\x65\x74\x3d\x22\x6e\x61\x76\x62\x61\x72\x49\x74\x65\x6d\x73\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x73\x70\x61\x6e\x3e\x3c\x2f\x73\x70\x61\x6e\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x73\x70\x61\x6e\x3e\x3c\x2f\x73\x70\x61\x6e\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x73\x70\x61\x6e\x3e\x3c\x2f\x73\x70\x61\x6e\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x2f\x64\x69\x76\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x2f\x64\x69\x76\x3e\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x69\x76\x20\x69\x64\x3d\x22\x6e\x61\x76\x62\x61\x72\x49\x74\x65\x6d\x73\x22\x20\x63\x6c\x61\x73\x73\x3d\x22\x6e\x61\x76\x62\x61\x72\x2d\x6d\x65\x6e\x75\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x69\x76\x20\x63\x6c\x61\x73\x73\x3d\x22\x6e\x61\x76\x62\x61\x72\x2d\x73\x74\x61\x72\x74\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x2f\x64\x69\x76\x3e\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x69\x76\x20\x63\x6c\x61\x73\x73\x3d\x22\x6e\x61\x76\x62\x61\x72\x2d\x65\x6e\x64\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x2f\x64\x69\x76\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x2f\x64\x69\x76\x3e\x0a\x20\x20\x20\x20\x3c\x2f\x6e\x61\x76\x3e\x0a\x20\x20\x20\x20\x3c\x73\x65\x63\x74\x69\x6f\x6e\x20\x63\x6c\x61\x73\x73\x3d\x22\x73\x65\x63\x74\x69\x6f\x6e\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x69\x76\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7b\x70\x61\x67\x69\x6e\x61\x74\x69\x6f\x6e\x7d\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x2f\x64\x69\x76\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x69\x76\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7b\x70\x61\x73\x74\x65\x73\x7d\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x2f\x64\x69\x76\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x64\x69\x76\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7b\x70\x61\x67\x69\x6e\x61\x74\x69\x6f\x6e\x7d\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x2f\x64\x69\x76\x3e\x0a\x20\x20\x20\x20\x3c\x2f\x73\x65\x63\x74\x69\x6f\x6e\x3e\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x0a\x0a\x3c\x2f\x68\x74\x6d\x6c\x3e")