azukaar / Cosmos-Server

☁️ The Most Secure and Easy Selfhosted Home Server. Take control of your data and privacy without sacrificing security and stability (Authentication, anti-DDOS, anti-bot)
https://cosmos-cloud.io
Other
3.1k stars 112 forks source link

[BUG]: Cosmos-Server Crashing #109

Closed CropWatchDevelopment closed 10 months ago

CropWatchDevelopment commented 10 months ago

What happened?

$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES c692b91ecf3e azukaar/cosmos-server:latest "sh -c './$(cat /bin…" 13 hours ago Restarting (2) 28 seconds ago cosmos-server

What should have happened?

not that....

How to reproduce the bug?

I am not sure what exactly caused it, things were working great, I didn't make any changes, and it broke.

Relevant log output

$ docker compose up
[+] Running 2/2
 ✔ Network cosmos_default   Created                                                                                                                                                                                                                                    0.1s 
 ✔ Container cosmos-server  Recreated                                                                                                                                                                                                                                  0.1s 
Attaching to cosmos-server
cosmos-server  | 2023/10/23 01:40:38 [INFO] Starting...
cosmos-server  | 2023/10/23 01:40:38 [INFO] Using config file: /config/cosmos.config.json
cosmos-server  | 2023/10/23 01:40:38 [INFO] Validating config file...
cosmos-server  | 2023/10/23 01:40:38 [INFO] Docker Connected
cosmos-server  | panic: strconv.Atoi: parsing "thethings": invalid syntax
cosmos-server  | 
cosmos-server  | goroutine 1 [running]:
cosmos-server  | github.com/azukaar/cosmos-server/src/docker.ExportDocker()
cosmos-server  |    /home/circleci/project/src/docker/export.go:151 +0x1459
cosmos-server  | main.main()
cosmos-server  |    /home/circleci/project/src/index.go:26 +0x1ac
cosmos-server exited with code 0

### Other details

Here is the contents of `/var/lib/cosmos/cosmos.config.json`:

{ "LoggingLevel": "INFO", "MongoDB": "mongodb://cosmos-hVk6q:UNE97JMsti6CLR9ipCp6ggQZ@cosmos-mongo-HAj:27017", "DisableUserManagement": false, "NewInstall": false, "HTTPConfig": { "TLSCert": "OMITTED....", "TLSKey": "OBVIOUSLY OMITTED FOR SECURITY", "TLSKeyHostsCached": null, "TLSValidUntil": "0001-01-01T00:00:00Z", "AuthPrivateKey": "SAME", "AuthPublicKey": "AND AGAIN... OMITTED", "GenerateMissingAuthCert": true, "HTTPSCertificateMode": "PROVIDED", "DNSChallengeProvider": "", "ForceHTTPSCertificateRenewal": false, "HTTPPort": "80", "HTTPSPort": "443", "ProxyConfig": { "Routes": [ { "Name": "strapi", "Description": "Strapi rev proxy", "UseHost": true, "Host": "strapi.Webiste Name!!!", "UsePathPrefix": false, "PathPrefix": "", "Timeout": 14400000, "ThrottlePerMinute": 10000, "CORSOrigin": "", "StripPathPrefix": false, "MaxBandwith": 0, "AuthEnabled": false, "AdminOnly": false, "Target": "http://10.0.1.10:1337", "SmartShield": { "Enabled": true, "PolicyStrictness": 0, "PerUserTimeBudget": 0, "PerUserRequestLimit": 0, "PerUserByteLimit": 0, "PerUserSimultaneous": 0, "MaxGlobalSimultaneous": 0, "PrivilegedGroups": 0 }, "Mode": "PROXY", "BlockCommonBots": true, "BlockAPIAbuse": false, "AcceptInsecureHTTPSTarget": false, "HideFromDashboard": false, "DisableHeaderHardening": false, "VerboseForwardHeader": false, "AddionalFilters": null, "RestrictToConstellation": false, "OverwriteHostHeader": "", "WhitelistInboundIPs": null }, { "Name": "ai-reverseproxy", "Description": "for AI camera", "UseHost": true, "Host": "iot.OMITTED.io", "UsePathPrefix": false, "PathPrefix": "", "Timeout": 14400000, "ThrottlePerMinute": 10000, "CORSOrigin": "", "StripPathPrefix": false, "MaxBandwith": 0, "AuthEnabled": false, "AdminOnly": false, "Target": "http://10.0.1.15:3000", "SmartShield": { "Enabled": true, "PolicyStrictness": 0, "PerUserTimeBudget": 0, "PerUserRequestLimit": 0, "PerUserByteLimit": 0, "PerUserSimultaneous": 0, "MaxGlobalSimultaneous": 0, "PrivilegedGroups": 0 }, "Mode": "PROXY", "BlockCommonBots": true, "BlockAPIAbuse": false, "AcceptInsecureHTTPSTarget": false, "HideFromDashboard": false, "DisableHeaderHardening": false, "VerboseForwardHeader": false, "AddionalFilters": null, "RestrictToConstellation": false, "OverwriteHostHeader": "", "WhitelistInboundIPs": null }, { "Name": "yayoi", "Description": "New Route", "UseHost": true, "Host": "OMITTED.co.jp", "UsePathPrefix": false, "PathPrefix": "", "Timeout": 14400000, "ThrottlePerMinute": 10000, "CORSOrigin": "", "StripPathPrefix": false, "MaxBandwith": 0, "AuthEnabled": false, "AdminOnly": false, "Target": "http://10.0.1.15:81", "SmartShield": { "Enabled": true, "PolicyStrictness": 0, "PerUserTimeBudget": 0, "PerUserRequestLimit": 0, "PerUserByteLimit": 0, "PerUserSimultaneous": 0, "MaxGlobalSimultaneous": 0, "PrivilegedGroups": 0 }, "Mode": "PROXY", "BlockCommonBots": true, "BlockAPIAbuse": false, "AcceptInsecureHTTPSTarget": false, "HideFromDashboard": false, "DisableHeaderHardening": false, "VerboseForwardHeader": false, "AddionalFilters": null, "RestrictToConstellation": false, "OverwriteHostHeader": "", "WhitelistInboundIPs": null }, { "Name": "main Website", "Description": "Main Site", "UseHost": true, "Host": "Webiste Name!!!", "UsePathPrefix": false, "PathPrefix": "", "Timeout": 14400000, "ThrottlePerMinute": 10000, "CORSOrigin": "", "StripPathPrefix": false, "MaxBandwith": 0, "AuthEnabled": false, "AdminOnly": false, "Target": "http://10.0.1.15", "SmartShield": { "Enabled": true, "PolicyStrictness": 0, "PerUserTimeBudget": 0, "PerUserRequestLimit": 0, "PerUserByteLimit": 0, "PerUserSimultaneous": 0, "MaxGlobalSimultaneous": 0, "PrivilegedGroups": 0 }, "Mode": "PROXY", "BlockCommonBots": true, "BlockAPIAbuse": false, "AcceptInsecureHTTPSTarget": false, "HideFromDashboard": false, "DisableHeaderHardening": false, "VerboseForwardHeader": false, "AddionalFilters": null, "RestrictToConstellation": false, "OverwriteHostHeader": "", "WhitelistInboundIPs": null }, { "Name": "thethingsstack-stack-1", "Description": "Expose thethingsstack-stack-1 to the internet", "UseHost": true, "Host": "server-01.omitted.io", "UsePathPrefix": false, "PathPrefix": "", "Timeout": 14400000, "ThrottlePerMinute": 10000, "CORSOrigin": "", "StripPathPrefix": false, "MaxBandwith": 0, "AuthEnabled": false, "AdminOnly": false, "Target": "http://thethingsstack-stack-1:1885", "SmartShield": { "Enabled": true, "PolicyStrictness": 0, "PerUserTimeBudget": 0, "PerUserRequestLimit": 0, "PerUserByteLimit": 0, "PerUserSimultaneous": 0, "MaxGlobalSimultaneous": 0, "PrivilegedGroups": 0 }, "Mode": "SERVAPP", "BlockCommonBots": true, "BlockAPIAbuse": false, "AcceptInsecureHTTPSTarget": false, "HideFromDashboard": false, "DisableHeaderHardening": false, "VerboseForwardHeader": false, "AddionalFilters": null, "RestrictToConstellation": false, "OverwriteHostHeader": "", "WhitelistInboundIPs": null } ] }, "Hostname": "Webiste Name!!!", "SSLEmail": "", "UseWildcardCertificate": false, "OverrideWildcardDomains": "", "AcceptAllInsecureHostname": false }, "EmailConfig": { "Enabled": false, "Host": "", "Port": "", "Username": "", "Password": "", "From": "", "UseTLS": false }, "DockerConfig": { "SkipPruneNetwork": false, "DefaultDataPath": "/usr" }, "BlockedCountries": [], "CountryBlacklistIsWhitelist": false, "ServerCountry": "", "RequireMFA": false, "AutoUpdate": true, "OpenIDClients": null, "MarketConfig": { "Sources": [] }, "HomepageConfig": { "Background": "", "Widgets": null, "Expanded": false }, "ThemeConfig": { "PrimaryColor": "", "SecondaryColor": "" }, "ConstellationConfig": { "Enabled": false, "SlaveMode": false, "PrivateNode": false, "DNSDisabled": false, "DNSPort": "", "DNSFallback": "", "DNSBlockBlacklist": false, "DNSAdditionalBlocklists": null, "CustomDNSEntries": null, "NebulaConfig": { "PKI": { "CA": "", "Cert": "", "Key": "", "Blocklist": null }, "StaticHostMap": null, "Lighthouse": { "AMLighthouse": false, "Interval": 0, "Hosts": null }, "Listen": { "Host": "", "Port": 0 }, "Punchy": { "Punch": false, "Respond": false }, "Relay": { "AMRelay": false, "UseRelays": false, "Relays": null }, "TUN": { "Disabled": false, "Dev": "", "DropLocalBroadcast": false, "DropMulticast": false, "TxQueue": 0, "MTU": 0, "Routes": null, "UnsafeRoutes": null }, "Logging": { "Level": "", "Format": "" }, "Firewall": { "OutboundAction": "", "InboundAction": "", "Conntrack": { "TCPTimeout": "", "UDPTimeout": "", "DefaultTimeout": "" }, "Outbound": null, "Inbound": null } }, "ConstellationHostname": "" } }



### System details

- OS: Ubuntu Server
- Browser: Brave (doesn't matter)
- Version: azukaar/cosmos-server:latest
azukaar commented 10 months ago

This was fixed in 0.11.1 please make sure you are using that image :)