Browse Source

fix #1030

tags/v2.1.0-rc1
Shivaram Lingamneni 4 years ago
parent
commit
b2483f5cf2
5 changed files with 26 additions and 21 deletions
  1. 6
    6
      conventional.yaml
  2. 1
    1
      irc/channel.go
  3. 2
    2
      irc/client.go
  4. 6
    6
      irc/config.go
  5. 11
    6
      oragono.yaml

+ 6
- 6
conventional.yaml View File

@@ -766,13 +766,13 @@ roleplay:
766 766
 history:
767 767
     # should we store messages for later playback?
768 768
     # by default, messages are stored in RAM only; they do not persist
769
-    # across server restarts. however, you should not enable this unless you understand
770
-    # how it interacts with the GDPR and/or any data privacy laws that apply
769
+    # across server restarts. however, you may want to understand how message
770
+    # history interacts with the GDPR and/or any data privacy laws that apply
771 771
     # in your country and the countries of your users.
772
-    enabled: false
772
+    enabled: true
773 773
 
774 774
     # how many channel-specific events (messages, joins, parts) should be tracked per channel?
775
-    channel-length: 1024
775
+    channel-length: 2048
776 776
 
777 777
     # how many direct messages and notices should be tracked per user?
778 778
     client-length: 256
@@ -783,7 +783,7 @@ history:
783 783
     # are dynamically expanded up to the maximum length. if the buffer is full
784 784
     # and the oldest message is older than `autoresize-window`, then it will overwrite
785 785
     # the oldest message rather than resize; otherwise, it will expand if possible.
786
-    autoresize-window: 1h
786
+    autoresize-window: 3d
787 787
 
788 788
     # number of messages to automatically play back on channel join (0 to disable):
789 789
     autoreplay-on-join: 0
@@ -800,7 +800,7 @@ history:
800 800
     restrictions:
801 801
         # if this is set, messages older than this cannot be retrieved by anyone
802 802
         # (and will eventually be deleted from persistent storage, if that's enabled)
803
-        #expire-time: 1w
803
+        expire-time: 1w
804 804
 
805 805
         # if this is set, logged-in users cannot retrieve messages older than their
806 806
         # account registration date, and logged-out users cannot retrieve messages

+ 1
- 1
irc/channel.go View File

