1
|
1
|
new file mode 100644
|
...
|
...
|
@@ -0,0 +1,180 @@
|
|
1
|
+apt update -y
|
|
2
|
+apt upgrade -y
|
|
3
|
+
|
|
4
|
+apt install -y sudo build-essential htop nginx libevent* debhelper libssl-dev libcap-dev libz-dev libwww-perl
|
|
5
|
+apt --fix-broken install
|
|
6
|
+
|
|
7
|
+adduser --system --no-create-home --home /var/run/aprsc --shell /usr/sbin/nologin --group aprsc
|
|
8
|
+
|
|
9
|
+cd wget http://he.fi/aprsc/down/aprsc-latest.tar.gz
|
|
10
|
+tar xvfz aprsc-latest.tar.gz
|
|
11
|
+rm -rf aprsc-latest.tar.gz
|
|
12
|
+cd aprsc-*
|
|
13
|
+cd src
|
|
14
|
+./configure
|
|
15
|
+make make-deb
|
|
16
|
+sudo dpkg -i ../aprsc-*.deb
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+sudo systemctl enable aprsc
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+tee /etc/default/aprsc <<EOF
|
|
23
|
+
|
|
24
|
+#
|
|
25
|
+# STARTAPRSC: start aprsc on boot. Should be set to "yes" once you have
|
|
26
|
+# configured aprsc.
|
|
27
|
+#
|
|
28
|
+STARTAPRSC="yes"
|
|
29
|
+
|
|
30
|
+#
|
|
31
|
+# Additional options that are passed to the Daemon.
|
|
32
|
+# Description of used options (don't change these unless
|
|
33
|
+# you're sure what you're doing):
|
|
34
|
+# -u aprsc: switch to user 'aprsc' as soon as possible
|
|
35
|
+# -t /opt/aprsc: chroot to the given directory
|
|
36
|
+# -f: fork to a daemon
|
|
37
|
+# -e info: log at level info
|
|
38
|
+# -o file: log to file
|
|
39
|
+# -r logs: log files are placed in /opt/aprsc/logs
|
|
40
|
+# -c etc/aprsc.conf: configuration file location
|
|
41
|
+#
|
|
42
|
+# Since the daemon chroots to /opt/aprsc, all paths are relative to
|
|
43
|
+# that directory and the daemon cannot access any files outside
|
|
44
|
+# the chroot.
|
|
45
|
+#
|
|
46
|
+# aprsc can log to syslog too, but that'd require bringing the
|
|
47
|
+# syslog socket within the chroot.
|
|
48
|
+#
|
|
49
|
+
|
|
50
|
+DAEMON_OPTS="-u aprsc -t /opt/aprsc -f -e info -o file -r logs -c etc/aprsc.conf"
|
|
51
|
+
|
|
52
|
+EOF
|
|
53
|
+
|
|
54
|
+tee /opt/aprsc/etc/aprsc.conf <<EOF
|
|
55
|
+# Configuration for aprsc, an APRS-IS server for core servers
|
|
56
|
+
|
|
57
|
+# Your unique server ID
|
|
58
|
+ServerId CALLSIGN-30
|
|
59
|
+# Passcode for the server ID
|
|
60
|
+PassCode 0
|
|
61
|
+# Who is running this server?
|
|
62
|
+MyAdmin "Name Last, Callsign"
|
|
63
|
+# The email address where the admin can be reached
|
|
64
|
+MyEmail email@domain.tld
|
|
65
|
+
|
|
66
|
+### Directories #########
|
|
67
|
+# Data directory (for persistent state files - currently none)
|
|
68
|
+RunDir data
|
|
69
|
+
|
|
70
|
+# If logging to a file (-o file), enable built-in log rotation.
|
|
71
|
+# LogRotate <megabytes> <filecount>
|
|
72
|
+# "LogRotate 10 5" keeps 5 old files of 10 megabytes each.
|
|
73
|
+LogRotate 10 5
|
|
74
|
+
|
|
75
|
+### Intervals and timers #########
|
|
76
|
+# Interval specification format examples:
|
|
77
|
+# 600 (600 seconds), or 600s, 5m, 2h, 1h30m, 1d3h15m24s, etc...
|
|
78
|
+
|
|
79
|
+# When no data is received from an upstream server in N seconds, switch to
|
|
80
|
+# another server.
|
|
81
|
+UpstreamTimeout 15s
|
|
82
|
+
|
|
83
|
+# When no data is received from a downstream server in N seconds, disconnect
|
|
84
|
+ClientTimeout 48h
|
|
85
|
+
|
|
86
|
+### TCP listener ##########
|
|
87
|
+# Listen <socketname> <porttype> tcp <address to bind> <port> <options...>
|
|
88
|
+# socketname: any name you wish to show up in logs and statistics
|
|
89
|
+# porttype: one of:
|
|
90
|
+# fullfeed - everything, after dupe filtering
|
|
91
|
+# igate - igate / client port with user-specified filters
|
|
92
|
+# udpsubmit - UDP packet submission port (8080)
|
|
93
|
+# dupefeed - duplicate packets dropped by the server
|
|
94
|
+# options:
|
|
95
|
+# filter "m/500" - force a filter for users connected here
|
|
96
|
+# maxclients 100 - limit clients connected on this port
|
|
97
|
+# acl etc/client.acl - match client addresses against ACL
|
|
98
|
+# hidden - don't show the port in the status page
|
|
99
|
+#
|
|
100
|
+# If you wish to provide UDP service for clients, set up a
|
|
101
|
+# second listener on the same address, port and protocol.
|
|
102
|
+#
|
|
103
|
+# The "::" is IPv6 "IN6ADDR_ANY", whereas "0.0.0.0" is same
|
|
104
|
+# with IPv4.
|
|
105
|
+#
|
|
106
|
+# On FreeBSD you need to have separate listeners for IPv4 and
|
|
107
|
+# IPv6. On Linux, just use :: alone - the IPv6 listener will
|
|
108
|
+# catch the IPv4 connections just as well.
|
|
109
|
+#
|
|
110
|
+# Example of normal server ports for Linux, supporting both TCP and UDP,
|
|
111
|
+# IPv4 and IPv6:
|
|
112
|
+#
|
|
113
|
+Listen "Full feed" fullfeed tcp :: 10152 hidden
|
|
114
|
+Listen "" fullfeed udp :: 10152 hidden
|
|
115
|
+
|
|
116
|
+Listen "Client-Defined Filters" igate tcp :: 14580
|
|
117
|
+Listen "" igate udp :: 14580
|
|
118
|
+
|
|
119
|
+Listen "350 km from my position" igate tcp :: 20350 filter "m/350"
|
|
120
|
+Listen "" igate udp :: 20350 filter "m/350"
|
|
121
|
+
|
|
122
|
+Listen "UDP submit" udpsubmit udp :: 8080
|
|
123
|
+
|
|
124
|
+### Uplink configuration ########
|
|
125
|
+# Uplink <name> <type> tcp <address> <port>
|
|
126
|
+# name: a name of the server or service you're connecting to
|
|
127
|
+# type: one of:
|
|
128
|
+# full - full feed
|
|
129
|
+# ro - read-only, do not transmit anything upstream
|
|
130
|
+#
|
|
131
|
+# If you wish to specify multiple alternative servers, use multiple
|
|
132
|
+# Uplink lines, one for each server.
|
|
133
|
+#
|
|
134
|
+# Normally a single line for the 'rotate' address is fine - it will connect
|
|
135
|
+# to one of the servers in a random fashion and go for another one should
|
|
136
|
+# the first one become unavailable.
|
|
137
|
+#
|
|
138
|
+Uplink "Core rotate" full tcp rotate.aprs.net 10152
|
|
139
|
+#Uplink "Core rotate" ro tcp rotate.aprs.net 10152
|
|
140
|
+
|
|
141
|
+# OPTIONAL: Bind source address before connecting to an uplink
|
|
142
|
+# You can enter two addresses, one for IPv4 and one for IPv6 connections.
|
|
143
|
+# Needed if you have multiple IP addresses on your server and only one
|
|
144
|
+# of them is allowed to connect by the remote server.
|
|
145
|
+#UplinkBind 127.0.0.1
|
|
146
|
+#UplinkBind ::1
|
|
147
|
+
|
|
148
|
+### HTTP server ##########
|
|
149
|
+# HTTPStatus port provides a status view to web browsers.
|
|
150
|
+# IPv6+IPv4 support works slightly differently than in Listen:
|
|
151
|
+# :: is "all addresses" for IPv6, 0.0.0.0 for IPv4, but
|
|
152
|
+# :: only works if you actually have a global IPv6 address
|
|
153
|
+# configured on the system.
|
|
154
|
+# The example is for IPv4, change the address to :: if you have
|
|
155
|
+# IPv6. For FreeBSD, or if you wish to support multiple specific
|
|
156
|
+# ports/addresses, use multiple HTTPStatus directives for each.
|
|
157
|
+HTTPStatus 0.0.0.0 14501
|
|
158
|
+# HTTPUpload port allows position uploads over HTTP
|
|
159
|
+HTTPUpload 0.0.0.0 8080
|
|
160
|
+
|
|
161
|
+### Environment ############
|
|
162
|
+# When running this server as super-user, the server can (in many systems)
|
|
163
|
+# increase several resource limits, and do other things that less privileged
|
|
164
|
+# server can not do.
|
|
165
|
+#
|
|
166
|
+# The FileLimit is resource limit on how many simultaneous connections and
|
|
167
|
+# some other internal resources the system can use at the same time.
|
|
168
|
+# If the server is not being run as super-user, this setting has no effect
|
|
169
|
+# in case it is above what normal user can set.
|
|
170
|
+#
|
|
171
|
+FileLimit 10000
|
|
172
|
+
|
|
173
|
+### Operator attention span qualification run ###########
|
|
174
|
+# After configuring the rest of the settings, remove this bad command
|
|
175
|
+# from the configuration file. It's here only to avoid starting the
|
|
176
|
+# server up accidentally with an invalid configuration.
|
|
177
|
+#MagicBadness 42.7
|
|
178
|
+EOF
|
|
179
|
+
|
|
180
|
+reboot
|