aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorFChannel <=>2021-01-17 12:06:01 -0800
committerFChannel <=>2021-01-17 12:06:01 -0800
commita4c64444b2b3df780a7a23e65d24f03dc983a188 (patch)
treeacdd5cddf3899ab6a5a8e3e1616fb82c6aea89c3 /main.go
parent08cfcaf5d4062adc37079430b83c741a1f355ae9 (diff)
added go mod and config-init
Diffstat (limited to 'main.go')
-rw-r--r--main.go17
1 files changed, 15 insertions, 2 deletions
diff --git a/main.go b/main.go
index cda1f97..a1f55d8 100644
--- a/main.go
+++ b/main.go
@@ -24,7 +24,7 @@ var Domain = TP + "" + GetConfigValue("instance")
var authReq = []string{"captcha","email","passphrase"}
-var supportedFiles = []string{"image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/avif","image/apng","video/mp4","video/ogg","video/webm","audio/mpeg","audio/ogg","audio/wav"}
+var supportedFiles = []string{"image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/avif","image/apng","video/mp4","video/ogg","video/webm","audio/mpeg","audio/ogg","audio/wav", "audio/wave", "audio/x-wav"}
var SiteEmail string //contact@fchan.xyz
var SiteEmailPassword string
@@ -389,6 +389,17 @@ func CreateTripCode(input string) string {
return out.String()
}
+func CreateNameTripCode(input string) string {
+ fmt.Println("AHHHHHHHHHH")
+ re := regexp.MustCompile("#.+")
+ chunck := re.FindString(input)
+ fmt.Println(input)
+ fmt.Println(chunck)
+ hash := CreateTripCode(chunck)
+ fmt.Println(hash[0:8])
+ return re.ReplaceAllString(input, hash[0:8])
+}
+
func GetActorFromPath(db *sql.DB, location string, prefix string) Actor {
pattern := fmt.Sprintf("%s([^/\n]+)(/.+)?", prefix)
re := regexp.MustCompile(pattern)
@@ -426,7 +437,7 @@ func GetContentType(location string) string {
func RandomID(size int) string {
rand.Seed(time.Now().UnixNano())
- domain := "0123456789ABCDEF"
+ domain := "0123456789ABCDEFG"
rng := size
newID := ""
for i := 0; i < rng; i++ {
@@ -1009,3 +1020,5 @@ func IsInStringArray(array []string, value string) bool {
}
return false
}
+
+