Skip to content

Commit f647882

Browse files
committed
Revert "refactor(queue): switch from rabbitmq to lavinmq"
This reverts commit 362be15.
1 parent ce3bdfe commit f647882

File tree

3 files changed

+5
-35
lines changed

3 files changed

+5
-35
lines changed

internal/assets/docker-compose.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,24 @@ services:
3939

4040
runtipi-queue:
4141
container_name: runtipi-queue
42-
image: cloudamqp/lavinmq
42+
image: rabbitmq:4-alpine
4343
restart: unless-stopped
44-
volumes:
45-
- ./lavinmq.ini:/etc/lavinmq/lavinmq.ini
4644
ports:
4745
- 5672:5672
46+
environment:
47+
RABBITMQ_DEFAULT_USER: tipi
48+
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD}
4849
networks:
4950
- tipi_main_network
5051

5152
runtipi:
5253
container_name: runtipi
5354
healthcheck:
55+
start_period: 10s
5456
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
5557
interval: 5s
5658
timeout: 10s
5759
retries: 20
58-
start_period: 10s
5960
image: ghcr.io/runtipi/runtipi:${TIPI_VERSION}
6061
restart: unless-stopped
6162
depends_on:

internal/utils/env.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -131,17 +131,6 @@ func GenerateEnvFile(customEnvFile string) error {
131131
rabbitmqPassword = DeriveEntropy("rabbitmq_password", seed)
132132
}
133133

134-
hashedPassword, err := HashPassword(rabbitmqPassword)
135-
if err != nil {
136-
return fmt.Errorf("failed to hash rabbitmq password: %w", err)
137-
}
138-
139-
lavinmqIniPath := filepath.Join(config.RootFolder, "lavinmq.ini")
140-
lavinmqIniContent := fmt.Sprintf("[main]\ndefault_user = tipi\ndefault_password = %s\n", hashedPassword)
141-
if err := os.WriteFile(lavinmqIniPath, []byte(lavinmqIniContent), 0644); err != nil {
142-
return fmt.Errorf("failed to write lavinmq.ini: %w", err)
143-
}
144-
145134
// Handle app data path
146135
appDataPath := settings.AppDataPath
147136
if appDataPath == "" {

internal/utils/system_info.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
package utils
22

33
import (
4-
"crypto/rand"
54
"crypto/sha256"
6-
"encoding/base64"
75
"encoding/hex"
86
"net"
97
"os"
@@ -36,21 +34,3 @@ func DeriveEntropy(key, seed string) string {
3634
hash := sha256.Sum256([]byte(key + seed))
3735
return hex.EncodeToString(hash[:])[:32]
3836
}
39-
40-
func HashPassword(password string) (string, error) {
41-
salt := make([]byte, 4)
42-
_, err := rand.Read(salt)
43-
if err != nil {
44-
return "", err
45-
}
46-
47-
salted := append(salt, []byte(password)...)
48-
49-
hash := sha256.Sum256(salted)
50-
51-
final := append(salt, hash[:]...)
52-
53-
encoded := base64.StdEncoding.EncodeToString(final)
54-
55-
return encoded, nil
56-
}

0 commit comments

Comments
 (0)