Skip to content

Commit 81eaccc

Browse files
authored
chore: add deployment script for ease of deployment (#1457)
1 parent a7bb27e commit 81eaccc

File tree

5 files changed

+375
-176
lines changed

5 files changed

+375
-176
lines changed

Cargo.lock

Lines changed: 8 additions & 123 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ tracing-subscriber = "0.3"
3131
wasmer = "5.0.4"
3232
wasmer-compiler-singlepass = "5.0.4"
3333

34-
# freenet-stdlib = { path = "./stdlib/rust/", features = ["unstable"] }
35-
freenet-stdlib = { version = "0.1.2" }
34+
freenet-stdlib = { path = "./stdlib/rust/" }
35+
# freenet-stdlib = { version = "0.1.2" }
3636

3737
[profile.dev.package."*"]
3838
opt-level = 3

crates/fdev/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ reqwest = { version = "0.12", features = ["json"] }
3838
http = "1.2"
3939

4040
# internal
41-
# freenet = { path = "../core"}
42-
freenet = { version = "0.1.1"}
41+
freenet = { path = "../core"}
42+
# freenet = { version = "0.1.1"}
4343
freenet-stdlib = { workspace = true }
4444

4545
[features]

scripts/FREENET-GW-SETUP-GUIDE.md

Lines changed: 59 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Here’s the full README in Markdown format for you to copy and paste:
33
# **Freenet Gateway Setup Guide with systemd**
44

55
## **1. Introduction**
6+
67
This guide provides detailed instructions for setting up and managing a **Freenet Gateway** service using `systemd` with the `init-gateway.sh` script.
78

89
---
@@ -32,98 +33,107 @@ Ensure you have the following installed:
3233
### **4.1. Copy Required Files**
3334

3435
1. **Copy `freenet-gateway.service` to systemd directory:**
35-
```bash
36-
sudo cp freenet-gateway.service /etc/systemd/system/
37-
```
38-
39-
2. Copy init-gateway.sh to /usr/local/bin/:
40-
41-
```bash
42-
sudo cp init-gateway.sh /usr/local/bin/
43-
sudo chmod +x /usr/local/bin/init-gateway.sh
44-
```
45-
46-
3. Set Ownership (if required):
47-
48-
```bash
49-
sudo chown root:root /etc/systemd/system/freenet-gateway.service
50-
sudo chown root:root /usr/local/bin/init-gateway.sh
51-
```
36+
37+
```bash
38+
sudo cp freenet-gateway.service /etc/systemd/system/
39+
```
40+
41+
2. Copy init-gateway.sh to /usr/local/bin/:
42+
43+
```bash
44+
sudo cp init-gateway.sh /usr/local/bin/
45+
sudo chmod +x /usr/local/bin/init-gateway.sh
46+
```
47+
48+
3. Set Ownership (if required):
49+
50+
```bash
51+
sudo chown root:root /etc/systemd/system/freenet-gateway.service
52+
sudo chown root:root /usr/local/bin/init-gateway.sh
53+
```
54+
5255
---
5356

5457
### **4.2. Update Environment Variables (if needed)**
5558

5659
Edit the service file if paths or parameters differ:
5760

5861
```bash
59-
sudo nano /etc/systemd/system/freenet-gateway.service
62+
sudo vi /etc/systemd/system/freenet-gateway.service
6063
```
6164

6265
Update values such as:
66+
6367
- TRANSPORT_KEYPAIR
6468
- PUBLIC_NETWORK_ADDRESS
6569
- PUBLIC_NETWORK_PORT
6670

6771
Save and exit.
6872

73+
### \*\*4.3. Configure gateways.toml file
74+
75+
Is important to manually setup the gateways file. Use as a [template](http://freenet.org/keys/gateways.toml) the file used by regular peers in the freenet.org website.
76+
77+
Then remove as necessary. For the main gateway this file should not exist, for others, they should list other gateways than themselves.
78+
6979
## **5. Enable and Start the Service**
70-
### **1. Reload systemd to recognize the new service:**
7180

72-
```bash
73-
sudo systemctl daemon-reload
74-
```
81+
### **1. Reload systemd to recognize the new service:**
7582

76-
### **2. Enable the service to start on boot:**
83+
```bash
84+
sudo systemctl daemon-reload
85+
```
7786

78-
```bash
79-
sudo systemctl enable freenet-gateway
80-
```
87+
### **2. Enable the service to start on boot:**
8188

89+
```bash
90+
sudo systemctl enable freenet-gateway
91+
```
8292

8393
### **3. Start the service:**
8494

85-
```bash
86-
sudo systemctl start freenet-gateway
87-
```
95+
```bash
96+
sudo systemctl start freenet-gateway
97+
```
8898

8999
### **4. Verify the service status:**
90100

91-
```bash
92-
sudo systemctl status freenet-gateway
93-
```
101+
```bash
102+
sudo systemctl status freenet-gateway
103+
```
94104

95105
---
96106

97107
## **6. Managing the Service**
98108

99109
### **1. View logs:**
100110

101-
```bash
102-
sudo journalctl -u freenet-gateway -f
103-
```
111+
```bash
112+
sudo journalctl -u freenet-gateway -f
113+
```
104114

105115
### **2. Restart the service:**
106116

107-
```bash
108-
sudo systemctl restart freenet-gateway
109-
```
117+
```bash
118+
sudo systemctl restart freenet-gateway
119+
```
110120

111121
### **3. Stop the service:**
112-
113-
```bash
114-
sudo systemctl stop freenet-gateway
115-
```
122+
123+
```bash
124+
sudo systemctl stop freenet-gateway
125+
```
116126

117127
---
118128

119129
## **7. Uninstalling the Service**
120130

121131
To remove the service:
122132

123-
```bash
124-
sudo systemctl stop freenet-gateway
125-
sudo systemctl disable freenet-gateway
126-
sudo rm /etc/systemd/system/freenet-gateway.service
127-
sudo rm /usr/local/bin/init-gateway.sh
128-
sudo systemctl daemon-reload
129-
```
133+
```bash
134+
sudo systemctl stop freenet-gateway
135+
sudo systemctl disable freenet-gateway
136+
sudo rm /etc/systemd/system/freenet-gateway.service
137+
sudo rm /usr/local/bin/init-gateway.sh
138+
sudo systemctl daemon-reload
139+
```

0 commit comments

Comments
 (0)