@@ -111,7 +111,7 @@ func (channel *Channel) IsLoaded() bool {
111 111
 func (channel *Channel) resizeHistory(config *Config) {
112 112
 	status, _ := channel.historyStatus(config)
113 113
 	if status == HistoryEphemeral {
114
-		channel.history.Resize(config.History.ChannelLength, config.History.AutoresizeWindow)
114
+		channel.history.Resize(config.History.ChannelLength, time.Duration(config.History.AutoresizeWindow))
115 115
 	} else {
116 116
 		channel.history.Resize(0, 0)
117 117
 	}

+ 2
- 2
irc/client.go View File

@@ -318,7 +318,7 @@ func (server *Server) RunClient(conn IRCConn) {
318 318
 		proxiedIP:      proxiedIP,
319 319
 	}
320 320
 	client.writerSemaphore.Initialize(1)
321
-	client.history.Initialize(config.History.ClientLength, config.History.AutoresizeWindow)
321
+	client.history.Initialize(config.History.ClientLength, time.Duration(config.History.AutoresizeWindow))
322 322
 	client.brbTimer.Initialize(client)
323 323
 	session := &Session{
324 324
 		client:     client,
@@ -414,7 +414,7 @@ func (server *Server) AddAlwaysOnClient(account ClientAccount, chnames []string,
414 414
 func (client *Client) resizeHistory(config *Config) {
415 415
 	status, _ := client.historyStatus(config)
416 416
 	if status == HistoryEphemeral {
417
-		client.history.Resize(config.History.ClientLength, config.History.AutoresizeWindow)
417
+		client.history.Resize(config.History.ClientLength, time.Duration(config.History.AutoresizeWindow))
418 418
 	} else {
419 419
 		client.history.Resize(0, 0)
420 420
 	}

+ 6
- 6
irc/config.go View File

@@ -576,12 +576,12 @@ type Config struct {
576 576
 
577 577
 	History struct {
578 578
 		Enabled          bool
579
-		ChannelLength    int           `yaml:"channel-length"`
580
-		ClientLength     int           `yaml:"client-length"`
581
-		AutoresizeWindow time.Duration `yaml:"autoresize-window"`
582
-		AutoreplayOnJoin int           `yaml:"autoreplay-on-join"`
583
-		ChathistoryMax   int           `yaml:"chathistory-maxmessages"`
584
-		ZNCMax           int           `yaml:"znc-maxmessages"`
579
+		ChannelLength    int              `yaml:"channel-length"`
580
+		ClientLength     int              `yaml:"client-length"`
581
+		AutoresizeWindow custime.Duration `yaml:"autoresize-window"`
582
+		AutoreplayOnJoin int              `yaml:"autoreplay-on-join"`
583
+		ChathistoryMax   int              `yaml:"chathistory-maxmessages"`
584
+		ZNCMax           int              `yaml:"znc-maxmessages"`
585 585
 		Restrictions     struct {
586 586
 			ExpireTime              custime.Duration `yaml:"expire-time"`
587 587
 			EnforceRegistrationDate bool             `yaml:"enforce-registration-date"`

+ 11
- 6
oragono.yaml View File

@@ -16,6 +16,11 @@
16 16
 #    you should enable them in server.listeners in place of the default
17 17
 #    self-signed certificates
18 18
 # 3. the operator password in the 'opers' section
19
+# 4. by default, message history is enabled, using in-memory history storage
20
+#    and with messages expiring after 7 days. depending on your needs, you may
21
+#    want to disable history entirely, remove the expiration time, switch to
22
+#    persistent history stored in MySQL, or do something else entirely. See
23
+#    the 'history' section of the config.
19 24
 
20 25
 # network configuration
21 26
 network:
@@ -787,13 +792,13 @@ roleplay:
787 792
 history:
788 793
     # should we store messages for later playback?
789 794
     # by default, messages are stored in RAM only; they do not persist
790
-    # across server restarts. however, you should not enable this unless you understand
791
-    # how it interacts with the GDPR and/or any data privacy laws that apply
795
+    # across server restarts. however, you may want to understand how message
796
+    # history interacts with the GDPR and/or any data privacy laws that apply
792 797
     # in your country and the countries of your users.
793
-    enabled: false
798
+    enabled: true
794 799
 
795 800
     # how many channel-specific events (messages, joins, parts) should be tracked per channel?
796
-    channel-length: 1024
801
+    channel-length: 2048
797 802
 
798 803
     # how many direct messages and notices should be tracked per user?
799 804
     client-length: 256
@@ -804,7 +809,7 @@ history:
804 809
     # are dynamically expanded up to the maximum length. if the buffer is full
805 810
     # and the oldest message is older than `autoresize-window`, then it will overwrite
806 811
     # the oldest message rather than resize; otherwise, it will expand if possible.
807
-    autoresize-window: 1h
812
+    autoresize-window: 3d
808 813
 
809 814
     # number of messages to automatically play back on channel join (0 to disable):
810 815
     autoreplay-on-join: 0
@@ -821,7 +826,7 @@ history:
821 826
     restrictions:
822 827
         # if this is set, messages older than this cannot be retrieved by anyone
823 828
         # (and will eventually be deleted from persistent storage, if that's enabled)
824
-        #expire-time: 1w
829
+        expire-time: 1w
825 830
 
826 831
         # if this is set, logged-in users cannot retrieve messages older than their
827 832
         # account registration date, and logged-out users cannot retrieve messages

Loading…
Cancel
Save