Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
backend
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
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hizla
waitlist
backend
Commits
45749909
Commit
45749909
authored
10 months ago
by
Ophestra
Browse files
Options
Downloads
Plain Diff
Merge branch 'listen-on-socket' into 'main'
feat(serve): listen on unix socket See merge request
!7
parents
7cb0a36e
2ac4ee4e
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!7
feat(serve): listen on unix socket
Pipeline
#969
passed
10 months ago
Stage: lint
Stage: test
Stage: build
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app.go
+10
-1
10 additions, 1 deletion
app.go
conf.go
+2
-0
2 additions, 0 deletions
conf.go
with
12 additions
and
1 deletion
app.go
+
10
−
1
View file @
45749909
...
@@ -3,6 +3,7 @@ package main
...
@@ -3,6 +3,7 @@ package main
import
(
import
(
"fmt"
"fmt"
"log"
"log"
"net"
"os"
"os"
"sync/atomic"
"sync/atomic"
"time"
"time"
...
@@ -73,5 +74,13 @@ func serve(sig chan os.Signal, db *leveldb.DB) error {
...
@@ -73,5 +74,13 @@ func serve(sig chan os.Signal, db *leveldb.DB) error {
}
}
}()
}()
if
conf
[
listen
]
==
"unset"
{
return
app
.
Listen
(
conf
[
listenAddr
])
return
app
.
Listen
(
conf
[
listenAddr
])
}
else
{
if
l
,
err
:=
net
.
Listen
(
"unix"
,
conf
[
listen
]);
err
!=
nil
{
return
err
}
else
{
return
app
.
Listener
(
l
)
}
}
}
}
This diff is collapsed.
Click to expand it.
conf.go
+
2
−
0
View file @
45749909
...
@@ -7,6 +7,7 @@ import (
...
@@ -7,6 +7,7 @@ import (
const
(
const
(
dbPath
uint8
=
iota
dbPath
uint8
=
iota
listen
listenAddr
listenAddr
allowedURL
allowedURL
hCaptchaSiteKey
hCaptchaSiteKey
...
@@ -17,6 +18,7 @@ const (
...
@@ -17,6 +18,7 @@ const (
// env variable, default pairing
// env variable, default pairing
var
confEnv
=
[
...
][
2
]
string
{
var
confEnv
=
[
...
][
2
]
string
{
dbPath
:
{
"DB"
,
"db"
},
dbPath
:
{
"DB"
,
"db"
},
listen
:
{
"LISTEN"
,
"unset"
},
listenAddr
:
{
"LISTEN_ADDR"
,
"127.0.0.1:3000"
},
listenAddr
:
{
"LISTEN_ADDR"
,
"127.0.0.1:3000"
},
allowedURL
:
{
"ALLOWED_URL"
,
"https://hizla.io"
},
allowedURL
:
{
"ALLOWED_URL"
,
"https://hizla.io"
},
hCaptchaSiteKey
:
{
"HCAPTCHA_SITE_KEY"
,
"unset"
},
hCaptchaSiteKey
:
{
"HCAPTCHA_SITE_KEY"
,
"unset"
},
...
...
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