Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cdn-origin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
easrng
cdn-origin
Commits
c776506b
Commit
c776506b
authored
6 years ago
by
Dean
Browse files
Options
Downloads
Patches
Plain Diff
update README.md and LICENSE
parent
4bedf17c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
LICENSE
+1
-1
1 addition, 1 deletion
LICENSE
README.md
+12
-33
12 additions, 33 deletions
README.md
with
13 additions
and
34 deletions
LICENSE
+
1
−
1
View file @
c776506b
The MIT License (MIT)
Copyright (c) 201
8
Dean Sheather, whats-this
Copyright (c) 201
9
Dean Sheather, whats-this
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
...
...
This diff is collapsed.
Click to expand it.
README.md
+
12
−
33
View file @
c776506b
#
Whats-This CDN O
rigin
#
cdn-o
rigin
Simple but quick Golang webserver that serves requests to get files and
redirects from a
[
PostgreSQL
](
https://www.postgresql.org
)
and
[
SeaweedFS
](
https://github.com/chrislusf/seaweedfs
)
backend.
redirects from
[
PostgreSQL
](
https://www.postgresql.org
)
.
### Requirements
-
PostgreSQL server with
`objects`
table
-
SeaweedFS cluster wi
th files
in the
`objects`
table
-
Access to the folder where
th
e
files
are stored
### Usage
```
$ go get -u github.com/whats-this/cdn-origin
# With configuration file
$ cp $GOPATH/src/github.com/whats-this/cdn-origin/cdn-origin.sample.toml /etc/cdn-origin/cdn-origin.toml
$ vim /etc/cdn-origin/cdn-origin.toml
$ cdn-origin
# With environment variables
$ set DATABASE_CONNECTION_URL="postgres://postgres@localhost/data?sslmode=disable"
$ set SEAWEED_MASTER_URL="http://localhost:9333"
$ ...
$ cdn-origin
# With flags
$ cdn-origin \
--database-connection-url="postgres://postgres@localhost/data?sslmode=disable" \
--seaweed-master-url="http://localhost:9333" \
...
# Flags take precedence over environment variables, which take precedence over config files
$ git clone https://owo.codes/whats-this/cdn-origin.git
$ cd cdn-origin
$ cp config.sample.toml config.toml
$ vim config.toml
$ go build main.go
$ ./main --config-file ./config.toml
```
Information about configuration variables and their purpose can be found in
[
cdn-origin.sample.toml
](
cdn-origin.sample.toml
)
. Configuration is handled by
[
Viper
](
https://github.com/spf13/viper
)
.
### Metrics
If
`metrics.enable`
is
`true`
, request metadata will be indexed in the provided
...
...
@@ -55,17 +36,15 @@ Elaticsearch server in the following format:
The index and
`@timestamp`
pipeline are created automatically if
`cdn-origin`
has permission. Alternatively, the mapping and pipeline can be created by other
means using the
`.json`
files in
[
metrics/
](
metrics
)
.
means using the
`.json`
files in
[
lib/
metrics/
](
lib/
metrics
)
.
### TODO
-
[ ] Process chunked files stored in SeaweedFS, similar to
[
how SeaweedFS cli
handles it
](
https://github.com/chrislusf/seaweedfs/wiki/Large-File-Handling
)
-
[ ] Add TTL to volume cache
-
[ ] Write tests
-
[ ] Add thumbnail functionality
(SeaweedFS supports this)
-
[ ] Add thumbnail functionality
### License
`cdn-origin`
is licensed under the MIT license. A copy of the MIT license can be
found in
[
LICENSE
](
LICENSE
)
.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment